Method and apparatus for processing online user distribution
Abstract
The present disclosure relates to a method for processing online user distribution. The method includes acquiring a map for displaying online user distribution; determining the projection algorithm of the map; determining intermediate coordinates of at least one of the points according to a longitude and a latitude and the projection algorithm, and acquiring, by using a fitting algorithm, approximate solutions of functions of mapping the intermediate coordinates to the coordinates on the map. The method further includes calculating coordinates of each online user on the map according to the projection algorithm and the approximate solutions of the mapping functions; and assembling distribution data of online users on the map according to coordinates of all the online users on the map. The present disclosure further provides an apparatus for processing online user distribution. By using embodiments of the present disclosure, online user distribution can be displayed on a map and higher precision and real-time data quality are achieved.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1 . A method for processing online user distribution, the method comprising the following steps:
acquiring a map for displaying online user distribution, the map being based on multiple points with known coordinates and longitudes and latitudes; determining the projection algorithm most closely resemble the map; determining intermediate coordinates of at least one of the points according to a longitude and latitude based on the projection algorithm; acquiring, by using a fitting algorithm, approximate solutions of functions of mapping the intermediate coordinates to the known coordinates of the points on the map, the points with known coordinates and longitudes and latitudes on the map being used for fitting calculation and precision checking in the fitting algorithm; determining coordinates of each online user on the map according to the projection algorithm and the approximate solutions of the mapping functions; and tallying distribution data of online users on the map according to coordinates of all the online users on the map.
2 . The method for processing online user distribution according to claim 1 , wherein the calculating coordinates of an online user on the map according to the projection algorithm and the approximate solutions of the mapping functions comprises:
acquiring a mapping relationship between an IP address and a territory of the map; acquiring a longitude and latitude of the territory, and calculating, according to the longitude and the latitude of the territory and the projection algorithm, intermediate coordinates corresponding to the territory; calculating coordinates of the territory on the map according to the intermediate coordinates corresponding to the territory and the approximate solutions of the mapping functions; storing the coordinates in an IP address database as coordinates of the IP address on the map of the territory to which the IP address is mapped; acquiring an IP address of an online user; and querying, in the IP address database, coordinates that correspond to the IP address of the online user on the map.
3 . The method for processing online user distribution according to claim 2 , wherein the acquiring a mapping relationship between an IP address and a territory comprises:
merging multiple IP address databases into one IP address database.
4 . The method for processing online user distribution according to claim 3 , wherein the merging multiple IP address databases into one IP address database comprises:
segmenting all IP addresses into several minimum sub-intervals according to segmentation intervals of IP addresses in IP address databases; matching address information corresponding to an IP address of each minimum sub-interval with a territory; and merging minimum sub-intervals whose address information corresponding to IP addresses matches a same territory, so that each IP address corresponds with a territory.
5 . The method for processing online user distribution according to claim 4 , wherein the matching address information corresponding to an IP address of each minimum sub-interval with a territory comprises:
encapsulating, into an http request, to-be-processed address information corresponding to an IP address, and submitting the http request to multiple search engines; extracting a character string from result pages returned by the search engines, and performing substring match between the extracted character string and a territory in a preset territory table; acquiring a character string successfully matching the territory in the preset territory table; and counting times the successfully matched character string appears in the result page set, and using a character string appearing most frequently as a territory matching the to-be-processed address information corresponding to the IP address.
6 . The method for processing online user distribution according to claim 2 , wherein the acquiring an IP address of an online user comprises: processing a behavior log file of the online user by using an adaptive multithreaded processing model, and analyzing the behavior log file to obtain the IP address of the online user.
7 . The method for processing online user distribution according to claim 6 , wherein the processing a behavior log file of the online user by using an adaptive multithreaded processing model comprises:
allocating a thread to a behavior log file each time the behavior log file is generated; stopping allocating a thread to a newly generated behavior log file when a quantity of allocated threads reaches a preset initial threshold; and reallocating, to the newly generated behavior log file, an idle thread already allocated.
8 . The method for processing online user distribution according to claim 1 , wherein the determining coordinates of an online user on the map according to the projection algorithm and the approximate solutions of the mapping functions comprises:
receiving location information sent by a client used by the online user, wherein the location information comprises a location in which the online user is located; calculating intermediate coordinates of the location in which the online user is located according to the location information and the projection algorithm; and calculating coordinates of the online user on the map according to the intermediate coordinates of the location in which the online user is located and the approximate solutions of the mapping functions.
9 . The method for processing online user distribution according to claim 1 , wherein the determining the projection algorithm of the map comprises:
acquiring P known projection algorithms Pr oj k , kε{1, 2, . . . P}; extracting coordinates of M corners (x i , y i ), iε{1, 2, . . . , M} from the map according to a corner detection algorithm; separately extracting, according to the corner detection algorithm, coordinates of M k corners (x i , y i ), iε{1, 2, . . . , M k }, kε{1, 2, . . . , P} from a projection map corresponding to each projection algorithm among the P projection algorithms; separately selecting, from M k corners of each projection map, a corner subset coordinates N k corresponding to the M corners, wherein k□{1, 2, . . . , P}; and calculating
∑
i
=
1
N
[
(
x
i
-
x
i
k
)
2
+
(
y
i
-
y
i
k
)
2
]
,
k
∈
{
1
,
2
,
…
,
P
}
,
and selecting, as the projection algorithm, a projection algorithm Proj k by using which
∑
i
=
1
N
[
(
x
i
-
x
i
k
)
2
+
(
y
i
-
y
i
k
)
2
]
,
k
∈
{
1
,
2
,
…
,
P
}
is the smallest.
10 . The method for processing online user distribution according to claim 1 , wherein the distribution data of the online users on the map comprises behavior states of the online users, and the method further comprises:
counting the behavior states of the online users.
11 . The method for processing online user distribution according to claim 1 , further comprising:
returning the distribution data of the online users on the map to a client, so that the client displays online user distribution on the map in a visible manner.
12 . The method for processing online user distribution according to claim 11 , wherein the displaying, by the client, online user distribution on the map in a visible manner comprises the following steps:
receiving, by the client, the distribution data of the online users on the map, and drawing a graph of the online user distribution on the map according to the distribution data.
13 . The method for processing online user distribution according to claim 12 , wherein the drawing a graph of the online user distribution on the map according to the distribution data comprises:
drawing a preset number of points on the map; and performing distribution processing on the preset number of points according to the distribution data to obtain the graph of the online user distribution.
14 . The method for processing online user distribution according to claim 13 , wherein the performing skewed distribution processing on the preset number of points according to the distribution data to obtain the graph of the online user distribution comprises:
allocating the preset number of points to each territory; and performing, according to the distribution data, skewed distribution processing on points belonging to each territory to obtain the graph of the online user distribution.
15 . The method for processing online user distribution according to claim 14 , wherein points belonging to a same territory are encapsulated into a point object group to perform skewed distribution processing.
16 . The method for processing online user distribution according to claim 14 , wherein the performing, according to the distribution data, skewed distribution processing on points belonging to each territory to obtain the graph of the online user distribution comprises:
enumerating a coordinate range of each territory on the map; acquiring coordinates, of a point belonging to each territory, on the map after skewed distribution processing; sequentially comparing the coordinates, of a point belonging to each territory, on the map after skewed distribution processing with a corresponding coordinate range of the territory; and setting a point of a territory to be invisible if coordinates of the point of the territory on the map after skewed distribution processing is not within a corresponding coordinate range of the territory.
17 . The method for processing online user distribution according to claim 12 , further comprising:
periodically requesting, by the client, latest distribution data of online users from a server, and updating the graph of the online user distribution according to the latest distribution data of online users.
18 . An apparatus for processing online user distribution, the apparatus comprising:
an acquiring module, configured to acquire a map for displaying online user distribution, the map comprising multiple points with known coordinates and longitudes and latitudes; a first calculation module, configured to calculate the projection algorithm most closely resemble the map; a second calculation module, configured to perform calculation to obtain intermediate coordinates of at least one of the points according to a longitude and a latitude and the projection algorithm, and acquire, by using a fitting algorithm, approximate solutions of functions of mapping the intermediate coordinates to the known coordinates of the points on the map, the points with known coordinates and longitudes and latitudes on the map being used for fitting calculation and precision checking in the fitting algorithm; a third calculation module, configured to calculate coordinates of each online user on the map according to the projection algorithm and the approximate solutions of the mapping functions; and a counting module, configured to count distribution data of online users on the map according to coordinates of all the online users on the map.
19 . The apparatus for processing online user distribution according to claim 18 , wherein the calculating coordinates of an online user on the map according to the projection algorithm and the approximate solutions of the mapping functions comprises:
acquiring a mapping relationship between an IP address and a territory of the map; acquiring a longitude and latitude of the territory, and calculating, according to the longitude and the latitude of the territory and the projection algorithm, intermediate coordinates corresponding to the territory; calculating coordinates of the territory on the map according to the intermediate coordinates corresponding to the territory and the approximate solutions of the mapping functions; storing, in an IP address database as coordinates of the IP address on the map, the coordinates, of the territory to which the IP address is mapped, on the map; acquiring an IP address of an online user; and querying, in the IP address database according to the IP address of the online user, coordinates that correspond to the IP address of the online user and are on the map.
20 . The apparatus for processing online user distribution according to claim 19 , wherein the acquiring a mapping relationship between an IP address and a territory comprises:
merging multiple IP address databases into one IP address database.
21 . The apparatus for processing online user distribution according to claim 20 , wherein the merging multiple IP address databases into one IP address database comprises:
segmenting all IP addresses into several minimum sub-intervals according to segmentation intervals of IP addresses in IP address databases; matching address information corresponding to an IP address of each minimum sub-interval with a territory; and merging minimum sub-intervals, among the minimum sub-intervals, whose address information corresponding to IP addresses matches a same territory, so that each IP address is in one-to-one correspondence with a territory.
22 . The apparatus for processing online user distribution according to claim 21 , wherein the matching address information corresponding to an IP address of each minimum sub-interval with a territory comprises:
encapsulating, into an http request, to-be-processed address information corresponding to an IP address, and submitting the http request to multiple search engines; extracting a character string one by one from result pages returned by the search engines, and performing substring match between the extracted character string and a territory in a preset territory table; acquiring a character string successfully matching the territory in the preset territory table; and counting times the successfully matched character string appears in the result page set, and using a character string appearing most frequently as a territory matching the to-be-processed address information corresponding to the IP address.
23 . The apparatus for processing online user distribution according to claim 19 , wherein
the acquiring an IP address of an online user comprises: processing a behavior log file of the online user by using an adaptive multithreaded processing model, and analyzing the behavior log file to obtain the IP address of the online user.
24 . The apparatus for processing online user distribution according to claim 23 , wherein the processing a behavior log file of the online user by using an adaptive multithreaded processing model comprises:
allocating a thread to a behavior log file each time the behavior log file is generated; stopping allocating a thread to a newly generated behavior log file when a quantity of allocated threads reaches a preset initial threshold; and reallocating, to the newly generated behavior log file, an idle thread already allocated.
25 . The apparatus for processing online user distribution according to claim 18 , wherein the calculating coordinates of an online user on the map according to the projection algorithm and the approximate solutions of the mapping functions comprises:
receiving location information sent by a client used by the online user, wherein the location information comprises a location in which the online user is located; calculating intermediate coordinates of the location in which the online user is located according to the location information and the projection algorithm; and calculating coordinates of the online user on the map according to the intermediate coordinates of the location in which the online user is located and the approximate solutions of the mapping functions.
26 . The apparatus for processing online user distribution according to claim 18 , wherein the calculating the projection algorithm of the map comprises:
acquiring P known projection algorithms Pr oj k , kε{1, 2, . . . P}; extracting coordinates of M corners (x i , y i ), iε{1, 2, . . . , M} from the map according to a corner detection algorithm; separately extracting, according to the corner detection algorithm, coordinates of M k corners (x i , y i ), iε{1, 2, . . . , M k }, kε{1, 2, . . . , P} from a projection map corresponding to each projection algorithm among the P projection algorithms; separately selecting, from M k corners of each projection map, a corner subset N k corresponding to the M corners, wherein k□{1, 2, . . . , P}; and calculating
∑
i
=
1
N
[
(
x
i
-
x
i
k
)
2
+
(
y
i
-
y
i
k
)
2
]
,
k
∈
{
1
,
2
,
…
,
P
}
,
and selecting, a projection algorithm Proj k by using which
∑
i
=
1
N
[
(
x
i
-
x
i
k
)
2
+
(
y
i
-
y
i
k
)
2
]
,
k
∈
{
1
,
2
,
…
,
P
}
is the smallest.
27 . The apparatus for processing online user distribution according to claim 18 , wherein the distribution data of the online users on the map comprises behavior states of the online users, and the counting module is further configured to count the behavior states of the online users.
28 . The apparatus for processing online user distribution according to claim 18 , further comprising:
returning the distribution data of the online users on the map to a client, so that the client displays online user distribution on the map in a visible manner.
29 . The apparatus for processing online user distribution according to claim 28 , wherein after the client receives the distribution data of the online users on the map, the client draws a graph of the online user distribution on the map according to the distribution data.
30 . The apparatus for processing online user distribution according to claim 29 , wherein the drawing a graph of the online user distribution on the map according to the distribution data comprises:
drawing a preset number of points on the map; and performing skewed distribution processing on the preset number of points according to the distribution data to obtain the graph of the online user distribution.
31 . The apparatus for processing online user distribution according to claim 30 , wherein the performing skewed distribution processing on the preset number of points according to the distribution data to obtain the graph of the online user distribution comprises:
allocating the preset number of points to each territory; and performing, according to the distribution data, skewed distribution processing on points belonging to each territory to obtain the graph of the online user distribution.
32 . The apparatus for processing online user distribution according to claim 31 , wherein points belonging to a same territory are encapsulated into a point object group to perform skewed distribution processing.
33 . The apparatus for processing online user distribution according to claim 30 , wherein the performing, according to the distribution data, skewed distribution processing on points belonging to each territory to obtain the graph of the online user distribution further comprises:
enumerating a coordinate range of each territory on the map; acquiring coordinates, of a point belonging to each territory, on the map after skewed distribution processing; sequentially comparing the coordinates, of a point belonging to each territory, on the map after skewed distribution processing with a corresponding coordinate range of the territory; and setting a point of a territory to be invisible if coordinates of the point of the territory on the map after skewed distribution processing is not within a corresponding coordinate range of the territory.
34 . The apparatus for processing online user distribution according to claim 29 , wherein the client periodically requests latest distribution data of online users from a server, and updates the graph of the online user distribution according to the latest distribution data of online users.
35 . A storage medium comprising a computer executable instruction, the computer executable instruction being executed by a computer processor to implement a method for determine online user distribution, the method comprising:
acquiring a map for displaying online user distribution, a projection algorithm of the map being unknown, the map comprising multiple points with known coordinates and longitudes and latitudes; calculating the projection algorithm of the map; performing calculation to obtain intermediate coordinates of at least one of the points according to a longitude and a latitude and the projection algorithm, and acquiring, by using a fitting algorithm, approximate solutions of functions of mapping the intermediate coordinates to the known coordinates of the points on the map, the points with known coordinates and longitudes and latitudes on the map being used for fitting calculation and precision checking in the fitting algorithm; calculating coordinates of each online user on the map according to the projection algorithm and the approximate solutions of the mapping functions; and assembling distribution data of online users on the map according to coordinates of all the online users on the map.Join the waitlist — get patent alerts
Track US2015294006A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.