Method, server and communication system for acquiring a geofence

By calculating the adjacent points and distances of sample points, the density gradient direction is determined to generate irregular clusters, which solves the problem of insufficient accuracy in geofencing generation and enables more accurate service recommendations in scenarios with uneven density and large differences in cluster spacing.

CN120166354BActive Publication Date: 2026-03-17HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311683870.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-07
Publication Date
2026-03-17
Estimated Expiration
2043-12-07

AI Technical Summary

Technical Problem

Existing geofencing generation algorithms lack accuracy in scenarios with uneven density and large differences in cluster spacing, resulting in inaccurate recommendation services for electronic devices.

Method used

By calculating the adjacent points and distances of sample points, the direction of the density gradient is determined, irregular clusters are generated, and then geofencing is generated. The density variation of sample points is taken into account to improve the clustering accuracy.

Benefits of technology

Generating more accurate geofencing in scenarios with uneven density and large differences in cluster spacing can better reflect user density and improve the accuracy of service recommendations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120166354B_ABST
    Figure CN120166354B_ABST
Patent Text Reader

Abstract

This application provides a method, server, and communication system for obtaining geofencing. Specifically, it includes: First, collecting a sample set in the cloud, which may include multiple sample points. Then, calculating the neighboring points of the multiple sample points within a first range and the distances to these neighboring points. Next, calculating the density of the multiple sample points based on the distances to their neighboring points. Then, determining the density gradient direction of the multiple sample points based on their density magnitude, thereby identifying multiple clusters. Finally, generating a geofencing based on the clusters obtained from clustering. This method results in a more accurate geofencing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminals, and more particularly to methods, servers, and communication systems for obtaining geofences. Background Technology

[0002] Geofencing technology is widely used in various service scenarios, such as taking the subway, high-speed rail, and airplanes, and sending and receiving packages. Specifically, when a user's electronic device enters a geofence (i.e., is within a geographical area encompassed by that geofence), the device can recommend relevant scene-aware services to the user. Various clustering algorithms are typically used to generate geofences. Different clustering algorithms can affect the accuracy of the generated geofences.

[0003] Improving the accuracy of geofencing to trigger electronic devices to recommend more precise services to users is an urgent problem to be solved. Summary of the Invention

[0004] This application provides a method, server, and communication system for obtaining geofencing. Specifically, it includes: First, collecting a sample set in the cloud, which may include multiple sample points. Then, calculating the neighboring points of the multiple sample points within a first range and the distances to these neighboring points. Next, calculating the density of the multiple sample points based on the distances to their neighboring points. Then, determining the density gradient direction of the multiple sample points based on their density magnitude, thereby identifying multiple clusters. Finally, generating a geofencing based on the clusters obtained from clustering. This method results in a more accurate geofencing.

[0005] In a first aspect, this application provides a method for obtaining geofences, the method comprising: obtaining a dataset including multiple sample points, the sample points indicating the location information of an electronic device when performing a first action; determining the adjacent points of each sample point, and determining the adjacency distance between each sample point and its adjacent points, wherein the adjacent points of a sample point include other sample points within a first range of the sample point; determining the sample point density within the first range to which each sample point belongs based on the adjacency distance of each sample point; determining the density gradient direction between each sample point and its adjacent points, wherein the positive direction of the density gradient direction between any two sample points points from the sample point with lower density to the sample point with higher density; determining multiple clusters, each cluster including a root node and multiple child nodes, wherein the root node is a sample point whose density gradient direction with its adjacent points all points to itself, and the multiple child nodes include sample points that pass through one or more density gradient directions pointing to the root node; and determining multiple geofences, one geofence corresponding to one cluster, the geofence being used to recommend services related to the first action to the electronic device when the electronic device is detected to have entered the geofence.

[0006] After implementing the method provided in the first aspect, it can be applied to scenarios with uneven density and large differences in cluster spacing. Furthermore, it eliminates the need to predetermine the number of clusters, and the shape of the clusters after clustering is not limited; for example, the clusters can be irregular. The clustering process takes into account the density variations of different sample points, thus better reflecting the density of users when electronic devices perform a certain action, resulting in higher accuracy of the generated geofence.

[0007] In conjunction with the method described in the first aspect, the first range includes a range centered on the sample point and with a first radius. Optionally, the first range can also be a range of other shapes.

[0008] In conjunction with the method described in the first aspect, the density of the sample point is the sum of the weights corresponding to all the adjacent distances of the sample point. The larger the distance between the sample point and its adjacent points, the smaller the weight corresponding to the adjacent distance between them, and the weight corresponding to the adjacent distance between them is a non-negative number.

[0009] In some implementations, the density of a sample point can be the sum of the adjacency weights of that sample point and all its neighboring points within its R-neighborhood. The formula for calculating the density of a sample point is as follows:

[0010]

[0011] Here, density(i) represents the density of sample point i. weight(i,j) represents the adjacency weight mapped by the distance between sample point i and sample point j. (i,j)∈E indicates that sample point i and sample point j belong to set V and the distance between sample point i and sample point j is less than the nearest neighbor radius R. ∑ (i,j)∈E weight(i,j) can represent the sum of the adjacency weights mapped to sample point i and all its neighboring points within its R neighborhood.

[0012] The adjacency weight is obtained by mapping the adjacency distance (i.e., the distance between sample point i and its neighboring points within its R-neighborhood). The above mapping relationship satisfies the following: the larger the adjacency distance, the smaller the adjacency weight, and the adjacency weight value is a non-negative number.

[0013] For example, in this embodiment of the application, a linear kernel function can be used to map adjacency distance to adjacency weight. The mapping formula is as follows:

[0014]

[0015] Here, weight(i,j) can represent the adjacency weight between sample point i and sample point j.

[0016] In conjunction with the method described in the first aspect, after acquiring the dataset, the method further includes: numbering the multiple sample points according to one or more of the following methods: numbering them in chronological order of collection; numbering them in order of the longitude and latitude indicated by the sample points, wherein sample points with smaller longitudes have smaller numbers, and when longitudes are the same, sample points with smaller latitudes have smaller numbers; if two sample points have the same density, then the positive direction of the density gradient between the two sample points points from the sample point with the smaller number to the sample point with the larger number. This ensures the strictness of the density gradient direction in the sample set.

[0017] In conjunction with the method described in the first aspect, the plurality of child nodes in the cluster include sample points that point to the root node through one or more density gradient directions. The one or more density gradient directions include a first density gradient direction that points from a first sample point to a second sample point. The weight corresponding to the adjacency distance between the first sample point and the second sample point is the largest among all the weights corresponding to the adjacency distances of the first sample point.

[0018] If the weight corresponding to the adjacency distance between the first sample point and the third sample point is the same as the weight corresponding to the adjacency distance between the first sample point and the second sample point, then the direction of the first density gradient points from the first sample point to the sample point with the greater density between the second sample point and the third sample point.

[0019] If the weight corresponding to the adjacency distance between the first sample point and the third sample point is the same as the weight corresponding to the adjacency distance between the first sample point and the second sample point, and the density of the second sample point and the third sample point is the same, then the direction of the first density gradient points from the first sample point to the sample point with the larger number between the second sample point and the third sample point.

[0020] In this way, the unique parent node of a certain sample point can be determined, allowing the server to smoothly traverse multiple clusters from the sample set.

[0021] In conjunction with the method described in the first aspect, the first action is a taxi-hailing action, and the services related to the first action include one or more of the following: taxi discount information, taxi location recommendation information, and taxi time information for frequently used routes; the first action is a public transportation action, and the services related to the first action include one or more of the following: estimated arrival time information for buses and travel time information for frequently used routes; the first action is a subway-taking action, and the services related to the first action include one or more of the following: subway-taking discount information and estimated arrival time information for subway stations.

[0022] In conjunction with the method described in the first aspect, after acquiring the dataset, the method further includes: displaying a scatter plot, where the horizontal axis of the scatter plot represents longitude, the vertical axis represents latitude, multiple data points in the scatter plot represent multiple sample points in the dataset, and the x and y coordinates of the data points in the scatter plot represent the location information of the sample points. This allows for a direct observation of the characteristics of the sample set.

[0023] Combining the method described in the first aspect, after determining the density of sample points within a first range to which each sample point belongs based on the adjacency distance of each sample point, the method further includes: displaying a density curve, where the horizontal axis of the density curve represents longitude, the vertical axis represents latitude, the vertical axis represents density, multiple peaks in the density curve represent multiple clusters, the coordinates of points on the peak surface of the density curve represent the density magnitude and location information of sample points in the cluster, and the coordinates of the highest point of the peak in the density curve represent the density magnitude and location information of the root node of the cluster. In this way, the abstract representation of each cluster obtained by clustering can be intuitively observed, and the physical meaning of each cluster can be expressed more accurately.

[0024] In conjunction with the method described in the first aspect, after identifying multiple clusters, the method further includes: displaying a density gradient hierarchy map, where the horizontal axis represents longitude, the vertical axis represents latitude, multiple vertices in the density gradient hierarchy map represent multiple sample points in the dataset, multiple polylines in the density gradient hierarchy map represent the density gradient directions between the root node and multiple child nodes, and multiple tree diagrams in the density gradient hierarchy map represent the multiple clusters. In this way, a visual representation of each cluster can be observed from a planar perspective.

[0025] In a second aspect, this application provides a communication system including a server and a plurality of electronic devices. The server includes one or more memories and one or more processors. The memories are coupled to the one or more processors and are used to store computer program code, which includes computer instructions. The one or more processors invoke the computer instructions to cause the server to perform the methods described in any of the first aspects.

[0026] Thirdly, this application provides an electronic device including one or more memories and one or more processors; the memory is coupled to the one or more processors, the memory is used to store computer program code including computer instructions, and the one or more processors call the computer instructions to cause the electronic device to perform the methods described in any of the first aspects.

[0027] Fourthly, this application provides a chip for use in an electronic device, the chip including one or more processors for invoking computer instructions to cause the electronic device to perform the methods described in any of the first aspects.

[0028] Fifthly, this application provides a computer-readable storage medium including instructions that, when executed on an electronic device, cause the electronic device to perform the method described in any of the first aspects. Attached Figure Description

[0029] Figure 1 A density surface plot of a sample set provided in an embodiment of this application;

[0030] Figure 2 A flowchart illustrating a method for obtaining a geofence, as provided in this application embodiment;

[0031] Figure 3 A scatter plot of a sample set provided in an embodiment of this application;

[0032] Figure 4A A directed adjacency graph provided in an embodiment of this application;

[0033] Figure 4B Another directed adjacency graph provided in this application embodiment;

[0034] Figure 5 A density gradient hierarchy map of a sample set is provided for an embodiment of this application;

[0035] Figure 6 A schematic diagram of the hardware architecture of the electronic device provided in the embodiments of this application;

[0036] Figure 7 A schematic diagram of the software architecture of the electronic device provided in the embodiments of this application;

[0037] Figure 8 This is a schematic diagram of the hardware architecture of the server provided in an embodiment of this application. Detailed Implementation

[0038] The technical solutions in the embodiments of this application will be clearly and thoroughly described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; the word "and / or" in the text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone.

[0039] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.

[0040] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this application can be combined with other embodiments.

[0041] The term "user interface (UI)" used in the following embodiments of this application refers to the medium interface through which an application or operating system interacts and exchanges information with the user. It realizes the conversion between the internal form of information and the form that the user can accept. The user interface is source code written in a specific computer language such as Java or Extensible Markup Language (XML). The interface source code is parsed and rendered on the electronic device, ultimately presenting content that the user can recognize. A common form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operation displayed graphically. It can be visible interface elements such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets displayed on the screen of an electronic device.

[0042] First, let's introduce some terms used in the embodiments of this application.

[0043] Clustering is the process of classifying a collection of physical or abstract objects into multiple classes composed of similar objects. Clustering methods can generally be divided into the following types: partitioning methods, hierarchical methods, density-based methods, grid-based methods, model-based methods, etc.

[0044] Among them, the k-means clustering algorithm (K-means) is a partitioning method that divides multiple sample points into K clusters based on the distance between them in a collected sample set. The value of K needs to be determined in advance or based on empirical values.

[0045] However, the K-means algorithm has some problems:

[0046] 1. Since it is uncertain in advance how many classes the multiple sample points need to be divided into, it is difficult to determine a suitable K value.

[0047] 2. The K-means algorithm classifies all sample points. However, in practical applications, there may be outliers in the sample set, and these sample points need to be removed.

[0048] 3. It is mainly suitable for spherically distributed data, and not very suitable for other types of data distribution.

[0049] Density-Based Spatial Clustering of Applications with Noise (DBSCAN) is an algorithm that clusters multiple samples based on the density of their distribution. Before introducing the DBSCAN algorithm flow, let's first introduce the relevant definitions:

[0050] E-neighborhood: The region within a sample of radius E is called the E-neighborhood of that sample. The value of radius E needs to be determined manually based on the specific application scenario of the DBSCAN algorithm.

[0051] Core objects: If the number of sample points in the E-neighborhood of a sample is greater than or equal to the minimum number of contained points (MinPts), then the sample is called a core object. MinPts can also be referred to as the density threshold. The value of MinPts needs to be determined manually or based on empirical values.

[0052] Direct density reachability: For a sample set A, sample point q and sample point p belong to sample set A. If sample point q is within the E-neighborhood of sample point p, and p is a core object, then sample point q is directly density reachable from sample point p.

[0053] Density reachability: For a sample set A, n sample points p1, p2, ..., pn all belong to sample set A. If sample point pi is directly density reachable from sample point p(i-1), then sample point pn is density reachable from sample point p1. Here, i takes any integer value from 1 to n. That is, density reachability satisfies transitivity.

[0054] Density connectivity: For a sample set A, sample points q, p, and o all belong to sample set A. If there exists a sample point o that is density-reachable from both sample points q and p (i.e., sample points q and p are both density-reachable from sample point o), then sample points q and p are density-connected.

[0055] For example, assume the radius E is 3 and the MinPts is 3. Calculate that the E-neighborhood of sample point a1 contains the set {b1, a1, a2, a3, a4}, the E-neighborhood of sample point b1 contains the set {b1, b2, b3, b4, a1}, the E-neighborhood of sample point b2 contains the set {a1, b2}, the E-neighborhood of sample point a4 contains the set {a4, a1, c1}, and the neighborhood of sample point c1 contains the set {a4, c1, c2}.

[0056] Based on the above information, the core objects include: a1, b1, a4, and c1; sample point b1 is directly density-reachable from sample point a1; sample point a4 is density-reachable from sample point a1; sample point a1 and sample point c1 are density-connected.

[0057] As defined above, density reachability is a transitive closure of direct density reachability, and this relationship is asymmetric. Density connectivity is a symmetric relationship.

[0058] The DBSCAN algorithm process is described in detail below.

[0059] First, initialize the core object set, the number of clusters, the set of unvisited samples, and the cluster partitioning. For example, performing the initialization operation can make the core object set a non-empty set, the number of clusters zero, the set of unvisited samples the collected sample set, and the cluster partitioning a non-empty set.

[0060] Then, all core objects are identified from the sample set. The E and MinPts values ​​were determined before executing DBSCAN.

[0061] Specifically, the E-neighborhood set of each sample point can be determined based on the distance between each sample point in the sample set and the E-value. Furthermore, the core object can be identified from each sample based on whether the number of E-neighborhood sets for each sample point is greater than or equal to the MinPts value.

[0062] Next, an unprocessed sample point is read from the sample set, and it is determined whether this sample point is a core object. An unprocessed sample point can refer to a sample point that has not been identified as belonging to a specific cluster.

[0063] If the sample point is the core object, then all sample points that are density-connected to the sample point are determined from the sample set, and the sample point and the determined sample points are formed into a cluster.

[0064] If the sample point is not a core object, then unprocessed sample points are read again from the sample set, and the status of the sample point as a core object is re-determined, until all sample points in the sample set have been processed.

[0065] Finally, multiple clusters can be obtained.

[0066] As can be seen from the above process, the purpose of the DBSCAN algorithm is to determine the largest set of density-connected objects.

[0067] However, the DBSCAN algorithm also has some problems:

[0068] 1. It is not suitable for situations where the density of the sample set is uneven or the difference in the distance between clusters is large, as this will lead to poor clustering quality.

[0069] 2. Since different combinations of the two parameters (i.e., E value and MinPts value) have a significant impact on the clustering results, multiple joint parameter tunings are required, which is quite complex.

[0070] For example, setting the E value too high will result in fewer clusters and more data in each cluster; setting the E value too low will result in more clusters and less data in each cluster.

[0071] Geofencing: This is equivalent to a virtual geographical boundary, which can include real-world geographical areas.

[0072] Geofencing technology is a location-aware technology used to recommend location-related services. When an electronic device enters or leaves a geographically defined area, it can trigger recommendations for corresponding services, such as automatically receiving notifications or initiating location-related subscription activities.

[0073] Geofencing technology can be divided into three main stages: data collection, geofencing generation, and geofencing matching. Among these, clustering algorithms are the core algorithms in the geofencing generation stage. Clustering algorithms are used to classify the collected data appropriately and remove some outliers, thereby obtaining multiple clusters for generating geofencing.

[0074] In some implementations, geofencing can be built based on one or more of the following data: GPS parameters, wireless-fidelity (Wi-Fi) parameters, base station parameters, or city parameters.

[0075] GPS parameters can refer to the latitude and longitude coordinates of the electronic device's GPS location. The geographical area encompassed by a geofence established based on GPS parameters can be an area demarcated with a certain geographical location's latitude and longitude coordinates as the center (e.g., a circular area), or it can be a polygonal area connected by multiple geographical location's latitude and longitude coordinates as vertices.

[0076] Wi-Fi parameters can refer to the identifiers of Wi-Fi networks that electronic devices scan or connect to. A geofence built based on Wi-Fi parameters can encompass a geographical area that includes the coverage area of ​​one or more Wi-Fi signals.

[0077] Base station parameters can refer to the identifiers of base stations that electronic devices scan or connect to. The geographical area encompassed by a geofence built based on base station parameters can include the coverage area of ​​one or more base station signals.

[0078] The city parameter refers to the city where the electronic device is located. The geographic area encompassed by a city-based geofence can include geographic areas encompassed by one or more cities.

[0079] In this embodiment of the application, the specific types of parameters used to establish the geofence can be determined based on the service to which the geofence is bound.

[0080] In one possible approach, geofencing can be based on only one parameter (such as GPS parameters). This requires less data collection and consumes less time and computational resources to establish the geofencing.

[0081] In another possible implementation, geofencing can be built based on any two or three of the four parameters mentioned above. For example, the geographical area encompassed by a geofencing built based on multiple parameters is equivalent to the union of areas built based on different parameters. Thus, the accuracy of geofencing can be increased due to the diversification of the basis for its creation.

[0082] In this embodiment of the application, the types of parameters used to establish the fence are not limited.

[0083] As explained above, if the clustering algorithm used in generating the geofence is inappropriate—for example, the problems encountered with the K-means or DBSCAN algorithms—resulting in insufficient precision in the geographical area included by the geofence, electronic devices may recommend services that the user does not currently need, thus disturbing the user. Therefore, it is necessary to improve the precision of geofences to more accurately trigger electronic devices to recommend services that the user currently requires.

[0084] To address the aforementioned issues, this application provides a method for obtaining geofencing. Specifically, it includes: First, collecting a sample set in the cloud, which may include multiple sample points. For example, sample points may indicate the location information of an electronic device performing a certain action. Then, calculating the neighboring points of the multiple sample points within a first range and the distances to these neighboring points, or calculating the similarity of the multiple sample points. Next, calculating the density of the multiple sample points based on the distances to neighboring points or the similarity. Then, determining the density gradient direction of the multiple sample points based on their density magnitude. Then, determining a density gradient hierarchy map based on the density gradient direction of the multiple sample points, thereby identifying multiple clusters. Finally, generating a geofencing based on the multiple clusters obtained from clustering.

[0085] The geofence acquisition method provided in this application can be applied to scenarios with uneven density and large differences in cluster spacing. Furthermore, it eliminates the need to predetermine the number of clusters, and the shape of the clusters after clustering is not limited; for example, the clusters can be irregular. The clustering process considers the density variations of different sample points, thus better reflecting the user density when an electronic device performs a certain action, resulting in higher accuracy of the generated geofence.

[0086] To better understand the multiple clusters obtained in the geofence acquisition method provided in the embodiments of this application, the following will be combined with... Figure 1 This section will introduce several clusters determined based on the direction of the density gradient.

[0087] Figure 1 The density surface plot of the sample set provided in the embodiments of this application is illustrated by way of example.

[0088] refer to Figure 1 , Figure 1 The density surface plot shown is used to represent the density surface of multiple sample points in the collected sample set. This density surface plot is a three-dimensional coordinate graph. The vertical axis of the coordinate axis represents the density of each sample point, the horizontal axis represents the longitude of each sample point, and the vertical axis represents the latitude of each sample point.

[0089] In this embodiment, intuitively speaking, each peak in the density surface plot is obtained based on the density magnitude of multiple sample points, and a peak can be considered as a cluster. Multiple peaks in the density curve plot represent these multiple clusters, and the coordinates of points on the peak surface in the density curve plot represent the density magnitude and position information of sample points within the cluster. The coordinates of the highest point of the peak in the density curve plot represent the density magnitude and position information of the root node of the cluster. The following process describes how to obtain multiple clusters based on sample points.

[0090] The following describes a method for obtaining a geofence provided by an embodiment of this application.

[0091] Figure 2 An exemplary flowchart of a method for obtaining a geofence provided in an embodiment of this application is shown.

[0092] S201. Collect a sample set, which includes multiple sample points.

[0093] In some implementations, crowdsourced data can be collected in the cloud.

[0094] Crowdsourced data can refer to the tracking data of multiple electronic devices performing specific actions.

[0095] The specific types of behavior may include, but are not limited to, any one or more of the following: business activities involving entering and exiting subway stations, business activities involving entering and exiting express delivery stations, business activities involving entering and exiting high-speed rail stations, business activities involving entering and exiting airports, and business activities involving entering and exiting shopping malls. Specifically, business activities involving entering and exiting subway stations may include scanning QR codes or swiping cards to enter / exit the station; business activities involving entering and exiting express delivery stations may include scanning QR codes to send / receive packages; business activities involving entering and exiting high-speed rail stations may include scanning QR codes to check tickets; and business activities involving entering and exiting airports may include scanning QR codes to check tickets. This application does not limit the types of specific behaviors performed when collecting data from the cloud, and they are not all listed here.

[0096] The data collected may include, but is not limited to, one or more of the following: information on exiting a subway station, information on entering and exiting a courier station, information on entering and exiting a high-speed rail station, and information on entering and exiting a shopping mall.

[0097] The information for entering and exiting subway stations includes subway station signage and data indicating the geographical area where the subway station is located. The information for entering and exiting courier stations includes courier station signage and data indicating the geographical area where the courier station is located. The information for entering and exiting high-speed rail stations includes courier station signage and data indicating the geographical area where the high-speed rail station is located. The information for entering and exiting airports includes airport signage and data indicating the geographical area where the airport is located. The information for entering and exiting shopping malls includes shopping mall signage and data indicating the geographical area where the shopping mall is located.

[0098] Among them, the sign for a courier station can be the name or location of the courier station, the sign for a subway station can be the name or location of the subway station, the sign for a high-speed rail station can be the name or location of the high-speed rail station, the sign for an airport can be the name or location of the airport, the sign for a shopping mall can be the name or location of the upload, and so on.

[0099] The data used to indicate the geographical area includes, but is not limited to, the following: identifiers of network devices scanned (including connected) when the aforementioned specific actions occur, city data, and GPS location data. Network devices include, but are not limited to, Wi-Fi identifiers and base station identifiers.

[0100] In this embodiment of the application, the coverage area of ​​the base station can be obtained based on the base station identifier, the coverage area of ​​the Wi-Fi can be obtained based on the Wi-Fi identifier, and the coverage area of ​​the city can also be obtained based on the city.

[0101] exist Figure 2 The flowchart shown illustrates the method for obtaining geofences in this application embodiment, using the information indicated by the sample points in the sample set, including GPS positioning data from multiple point data points of multiple electronic devices performing a certain action as an example.

[0102] Specifically, GPS positioning data can refer to the latitude and longitude coordinates of an electronic device when performing a certain action. A sample point can indicate a set of latitude and longitude coordinates in a set of data points.

[0103] In some implementations, each sample point can be numbered according to the chronological order of the collection times. For example, if the sample set contains n sample points, each sample point can be numbered 1, 2, ..., n in chronological order of collection time.

[0104] Optionally, each sample point can be numbered according to the coordinate values ​​of multiple sample points in the collected sample set, from smallest to largest. For example, the smaller the longitude coordinate, the smaller the number of the sample point; for sample points with the same longitude coordinate, the smaller the latitude coordinate, the smaller the number of the sample point.

