CN113067913B - Positioning method, device, server, medium and product - Google Patents
Positioning method, device, server, medium and product Download PDFInfo
- Publication number
- CN113067913B CN113067913B CN202110295660.7A CN202110295660A CN113067913B CN 113067913 B CN113067913 B CN 113067913B CN 202110295660 A CN202110295660 A CN 202110295660A CN 113067913 B CN113067913 B CN 113067913B
- Authority
- CN
- China
- Prior art keywords
- positioning data
- address
- associated positioning
- position information
- location information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 51
- 238000000605 extraction Methods 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 10
- 239000004575 stone Substances 0.000 description 8
- 230000008569 process Effects 0.000 description 6
- 238000004590 computer program Methods 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 230000001174 ascending effect Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 230000002860 competitive effect Effects 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000012552 review Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5007—Internet protocol [IP] addresses
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/52—Network services specially adapted for the location of the user terminal
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/55—Push-based network services
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L2101/00—Indexing scheme associated with group H04L61/00
- H04L2101/60—Types of network addresses
- H04L2101/69—Types of network addresses using geographic information, e.g. room number
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The disclosure provides a positioning method, a positioning device, a server, a medium and a product, for an IP address of position information to be determined, one or more associated positioning data can be obtained, the associated positioning data includes the IP address, an equipment identifier of an electronic device using the IP address and position information of the electronic device when the IP address is used, and since the IP address is dynamically allocated, the same IP address may be allocated to different electronic devices in different time periods, and therefore, the equipment identifiers included in the obtained different associated positioning data may not be completely the same; the first number of electronic devices included in the one or more associated positioning data may be obtained according to the device identifier included in the one or more associated positioning data, that is, the IP address is used by a first number of electronic devices at different times. If the first number is greater than or equal to a first threshold, determining location information of the IP address based on location information included in one or more associated positioning data.
Description
Technical Field
The present disclosure relates to the field of positioning technologies, and in particular, to a positioning method, apparatus, server, medium, and product.
Background
The positioning of the electronic device plays an important role in various scenarios, for example, pushing information about a city where the electronic device is located for the electronic device, providing services for the electronic device by using a server in the city where the electronic device is located, and the like.
In the related art, the positioning method of the electronic device is as follows: the method includes querying location information corresponding to an IP address used by the electronic device in an IP (Internet protocol address) address library, and if it is queried that the IP address used by the electronic device does not correspond to the location information or the corresponding location information is missing, for example, city information is missing, then accurate service cannot be provided for the electronic device.
Disclosure of Invention
The present disclosure provides a positioning method, apparatus, server, medium, and product based on an IP address, so as to at least solve a problem in the related art that if an IP address used by an electronic device is not queried to have corresponding location information, or if the corresponding location information is missing, accurate service cannot be provided for the electronic device. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a positioning method, including:
acquiring an internet protocol IP address of position information to be determined;
acquiring one or more associated positioning data, wherein the associated positioning data comprises the IP address, an equipment identifier of the electronic equipment using the IP address and position information of the electronic equipment when the IP address is used;
acquiring a first number of electronic devices included in the one or more associated positioning data according to the device identifiers included in the one or more associated positioning data;
if the first number is greater than or equal to a first threshold, determining the location information of the IP address based on the location information included in the one or more associated positioning data.
With reference to the first aspect, in a first possible implementation manner, the determining, based on the location information included in the one or more associated positioning data, the location information of the IP address includes:
if the position information contained in the one or more associated positioning data is the same, determining that the position information of the IP address is the position information contained in the one or more associated positioning data;
if the position information contained in the one or more associated positioning data is not completely the same, dividing the associated positioning data with the same position information into the same position information set to obtain a plurality of position information sets;
obtaining a target position information set containing the maximum number of associated positioning data from the plurality of position information sets;
and determining the position information of the IP address based on the position information in the associated positioning data contained in the target position information set.
With reference to the first aspect, in a second possible implementation manner, the determining, based on location information in associated positioning data included in the target location information set, location information of the IP address includes:
and determining the position information in the associated positioning data contained in the target position information set as the position information of the IP address.
With reference to the first aspect, in a third possible implementation manner, the determining, based on location information in associated positioning data included in the target location information set, location information of the IP address includes:
determining a ratio of a second quantity to a quantity of the one or more associated positioning data, the second quantity being a quantity of associated positioning data contained in the set of target location information;
and if the ratio is larger than or equal to a second threshold value, determining the position information in the associated positioning data contained in the target position information set as the position information of the IP address.
With reference to the first aspect, in a fourth possible implementation manner, the step of obtaining one or more associated positioning data includes:
acquiring a plurality of candidate associated positioning data and reporting time corresponding to the candidate associated positioning data, wherein the candidate associated positioning data comprises the IP address, an equipment identifier of electronic equipment using the IP address and position information of the electronic equipment when the IP address is used;
dividing the same candidate associated positioning data into the same candidate data set to obtain at least one candidate data set, wherein the at least one associated positioning data contained in the candidate data set is sorted according to the reporting time;
extracting at least one target candidate associated positioning data from at least one candidate associated positioning data contained in each candidate data set at intervals of at least a preset reporting time period;
and determining the extracted target candidate associated positioning data as the associated positioning data.
With reference to the first aspect, in a fifth possible implementation manner, the location information included in the associated positioning data includes country information, province information, and city information, and the step of obtaining a plurality of candidate associated positioning data includes:
acquiring a plurality of original associated positioning data, wherein the original associated positioning data comprise the IP address, an equipment identifier of the electronic equipment using the IP address and position information of the electronic equipment when the IP address is used;
inquiring and obtaining city default position information corresponding to the IP address from an address library, wherein the city default position information consists of country information and province information;
obtaining a plurality of candidate associated positioning data from the plurality of original associated positioning data, wherein the country information in the position information contained in the candidate associated positioning data is the same as the country information in the default position information of the city, and the province information in the position information contained in the candidate associated positioning data is the same as the province information in the default position information of the city.
According to a second aspect of the embodiments of the present disclosure, there is provided a positioning apparatus including:
the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is configured to acquire an Internet Protocol (IP) address of position information to be determined;
a second obtaining module configured to obtain one or more associated positioning data, where the associated positioning data includes the IP address, a device identifier of an electronic device using the IP address, and location information of the electronic device when the IP address is used;
a third obtaining module configured to obtain a first number of electronic devices included in the one or more associated positioning data according to the device identifiers included in the one or more associated positioning data;
a first determining module configured to determine location information of the IP address based on location information included in the one or more associated positioning data if the first number is greater than or equal to a first threshold.
With reference to the second aspect, in a first possible implementation manner, the first determining module is specifically configured to:
a first determining unit, configured to determine, if the location information included in the one or more pieces of associated positioning data is the same, that the location information of the IP address is the location information included in the one or more pieces of associated positioning data;
the first dividing unit is configured to divide the associated positioning data with the same position information into the same position information set to obtain a plurality of position information sets if the position information included in the one or more associated positioning data is not completely the same;
a first acquisition unit configured to acquire a target position information set containing the largest number of associated positioning data from the plurality of position information sets;
a second determining unit configured to determine the location information of the IP address based on the location information in the associated positioning data included in the set of target location information.
With reference to the second aspect, in a second possible implementation manner, the second determining unit is specifically configured to:
a first determining subunit configured to determine, as the location information of the IP address, the location information in the associated positioning data included in the target location information set.
With reference to the second aspect, in a third possible implementation manner, the second determining unit is specifically configured to:
a second determining subunit configured to determine a ratio of a second quantity to the quantity of the one or more associated positioning data, the second quantity being the quantity of associated positioning data contained in the set of target position information;
a third determining subunit, configured to determine, if the ratio is greater than or equal to a second threshold, location information in the associated positioning data included in the target location information set as location information of the IP address.
With reference to the second aspect, in a fourth possible implementation manner, the second obtaining module is specifically configured to:
a second obtaining unit, configured to obtain multiple candidate associated positioning data and reporting times corresponding to the multiple candidate associated positioning data, where the candidate associated positioning data includes the IP address, a device identifier of an electronic device using the IP address, and location information of the electronic device when the IP address is used;
the second dividing unit is configured to divide the same candidate associated positioning data into the same candidate data set to obtain at least one candidate data set, wherein the at least one associated positioning data included in the candidate data set is sorted according to the reporting time;
the extraction unit is configured to extract at least one target candidate associated positioning data from at least one candidate associated positioning data included in each candidate data set at intervals of at least a preset reporting time period;
a third determining unit configured to determine the extracted object candidate associated positioning data as the associated positioning data.
With reference to the second aspect, in a fifth possible implementation manner, the location information included in the associated positioning data includes country information, province information, and city information, and the second obtaining unit is specifically configured to:
a third obtaining unit configured to obtain a plurality of original associated positioning data, where the original associated positioning data includes the IP address, a device identifier of an electronic device using the IP address, and location information of the electronic device when the IP address is used;
the inquiry unit is configured to acquire city default position information corresponding to the IP address from an address library, wherein the city default position information consists of country information and province information;
a fourth obtaining unit configured to obtain the plurality of candidate associated positioning data from the plurality of original associated positioning data, where the candidate associated positioning data includes position information in which country information is the same as that in the default position information of the city, and the candidate associated positioning data includes position information in which province information is the same as that in the default position information of the city.
According to a third aspect of the embodiments of the present disclosure, there is provided a server, including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the positioning method according to the first aspect.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium, wherein instructions, when executed by a processor of a server, enable the server to perform the positioning method according to the first aspect.
According to a fifth aspect of the embodiments of the present disclosure, there is provided a computer program product directly loadable into the internal memory of a computer, said memory being included in the server according to claim 13 and containing software code, and said computer program is loaded into and executed by the computer to implement the positioning method according to the first aspect.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
in the positioning method provided by the embodiment of the present disclosure, for an IP address of location information to be determined, one or more associated positioning data may be obtained, where the associated positioning data includes the IP address, a device identifier of an electronic device using the IP address, and location information of the electronic device when the IP address is used, and since the IP address is dynamically allocated, the same IP address may be allocated to different electronic devices in different time periods, and therefore, the device identifiers included in the obtained different associated positioning data may not be completely the same; a first number of electronic devices included in the one or more associated positioning data may be obtained according to the device identifier included in the one or more associated positioning data, that is, the IP address is used by a first number of electronic devices at different times. If the first number is greater than or equal to a first threshold, determining the location information of the IP address based on the location information included in the one or more associated positioning data. It can be understood that the larger the first number is, the more accurate the obtained location information of the IP address is based on the location information included in the one or more associated positioning data, and if the first number is greater than or equal to the first threshold, it indicates that more electronic devices have used the IP address, so that the accuracy of the obtained location information of the IP address is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is an architectural diagram of a first implementation environment, shown in accordance with an exemplary embodiment;
FIG. 2 is an architectural diagram illustrating a second implementation environment in accordance with an exemplary embodiment;
FIG. 3 is an architectural diagram illustrating a third implementation environment in accordance with an exemplary embodiment;
FIG. 4 is a flow chart illustrating a method of positioning according to an exemplary embodiment;
FIG. 5 is a block diagram illustrating a positioning device in accordance with an exemplary embodiment;
FIG. 6 is a block diagram illustrating a server in accordance with an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in other sequences than those illustrated or described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The embodiment of the disclosure provides a positioning method, a positioning device, a server, a medium and a product. Before the technical solutions provided by the embodiments of the present disclosure are introduced, the application environments and implementation environments related to the technical solutions provided by the embodiments of the present disclosure are introduced.
First, an application environment provided by the embodiment of the present disclosure is explained.
The method can be used for accurately positioning the position information of the electronic equipment of the client in time, and is an important basis for providing corresponding services for the client by the server.
The client may be an application client or a web page version client, for example.
Illustratively, the client may be any one of a news client, a short video client, a video playing client, a payment client, a shopping client, and an instant messaging client.
The following description will take the client as a short video client as an example to explain that the position information of the electronic device is an important basis for providing corresponding services by the server.
A user watches live broadcast based on a short video client, and a server can determine position information corresponding to an IP address used by an electronic device operating the short video client, where the position information includes, for example, country information, province information, and city information where the electronic device is located, so that the server controls a city where the electronic device is located or a CDN (Content Delivery Network) server closest to the city to send live broadcast video streams to the electronic device.
It can be understood that the closer the CDN server is to the electronic device, the smoother the live video stream is provided for the short video client running on the electronic device, and the less the pause phenomenon occurs.
In the related art, a method of obtaining location information of an electronic device is: the location information corresponding to the IP address of the electronic device is queried from the IP address library, and if the location information corresponding to the IP address of the electronic device stored in the IP address library is missing, for example, city information and/or provincial information and/or national information is missing, or the location information corresponding to the IP address of the electronic device is not stored in the IP address library, it is impossible to provide accurate service for the electronic device. For example, a CDN server in a city where the electronic device is located or closest to the city cannot be controlled to send a live video stream for the electronic device.
At present, the location information of the IP address base is relatively serious, for example, the location information corresponding to a certain IP address stored in the IP address base lacks city information and/or province information and/or country information, especially the IP address of the mobile base station, the city information corresponding to the IP address base is serious, that is, the location information corresponding to a certain amount of IP addresses in the IP address base lacks or does not correspond to location information. For these IP addresses, the electronic device cannot be located by the IP address used by the electronic device, and thus, a better service cannot be provided for the user.
In the embodiment of the present disclosure, an IP address where corresponding location information is missing is referred to as an IP address of location information to be determined, for example, the IP address of the location information to be determined is an IP address where city information and/or provincial information and/or national information is missing, or an IP address that does not correspond to location information.
For example, the IP address library stores location information corresponding to each IP address, and the location information corresponding to each IP address may be stored in the IP address library in any form of a table, a function, and a linked list. The following description will be made by taking a table as an example. Table 1 shows the location information corresponding to each IP address stored in the IP address repository.
TABLE 1
In table 1, 192.2.5.3 lacking city information is the IP address of the location information to be determined; 192.3.0.0 lacking provincial information and city information is the IP address of the position information to be determined; 192.4.0.0 lacking the country information, province information and city information is the IP address of the location information to be determined. Illustratively, 192.4.0.0 lacking country information, province information and city information is an IP address not corresponding to location information.
It can be understood that the IP addresses are dynamically allocated, one IP address is used by only one electronic device at a time, the same IP address may be allocated to different electronic devices at different times, and in the process of operating the client, the electronic device reports a data packet to a server corresponding to the client, where the data packet includes a device identifier of the electronic device, an IP address used by the electronic device, and location information of the electronic device when the IP address is used.
For example, the position information of an electronic device may be obtained based on GPS (Global Positioning System) Positioning, or BDS (BeiDou Navigation Satellite System, beiDou Satellite Navigation System).
Based on this, if the location information corresponding to the IP address obtained from the IP address library is missing, for example, city information and/or province information and/or country information is missing, the embodiment of the present disclosure may be adopted to provide a location method, and for each IP address of the location information to be determined, the location information of the IP address may be determined based on the location information (the location information is complete, that is, no information is missing) where a plurality of electronic devices reporting the IP address use the IP address, so that accurate service may be provided for the electronic devices.
Next, description is made on implementation environments related to embodiments of the present disclosure, which are various, and the embodiments of the present disclosure provide, but are not limited to, the following two.
A first implementation environment, fig. 1 is an architectural diagram of a first implementation environment shown in accordance with an exemplary embodiment, the implementation environment comprising: an IP address repository 11, a database 12 and a server 13.
Illustratively, the IP address repository 11 is a third party database.
Illustratively, the database 12 may be independent of the server 13; the database 12 may, for example, belong to a server 13.
The server 13 may be, for example, one server, a server cluster composed of multiple servers, or a cloud computing server center.
Illustratively, the server 13 may establish a connection and communicate with the IP address repository 11 and the database 12, respectively, via a wired network or a wireless network.
The server 13 is configured to obtain an IP address of the location information to be determined from the IP address library 11, determine the location information of the IP address by using the positioning method provided in the embodiment of the present disclosure, and store the corresponding relationship between the IP address and the location information in the database 12.
For example, the IP address database 11 and the database 12 may be the same database or different databases.
The server 13 is configured to complete the IP address library 11, so that when the electronic device is provided with a service, the location information corresponding to the IP address used by the electronic device can be obtained based on the IP address library 11 or the database 12.
For example, the server 13 first queries the location information corresponding to the IP address used by the electronic device based on the IP address library 11, and then queries the location information corresponding to the IP address used by the electronic device based on the database 12 if the location information is not queried or is missing.
FIG. 2 is an architectural diagram of a second exemplary implementation environment, according to an exemplary embodiment, that includes: an IP address repository 11, an electronic device 21, and a server 23.
For the description of the IP address library 11, reference may be made to the first implementation environment, which is not described herein again.
For example, the electronic device 21 may be any electronic product capable of interacting with a user through one or more modes of a keyboard, a touch PAD, a touch screen, a remote controller, voice interaction or handwriting equipment, for example, a mobile phone, a laptop computer, a tablet computer, a palmtop computer, a personal computer, a wearable device, a smart television, a PAD, a robot, and the like.
It should be noted that fig. 2 is only an example, the types of the electronic devices may be various and are not limited to the laptop, the smart phone, and the PAD in fig. 2, and the number of the electronic devices may be determined based on the actual situation and is not limited to 3 shown in fig. 2.
The server 23 may be, for example, one server, a server cluster composed of multiple servers, or a cloud computing server center.
In the second implementation environment, the server 23 will obtain the IP address used by the electronic device 21 only when there is a need to provide a service for the electronic device, and query the location information of the IP address from the IP address library 11; if the location information corresponding to the IP address obtained from the IP address repository 11 is missing, for example, city information and/or province information and/or country information is missing, or the location information corresponding to the IP address is not obtained from the IP address repository 11, the location information corresponding to the IP address may be determined (the determined location information is complete and does not lack any information) by using the positioning method provided by the embodiment of the present disclosure, so as to provide a service for the electronic device 21.
In a second implementation environment, when the electronic device sends a data packet to the server 23, the data packet may carry location information of the electronic device, for example, the electronic device performs positioning through a GPS or BDS to obtain its own location information, if the electronic device performs positioning through the GPS or BDS and its own location information may be missing, or the electronic device performs positioning through the GPS or BDS and its own location information is wrong, or the data packet sent by the electronic device 21 is encrypted, so that the server cannot resolve the location information from the data packet sent by the electronic device 21, then the IP address used by the electronic device 21 may be obtained, and the location information of the IP address may be queried from the IP address library 11; if the location information corresponding to the IP address obtained from the IP address repository 11 is missing, or the location information corresponding to the IP address is not obtained from the IP address repository 11, the location information corresponding to the IP address may be determined by using the positioning method provided in the embodiment of the present disclosure.
In a second implementation environment, when the electronic device sends a data packet to the server 23, the data packet may not carry the location information of the electronic device, for example, the electronic device 21 has prohibited the GPS or BDS from performing the positioning, so the server 23 cannot obtain the location information of the electronic device based on the electronic device 21 itself, and may obtain the IP address used by the electronic device 21 and query the location information of the IP address from the IP address library 11; if the location information corresponding to the IP address obtained from the IP address repository 11 is missing, or the location information corresponding to the IP address is not obtained from the IP address repository 11, the location information corresponding to the IP address may be determined by using the positioning method provided in the embodiment of the present disclosure.
In summary, the IP address is one of the ways of positioning the electronic device, and has the advantage of high reporting rate, and any electronic device accessing the internet reports the IP address, but does not necessarily report the location information, that is, the ability of positioning by using the IP address is improved, and the electronic device can be better positioned, thereby providing better service for the electronic device.
The first implementation environment and the second implementation environment realize that when the position information corresponding to the IP address cannot be obtained through the IP address base or the position information corresponding to the IP address obtained through the IP address base is missing, the positioning can be performed through the positioning method provided by the present disclosure.
FIG. 3 is an architectural diagram illustrating a third exemplary implementation environment, according to an exemplary embodiment, that includes: database 12, electronic device 21, server 33, and server 34.
For a description of the database 12, reference may be made to the first embodiment, which is not described in detail herein. For a description of the electronic device 21, reference may be made to the second implementation environment, which is not described herein.
The server 33 may be, for example, one server, a server cluster composed of a plurality of servers, or a cloud computing server center.
The server 34 may be, for example, one server, a server cluster composed of a plurality of servers, or a cloud computing server center.
The server 33 is configured to determine the location information corresponding to each IP address by using the positioning method provided in the embodiment of the present disclosure, and store the location information in the database 12.
A server 34 for acquiring an IP address used by the electronic device 21; the location information of the IP address is searched from the database 12, and the electronic device 21 is provided with a service based on the location information corresponding to the IP address.
Illustratively, the server 33 and the server 34 may be the same server or different servers.
The third implementation environment realizes a technical scheme of determining the position information corresponding to the IP address by using the own database without using the IP address database.
It will be understood by those skilled in the art that the foregoing electronic devices and servers are merely exemplary and that other existing or future electronic devices or servers may be suitable for use with the present disclosure and are intended to be included within the scope of the present disclosure and are hereby incorporated by reference.
The technical solution provided by the present disclosure is described below with reference to the above three implementation environments.
Fig. 4 is a flowchart illustrating a positioning method according to an exemplary embodiment, and as shown in fig. 4, the positioning method may be used in any server in the above implementation environment, and the method includes the following steps S41 to S44 in the implementation process.
In step S41, the internet protocol IP address of the location information to be determined is acquired.
For example, there are various implementations of step S41, and the embodiments of the present disclosure provide, but are not limited to, the following two.
First, an IP address corresponding to location information having a missing address or an IP address not corresponding to location information is obtained from an IP address repository.
The IP address with the missing position information or the IP address without the corresponding position information is the IP address of the position information to be determined.
And secondly, acquiring an IP address used by the electronic equipment from a data packet reported by the electronic equipment, wherein the IP address is the IP address of the position information to be determined.
In step S42, one or more associated positioning data are obtained, where the associated positioning data includes the IP address, the device identifier of the electronic device using the IP address, and the location information of the electronic device when the IP address is used.
For example, the associated positioning data obtained in step S42 includes perfect position information without any content, for example, the associated positioning data includes position information including country information, province information, and city information.
The position information included in the associated positioning data includes country information, province information, and city information, which are merely examples, and the embodiment of the present disclosure does not limit the specific content of the position information included in the associated positioning data. For example, the specific content of the location information included in the associated positioning data may be determined based on the minimum geographic location unit allocated by the operator for the IP address, and the following example describes the "minimum geographic location unit".
For example, if the minimum geographic location unit of the IP address allocated by the operator is a city, that is, different IP addresses are allocated to different cities, the location information included in the associated positioning data includes: country information, province information, city information; if the minimum geographic location unit allocated with the IP address by the operator is a certain area in the city, that is, the operator allocates different IP addresses for different city areas in the same city, for example, the baoding city of the north and Hebei province is divided into a competitive area and a high-open area, and if the IP addresses allocated for the competitive area and the high-open area are different, the minimum geographic location unit is a certain area in the city, and the location information included in the associated positioning data includes: country information, province information, city information, and city region information.
In the embodiments of the present disclosure, "the location information is perfect" means that the location information contains all information from country information to the minimum geographical location unit. The absence of location information refers to the absence of one or more information from the country information to the smallest geographical location unit.
The operator may be, for example, a telecommunications operator or a mobile operator.
For example, the city information may be a city in direct jurisdiction or a city in non-direct jurisdiction, and the province information included in the location information including the city in direct jurisdiction is null. Exemplary, non-jurisdictional cities such as Hebei province baoding city; direct market such as Beijing.
For example, if the minimum geographic location unit is a city, then the positioning accuracy of the electronic device in the embodiment of the present disclosure is required to be the city, for example, beijing, shanghai, baoding, shijiazhuang, and the like.
For example, the Device Identifier of the electronic Device may be a Unique Device Identifier (UDID) or an International Mobile Equipment Identity (IMEI).
Illustratively, the one or more associated positioning data obtained in step S42 are positioning data reported by one or more electronic devices within a preset time period.
For example, the preset time period may be 10 days, 30 days, 50 days, and the like, and may be determined specifically based on actual conditions, which is not specifically limited in the embodiment of the present disclosure.
Illustratively, the preset time period ends at the current time. The preset time period is changed continuously as time passes, for example, if the current time is 2020, 9, 1 days, and the time period is 30 days, the preset time period is from 2020, 8, 3 days, to 2020, 9, 1 days. If the current time is 2020, 9, 29 days and the time period is 30 days, the preset time period is from 2020, 8, 31 days to 2020, 9, 29 days.
For example, the preset time period may be a fixed time period; for example, the preset time period may be a non-fixed time period.
It is understood that the IP address allocated by the operator to the same city at different times may change, for example, assuming that the period for the operator to re-allocate the IP address to the city is 3 months, for example, during 1 month to 3 months in 2020, the IP address a is allocated to beijing city, and during 4 months to 6 months in 2020, the IP address a is allocated to hebei province shijiazhuan city. Therefore, the location information corresponding to the same IP address may be different at different times. The preset time period may be set appropriately, for example, the preset time period is less than or equal to the minimum period of the operator re-allocating the IP address to the city, so that the associated positioning data obtained in step S42 are all accurate; or, if the time for the operator to reallocate the IP address is known, the starting time of the preset time period is later than or equal to the time for the operator closest to the current time to reallocate the IP address for the city.
Assuming that the operator reallocates the IP address to each city at 9/10/2020 and does not change the IP address, the operator closest to the current time (assuming that the current time is 9/29/2020) reallocates the IP address to each city at 9/10/2020. Then, the starting time of the preset time period may be later than or equal to 9/10 of 2020, for example, the preset time period may be from 10/9 of 2020 to 29/9 of 2020, or from 11/9 of 2020 to 29/9 of 2020.
In an alternative implementation, the preset time period may be randomly determined.
In step S43, a first number of electronic devices included in the one or more associated positioning data is obtained according to the device identifiers included in the one or more associated positioning data.
Assuming that the number of associated positioning data obtained in step S42 is 10, the associated positioning data is represented by a table, such as table 2, which includes 10 associated positioning data.
TABLE 2
One row includes one or more associated positioning data, and as shown in table 2, the example that one row includes one associated positioning data is used as an example, it can be known from table 2 that, for the same IP address, the same electronic device may report associated positioning data for multiple times, for example, an electronic device with a device identifier 01 reports associated positioning data twice, and an electronic device with a device identifier 06 reports associated positioning data twice; for an IP address, an electronic device may report associated positioning data, for example, the electronic device with device id 02, the electronic device with device id 03, and so on.
Based on the device identities comprised by the one or more associated positioning data obtained in step S42, a first number may be obtained, as shown in table 2, where 10 associated positioning data comprise 8 different device identities, so the first number is 8.
In step S44, if the first number is greater than or equal to a first threshold, the location information of the IP address is determined based on the location information included in the one or more associated positioning data.
For example, if the first number is smaller than the first threshold, the IP address is determined to be the IP address of the location information to be determined.
It will be appreciated that the same IP address may be assigned to different electronic devices at different times, the greater the first number, the more accurate the location information of the IP address determined at step S44. The smaller the first number, the less accurate the location information of the IP address determined at step S44. The reasons may be as follows:
in an alternative implementation manner, the IP address allocation policy of the operator to the mobile base station may be: an IP address is assigned to a city of a province. Under the allocation strategy, for the same IP address, the location information in the associated positioning data reported by different electronic devices should be the same, but there are the following two situations, which may cause the location information in the associated positioning data reported by different electronic devices to be different.
In the first case, the location information in the associated positioning data reported by the electronic device is the location information of the positioning error of the electronic device.
For example, the city in which the electronic device is located is the baoding city of hebei province, but the city in which the electronic device is located by the GPS or BDS is the beijing city. Then, the associated positioning data reported by the electronic device includes: the device identification of the electronic device, the IP address used by the electronic device and the position information comprise China and Beijing.
And in the second situation, the IP address in the associated positioning data reported by the electronic equipment is a false IP address set by the user of the electronic equipment.
For example, the city where the electronic device is located is the province's city of Hebei province, the real IP address used by the electronic device is IP address A, but the user held by the electronic device sets the IP address used by the electronic device to be a false IP address B, which is the IP address B allocated by the operator to Shanghai city. Then, the associated positioning data reported by the electronic device includes the device identifier of the electronic device, the IP address B used by the electronic device, and the location information includes china, the province of north river, and the city of baoding.
However, the probability of occurrence of the two cases is low, so that the ratio of the number of the electronic devices in which the first case or the second case occurs to the first number is lower as the first number is larger, that is, a small number of the associated positioning data in the one or more associated positioning data obtained in step S42 is wrong, and most of the associated positioning data is accurate, so that the accuracy of the position information corresponding to the IP address determined in step S43 is higher.
For example, the first threshold may be determined based on actual conditions, and the embodiment of the present application does not limit a specific value of the first threshold.
In the positioning method provided by the embodiment of the disclosure, for an IP address of position information to be determined, one or more associated positioning data may be obtained, where the associated positioning data includes the IP address, an equipment identifier of an electronic device using the IP address, and position information of the electronic device when the IP address is used, and since the IP address is dynamically allocated, the same IP address may be allocated to different electronic devices in different time periods, and therefore, the equipment identifiers included in the obtained different associated positioning data may not be completely the same; a first number of electronic devices included in the one or more associated positioning data may be obtained according to the device identifier included in the one or more associated positioning data, that is, the IP address is used by a first number of electronic devices at different times. If the first number is greater than or equal to a first threshold, determining the location information of the IP address based on the location information included in the one or more associated positioning data. It can be understood that the larger the first number is, the more accurate the obtained location information of the IP address is based on the location information included in the one or more associated positioning data, and if the first number is greater than or equal to the first threshold, it indicates that more electronic devices have used the IP address, so that the accuracy of the obtained location information of the IP address is improved.
In an alternative implementation manner, there are multiple ways for the server 13, the server 23, or the server 33 to implement the step S42, and the disclosed embodiment provides, but is not limited to, the following ways. The first implementation of step S42 includes steps A1 to A3.
In step A1, at least one data packet respectively reported by a plurality of electronic devices is obtained.
The data packet reported by the electronic equipment comprises the equipment identification of the electronic equipment, the IP address used by the electronic equipment and the position information of the electronic equipment when the IP address is used.
For example, the data packets reported by the electronic device may be reported by the client.
For example, the electronic device may upload data based on the client during the operation of the client, and the client uploads the data to the server in the form of data packets.
Illustratively, the uploaded data may be at least one of User Generated Content (UGC), video, picture, text, audio for the User.
Illustratively, the user-generated content includes, but is not limited to, at least one of user comments, barrage, praise.
The following describes a process of reporting a data packet by a client, taking the client as a short video client as an example.
After the user performs the praise operation on the short video displayed by the client, the client generates a data packet and uploads the data packet to the server; when a user executes the operation of refreshing and displaying the video at a client, a data packet requesting the video is generated and uploaded to a server; after a user reviews the short video displayed by the client, a data packet is generated and uploaded to the server; after the user shoots the short video, the short video can be uploaded to the server in the form of a data packet.
In an optional implementation manner, the server 13, the server 23, or the server 33 may obtain a data packet reported by a corresponding client, for example, if the client is a wechat client, the server 13, the server 23, or the server 33 is a server corresponding to the wechat client; if the client is a short video client, the server 13, the server 23, or the server 33 may be a CDN server corresponding to the short video client. In the embodiment of the present disclosure, a server corresponding to a certain client refers to a server providing a service for the client.
In step A2, for each data packet, the data packet is analyzed to obtain associated location data including an apparatus identifier of the electronic apparatus, an IP address used by the electronic apparatus, and location information of the electronic apparatus when the IP address is used.
For example, the reporting time of the data packet reported by the electronic device may also be obtained.
In an optional implementation manner, the associated positioning data corresponding to the plurality of reporting times may be stored, and the storage manner of the associated positioning data corresponding to the plurality of reporting times may be any one of a table, a function, and a linked list. The following description will be made by taking a table as an example. As shown in table 3, the table is an associated positioning data table corresponding to a plurality of reporting times.
TABLE 3
In table 3, it is illustrated by taking the associated positioning data corresponding to one row serving as one reporting time as an example, the associated positioning data may further include a user identifier, and the user identifier may be, for example, a user account for logging in the client; for example, the associated positioning data may not include a user identification.
In step A3, associated positioning data including the IP address mentioned in step S41 is obtained from the plurality of associated positioning data. Or, in step A3, the associated positioning data that includes the IP address mentioned in step S41 and whose reporting time belongs to the preset time period is obtained from the associated positioning data corresponding to each of the multiple reporting times.
The following describes the implementation of step S44. Step S44 involves multiple cases in the implementation process, and the embodiment of the present disclosure provides, but is not limited to, the following two cases.
In the first case, if the location information included in the one or more associated positioning data obtained in step S42 is the same, it is determined that the location information of the IP address is the location information included in the one or more associated positioning data.
The second case includes the following steps C1 to C3.
In step C1, if the position information included in the one or more associated positioning data is not completely the same, the associated positioning data with the same position information is divided into the same position information set to obtain a plurality of position information sets.
Still taking table 2 as an example for explanation, the 10 associated positioning data in table 2 are divided into two position information sets, where the first position information set includes: {01, 192.0.0.0, china Hebei province Stone house Mang City }, {01, 192.0.0, china Hebei province Stone house Mang City }, {02, 192.0.0, china Hebei province Stone house Mang City }, {04, 192.0.0.0, china Hebei province Stone house Mang City }, {05, 192.0.0, china Hebei province Stone house Mang City }, {06, 192.0.0.0, china Hebei province Stone house Mang City }, {07, 192.0.0.0, china Hebei province Stone house Mang City }, {08, 192.0.0, and China Hebei Stone house Mang City }; the second set of location information includes: {03, 192.0.0.0, beijing, china }.
In step C2, a target position information set containing the largest number of associated positioning data is obtained from the plurality of position information sets.
Still taking the above table 2 as an example, the target position information set determined in the above two position information sets is the first position information set.
In step C3, the location information of the IP address is determined based on the location information in the associated positioning data included in the target location information set.
In an alternative implementation manner, there are various implementation manners of step C3, and the disclosed embodiment provides, but is not limited to, the following two.
The first implementation of step C3 includes: and determining the position information in the associated positioning data contained in the target position information set as the position information of the IP address.
Still taking table 2 as an example, the location information corresponding to the IP address of the location information to be determined is china, hebei province, shijiazhuang city.
In an optional implementation manner, the IP address allocation policy of the operator to the mobile base station includes two types, a first allocation policy that one IP address is allocated to one city of one province, and a second allocation policy that one IP address is allocated to a plurality of cities of one province.
Under the first allocation policy, since an IP address is allocated to a city of a province, most of the location information in the associated positioning data including the same IP address reported by different electronic devices is the same (see the first and second cases involved in the description of step S44, which is not repeated here), the number of associated positioning data included in the target location information set is far from the number of associated positioning data included in other location information sets, for example, the number of associated data included in the first location information set and the second location information set is 9 different, so the accuracy of the result obtained by the implementation of the first step C3 is high.
Under the second allocation strategy, since the same IP address is allocated to multiple cities of a province, the probability that multiple electronic devices located in different cities report associated positioning data containing the IP address is the same, so the difference between the numbers of associated positioning data contained in different location information sets is not very large, for example, the number of associated positioning data contained in one location information set and the number of associated positioning data contained in a target location information set only differ by 1, and the accuracy of the result obtained by the implementation manner of the first step C3 is low.
Based on this, a second implementation of step C3 is provided, the method comprising steps C31 to C32.
In step C31, a ratio of a second amount to the amount of the one or more associated positioning data is determined, the second amount being the amount of associated positioning data comprised by the set of target position information.
In step C32, if the ratio is greater than or equal to a second threshold, the position information in the associated positioning data included in the target position information set is determined as the position information of the IP address.
For example, if the ratio is greater than or equal to the second threshold, it indicates that the IP address allocation policy of the operator to the mobile base station should be the first allocation policy and not the second allocation policy, so the location information in the associated positioning data included in the target location information set may be determined as the location information of the IP address.
Illustratively, the second threshold may be based on practical conditions, assuming that the second threshold is 80%.
Still taking table 2 as an example, the first location information set includes the number of associated positioning data, i.e. the second number =9, and the number of the associated positioning data =10; the ratio =9/10=90% > 80%, so the position information corresponding to the IP address is in the china hubei province, shijiazhuang city.
Exemplary, also include: in step C33, if the ratio is smaller than the second threshold, the IP address is determined as the IP address of the location information to be determined.
For example, if the ratio is smaller than the second threshold, it indicates that the IP address allocation policy of the operator for the mobile base station may be the second allocation policy, and therefore, the location information corresponding to the IP address cannot be determined.
It can be understood that, after the IP address is allocated to the electronic device, the electronic device may report the associated positioning data for many times frequently before the IP address is not released, where multiple associated positioning data reported by the electronic device are the same, and the multiple associated positioning data are redundant data, and if the one or more associated positioning data obtained in step S42 include multiple associated positioning data frequently reported when the same electronic device occupies the same IP address, the location information corresponding to the IP address obtained in step S42 is inaccurate.
Based on this, for example, the embodiment of the present disclosure provides the following specific implementation manner of step S42, and the implementation manner includes steps E1 to E4.
In step E1, a plurality of candidate associated positioning data and report time corresponding to the plurality of candidate associated positioning data are obtained, where the candidate associated positioning data includes the IP address, an equipment identifier of an electronic device using the IP address, and location information of the electronic device when the IP address is used.
In step E2, the same candidate associated positioning data is divided into the same candidate data set to obtain at least one candidate data set, where at least one candidate associated positioning data included in the candidate data set is sorted according to the reporting time.
Since the plurality of candidate associated positioning data are all IP addresses containing position information to be determined, the same candidate associated positioning data mentioned in step E2 means that the device identifier and the position information are the same. Exemplarily, two candidate associated positioning data are the same, that is, the device identifiers in the two candidate associated positioning data are the same, and the position information in the two candidate associated positioning data is the same.
It can be understood that the same candidate associated positioning data is reported by the same electronic device.
Illustratively, at least one candidate associated positioning data included in the candidate data set is sorted according to reporting time, and the sorting may be ascending sorting or descending sorting.
In step E3, a target candidate associated positioning data is extracted from at least one candidate associated positioning data included in each candidate data set every at least a preset reporting time period.
For example, assuming that at least one candidate associated positioning data included in the candidate data set is sorted according to the ascending reporting time, the implementation procedure of step E3 may include step E31, step E35.
In step E31, a first time period is obtained, where a start time of the first time period is a reporting time corresponding to a first candidate associated positioning data in the candidate data set, and an end time of the first time period is a sum of the reporting time corresponding to the first candidate associated positioning data in the candidate data set and a preset reporting time period.
In step E32, an object candidate associated positioning data is extracted from one or more candidate associated positioning data whose reporting time belongs to the first time period in the candidate data set.
In step E33, an ith time period is obtained, where a start time of the ith time period is an end time of the ith-1 time period, and the end time of the ith time period is a sum of the end time of the ith-1 time period and a preset reporting time period.
The initial value of i is 2.
In step E34, an object candidate associated positioning data is extracted from one or more candidate associated positioning data whose reporting time belongs to the ith time period in the candidate data set.
In step E35, i = i +1, and the process returns to step E33 until the maximum value of the i-th time period is greater than or equal to the maximum reporting time in the candidate data set.
For example, the preset reporting time period may be determined based on an actual situation, and the preset reporting time period is not limited in this disclosure, for example, the preset reporting time period is 3 days, 4 days, or 5 days.
It can be understood that, since at least one associated positioning data included in the candidate data set is sorted according to the reporting time, one target candidate associated positioning data can be extracted from the candidate data set every preset reporting time period, and the extracted target candidate associated positioning data is the associated positioning data.
Exemplarily, if the candidate data set includes a candidate associated positioning data, the candidate associated positioning data is the associated positioning data; if the candidate data set includes a plurality of candidate associated positioning data, if a difference between a maximum reporting time and a minimum reporting time in the plurality of candidate associated positioning data is smaller than a preset reporting time period, one target candidate associated positioning data may be extracted from the plurality of candidate associated positioning data included in the candidate data set. If the candidate data set includes a plurality of candidate associated positioning data, if a difference between a maximum reporting time and a minimum reporting time in the plurality of candidate associated positioning data is greater than or equal to a preset reporting time period, two or more target candidate associated positioning data may be extracted from the plurality of candidate associated positioning data included in the candidate data set.
Assuming that the preset reporting time period is 1 day, the candidate data set comprises: candidate associated positioning data 1{ device identifier a, IP address 1, location information 1} corresponding to 10 am at 9/2/2020, and candidate associated positioning data 2{ device identifier a, IP address 1, location information 1} corresponding to 10 am at 9/2/2020, are reported 30, and the first time period is [ 10 am at 9/2/2020, 10 am at 9/3/2020), because the reporting time of the two candidate associated positioning data all belongs to the first time period, a target candidate associated positioning data can be extracted from the candidate data set.
In step E4, the extracted target candidate associated positioning data is determined as the associated positioning data.
In an optional implementation manner, the IP address of the location information to be determined refers to location information that lacks city information and is obtained from an IP address base, and because the country information and the province information corresponding to the IP address that has been obtained from the IP address base, in the embodiment of the present disclosure, the country information and the province information included in the city default location information corresponding to the IP address that is obtained from the IP address base are considered to be accurate. Based on this, acquiring a plurality of candidate associated positioning data in step E1 includes the following steps F1 to F3.
In step F1, a plurality of original associated positioning data is obtained, where the original associated positioning data includes the IP address, the device identifier of the electronic device using the IP address, and the location information of the electronic device when the IP address is used.
For example, the country information in the location information contained in the raw associated positioning data may be the same as or different from the country information in the default location information of the city; the province information in the location information contained in the original associated positioning data may be the same as or different from the province information in the default location information of the city.
In step F2, city default position information corresponding to the IP address is obtained by inquiring from an address base, wherein the city default position information consists of country information and province information.
For example, in the embodiment of the present disclosure, it is considered that the country information and province information included in the original associated positioning data should be the same as the country information and city information in the default location information of the city, and if they are different, it is considered that the original associated positioning data is incorrect, and then the original associated positioning data is excluded.
In step F3, the plurality of candidate associated positioning data are obtained from the plurality of original associated positioning data, the country information in the position information included in the candidate associated positioning data is the same as the country information in the default position information of the city, and the province information in the position information included in the candidate associated positioning data is the same as the province information in the default position information of the city.
The method is described in detail in the embodiments disclosed in the present application, and the method of the present application can be implemented by using various types of apparatuses, so that various apparatuses are also disclosed in the present application, and specific embodiments are given below for detailed description.
FIG. 5 is a block diagram illustrating a positioning device according to an exemplary embodiment. Referring to fig. 5, the apparatus includes a first obtaining module 51, a second obtaining module 52, a third obtaining module 53, and a first determining module 54.
A first obtaining module 51 configured to obtain an internet protocol IP address of the location information to be determined;
a second obtaining module 52, configured to obtain one or more associated positioning data, where the associated positioning data includes the IP address, a device identifier of an electronic device using the IP address, and location information of the electronic device when the IP address is used;
a third obtaining module 53, configured to obtain, according to the device identifier included in the one or more associated positioning data, a first number of electronic devices included in the one or more associated positioning data;
a first determining module 54 configured to determine location information of the IP address based on location information included in the one or more associated positioning data if the first number is greater than or equal to a first threshold.
In an optional implementation manner, the first determining module is specifically configured to:
a first determining unit, configured to determine, if the location information included in the one or more pieces of associated positioning data is the same, that the location information of the IP address is the location information included in the one or more pieces of associated positioning data;
the first dividing unit is configured to divide the associated positioning data with the same position information into the same position information set to obtain a plurality of position information sets if the position information included in the one or more associated positioning data is not completely the same;
a first acquisition unit configured to acquire a target position information set containing the largest number of associated positioning data from among the plurality of position information sets;
a second determining unit configured to determine the location information of the IP address based on the location information in the associated positioning data included in the set of target location information.
In an optional implementation manner, the second determining unit is specifically configured to:
a first determining subunit configured to determine, as the location information of the IP address, the location information in the associated positioning data included in the target location information set.
In an optional implementation manner, the second determining unit is specifically configured to:
a second determining subunit configured to determine a ratio of a second amount to the amount of the one or more associated positioning data, the second amount being the amount of associated positioning data contained in the set of target position information;
a third determining subunit, configured to determine, if the ratio is greater than or equal to a second threshold, location information in the associated positioning data included in the target location information set as location information of the IP address.
In an optional implementation manner, the second determining unit further includes: a fourth determining subunit configured to determine the IP address as the IP address of the location information to be determined, if the ratio is smaller than the second threshold.
In an optional implementation manner, the second obtaining module is specifically configured to:
a second obtaining unit, configured to obtain a plurality of candidate associated positioning data and reporting times corresponding to the plurality of candidate associated positioning data, where the candidate associated positioning data includes the IP address, a device identifier of an electronic device using the IP address, and location information of the electronic device when the IP address is used;
the second dividing unit is configured to divide the same candidate associated positioning data into the same candidate data set to obtain at least one candidate data set, wherein the at least one associated positioning data included in the candidate data set is sorted according to the reporting time;
the extraction unit is configured to extract at least one target candidate associated positioning data from at least one candidate associated positioning data included in each candidate data set at intervals of at least a preset reporting time period;
a third determining unit configured to determine the extracted object candidate associated positioning data as the associated positioning data.
In an optional implementation manner, the location information included in the associated positioning data includes country information, province information, and city information, and the second obtaining unit is specifically configured to:
a third obtaining unit configured to obtain a plurality of original associated positioning data, where the original associated positioning data includes the IP address, a device identifier of an electronic device using the IP address, and location information of the electronic device when the IP address is used;
the query unit is configured to query and obtain city default position information corresponding to the IP address from an address base, wherein the city default position information consists of country information and province information;
a fourth obtaining unit configured to obtain the plurality of candidate associated positioning data from the plurality of original associated positioning data, where the candidate associated positioning data includes position information whose country information is the same as that in the default position information of the city, and includes provincial information whose provincial information is the same as that in the default position information of the city.
With regard to the apparatus in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be described in detail here.
FIG. 6 is a block diagram illustrating a server in accordance with an example embodiment. Servers include, but are not limited to: a processor 501, a memory 502, a network interface 503, an I/O controller 504, and a communication bus 505.
It should be noted that the structure of the server shown in fig. 5 is not limited to the server, and the server may include more or less components than those shown in fig. 5, or some components may be combined, or a different arrangement of components may be used, as will be understood by those skilled in the art.
The following describes each component of the server in detail with reference to fig. 5:
the processor 501 is a control center of the server, connects various parts of the entire server using various interfaces and lines, and performs various functions of the server and processes data by running or executing software programs and/or modules stored in the memory 502 and calling data stored in the memory 502, thereby performing overall monitoring of the server. Processor 501 may include one or more processing units; alternatively, the processor 501 may integrate an application processor and a modem processor, wherein the application processor mainly handles an operating system, a user interface, application programs, and the like, and the modem processor mainly handles wireless communication. It will be appreciated that the modem processor described above may not be integrated into the processor 501.
the Memory 502 may include Memory, such as Random-Access Memory (RAM) 5021 and Read-Only Memory (ROM) 5022, and may also include a mass storage device 5023, such as at least 1 disk storage. Of course, the server may also include hardware needed for other services.
The memory 502 is used for storing the executable instructions of the processor 501. The processor 501 is configured to perform any one of the steps of the positioning method embodiments.
A wired or wireless network interface 503 is configured to connect the server to a network.
The processor 501, the memory 502, the network interface 503, and the I/O controller 504 may be connected to each other by a communication bus 505, which may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc.
In an exemplary embodiment, the server may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described electronic resource transmission method.
In an exemplary embodiment, a computer-readable storage medium comprising instructions, such as the memory 502 comprising instructions, executable by the processor 501 of the server to perform the method described above is also provided. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided, which can be directly loaded into the internal memory of a computer, wherein the memory is included in the memory 502 of the server and contains software codes, and the computer program can be loaded into the computer and executed to implement the positioning method as described above.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims (14)
1. A method of positioning, comprising:
acquiring an Internet Protocol (IP) address of position information to be determined;
acquiring one or more associated positioning data, wherein the associated positioning data comprises the IP address, an equipment identifier of the electronic equipment using the IP address and position information of the electronic equipment when the IP address is used;
acquiring a first number of electronic devices included in the one or more associated positioning data according to the device identifiers included in the one or more associated positioning data;
if the first number is greater than or equal to a first threshold value, determining the location information of the IP address based on the location information included in the one or more associated positioning data;
if the location information included in the one or more associated positioning data is the same, determining that the location information of the IP address is the location information included in the one or more associated positioning data.
2. The method according to claim 1, wherein the determining the location information of the IP address based on the location information included in the one or more associated positioning data further comprises:
if the position information contained in the one or more associated positioning data is not completely the same, dividing the associated positioning data with the same position information into the same position information set to obtain a plurality of position information sets;
obtaining a target position information set containing the maximum number of associated positioning data from the plurality of position information sets;
and determining the position information of the IP address based on the position information in the associated positioning data contained in the target position information set.
3. The positioning method according to claim 2, wherein the step of determining the location information of the IP address based on the location information in the associated positioning data included in the set of target location information comprises:
and determining the position information in the associated positioning data contained in the target position information set as the position information of the IP address.
4. The positioning method according to claim 2, wherein the step of determining the location information of the IP address based on the location information in the associated positioning data included in the set of target location information comprises:
determining a ratio of a second quantity to a quantity of the one or more associated positioning data, the second quantity being a quantity of associated positioning data contained in the set of target location information;
and if the ratio is greater than or equal to a second threshold value, determining the position information in the associated positioning data contained in the target position information set as the position information of the IP address.
5. The positioning method according to any one of claims 1 to 4, wherein said step of obtaining one or more associated positioning data comprises:
acquiring a plurality of candidate associated positioning data and reporting time corresponding to the plurality of candidate associated positioning data, wherein the candidate associated positioning data comprises the IP address, an equipment identifier of electronic equipment using the IP address and position information of the electronic equipment when the IP address is used;
dividing the same candidate associated positioning data into the same candidate data set to obtain at least one candidate data set, wherein the at least one associated positioning data contained in the candidate data set is sorted according to the reporting time;
extracting at least one target candidate associated positioning data from at least one candidate associated positioning data contained in each candidate data set at intervals of at least a preset reporting time period;
and determining the extracted target candidate associated positioning data as the associated positioning data.
6. The positioning method according to claim 5, wherein the associated positioning data includes location information including country information, province information and city information, and the step of obtaining a plurality of candidate associated positioning data comprises:
acquiring a plurality of original associated positioning data, wherein the original associated positioning data comprise the IP address, an equipment identifier of electronic equipment using the IP address and position information of the electronic equipment when the IP address is used;
inquiring and obtaining city default position information corresponding to the IP address from an address library, wherein the city default position information consists of country information and province information;
obtaining a plurality of candidate associated positioning data from the plurality of original associated positioning data, wherein the country information in the position information contained in the candidate associated positioning data is the same as the country information in the default position information of the city, and the province information in the position information contained in the candidate associated positioning data is the same as the province information in the default position information of the city.
7. A positioning device, comprising:
the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is configured to acquire an Internet Protocol (IP) address of position information to be determined;
the second acquisition module is configured to acquire one or more associated positioning data, wherein the associated positioning data comprises the IP address, the device identifier of the electronic device using the IP address and the position information of the electronic device when the IP address is used;
a third obtaining module configured to obtain a first number of electronic devices included in the one or more associated positioning data according to the device identifiers included in the one or more associated positioning data;
a first determining module configured to determine location information of the IP address based on location information included in the one or more associated positioning data if the first number is greater than or equal to a first threshold;
wherein the first determination module is configured to:
a first determining unit, configured to determine that the location information of the IP address is the location information included in the one or more associated positioning data if the location information included in the one or more associated positioning data is the same.
8. The positioning apparatus of claim 7, wherein the first determining module is further configured to:
the first dividing unit is configured to divide the associated positioning data with the same position information into the same position information set to obtain a plurality of position information sets if the position information included in the one or more associated positioning data is not completely the same;
a first acquisition unit configured to acquire a target position information set containing the largest number of associated positioning data from among the plurality of position information sets;
a second determining unit configured to determine the location information of the IP address based on the location information in the associated positioning data included in the set of target location information.
9. The positioning apparatus according to claim 8, wherein the second determining unit is specifically configured to:
a first determining subunit configured to determine, as the location information of the IP address, the location information in the associated positioning data included in the target location information set.
10. The positioning apparatus according to claim 8, wherein the second determination unit is specifically configured to:
a second determining subunit configured to determine a ratio of a second amount to the amount of the one or more associated positioning data, the second amount being the amount of associated positioning data contained in the set of target position information;
a third determining subunit, configured to determine, if the ratio is greater than or equal to a second threshold, location information in the associated positioning data included in the target location information set as location information of the IP address.
11. The positioning apparatus according to any one of claims 7 to 10, wherein the second obtaining module is specifically configured to:
a second obtaining unit, configured to obtain a plurality of candidate associated positioning data and reporting times corresponding to the plurality of candidate associated positioning data, where the candidate associated positioning data includes the IP address, a device identifier of an electronic device using the IP address, and location information of the electronic device when the IP address is used;
the second dividing unit is configured to divide the same candidate associated positioning data into the same candidate data set to obtain at least one candidate data set, wherein the at least one associated positioning data included in the candidate data set is sorted according to the reporting time;
the extraction unit is configured to extract at least one target candidate associated positioning data every at least a preset reporting time period from at least one candidate associated positioning data included in each candidate data set;
a third determining unit configured to determine the extracted object candidate associated positioning data as the associated positioning data.
12. The positioning apparatus according to claim 11, wherein the position information included in the associated positioning data includes country information, province information, and city information, and the second obtaining unit is specifically configured to:
a third obtaining unit configured to obtain a plurality of original associated positioning data, where the original associated positioning data includes the IP address, a device identifier of an electronic device using the IP address, and location information of the electronic device when the IP address is used;
the query unit is configured to query and obtain city default position information corresponding to the IP address from an address base, wherein the city default position information consists of country information and province information;
a fourth obtaining unit configured to obtain the plurality of candidate associated positioning data from the plurality of original associated positioning data, where the candidate associated positioning data includes position information whose country information is the same as that in the default position information of the city, and includes provincial information whose provincial information is the same as that in the default position information of the city.
13. A server, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the positioning method of any one of claims 1 to 6.
14. A computer-readable storage medium, wherein instructions, when executed by a processor of a server, enable the server to perform the positioning method of any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110295660.7A CN113067913B (en) | 2021-03-19 | 2021-03-19 | Positioning method, device, server, medium and product |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110295660.7A CN113067913B (en) | 2021-03-19 | 2021-03-19 | Positioning method, device, server, medium and product |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113067913A CN113067913A (en) | 2021-07-02 |
CN113067913B true CN113067913B (en) | 2022-12-09 |
Family
ID=76562342
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110295660.7A Active CN113067913B (en) | 2021-03-19 | 2021-03-19 | Positioning method, device, server, medium and product |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113067913B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115277823A (en) * | 2022-07-08 | 2022-11-01 | 北京达佳互联信息技术有限公司 | Positioning method, positioning device, electronic equipment and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019128355A1 (en) * | 2017-12-29 | 2019-07-04 | 北京京东尚科信息技术有限公司 | Method and device for determining accurate geographic location |
CN112153091A (en) * | 2019-06-27 | 2020-12-29 | 北京百度网讯科技有限公司 | Method and device for determining relevance of equipment |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7991910B2 (en) * | 2008-11-17 | 2011-08-02 | Amazon Technologies, Inc. | Updating routing information based on client location |
CN104935676A (en) * | 2014-03-17 | 2015-09-23 | 阿里巴巴集团控股有限公司 | Method and device for determining IP address segment and its corresponding latitude and longitude |
CN104253879A (en) * | 2014-09-15 | 2014-12-31 | 北京锐安科技有限公司 | IP (Internet protocol) address-based position calibration method and IP address-based position calibration device |
CN107612946B (en) * | 2017-11-03 | 2021-09-03 | 北京奇艺世纪科技有限公司 | IP address detection method and device and electronic equipment |
CN110300084B (en) * | 2018-03-22 | 2023-09-01 | 北京京东尚科信息技术有限公司 | IP address-based portrait method and apparatus, electronic device, and readable medium |
CN111343301B (en) * | 2020-04-21 | 2022-08-16 | 北京字节跳动网络技术有限公司 | Positioning method, positioning device, electronic equipment and storage medium |
-
2021
- 2021-03-19 CN CN202110295660.7A patent/CN113067913B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019128355A1 (en) * | 2017-12-29 | 2019-07-04 | 北京京东尚科信息技术有限公司 | Method and device for determining accurate geographic location |
CN112153091A (en) * | 2019-06-27 | 2020-12-29 | 北京百度网讯科技有限公司 | Method and device for determining relevance of equipment |
Also Published As
Publication number | Publication date |
---|---|
CN113067913A (en) | 2021-07-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR102121361B1 (en) | Method and device for identifying the type of geographic location where the user is located | |
CN103220376B (en) | Method for positioning IP (Internet Protocol) by position data of mobile terminal | |
CN106534392B (en) | Positioning information acquisition method, positioning method and device | |
CN106874273B (en) | Channel information statistical method, device and system | |
CN109309596B (en) | Pressure testing method and device and server | |
CN110300084B (en) | IP address-based portrait method and apparatus, electronic device, and readable medium | |
US8131818B2 (en) | Optimizing caching period of location data for network based location services | |
CN106027693B (en) | IP address-based localization method and device | |
CN111429091A (en) | Resource allocation method and device, electronic equipment and storage medium | |
US9026489B2 (en) | Updating a conference invitation responsive to user location | |
US20150094107A1 (en) | Message combination method and device | |
CN110020150B (en) | Information recommendation method and device | |
CN113067913B (en) | Positioning method, device, server, medium and product | |
CN106453822B (en) | Map information display method based on asynchronous loading | |
TW202024964A (en) | User position determination method and apparatus, device, and computer readable storage medium | |
CN110913240B (en) | Video interception method, device, server and computer readable storage medium | |
CN106487653B (en) | Message processing method and server | |
CN106027692B (en) | Information acquisition method, device and server | |
CN103874014A (en) | Terminal location information-based business service method, service provision device and terminal | |
CN107633028B (en) | Dynamic data collision association method and system | |
CN114765738B (en) | Geographic position determining method and device based on wireless network address and storage medium | |
CN111125473B (en) | Recommended service processing and information recommending method, device, equipment and system | |
CN107172129A (en) | A kind of server collocation method and device | |
CN108763498B (en) | User identity identification method and device, electronic equipment and readable storage medium | |
CN109769202A (en) | Localization method and device, storage medium, the server of data on flows |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |