Geo-fence division method and related electronic equipment
In the geofencing division method, the extended first raster set is determined based on the target accuracy and grid size, and the geofen is calculated through the density clustering algorithm, the problem of insufficient accuracy caused by data isolation in the prior art is solved, and the user experience is improved.
Patent Information
- Application Number
- CN202311739509.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-15
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2043-12-15
AI Technical Summary
When the prior art divides geofences, data isolation is caused by rasterization processing, which cannot accurately reflect the actual geographical characteristics or user behavior patterns of the city, reducing the user experience.
By obtaining crowdsourced data of the raster map, the raster information of each raster is determined, and based on the target accuracy and raster size, the M first raster set corresponding to the target raster is determined, including the target raster and its associated (M-1) rasters. Then, based on these first raster sets, a plurality of first sets of dot data are determined, and the geofence is calculated by a density clustering algorithm.
The accuracy of geofences is improved, so that users can receive recommended services more accurately when entering the corresponding geographical area, improving the user experience.
Smart Images

Figure CN120201079A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data processing, and in particular, to a method for dividing a geographical fence and related electronic devices. Background Art
[0002] Geographical fence (Geo-fencing) is a new application based on Location Based Service (LBS). It uses a virtual fence to enclose a virtual geographical boundary. By collecting data of numerous users for clustering learning of geographical fences and mining of fence features, when a mobile phone enters, leaves, or moves within a specific geographical area, the mobile phone can receive automatic notifications and warnings, so as to provide convenient recommendation services for users in the corresponding geographical area. For example, for places where QR code payment is required, we can identify the timing of users' QR code scanning, collect corresponding geographical data, and cluster and learn the geographical fences where users are accustomed to QR code payment and the peak and off-peak payment time periods in each fence. Then, when the user goes to the QR code scanning location to make a payment or other operations next time, we can recommend a quick QR code scanning entry on the desktop to facilitate the user's payment scenario experience.
[0003] When clustering the crowdsourcing data of user points according to cities, the huge amount of data may lead to a serious time-consuming calculation process and even unable to obtain the calculated fence result. Therefore, the prior art usually adopts a rasterization processing method to divide the crowdsourcing data of the city into regular raster cells, and then cluster the data according to the raster. However, dividing the data according to the raster may lead to data isolation, that is, data belonging to the same category cannot be clustered uniformly because they are divided into different rasters, resulting in the same category of data being split into multiple categories. Therefore, the calculated geographical fence cannot accurately reflect the actual geographical features or user behavior patterns of the city, making users unable to accurately receive corresponding recommendation services in the corresponding geographical area, thus reducing the user experience. Summary of the Invention
[0004] Embodiments of this application provide a method for dividing a geographical fence and related electronic devices, which can improve the accuracy of the geographical fence divided based on a raster map to enhance the user experience.
[0005] In a first aspect, an embodiment of the present application provides a method for dividing a geographical fence. The method may include: obtaining crowdsourcing data of a grid map, where the crowdsourcing data includes dot data of service behaviors reported by a plurality of electronic devices; determining grid information of each grid in the grid map based on the crowdsourcing data, where the grid information includes grid size, grid identifier, and a set of dot data within the corresponding geographical area; determining M first grid sets corresponding to a target grid based on a target accuracy and the grid size of the target grid, where 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; where one extended grid corresponds to one first grid set, and one first grid set includes the corresponding extended grid and grids associated with the corresponding extended grid; determining a plurality of first dot data sets based on the M first grid sets corresponding to each target grid in the grid map, where one first grid set corresponds to one first dot data set; and determining the geographical fence of the grid map based on the plurality of first dot data sets corresponding to each target grid in the grid map.
[0006] In the embodiments of the present application, since the dotting data (i.e., crowdsourcing data) of the service behaviors reported by numerous electronic devices in the grid map is randomly distributed, there may be dotting data distributed on the boundary of any grid (i.e., the target grid) of the grid map and / or in the area of the adjacent grid close to the boundary of the target grid. These dotting data have a high similarity with the dotting data in the target grid and may be dotting data of the same type (e.g., dotting data with specific service behaviors). However, the existing method for dividing the geographical fence is to generate the geographical fence corresponding to the entire grid map based on the set of dotting data in each target grid of the grid map. The limitation of this method is that it does not consider the associated dotting data distributed on the boundary of each target grid and / or in the area of the adjacent grid close to the boundary of the target grid. And these dotting data may not be able to generate the corresponding geographical fence due to the small distribution amount and / or insufficient aggregation degree in other corresponding grids, resulting in low accuracy of the geographical fence generated by the geographical fence division method in the prior art and unable to accurately reflect the actual geographical features or user behavior patterns of the geographical area corresponding to the grid map. When users use the location service based on this geographical fence, they cannot receive the corresponding recommended service in a timely and accurate manner, reducing the experience. In the method for dividing the geographical fence in the embodiments of the present application, in the process of generating the corresponding geographical fence (i.e., the geographical fence of the grid map) based on the set of dotting data in the geographical area corresponding to all target grids in the grid map, all dotting data associated with the dotting data in the geographical area corresponding to the target grid (i.e., multiple first dotting data sets) are also considered. By taking the multiple first dotting data sets corresponding to each target grid in the grid map as an independent calculation entity, the geographical fences corresponding to all target grids are calculated. Specifically, in the embodiments of the present application, M extended grids corresponding to a target grid can be determined based on the original target grid, including the target grid and (M - 1) extended grids; each of the extended grids may include dotting data associated with the target grid. In order to facilitate the determination of the dotting data associated with the dotting data in the target grid in each extended grid, it is necessary to determine the grids associated with each extended grid (i.e., 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, so as to obtain M first grid sets based on the M extended grids.Therefore, the embodiment of the present application determines the M first grid sets corresponding to the target grid (that is, the target grid) based on the target accuracy and the grid size of any grid in the grid map (that is, the target grid), and then determines the dot data in the target grid and the set of all dot data associated with the dot data in the target grid (that is, multiple first dot data sets) based on the M first grid sets corresponding to each target grid in the grid map, and further determines the geographic fence of the grid map based on the multiple first dot data sets corresponding to each target grid in the grid map. In summary, in the process of dividing the geographic fence, the embodiment of the present application treats multiple first dot data sets corresponding to each target grid in the grid map as an independent calculation individual. Compared with the prior art of treating each target grid in the grid map as an independent calculation individual, the problem of dot data originally belonging to the same category in the grid map (for example, dot data with specific business behaviors) not being able to be calculated uniformly due to being divided into different grids is reduced as much as possible. Therefore, the geographic fence of the grid map determined by the embodiment of the present application can more accurately reflect the actual geographic features or user behavior patterns of the geographic area corresponding to the grid map, improve the accuracy of the geographic fence division, so that when the user enters the geographic area corresponding to the geographic fence, he can more accurately receive the corresponding recommended services to enhance the user experience.
[0007] In a possible implementation, the target accuracy is determined based on the size of an associated radius, and is used to indicate the desired accuracy of the geographic fence; the associated radius is a distance range used to determine whether the dot data are associated.
[0008] In the embodiment of the present application, the target accuracy is used to indicate the accuracy of the geo-fence to be generated, and the target accuracy can be determined by the size of the associated radius; further, since the associated radius can be used to determine the distance range of whether the dot data are associated, that is, when the dot data in the grid map are divided into geo-fences, if the distance between two dot data is within the range of the associated radius, it is considered that the two dot data are associated. Exemplarily, the larger the associated radius, the larger the distance between the dot data associated with the dot data in the geographical area corresponding to the target grid and the grid boundary of the target grid, and the larger the range of the determined geo-fence, and accordingly, the smaller the associated radius, the smaller the range of the geo-fence; and the range of the geo-fence is too large or too small, it will affect the accuracy of the geo-fence, so selecting a suitable associated radius can make the generated geo-fence achieve the desired target accuracy, and can more accurately reflect the actual geographical features or user behavior patterns of the geographical area corresponding to the grid map, so as to provide more accurate recommendation services based on the geo-fence to improve the user experience.
[0009] In a possible implementation, the determining of the M first grid sets corresponding to the target grid based on the target accuracy 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 is a row and column range where a specific grid in the M first grid sets is located; based on the first row and column range, determining the M first grid sets corresponding to the target grid.
[0010] How the embodiments of the present application determine the M first grid sets corresponding to the target grid based on the expected accuracy of the geo-fence (i.e., target accuracy) and the grid size of any grid in the grid map (i.e., target grid) may specifically include: determining the row and column range (i.e., the first row and column range) of the specific grid in the M first grid sets corresponding to the target grid based on the associated radius of the distance range used to determine whether the dot data are associated and the grid size of any grid in the grid map (i.e., target grid); for example, when the specific grid corresponding to the target grid is the grid located in the upper left corner of the M first grid sets, the first row and column range is the row and column range of the grid located in the upper left corner of the M first grid sets corresponding to the target grid; further, based on the first row and column range, the M first grid sets corresponding to the target grid are determined. Since the expected accuracy of the geographic fence (i.e., the target accuracy) can be determined by the size of the associated radius of the distance range used to determine whether the dot data are associated, the embodiment of the present application can determine the row and column range (i.e., the first row and column range) of the specific grid in the M first grid sets corresponding to the target grid through the associated radius and the grid size of any grid (i.e., the target grid) in the grid map, and further determine the M first grid sets corresponding to the target grid, so as to determine the dot data set (i.e., the first row and column range) in the geographic area corresponding to the M first grid sets through the M first grid sets corresponding to each target grid in the grid map. is a plurality of first dot data sets), and further based on the plurality of first dot data sets corresponding to each target grid in the grid map, the geographic fence of the grid map is calculated, so that the geographic fence can achieve the desired accuracy (i.e., the target accuracy) while avoiding as much as possible the problem that the same type of dot data in the grid map is divided into different grids and calculated separately, resulting in the geographic fence being unable to accurately reflect the actual geographic features or user behavior patterns of the geographic area corresponding to the grid map, thereby improving the accuracy of the geographic fence division, so that when the user enters the geographic area corresponding to the geographic fence, the user can more accurately receive the corresponding recommendation service to enhance the user experience.
[0011] In a 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 extended number of rows and columns; wherein the first row and column range includes the maximum row and column value and the minimum row and column value of the specific grid, and the specific grid is a grid at a specific position of each first grid set in the M first grid sets.
[0012] In the embodiment of the present application, how to determine the row and column range (that is, the first row and column range) where a specific grid in the M first grid sets corresponding to the target grid is located, based on the association radius of the distance range used to determine whether the dot data is associated and the grid size of any grid in the grid map (that is, the target grid), for example, the row and column range where the grid located in the upper left corner in the M first grid sets corresponding to the target grid is located, can specifically include: first, based on the association radius and the grid size of the target grid, determining the number of expanded rows and columns of the target grid, and further based on the row and column position of each target grid, after expanding the expanded number of rows and columns respectively, the first grid range can be determined, that is, the maximum row and column value and the minimum row and column value of the grid at the specific position of each first grid set in the M first grid sets corresponding to each target grid (for example, the grid located at the upper left corner), wherein the grid at the specific position of each first grid set can also be a grid at other positions in the first grid set, which is not limited in the embodiment of the present application. Through the embodiment of the present application, based on the associated radius and the grid size of any grid (i.e., the target grid) in the grid map and the row and column position of the target grid, the row and column range (i.e., the first row and column range) of the specific grid in the M first grid sets corresponding to the target grid can be determined, so as to calculate the M first grid sets corresponding to the target grid based on the first row and column range, further determine the dot data sets (i.e., multiple first dot data sets) in the geographical area corresponding to all grids in each first grid set in the M first grid sets, and then for the grid map, Multiple first dot data sets corresponding to each target grid are used to calculate the geographic fence of the grid map, so that the geographic fence can achieve the desired accuracy (i.e., target accuracy) while avoiding as much as possible the problem that the same type of dot data in the grid map is divided into different grids and calculated separately, resulting in the geographic fence not being able to accurately reflect the actual geographic features or user behavior patterns of the geographic area corresponding to the grid map. The accuracy of the geographic fence division is improved, so that when the user enters the geographic area corresponding to the geographic fence, the user can more accurately receive the corresponding recommendation service to enhance the user experience.
[0013] In a 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 the second row and column range; 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; determining M first set identifiers based on the second row and column range; the first set identifier is used to indicate a first grid set among the M first grid sets.
[0014] How the embodiment of the present application determines the M first grid sets corresponding to the target grid based on the row and column range (that is, the first row and column range) where a specific grid is located in the M first grid sets corresponding to the target grid may specifically include: first, for the maximum row and column value and the minimum row and column value of the grid at a specific position of each first grid set in the M first grid sets corresponding to each target grid (for example, the grid at the upper left corner), traverse from the minimum row and column value to the maximum row and column value to determine the maximum row and column value and the minimum row and column value of the first grid set where the grid at each specific position is located, that is, the maximum row and column value and the minimum row and column value of all grids in each first grid set in the M first grid sets corresponding to the target grid (that is, the second row and column range); further, based on the second row and column range, determine M first set identifiers that can be used to indicate a first grid set in the M first grid sets corresponding to the target grid, so that the target grid can be determined based on the first set identifier. Each first grid set in the corresponding M first grid sets is used to determine the dot data set (that is, multiple first dot data sets) in the geographical area corresponding to all grids in each first grid set in the M first grid sets based on the M first grid sets corresponding to each target grid in the grid map, and then the geographical fence of the grid map is further calculated for the multiple first dot data sets corresponding to each target grid in the grid map, so that the geographical fence can achieve the expected accuracy (that is, the target accuracy) while avoiding as much as possible the problem that the same type of dot data in the grid map is divided into different grids and calculated separately, resulting in the geographical fence not being able to accurately reflect the actual geographical features or user behavior patterns of the geographical area corresponding to the grid map, thereby improving the accuracy of the geographical fence division, so that when the user enters the geographical area corresponding to the geographical fence, the corresponding recommendation service can be received more accurately to enhance the user experience.
[0015] In a possible implementation, the method further includes: preprocessing 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 dotting 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, and is used to indicate the M first grid sets corresponding to each target grid.
[0016] In the embodiment of the present application, by preprocessing the grid information of each target grid in the grid map, a first information list including the grid identifier of each target grid, the set of dotting data in the corresponding geographical area, and the second set identifier that can be used to indicate the M first grid sets corresponding to each target grid is obtained, so as to quickly determine the grid identifier of each target grid in the grid map, the set of dotting data in the corresponding geographical area, and the corresponding M first grid sets based on the first information list, and further determine the set of dotting data (that is, multiple first dotting data sets) in the geographical 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 geographical fence of the grid map.
[0017] In a possible implementation, determining multiple first dotting 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, expand the grid identifier of the grid involved in each first set identifier, the set of dotting data in the corresponding geographical area, and the second set identifier involved, to obtain a second information list; merge the sets of dotting data in the corresponding geographical areas of the grids involved in 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 dotting data sets; wherein, the multiple first dotting data sets include the dotting data in the corresponding geographical areas of one or more grids involved in one merged first set identifier.
[0018] How the embodiments of the present application determine the set of dot data (i.e., multiple sets of first dot data) in the geographical area corresponding to the M sets of first grids corresponding to each target grid in the grid map may specifically include: First, 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 identifiers that can be used to indicate the M sets of first grids corresponding to each target grid, expand the set of dot data in the geographical area corresponding to the grids involved in each first set identifier to obtain a second information list; Then, merge the sets of dot data in the geographical 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 sets of first dot data, where the multiple sets of first dot data include the dot data in the geographical area corresponding to one or more grids involved in one merged first set identifier. Since for different target grids in the grid map, one of the M extended grids associated with an extended grid (i.e., the set of first grids) may be the same, there are a large number of identical sets of first dot data among the multiple sets of first dot data determined based on the M sets of first grids corresponding to each target grid in the grid map. Therefore, through the embodiments of the present application, the multiple sets of first dot data corresponding to each target grid after merging the identical sets of first dot data can be obtained (i.e., the set of dot data in the geographical area corresponding to one or more grids involved in each merged first set identifier in the third information list), so as to reduce the number of the multiple sets of first dot data corresponding to each target grid in the grid map, and reduce the complexity of calculating the geographical fence of the grid map. In addition, the embodiments of the present application can quickly determine the set of dot data (i.e., multiple sets of first dot data) in the geographical area corresponding to each first grid in the M sets of first grids corresponding to each target grid by querying the third information list, without having to query the set of dot data in the geographical area corresponding to other grids adjacent to the target grid each time, thereby effectively reducing the number of interaction behaviors of database table queries and reducing the calculation burden.
[0019] In a possible implementation, determining the geographical fence of the grid map based on the multiple first dot data sets corresponding to each target grid in the grid map may include: calculating a target geographical fence through a density-based clustering algorithm based on the multiple first dot data sets corresponding to each target grid in the grid map; the target geographical fence includes the geographical fence within the geographical 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; determining the geographical fence of the grid map based on the target geographical fence.
[0020] In the embodiments of the present application, how to determine the geographical fence of the grid map based on the dot data set (i.e., multiple first dot data sets) within the geographical area corresponding to one of the M first grid sets corresponding to each target grid in the grid map specifically may include: First, for the dot data set (i.e., multiple first dot data sets) within the geographical area corresponding to one of the M first grid sets corresponding to each target grid in the grid map, through a density-based clustering algorithm, such as the K-means method or the Density-Based Spatial Clustering of Applications with Noise (DBSCAN) method, calculate a target geographical fence that includes the geographical fence within the geographical 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. Further, determine the geographical fence of the grid map based on the target geographical fence. Through the embodiments of the present application, first perform density-based clustering algorithm calculation on the multiple first dot data sets corresponding to each target grid in the grid map. Since the amount of data calculated is small, it is easier to calculate the target geographical fence, reducing the complexity of the calculation. At the same time, the calculation for the entire grid map can be decomposed into calculations for partial grids, which is conducive to achieving parallel calculation to obtain the target geographical fence that includes the geographical fence within the geographical 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, reducing the time consumption in the calculation process to improve the calculation efficiency. In addition, since different regions may have different geographical attributes and / or data distributions, the geographical fence of the grid map determined based on the target geographical fence obtained through local calculation can cover the entire area of the grid map and more accurately reflect the actual geographical features or user behavior patterns of each area of the grid map, improving the accuracy of geographical fence division, so that when the user enters the geographical area corresponding to the geographical fence, they can more accurately receive corresponding recommended services to enhance the user experience.
[0021] In a possible implementation, the target geographic fence calculated by a density-based clustering algorithm based on each of the multiple first dot data sets corresponding to each target grid in the grid map includes: calculating grid codes of core grids in a corresponding first grid set according to each merged first set identifier in the third information list; obtaining a second dot data set based on the grid codes of each core grid; the second dot data set includes dot data within the geographic area corresponding to each core grid; by traversing the dot data in the second dot data set, determining associated dot data for each dot data based on the association radius; determining a third dot data set based on the second dot data set and the associated dot data; the third dot data set includes dot data within the geographic area corresponding to each core grid and the corresponding associated dot data; by performing learning of the density-based clustering algorithm on all the dot data in the third dot data set, calculating the target geographic fence.
[0022] The embodiment of the present application is about how to calculate the target geographic fence through a density-based clustering algorithm based on a dot data set in a geographic area corresponding to one of the M first grid sets corresponding to each target grid in the grid map (that is, multiple first dot data sets), and specifically may include: first, according to each merged first set identifier in the above-mentioned third information list, calculating the grid code of the core grid in the corresponding first grid set; and then, based on the calculated grid code of each corresponding core grid in the first grid set, obtaining a second dot data set including the dot data in the geographic area corresponding to each core grid. Furthermore, by traversing the dot data in the second dot data set, the associated dot data of each dot data is determined based on the associated radius of the distance range used to determine whether the dot data are associated, and further based on the second dot data set and the determined associated dot data, a third dot data set including the dot data in the geographic area corresponding to each core grid and the corresponding associated dot data is determined, and finally, by performing density-based clustering algorithm learning on all the dot data in the third dot data set, such as the K-means method or the DBSCAN method, a target geographic fence is calculated, including the same first grid set in the M first grid sets corresponding to each target grid, and the target geographic fence in the geographic area corresponding to all grids in each first grid set is obtained. Through the embodiment of the present application, since the third information list includes the dot data set in the corresponding geographic area of one or more grids involved in the merged first set identifier, and each merged first set identifier is determined based on the maximum row and column values and the minimum row and column values of all grids in the corresponding first grid set, the grid code of the core grid can be determined by the maximum row and column values and the minimum row and column values of all grids in the corresponding first grid set, thereby determining the dot data in the corresponding geographic area of each core grid to obtain a second dot data set; then traverse the dot data in the second dot data set, determine the associated dot data associated with each dot data through the associated radius, and obtain a third dot data set including the dot data in the corresponding geographic area of each core grid and the corresponding associated dot data, and finally obtain the target geographic fence by performing density-based clustering algorithm learning on all the dot data in the third dot data set.Since the amount of data for geofence calculation for all the data in the third dot data set is small, it is easier to calculate the target geofence, reducing the complexity of the calculation. At the same time, the geofence calculation for the dot data of the entire raster map can be decomposed into the calculation for the dot data and the corresponding associated dot data within the geographical area corresponding to each target raster, which is conducive to achieving parallel calculation simultaneously to obtain the target geofences within the geographical areas corresponding to all the rasters in each of the M first raster sets after combining the same first raster sets corresponding to each target raster, reducing the time consumption in the calculation process to improve the calculation efficiency. In addition, since different regions may have different geographical attributes and / or data distributions, the geofence of the raster map determined based on the target geofence obtained through local calculation can cover the entire area of the raster map and can more accurately reflect the actual geographical features or user behavior patterns of each region of the raster map, improving the accuracy of geofence division, so that when the user enters the geographical area corresponding to the geofence, the user can more accurately receive the corresponding recommended services to enhance the user experience.
[0023] In a possible implementation manner, determining the geofence of the raster map based on the target geofence includes: by traversing each target geofence in the target geofences, determining whether the center point of the target geofence is located in the core raster of the corresponding first raster set; if so, retaining the target geofence; if not, deleting the target geofence; and combining the retained target geofences to obtain the geofence of the raster map.
[0024] In the embodiment of the present application, since the dot data set (i.e., multiple first dot data sets) in the geographical area corresponding to one of the M first grid sets corresponding to each target grid in the grid map, the target geographical fences determined by the density-based clustering algorithm may be repeated. Therefore, determining the geographical fence of the grid map based on the target geographical fence may specifically include: first, by traversing each target geographical fence, determining whether the center point of the target geographical fence 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, and then retaining the target geographical fences whose center points are located in the core grids of the corresponding first grid sets to remove the duplicate geographical fences in the target geographical fences. Finally, generating the geographical fence of the grid map based on the retained target geographical fences. By removing the duplicate geographical fences in the target geographical fences, the embodiment of the present application makes the process of generating the geographical fence of the grid map based on the target geographical fence more concise and efficient, improves the generation efficiency of the geographical fence on the premise that the generated geographical fence can cover the entire area of the grid map. At the same time, the core grid may contain key resources or business centers. Therefore, only retaining the geographical fences whose center points are located in the core grids can more specifically focus on important areas and ignore secondary areas, enabling the generated geographical fence to more accurately reflect the actual geographical features or user behavior patterns of each area of the grid map, improving the accuracy of geographical fence division, and enabling users to more accurately receive corresponding recommended services when entering the geographical area corresponding to the geographical fence, thereby enhancing the user experience.
[0025] In a second aspect, the embodiment of the present application provides a device for dividing geographical fences, which may include:
[0026] A first acquisition unit, configured to acquire crowdsourcing data of a grid map, where the crowdsourcing data includes dot data of business behaviors reported by a plurality of electronic devices;
[0027] A first determination unit, configured to determine grid information of each grid in the grid map based on the crowdsourcing data, where the grid information includes grid size, grid identifier, and a set of dot data in the corresponding geographical area;
[0028] A second determination unit, configured to determine M first grid sets corresponding to the target grid based on a target accuracy and the grid size of the target grid, where 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; where 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] A third determination unit, configured to determine a plurality of first dot data sets based on the M first grid sets corresponding to each of the target grids in the grid map, where one first grid set corresponds to one first dot data set;
[0030] A fourth determination unit, configured to determine a geographical fence of the grid map based on the plurality of first dot data sets corresponding to each of the target grids in the grid map.
[0031] In the geographical fence partitioning device in the embodiments of the present application, first, a first acquisition unit acquires crowdsourcing data including dot data of service behaviors reported by a large number of electronic devices in a grid map, and then a first determination unit determines grid information such as the grid size, grid identifier, and the set of dot data in the corresponding geographical area of each grid in the grid map based on the acquired crowdsourcing data. Further, a second determination unit determines M first grid sets corresponding to a target grid based on the target accuracy and the grid size of any grid (i.e., the target grid) in the grid map. Among them, 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 grids associated with one of the M extended grids, and M is a positive integer. Still further, a third determination unit determines a plurality of first dot data sets based on the M first grid sets corresponding to each target grid in the grid map, where one first grid set corresponds to one first dot data set. Finally, a fourth determination unit determines a geographical fence of the grid map based on the plurality of first dot data sets corresponding to each target grid in the grid map. In the embodiments of the present application, by taking the plurality of first dot data sets corresponding to each target grid in the grid map as an independent calculation entity, compared with the prior art where each target grid in the grid map is taken as an independent calculation entity, the problem that dot data originally belonging to the same category in the grid map (such as dot data with similar service behaviors) cannot be uniformly calculated because they are divided into different grids is reduced as much as possible. Therefore, the geographical fence of the grid map determined through the embodiments of the present application can more accurately reflect the actual geographical features or user behavior patterns of the geographical area corresponding to the grid map, improve the accuracy of geographical fence partitioning, and enable users to more accurately receive corresponding recommended services when entering the geographical area corresponding to the geographical fence, thereby enhancing the user experience.
[0032] In a possible implementation manner, the target accuracy is determined based on the size of an association radius, and is used to indicate the desired accuracy of the geographical fence; the association radius is a distance range used to determine whether dot data is associated.
[0033] In a possible implementation manner, the second determining unit is specifically configured to:
[0034] Determine 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 is the row and column range where a specific grid in the M first grid sets is located;
[0035] Based on the first row and column range, M first grid sets corresponding to the target grid are determined.
[0036] In a possible implementation manner, the second determining unit is specifically configured to:
[0037] Determining the number of expanded rows and columns of the target grid based on the associated radius and the grid size of the target grid;
[0038] The first row and column range is determined based on the row and column position of the target grid and the number of expanded rows and columns; wherein the first row and column range includes the maximum row and column value and the minimum row and column value of the specific grid, and the specific grid is the grid at a specific position of each first grid set in the M first grid sets.
[0039] In a possible implementation manner, the second determining unit is specifically configured to:
[0040] Traversing from the minimum row and column value of the specific grid to the maximum row and column value of the specific grid, determining a second row and column range; the second row and column range includes the maximum row and column values and the minimum row and column values 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 a first grid set among the M first grid sets.
[0042] In a possible implementation, the geographic fence division device further includes:
[0043] The fifth determination 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 dot 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 a possible implementation manner, the third determining unit is specifically configured to:
[0045] Based on the first information list, for each of the first set identifiers in the second set identifier, expand the grid identifiers of the grids involved in each of the first set identifiers, the set of dotting data within the corresponding geographical area, and the second set identifiers involved, to obtain a second information list;
[0046] Merge the sets of dotting data within the geographical areas corresponding to the grids involved in 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 dotting data sets; wherein, the multiple first dotting data sets include the dotting data within the geographical areas corresponding to one or more grids involved in one of the merged first set identifiers.
[0047] In a possible implementation manner, the fourth determination unit is specifically configured to:
[0048] Based on the multiple first dotting data sets corresponding to each of the target grids in the grid map, calculate a target geographical fence through a density-based clustering algorithm; the target geographical fence includes the geographical fences within the geographical areas corresponding to all the grids in each first grid set after merging the same first grid sets in the M first grid sets corresponding to each of the target grids;
[0049] Determine the geographical fence of the grid map based on the target geographical fence.
[0050] In a possible implementation manner, the fourth determination unit is specifically configured to:
[0051] Calculate the grid codes of the core grids in the corresponding first grid sets according to each of the merged first set identifiers in the third information list;
[0052] Based on the grid codes of each of the core grids, obtain a second dotting data set; the second dotting data set includes the dotting data within the geographical areas corresponding to each of the core grids;
[0053] By traversing the dotting data in the second dotting data set, determine the associated dotting data of each dotting data based on the association radius;
[0054] Determine a third dotting data set based on the second dotting data set and the associated dotting data; the third dotting data set includes the dotting data within the geographical areas corresponding to each of the core grids and the corresponding associated dotting data;
[0055] Through performing the density-based clustering algorithm learning on all the dotting data in the third dotting data set, calculate the target geographical fence.
[0056] In a possible implementation, the fourth determining unit is specifically configured to:
[0057] By traversing each target geofence in the target geofences, determine whether the center point of the target geofence is located in the core grid of the corresponding first grid set;
[0058] If so, retain the target geofence;
[0059] If not, delete the target geofence;
[0060] Merge the retained target geofences to obtain the geofence of the grid map.
[0061] In a third aspect, an embodiment of the present application provides an electronic device, which 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, so that the routing device executes the method according to any one of the possible implementation manners in the first aspect above.
[0062] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and the computer program is executed by the processor to implement the method according to any one of the possible implementation manners in the first aspect above.
[0063] In a fifth aspect, an embodiment of the present application provides a computer program, the computer program includes instructions, and the computer program is executed by a computing device to implement the method according to any one of the possible implementation manners in the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 is a schematic hardware structure diagram of an electronic device provided by an embodiment of the present application.
[0065] Figure 2 is a schematic software structure diagram of the electronic device 100 provided by an embodiment of the present application.
[0066] Figure 3 is a schematic diagram of a grid map based on crowdsourcing data provided by an embodiment of the present application.
[0067] Figure 4 is a schematic diagram of an application scenario of a geofence divided based on a grid map in the prior art.
[0068] Figure 5 is a flowchart example diagram of a method for dividing a geofence provided by an embodiment of the present application.
[0069] Figure 6It is a specific process example diagram of another method for dividing a geofence provided by an embodiment of the present application.
[0070] Figure 7 It is a schematic diagram of determining M first grid sets corresponding to a target grid based on the target grid provided by an embodiment of the present application.
[0071] Figure 8 It is a schematic diagram of an application scenario of a geofence divided based on a grid map provided by an embodiment of the present application.
[0072] Figures 9A - 9C It is a schematic diagram of an interface for some users to use a geofence divided based on a grid map provided by an embodiment of the present application.
[0073] Figure 10 It is a schematic diagram of the structure of a device for dividing a geofence provided by an embodiment of the present application.
[0074] Figure 11 It is a schematic diagram of the hardware structure of another electronic device provided by an embodiment of the present application. Detailed implementation manners
[0075] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The mention of "embodiment" in this article means that the specific features, structures, or characteristics described in conjunction with the embodiment can be included in at least one embodiment of the present application. The phrase does not necessarily refer to the same embodiment at various positions in the specification, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art can explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present application.
[0076] The terms "first", "second", "third", etc. in the specification, claims, and drawings of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a series of steps or units are included, or optionally, steps or units not listed are also included, or optionally, other steps or units inherent in these processes, methods, products, or devices are also included.
[0077] In the following embodiments of this application, the term "user interface (UI)" is a media interface for interaction and information exchange between an application or an operating system and a user. It realizes the conversion between the internal form of information and the form acceptable to the user. The user interface is source code written in specific computer languages such as Java and Extensible Markup Language (XML). The interface source code is parsed and rendered on an electronic device and finally presented as content recognizable by the user. The common manifestation form of the user interface is the graphical user interface (GUI), which refers to the user interface related to computer operations displayed in a graphical way. It can be visual interface elements such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and Widgets displayed on the display 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 the embodiments of this application. For example, the electronic device can be a mobile phone, and can also include a tablet computer, a desktop computer, a desktop computer with a touch-sensitive surface or a touch panel, a laptop, a handheld computer, a notebook computer, a smart screen, a wearable device (such as a smart watch, a smart bracelet, etc.), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a car machine, a smart headset, a game console, and can also be an Internet of Things (IOT) device or a smart home device such as a smart water heater, a smart lamp, a smart air conditioner, etc.
[0079] Only parts related to this application rather than all content are shown in the drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the operations (or steps) as sequential processes, many of the operations can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the operations can be rearranged. The process can be terminated when its operations are completed, but it can also have additional steps not included in the drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
[0080] As used in this specification, terms such as "component", "module", "system", "unit", etc. are used to represent 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, an execution thread, a program, and / or distributed between two or more computers. In addition, these units can be executed from various computer-readable media storing various data structures. A unit can communicate, for example, through local and / or remote processes via a signal having one or more data packets (e.g., data from a second unit interacting with a local system, a distributed system, and / or another unit between networks. For example, the Internet interacting with other systems through a signal).
[0081] First, some terms used in this application are explained to facilitate understanding of the embodiments of this application by those skilled in the art.
[0082] (1) A Raster Map (RM) is an electronic map that represents geospatial information based on a raster. In a raster map, the map is divided into multiple regular rectangular areas (geographical rasters), and each raster contains information about that area.
[0083] (2) Crowdsourcing data (referred to as crowdsourcing for short) refers to the data points 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 leaving subway stations, business behaviors of entering and leaving express delivery stations, business behaviors of entering and leaving high-speed railway stations, business behaviors of entering and leaving airports, and business behaviors of entering and leaving shopping malls, etc.
[0084] (3) Data points refer to the changes caused by user operations recorded, providing business data information for the data reported by electronic devices for development, product, and operation and maintenance analysis. In map or spatial analysis, these data may represent specific locations on the actual geographical location, the coordinates where events occur, the positions of devices, or any other location information that can be represented by coordinate values.
[0085] (4) Clustering algorithms are a class of machine learning algorithms whose main goal is to divide the samples in a data set into several groups so that the samples within the same group have a high degree of similarity, while the samples between different groups have a low degree of similarity. The goal of clustering is to discover natural and implicit group structures in the data in order to better understand the characteristics and distributions of the data.
[0086] (5) The K-means method is an iterative algorithm that divides a data set into K clusters, where K is a parameter specified by the user. The core idea of this algorithm is to iteratively assign samples to clusters and update the centers of the clusters until convergence.
[0087] (6) The Density-Based Spatial Clustering of Applications with Noise (DBSCAN) method is a density-based clustering algorithm. DBSCAN defines a cluster as the largest set of density-connected points, can divide regions with sufficiently high density into clusters, and can discover clusters of arbitrary shapes in a spatial database with noise.
[0088] (7) A geofence is a virtual geographical area boundary, usually a defined area on a map, used to trigger specific events or operations related to that area. This technology mainly uses the Global Positioning System (GPS) and other location services to achieve.
[0089] To facilitate the introduction of the technical problems to be solved by this application and the application scenarios, the electronic devices involved in the embodiments of this application are introduced first.
[0090] Please refer to Figure 1 , Figure 1 which is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of this application. The electronic device 100 can be used to execute the geofence division method in the prior art and the geofence division method provided by the embodiments of this application. 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, an antenna 1, an 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 interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. Among them, the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light 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] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.
[0092] The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor, etc.
[0093] The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example, the antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0094] The mobile communication module 150 can provide solutions for wireless communications such as 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves by the antenna 1, filter, amplify, etc. the received electromagnetic waves, and transmit them to the 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 through the antenna 1 and radiate it out. In some embodiments, at least some functional modules of the mobile communication module 150 may be disposed 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 disposed in the same device.
[0095] The wireless communication module 160 may provide solutions for wireless communications applied to the electronic device 100, including wireless local area networks (WLANs) (such as Wi-Fi networks), Bluetooth (BT), BLE broadcasts, global navigation satellite systems (GNSSs), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 may also receive the signals to be sent from the processor 110, perform frequency modulation and amplification on them, and convert them into electromagnetic waves through the antenna 2 for radiation. In the embodiments of the present application, the wireless communication module 160 may receive information from the base station, so that the electronic device can establish a geofence based on the obtained base station information.
[0096] The electronic device 100 implements the display function through the GPU, the display screen 194, and the application processor, etc. 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. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
[0097] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel may adopt 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 Miniled, a MicroLed, a Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than 1.
[0098] The electronic device 100 can implement the shooting function through the ISP, camera 193, video codec, GPU, display screen 194, application processor, etc.
[0099] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and the light passes through the lens and is transmitted to the camera photosensitive element. The optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also optimize the noise and brightness of the image through algorithms. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be provided in the camera 193.
[0100] In the embodiment of the present application, the camera 193 can be turned on after the electronic device turns on the QR code scanning function, and can obtain the preview image in real time and display the preview image on the display screen 194.
[0101] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc.
[0102] The NPU is a neural-network (NN) computing processor. By learning from the biological neural network structure, for example, learning from the transmission mode between human brain neurons, it can quickly process the input information and can also continuously self-learn. Through the NPU, applications such as intelligent cognition of the electronic device 100 can be realized, such as: image recognition, face recognition, voice recognition, text understanding, etc.
[0103] The external memory 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 memory interface 120 to implement the data storage function. For example, files such as music and videos are saved in the external memory card.
[0104] The internal memory 121 can be used to store computer-executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 can include a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.). The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.). In addition, the internal memory 121 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0105] The electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor, etc. For example, music playback, recording, etc.
[0106] The audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be disposed in the processor 110, or some functional modules of the audio module 170 can be disposed in the processor 110.
[0107] The speaker 170A, also known as a "loudspeaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or hands-free calls through the speaker 170A.
[0108] The receiver 170B, also known as a "handset", is used to convert an audio electrical signal into a sound signal. When the electronic device 100 answers a call or a voice message, the voice can be listened to by bringing the receiver 170B close to the human ear.
[0109] The microphone 170C, also known as a "microphone" or "transmitter", is used to convert a sound signal into an electrical signal. When making a call or sending a voice message, the user can speak by bringing the mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In some other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also implement a noise reduction function. In some other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to implement functions such as collecting sound signals, noise reduction, identifying the sound source, and implementing a directional recording function.
[0110] The headphone jack 170D is used to connect a wired headphone. The headphone jack 170D can be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0111] The pressure sensor 180A is used to sense pressure signals and can convert the pressure signals into electrical signals. In some embodiments, the pressure sensor 180A can be disposed on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can include at least two parallel plates with conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device 100 can also calculate the position of the touch according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations with the same touch position but different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, the instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, the instruction to create a new short message is executed.
[0112] The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100.
[0113] The barometric pressure sensor 180C is used to measure the barometric pressure. In some embodiments, the electronic device 100 calculates the altitude according to the barometric 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 leather case.
[0115] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.
[0116] The 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 ambient light sensor 180L is used to sense the ambient light brightness.
[0119] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint answering of incoming calls, etc.
[0120] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 executes a temperature processing strategy using the temperature detected by the temperature sensor 180J.
[0121] The touch sensor 180K, also known as the "touch panel". The touch sensor 180K can be disposed on the display screen 194, and together with the display screen 194 forms a touch screen, also known as the "touch screen". The touch sensor 180K is used to detect touch operations acting thereon or nearby. 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 the display screen 194. In some other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, at a different position from the 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 of the vibrating bone mass of the human vocal part. The bone conduction sensor 180M can also contact the human pulse to receive blood pressure pulsation signals. In some embodiments, the bone conduction sensor 180M can also be disposed in the earphone to form a bone conduction earphone. The audio module 170 can parse out voice signals based on the vibration signals of the vibrating bone mass of the vocal part acquired by the bone conduction sensor 180M to implement the voice function. The application processor can parse out heart rate information based on the blood pressure pulsation signals acquired by the bone conduction sensor 180M to implement the heart rate detection function.
[0123] The keys 190 include a power-on key, volume keys, etc. The keys 190 can be mechanical keys. They can also be touch keys. The electronic device 100 can receive key inputs and generate key signal inputs related to the user settings and function controls of the electronic device 100.
[0124] The motor 191 can generate vibration prompts. The motor 191 can be used for vibration prompts for incoming calls and also for touch vibration feedback. For example, touch operations for different applications (such as taking pictures, playing audio, etc.) can correspond to different vibration feedback effects. For touch operations on different regions of the display screen 194, the motor 191 can also correspond to different vibration feedback effects. Different application scenarios (such as time reminder, receiving messages, alarm clock, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0125] The indicator 192 can be an indicator light and can be used to indicate the charging status, power change, and can also be used to indicate messages, missed calls, notifications, etc.
[0126] The SIM card interface 195 is used to connect the SIM card. The SIM card can be inserted into or pulled out from the SIM card interface 195 to achieve contact and separation from the electronic device 100. The electronic device 100 can support 1 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 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to achieve functions such as calls and data communication. In some embodiments, the electronic device 100 uses an eSIM, that is, 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 the electronic device 100 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. In the embodiments of the present invention, the Android system with a layered architecture is taken as an example to exemplarily illustrate the software structure of the electronic device 100. Figure 2 It is a schematic diagram of the software structure of the electronic device 100 provided by the embodiments of the present application. The layered architecture divides the software into several layers, and each layer has 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, namely the application layer, the application framework layer, the Android runtime and the system libraries, and the kernel layer.
[0128] The application layer can include a series of application packages. As Figure 2 shown, the application packages can include applications such as cameras, galleries, calendars, calls, maps, navigation, music, geofence recognition applications, service recommendation applications, etc.
[0129] Among them, the geofence recognition application is used to determine whether a geofence is triggered, and the service recommendation application is used to trigger the geofence of the corresponding service type according to the instruction sent by the geofence recognition application.
[0130] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the 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 wifi 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 through information such as the signal strength and time delay between the electronic device and multiple base stations, and send the location information of the determined current location of the electronic device to the geofence recognition module.
[0132] The positioning module is used to obtain the geographical location information (for example, longitude and latitude) of the current location.
[0133] The Wifi module is used to scan the Wifi information of the current location.
[0134] The phone manager is used to provide the communication function of the electronic device 100. For example, the management of call status (including answering, hanging up, etc.).
[0135] The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, etc.
[0136] The notification manager enables the application to display notification information in the status bar, can be used to convey notification-type messages, can disappear automatically after a short stay without user interaction. For example, the notification manager is used to inform that the download is completed, message reminder, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as the notification of a background-running application, and can also be a notification that appears on the screen in the form of a dialogue window. For example, prompt text information in the status bar, emit a prompt sound, the electronic device vibrates, the indicator light flashes, etc.
[0137] Android Runtime includes a core library and a virtual machine. Android runtime is responsible for the scheduling and management of the Android system.
[0138] The core library contains two parts: one part is the functional functions that need to be called by the Java language, and the other part is the core library of Android.
[0139] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0140] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0141] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0142] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[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 drawing engine for 2D drawings.
[0145] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
[0146] Based on the above Figures 1 - 2 With reference to the related description of the hardware structure and software structure of the electronic device 100, a grid map applicable to the geographic fence division method provided in the prior art and the embodiment of the present application is exemplarily introduced below.
[0147] See also Figure 3 , Figure 3 A schematic diagram of a grid map based on crowdsourced data provided in an embodiment of the present application. Figure 3 As shown, the grid map divides a certain range of geographical areas into multiple geographical grids (hereinafter referred to as grids in the present application embodiment), and each grid contains dot data of different locations and different service types collected in the corresponding geographical area. When a geographical fence is generated based on the grid map, all dot data contained in the grid map can be dot data of specific business behaviors reported by a large number of electronic devices (each dot data corresponds to Figure 3a point in it), that is, crowdsourced point data. The grid information of each grid can include the grid size, grid identifier, and a set of point data within the corresponding geographical area. Among them, the grid size is the size of the geographical range corresponding to each grid, usually divided by length units such as meters or kilometers, and its length is related to the resolution of the grid map; the grid identifier can be a code corresponding to each grid (for example, 1 to 36), and the set of point data within the geographical area corresponding to each grid can include the service tag (TagID) of the point data, the time information of the point, and the geographical location information of the point. Among them, there are different types of point data, and the service tags of different types of point data are different. Correspondingly, the generated geographical fences will also be different. Exemplarily, for the point data of the ride service, it can include the swiping time of the ride code, the geographical location information of the swiping location of the ride code, and the service tag of the ride code. For the point data of the venue code service, it can include the scanning time of the venue code, the geographical location information of the scanning location of the venue code, and the service tag of the venue code. For the point data of the payment service, it can include the scanning time of the payment code, the geographical location information of the scanning location of the payment code, and the service tag of the payment code.
[0148] Among them, the geographical location information of the point can include longitude and latitude information, can also include community information, and can also include wifi information. A certain area (for example, a city) can be divided into multiple geographical grids (abbreviated as grids in the embodiments of the present application), and identification information is configured for each grid. Within this area, the grid identification information of each grid is unique. Convert the geographical location range of each grid into a longitude and latitude range. Then, according to the longitude and latitude of the collected point data, the point data whose longitude and latitude are within the longitude and latitude range of the grid can be corresponded to the grid, so as to obtain the mapping relationship between the longitude and latitude information of the point data and the grid identification information. In this way, after associating the point data with the grid, when establishing a geographical fence, only the point data of some grids need to be traversed to train the geographical fence, so as to obtain the geographical fence of the preset service type. Instead of traversing the service tags and geographical location information of each piece of point data to screen out the qualified point data as the training samples of the geographical fence. This greatly saves the manpower and material resources for training and generating geographical fences.
[0149] Exemplarily, when Figure 3 learning the geographical fence by the density-based clustering algorithm for the point data in grid No. 15 in, it can be intuitively observed that the point data in grid No. 15 can be clustered into two clusters, and can include Figure 3The dot data sets within the range of circle 301 and the dot data sets within the range of circle 302 are shown. Among them, the dot data set within the range of circle 302 is within the geographical range corresponding to grid No. 15. Due to grid division, the dot data set within the range of circle 301 is split into 4 grids (grid No. 8, 9, 14, and 15). Therefore, when using the geographical fence division method in the prior art to perform density-based clustering algorithm learning for geographical fences on the dot data in grid No. 15, the dot data in grids No. 8, 9, 14, and 15 are not used. In addition, when performing density-based clustering algorithm learning for geographical fences on the dot data in grids No. 8, 9, 14, and 15 respectively, it may be due to the small amount of dot data (i.e., the dot data within the range of circle 301) closely related to grid No. 15 in grids No. 8, 9, 14, or 15 and insufficient aggregation density, resulting in the geographical locations corresponding to these dot data not being included within the geographical fence range of the calculated grid map. To improve the clustering accuracy, when clustering the dot data in grid No. 15, it is necessary to obtain the dot data in grids No. 8, 9, and 14 simultaneously. Therefore, in the embodiments of the present application, the dot data in grids No. 8, 9, 10, 14, 15, 16, 20, 21, and 22 can be regarded as a whole, and grid No. 15 is calculated as the core grid. Thus, while performing density-based clustering algorithm learning for geographical fences on the dot data in the core grid, the dot data in the other 8 surrounding grids can also be associated. Compared with the prior art where 1 grid data is used as an independent calculation entity, for example, parallel clustering calculations are performed on the dot data in grids No. 1, 2, 3, 4... without affecting each other, it is improved to use a grid set composed of each grid and its associated surrounding grids as an independent calculation entity. For example, parallel clustering calculations are performed on grid sets such as (grid No. 1, 2, 3, 7, 8, 9, 13, 14, 15), (grid No. 2, 3, 4, 8, 9, 10, 14, 15, 16)... Each set of 9 grids is an independent calculation entity, and the grids included in the new entity may overlap. Therefore, in the embodiments of the present application, the core grid can be found, and the main clustering calculation is performed on the dot data in the core grid, while the surrounding grids are used to find neighboring associated dot data.
[0150] It can be understood that the embodiments of the present application only exemplarily introduce a possible distribution method of the crowdsourcing data included in the above grid map and several possible types of dot data included in the crowdsourcing data. In addition, the grid map may also include other crowdsourcing data with different distributions and more types of dot data, which will not be enumerated one by one here.
[0151] The above Figures 1 - 2The relevant descriptions of the hardware structure and software structure of the electronic device 100 in combination with Figure 3 A schematic diagram of a grid map based on crowdsourced data provided in Figure 4 , Figure 4 is a schematic diagram of the application scenario of a geofence divided based on a grid map in the prior art. As Figure 4 shown, corresponding to the grid map in Figure 3 , Figure 4 the geographical area in Figure 3 includes geographical areas corresponding to each grid in Figure 4 (for example, grids with grid identifiers 1 to 36), and its geofence (such as the geofence 401 in Figure 3 ) is obtained by taking the set of dot data of each grid in Figure 3 (for example, grids with grid identifiers 1 to 36) as an independent computing entity and performing a density-based clustering algorithm (such as the K-means method or the DBSCAN method) on the dot data therein. In addition, when the crowdsourced data in Figure 4 is the dot data of the business behaviors of many electronic devices reporting in and out of the subway station 402 near the subway station 402, where the business behaviors of entering and leaving the subway station 402 are specifically, for example, behaviors of entering or leaving the station by scanning a code or swiping a card, then the geofence 401 in Figure 4 is the geofence for receiving the recommended service of the subway ride code when the user enters and leaves the subway station 402. Since the dot data of the business behaviors reported by many electronic devices in the grid map (that is, the crowdsourced data) is randomly distributed, there may also be dot data distributed on the boundary of any grid in the grid map (that is, the target grid) and / or in the area of the adjacent grid close to the boundary of the target grid. These dot data have a high similarity to the dot data in the target grid and may be dot data belonging to the same category (for example, dot data with specific business behaviors). However, the method of dividing the geofence in the prior art regards the set of dot data in each target grid in the grid map as an independent computing entity to calculate the geofence, without considering the relevant associated dot data distributed on the boundary of each target grid and / or in the area of the adjacent grid close to the boundary of the target grid. And these dot data may not be able to generate corresponding geofences due to less distribution and / or insufficient aggregation in other corresponding grids, resulting in insufficient accuracy of the geofence 401 generated by the geofence division method in the prior art. For example, the geographical area range included in the geofence 401 is too small, so that the user has entered the vicinity of the subway station 402 (for example, point A in Figure 4 ) but still has not received the recommendation of the ride code, resulting in the user not being able to receive the pushed subway ride code service in time, thus reducing the user experience.
[0152] Based on the above-mentioned technical problems proposed, the embodiments of the present application disclose a method for dividing a geographical fence, which can specifically solve one or more of the following technical problems:
[0153] (1) Solve the problem in the prior art that due to grid division, the dot data originally belonging to the same category in the grid map is divided into different grids and cannot be calculated uniformly, so that the generated geographical fence will not be split due to rasterization processing, and can more accurately reflect the actual geographical features or user behavior patterns of the geographical area corresponding to the grid map, improve the accuracy of geographical fence division to enhance the user experience.
[0154] (2) Solve the problem that when determining the associated dot data corresponding to the dot data in each grid in the grid map, if the dot data in each grid is stored in a table, and when performing clustering calculation on each grid data, it is necessary to query the data of other adjacent grid tables, resulting in a large number of database table query interaction behaviors and increasing the calculation burden. It can quickly determine the associated dot data corresponding to the dot data in each grid to improve the efficiency of calculating the geographical fence.
[0155] (3) Solve the problem that the efficiency of generating the geographical fence corresponding to the grid map is low due to the redundancy of the geographical fence calculated for the associated dot data corresponding to the dot data in each grid in the grid map, so that the process of generating the geographical fence of the grid map based on the geographical fence corresponding to each grid is more concise and efficient. On the premise of ensuring that the generated geographical fence can cover the entire area of the grid map, the generation efficiency of the geographical fence is improved.
[0156] The above Figures 1 - 2 introduced the hardware structure and software structure of the electronic device. Based on the above Figure 3 description of a grid map based on crowdsourcing data provided, and combined with Figure 4 description of the application scenario of the geographical fence based on grid map division in the prior art, the technical problems proposed in the present application are specifically analyzed and solved below.
[0157] A method for dividing a geographical fence provided by the embodiments of the present application, please refer to Figure 5 , Figure 5 is a flowchart example of a method for dividing a geographical fence provided by the embodiments of the present application. This method can be applied to the hardware structure of the electronic device provided above Figure 1 the software structure of the electronic device provided Figure 2 and the software structure of the electronic device provided, as well as Figure 3 a grid map based on crowdsourcing data provided, and may include the following steps.
[0158] Step 501: Obtain the crowdsourcing data of the grid map.
[0159] Specifically, the crowdsourcing data includes the dot data of the business behaviors reported by numerous electronic devices. Exemplarily, the cloud can collect the dot data of various business behaviors reported by numerous electronic devices (referred to as crowdsourcing data). The crowdsourcing data specifically includes the types of specific business behaviors, such as the ride code service, venue code service, payment code service, etc. introduced above, which will not be elaborated here for the time being. The grid map includes multiple geographical grid units (abbreviated as grids in the embodiments of the present application). Each grid corresponds to a geographical area in the actual geographical space. The set of dot data in each grid unit of the grid map can include the dot data of specific business behaviors reported by numerous electronic devices collected in the corresponding geographical area.
[0160] Step 502: Based on the crowdsourcing data, determine the grid information of each grid in the grid map.
[0161] Specifically, the grid information includes the grid size, grid identifier, and the set of dot data in the corresponding geographical area. Exemplarily, the electronic device determines the grid size, grid identifier, and the set of dot data in the corresponding geographical area of each grid in the grid map based on the obtained crowdsourcing data in the grid map. Among them, the grid size is the size of the geographical range corresponding to each grid, usually divided by length units such as meters or kilometers, and its length size is related to the resolution of the grid map; the grid identifier can be the code corresponding to each grid (such as Figure 3 the grid codes 1-36 in), and the set of dot data in the corresponding geographical area of each grid can include the dot data of specific business behaviors reported by numerous electronic devices collected in the corresponding geographical area.
[0162] Step 503: Based on the target accuracy and the grid size of the target grid, determine M first grid sets corresponding to the target grid.
[0163] Specifically, 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; among them, 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. Exemplarily, when the target grid is Figure 3In the 15th grid, with the target accuracy of 50 meters and the grid size of the target grid being 100 meters, the M first grid sets corresponding to the target grid determined by the electronic device are 9 first grid sets respectively expanded with the 8th, 9th, 10th, 14th, 15th, 16th, 20th, 21st, and 22nd grids as the centers. It can be understood that in the embodiments of the present application, 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 the embodiments of the present application, the value of M can be 9. In some embodiments, the value of M can also be other positive integers, and the embodiments of the present application do not limit this. In addition, the number of expanded grids corresponding to each first grid set and the grids associated with the corresponding expanded grids can be M, or other positive integers smaller than M, and the present application does not limit this.
[0164] In a possible implementation manner, the target accuracy is determined based on the size of the association radius, which is used to indicate the expected accuracy of the geofence; the association radius is the distance range used to determine whether the dot data is associated. Specifically, the target accuracy is used to indicate the accuracy of the expected generated geofence, and the target accuracy can be determined by the size of the association radius; further, since the association radius can be used to determine the distance range within which the dot data is associated, that is, when dividing the geofence for the dot data in the grid map, if the distance between two dot data is within the range of the association radius (for example, 50 meters), it is considered that the two dot data are associated. The embodiments of the present application can determine the associated dot data available for geofence division based on different sizes of the association radius, so that the generated geofence can reach the expected target accuracy, can more accurately reflect the actual geographical features or user behavior patterns of the geographical area corresponding to the grid map, and is convenient to provide more accurate recommendation services based on the geofence to improve the user experience.
[0165] In a possible implementation, the embodiment of the present application determines the row and column range (that is, 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 and the grid size of the target grid; and further determines the M first grid sets corresponding to the target grid based on the first row and column range. Specifically, since the expected accuracy of the geographic fence (that is, the target accuracy) can be determined by the size of the association radius of the distance range used to determine whether the dot data is associated, the embodiment of the present application can determine the row and column range (that is, the first row and column range) of a specific grid in the M first grid sets corresponding to the target grid through the association radius and the grid size of any grid (that is, the target grid) in the grid map, for example, the row and column range of the grid located in the upper left corner of the M first grid sets corresponding to the target grid; and further determines the M first grid sets corresponding to the target grid, so as to determine the M first grid sets corresponding to each target grid in the grid map. The first grid set corresponds to a set of dot data in the geographic area (that is, multiple first dot data sets), and further based on the multiple first dot data sets corresponding to each target grid in the grid map, the geographic fence of the grid map is calculated, so that the geographic fence can achieve the desired accuracy (that is, the target accuracy) while avoiding as much as possible the problem that the same type of dot data in the grid map is divided into different grids and calculated separately, resulting in the geographic fence not being able to accurately reflect the actual geographic features or user behavior patterns of the geographic area corresponding to the grid map, thereby improving the accuracy of the geographic fence division, so that when the user enters the geographic area corresponding to the geographic fence, the user can more accurately receive the corresponding recommendation service to enhance the user experience.
[0166] Optionally, how to determine the row and column range (that is, the first row and column range) of a specific grid in the M first grid sets corresponding to the target grid based on the correlation radius of the distance range used to determine whether the dot data are associated and the grid size of any grid in the grid map (that is, the target grid), for example, the row and column range of the grid located in the upper left corner in the M first grid sets corresponding to the target grid, specifically may include, firstly, determining the number of expanded rows and columns of the target grid based on the correlation radius and the grid size of the target grid, for example, when the target grid is Figure 3 15 in the grid, and the target accuracy is 50 meters, and the grid size of the target grid is 100 meters, then the determined number of expanded rows and columns is 2; further based on the row and column position of each target grid, the first grid range can be determined after expanding the expanded row and column numbers on the row and column, that is, the maximum row and column value and the minimum row and column value of the grid at a specific position of each first grid set in the M first grid sets corresponding to each target grid (for example, the grid at the upper left corner), for exampleFigure 3 The row and column position of grid No. 15 is (3, 3), then the maximum row and column value of the grid at the upper left corner position of each of the 9 first grid sets corresponding to grid No. 15 is determined to be (3, 3), and the minimum row and column value is (1, 1). Among them, the grid at a specific position of each first grid set can also be a grid at other positions in the first grid set, which is not limited in the embodiment of the present application. Through the embodiment of the present application, based on the associated radius and the grid size of any grid (i.e., the target grid) in the grid map and the row and column position of the target grid, the row and column range (i.e., the first row and column range) of the specific grid in the M first grid sets corresponding to the target grid can be determined, so as to calculate the M first grid sets corresponding to the target grid based on the first row and column range, further determine the dot data set (i.e., multiple first dot data sets) in the geographical area corresponding to all grids in each of the M first grid sets, and then for the grid map, Multiple first dot data sets corresponding to each target grid are used to calculate the geographic fence of the grid map, so that the geographic fence can achieve the desired accuracy (i.e., target accuracy) while avoiding as much as possible the problem that the same type of dot data in the grid map is divided into different grids and calculated separately, resulting in the geographic fence not being able to accurately reflect the actual geographic features or user behavior patterns of the geographic area corresponding to the grid map. The accuracy of the geographic fence division is improved, so that when the user enters the geographic area corresponding to the geographic fence, the user can more accurately receive the corresponding recommendation service to enhance the user experience.
[0167] Furthermore, how to determine the M first grid sets corresponding to the target grid based on the row and column range (that is, the first row and column range) where the specific grid is located in the M first grid sets corresponding to the target grid may specifically include firstly determining the grid at a specific position of each first grid set in the M first grid sets corresponding to each target grid (for example, the grid at Figure 3The maximum row and column value and the minimum row and column value of the first grid set where the grid at each specific position is located are determined, for example, when the maximum row and column value is (3, 3) and the minimum row and column value is (1, 1), traverse from the minimum row and column value to the maximum row and column value, for example, traverse from (1, 1) to (3, 3) to determine the maximum row and column value and the minimum row and column value of the first grid set where the grid at each specific position is located, that is, 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 (that is, the second row and column range); further determine M first set identifiers that can be used to indicate a first grid set in the M first grid sets corresponding to the target grid based on the second row and column range, so that each first grid set in the M first grid sets corresponding to the target grid can be determined based on the first set identifier, so as to facilitate the determination of each first grid set in the grid map based on the grid map. M first grid sets corresponding to a target grid are determined, and the dot data sets (that is, multiple first dot data sets) in the geographical area corresponding to all grids in each first grid set in the M first grid sets are determined. Then, for the multiple first dot data sets corresponding to each target grid in the grid map, the geographical fence of the grid map is further calculated, so that the geographical fence can achieve the expected accuracy (that is, the target accuracy) while avoiding as much as possible the problem that the same type of dot data in the grid map is divided into different grids and calculated separately, resulting in the geographical fence not being able to accurately reflect the actual geographical features or user behavior patterns of the geographical area corresponding to the grid map, thereby improving the accuracy of the division of the geographical fence, so that when the user enters the geographical area corresponding to the geographical fence, the user can more accurately receive the corresponding recommendation service to enhance the user experience.
[0168] Optionally, the embodiment of the present application can also preprocess the grid information of each target grid in the grid map to obtain a first information list including the grid identification of each target grid, the set of dot data in the corresponding geographic area, and the corresponding second set identification that can be used to indicate the M first grid sets corresponding to each target grid, so as to quickly determine the grid identification of each target grid in the grid map, the set of dot data in the corresponding geographic area and the corresponding M first grid sets based on the first information list, and further determine the dot data sets in the geographic area corresponding to the M first grid sets corresponding to each target grid in the grid map (that is, multiple first dot data sets), thereby effectively improving the efficiency of calculating the geographic fence of the grid map.
[0169] Step 504: Determine a plurality of first dot data sets based on the M first grid sets corresponding to each target grid in the grid map.
[0170] Among them, a first grid set corresponds to a first dotting data set. How the embodiments of the present application determine the dotting data sets (i.e., multiple first dotting data sets) in the geographical regions corresponding to the M first grid sets corresponding to each target grid in the grid map based on the M first grid sets corresponding to each target grid in the grid map specifically may include: First, 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 that can be used to indicate the M first grid sets corresponding to each target grid in the first information list, expand the sets of dotting data in the geographical regions corresponding to the grids involved in each first set identifier to obtain a second information list; then merge the sets of dotting data in the geographical regions 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 dotting data sets, where the multiple first dotting data sets include the dotting data in the geographical regions corresponding to one or more grids involved in one merged first set identifier. Since for different target grids in the grid map, one of the grids associated with one of the M extended grids (i.e., the first grid set) corresponding to the target grid may be the same, there are a large number of identical first dotting data sets among the multiple first dotting data sets determined based on the M first grid sets corresponding to each target grid in the grid map. Therefore, through the embodiments of the present application, the multiple first dotting data sets corresponding to each target grid after merging the identical first dotting data sets can be obtained (i.e., the sets of dotting data in the geographical regions corresponding to one or more grids involved in each merged first set identifier in the third information list), so as to reduce the number of the multiple first dotting data sets corresponding to each target grid in the grid map, and reduce the complexity of calculating the geographical fence of the grid map based on the multiple first dotting data sets corresponding to each target grid in the grid map. In addition, the embodiments of the present application can quickly determine the dotting data sets (i.e., multiple first dotting data sets) in the geographical regions corresponding to the M first grid sets corresponding to each target grid by querying the third information list, without having to query the sets of dotting data in the geographical regions corresponding to other grids adjacent to the target grid each time, thereby effectively reducing the number of interaction behaviors of querying the database table and reducing the calculation burden.
[0171] Step 505: Determine the geographical fence of the grid map based on the multiple first dotting data sets corresponding to each target grid in the grid map.
[0172] In one possible implementation, how to determine the geographic fence of the grid map based on a dot data set (that is, multiple first dot data sets) in the geographical area corresponding to one of the M extended grids and the associated grid corresponding to each target grid in the grid map can specifically include: first, for each target grid in the grid map, a dot data set (that is, multiple first dot data sets) in the geographical area corresponding to one of the M extended grids and the associated grid corresponding to the target grid, a density-based clustering algorithm, such as a K-means clustering (K-means) method or a density-based spatial clustering of applications with noise (DBSCAN) method, calculate the target geographic fence including the geographical area corresponding to all grids in each first grid set after merging the same first grid set in the M first grid sets corresponding to each target grid, and further determine the geographic fence of the grid map based on the target geographic fence. Through the embodiment of the present application, firstly, a density-based clustering algorithm is calculated for multiple first dot data sets corresponding to each target grid in the grid map. Since the amount of data to be calculated is small, it is easier to calculate the target geographic fence, reducing the complexity of the calculation. At the same time, the calculation for the entire grid map can be decomposed into calculations for some grids, which is conducive to achieving simultaneous parallel calculations to obtain the target geographic fence in the geographical area corresponding to all grids in each first grid set after merging the same first grid set in the M first grid sets corresponding to each target grid, reducing the time consumption of the calculation process to improve the calculation efficiency. In addition, since different areas may have different geographical attributes and / or data distributions, the geographic fence of the grid map determined based on the target geographic fence obtained through local calculation can cover the entire area of the grid map while more accurately reflecting the actual geographical features or user behavior patterns of each area of the grid map, thereby improving the accuracy of the geographic fence division, so that when the user enters the geographical area corresponding to the geographic fence, the user can more accurately receive the corresponding recommendation service to improve the user experience.
[0173] Optionally, regarding how to calculate the target geographical fence based on the density-based clustering algorithm for the set of dotting data (i.e., multiple first dotting data sets) within the geographical area corresponding to the M first grid sets corresponding to each target grid in the grid map, specifically, it may include first calculating the grid encoding of the core grid in the corresponding first grid set according to each merged first set identifier in the above third information list; then, based on the grid encoding of the core grid in each corresponding first grid set calculated, obtaining a second dotting data set including the dotting data within the geographical area corresponding to each core grid. Further, by traversing the dotting data in the second dotting data set, determining the associated dotting data of each dotting data based on the association radius for determining the distance range between dotting data. For example, in Figure 3 when the grid encoding of the calculated core grid is 15, the second dotting data set may include the obtained ones such as Figure 3Dot data within the geographical area corresponding to grid No. 15 as shown; when the length of the association radius for determining whether dot data is associated is 50 meters, then traverse all the dot data within grid No. 15, and the determined associated dot data includes dot data within other grids except grid No. 15 whose distance from any dot data within grid No. 15 is within 50 meters. Further, based on this second set of dot data and the determined associated dot data, determine a third set of dot data including the dot data within the geographical area corresponding to each core grid and the corresponding associated dot data. Finally, by performing density-based clustering algorithm learning, such as the K means method or the DBSCAN method, on all the dot data in this third set of dot data, calculate the target geographical fence within the geographical area corresponding to all the grids in each first grid set after merging the same first grid sets corresponding to each target grid. Through the embodiments of the present application, since the third information list includes the set of dot data within the geographical area corresponding to one or more grids involved in the merged first set identifier, and each merged first set identifier is determined based on the maximum row and column values and the minimum row and column values of all the grids in the corresponding first grid set, the grid code of the core grid therein can be determined through the maximum row and column values and the minimum row and column values of all the grids in the corresponding first grid set, thereby determining the dot data within the geographical area corresponding to each core grid to obtain a second set of dot data; then traverse the dot data in this second set of dot data, and determine the associated dot data associated with each dot data through the association radius to obtain a third set of dot data including the dot data within the geographical area corresponding to each core grid and the corresponding associated dot data. Finally, the target geographical fence can be obtained by performing density-based clustering algorithm learning on all the dot data in this third set of dot data. Since the amount of data for calculating the geographical fence for all the data in the third set of dot data is small, it is easier to calculate the target geographical fence, reducing the computational complexity. At the same time, the calculation of the geographical fence for the dot data of the entire grid map can be decomposed into the calculation of the dot data within the geographical area corresponding to each target grid and the corresponding associated dot data, which is conducive to achieving parallel calculation to obtain the target geographical fence within the geographical area corresponding to all the grids in each first grid set after merging the same first grid sets corresponding to each target grid, reducing the time consumption of the calculation process to improve the calculation efficiency.In addition, since different regions may have different geographical attributes and / or data distributions, the geographical fence of the grid map determined based on the target geographical fence obtained through local calculation can cover the entire area of the grid map while more accurately reflecting the actual geographical features or user behavior patterns of each region of the grid map, improving the accuracy of geographical fence division, so that when the user enters the geographical area corresponding to the geographical fence, the user can more accurately receive the corresponding recommended services to enhance the user experience.
[0174] Furthermore, how to determine the geographical fence of the grid map based on the target geographical fence specifically includes that since the dot data sets (i.e., multiple first dot data sets) in the geographical area corresponding to one of the M first grid sets corresponding to each target grid in the grid map, the target geographical fence determined by the density-based clustering algorithm may be repeated. Therefore, first, by traversing each target geographical fence, it is judged whether the center point of the target geographical fence 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, and then the target geographical fences with the center points located in the core grids of the corresponding first grid sets are retained to remove the duplicate geographical fences in the target geographical fences. Finally, the geographical fence of the grid map is generated based on the retained target geographical fences. In the embodiment of the present application, by removing the duplicate geographical fences in the target geographical fences, the process of generating the geographical fence of the grid map based on the target geographical fence is made more concise and efficient. On the premise of ensuring that the generated geographical fence can cover the entire area of the grid map, the generation efficiency of the geographical fence is improved. At the same time, the core grid may contain key resources or business centers. Therefore, only retaining the geographical fences with the center points located in the core grids can more specifically focus on important areas and ignore secondary areas, so that the generated geographical fence can more accurately reflect the actual geographical features or user behavior patterns of each region of the grid map, improve the accuracy of geographical fence division, and enable the user to more accurately receive the corresponding recommended services to enhance the user experience when entering the geographical area corresponding to the geographical fence.
[0175] Exemplarily, please refer to Figure 6 , Figure 6 which is a specific process example diagram of another method for dividing geographical fences provided by the embodiment of the present application. This method can be applied to the hardware structure of the electronic device described above Figure 1 and the software structure of the electronic device described above Figure 2 . This method can be applied to the hardware structure of the electronic device provided above Figure 1 , the software structure of the electronic device provided above Figure 2 , and in a grid map based on crowdsourcing data provided above Figure 3 . The specific steps are as follows:
[0176] Step 601: Obtain the crowdsourcing data of the grid map.
[0177] Among them, the crowdsourcing data includes the dot data of the service behaviors reported by numerous electronic devices.
[0178] Step 602: Based on the crowdsourcing data, determine the grid information of each grid in the grid map.
[0179] Among them, the grid information includes the grid size, the grid identifier, and the set of dot data within the corresponding geographical area;
[0180] Specifically, for the specific descriptions of Steps 601 - 602, reference can be made to the relevant descriptions of Steps 501 - 502 above, which will not be elaborated here.
[0181] Step 603: Based on the association radius and the grid size of the target grid, determine the extended row and column numbers of the target grid.
[0182] Step 604: Based on the row and column positions where the target grid is located and the extended row and column numbers, determine the first row and column range.
[0183] Among them, the first row and column range includes the maximum row and column values and the minimum row and column values of specific grids, and the specific grids are the grids at specific positions of each first grid set in the M first grid sets.
[0184] Step 605: Traverse from the minimum row and column values of the specific grid to the maximum row and column values of the specific grid to determine the second row and column range.
[0185] Among them, the second row and column range includes the maximum row and column values and the minimum row and column values of all grids in each first grid set corresponding to the target grid in the M first grid sets.
[0186] Step 606: Based on the second row and column range, determine the M first set identifiers.
[0187] Among them, the first set identifier is used to indicate one of the first grid sets in 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) where a specific grid is located in the M first grid sets corresponding to the target grid based on the association radius for determining whether dot data is associated 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) where a specific grid is located in the M first grid sets corresponding to the target grid. For the specific description of the steps, reference can be made to the relevant description in step 503 above, which will not be elaborated here.
[0189] Exemplarily, based on the above Figure 3 provided grid map based on crowdsourcing data, assuming that the length of the association radius for determining whether dot data is associated is 50 meters, and the grid size of any grid (i.e., the target grid) in the grid map is 100 meters. When the target grid is Figure 3 the grid numbered 15 in the grid map, please refer to Figure 7 , Figure 7 FIG. is a schematic diagram of determining the M first grid sets corresponding to the target grid provided by an embodiment of the present application. The specific steps may include but are not limited to the following steps 1-step 4.
[0190] Step 1: Determine the extended row and column numbers of the target grid based on the association radius and the grid size of the target grid; the extended row and column numbers of the target grid are:
[0191] extendGrid = (radius / gridSize + 1) × 2;
[0192] where extendGrid is the extended row and column numbers of the target grid, radius is the length of the association radius, and gridSize is the grid size of any grid (i.e., the target grid) in the grid map. When the length of the association radius is 50 meters and the grid size of the target grid is 100 meters, by taking the integer value of radius / gridSize, the calculated extended row and column numbers of the target grid are 2. That is, all the grids in the grid set obtained by expanding the row and column of the original one target grid (such as grid No. 15) by 2 grids each are the M extended grids corresponding to the target grid, and M is a positive integer. Exemplarily, as Figure 7As shown in (A) of , the row and column positions of the 15th grid are (3, 3). Then, all the grids in the grid set obtained by expanding 2 grids in both the row and column of the 15th grid are the 8th, 9th, 10th, 14th, 15th, 16th, 20th, 21st, and 22nd grids. At this time, the value of M is 9, and the 8th, 9th, 10th, 14th, 15th, 16th, 20th, 21st, and 22nd grids are the 9 expanded grids corresponding to the 15th grid.
[0193] It should be noted that the embodiments of the present application only exemplarily introduce a possible implementation manner of determining the expanded row and column numbers of the target grid based on the association radius and the grid size of the target grid. In some embodiments, there may be other calculation methods for the expanded row and column numbers. Correspondingly, based on the row and column values where the target grid is located and the expanded row and column numbers, the specific manner of determining the corresponding M expanded grids by expansion will also change accordingly. The embodiments of the present application do not make specific limitations on this.
[0194] Step 2: Based on the row and column positions where the target grid is located and the expanded row and column numbers, determine the row and column range (i.e., the first row and column range) where the specific grid is located in the M first grid sets corresponding to the target grid; Exemplarily, 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 values of the specific grid are:
[0195] (XminRow, YmincurCol) = (curRow - extentGrid, curCol - extendGrid)
[0196] The maximum row and column values of the specific grid are:
[0197] (XmaxRow, YmaxcurCol) = (curRow, curCol)
[0198] Specifically, the first row and column range is the row and column range where the specific grid is located in the M first grid sets corresponding to the target grid. The first row and column range includes the maximum row and column values and the minimum row and column values of the specific grid. Among them, (XminRow, YmincurCol) are respectively 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 respectively 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 respectively the row and column where the target grid is located.
[0199] Exemplarily, since the target grid in the embodiment of the present application is grid No. 15, the value of (curRow, curCol) is (3, 3), and the extended row and column number extendGrid is 2. Therefore, it can be calculated that for the target grid (such as grid No. 15), the row and column range (i.e., the first row and column range) where the specific grid (such as the grid located in the upper left corner) is located in the M first grid sets corresponding to the target grid 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 can be understood that the embodiment of the present application only exemplarily introduces a possible calculation method when the specific grid is the grid located in the upper left corner in the M first grid sets corresponding to the target grid. In some embodiments, the specific grid can also be any other grid at any position in the M first grid sets corresponding to the target grid. Correspondingly, the calculation method for calculating the specific grid will also change accordingly, and the embodiment of the present application does not limit this.
[0200] Step 3: Traverse from the minimum row and column value of the specific grid to the maximum row and column value of the specific grid to determine the maximum row and column value and the minimum row and column value (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 the maximum row and column value and the minimum row and column value of the grid at a specific position (such as the grid located in the upper left corner position) in each of the M first grid sets corresponding to each target grid, traverse from the minimum row and column value to the maximum row and column value to determine the maximum row and column value and the minimum row and column value of the first grid set where each specific position grid is located. That is, the maximum row and column value and the minimum row and column value (i.e., the second row and column range) of all grids in each of the M first grid sets corresponding to the target grid. Exemplarily, traverse from the minimum row and column value to the maximum row and column value of the specific grid, and determine that the row and column values of each specific grid are (1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3), corresponding Figure 7 to the grids numbered 1, 2, 3, 7, 8, 9, 13, 14, 15 in (A). Since the position of the specific grid in the embodiment of the present application is located in the upper left corner position of each first grid set, therefore, it can be determined that the maximum row and column value of the first grid set where each specific position grid is located is:
[0202] (maxRow, maxcurCol) = (XRow + extentGrid, YcurCol + extendGrid)
[0203] The minimum row and column value of the first grid set where each specific position grid is located is:
[0204] (minRow, mincurCol) = (XcurRow, YcurCol)
[0205] Among them, (maxRow, maxcurCol) is the maximum row and column values of the first grid set where the grid at each specific position is located, (minRow, mincurCol) is the minimum row and column values of the first grid set where the grid at each specific position is located, and (XRow, YcurCol) is the row and column values where the grid at each specific position is located. Therefore, according to the above calculation method, the maximum row and column values and the minimum row and column values of the first grid set where the grid at each specific position is located can be obtained. That is, among the M first grid sets corresponding to the target grid, the maximum row and column values and the minimum row and column values (i.e., the second row and column range) of all grids in each of the first grid sets.
[0206] It can be understood that the embodiments of the present application only exemplarily introduce a possible calculation method for determining the maximum row and column values and the 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 the specific grid is the grid located at the upper left corner among the M first grid sets corresponding to the target grid. In some embodiments, the specific grid may also be any other grid at any position among the M first grid sets corresponding to the target grid. Correspondingly, the calculation method for calculating the second row and column range will also change accordingly. The embodiments of the present 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, according to the maximum row and column values and the minimum row and column values of the first grid set where the grid at each specific position in the calculated second row and column range is located, the first set identifier of the corresponding first grid set can be determined. Through this first set identifier, it is convenient to determine each of the M first grid sets corresponding to the target grid. Exemplarily, the definition method of the first set identifier in the embodiments of the present application can be (minRow:maxRow:minCol:maxCol), corresponding to Figure 7 the 9 first grid sets shown in Figure (B). That is, when the target grid is grid No. 15, the corresponding M first grid sets are determined. Among them, the first set identifiers corresponding to all grids in each first grid set can be as shown in Table 1. Table 1 is as follows:
[0209] Table 1
[0210]
[0211] It can be understood that due to the difference between the expected accuracy of the geographical fence (i.e., the target accuracy) and the grid size of any grid in the grid map (i.e., the target grid), the number of the M first grid sets corresponding to the determined target grid is different. Among them, the definition method of each first grid set can be (minRow:maxRow:minCol:maxCol), or other definition methods, which are not limited in the embodiments of the present application. The embodiments of the present application only introduce a possible implementation manner of determining the corresponding M first grid sets based on the target grid when the 15th grid is the target grid. The steps of determining the corresponding M first grid sets for other grids in the grid map as the target grid are similar to the above steps and will not be elaborated here.
[0212] Step 607: Preprocess the grid information of each target grid in the grid map to determine the first information list.
[0213] Specifically, before the electronic device is based on the M first grid sets corresponding to each target grid in the grid map and the multiple first dot data sets, it can obtain the first information list by preprocessing the grid information of each target grid in the grid map. Among them, the first information list includes the grid identifier of each target grid, the set of dot data in 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, which are used to indicate the M first grid sets corresponding to each target grid. For the specific description of step 607, reference can be made to the relevant description above and will not be elaborated here. It should be noted that there is no clear sequence relationship between step 607 and the above steps 603 - step 606, that is, step 607 can be before or after steps 603 - step 606, or can be carried out simultaneously with steps 603 - step 606, which is not limited in the embodiments of the present application.
[0214] Exemplarily, based on the above Figure 3 A grid map based on crowdsourcing data provided, the first information list determined by preprocessing the grid information of each target grid in the grid map can be shown in Table 2:
[0215] Table 2
[0216]
[0217] Among them, as shown in Table 2, the Morton codes 1 to 36 are respectively as Figure 3The grid identifiers of grids 1 to 36 in the grid map shown (that is, the grid identifier of each target grid), raw1, raw2, raw3...raw36 respectively represent the dot data sets in grids 1 to 36 (that is, the set of dot data in the geographical area corresponding to each target grid), and mortonListlds respectively represent the second set identifiers of the 9 first grid sets corresponding to grids 1 to 36 (that is, the second set identifiers of the M first grid sets corresponding to each target grid). Exemplarily, the second set identifiers of the M first grid sets corresponding to each target grid include M first set identifiers, that is, set1, set2, set3...set114 in Table 2 can be used to indicate one first grid set in the M first grid sets corresponding to each target grid. Among them, each first set identifier can adopt the definition method of the above-mentioned first set identifier (minRow: maxRow: minCol: maxCol), for example, all the first set identifiers of the second set identifiers [set9, set27, set45, set46, set47, set48, set49, set50, set51] of the M first grid sets corresponding to the grid with grid identifier 15, including all the first set identifiers shown in Table 1, and their specific descriptions can be found in the previous text, which will not be repeated here. It can be understood that the second set identifiers of the M first grid sets corresponding to each other target grid can also be expressed by this definition method, and each second set identifier can be used to represent a first grid set in the M first grid sets corresponding to the target grid, and the embodiments of the present application are not listed one by one here.
[0218] Step 608: Based on the first information list, for each first set identifier in the second set identifier, expand the grid identifier of the grid involved in each first set identifier, the set of dot data in the corresponding geographical area, and the involved second set identifier to obtain a second information list;
[0219] Exemplarily, 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), the grid identifier of the grid involved in each first set identifier, the set of dot data in the corresponding geographical area, and the involved second set identifier are expanded, and the obtained second information list can be shown in Table 3:
[0220] Table 3
[0221]
[0222]
[0223] Among them, as shown in Table 3, set1, set1, set1... set114 are the first set identifiers after expanding each first set identifier in the second set identifier in Table 2. The morton codes corresponding to numbers 1 to 36 are the grid identifiers of the target grid corresponding to the second set identifier where the first set identifier is located in Table 2 (that is, the grid identifiers of the grids involved in the first set identifier), and the corresponding raw1, raw1, raw1... raw36 are the sets of dot data in the geographical area corresponding to the grids involved. mortonListlds are the second set identifiers where the first set identifier is located (that is, the second set identifiers involved). It can be understood that in the embodiment of the present application, it is exemplarily shown for each first set identifier in one of the second set identifiers in Table 2 (such as [set1, set2, set3, set4, set5, set6, set7, set8, set9]) to expand the grid identifiers of the grids involved in the first set identifier, the sets of dot data in the corresponding geographical area, and the second set identifiers involved. The expansion process for 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, which will not be elaborated here one by one.
[0224] Step 609: Merge the sets of dot data in the geographical area corresponding to the grids involved in the same first set identifier in the second information list to obtain a third information list.
[0225] Among them, the third information list includes the merged first set identifier and the corresponding multiple first dot data sets; among them, the multiple first dot data sets include the dot data in the geographical area corresponding to one or more grids involved in one merged first set identifier.
[0226] Exemplarily, merge the sets of dot data in the geographical area corresponding to the grids involved in the same first set identifier in the second information list as shown in Table 3, and the obtained third information list is shown in Table 4:
[0227] Table 4
[0228]
[0229] Among them, set1, set2, set3... set114 in the mortonListld are the first set identifiers after merging respectively. The String sets are multiple first dot data sets corresponding to the first set identifier after merging, that is, the set of dot data within the geographical regions corresponding to all the grids involved in the first set identifier in Table 2. In the embodiment of the present application, the set of dot data within the geographical regions corresponding to all the grids (such as all the grids in the first grid set indicated by set1, set2, se3... set114) in each of the M first grid sets corresponding to each target grid can be quickly determined by querying the third information list, without the need to query the set of dot data within the geographical regions corresponding to other grids adjacent to the target grid each time, thereby effectively reducing the number of interaction behaviors of database table queries and reducing the computing burden.
[0230] Step 610: Calculate the grid code of the core grid in the corresponding first grid set according to each first set identifier after merging in the third information list.
[0231] Exemplarily, according to each first set identifier after merging (such as set1, set2, set3... set114) in the third information list shown in Table 4, since each first set identifier after merging is determined based on the maximum row and column values and the minimum row and column values of all the grids in the corresponding first grid set, and each first set identifier after merging can be defined in the form of (minRow:maxRow:minCol:maxCol). For example, for the first set identifier after merging with (1:3:1:3), the row and column values of its core grid can be determined as (2, 2), corresponding to Figure 3 the grid code in the grid map shown is 8. Correspondingly, according to each first set identifier after merging, the grid code of the core grid in the corresponding first grid set can be calculated.
[0232] Step 611: Obtain the second dot data set based on the grid code of each core grid.
[0233] Among them, the second dot data set includes the dot data within the geographical regions corresponding to each of the core grids. Exemplarily, according to the grid code of the core grid in the first grid set corresponding to each first set identifier after merging calculated, the dot data within the geographical regions corresponding to each core grid (that is, the second dot data) can be obtained.
[0234] Step 612: By traversing the dot data in the second dot data set, determine the associated dot data of each dot data based on the associated radius.
[0235] Specifically, traverse all the dot data within the geographical area corresponding to each core grid, and determine the associated dot data associated with each dot data through the association radius. A third dot data set including the dot data within the geographical area corresponding to each core grid and the corresponding associated dot data is obtained.
[0236] Step 613: Determine a third dot data set based on the second dot data set and the associated dot data.
[0237] Further, summarize the dot data within the geographical area corresponding to each core grid (i.e., the second dot data set) and the associated dot data determined in step 612 above to obtain a third dot data set, which includes the dot data within the geographical area corresponding to each core grid and the corresponding associated dot data.
[0238] Step 614: Calculate the target geographical fence by performing density-based clustering algorithm learning on all the dot data in the third dot data set.
[0239] Exemplarily, calculate the target geographical fence by performing density-based clustering algorithm learning on all the dot data in this third dot data set, such as the K means method or the DBSCAN method.
[0240] Step 615: By traversing each target geographical fence in the target geographical fence, determine whether the center point of the target geographical fence is located in the core grid of the corresponding first grid set.
[0241] Step 616A: If so, retain the target geographical fence.
[0242] Step 616B: If not, delete the target geographical fence.
[0243] Step 617: Merge the retained target geographical fences to obtain the geographical fence of the grid map.
[0244] Specifically, for the specific description of the above steps 610-617, please refer to the relevant description of the above step 505, which will not be repeated here. Through the embodiment of the present application, the multiple first dot data sets corresponding to each target grid in the grid map can be regarded as an independent calculation individual. Compared with the prior art that treats each target grid in the grid map as an independent calculation individual, the dot data originally belonging to the same category in the grid map (for example, dot data with specific business behaviors) can be reduced as much as possible. The problem that the dot data cannot be uniformly calculated due to being divided into different grids. Therefore, the geographic fence of the grid map determined by the embodiment of the present application can more accurately reflect the actual geographic features or user behavior patterns of the geographic area corresponding to the grid map, improve the accuracy of the geographic fence division, so that when the user enters the geographic area corresponding to the geographic fence, he can more accurately receive the corresponding recommendation service to enhance the user experience.
[0245] The above describes the steps of the method for dividing a geographic fence provided in the embodiment of the present application. Figure 8 and Figures 9A - 9C An example application scenario of a geographic fence provided in an embodiment of the present application is described.
[0246] For example, Figure 8 A schematic diagram of an application scenario of a geographic fence based on grid map division provided in an embodiment of the present application. Figure 8 As shown, based on Figure 3 The raster map in Figure 8 The geographical areas include Figure 3 The geographical area corresponding to each grid (e.g., grids with grid identifiers 1 to 36) in Figure 3 When the crowdsourced data in the example is the dotted data of the business behavior of entering and leaving the subway station 802 reported by many electronic devices near the subway station 802, its geographic fence (such as Figure 8 The geo-fence 801 in Figure 3 Each grid in (for example, grids with grid identifiers 1 to 36) corresponds to the dot data in the geographical area and the data associated with the dot data (that is, multiple first dot data sets). Figure 8 The geographic fence 803 is divided by the existing technology based on Figure 3 The geo-fence 803 obtained from the grid map in Figure 4 For example, when the target grid is Figure 3When it comes to grid No. 15, when performing density-based clustering algorithm learning on the dot data of this grid No. 15 to learn the geofence, the data associated with the dot data within grid No. 15 is also taken into account (that is, the dot data within the range of circle 301 divided by the grid into No. 8, No. 9, and No. 14). Therefore, the geofence 801 generated by the geofence division method provided by the embodiments of the present application has higher accuracy than the geofence 803 generated by the prior art. When the user enters the vicinity of the subway station 802 (for example Figure 8 point A therein), the mobile phone will automatically recognize that the user has entered the geofence 801 and receive the pushed services required by the user, such as pushing the quick entry of the subway ride code, thereby enhancing the user experience of using the subway code to take the subway in the subway station scenario.
[0247] It should be noted that the above-mentioned Figure 3 crowdsourcing data may also include other possible distribution methods and / or dot data of other types of business behaviors. Correspondingly, the generated geofence (such as the range and / or service label of the geofence 801) will also be different. The embodiments of the present application do not limit this.
[0248] Exemplarily, please refer to Figures 9A - 9C , Figures 9A - 9C which are schematic diagrams of the interfaces for some users to use the geofence divided based on the grid map provided by the embodiments of the present application. As Figure 9A shown, when the geofence generated based on the grid map is the geofence for the subway code ride service, when the electronic device automatically recognizes that the user enters the geographical area corresponding to the geofence, it triggers the recommended ride code service and presents the user interface 91. This user interface 91 is the main interface of the electronic device 100. In this main interface, there are application cards 901 and other application icons. In the application card 901, there are one or more application widgets. In the application card 901, there is 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 start the application program corresponding to this icon and display as Figure 9B shown in the user interface 92. In this user interface 92, there is a display box 902 for displaying the subway ride code, thus greatly enhancing the user experience of using the subway ride code to take the subway in the subway station scenario.
[0249] As Figure 9BAs shown, when the geofence generated based on the grid map is the geofence for the payment service, when the electronic device automatically recognizes that the user enters the geographical area corresponding to the geofence, it triggers the recommended payment code service and presents the user interface 93. This user interface 93 is the main interface of the electronic device 100, and in this main interface, there are application cards 903 and other application icons. In the application card 901, there are one or more application widgets. In the application card 903, there is 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 start the application corresponding to this icon and display as Figure 9B shown in the user interface 94. In this user interface 94, there is a display box 904 for displaying the payment code, thus greatly enhancing the user experience of using the payment code for payment in the payment scenario.
[0250] As Figure 9C shown, when the geofence generated based on the grid map is the geofence for the venue code service, when the electronic device automatically recognizes that the user enters the geographical area corresponding to the geofence, it triggers the venue code scanning service and presents the user interface 95. This user interface 95 is the main interface of the electronic device 100, and in this main interface, there are application cards 905 and other application icons. In the application card 905, there are one or more application widgets. In the application card 905, there is 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 start the application corresponding to this icon and display as Figure 9C shown in the user interface 96. In this user interface 96, there is a display box 906 for displaying the scanned venue code, thus greatly enhancing the user experience of using the venue code scanning function to enter and exit the venue in the scenario where the venue code needs to be scanned.
[0251] It should be noted that the above Figures 9A - 9C shown user interface diagrams are all exemplary displays of the embodiments of this application. The user interface diagrams during actual operation can also be of other styles. In addition, this application only exemplarily describes the application scenarios of geofences for several possible business types. In some embodiments, it may also include the application scenarios of geofences for other business types, and the embodiments of this application do not limit this.
[0252] The methods and application scenarios of the embodiments of the present application are elaborated in detail above. It can be understood that, in order for each device to implement the corresponding functions above, it includes the corresponding hardware structure and / or software module for executing each function. Combining the units and steps of each example described in the embodiments disclosed in this article, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application. Next, the devices provided by the embodiments of the present application will be introduced.
[0253] Please refer to Figure 10 , Figure 10 FIG. is a schematic structural diagram of a device for dividing a geofence provided by an embodiment of the present application. The geofence dividing 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. The detailed descriptions of each unit are as follows:
[0254] The first acquisition unit 1001 is configured to acquire crowdsourcing data of a grid map, and the crowdsourcing data includes dot data of service behaviors reported by a plurality of electronic devices;
[0255] The first determination unit 1002 is configured to determine grid information of each grid in the grid map based on the crowdsourcing data, where the grid information includes grid size, grid identifier, and a set of dot data in the corresponding geographical area;
[0256] The second determination unit 1003 is configured to determine M first grid sets corresponding to the target grid based on the target accuracy and the grid size of the target grid, where the target grid is any grid in the grid map, the target grid corresponds to M expanded grids, the M expanded grids include the target grid and (M - 1) grids associated with the target grid, and M is a positive integer; wherein, one expanded grid corresponds to one first grid set, and one first grid set includes the corresponding expanded grid and the grids associated with the corresponding expanded grid;
[0257] The third determination unit 1004 is configured to determine a plurality of first dot data sets based on the M first grid sets corresponding to each target grid in the grid map, where one first grid set corresponds to one first dot data set;
[0258] The fourth determination unit 1005 is configured to determine the geofence of the grid map based on the plurality of first dot data sets corresponding to each target grid in the grid map.
[0259] In the embodiment of the present application in the device for dividing the geofence, first, the first acquisition unit 1001 acquires crowdsourcing data including the dotting data of service behaviors reported by a large number of electronic devices in the grid map. Then, the first determination unit 1002 determines grid information such as the grid size, grid identifier, and the set of dotting data in the corresponding geographical area for each grid in the grid map based on the acquired crowdsourcing data. Further, the second determination unit 1003 determines M first grid sets corresponding to the target grid based on the target accuracy and the grid size of any grid (i.e., the target grid) in the grid map. Among them, the target grid corresponds to M expanded grids, and the M expanded grids include the target grid and (M - 1) grids associated with the target grid. Each first grid set includes grids associated with one of the M expanded grids. M is a positive integer. Still further, the third determination unit 1004 determines a plurality of first dotting data sets based on the M first grid sets corresponding to each target grid in the grid map. Among them, one first grid set corresponds to one first dotting data set. Finally, the fourth determination unit 1005 determines the geofence of the grid map based on the plurality of first dotting data sets corresponding to each target grid in the grid map. In the embodiment of the present application, by taking the plurality of first dotting data sets corresponding to each target grid in the grid map as an independent calculation entity, compared with taking each target grid in the grid map as an independent calculation entity in the prior art, it reduces as much as possible the problem that the dotting data originally belonging to the same category in the grid map (such as dotting data with similar service behaviors) cannot be calculated uniformly because they are divided into different grids. Therefore, the geofence of the grid map determined by the embodiment of the present application can more accurately reflect the actual geographical features or user behavior patterns of the geographical area corresponding to the grid map, improve the accuracy of geofence division, and enable the user to receive more accurate recommended services when entering the geographical area corresponding to the geofence, thereby enhancing the user experience.
[0260] In a possible implementation manner, the target accuracy is determined based on the size of the association radius, and is used to indicate the expected accuracy of the geofence; the association radius is a distance range used to determine whether the dotting data is associated.
[0261] In a possible implementation manner, the second determination unit 1003 is specifically configured to:
[0262] Determine a first row-column range based on the association radius and the grid size of the target grid; the first row-column range is the row-column range where a specific grid in the M first grid sets is located;
[0263] Based on the first row-column range, determine M first grid sets corresponding to the target grid.
[0264] In a possible implementation, the second determination unit 1003 is specifically configured to:
[0265] Based on the association radius and the grid size of the target grid, determine the extended row-column number of the target grid;
[0266] Based on the row-column position where the target grid is located and the extended row-column number, determine the first row-column range; wherein, the first row-column range includes the maximum row-column value and the minimum row-column value 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 a possible implementation, the second determination unit 1003 is specifically configured to:
[0268] Traverse from the minimum row-column value of the specific grid to the maximum row-column value of the specific grid to determine the second row-column range; the second row-column range includes the maximum row-column value and the minimum row-column value of all grids in each of the M first grid sets corresponding to the target grid;
[0269] Based on the second row-column range, determine M first set identifiers; the first set identifier is used to indicate one of the M first grid sets.
[0270] In a possible implementation, the geographical fence dividing device further includes:
[0271] A fifth determination unit, configured 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 dotting 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 and is used to indicate the M first grid sets corresponding to each target grid.
[0272] In a possible implementation, the third determination unit 1004 is specifically configured to:
[0273] Based on the first information list, for each of the first set identifiers in the second set identifier, expand the grid identifier of the grid involved in each first set identifier, the set of dotting data in the corresponding geographical area, and the second set identifier involved, to obtain a second information list;
[0274] Merge the sets of dotting data within the geographical regions corresponding to the grids involved in 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 dotting data sets; wherein, the multiple first dotting data sets include the dotting data within the geographical regions corresponding to one or more grids involved in one of the merged first set identifiers.
[0275] In a possible implementation manner, the fourth determination unit 1005 is specifically configured to:
[0276] Based on the multiple first dotting data sets corresponding to each of the target grids in the grid map, calculate a target geographical fence through a density-based clustering algorithm; the target geographical fence includes the geographical fences within the geographical regions corresponding to all the grids in each first grid set after merging the same first grid sets in the M first grid sets corresponding to each of the target grids;
[0277] Determine the geographical fence of the grid map based on the target geographical fence.
[0278] In a possible implementation manner, the fourth determination unit 1005 is specifically configured to:
[0279] According to each of the merged first set identifiers in the third information list, calculate the grid code of the core grid in the corresponding first grid set;
[0280] Based on the grid code of each of the core grids, obtain a second dotting data set; the second dotting data set includes the dotting data within the geographical regions corresponding to each of the core grids;
[0281] By traversing the dotting data in the second dotting data set, determine the associated dotting data of each dotting data based on the association radius;
[0282] Determine a third dotting data set based on the second dotting data set and the associated dotting data; the third dotting data set includes the dotting data within the geographical regions corresponding to each of the core grids and the corresponding associated dotting data;
[0283] Through performing the density-based clustering algorithm learning on all the dotting data in the third dotting data set, calculate the target geographical fence.
[0284] In a possible implementation manner, the fourth determination unit 1005 is specifically configured to:
[0285] By traversing each target geofence in the target geofences, determine whether the center point of the target geofence is located in the core grid of the corresponding first grid set;
[0286] If so, retain the target geofence;
[0287] If not, delete the target geofence;
[0288] Merge the retained target geofences to obtain the geofence of the grid map.
[0289] It should be noted that the functions of each unit in the geofence division device 1000 described in the embodiments of the present application can be referred to the relevant descriptions in the foregoing method embodiments, and will not be elaborated here. It can be understood that the device and method provided in the embodiments of the present 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 function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces, and the indirect coupling or communication connection of the device or unit can be in electrical, mechanical or other forms.
[0290] Please refer to Figure 11 , Figure 11 which is a schematic hardware structure diagram of another electronic device provided by the embodiments of the present application. As Figure 11 shown, the electronic device 1100 includes at least one processor 1101 and a memory 1102. Among them, the processor 1101 is coupled to the memory 1102. The coupling in the embodiments of the present application can be a communication connection, which can be electrical or other forms. The processor 1101 and the memory 1102 can be connected through a bus 1103. Specifically, the memory 1102 is used to store program instructions. The processor 1101 is used to call the program instructions stored in the memory 1102, so that the electronic device 1100 can execute the steps in the geofence division method provided by the embodiments of the present application. The descriptions of its various components and related steps can be referred to above, and will not be elaborated here.
[0291] It should be noted that the electronic device 1100 provided by the embodiments of the present application may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or different component arrangements. The components shown in the figure can be implemented in hardware, software or any combination of software and hardware.
[0292] An embodiment of the present application further provides a computer-readable storage medium. The computer-readable storage medium may store a program. When the computer program is executed by a processor, it implements some or all of the steps of any one of the methods for dividing a geographical fence described in the above method embodiments.
[0293] An embodiment of the present application further provides a computer program. The computer program includes instructions. When the computer program is executed by a computing device, the computing device can execute some or all of the steps of any one of the above methods for dividing a geographical fence.
[0294] In the above embodiments, the descriptions of the respective embodiments have their own focuses. For parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0295] As used in the above embodiments, depending on the context, the term "when..." may be interpreted to mean "if...", or "after...", or "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if detecting (the stated condition or event)" may be interpreted to mean "if determining...", or "in response to determining...", or "when detecting (the stated condition or event)", or "in response to detecting (the stated condition or event)".
[0296] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present application is not limited by the described order of actions. Because according to the present application, certain steps may be performed in other orders or simultaneously, or some steps may be omitted, multiple steps may be combined into one step for execution, and / or one step may be decomposed into multiple steps for execution. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present application. It should also be noted that according to the present disclosure, the features and functions of two or more devices may be embodied in one device. Conversely, the features and functions of one device described above may be further divided and embodied by multiple devices.
[0297] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of 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, the processes or functions described in this application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. 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 by wire (such as coaxial cable, optical fiber, digital subscriber line) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that the computer can access or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk).
[0298] Those of ordinary skill in the art can understand that all or part of the processes in the above embodiments of the method can be completed by instructing relevant hardware with a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above method embodiments. The foregoing storage medium includes various media that can store program codes, such as ROM or random access memory RAM, magnetic disks, or optical discs.
[0299] In summary, the above are only embodiments of the technical solutions of the present invention and are not used to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made based on the disclosure of the present invention shall be included within the protection scope of the present invention.
Claims
1. A method for dividing a geofence, characterized in that, Including: Obtaining crowdsourcing data of a grid map, where the crowdsourcing data includes dot data of service behaviors reported by a plurality of electronic devices; Based on the crowdsourcing data, determining grid information of each grid in the grid map, where the grid information includes grid size, grid identifier, and a set of dot data within the corresponding geographic area; Based on a target accuracy and the grid size of a target grid, determining M first grid sets corresponding to the target grid, where 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; Based on the M first grid sets corresponding to each target grid in the grid map, determining a plurality of first dot data sets, where one first grid set corresponds to one first dot data set; Based on the plurality of first dot data sets corresponding to each target grid in the grid map, determining a geographic fence of the grid map.
2. The method according to claim 1, characterized in that The target accuracy is determined based on the size of an association radius, and is used to indicate the desired accuracy of the geographic fence; the association radius is a distance range used to determine whether dot data is associated.
3. The method according to claim 1 or 2, characterized in that, The determining, based on a target accuracy and the grid size of a target grid, M first grid sets corresponding to the target grid includes: Based on the association radius and the grid size of the target grid, determining a first row-column range; the first row-column range is the row-column range where a specific grid in the M first grid sets is located; Based on the first row-column range, determining the M first grid sets corresponding to the target grid.
4. The method according to claim 3, characterized in that, The determining, based on the association radius and the grid size of the target grid, a first row-column range includes: Based on the association radius and the grid size of the target grid, determining the extended row-column number of the target grid; Based on the row-column position where the target grid is located and the extended row-column number, determining the first row-column range; wherein, the first row-column range includes the maximum row-column value and the minimum row-column value of the specific grid, and the specific grid is the grid at a specific position in each first grid set of the M first grid sets.
5. The method according to claim 3 or 4, characterized in that, The determining, based on the first row-column range, M first grid sets corresponding to the target grid includes: Traversing from the minimum row-column value of the specific grid to the maximum row-column value of the specific grid to determine a second row-column range; the second row-column range includes the maximum row-column value and the minimum row-column value of all grids in each of the M first grid sets corresponding to the target grid; Based on the second row-column range, determining M first set identifiers; the first set identifiers are used to indicate one of the M first grid sets.
6. The method according to any one of claims 1 to 5, characterized in that The method further includes: 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 dotting data within 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.
7. The method according to claim 6, wherein Determining a plurality of first dotting 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 grid identifier of the grid involved in each first set identifier, the set of dotting data within the corresponding geographical area, and the second set identifier involved, to obtain a second information list; Merge the sets of dotting data within the geographical areas corresponding to the grids involved in 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 plurality of first dotting data sets; wherein, the plurality of first dotting data sets include the dotting data within the geographical areas corresponding to one or more grids involved in one merged first set identifier.
8. The method according to any one of claims 1 to 7, characterized in that Determining the geographical fence of the grid map based on the plurality of first dotting data sets corresponding to each target grid in the grid map includes: Based on the plurality of first dotting data sets corresponding to each target grid in the grid map, calculate a target geographical fence through a density-based clustering algorithm; the target geographical fence includes the geographical fences within the geographical areas corresponding to all the grids in each first grid set after merging the same first grid sets in the M first grid sets corresponding to each target grid; Determine the geographical fence of the grid map based on the target geographical fence.
9. The method according to claim 8, wherein Calculating the target geographical fence through a density-based clustering algorithm based on the plurality of first dotting data sets corresponding to each target grid in the grid map includes: According to each merged first set identifier in the third information list, calculate the grid code of the core grid in the corresponding first grid set; Based on the grid code of each core grid, obtain a second dotting data set; the second dotting data set includes the dotting data within the geographical area corresponding to each core grid; By traversing the dotting data in the second dotting data set, determine the associated dotting data of each dotting data based on the association radius; Determine a third dotting data set based on the second dotting data set and the associated dotting data; the third dotting data set includes the dotting data within the geographical area corresponding to each core grid and the corresponding associated dotting data; Through performing the density-based clustering algorithm learning on all the dotting data in the third dotting data set, calculate the target geographical fence.
10. The method according to claim 8 or 9, characterized in that Determining the geofence of the grid map based on the target geofence includes: By traversing each target geofence in the target geofence, determining whether the center point of the target geofence is located in the core grid of the corresponding first grid set; If so, retain the target geofence; If not, delete the target geofence; Merge the retained target geofences to obtain the geofence of the grid map.
11. A device for dividing a geographical fence, characterized in that, Including: A first acquisition unit for acquiring crowdsourcing data of the grid map, where the crowdsourcing data includes the dot data of service behaviors reported by a plurality of electronic devices; A first determination unit for determining the grid information of each grid in the grid map based on the crowdsourcing data, where the grid information includes the grid size, grid identifier, and a set of dot data in the corresponding geographical area; A second determination unit for determining M first grid sets corresponding to the target grid based on the target accuracy and the grid size of the target grid, where the target grid is any grid in the grid map, the target grid corresponds to M expanded grids, the M expanded grids include the target grid and (M - 1) grids associated with the target grid, and M is a positive integer; wherein, one expanded grid corresponds to one first grid set, and one first grid set includes the corresponding expanded grid and the grids associated with the corresponding expanded grid; A third determination unit for determining a plurality of first dot data sets based on the M first grid sets corresponding to each target grid in the grid map, where one first grid set corresponds to one first dot data set; A fourth determination unit for determining the geofence of the grid map based on the plurality of first dot data sets corresponding to each target grid in the grid map.
12. An electronic device, characterized in that, The electronic device includes a memory and a processor, where the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device executes 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, and when the computer program is executed by a processor, it implements the method according to any one of claims 1-9.
14. A computer program, characterized in that, The computer program includes instructions, and the computer program is executed by a computing device to implement the method according to any one of claims 1-9.
Citation Information
Patent Citations
Triggering method of geo-fence and related electronic equipment
CN116056003A
Fingerprint database generation method and electronic equipment
CN116680468A
Cell position updating method, server and storage medium
CN117135573A
Proximity-based offline geofencing
US20220312147A1
Systems, methods and apparatus for geofence networks
US20230090938A1