[0105] In the embodiments of this application, the above numbering method is only illustrative and does not limit the numbering method of multiple sample points in the sample set.

[0106] refer to Figure 3 , Figure 3 A scatter plot of the sample set provided in an embodiment of this application is shown as an example.

[0107] like Figure 3 As shown, Figure 3 The scatter plot shown represents the collected sample set. The multiple sample points included in the collected sample set can be represented by... Figure 3 The coordinates of multiple data points are used to represent the data. The horizontal axis of the coordinate system can represent longitude, and the vertical axis can represent latitude. The x and y coordinates of the data points in the scatter plot are used to represent the location information of the sample points. Figure 3 The values ​​of the horizontal and vertical axes in the figure are Figure 2 The values ​​of the horizontal axis and the vertical axis correspond.

[0108] For example, collection Figure 3 The sample set shown represents a specific action performed by an electronic device, such as hailing a ride. Figure 3As can be seen, each data point represents a ride-hailing activity performed by the electronic device at that latitude and longitude coordinate. The scatter plot composed of multiple data points contains both sparse and dense areas. That is, sparse areas correspond to geographical regions with fewer users hailing rides, while dense areas correspond to regions with more users hailing rides. If the electronic device needs to recommend ride-hailing related services, the electronic device will base its recommendations on… Figure 3 The sample set shown identifies the geofence for ride-hailing types.

[0109] In the embodiments of this application, Figure 3 The values ​​of the horizontal and vertical axes are for illustrative purposes only and are not intended to be limiting.

[0110] In this embodiment of the application, the sample set may also be the identifier of the network device scanned (including connected) when the above-mentioned specific behavior occurs, the city data, and the GPS location data, without limitation.

[0111] S202. Calculate the adjacent points and adjacent distances of multiple sample points within the first range.

[0112] In some implementations, the first range can be exemplarily defined as a circle centered at the sample point with a radius of R for its nearest neighbors. Here, the value of R can be determined manually based on the specific application scenario of the clustering algorithm provided in this application embodiment or based on empirical values. The magnitude of the R value may affect the server's computational speed.

[0113] In this embodiment, the first range can also be a range of other shapes. The sample point in the first range can also be understood as the R-neighborhood range of the sample point.

[0114] The adjacent points of a sample point can also refer to multiple sample points within the R-neighborhood of that sample point.

[0115] Adjacency distance refers to the distance between a sample point and its neighboring points within its R-neighborhood. If multiple neighboring points exist, each neighboring point can have a different adjacency distance.

[0116] In execution Figure 2 Before the flowchart shown, the nearest neighbor radius R can be set manually or based on empirical values. For example, different specific behaviors can have different nearest neighbor radii R. For instance, the nearest neighbor radius R can be 30m. In this embodiment, the value of the nearest neighbor radius R is not limited.

[0117] For example, when the nearest neighbor radius R is 30m, the calculation of the adjacent points of sample point a1 specifically includes:

[0118] First, based on the coordinates (x1, y1) of sample point a1, determine the sample points within the region {[(x1-30),(y1-30)],[(x1+30),(y1+30)]}. This is because the nearest neighbor radius R is 30m, and the R-neighborhood of sample point a1 must belong to a region centered on sample point a1 with a length of 60m. This further reduces the number of points that need to be calculated to determine whether two points are adjacent, saving computational resources.

[0119] In this embodiment of the application, the area with a length of 60m centered on sample point a1 is only for illustrative purposes and is not limited thereto. It is only necessary to ensure that the R neighborhood of the sample point belongs to this area.

[0120] Then calculate the distance between the sample points within the region and sample point a1.

[0121] If the distance between sample point a2 and sample point a1 is less than or equal to the nearest neighbor radius R, then sample point a2 is an adjacent point within the R neighborhood of sample point a1; if the distance between sample point a2 and sample point a1 is greater than the nearest neighbor radius R, then sample point a2 is not an adjacent point within the R neighborhood of sample point a1.

[0122] For example, in this embodiment of the application, the semi-versus formula can be used to calculate the distance between two sample points. The semi-versus formula is as follows:

[0123]

[0124] Here, distance(i,j) can represent the distance between sample point i and sample point j.

[0125] R earth It can represent the average radius of the Earth, and is generally taken as 6371 kilometers.

[0126] x i This can represent the longitude of sample point i. y i Let represent the latitude of sample point i.

[0127] x j This can represent the longitude of sample point j. j It can represent the latitude of sample point j.

[0128] In the embodiments of this application, other formulas for calculating the distance between two sample points may also be used, and there is no limitation on them.

[0129] Next, record the neighboring points within the R neighborhood of sample point a1 and their distances from sample point a1.

[0130] Finally, repeat the above process to record the neighboring points within the R neighborhood of each sample point and their distances from the sample point.

[0131] In another implementation, the distance between each sample point and other sample points in the sample set can be directly calculated, and the adjacent points and their distances within the R neighborhood of each sample point can be recorded.

[0132] For example, in this embodiment of the application, a directed adjacency graph can be used to record the adjacent points and their adjacency distances within the R-neighborhood of each sample point in the sample set. The directed adjacency graph is shown below:

[0133] G = (V, E)

[0134] Where V = 1, 2, ..., n can represent the set of nodes in the directed adjacency graph, that is, the set of adjacent nodes within the R neighborhood of the sample point.

[0135] The set V can represent the set of adjacent points within the R-neighborhood of all sample points, not the set of adjacent points within the R-neighborhood of a single sample point.

[0136] It is worth noting that if a sample point has no adjacent points within its R neighborhood, then that sample point does not belong to set V. In other words, this sample point may be an outlier and needs to be removed to avoid affecting the accuracy of subsequent cluster generation.

[0137] E = {(i,j)|i∈V,j∈V,distance(i,j)<R} can represent the set of edges (i.e., the set of adjacent edges) connecting nodes in a directed adjacency graph. The condition for this set of adjacent edges is that the distance between sample point i and sample point j does not exceed the nearest neighbor radius R.

[0138] That is, set E represents the set of adjacency distances within the R-neighborhood of a sample point. Set E can represent the set of adjacency distances within the R-neighborhood of all sample points, not just the set of adjacency distances within the R-neighborhood of a single sample point.

[0139] In the embodiments of this application, adjacent points and distances can also be recorded in a different way, and there are no limitations on this.

[0140] S203. Calculate the density of multiple sample points.

[0141] In some implementations, the density of a sample point can refer to the density of sample points within its R-neighborhood. For example, a higher sample point density indicates that the electronic device performs a specific action more frequently within that R-neighborhood. Furthermore, it suggests that the probability of the electronic device performing that specific action within that R-neighborhood may also be higher.

[0142] After obtaining the neighboring points and neighborhood distances within the R neighborhood of each sample point, the density of each sample point can be calculated based on these neighborhood distances.

[0143] In some implementations, the density of a sample point can be the sum of the adjacency weights of that sample point and all its neighboring points within its R-neighborhood. The formula for calculating the density of a sample point is as follows:

[0144]

[0145] Here, density(i) can represent the density of sample point i.

[0146] weight(i,j) can represent the adjacency weight mapped by the distance between sample point i and sample point j.

[0147] (i,j)∈E indicates that sample point i and sample point j belong to set V and the distance between sample point i and sample point j is less than the nearest neighbor radius R.

[0148] ∑ (i,j)∈E weight(i,j) can represent the sum of the adjacency weights mapped to sample point i and all its neighboring points within its R neighborhood.

[0149] The adjacency weight is obtained by mapping the adjacency distance (i.e., the distance between sample point i and its neighboring points within its R-neighborhood). The above mapping relationship must satisfy the following: the larger the adjacency distance, the smaller the adjacency weight, and the adjacency weight value is a non-negative number.

[0150] For example, in this embodiment of the application, a linear kernel function can be used to map adjacency distance to adjacency weight. The mapping formula is as follows:

[0151]

[0152] Here, weight(i,j) can represent the adjacency weight between sample point i and sample point j.

[0153] min(distance(i,j),R) can be used to represent the smaller value between distance(i,j) and R.

[0154] For example: if distance(i,j) is less than R, then min(distance(i,j),R) can take the value distance(i,j); if distance(i,j) is equal to R, then min(distance(i,j),R) can take the value distance(i,j) or R; if distance(i,j) is greater than R, then min(distance(i,j),R) can take the value R.

[0155] As can be seen from the mapping formula, weight(i,j) can be at most 1 and at least 0.

