Geoffects generation method, use method, device, medium and program product
By generating geofences, using base station data and cluster fitting algorithms, the high power consumption and privacy violations caused by terminal equipment frequently obtaining location information is solved, and accurate geofence push is achieved, reducing the risk of false triggering.
Patent Information
- Application Number
- CN202410047136.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-10
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2044-01-10
AI Technical Summary
In the prior art, frequent acquisition of location information of terminal devices is achieved to determine that geofence matching leads to high power consumption and infringes on user privacy, and inaccurate base station coverage leads to false triggering of services.
By acquiring base station data, geofences are generated based on the base station coverage, geofences are generated using base station data, reducing dependence on terminal equipment location information, and using clustering and fitting algorithms to determine the base station center and coverage range to generate accurate geofences.
It reduces the power consumption of terminal devices, reduces the acquisition of user location information, improves the accuracy of geofences, avoids accidentally triggering services, and realizes precise push of geofence corresponding services.
Smart Images

Figure CN120343493A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic information technology, and in particular to a method for generating a geofence, a usage method, a device, a medium, and a program product. Background Art
[0002] Geofencing is a technology based on location-based services (LBS), that is, a virtual fence is used to enclose a virtual geographical boundary. When it is detected that the terminal device enters, leaves, or moves within a specific geographical area, the relevant operations corresponding to the geofence will be triggered or closed.
[0003] Currently, different geofences can be formed based on different service requirements. In this way, when it is determined that the area where the user is located matches the position of the geofence based on the location information of the terminal device, such as the longitude and latitude coordinates of the terminal device, it is considered that the user enters or leaves the geofence. Furthermore, the relevant operations corresponding to the geofence can be triggered, such as making service recommendations corresponding to the geofence. However, frequently obtaining the location information of the terminal device requires the terminal device to consume a large amount of power, and the precise location information of the terminal device belongs to the user's privacy information, which invisibly violates the user's privacy. Summary of the Invention
[0004] To avoid frequently obtaining the location information of the terminal device, embodiments of this application provide a method for generating a geofence, a usage method, a device, a medium, and a program product.
[0005] In a first aspect, embodiments of this application provide a method for generating a geofence. The method for generating a geofence includes: obtaining base station data related to a target service executed by a terminal device in a first area, where the base station data includes the location information of the terminal device when connecting at least one base station in the first area and executing the target service; determining the coverage range of each base station in the first area based on the base station data; and generating a geofence corresponding to the target service of the terminal device based on the coverage range of each base station in the first area, where the geofence includes at least one base station in the first area that meets the coverage condition.
[0006] It can be understood that the first area may be the target area in the embodiments of this application, and the target service may be any service that uses the positioning function, such as map services, services for entering and leaving subway stations, services for entering and leaving express delivery stations, services for entering and leaving high-speed railway stations, and services for entering and leaving airports, etc. The base station data may be the crowdsourcing data in the embodiments of this application, and the base station data includes information such as longitude and latitude information, base station information (cellid), city code, and location area code (LAC).
[0007] In an embodiment of the present application, a geofence is generated based on base station data, so that it is not necessary to frequently retrieve the location information of the terminal device, and the geofence corresponding to the terminal device can be determined according to the base station to which the terminal device is currently connected, and relevant operations of the geofence are pushed, realizing the accurate push of services corresponding to the geofence to users and reducing the power consumption caused by frequent use of positioning.
[0008] In a possible implementation, the coverage condition includes: the base station center of the base station is within the first area, and the proportion of the coverage range of the base station within the first area is greater than the first threshold.
[0009] It can be understood that the first threshold can be any real number between 0 and 1, for example, 0.5.
[0010] In a possible implementation, generating a geofence corresponding to a target service of a terminal device based on the coverage ranges of base stations in a first area includes: determining the base stations in the first area that meet the coverage condition based on the coverage ranges and base station centers of the base stations in the first area; generating a geofence corresponding to the target service of the terminal device based on the base stations in the first area that meet the coverage condition.
[0011] For example, as Figure 6b shown, the target area T of service T includes base stations 1, 2, 3, 4, 5, 6, 7, 8, and 9. It is determined that the base station centers of base stations 1, 2, 3, 4, 5, 6, 7, and 8 are within the target area T, and the proportion of the coverage range of the base stations within the target area T is greater than the first threshold, such as 0.5; the base station center of base station 9 is not within the target area T, and the proportion of the coverage range of the base station within the target area T is less than the first threshold, such as 0.5. Therefore, a geofence for service T is generated based on base stations 1, 2, 3, 4, 5, 6, 7, and 8.
[0012] In a possible implementation, at least one base station includes a first base station; and determining the coverage ranges of base stations in the first area based on base station data includes: clustering the multiple positions represented by each base station data based on the location information in the multiple base station data of the first base station to obtain at least one first clustering area; repeating the following operations until the number of first clustering areas is 1: deleting the base station data corresponding to the positions that are not within the LAC area of the first base station among the positions represented by each base station data in at least one first clustering area; clustering the remaining base station data after deletion to obtain at least one first clustering area of the first base station.
[0013] It can be understood that the first clustering area may be an effective cluster in the embodiment of the present application.
[0014] It can be understood that the LAC is an identifier of the characteristics of the base station area. The coverage area of the LAC is an irregular polygon, and it is necessary to describe the specific polygon to more closely match the actual area range. For example, Figure 1 as shown Figure 1 shows a schematic diagram of two LACs.
[0015] In a possible implementation, a method for determining the LAC area of the first base station includes: aggregating each LAC included in the first area according to the administrative area of the city to obtain the LAC area of the first base station.
[0016] In a possible implementation, a method for determining whether base station data is located within the LAC area of the first base station includes: drawing a ray from each piece of base station data of the first base station; corresponding to the number of intersection points of the ray and the LAC area of the first base station being odd, determining that the base station data is located within the LAC area of the first base station; corresponding to the number of intersection points of the ray and the LAC area of the first base station being even, determining that the base station data is not located within the LAC area of the first base station.
[0017] For example, as Figure 10b shown, draw a ray from the dot data A, and determine that the number of intersection points of the dot data A and the polygon is 1, then determine that the dot data A is inside the polygon, and the base station corresponding to the dot data A is the base station within the LAC.
[0018] In a possible implementation, based on the location information in the multiple pieces of base station data of the first base station, clustering the multiple locations represented by each piece of base station data to obtain at least one first clustering area, including: clustering the multiple locations represented by each piece of base station data based on the clustering algorithm and the location information in the multiple pieces of base station data of the first base station to obtain at least one first clustering area; where the clustering algorithm includes at least one of the density-based spatial clustering of applications with noise (DBSCAN) algorithm, the k-means clustering algorithm (K-means), and the hierarchical clustering algorithm.
[0019] In a possible implementation, based on the base station data, determining the coverage range of each base station in the first area further includes: generating a first coverage area of the first base station based on 1 first clustering area.
[0020] In a possible implementation, generating a first coverage area of the first base station based on 1 first clustering area includes: fitting the first clustering area of the first base station to obtain a first coverage area with a preset shape.
[0021] In a possible implementation, fitting the first clustering area of the first base station to obtain a first coverage area with a preset shape includes: fitting the first clustering area through a fitting algorithm to obtain a first coverage area with a preset shape; wherein, the fitting algorithm includes at least one of the algebraic approximation method, the least squares method, and the orthogonal distance regression method.
[0022] In a possible implementation, the preset shape includes at least one of the following: circle, rectangle, rhombus, polygon.
[0023] In a possible implementation, the center point of the first base station is the point in the first clustering area of the first base station where the position density corresponding to the base station data is the highest and the number of connections to the base station is the most.
[0024] In a possible implementation, clustering the multiple positions represented by each base station data based on the clustering algorithm and the position information in the multiple base station data of the first base station to obtain at least one first clustering area includes: bucketing the multiple base station data of the first base station based on the administrative region of the city and the position information in the multiple base station data of the first base station to obtain bucketing data; clustering the multiple positions represented by the bucketing data according to the cell and the clustering algorithm to obtain at least one first clustering area.
[0025] In a possible implementation, before determining the coverage range of each base station in the first area based on the base station data, deleting the data in the base station data that does not meet the compliance conditions; the compliance conditions include: the city code of the base station data meets the first interval corresponding to the city code, the cellid of the base station data meets the second interval corresponding to the cellid, the LAC area of the base station data meets the third interval corresponding to the LAC area, and the longitude and latitude of the base station data meet the fourth interval corresponding to the longitude and latitude.
[0026] In a second aspect, an embodiment of the present application provides a method for using a geofence, which is characterized by including: during the movement of the terminal device, detecting that the terminal device is connected to a first base station; the terminal device executes the operation corresponding to the geofence to which the first base station belongs.
[0027] In a possible implementation, the operations corresponding to the geofence include at least one of triggering a recommendation service, triggering a notification service, and triggering a registration service.
[0028] For example, if the target service is the card - swiping service for entering and leaving the subway station, the related operation of triggering the geofence is to pop up the ride code.
[0029] In a third aspect, an embodiment of the present application provides a terminal device, comprising: a memory for storing instructions executed by one or more processors of the terminal device, and a processor, which is one of the one or more processors of the terminal device, for implementing any method for generating a geographic fence provided by the first aspect and various possible implementations of the first aspect, and any method for using a geographic fence provided by the second aspect and various possible implementations of the second aspect.
[0030] In a fourth aspect, an embodiment of the present application provides a readable medium having instructions stored thereon, which, when executed on an electronic device, enables the electronic device to implement any method for generating a geographic fence provided by the first aspect and various possible implementations of the first aspect, as well as any method for using a geographic fence provided by the second aspect and various possible implementations of the second aspect.
[0031] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes computer instructions. When executed by an electronic device, the electronic device executes any method for generating a geographic fence provided by the first aspect and various possible implementations of the first aspect, and any method for using a geographic fence provided by the second aspect and various possible implementations of the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 According to an embodiment of the present application, a schematic diagram of a polygon corresponding to a LAC area is shown;
[0033] Figure 2 According to an embodiment of the present application, a schematic diagram of a geo-fence application scenario is shown;
[0034] Figure 3 According to an embodiment of the present application, a schematic flow chart of a method for using a geographic fence is shown;
[0035] Figure 4a According to an embodiment of the present application, a schematic diagram of a scenario including multiple base stations in area A is shown;
[0036] Figure 4b According to an embodiment of the present application, a schematic diagram of dot data included in area A is shown;
[0037] Figure 4c According to an embodiment of the present application, a schematic diagram of a base station coverage range L1 in area A is shown;
[0038] Figure 4d According to an embodiment of the present application, a schematic diagram of a geo-fence A1 is shown;
[0039] Figure 5aAccording to an embodiment of the present application, a schematic diagram of a geofence B1 is shown;
[0040] Figure 5b According to an embodiment of the present application, a schematic diagram of a geofence B1' is shown;
[0041] Figure 6a According to an embodiment of the present application, a flowchart schematic diagram of a method for generating a geofence is shown;
[0042] Figure 6b According to an embodiment of the present application, a scenario schematic diagram of a method for generating a geofence is shown;
[0043] Figure 7 According to an embodiment of the present application, a flowchart schematic diagram of a method for determining a base station coverage area is shown;
[0044] Figure 8 According to an embodiment of the present application, a distribution schematic diagram of dot data is shown;
[0045] Figure 9 According to an embodiment of the present application, a schematic diagram of multiple valid clusters is shown;
[0046] Figure 10a According to an embodiment of the present application, a schematic diagram of a polygon corresponding to another LAC area is shown;
[0047] Figure 10b According to an embodiment of the present application, a scenario schematic diagram for determining whether dot data is within a polygon corresponding to an LAC area is shown;
[0048] Figure 11 According to an embodiment of the present application, a schematic diagram of the base station coverage area L1 within a target area is shown;
[0049] Figure 12 According to an embodiment of the present application, a schematic diagram of the coverage areas of base stations C1, C2, and C3 is shown;
[0050] Figure 13 According to some embodiments of the present application, a schematic diagram of the structure of an electronic device 10 is shown. Detailed implementation manners
[0051] The illustrative embodiments of the present application include, but are not limited to, a method for generating a geofence, a method for using the geofence, a device, a medium, and a program product.
[0052] First, the technical terms related to the present application will be explained below.
[0053] Network positioning technology: It refers to a technology that determines the location information of a terminal device by using the characteristic that the signal strength is different at different positions in space, where the signal can specifically be a Wi-Fi signal, a Bluetooth signal, etc. The network positioning technology needs to first collect the signals and location coordinates of each position coordinate according to the distribution of the signal strength values to form a mapping relationship between the signals and the location coordinates, that is, to construct a fingerprint database, and the fingerprint database can be deployed in a network server. Furthermore, after a terminal device, such as a mobile phone, receives signal data (such as Wi-Fi fingerprints scanned by the mobile phone or Bluetooth fingerprints connected by the mobile phone), it can send the signal data to the network server, so that the network server can obtain the location information of the terminal device according to the fingerprint database and return it to the terminal device.
[0054] It can be understood that in some embodiments, the fingerprint database includes a Wi-Fi fingerprint database, a Bluetooth fingerprint database, etc.
[0055] Crowdsourced data: It refers to the location information obtained by many terminal devices when enabling a specific service with the positioning function. This location information can also be called dotting data, such as longitude and latitude information, base station information (cellid), city code, and location area code (LAC).
[0056] Among them, the specific service refers to a service that will use the positioning function of the terminal device during the use of the terminal device. For example, map services, services for entering and leaving subway stations, services for entering and leaving express delivery stations, services for entering and leaving high-speed railway stations, and services for entering and leaving airports, etc. Among them, the map service is specifically, for example, a navigation behavior, the service behavior for entering and leaving a subway station is specifically, for example, the behavior of entering / exiting the station by scanning a code or swiping a card, the service behavior for entering and leaving an express delivery station is, for example, the behavior of sending / receiving a package by scanning a code, the service behavior for entering and leaving a high-speed railway station is, for example, the behavior of checking tickets by scanning a code, and the service behavior for entering and leaving an airport is, for example, the behavior of checking tickets by scanning a code, etc.
[0057] Cellid: Each base station will have a cellid that can uniquely identify the base station. Therefore, according to the obtained cellid, the base station corresponding to the terminal device can be determined.
[0058] LAC: In order to determine the location of a mobile station, the coverage area of each public land mobile network (PLMN) of a global system for mobile communications (GSM) is divided into many location areas, and the LAC is used to identify different location areas. Among them, the LAC is divided according to regions and has certain geographical boundaries, but the area of the LAC is not exactly the same as the administrative region.
[0059] It can be understood that each base station has a unique cellid and LAC.
[0060] In some embodiments, a globally unique base station can be identified by a mobile country code (MCC), a mobile network code (MNC), an LAC, and a cellid.
[0061] It can be understood that the LAC is an identifier of the base station area characteristics. The coverage area of the LAC is an irregular polygon, and a specific polygon description is required to more closely match the actual area range, such as Figure 1 shown Figure 1 shows a schematic diagram of two LACs. It can be understood that there will be an error between the LAC boundaries marked by the square and circular representations and the actual area range of the LAC.
[0062] Geofence: It refers to a virtual geographical boundary enclosed by a virtual fence. When a user arrives near a certain geographical location, the user's mobile phone can determine the geofence corresponding to the mobile phone's location information (such as the longitude and latitude coordinates of the monitored mobile phone) based on the location information of the mobile phone, so as to recommend services corresponding to the geofence to the user.
[0063] The following Figure 2 introduces the triggering scenarios of geofences.
[0064] For example, Figure 2 as shown in the geofence 1 is the geofence of subway station A1, and the geofence 2 is the geofence of cinema A2. When user A enters geofence 1, the mobile phone 100 of user A pops up a ride code card so that the user can take the bus without manually opening the application corresponding to the ride code. When user A enters geofence 2 from geofence 1, the mobile phone 100 of user A can pop up a ticket collection reminder to remind the user of the ticket collection time and prevent the user from missing the movie start.
[0065] See Figure 3 , Figure 3 shows a schematic flowchart of a triggering scenario of a geofence, which is applied to an electronic device. The specific process is as follows:
[0066] 301: Obtain the location information of the terminal device.
[0067] In the embodiments of the present application, the electronic device can obtain the location information of the terminal device through network positioning technology, such as the longitude and latitude coordinates of a mobile phone.
[0068] 302: Determine the geofence that matches the location information of the terminal device.
[0069] For example, if it is determined according to the location information of the terminal device that the terminal device is within the coordinate data range of the geofence 1, it is determined that the terminal device matches the geofence 1. If it is determined according to the location information of the terminal device that the terminal device is within the coordinate data range of the geofence 2, it is determined that the terminal device matches the geofence 2.
[0070] 303: Trigger the geofence.
[0071] It can be understood that triggering the geofence can be for the terminal device to recommend relevant operations corresponding to the geofence to the user. For example, the terminal device recommends services corresponding to the geofence to the user, or it can be for the terminal device to execute relevant operations corresponding to the geofence. For example, the terminal device executes services corresponding to the geofence. In the embodiments of the present application, taking triggering the geofence as an example that the terminal device recommends the service of the geofence to the user is described.
[0072] For example, as Figure 2 shown, if the mobile phone 100 matches the geofence 1, the geofence 1 is triggered, and the mobile phone 100 can display a ride code card on the user interface so that the user can take the ride without manually opening the application corresponding to the ride code. If the mobile phone 100 matches the geofence 2, the geofence 2 is triggered, and the mobile phone 100 can pop up a ticket collection reminder on the user interface to remind the user of the ticket collection time and prevent the user from missing the movie start. If the mobile phone 100 matches the geofence 3 of the express station, the geofence 3 is triggered, and the mobile phone 100 can pop up a pick-up reminder on the user interface to remind the user to pick up the express in time.
[0073] From the above introduction, it can be seen that in the process of determining the geofence that matches the terminal device, it is necessary to continuously obtain the location information of the terminal device, which consumes a large amount of power, and moreover, the location information of the terminal device includes the privacy information of the user, which virtually violates the privacy of the user.
[0074] It can be understood that during the user's use of the terminal device, the terminal device will continuously access the network. Therefore, the terminal device will continuously enter the process of accessing the communication base station - disconnecting from the communication base station - accessing the communication base station. And in the process of network deployment, the location and coverage range of the base station are fixed for a period of time.
[0075] Therefore, in order to solve the above problems, an embodiment of the present application provides a method for generating a geo-fence. The method for generating a geo-fence generates a geo-fence corresponding to each service based on the base station data accessed by the user when using each service. When the user is using the terminal device for the target service, the base station data connected to the terminal device can be obtained, and the geo-fence can be determined based on the obtained base station data. In the subsequent use of the terminal device by the user, if the base station corresponding to the geo-fence is connected, the relevant operations of the target service corresponding to the geo-fence will be triggered. For example, if the target service is a card swiping service for entering and exiting a subway station, the relevant operation that triggers the geo-fence is the pop-up boarding code. Therefore, there is no need to frequently retrieve the location information of the terminal device, and the geo-fence corresponding to the terminal device can be determined according to the base station currently connected to the terminal device, and the relevant operations of the geo-fence can be pushed, so as to accurately push the services corresponding to the geo-fence to the user and reduce the power consumption caused by frequent use of positioning.
[0076] It is understood that in some embodiments, the geo-fence of each service may be generated based on the base station data in the following manner:
[0077] 1) Obtain crowdsourced data in the target area, where the crowdsourced data includes the dot data generated when the user connects to the base station when using the target service, that is, including latitude and longitude information, cellid, city code, LAC, etc.
[0078] 2) Based on the dot data of each base station in the target area, determine the base station center and coverage of each base station. The base station center is the center of the location identified by the longitude and latitude information when the terminal device executes the target service to connect to the base station, that is, the location with dense dot data and the most base station connections. In the embodiment of the present application, the dot data of each base station can be fitted to obtain a fitting circle representing the coverage of each base station.
[0079] 3) The coverage of each base station in the target area is merged to obtain the geo-fence corresponding to the target service in the target area.
[0080] For example, Figure 4a As shown, when a user in area A uses target service S1, the base stations accessed include base stations B1 to B5. The coverage of each base station can be determined by obtaining the dot data of each base station in area A, and the geo-fence corresponding to target service S1 can be generated based on the coverage of each base station.
[0081] For example, Figure 4b As shown, Figure 4bEach circle in it represents the location where the user is using the target service S1 and connecting to the base station B1 in area A. When determining that the user is using service A, the locations are relatively concentrated, that is, the center point P with the highest dot data density is the center point of base station B1. The coverage radius R1 can be determined according to the base station type of base station B1. Taking point P as the center and R1 as the coverage radius, the coverage area L1 of base station B1 as shown in Figure 4c is generated. Among them, the method for determining the signal coverage areas of base stations B2 to B5 is the same as that for determining the signal coverage area of base station B1, and will not be elaborated here.
[0082] Based on the base stations included in service A, such as the signal coverage areas of base stations B1 to B5, the geographical fence A1 of service A as shown in Figure 4d is generated. In this way, during the process of the user using the terminal device, if it is determined that the base station connected by the terminal device is within the coverage area of any base station in the geographical fence A1, such as the base station connected by the terminal device is base station B1, then service A is triggered.
[0083] In some embodiments, in order to improve the accuracy of the determined base station center, the crowdsourcing data can also be screened and clustered, thereby narrowing the scope of the crowdsourcing data. Specifically, it includes: deleting the illegal data in the crowdsourcing data, where the illegal data refers to the data whose longitude and latitude information, cellid, city code, and LAC exceed the reasonable range; deleting the data in the crowdsourcing data that is not within the area corresponding to the LAC; deleting the data with positioning drift in the crowdsourcing data.
[0084] In the embodiments of the present application, clustering the crowdsourcing data includes: clustering the crowdsourcing data based on the density-based spatial clustering of applications with noise (DBSCAN).
[0085] It can be understood that since the signal is unstable when the user is near a highway, subway, or expressway, there will be data with positioning drift, that is, there will be relatively large along-line error data in the crowdsourcing data of the base stations near the highway, subway, or expressway, resulting in different base station coverage areas for the same base station.
[0086] In the embodiments of the present application, in order to avoid the problem of different base station coverage areas for the same base station, the data is cleaned through a box plot with adaptive parameters to filter the data with positioning drift. By performing secondary clustering on the crowdsourcing data, only one effective cluster is left for each base station, avoiding the problem of too large a radius of the base station coverage area, and obtaining the crowdsourcing data that can reproduce the base station coverage area.
[0087] The following combines Figure 5a and Figure 5b, compare the geofence B1 obtained without using the geofence generation method provided by this application with the geofence B1' obtained using the geofence generation method provided by this application.
[0088] As Figure 5a shown, in the geofence B1 obtained without using the geofence generation method provided by this application, the same base station has multiple coverage areas. For example, cellid5 has two coverage areas; cellid8 also has two coverage areas, and one of the coverage areas is inside the geofence B1, and the other coverage area is outside the geofence B1.
[0089] When user A walks to position A1 within the coverage area of cellid3, it is determined that user A is inside the geofence B1, and the service corresponding to the geofence B1 is triggered. When user B walks to position B1 within the coverage area of cellid3, it is determined that user B is inside the geofence B1, and the service corresponding to the geofence B1 is triggered.
[0090] However, if user B walks to position C of cellid8 outside the geofence B1, since another cellid8 belongs to the geofence B1, it will also be considered that user B is inside the geofence B1, and the service corresponding to the geofence B1 is triggered. However, at this time, user B is not inside the geofence B1, that is, the situation of mis-triggering the service corresponding to the geofence occurs.
[0091] As Figure 5b shown, in the geofence B1' obtained using the geofence generation method provided by this application, each base station has only one coverage area, and the coverage area of the base station is determined by screening and aggregating based on crowdsourcing data. The coverage area of the base station is more accurate, and the accuracy of the obtained geofence B1' will also be higher, avoiding the situation of mis-triggering the service corresponding to the geofence.
[0092] In the embodiments of the present application, the device for obtaining the crowdsourcing data of the base station and generating the geofence may be the electronic device 10, and the device for obtaining the base station to which the terminal device is connected, determining the corresponding geofence, and the target service may be specifically the electronic device 20. Specifically, the electronic device may be a mobile phone, a smart watch, a TV, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc. The electronic device may also be a physical server or a cloud device, such as an X86 server, an ARM server, etc., or may also be a virtual machine (VM) implemented based on a general physical server combined with network functions virtualization (NFV) technology. A virtual machine refers to a complete computer system with complete hardware system functions simulated by software and running in a completely isolated environment. The present application does not impose any restrictions on the specific type of the electronic device.
[0093] Optionally, the electronic device 10 and the electronic device 20 may be the same device.
[0094] Among them, the terminal device may be a device with a positioning function. For example, it includes but is not limited to a mobile phone, a smart watch, a TV, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc. The embodiments of the present invention do not impose any restrictions on the specific type of the terminal device.
[0095] The following will provide a detailed description of the geofence generation method provided by the embodiments of the present application. The geofence generation method of the embodiments of the present application is applied to the electronic device 10. Among them, Figure 6a FIG. shows a schematic diagram of a geofence generation method according to an embodiment of the present application. The geofence generation method includes:
[0096] 601: Obtain the crowdsourcing data in the target area.
[0097] It can be understood that the crowdsourced data includes the dotting data generated when the user's terminal device connects to the base station when using the target service, including the longitude and latitude information of the user when using the target service, the cellid, city code, LAC, etc. of the connected base station.
[0098] Among them, the target service can be any service that uses the positioning function, such as map services, services for entering and leaving subway stations, services for entering and leaving express delivery stations, services for entering and leaving high-speed railway stations, and services for entering and leaving airports, etc.
[0099] Optionally, in order to improve the accuracy of the crowdsourced data, the invalid data in the crowdsourced data can be cleaned. For example, delete the unreasonable dotting data in the crowdsourced data, such as illegal information where the longitude and latitude, cell number, etc. exceed the reasonable range.
[0100] It can be understood that the city code, cellid, LAC, longitude and latitude, etc. of each city are all standard within a certain range. In the embodiments of the present application, the unreasonable data in the crowdsourced data can be deleted, such as data where the city code, cell, LAC, longitude and latitude exceed the reasonable range, so as to select the data that is beneficial to learning the location and coverage range of the cellular network base stations.
[0101] For example, determine the city code range, cellid range, LAC range and longitude and latitude range of the city corresponding to the crowdsourced data, and delete the data in the crowdsourced data that do not meet the city code range, cellid range, LAC range and longitude and latitude range.
[0102] 602: Based on the dotting data in the crowdsourced data corresponding to each base station, determine the coverage range of each base station.
[0103] In the embodiments of the present application, clustering can be performed on the dotting data in the crowdsourced data corresponding to each base station to determine the effective clusters in the crowdsourced data corresponding to each base station, and then determine the center point of the position with the highest dotting data density and the most connected base stations in the effective clusters as the base station center; fit the dotting data of each base station to obtain a fitting circle representing the coverage range of each base station.
[0104] In the embodiments of the present application, the dotting data of each base station can be fitted through a fitting algorithm to obtain a fitting circle representing the coverage range of each base station. Among them, the fitting algorithm includes at least one of the algebraic approximation method, the least squares method, and the orthogonal distance regression method.
[0105] Optionally, clustering can be performed through a clustering algorithm, and the clustering algorithm can be any one of DBSCAN, K-means or hierarchical clustering.
[0106] In the embodiments of the present application, in order to ensure the efficiency of the clustering algorithm, the crowdsourcing data can also be divided according to the administrative regions of cities with the administrative regions of cities as the dimension, so as to obtain the crowdsourcing data corresponding to different cities.
[0107] 603: Combine the coverage ranges of each base station in the target area to obtain the geographical fence served in the target area.
[0108] In the embodiments of the present application, the base stations included in the service S1 in the target area can be determined, and then based on the base station center and coverage range of each base station determined in step 602, the coverage range of each base station is fitted to obtain the geographical fence of the service S1 in the target area, so that the obtained geographical fence of the service S1 includes the coverage range of each base station included in the service S1. It can be understood that the base station center represents the location of the base station.
[0109] For example, as Figure 4d shown, the geographical fence A1 of the service S1 includes the coverage range of each of the base stations B1, B2, B3, and B4 included in the service S1.
[0110] In the embodiments of the present application, the base stations that meet the coverage conditions in the target area can be determined based on the coverage ranges and base station centers of the base stations in the target area; and the geographical fence of the target service is generated based on the base stations that meet the coverage conditions in the target area.
[0111] Among them, the coverage condition includes that the base station center of the base station is within the first area, and the proportion of the coverage range of the base station within the first area is greater than the first threshold. It can be understood that the first threshold can be any real number from 0 to 1, for example, 0.5.
[0112] For example, as Figure 6b shown, the target area T of the service T includes base stations 1, 2, 3, 4, 5, 6, 7, 8, and 9. It is determined that the base station centers of base stations 1, 2, 3, 4, 5, 6, 7, and 8 are within the target area T, and the proportion of the coverage range of the base stations within the target area T is greater than the first threshold, such as 0.5; the base station center of base station 9 is not within the target area T, and the proportion of the coverage range of the base station within the target area T is less than the first threshold, such as 0.5. Therefore, the geographical fence of the service T is generated based on base stations 1, 2, 3, 4, 5, 6, 7, and 8.
[0113] During the movement of the terminal device, if it is detected that the terminal device is connected to base station 4, the terminal device executes the operation corresponding to the geographical fence to which base station 4 belongs. Among them, the operations corresponding to the geographical fence include at least one of triggering a recommended service, triggering a notification service, and triggering a registration service.
[0114] In this way, during the process of the user using the terminal device, the electronic device 10 or the electronic device 20 only needs to obtain the base station connected to the terminal device, and then it can determine the geographical fence corresponding to the base station, and further determine the geographical fence corresponding to the terminal device. Thereby triggering relevant operations for the terminal device to execute the services corresponding to the geographical fence. For example, if the target service is the card swiping service for entering and leaving the subway station, the relevant operation for triggering the geographical fence is to pop up the ride code.
[0115] Therefore, it is not necessary to frequently retrieve the location information of the terminal device. It is also possible to determine the geographical fence corresponding to the terminal device according to the base station currently connected to the terminal device, and push the relevant operations of the geographical fence, realizing the accurate push of the services corresponding to the geographical fence for the user, and reducing the power consumption caused by frequent use of positioning.
[0116] The following combines Figure 7 , and gives an example of the implementation of the above steps 601-602 in some other embodiments. Figure 7 The method for determining the coverage range of the base station shown can be applied to the electronic device 10, including:
[0117] 701: Crowdsourcing data.
[0118] In the embodiments of the present application, when the electronic device 10 acquires the location information (latitude and longitude information), LAC, cellid, and city code of the base station accessed by the terminal user when the terminal user uses the positioning function of the terminal device in the target area.
[0119] For example, as Figure 8 shown, it shows the dot data of the same base station connected when the terminal user uses the positioning function of the terminal device in the target area. Figure 8 In [the figure] the dot distribution of the terminal device is represented by circles.
[0120] 702: Cleaning of invalid value data.
[0121] In order to improve the accuracy of the acquired crowdsourcing data and reduce the scope of data processing, in the embodiments of the present application, the invalid value data in the crowdsourcing data can be cleaned to delete the unreasonable dot data in the crowdsourcing data, such as illegal information such as latitude and longitude and cell number that exceed the reasonable range.
[0122] It can be understood that the city code, cellid, LAC, longitude and latitude of each region have reasonable ranges within a certain area. For example, the range of the city code in region A is [123, 125], the range of cellid is [12345, 19999], the range of LAC is [22345, 29999], the range of longitude is [114.054935, 115.054935], and the range of latitude is [22.57692, 23.57692]. In some embodiments, the corresponding city code range, cellid range and LAC range can be determined according to the longitude and latitude of each region.
[0123] In the embodiments of the present application, unreasonable data in the crowdsourcing data can be deleted, such as data with city codes, cells, LACs, longitudes and latitudes exceeding the reasonable ranges, so as to select data beneficial to learning the location and coverage of cellular network base stations.
[0124] For example, determine the city code range, cellid range, LAC range and longitude and latitude range of the target region, and delete the data in the crowdsourcing data that do not meet the city code range, cellid range, LAC range and longitude and latitude range.
[0125] 703: Bucket by city and perform DBSCAN clustering by cell.
[0126] In the embodiments of the present application, in order to ensure the efficiency of the DBSCAN algorithm, taking the city area information as the dimension, the crowdsourcing data is divided according to the administrative regions of the cities, and then the crowdsourcing data corresponding to different cities is obtained; then based on the DBSCAN algorithm, the crowdsourcing data corresponding to each city is clustered according to the cell (cell), so that the crowdsourcing data of each cell can be obtained.
[0127] Such as Figure 9 shown, Figure 9 each circle in Figure 8 represents the schematic diagram of the dot data shown after DBSCAN clustering.
[0128] It can be understood that bucketing refers to the process of dividing a row of items or a plane into multiple buckets so that each bucket has corresponding internal information. Based on the bucketing method, the crowdsourcing data is bucketed according to the administrative regions of the cities, and the crowdsourcing data can be divided into multiple regions according to the administrative regions of each city, which is convenient for subsequent DBSCAN clustering of the crowdsourcing data based on the cell. For example, if the crowdsourcing data includes city A, city B, city C and city D, the crowdsourcing data can be bucketed according to the administrative positions of city A, city B, city C and city D.
[0129] In some embodiments, the cities corresponding to the crowdsourced data may be bucketed according to a grid size of 2 km*2 km, and each grid block corresponds to a target area, wherein the grid size includes but is not limited to 2 km*2 km.
[0130] It is understandable that in the process of bucketing the city, the division can also be performed based on road condition information. For example, for the area where the main roads of the city are located, the target area can be formed by dividing the area with the main roads as the boundary.
[0131] It can be understood that a cell is a cellular area, which is an area covered by a base station or a part of a base station (sector antenna) in a cellular mobile communication system, within which a terminal device can reliably communicate with the base station through a wireless channel.
[0132] It can be understood that clustering refers to the process of dividing a collection of physical or abstract objects into multiple classes consisting of similar objects. The cluster generated by clustering is a collection of data objects that are similar to objects in the same cluster and different from objects in other clusters.
[0133] In some embodiments, the crowdsourcing data corresponding to each city may be clustered according to the communities using a clustering algorithm such as K-means or hierarchical clustering to obtain crowdsourcing data for each community.
[0134] 704: There is only one valid cluster.
[0135] After clustering the cells, the clustering quality can be measured and the number of valid clusters can be determined. If the valid cluster of the same base station is 1, no secondary clustering is required. If the valid cluster of the same base station is ≥ 2, secondary clustering of the valid clusters of the base station is required.
[0136] It can be understood that the clustering algorithm can divide the crowdsourcing data according to the similarity or distance between the data points in the crowdsourcing data. By dividing the crowdsourcing data through the clustering algorithm, each base station can obtain at least one cluster. The data points in the same cluster should be as similar as possible, and the data points between different clusters should be as different as possible.
[0137] In the embodiment of the present application, the clustering quality can be measured by the silhouette coefficient of the cluster. When the silhouette coefficient of the cluster meets a preset threshold, the cluster is determined to be a valid cluster.
[0138] In some embodiments, the average distance between each cluster obtained by the clustering algorithm and the average distance between each data within the cluster can be calculated; when it is determined that the average distance between each cluster satisfies the first distance and the average distance between each data within the cluster satisfies the second distance, the cluster is determined to be a valid cluster.
[0139] 705: Valid clusters ≥ 2.
[0140] It can be understood that the base station center of the same base station is unique. When the valid clusters of the same base station are ≥2, multiple base station centers may be obtained based on multiple valid clusters. Therefore, when it is determined that the valid clusters of the same base station are ≥2, step S706 is executed.
[0141] In some embodiments, steps 703-705 may be performed simultaneously with steps 706-707. In some embodiments, steps 706-707 may be performed before steps 703-705. In other embodiments, steps 706-707 may be performed after step 705.
[0142] 706: Aggregate LAC based on the city dimension.
[0143] In the embodiment of the present application, the LAC of each city can be aggregated by a clustering algorithm according to each city administrative area based on the city area information, so as to determine the polygon corresponding to the LAC of each city administrative area, thereby filtering out the dot data not in the LAC through the polygon corresponding to the LAC. The clustering algorithm can be any one of DBSCAN, K-means or hierarchical clustering.
[0144] It can be understood that LAC is an identifier of the regional characteristics of the base station. The representation of square and circle cannot mark the boundary of two LACs, which will cause errors. The coverage of LAC is more in line with the actual regional scope through the description of specific polygons, such as Figure 1 As shown, Figure 1 A schematic diagram of two LACs is shown. The polygons corresponding to the LACs can be used to correct cellid mislearning later, that is, to filter out the dot data that is not within the LAC.
[0145] 707: Draw the polygon corresponding to LAC.
[0146] In the embodiment of the present application, the distribution of LAC can be learned as follows: Figure 10a The distribution Thiessen polygon of the LAC shown in the figure, if the dotted data is inside the Thiessen polygon of the corresponding LAC, it is determined that the dotted data can be used for learning the base station location, if the dotted data is outside the Thiessen polygon of the corresponding LAC, it is determined that the dotted data cannot be used for learning the base station location. Specifically, whether it is inside can refer to the description of step 708.
[0147] Among them, the Thiessen polygon, also known as the Voronoi diagram, is a set of continuous polygons composed of the perpendicular bisectors of the line segments connecting adjacent points. Any point within a Thiessen polygon is closer to the control points that form the polygon than to the control points of other polygons. The Thiessen polygon is a kind of subdivision of the spatial plane, and its characteristic is that any position within the polygon is the closest to the sample points (such as settlements) of the polygon, farther from the sample points in adjacent polygons, and each polygon contains and only contains one sample point.
[0148] In some embodiments, through the distribution of LAC, shapes such as circles, rectangles, and rhombuses can also be learned.
[0149] 708: Perform the second clustering, select the cluster with the largest number, and check whether the LAC is within its polygon range. If it is inside, it is an effective cell coverage cluster.
[0150] It can be understood that there may be a situation where the same cellid has data points in two cities (City A and City B) in the crowdsourcing data obtained. If the base station center is learned according to the city subsequently, the same base station coverage will be learned in both cities, but in fact, most likely only one city has the signal coverage of the base station.
[0151] In the embodiment of the present application, after performing step S705, if it is determined that the number of effective clusters after the first clustering is ≥2, the second clustering can be performed by the clustering algorithm according to the longitude and latitude of the cluster centers after the first clustering, and the most central cluster of the second clustering can be determined according to the coverage range of the LAC determined in step 707.
[0152] In the embodiment of the present application, the method for determining whether the data point is within the polygon of the corresponding LAC includes: drawing a ray from any data point, for example, a horizontal ray, and determining the number of intersection points between the ray and the polygon. If the number of intersection points is odd, it is determined that the data point is within the polygon, that is, the data point forms an effective cell coverage cluster, that is, the base station corresponding to the data point is the base station within the LAC; if the number of intersection points is even, it is determined that the data point is outside the polygon, that is, the base station corresponding to the data point is the base station outside the LAC.
[0153] For example, as Figure 10b shown, draw a ray from the data point A, and determine that the number of intersection points between the data point A and the polygon is 1, then it is determined that the data point A is within the polygon, and the base station corresponding to the data point A is the base station within the LAC.
[0154] It can be understood that different clusters with the same LAC and cellid between the same city and different cities can all be processed by the methods shown in steps 706 to 708.
[0155] 709: Further data cleaning is performed on the box plot to filter out data with positioning drift.
[0156] It can be understood that when the user is near a highway, subway, or expressway, the signal is unstable, so there will be data with positioning drift, that is, there will be relatively large error data along the line in the crowdsourcing data of the base stations near the highway, subway, or expressway. In order to eliminate the error data along the line, in the embodiments of the present application, the data after the first clustering or the second clustering is cleaned by a box plot with adaptive parameters to filter out the data with positioning drift in the data after the first clustering or the second clustering, and reproduce the crowdsourcing data that can reflect the coverage range of the base station.
[0157] Among them, the box plot (Box-plot), also known as the box-and-whisker plot, box plot, or box-line plot, is a statistical chart used to display the dispersion of a set of data. The box plot is mainly used to reflect the characteristics of the original data distribution and can also be used to compare the distribution characteristics of multiple sets of data. The parameters of the box plot can be determined by the distribution ratio of the crowdsourcing data from the center position of the effective cluster.
[0158] In some embodiments, if the base station corresponding to the effective cluster is a 4G base station, the upper and lower boundaries of the box plot are the first distance; if the base station corresponding to the effective cluster is a 5G base station, the upper and lower boundaries of the box plot are the second distance; if the base station corresponding to the effective cluster is a 6G base station, the upper and lower boundaries of the box plot are the third distance. Among them, the first distance can be 800m, the second distance can be 600m, and the third distance can be 400m.
[0159] It can be understood that the main frequency bands used by 4G are in the range of 700MHz to 2.6GHz, while 5G is transmitted in higher frequency bands, including 3.5GHz, 26GHz, and 28GHz, etc. The signal transmission characteristics of the high-frequency band make the transmission distance of the 5G signal relatively short and the penetration ability of buildings relatively poor. Therefore, the coverage range of 5G is relatively smaller than that of 4G.
[0160] In the embodiments of the present application, the cluster data retained after the data cleaning of the box plot with adaptive parameters is used to filter out the data with positioning drift and the data that cannot be clustered, ensuring that the filtered data is more in line with the real situation.
[0161] Through the crowdsourcing data, it can be found that the dotting data corresponding to the base station with the same cellid may be concentrated in one area or may be concentrated in several areas. For example, Figure 9 As shown, there are multiple dense dotting data at similar positions for the same base station. By cleaning the dotting data shown in Figure 9 through the first clustering and the second clustering methods, the area with the densest dotting data (the coverage area of the base station) can be learned.
[0162] 710: The filtered points are subjected to density clustering, and the center point of the cluster with the highest density is selected as the cell center.
[0163] In the embodiments of the present application, the center point with the highest density of the dot data in the valid cluster of each base station and the most connection times to the base station can be selected as the cell center (base station center).
[0164] In some embodiments, the center point with the highest density of the positions corresponding to the dot data in the valid cluster of each base station and the most connection times to the base station can be selected as the cell center.
[0165] In the embodiments of the present application, the crowdsourcing data after box plot cleaning can be clustered again through a clustering algorithm, so as to improve the accuracy of the center point of the cluster with the highest density obtained by clustering.
[0166] As Figure 11 shown, Figure 11 the point P in Figure 11 is the cell center of the base station corresponding to the dot data shown.
[0167] It can be understood that after the second clustering of the filtered points, each base station has a unique valid cluster.
[0168] In some embodiments, the following operations can be repeatedly executed until the valid cluster of each base station is unique: deleting the base station data corresponding to the positions that are not within the LAC area of the corresponding base station in the positions represented by the base station data of each base station; clustering the remaining base station data after deletion to obtain the valid cluster of each base station.
[0169] 711: The coverage range can be represented by a fitted circle or an enclosing polygon.
[0170] In the embodiments of the present application, the dot data of each base station clustered in step 710 can be fitted to obtain a fitted circle for each base station. Among them, the fitted circle is, given a set of data points, by finding the optimal circular parameters such that the circle can best fit these data points.
[0171] In the embodiments of the present application, the dot data of each base station can be fitted through a fitting algorithm to obtain a fitted circle representing the coverage range of each base station. Among them, the fitting algorithm includes at least one of the algebraic approximation method, the least squares method, and the orthogonal distance regression method.
[0172] 712: Base station location and signal coverage range, LAC coverage polygon.
[0173] In the embodiments of the present application, the positions and LACs of the base stations learned based on the embodiments of the present application are shown in Tables 1 and 2.
[0174] Table 1 Results of cellid learning
[0175] Citycode Opt LAC Cellid Longtitude Latitude Radius 755 Mobile 90452 12345 114.054935 22.57692 436 755 Mobile 90452 3698 114.054415 22.57603 200 755 Mobile 90452 7715 114.054302 22.57667 362 755 Mobile 361 3647 114.05385 22.57107 179
[0176] Among them, Citycode is the city code, Opt is the operator, Longtitude is the longitude, Latitude is the latitude, and Radius is the base station radius.
[0177] Table 2 Results of LAC learning
[0178]
[0179] Among them, Citycode is the city code, Opt is the operator, and Ploygon is the shape of the polygon corresponding to LAC.
[0180] For example, as Figure 12 shown, C11 is the coverage range of base station C1 obtained without using the method for determining the base station coverage range provided by this application, and C12 is the coverage range of base station C1 determined by the method provided by the embodiments of this application; C21 is the coverage range of base station C2 obtained without using the method for determining the base station coverage range provided by this application, and C22 is the coverage range of base station C2 determined by the method provided by the embodiments of this application; C31 is the coverage range of base station C3 obtained without using the method for determining the base station coverage range provided by this application, and C32 is the coverage range of base station C3 determined by the method provided by the embodiments of this application.
[0181] It can be found that the coverage ranges of the base stations learned through the embodiments of this application are more concentrated.
[0182] In the embodiments of this application, the parameters used to establish the geofence can be specifically determined according to the service bound to the geofence. For example, some services require precise recommendations to users, and correspondingly require a high-precision geofence. Therefore, a geofence established only based on the city cannot meet the high-precision requirements. However, through the method for determining the base station coverage range provided by the embodiments of this application, the precision of the geofence can be improved, and the accuracy of the detection results can be improved.
[0183] The method for determining the base station coverage range provided by the embodiments of the present application can be not only applied to the generation of geofences with different precisions and different services. For example, by obtaining the base station distribution at the current location through specific location points of interest (POIs), a geofence (a geofence composed of base stations) can be quickly generated. Moreover, the method for determining the base station coverage range provided by the embodiments of the present application can also implement network positioning based on the cellular network according to the base station access situation, and can also be used for the judgment of network handover. For example, in the case of knowing the edge of the current network coverage or when the signal strength of the current network model is weak, it can assist in the soft handover of the network.
[0184] Next, taking the electronic device 10 as an example, the hardware structure of each electronic device mentioned in the present application will be described. As Figure 13 shown, the electronic device 10 may include a processor 110, a power module 140, a memory 180, a mobile communication module 130, a wireless communication module 120, a sensor module 190, an audio module 150, a camera 170, an interface module 160, a button 101, and a display screen 102, etc.
[0185] It can be understood that the structure schematically shown in the embodiments of the present invention does not constitute a specific limitation on the electronic device 10. In other embodiments of the present application, the electronic device 10 may include more or fewer components than shown, or combine certain components, or split certain components, or have different component arrangements. The components shown can be implemented in hardware, software, or a combination of software and hardware.
[0186] The processor 110 may include one or more processing units. For example, it may include a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processing (DSP), a micro-programmed control unit (MCU), an artificial intelligence (AI) processor, or a processing module or processing circuit such as a field programmable gate array (FPGA). Among them, different processing units may be independent devices or integrated in one or more processors. A storage unit may be provided in the processor 110 for storing instructions and data. In some embodiments, the storage unit in the processor 110 is the cache memory 180.
[0187] It can be understood that the method for generating a geographical fence in the embodiments of the present application can be executed by the processor 110 of the corresponding electronic device. The power module 140 may include a power source, a power management component, etc. The power source may be a battery. The power management component is used to manage the charging of the power source and the power supply from the power source to other modules.
[0188] The mobile communication module 130 may include, but is not limited to, an antenna, a power amplifier, a filter, a low noise amplifier (LNA), etc. The mobile communication module 130 may provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc. applied to the electronic device 10. The mobile communication module 130 may receive electromagnetic waves through the antenna, filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 130 may also amplify the signal modulated by the modulation and demodulation processor and convert it into electromagnetic waves through the antenna for radiation. In some embodiments, at least some functional modules of the mobile communication module 130 may be provided in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 130 and at least some modules of the processor 110 may be provided in the same device.
[0189] The wireless communication module 120 may include an antenna and realize the transceiver of electromagnetic waves through the antenna. The wireless communication module 120 may provide solutions for wireless communications including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc. applied to the electronic device 10. The electronic device 10 may communicate with the network and other devices through wireless communication technologies.
[0190] In the embodiments of the present application, the base station connected to the terminal device 30 may be obtained through the wireless communication module 120 or the mobile communication module 130.
[0191] In some embodiments, the mobile communication module 130 and the wireless communication module 120 of the electronic device 10 may also be located in the same module.
[0192] The display screen 102 is used to display the human-machine interaction interface, images, videos, etc. The display screen 102 includes a display panel. The display panel can 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 quantum dot light-emitting diode (QLED), etc.
[0193] The sensor module 190 may include a proximity light sensor, a pressure sensor, a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
[0194] The audio module 150 is used to convert digital audio information into an analog audio signal for output, or convert analog audio input into digital audio signals. The audio module 150 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 150 can be disposed in the processor 110, or some functional modules of the audio module 150 can be disposed in the processor 110. In some embodiments, the audio module 150 may include a speaker, a receiver, a microphone, and a headphone jack. The camera 170 is used to capture still images or videos. An object generates an optical image through a lens and projects it onto a photosensitive element. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to an image signal processing (ISP) to convert it into a digital image signal. The electronic device 10 can implement the shooting function through the ISP, the camera 170, a video codec, a graphic processing unit (GPU), the display screen 102, and an application processor, etc.
[0195] The interface module 160 includes an external memory interface, a USB interface, a subscriber identification module (SIM) card interface, etc. Among them, the external memory interface can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 10. The external memory card communicates with the processor 110 through the external memory interface to implement the data storage function. The universal serial bus interface is used for the electronic device 10 to communicate with other electronic devices. The subscriber identification module card interface is used to communicate with the SIM card installed in the electronic device 10, such as reading the phone number stored in the SIM card or writing the phone number into the SIM card.
[0196] In some embodiments, the electronic device 10 further includes a button 101, a motor, and an indicator, etc. Among them, the button 101 may include a volume button, a power on / off button, etc. The motor is used to make the electronic device 10 generate a vibration effect, such as generating a vibration when the user's electronic device 10 is called to prompt the user to answer the incoming call of the electronic device 10. The indicator may include a laser indicator, a radio frequency indicator, an LED indicator, etc.
[0197] Embodiments of the mechanisms disclosed in this application can be implemented in hardware, software, firmware, or a combination of these implementation methods. Embodiments of this application can be implemented as a computer program or program code executed on a programmable system, which includes at least one processor, a storage system (including volatile and non-volatile memories and / or storage elements), at least one input device, and at least one output device.
[0198] The program code can be applied to the input instructions to execute the various functions described in this application and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, the processing system includes any system having a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.
[0199] The program code can be implemented in a high-level procedural language or an object-oriented programming language to communicate with the processing system. When necessary, the program code can also be implemented in assembly language or machine language. In fact, the mechanisms described in this application are not limited to the scope of any specific programming language. In any case, the language can be a compiled language or an interpreted language.
[0200] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored on one or more transitory or non-transitory machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, the instructions may be distributed via a network or via other computer-readable media. Thus, machine-readable media may include any mechanism for storing or transmitting information in a machine (e.g., computer) readable form, including but not limited to, floppy disks, optical disks, optical discs, compact disc-read only memories (CD-ROMs), magneto-optical disks, read only memories (ROMs), random access memories (RAMs), erasable programmable read only memories (EPROMs), electrically erasable programmable read-only memories (EEPROMs), magnetic or optical cards, flash memory, or tangible machine-readable memories for transmitting information (e.g., carrier waves, infrared signals, digital signals, etc.) in electrical, optical, acoustic, or other forms via the Internet. Thus, machine-readable media include any type of machine-readable media suitable for storing or transmitting electronic instructions or information in a machine (e.g., computer) readable form.
[0201] In the drawings, some structural or method features may be shown in a particular arrangement and / or order. However, it should be understood that such a particular arrangement and / or ordering may not be required. Rather, in some embodiments, these features may be arranged in a different manner and / or order than shown in the illustrative drawings. Additionally, the inclusion of a structural or method feature in a particular figure does not imply that such a feature is required in all embodiments, and in some embodiments, these features may not be included or may be combined with other features.
[0202] It should be noted that each unit / module mentioned in the device embodiments of the present application is a logical unit / module. Physically, a logical unit / module can be a physical unit / module, a part of a physical unit / module, or can be implemented as a combination of multiple physical units / module. The physical implementation manner of these logical units / module themselves is not the most important. The combination of the functions implemented by these logical units / module is the key to solving the technical problems proposed by the present application. In addition, in order to highlight the innovative part of the present application, the above device embodiments of the present application do not introduce units / modules that are not closely related to solving the technical problems proposed by the present application, which does not mean that there are no other units / modules in the above device embodiments.
[0203] It should be noted that in the examples and the description of this patent, the terms "including", "comprising" or any other variation thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the phrase "including one" does not exclude the presence of additional identical elements in the process, method, article or device including said element. Although the present application has been illustrated and described with reference to certain preferred embodiments thereof, those of ordinary skill in the art should understand that various changes in form and detail may be made thereto without departing from the spirit and scope of the present application.
Claims
1. A method for generating a geofence, characterized in that, The method for generating the geographical fence includes: Obtaining base station data related to the target service executed by the terminal device in the first area, where the base station data includes the location information of the terminal device connecting at least one base station in the first area during the execution of the target service; Determining the coverage range of each base station in the first area based on the base station data; Generating a geographical fence corresponding to the target service of the terminal device based on the coverage ranges of the base stations in the first area, where the geographical fence includes at least one base station in the first area that meets the coverage condition.
2. The method for generating a geofence according to claim 1, wherein The coverage condition includes: The center of the base station is within the first area, and the proportion of the coverage range of the base station within the first area is greater than a first threshold.
3. The method for generating a geographical fence according to claim 2, wherein The generating the geographical fence corresponding to the target service of the terminal device based on the coverage ranges of the base stations in the first area includes: Determining the base stations that meet the coverage condition in the first area based on the coverage ranges and base station centers of the base stations in the first area; Generating a geographical fence corresponding to the target service of the terminal device based on the base stations that meet the coverage condition in the first area.
4. According to the method for generating the geographical fence as claimed in claim 2, the at least one base station includes a first base station; and The determining the coverage range of each base station in the first area based on the base station data includes: Clustering the multiple positions represented by each base station data based on the location information in the multiple base station data of the first base station to obtain at least one first clustering area; Repeating the following operations until the number of the first clustering areas is 1: Deleting the base station data corresponding to the positions that are not within the LAC area of the first base station among the positions represented by each base station data in the at least one first clustering area; Clustering the remaining base station data after the deletion to obtain at least one first clustering area of the first base station.
5. The method for generating a geofence according to claim 4, wherein, The method for determining the LAC area of the first base station includes: Aggregating each LAC included in the first area according to the administrative regions of the city to obtain the LAC area of the first base station.
6. The method for generating a geographical fence according to claim 4, characterized in that, The method for determining whether the base station data is within the LAC area of the first base station includes: Drawing a ray from each base station data of the first base station; Determining that the base station data is within the LAC area of the first base station corresponding to the number of intersections of the ray and the LAC area of the first base station being odd; Determining that the base station data is not within the LAC area of the first base station corresponding to the number of intersections of the ray and the LAC area of the first base station being even.
7. The method for generating a geofence according to claim 4, wherein The clustering the multiple positions represented by each base station data based on the location information in the multiple base station data of the first base station to obtain at least one first clustering area includes: Clustering the multiple positions represented by each base station data based on the clustering algorithm and the location information in the multiple base station data of the first base station to obtain at least one first clustering area; Among them, the clustering algorithm includes at least one of the DBSCAN algorithm, the K-means algorithm, and the hierarchical clustering algorithm.
8. The method for generating a geofence according to claim 4, wherein Based on the base station data, determining the coverage ranges of the base stations in the first area further includes: Generating a first coverage area of the first base station based on one first clustering area.
9. The method for generating a geofence according to claim 8, wherein The generating a first coverage area of the first base station based on the one first clustering area includes: Fitting the first clustering area of the first base station to obtain a first coverage area with a preset shape.
10. The method for generating a geofence according to claim 9, wherein The fitting the first clustering area of the first base station to obtain a first coverage area with a preset shape includes: Fitting the first clustering area through a fitting algorithm to obtain a first coverage area with a preset shape; Among them, the fitting algorithm includes at least one of the algebraic approximation method, the least squares method, and the orthogonal distance regression method.
11. The method for generating a geofence according to claim 9, wherein The preset shape includes at least one of the following: circle, rectangle, rhombus, polygon.
12. The method for generating a geofence according to claim 4, wherein, The center point of the first base station is the point with the highest position density and the most connection times to the base station in the first clustering area of the first base station.
13. The method for generating a geofence according to claim 7, wherein Based on the clustering algorithm and the position information in the multiple base station data of the first base station, clustering the multiple positions represented by the base station data to obtain at least one first clustering area, including: Based on the administrative region of the city and the position information in the multiple base station data of the first base station, binning the multiple base station data of the first base station to obtain binned data; According to the cell and the clustering algorithm, clustering the multiple positions represented by the binned data to obtain at least one first clustering area.
14. The method for generating a geographical fence according to claim 1, wherein Includes: Before determining the coverage ranges of the base stations in the first area based on the base station data, deleting the data that does not meet the compliance conditions in the base station data; The compliance conditions include: The city code of the base station data satisfies the first interval corresponding to the city code, the cellid of the base station data satisfies the second interval corresponding to the cellid, the LAC area of the base station data satisfies the third interval corresponding to the LAC area, and the longitude and latitude of the base station data satisfy the fourth interval corresponding to the longitude and latitude.
15. A method for using a geofence, characterized in that, Includes: During the movement of the terminal device, it is detected that the terminal device is connected to a first base station; The terminal device executes the operations corresponding to the geographical fence to which the first base station belongs.
16. The method for using a geofence according to claim 15, wherein The operations corresponding to the geographical fence include: Triggering at least one of a recommendation service, a notification service, and a registration service.
17. A terminal device, characterized in that, Includes: A memory for storing instructions executed by one or more processors of the terminal device, and the processor, which is one of the one or more processors of the terminal device, is used to execute the method for generating a geographical fence according to any one of claims 1 to 14 or the method for using a geographical fence according to any one of claims 15 to 16.
18. A readable medium, characterized in that, Instructions are stored on the readable medium, and when the instructions are executed on the terminal device, the terminal device is caused to execute the method for generating a geographical fence according to any one of claims 1 to 14 or the method for using a geographical fence according to any one of claims 15 to 16.
19. A computer program product, characterized in that, The computer program product includes computer instructions which, when executed by an electronic device, cause the electronic device to execute the method for generating a geofence according to any one of claims 1 to 14 or the method for using a geofence according to any one of claims 15 to 16.
Citation Information
Patent Citations
Method for determining that terminal device is located inside geofence, and terminal device
CN113615217A
Express pickup reminding method and device
CN114463898A
Triggering method of geo-fence and related electronic equipment
CN116056003A
Geofence establishing method, server and communication system
CN116437293A
Method for generating geo-fence, electronic equipment and storage medium
CN116668951A