Electronic device for configuring geofence and operation method thereof
An electronic device may include a communication circuit and a processor electrically connected to the communication circuit, where the processor may be configured to receive location information of the electronic device, identify whether an amount of the location information is greater than or equal to a reference amount, and change a geofence configuration based on a location accuracy radius of the location information, in case that the location information amount is equal to or greater than the reference amount, and the location accuracy radius may be determined based on a probability that the electronic device is actually located in a specific area.
1 . An electronic device comprising:
a communication circuit;
at least one processor, comprising processing circuitry, electrically connected to the communication circuit; and
memory storing instructions that, when executed by the at least one processor individually and/or collectively, cause the electronic device to:
identify first information on locations of the electronic device and second information on probability distances from a reference location of a geofence, wherein the probability distances are determined such that a probability that the locations are within the probability distances respectively is equal to a designated value,
identify whether a number of the locations is equal to or greater than a designated number configured for the geofence with a first range,
in case that the number of the locations is equal to or greater than the designated number, identify a second range based on the probability distances, and
change a range of the geofence from the first range to the second range.
2 . The electronic device of claim 1 , wherein the first range corresponds to a first radius and the second range corresponds to a second radius,
wherein the instructions, when executed by the at least one processor individually and/or collectively, cause the electronic device to:
identify the second radius greater than the first radius, based on at least one of a mean value, or a standard deviation of the probability distances, and
increase a radius of the range of the geofence from the first radius to the second radius.
3 . The electronic device of claim 1 , wherein the first range corresponds to a first radius and the second range corresponds to a second radius,
wherein the instructions, when executed by the at least one processor individually and/or collectively, cause the electronic device to:
identify the second radius greater than the first radius, based on an interquartile range (IQR) of the probability distances, and
increase a radius of the range of the geofence from the first radius to the second radius.
4 . The electronic device of claim 1 , wherein the instructions, when executed by the at least one processor individually and/or collectively, cause the electronic device to:
in case that the number of the locations is less than the designated number, maintain the range of the geofence.
5 . The electronic device of claim 1 , wherein the first information includes at least one of global navigation satellite system (GNSS) information, cellular positioning system (CPS) information or wi-fi positioning system (WPS) information.
6 . The electronic device of claim 1 , wherein the instructions, when executed by the at least one processor individually and/or collectively, cause the electronic device to:
identify first probability distances greater than a reference distance for an accuracy among the probability distances, and
identify the second range based on second probability distances remaining after excluding the first probability distances from the probability distances.
7 . The electronic device of claim 1 , wherein the instructions, when executed by the at least one processor individually and/or collectively, cause the electronic device to:
identify whether a distribution of the locations is biased in a specific direction, and
in case that the distribution is biased in the specific direction, change the reference location corresponding to a center of the geofence.
8 . The electronic device of claim 1 , wherein the first range corresponds to a first radius and the second range corresponds to a second radius,
wherein the instructions, when executed by the at least one processor individually and/or collectively, cause the electronic device to:
identify the second radius smaller than the first radius, based on at least one of a mean value, or a standard deviation of the probability distances, and
decrease a radius of the range of the geofence from the first radius to the second radius.
9 . The electronic device of claim 1 , wherein, in case that the locations of the electronic device are spaced farther apart than a specific distance from the reference location, the range of the geofence is maintained.
10 . A method performed by an electronic device, the method comprising:
identifying first information on locations of the electronic device and second information on probability distances from a reference location of a geofence, wherein the probability distances are determined such that a probability that the locations are within the probability distances respectively is equal to a designated value;
identifying whether a number of the locations is equal to or greater than a designated number configured for the geofence with a first range;
in case that the number of the locations is equal to or greater than the designated number, identifying a second range based on the probability distances; and
changing a range of the geofence from the first range to the second range.
11 . The method of claim 10 , wherein the first range corresponds to a first radius and the second range corresponds to a second radius,
wherein changing the range comprises:
identifying the second radius greater than the first radius, based on at least one of a mean value, or a standard deviation of the probability distances, and
increasing a radius of the range of the geofence from the first radius to the second radius.
12 . The method of claim 10 , wherein the first range corresponds to a first radius and the second range corresponds to a second radius,
wherein changing the range comprises:
identifying the second radius greater than the first radius, based on an interquartile range (IQR) of the probability distances, and
increasing a radius of the range of the geofence from the first radius to the second radius.
13 . The method of claim 10 , further comprising:
in case that the number of the locations is less than the designated number, maintaining the range of the geofence.
14 . The method of claim 10 , wherein the first information includes at least one of global navigation satellite system (GNSS) information, cellular positioning system (CPS) information or wi-fi positioning system (WPS) information.
15 . The method of claim 10 , further comprising:
identifying first probability distances greater than a reference distance for an accuracy among the probability distances, and
identifying the second range based on second probability distances remaining after excluding the first probability distances from the probability distances.
16 . The method of claim 10 , further comprising:
identifying whether a distribution of the locations is biased in a specific direction, and
in case that the distribution is biased in the specific direction, changing the reference location corresponding to a center of the geofence.
17 . The method of claim 10 , wherein the first range corresponds to a first radius and the second range corresponds to a second radius,
wherein the method further comprises:
identifying the second radius smaller than the first radius, based on at least one of a mean value, or a standard deviation of the probability distances, and
decreasing a radius of the range of the geofence from the first radius to the second radius.
18 . The method of claim 10 , wherein, in case that the locations of the electronic device are spaced farther apart than a specific distance from the reference location, the range of the geofence is maintained.