[0156] For example, when distance(i,j) is very small, weight(i,j) can approach 1 infinitely; when distance(i,j) equals R, weight(i,j) can be 0; theoretically, when distance(i,j) is greater than R, weight(i,j) can also be 0. However, in reality, there is no case where distance(i,j) is greater than R. That is to say, only the weights mapped from the adjacency distances of adjacent points within the R-neighborhood range of each sample point are non-zero.

[0157] S204. Determine the direction of the density gradient between multiple sample points based on the density magnitude of multiple sample points.

[0158] After calculating the density magnitudes of multiple sample points, the direction of the density gradient in the directed adjacency graph can be determined. The density gradient direction can be the partial order relationship between multiple sample points in the directed adjacency graph, or it can be understood as the directional relationship between a sample point and its neighboring points in the directed adjacency graph.

[0159] In some implementations, a directed adjacency graph can be considered a directed acyclic graph when all edges in the graph satisfy a strict partial order relation.

[0160] In the embodiments of this application, the density relationship is theoretically a partial order relationship. For example, a sample point with lower density can point to a sample point with higher density. A strict partial order relationship requires that the direction of each sample point pointing to other sample points is unique; there cannot be a situation where sample point 1 points to sample point 2, and sample point 2 points to sample point 1, that is, there cannot be a cycle between multiple sample points. However, for two different sample points in the sample set, their density may be the same. Therefore, determining the density gradient direction solely based on the density of sample points does not satisfy the strictness requirement.

[0161] To ensure the strictness of the density gradient direction in the sample set, embodiments of this application can determine the strict partial order relationship based on the density magnitude and the number of the sample points.

[0162] Specifically, a strict partial order relation can be determined by constructing a tuple (density(i), i) with the density and number of the sample points, and comparing the size relationship of the tuples for each sample point.

[0163] The order of the tuples can be defined as: Tuple(x1, x2, ..., x...). n ) < Tuple(y1, y2, ..., y n ), if and only if: there exist i∈1,2,...,n, for all j∈1,2,...i-1,x j =y j And x i <y i .

[0164] For example, when i is 3, if x1 = y1, x2 = y2 and x3 < y3, then Tuple(x1, x2, x3) < Tuple(y1, y2, y3).

[0165] In this embodiment of the application, in order to distinguish the direction of the density gradient, it is necessary to define the direction between multiple sample points:

[0166] For any edge (i, j) ∈ E, when Tuple(density(i), i) < Tuple(density(j), j), that is, when density(i) < density(j) or density(i) = density(j) and i < j, sample point i points to sample point j. In other words, the direction from sample point i to sample point j is the upward direction, and the direction from sample point j to sample point i is the downward direction.

[0167] In other words, for two adjacent sample points, when the densities of the two sample points are different, the direction from the sample point with lower density to the sample point with higher density is upward; when the densities of the two sample points are the same, the direction from the sample point with lower number to the sample point with higher number is upward.

[0168] Since each sample point has a unique identifier, the tuples for each sample point are also unique. Therefore, the tuples for each sample point satisfy a strict partial order relation.

[0169] After determining the positive and negative directions of the density gradient based on the tuple size relationship of the sample points, the positive direction of the density gradient (i.e., the direction is upward) is selected, and the directed acyclic graph of the sample set is determined based on the directed adjacency graph obtained by S202.

[0170] In the embodiments of this application, the fact that sample point i points to sample point j can be understood as sample point i having an upward adjacent point sample point j.

[0171] The following is combined Figure 4A as well as Figure 4B This will explain how to determine the direction of the density gradient based on the density and number of the sample points.

[0172] refer to Figure 4A , Figure 4A An exemplary embodiment of the present application provides a directed adjacency graph G1.

[0173] Where G1 = (V1, E1), V1 = μ1, v2, v3, v4, and v1, v2, v3, v4 are adjacent points that have a pairwise adjacency distance. For example, density(v1) = 1, density(v2) = 2, density(v3) = 2, and density(v4) = 4.

[0174] Since density(v1) < density(v2) = density(v3) < density(v4), based on the method described above for determining density gradient relationships based on tuple size, the positive direction of the density gradient of the directed adjacency graph G1 can be determined as follows: Figure 4A The arrows in the image indicate the direction:

[0175] v1 points to v2, v1 points to v3, v1 points to v4, v2 points to v3, v2 points to v4, v3 points to v4.

[0176] refer to Figure 4B , Figure 4B An exemplary embodiment of the present application provides another directed adjacency graph G2.

[0177] Where G2 = (V2, E2), V2 = v5, v6, v7, v8, and v5, v6, v7, v8 are adjacent points that have a common distance between them. For example, density(v5) = 3, density(v6) = 1, density(v7) = 2, and density(v8) = 4.

[0178] Since density(v6) < density(v7) < density(v5) < density(v8), according to the method described above for determining the density gradient relationship based on tuple size, the positive direction of the density gradient of the directed adjacency graph G2 can be determined as follows: Figure 4B The arrows in the image indicate the direction:

[0179] v6 points to v5, v6 points to v7, v6 points to v8, v7 points to v5, v7 points to v8, v5 points to v8.

[0180] In some implementations, if there is no adjacency distance between two sample points in the directed adjacency graph, then there is no need to determine the direction of the density gradient between the two sample points. For example, if all of v5, v6, v7, and v8 except v6 and v7 are adjacent points with pairwise adjacency distances, then there is no need to determine whether the positive direction is from v5 to v6 or from v5 to v6. That is, during the execution of S204, it is necessary to determine the positive direction of the density gradient based on the set of adjacent edges in the directed adjacency graph obtained in S202.

[0181] S205. Determine the density gradient hierarchy map based on the density gradient directions of multiple sample points, and traverse the density gradient hierarchy map to obtain multiple clusters.

[0182] First, after identifying the positive direction of the density gradient (i.e., upward) and determining the directed acyclic graph (DAG), it is necessary to determine the parent node of each sample point in the DAG. Furthermore, it must be ensured that each sample point has at most one parent node. Then, for each node, only the edges of its parent nodes are retained from its adjacent edge set. Here, the adjacent edge set of a sample point refers to the set of lines connecting that sample point to its neighbors within its R-neighborhood. Finally, the directed forest graph of the sample set is obtained, i.e., the density gradient hierarchy graph.

[0183] As can be seen from S204, a sample point may point to multiple sample points, but in order to determine the parent node of the sample point in the density gradient hierarchy map, uniqueness must be guaranteed.

[0184] Therefore, embodiments of this application can determine the unique parent node of a sample point by comparing adjacency weights.

[0185] Specifically, when a sample point points to multiple adjacent points, the adjacent point with the largest adjacency weight among the multiple adjacent points is selected as the parent node of the sample point.

[0186] For example, after executing S204, sample point n1 points to sample points n2, n3, and n4. Where weight(n1, n2) = 0.9, weight(n1, n3) = 0.6, and weight(n1, n4) = 0.5, the parent node of sample point n1 is determined to be sample point n2.

[0187] Specifically, when multiple neighboring points pointed to by a sample point have the same adjacency weight, the density and number of the multiple neighboring points can be compared further.

[0188] For example, for a sample point i whose parent node needs to be determined, a weight tuple (weight(i, j), density(j), j) can be constructed, where the neighboring node j with the largest weight tuple value is the parent node of sample point i. The comparison method for tuple sizes can be found in the relevant description in S204 above, and will not be repeated here.

[0189] In some implementations, multiple clusters can be obtained by traversing the density gradient hierarchy graph obtained above. Each maximally connected component in the density gradient hierarchy graph is a dendrogram. Furthermore, each dendrogram can be associated with the aforementioned... Figure 1 Each peak in the density surface plot corresponds to a specific peak. Therefore, obtaining each dendrogram of the density gradient hierarchy plot yields multiple clusters.

[0190] Specifically, first, the sample points without parent nodes in the density gradient hierarchy map are identified as the root node of each tree diagram.

[0191] Then determine the cluster label for each tree diagram. For example, the sample point number that serves as the root node of each tree diagram can be used as the cluster label for each tree diagram.

[0192] Next, enqueue all sample points that serve as the root node. Then, completely traverse the sample point queue. Specifically, completely traversing the sample queue can mean: first, read the sample point i that serves as the root node from the queue; then, determine the child nodes of sample point i, that is, the multiple adjacent nodes with sample point i as the parent node; then, assign the cluster label of all child nodes of sample point i to the cluster label of sample point i; finally, add all child nodes of sample point i to the queue.

[0193] Finally, all sample points in the queue are grouped according to their cluster labels, and each group is considered as a cluster.

[0194] In other words, each cluster includes a root node and multiple child nodes. The root node can be a sample point whose density gradient direction points to itself from its neighboring points. The multiple child nodes can be sample points that pass through one or more density gradient directions pointing to the root node.

[0195] refer to Figure 5 , Figure 5 An exemplary diagram of the density gradient hierarchy of the sample set provided in an embodiment of this application is shown.

[0196] like Figure 5 As shown, Figure 5 The planar coordinate graph shown is a density gradient hierarchy diagram of the sample set after clustering. Figure 5Each vertex shown is a sample point, and the connection between any two vertices is a line connecting the sample point to its parent node. Each closed curve containing sample points and its adjacent edge set represents a cluster. For example, Figure 5 Eleven clusters are shown. Other clusters were filtered out because they contained too few sample points.

[0197] S206. Generate geofences based on multiple clusters.

[0198] In some implementations, the geographic area covered by each cluster can be used as the scope of a geofence.

[0199] Specifically, the coordinates of the boundary points of multiple clusters can be used as the boundary point coordinates of multiple geofences. When the boundary of a cluster is a regular shape (e.g., rectangle, circle) or an approximately regular shape, the boundary of the cluster can also be represented by the parameters of the regular shape. For example, a vertex coordinate and the length and width of the rectangle can be used to represent the rectangular boundary, and the center coordinate and radius of the circle can be used to represent the circular boundary.

[0200] Alternatively, when the cluster boundary (usually a closed shape) is irregular, the cluster boundary can be represented by the set of coordinates of the boundary points along the clockwise or counterclockwise direction, thereby determining the cluster boundary as the generated geofence.

[0201] In one possible implementation, different approaches may be taken to further determine the geofence, depending on the specific actions performed when collecting sample points.

[0202] For example, based on the latitude and longitude of the root node of a cluster, the location of the sample point farthest from the root node in that cluster can be determined first. Then, the distance dmax between the farthest sample point and the root node can be determined. Finally, a geofence generated based on that cluster can be determined using the root node as the radius and dmax as the radius. If the specific behavior performed at the sample point is hailing a ride, then the geofence can be determined to be a ride-hailing type geofence. Optionally, for example, generally, when performing a ride-hailing behavior, the user has not yet taken a ride; therefore, a ride-hailing type geofence may not include the geographical area of ​​roads.

[0203] In the embodiments of this application, the above methods are only illustrative and are not intended to limit the scope of the application.

[0204] In some implementations, clusters with fewer sample points can be filtered out. For example, if a cluster contains fewer than 20 sample points, it will be filtered out. In other words, filtered-out clusters will not be subject to geographic feature extraction.

[0205] By implementing the above method, more accurate geofencing can be obtained. The multiple clusters obtained using the embodiments of this application will neither cover too many sample points nor too few sample points.

[0206] In one possible implementation, the collected sample set may be the Wi-Fi identifier and / or base station identifier from multiple data points of multiple electronic devices performing a certain action.

[0207] Geofencing can also be generated when the sample set is identified by Wi-Fi identifiers. Specifically, the similarity between each Wi-Fi in the sample set is first calculated. This similarity can be measured by the distance between Wi-Fi coverage areas. Then, a weight mapping is performed based on the similarity between Wi-Fis to obtain the Wi-Fi density for each sample. The lower the similarity, the lower the weight, and the weight values ​​are non-negative. The Wi-Fi density of a sample is the sum of the weights corresponding to the similarity of all Wi-Fis. Next, multiple clusters are determined based on the Wi-Fi density. Finally, a geofence is generated. For details on how to determine multiple clusters based on density, please refer to the above. Figure 2 The relevant descriptions will not be repeated here.

[0208] When the sample set is identified by base station identifiers, geofencing can also be generated. Specifically, first, the similarity between each base station in the sample set is calculated. This similarity can be measured by the distance between the coverage areas of the base stations. Then, a weight mapping is performed based on the similarity between the base stations to obtain the density of each base station. The lower the similarity, the lower the weight, and the weight values ​​are non-negative. The density of a base station is the sum of all weights. Next, multiple clusters are determined based on the base station density. Finally, geofencing is generated. For details on how to determine multiple clusters based on density, please refer to the above. Figure 2 The relevant descriptions will not be repeated here.

[0209] In one possible implementation, the clusters obtained by using two or more parameters can be combined to obtain a union cluster, and then geographic features can be extracted from the union cluster to obtain a geofence.

[0210] In some implementations, after a geofence is generated, when an electronic device is detected entering that geofence, services related to that geofence can be pushed to the electronic device. For example, after detecting that an electronic device has entered a ride-hailing geofence, the electronic device can push information related to ride-hailing coupons.

[0211] In some implementations, embodiments of this application may also periodically collect sample sets to update the generated geofence. For example, the sample set may consist of data points from multiple electronic devices within a week, and then, after a one-month interval, another week's sample set may be collected to update the geofence.

[0212] Based on the aforementioned method and process, the following describes the communication system used in the method for obtaining geofences provided in this application. This communication system includes a server (also known as the cloud) and multiple electronic devices.

[0213] Figure 6 A schematic diagram of the hardware architecture of the electronic device 100 is shown.

[0214] Electronic device 100 may be equipped with Alternatively, it can be a portable terminal device with other operating systems. Electronic device 100 can be a mobile phone, tablet computer, desktop computer, laptop computer, handheld computer, ultra-mobile personal computer (UMPC), netbook, as well as cellular phone, personal digital assistant (PDA), augmented reality (AR) device, virtual reality (VR) device, artificial intelligence (AI) device, wearable device, vehicle, in-vehicle device, smart home device, and / or smart city device. It is not limited to these; electronic device 100 can also include non-portable terminal devices such as laptops and desktop computers with touch-sensitive surfaces or touch panels. This application embodiment does not impose any special limitations on the specific type of electronic device.

[0215] Electronic device 100 may include processor 110, external memory interface 120, internal memory 121, universal serial bus (USB) interface 130, charging management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0216] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0217] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.

[0218] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0219] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0220] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C buses. The processor 110 can couple to the touch sensor 180K, charger, flash, camera 193, etc., through different I2C bus interfaces. For example, the processor 110 can couple to the touch sensor 180K through the I2C interface, enabling the processor 110 and the touch sensor 180K to communicate through the I2C bus interface, thereby realizing the touch function of the electronic device 100.

[0221] The I2S interface can be used for audio communication. In some embodiments, the processor 110 may include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface to enable the function of answering phone calls through a Bluetooth headset.

[0222] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via the PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering phone calls through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0223] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface to enable music playback through Bluetooth headphones.

[0224] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to enable the electronic device 100 to capture images. The processor 110 and the display screen 194 communicate via the DSI interface to enable the electronic device 100 to display images.

[0225] The GPIO interface can be configured via software. It can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to a camera 193, a display screen 194, a wireless communication module 160, an audio module 170, a sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0226] USB port 130 is a USB standard compliant interface, specifically a Mini USB port, Micro USB port, USB Type-C port, etc. USB port 130 can be used to connect a charger to charge electronic device 100, and can also be used for data transfer between electronic device 100 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other electronic devices, such as AR devices.

[0227] It is understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0228] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device via the power management module 141.

[0229] The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, providing power to the processor 110, internal memory 121, display screen 194, camera 193, and wireless communication module 160, etc. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 141 may also be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be located in the same device.

[0230] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.

[0231] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with a tuning switch.

[0232] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.

[0233] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 194. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.

[0234] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, demodulates and filters the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, frequency modulate and amplify them, and then convert them into electromagnetic waves for radiation via antenna 2.

[0235] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).

[0236] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0237] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.

[0238] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.

[0239] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and color. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.

[0240] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.

[0241] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 100 selects a frequency, the DSP can perform Fourier transforms on the frequency energy.

[0242] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0243] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.

[0244] Internal memory 121 may include one or more random access memory (RAM) and one or more non-volatile memory (NVM).

[0245] Random access memory can include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), and double data rate synchronous dynamic random access memory (DDR SDRAM, such as fifth-generation DDR SDRAM, which is generally called DDR5 SDRAM). Non-volatile memory can include disk storage devices and flash memory.

[0246] Flash memory can be classified according to its operating principle, including NOR FLASH, NAND FLASH, 3D NAND FLASH, etc.; according to the level of the storage cell, including single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc.; and according to the storage specification, including universal flash storage (UFS) and embedded multimedia card (eMMC), etc.

[0247] The random access memory can be directly read and written by the processor 110. It can be used to store executable programs (such as machine instructions) of the operating system or other running programs, as well as user and application data.

[0248] Non-volatile memory can also store executable programs and user and application data, and can be pre-loaded into random access memory for direct reading and writing by the processor 110.

[0249] The external memory interface 120 can be used to connect to external non-volatile memory, thereby expanding the storage capacity of the electronic device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to perform data storage functions. For example, music, video, and other files can be stored in the external non-volatile memory.

[0250] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.

[0251] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110.

[0252] The speaker 170A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or make hands-free calls through the speaker 170A.

[0253] The receiver 170B, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a telephone call or voice message, the receiver 170B can be brought close to the ear to listen to the voice.

[0254] Microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 170C, inputting the sound signal into microphone 170C. Electronic device 100 may have at least one microphone 170C. In some embodiments, electronic device 100 may have two microphones 170C, which, in addition to collecting sound signals, can also perform noise reduction. In other embodiments, electronic device 100 may also have three, four, or more microphones 170C, which can collect sound signals, reduce noise, identify the sound source, and perform directional recording, etc.

[0255] The 170D headphone jack is used to connect wired headphones. The 170D headphone jack can be a USB 130 interface or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, a CTIA (Cellular Telecommunications Industry Association of the USA) standard interface.

[0256] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be disposed on display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive material. When force is applied to pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the intensity of the touch operation based on pressure sensor 180A. Electronic device 100 can also calculate the touch position based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands. For example, when a touch operation with an intensity less than a first pressure threshold is applied to the SMS application icon, a command to view an SMS is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the SMS application icon, a command to create a new SMS is executed.

[0257] The gyroscope sensor 180B can be used to determine the motion attitude of the electronic device 100. In some embodiments, the gyroscope sensor 180B can determine the angular velocity of the electronic device 100 about three axes (i.e., the x, y, and z axes). The gyroscope sensor 180B can be used for image stabilization. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the shake of the electronic device 100, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to counteract the shake of the electronic device 100 by moving in the opposite direction, thus achieving image stabilization. The gyroscope sensor 180B can also be used in navigation and motion-sensing game scenarios.

[0258] The barometric pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates altitude using the air pressure value measured by the barometric pressure sensor 180C to assist in positioning and navigation.

[0259] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip cover. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover using the magnetic sensor 180D. Then, based on the detected opening and closing state of the cover or the flip cover, features such as automatic flip unlocking can be set.

[0260] The 180E accelerometer can detect the magnitude of acceleration of electronic device 100 in various directions (typically three axes). When electronic device 100 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the posture of electronic devices and applied to applications such as screen orientation switching and pedometers.

[0261] A distance sensor 180F is used to measure distance. Electronic device 100 can measure distance via infrared or laser. In some embodiments, during a shooting scene, electronic device 100 can utilize the distance sensor 180F to measure distance for rapid focusing.

[0262] The proximity sensor 180G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The LED may be an infrared LED. The electronic device 100 emits infrared light outward through the LED. The electronic device 100 uses the photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 may use the proximity sensor 180G to detect when a user holds the electronic device 100 close to their ear for a call, so as to automatically turn off the screen to save power. The proximity sensor 180G can also be used in holster mode and pocket mode for automatic unlocking and locking of the screen.

[0263] The ambient light sensor 180L is used to sense the brightness of ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 194 based on the sensed ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also work with the proximity sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.

[0264] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can utilize the characteristics of the collected fingerprints to achieve fingerprint unlocking, accessing application locks, taking photos with fingerprints, answering calls with fingerprints, etc.

[0265] Temperature sensor 180J is used to detect temperature. In some embodiments, electronic device 100 uses the temperature detected by temperature sensor 180J to execute a temperature handling strategy. For example, when the temperature reported by temperature sensor 180J exceeds a threshold, electronic device 100 performs thermal protection by reducing the performance of a processor located near temperature sensor 180J to reduce power consumption. In other embodiments, when the temperature is below another threshold, electronic device 100 heats battery 142 to prevent abnormal shutdown of electronic device 100 due to low temperature. In still other embodiments, when the temperature is below yet another threshold, electronic device 100 boosts the output voltage of battery 142 to prevent abnormal shutdown due to low temperature.

[0266] Touch sensor 180K, also known as a "touch device," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touchscreen." Touch sensor 180K detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be located on the surface of electronic device 100, in a different position than display screen 194.

[0267] The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire vibration signals from the vibrating bone segments of the human vocal cords. The bone conduction sensor 180M can also contact the human pulse to receive blood pressure signals. In some embodiments, the bone conduction sensor 180M can also be incorporated into headphones to form bone conduction headphones. The audio module 170 can parse the voice signals from the vibrating bone segments of the vocal cords acquired by the bone conduction sensor 180M to realize voice functionality. The application processor can parse heart rate information from the blood pressure signals acquired by the bone conduction sensor 180M to realize heart rate detection functionality.

[0268] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100.

[0269] Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. For example, different vibration feedback effects can correspond to touch operations performed on different applications (such as taking photos, playing audio, etc.). Motor 191 can also correspond to different vibration feedback effects for touch operations performed on different areas of the display screen 194. Different application scenarios (such as time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized.

[0270] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.

[0271] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to make contact with and separate from the electronic device 100. The electronic device 100 can support one or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 simultaneously. The multiple cards can be of the same or different types. The SIM card interface 195 is also compatible with different types of SIM cards. The SIM card interface 195 is also compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as calls and data communication. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0272] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This embodiment of the invention uses the layered architecture Android system as an example to illustrate the software structure of electronic device 100.

[0273] Figure 7 This is a schematic diagram of the software architecture of the electronic device 100 according to an embodiment of the present invention.

[0274] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

[0275] The application layer can include a series of application packages.

[0276] like Figure 7 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and SMS.

[0277] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0278] like Figure 7 As shown, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.

[0279] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.

[0280] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.

[0281] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.

[0282] The phone manager is used to provide communication functions for electronic device 100. For example, it manages call status (including connection and disconnection).

[0283] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.

[0284] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.

[0285] The Android Runtime consists of core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.

[0286] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.

[0287] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0288] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.

[0289] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.

[0290] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.

[0291] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0292] A 2D graphics engine is a graphics engine for 2D drawing.

[0293] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.

[0294] Figure 8 This is a schematic diagram of the hardware architecture of the server in an embodiment of this application.

[0295] like Figure 8 As shown, the server may include: one or more processors 201, memory 202, communication interface 203, transmitter 205, receiver 206, coupler 207, and antenna 208. These components can be connected via bus 204 or other means. Figure 8 Taking a connection via bus 204 as an example. Where:

[0296] The processor 201 can be used to read and execute computer-readable instructions. Specifically, the processor 201 can be used to call a program stored in the memory 202, such as the method provided in the embodiments of this application, which calculates the density of sample points in a sample set based on a sample set reported by an electronic device, generates a geofence based on multiple clusters obtained, and then sends the geofence to the electronic device, and executes the instructions contained in the program.

[0297] The memory 202 is coupled to the processor 201 and is used to store various software programs and / or multiple sets of instructions. Specifically, the memory 202 may include high-speed random access memory and may also include non-volatile memory, such as one or more disk storage devices, flash memory devices, or other non-volatile solid-state storage devices.

[0298] The memory 202 can store an operating system (hereinafter referred to as the system), such as uCOS, VxWorks, RTLinux, and other embedded operating systems. The memory 202 can also store network communication programs, which can be used to communicate with electronic devices. Furthermore, the memory 202 can also be used to store sample sets reported by electronic devices, etc.

[0299] The communication interface 203 can be used for communication between the server and other communication devices, such as electronic devices. Specifically, the communication interface 203 can be a 3G communication interface, a Long Term Evolution (LTE) (4G) communication interface, a 5G communication interface, a WLAN communication interface, a WAN communication interface, etc. Not limited to wireless communication interfaces, the server can also be configured with a wired communication interface 203 to support wired communication; for example, the link between the server and electronic devices can be a wired communication connection.

[0300] In some embodiments of this application, transmitter 205 and receiver 206 can be considered as a wireless modem. Transmitter 205 can be used to transmit signals output by processor 201. Receiver 206 can be used to receive signals. In a server, the number of transmitters 205 and receivers 206 can be one or more. Antenna 208 can be used to convert electromagnetic energy in a transmission line into electromagnetic waves in free space, or to convert electromagnetic waves in free space into electromagnetic energy in a transmission line. Coupler 207 can be used to split mobile communication signals into multiple paths and distribute them to multiple receivers 206. Understandably, the antenna 208 of the network device can be implemented as a massive MIMO (Massively Multi-Size Antenna Array).

[0301] The server can transmit data with electronic devices through the aforementioned transmitter 205 and receiver 206. Specifically, this includes receiving sample sets reported by electronic devices through receiver 206 and sending geofences to electronic devices through transmitter 205.

[0302] It should be understood that the steps in the above-described method embodiments provided in this application can be implemented by integrated logic circuits in the processor hardware or by instructions in software form. The method steps disclosed in the embodiments of this application can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.

[0303] This application also provides an electronic device that may include a memory and a processor. The memory may be used to store a computer program; the processor may be used to invoke the computer program in the memory to cause the electronic device to perform the method in any of the above embodiments.

[0304] This application also provides a chip system including at least one processor for implementing the functions involved in the methods performed by the electronic device in any of the above embodiments.

[0305] In one possible design, the chip system also includes a memory for storing program instructions and data, which may be located within or outside the processor.

[0306] The chip system can consist of chips or include chips and other discrete components.

[0307] Optionally, the chip system may contain one or more processors. These processors can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented in software, the processor can be a general-purpose processor, implemented by reading software code stored in memory.

[0308] Optionally, the chip system may contain one or more memories. The memory may be integrated with the processor or disposed separately from it; this application embodiment does not limit this. For example, the memory may be a non-transient processor, such as a read-only memory (ROM), which may be integrated with the processor on the same chip or disposed separately on different chips. This application embodiment does not specifically limit the type of memory or the arrangement of the memory and processor.

[0309] For example, the chip system may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a micro controller unit (MCU), a programmable logic device (PLD), or other integrated chips.

[0310] This application also provides a computer program product comprising: a computer program (also referred to as code or instructions) that, when run, causes a computer to perform the method executed by the electronic device in any of the above embodiments.

[0311] This application also provides a computer-readable storage medium storing a computer program (also referred to as code or instructions). When the computer program is run, it causes the computer to perform the method executed by the electronic device in any of the above embodiments.

[0312] The various embodiments of this application can be combined arbitrarily to achieve different technical effects.

[0313] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0314] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

[0315] In summary, the above description is merely an embodiment of the technical solution of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made according to the disclosure of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method of acquiring a geofence, the method comprising: The method comprises: obtaining a data set comprising a plurality of sample points, the sample points indicating position information of an electronic device when performing a first behavior; numbering the plurality of sample points; determining adjacent points of each sample point, and determining adjacent distances between each sample point and the adjacent points of the sample point, the adjacent points of a sample point comprising other sample points in a first range of the sample point in the data set; determining sample point density in the first range to which each sample point belongs based on the adjacent distances of each sample point, the greater the sample point density, the more times the electronic device performs the first behavior in the first range corresponding to the sample point; determining a density gradient direction between each sample point and the adjacent points of the sample point, the positive direction of the density gradient direction between any two sample points being from the sample point with smaller density to the sample point with larger density; determining a plurality of clusters, each cluster comprising a root node and a plurality of child nodes, the root node being a sample point whose density gradient directions with adjacent points all point to itself, and the plurality of child nodes comprising sample points pointing to the root node through one or more density gradient directions; the plurality of child nodes in the cluster comprise sample points pointing to the root node through one or more density gradient directions, the one or more density gradient directions comprising a first density gradient direction, the first density gradient direction being from a first sample point to a second sample point, and the weight corresponding to the adjacent distance between the first sample point and the second sample point being the largest among the weights corresponding to all adjacent distances of the first sample point; if the weight corresponding to the adjacent distance between the first sample point and a third sample point is the same as the weight corresponding to the adjacent distance between the first sample point and the second sample point, the first density gradient direction is from the first sample point to the sample point with larger density between the second sample point and the third sample point; if the weight corresponding to the adjacent distance between the first sample point and the third sample point is the same as the weight corresponding to the adjacent distance between the first sample point and the second sample point, and the densities of the second sample point and the third sample point are the same, the first density gradient direction is from the first sample point to the sample point with larger number between the second sample point and the third sample point; determining a plurality of geofences, one geofence corresponding to one cluster, the geofence being used to recommend a service related to the first behavior to the electronic device when detecting that the electronic device enters the geofence.

2. The method of claim 1, wherein, The first range comprises a range with a first radius as a radius and the sample point as a center.

3. The method of claim 1, wherein, The sample point density is a sum of weights corresponding to all adjacent distances of the sample point, wherein the greater the distance between a sample point and an adjacent point, the smaller the weight corresponding to the adjacent distance between them, and the weight corresponding to the adjacent distance between them is a non-negative number.

4. The method according to any one of claims 1-3, characterized in that, The plurality of sample points are numbered, specifically comprising: The plurality of sample points are numbered in one or more of the following ways: numbering the plurality of sample points in chronological order of collecting the sample points; The sample points are numbered according to the longitude and latitude indicated by the sample points, wherein, the longitude of a sample point is smaller, the sample point is numbered smaller, and when the longitude is the same, the latitude of a sample point is smaller, the sample point is numbered smaller; If the density of two sample points is the same, the positive direction of the density gradient direction between the two sample points is from the sample point numbered smaller to the sample point numbered larger.

5. The method of any one of claims 1-3, wherein, The first behavior is a taxi-booking behavior, and the service related to the first behavior includes one or more of the following: taxi-booking discount information, taxi-booking location recommendation information, and taxi-booking time information of a commonly used path; The first behavior is a bus-riding behavior, and the service related to the first behavior includes one or more of the following: bus-arrival time information, and bus-riding time information of a commonly used path; The first behavior is a subway-riding behavior, and the service related to the first behavior includes one or more of the following: subway-riding discount information, and subway-arrival time information.

6. The method according to any one of claims 1-3, characterized in that, After obtaining the data set, the method further includes: displaying a scatter plot, the horizontal axis of the scatter plot represents longitude, and the vertical axis of the scatter plot represents latitude, a plurality of data points in the scatter plot are used to represent a plurality of sample points in the data set, the horizontal coordinate and the vertical coordinate of a data point in the scatter plot are used to represent the position information of the sample point.

7. The method according to any one of claims 1-3, characterized in that, After determining the density of sample points in the first range to which each sample point belongs based on the adjacency distance of each sample point, the method further includes: displaying a density curve graph, wherein the horizontal axis of the density curve graph represents longitude, the vertical axis of the density curve graph represents latitude, and the vertical axis of the density curve graph represents density, a plurality of peaks in the density curve graph represent the plurality of clusters, the coordinates of a point on the surface of a peak in the density curve graph represent the density and position information of a sample point in the cluster, and the coordinates of the highest point of a peak in the density curve graph represent the density and position information of the root node of the cluster.

8. The method of any one of claims 1-3, wherein, After determining the plurality of clusters, the method further includes: displaying a density gradient hierarchy graph, the horizontal axis of the density gradient hierarchy graph represents longitude, and the vertical axis of the density gradient hierarchy graph represents latitude, a plurality of turning points in the density gradient hierarchy graph are used to represent a plurality of sample points in the data set, a plurality of turning lines in the density gradient hierarchy graph are used to represent the density gradient direction between the root node and a plurality of child nodes and the density gradient direction between a plurality of child nodes, a plurality of tree diagrams in the density gradient hierarchy graph are used to represent the plurality of clusters.

9. A communication system, characterized by The communication system includes a server and a plurality of electronic devices, the server includes one or more memories and one or more processors; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors invoke the computer instructions to enable the server to perform the method of any one of claims 1-8.

10. A server, characterized by The server comprises one or more memories, one or more processors; the memory is coupled with the one or more processors, the memory is used to store computer program code, the computer program code comprises computer instructions, the one or more processors invoke the computer instructions to enable the server to execute the method as claimed in any one of claims 1-8.

11. A chip applied to a server, characterized by, The chip comprises one or more processors, the processor is used to invoke computer instructions to enable the server to execute the method as claimed in any one of claims 1-8.

12. A computer-readable storage medium comprising instructions, wherein: When the instructions run on the server, enable the server to execute the method as claimed in any one of claims 1-8.

Citation Information

Patent Citations

  • Geographic fence determination method and device based on user position and electronic equipment

    CN109992633A

  • Traffic data clustering method and device, equipment and medium

    CN115563522A