CN110928964A - Administrative region positioning method and device, computer equipment and storage medium - Google Patents

Administrative region positioning method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN110928964A
CN110928964A CN201811101296.0A CN201811101296A CN110928964A CN 110928964 A CN110928964 A CN 110928964A CN 201811101296 A CN201811101296 A CN 201811101296A CN 110928964 A CN110928964 A CN 110928964A
Authority
CN
China
Prior art keywords
information
longitude
administrative
user
latitude
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.)
Pending
Application number
CN201811101296.0A
Other languages
Chinese (zh)
Inventor
崔轩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Baidu Online Network Technology Beijing Co Ltd
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201811101296.0A priority Critical patent/CN110928964A/en
Publication of CN110928964A publication Critical patent/CN110928964A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/02Services making use of location information
    • H04W4/021Services related to particular areas, e.g. point of interest [POI] services, venue services or geofences
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/02Services making use of location information
    • H04W4/025Services making use of location information using location based information parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/69Types of network addresses using geographic information, e.g. room number

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method and a device for positioning administrative regions, computer equipment and a storage medium, wherein the method comprises the following steps: obtaining multi-dimensional data information of a user; if the multi-dimensional data information contains the IP information of the user but does not contain the longitude and latitude information of the user, determining an administrative region where the user is located according to the IP information; and if the multi-dimensional data information simultaneously contains the IP information of the user and the longitude and latitude information of the user, determining the administrative area where the user is located according to the longitude and latitude information. By applying the scheme of the invention, the accuracy of the positioning result can be improved.

Description

Administrative region positioning method and device, computer equipment and storage medium
[ technical field ] A method for producing a semiconductor device
The present invention relates to network technologies, and in particular, to a method and an apparatus for locating an administrative area, a computer device, and a storage medium.
[ background of the invention ]
At present, products such as search engines provide free services such as information retrieval for users, and when users search data, some information of the users can be transmitted back to a server at the background for recording, so that the users can be better understood.
For example, the administrative region where the user is located may be determined according to the IP information of the user. However, this approach is likely to cause a positioning error for a user roaming using a proxy or a handset, resulting in dirty data, i.e., reducing the accuracy of the positioning result.
[ summary of the invention ]
In view of the above, the invention provides a method and an apparatus for locating an administrative area, a computer device and a storage medium.
The specific technical scheme is as follows:
an administrative region positioning method, comprising:
obtaining multi-dimensional data information of a user;
if the multi-dimensional data information contains the IP information of the user but does not contain the longitude and latitude information of the user, determining an administrative region where the user is located according to the IP information;
and if the multi-dimensional data information simultaneously contains the IP information of the user and the longitude and latitude information of the user, determining the administrative area where the user is located according to the longitude and latitude information.
According to a preferred embodiment of the present invention, the determining the administrative area where the user is located according to the IP information includes:
determining an administrative region corresponding to the IP information by inquiring a pre-generated IP and administrative region comparison table, and taking the determined administrative region as an administrative region where a user is located;
and the administrative areas corresponding to different IP information are recorded in the IP and administrative area comparison table.
According to a preferred embodiment of the present invention, the determining the administrative area where the user is located according to the longitude and latitude information includes:
and if the multi-dimensional data information contains at least two kinds of longitude and latitude information, selecting the longitude and latitude information with the highest priority according to a preset priority sequence, and determining the administrative region where the user is located according to the selected longitude and latitude information.
According to a preferred embodiment of the present invention, the determining the administrative area where the user is located according to the longitude and latitude information includes:
determining an administrative region where the longitude and latitude information is located by inquiring a pre-generated administrative region boundary dictionary, and taking the determined administrative region as an administrative region where a user is located;
and longitude and latitude boundary coordinate sets respectively corresponding to different administrative regions are recorded in the administrative region boundary dictionary.
According to a preferred embodiment of the present invention, the determining the administrative area in which the longitude and latitude information is located by querying a pre-generated administrative area boundary dictionary includes:
aiming at each longitude and latitude boundary coordinate set, respectively using a coordinate point corresponding to the longitude and latitude information as an endpoint to guide a ray, calculating the number of intersection points of the ray and the sides of a polygonal area constructed by the longitude and latitude boundary coordinate set, if the number of the intersection points is an odd number, determining that the longitude and latitude information is positioned in the polygonal area, and determining an administrative area corresponding to the polygonal area as an administrative area where the longitude and latitude information is positioned.
According to a preferred embodiment of the invention, the method further comprises: and if the multi-dimensional data information simultaneously contains the IP information and the longitude and latitude information, determining an administrative area where the user is located by combining the IP information and the longitude and latitude information.
According to a preferred embodiment of the present invention, the determining the administrative area where the user is located by combining the IP information and the latitude and longitude information includes:
determining an administrative region where the user is located according to the IP information;
determining an administrative region where the user is located according to the longitude and latitude information;
and comparing the administrative areas determined twice, if the administrative areas are consistent, taking the determined administrative areas as the administrative areas where the users are located, and if the administrative areas are not consistent, taking the administrative areas determined according to the longitude and latitude information as the administrative areas where the users are located.
An administrative area locating device comprising: an acquisition unit and a positioning unit;
the acquisition unit is used for acquiring multi-dimensional data information of a user;
the positioning unit is used for determining an administrative area where the user is located according to the IP information when the multi-dimensional data information contains the IP information of the user but does not contain the longitude and latitude information of the user, and determining the administrative area where the user is located according to the longitude and latitude information when the multi-dimensional data information contains the IP information of the user and the longitude and latitude information of the user at the same time.
According to a preferred embodiment of the present invention, the positioning unit determines an administrative area corresponding to the IP information by querying a pre-generated IP and administrative area comparison table, and takes the determined administrative area as an administrative area where the user is located;
and the administrative areas corresponding to different IP information are recorded in the IP and administrative area comparison table.
According to a preferred embodiment of the present invention, the positioning unit is further configured to select longitude and latitude information with a highest priority according to a preset priority order if the multi-dimensional data information includes at least two kinds of longitude and latitude information, and determine an administrative area where the user is located according to the selected longitude and latitude information.
According to a preferred embodiment of the present invention, the positioning unit determines an administrative area where the longitude and latitude information is located by querying a pre-generated administrative area boundary dictionary, and takes the determined administrative area as an administrative area where the user is located;
and longitude and latitude boundary coordinate sets respectively corresponding to different administrative regions are recorded in the administrative region boundary dictionary.
According to a preferred embodiment of the present invention, the positioning unit guides a ray to each longitude and latitude boundary coordinate set by using a coordinate point corresponding to the longitude and latitude information as an endpoint, calculates the number of intersection points of the ray and the side of a polygonal area constructed by the longitude and latitude boundary coordinate set, determines that the longitude and latitude information is located inside the polygonal area if the number of the intersection points is an odd number, and determines an administrative area corresponding to the polygonal area as an administrative area where the longitude and latitude information is located.
According to a preferred embodiment of the present invention, the positioning unit is further configured to determine an administrative area where the user is located by combining the IP information and the latitude and longitude information when the multi-dimensional data information includes the IP information and the latitude and longitude information at the same time.
According to a preferred embodiment of the present invention, the positioning unit determines the administrative area where the user is located according to the IP information, determines the administrative area where the user is located according to the longitude and latitude information, compares the administrative areas determined twice, if the administrative areas are consistent, the determined administrative area is used as the administrative area where the user is located, and if the administrative areas are inconsistent, the administrative area determined according to the longitude and latitude information is used as the administrative area where the user is located.
A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method as described above when executing the program.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method as set forth above.
Based on the introduction, the method and the device can acquire the multi-dimensional data information of the user, can determine the administrative area where the user is located according to the IP information if the multi-dimensional data information contains the IP information of the user but does not contain the longitude and latitude information of the user, and can determine the administrative area where the user is located according to the longitude and latitude information if the multi-dimensional data information contains the IP information of the user and the longitude and latitude information of the user at the same time.
[ description of the drawings ]
Fig. 1 is a flowchart illustrating a method for locating an administrative area according to a first embodiment of the present invention.
FIG. 2 is a schematic view of a polygon according to the present invention.
Fig. 3 is a flowchart of a second embodiment of the administrative area locating method according to the present invention.
Fig. 4 is a schematic structural diagram of an embodiment of the administrative area positioning device according to the present invention.
FIG. 5 illustrates a block diagram of an exemplary computer system/server 12 suitable for use in implementing embodiments of the present invention.
[ detailed description ] embodiments
In order to make the technical solution of the present invention clearer and more obvious, the solution of the present invention is further described below by referring to the drawings and examples.
It is to be understood that the embodiments described are only a few embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a flowchart illustrating a method for locating an administrative area according to a first embodiment of the present invention. As shown in fig. 1, the following detailed implementation is included.
In 101, multi-dimensional data information of a user is acquired.
In 102, if the multi-dimensional data information includes the IP information of the user but does not include the longitude and latitude information of the user, the administrative area where the user is located is determined according to the IP information.
In 103, if the multi-dimensional data information includes the IP information of the user and the longitude and latitude information of the user at the same time, the administrative area where the user is located is determined according to the longitude and latitude information.
The obtained various information of the user can be integrated, so that the multi-dimensional data information of the user is obtained.
Generally, the multi-dimensional data information may include IP information of the user, latitude and longitude information of the user, and some other information.
If the multi-dimensional data information contains the IP information of the user but does not contain the longitude and latitude information of the user, the administrative area where the user is located can be determined according to the IP information, and if the multi-dimensional data information contains the IP information of the user and the longitude and latitude information of the user at the same time, the administrative area where the user is located can be determined according to the longitude and latitude information.
When the administrative region where the user is located is determined according to the IP information, the administrative region corresponding to the IP information can be determined by inquiring a pre-generated comparison table of the IP and the administrative region, the determined administrative region is further used as the administrative region where the user is located, and different administrative regions respectively corresponding to the IP information are recorded in the comparison table of the IP and the administrative region.
In the embodiment, a correspondence relationship between the IP segments and the administrative areas is converted into a correspondence relationship between the IP information and the administrative areas, that is, kv pairs of the IP information and the administrative areas are generated, so that a comparison table of the IP and the administrative areas recorded with different IP information respectively corresponding to each other is obtained, and one administrative area may correspond to a plurality of IP information. Therefore, when the administrative region where the user is located is required to be determined according to the IP information of the user, the IP information of the user can be used as a key to search, and the administrative region where the user is located is obtained.
When the administrative area where the user is located is determined according to the longitude and latitude information, the possibly multi-dimensional data information comprises at least two kinds of longitude and latitude information, namely the multi-latitude and longitude information, so that the longitude and latitude information with the highest priority can be selected according to a preset priority sequence, and then the administrative area where the user is located is determined according to the selected longitude and latitude information.
For example, the latitude and longitude information may include Global Positioning System (GPS) data, wifi positioning data, base station positioning data, and latitude and longitude data located by other chips.
The priority order of various latitude and longitude information can be preset, for example, the priority order is from high to low: GPS data, wifi positioning data, base station positioning data and longitude and latitude data positioned by other chips. Therefore, when the multi-dimensional data information contains various latitude and longitude information, the latitude and longitude information with the highest priority can be selected, and the administrative area where the user is located is determined according to the selected latitude and longitude information.
Specifically, an administrative area where the longitude and latitude information is located can be determined by querying a pre-generated administrative area boundary dictionary, the determined administrative area is used as the administrative area where the user is located, and longitude and latitude boundary coordinate sets corresponding to different administrative areas are recorded in the administrative area boundary dictionary.
The longitude and latitude boundary coordinates of all administrative areas in the country can be acquired based on a Baidu map and the like, so that a longitude and latitude boundary coordinate set is respectively formed for each administrative area, and the boundary of the administrative area can be constructed according to the longitude and latitude boundary coordinate set. The administrative region may be a polygonal region containing any number of edges.
Because the administrative region is a polygonal region containing any number of edges, the mathematical problem that whether the query point is in the polygon can be converted by determining the administrative region according to the given longitude and latitude information. Correspondingly, in this embodiment, for each longitude and latitude boundary coordinate set, a ray may be respectively introduced with a coordinate point corresponding to the longitude and latitude information as an endpoint, the number of intersection points of the ray and the side of the polygonal area constructed by the longitude and latitude boundary coordinate set is calculated, if the number of the intersection points is an odd number, the longitude and latitude information is determined to be located inside the polygonal area, and the administrative area corresponding to the polygonal area is determined to be the administrative area where the longitude and latitude information is located.
Namely, an administrative region where longitude and latitude information is located is determined by adopting a ray method. The basic idea of the ray method is as follows: and (3) guiding a ray by taking the target point as an end point, calculating the number of intersection points of the ray and all edges of the polygon, if the number of the intersection points is an odd number, indicating that the target point is positioned inside the polygon, and if the number of the intersection points is an even number, indicating that the target point is positioned outside the polygon.
For example, the following steps are carried out: FIG. 2 is a schematic view of a polygon according to the present invention. The key point of the ray method is unidirectional emission, taking a horizontal line as an example, a target point O is positioned inside a polygon, rays are emitted to the right, intersection points with the polygon are a point B, a point C and a point D, rays are emitted to the left, intersection points with the polygon are an odd number, an intersection point P is positioned outside the polygon, and no matter rays are emitted to the left or the right, 2 intersection points with the polygon are even numbers.
Specifically, in this embodiment, the target point shown in fig. 2 is a coordinate point corresponding to latitude and longitude information of the user, and the polygon shown in fig. 2 is a polygon area constructed by any latitude and longitude boundary coordinate set.
In the above embodiment, when the multi-dimensional data information includes the IP information of the user and the longitude and latitude information of the user at the same time, the administrative area where the user is located is determined according to the longitude and latitude information.
Fig. 3 is a flowchart of a second embodiment of the administrative area locating method according to the present invention. As shown in fig. 3, the following detailed implementation is included.
In 301, multi-dimensional data information of a user is obtained.
In 302, if the multi-dimensional data information includes the IP information of the user and the longitude and latitude information of the user at the same time, the processing is performed in the manner shown in 303-305.
In 303, the administrative region where the user is located is determined according to the IP information.
For example, the administrative region corresponding to the IP information may be determined by querying a pre-generated IP-administrative region comparison table, and the determined administrative region is used as the administrative region where the user is located, and the administrative regions corresponding to different IP information are recorded in the IP-administrative region comparison table.
At 304, the administrative area where the user is located is determined according to the latitude and longitude information.
For example, an administrative area where the longitude and latitude information is located may be determined by querying a pre-generated administrative area boundary dictionary, and the determined administrative area is used as an administrative area where the user is located, and longitude and latitude boundary coordinate sets corresponding to different administrative areas are recorded in the administrative area boundary dictionary.
Specifically, for each longitude and latitude boundary coordinate set, a ray may be respectively introduced with a coordinate point corresponding to the longitude and latitude information as an endpoint, the number of intersection points of the ray and the side of the polygonal area constructed by the longitude and latitude boundary coordinate set is calculated, if the number of the intersection points is an odd number, the longitude and latitude information is determined to be located inside the polygonal area, and the administrative area corresponding to the polygonal area is determined to be the administrative area where the longitude and latitude information is located.
If the multi-dimensional data information contains at least two kinds of longitude and latitude information, the longitude and latitude information with the highest priority can be selected according to a preset priority sequence, and then the administrative region where the user is located is determined according to the selected longitude and latitude information.
In 305, the administrative areas determined twice are compared, if the administrative areas are consistent, the determined administrative area is used as the administrative area where the user is located, and if the administrative areas are not consistent, the administrative area determined according to the longitude and latitude information is used as the administrative area where the user is located.
After the two administrative areas are determined according to the manners shown by 303 and 304, the two administrative areas can be compared, if the two administrative areas are consistent, the determined administrative area can be used as the administrative area where the user is located, and if the two administrative areas are not consistent, the administrative area determined according to the longitude and latitude information can be used as the administrative area where the user is located.
Considering that the administrative region determined based on the longitude and latitude information is more accurate, when the positioning results obtained twice are inconsistent, the more accurate positioning result can be adopted, so that the accuracy of the positioning result is improved, and when the positioning results obtained twice are consistent, the positioning result obtained in 304 is equivalently verified further by using the positioning result obtained in 303, so that the accuracy of the positioning result is ensured.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In a word, by adopting the scheme of the invention, the longitude and latitude information can be utilized to well supplement the existing administrative region positioning, thereby improving the accuracy of the positioning result and the like.
The above is a description of method embodiments, and the embodiments of the present invention are further described below by way of apparatus embodiments.
Fig. 4 is a schematic structural diagram of an embodiment of the administrative area positioning device according to the present invention. As shown in fig. 4, includes: an acquisition unit 401 and a positioning unit 402.
An obtaining unit 401 is configured to obtain multidimensional data information of a user.
The positioning unit 402 is configured to determine an administrative area where the user is located according to the IP information when the multi-dimensional data information includes the IP information of the user but does not include the longitude and latitude information of the user, and determine the administrative area where the user is located according to the longitude and latitude information when the multi-dimensional data information includes the IP information of the user and the longitude and latitude information of the user at the same time.
The obtaining unit 401 may integrate the obtained various information of the user, so as to obtain the multidimensional data information of the user.
Generally, the multi-dimensional data information may include IP information of the user, latitude and longitude information of the user, and some other information.
If the multi-dimensional data information includes the IP information of the user but does not include the longitude and latitude information of the user, the positioning unit 402 may determine the administrative area where the user is located according to the IP information, and if the multi-dimensional data information includes the IP information of the user and the longitude and latitude information of the user at the same time, the positioning unit 402 may determine the administrative area where the user is located according to the longitude and latitude information.
When the administrative area where the user is located is determined according to the IP information, the positioning unit 402 may determine the administrative area corresponding to the IP information by querying a pre-generated IP and administrative area comparison table, and then take the determined administrative area as the administrative area where the user is located, where the administrative areas corresponding to different IP information are recorded in the IP and administrative area comparison table.
When the administrative area where the user is located is determined according to the longitude and latitude information, the multi-dimensional data information may include at least two kinds of longitude and latitude information, that is, multiple kinds of longitude and latitude information, so that the positioning unit 402 may select the longitude and latitude information with the highest priority according to a preset priority order, and then determine the administrative area where the user is located according to the selected longitude and latitude information.
For example, the latitude and longitude information may include GPS data, wifi positioning data, base station positioning data, latitude and longitude data located by other chips, and the like.
The priority order of various latitude and longitude information can be preset, for example, the priority order is from high to low: GPS data, wifi positioning data, base station positioning data and longitude and latitude data positioned by other chips.
Specifically, the positioning unit 402 may determine an administrative area where the longitude and latitude information is located by querying a pre-generated administrative area boundary dictionary, and use the determined administrative area as an administrative area where the user is located, where longitude and latitude boundary coordinate sets respectively corresponding to different administrative areas are recorded in the administrative area boundary dictionary.
The longitude and latitude boundary coordinates of all administrative areas in the country can be acquired based on a Baidu map and the like, so that a longitude and latitude boundary coordinate set is respectively formed for each administrative area, and the boundary of the administrative area can be constructed according to the longitude and latitude boundary coordinate set. The administrative region may be a polygonal region containing any number of edges.
The positioning unit 402 may respectively direct a ray to each longitude and latitude boundary coordinate set by using a coordinate point corresponding to the longitude and latitude information as an endpoint, calculate the number of intersection points of the ray and the side of the polygon area constructed by the longitude and latitude boundary coordinate set, determine that the longitude and latitude information is located inside the polygon area if the number of the intersection points is an odd number, and determine the administrative area corresponding to the polygon area as the administrative area where the longitude and latitude information is located.
Namely, an administrative region where longitude and latitude information is located is determined by adopting a ray method. The basic idea of the ray method is as follows: and (3) guiding a ray by taking the target point as an end point, calculating the number of intersection points of the ray and all edges of the polygon, if the number of the intersection points is an odd number, indicating that the target point is positioned inside the polygon, and if the number of the intersection points is an even number, indicating that the target point is positioned outside the polygon.
In addition, when the multi-dimensional data information simultaneously includes the IP information and the latitude and longitude information, the positioning unit 402 may determine the administrative area where the user is located by combining the IP information and the latitude and longitude information.
For example, the positioning unit 402 may determine the administrative area where the user is located according to the IP information, determine the administrative area where the user is located according to the longitude and latitude information, compare the administrative areas determined twice, if the administrative areas are consistent, use the determined administrative area as the administrative area where the user is located, and if the administrative areas are not consistent, use the administrative area determined according to the longitude and latitude information as the administrative area where the user is located.
For a specific work flow of the apparatus embodiment shown in fig. 4, reference is made to the related description in the foregoing method embodiment, and details are not repeated.
FIG. 5 illustrates a block diagram of an exemplary computer system/server 12 suitable for use in implementing embodiments of the present invention. The computer system/server 12 shown in FIG. 5 is only one example and should not be taken to limit the scope of use or functionality of embodiments of the present invention.
As shown in FIG. 5, computer system/server 12 is in the form of a general purpose computing device. The components of computer system/server 12 may include, but are not limited to: one or more processors (processing units) 16, a memory 28, and a bus 18 that connects the various system components, including the memory 28 and the processors 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Computer system/server 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by computer system/server 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. The computer system/server 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 5, and commonly referred to as a "hard drive"). Although not shown in FIG. 5, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
The computer system/server 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with the computer system/server 12, and/or with any devices (e.g., network card, modem, etc.) that enable the computer system/server 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the computer system/server 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet) via the network adapter 20. As shown in FIG. 5, the network adapter 20 communicates with the other modules of the computer system/server 12 via the bus 18. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the computer system/server 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processor 16 executes various functional applications and data processing by executing programs stored in the memory 28, for example implementing the methods in the embodiments shown in fig. 1 or fig. 3.
The invention also discloses a computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, will carry out the method of the embodiments shown in fig. 1 or fig. 3.
Any combination of one or more computer-readable media may be employed. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method, etc., can be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the units is only one logical functional division, and other divisions may be realized in practice.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (16)

1. An administrative region positioning method, comprising:
obtaining multi-dimensional data information of a user;
if the multi-dimensional data information contains the IP information of the user but does not contain the longitude and latitude information of the user, determining an administrative region where the user is located according to the IP information;
and if the multi-dimensional data information simultaneously contains the IP information of the user and the longitude and latitude information of the user, determining the administrative area where the user is located according to the longitude and latitude information.
2. The method of claim 1,
the determining the administrative region where the user is located according to the IP information comprises:
determining an administrative region corresponding to the IP information by inquiring a pre-generated IP and administrative region comparison table, and taking the determined administrative region as an administrative region where a user is located;
and the administrative areas corresponding to different IP information are recorded in the IP and administrative area comparison table.
3. The method of claim 1,
the step of determining the administrative region where the user is located according to the longitude and latitude information comprises the following steps:
and if the multi-dimensional data information contains at least two kinds of longitude and latitude information, selecting the longitude and latitude information with the highest priority according to a preset priority sequence, and determining the administrative region where the user is located according to the selected longitude and latitude information.
4. The method of claim 1,
the step of determining the administrative region where the user is located according to the longitude and latitude information comprises the following steps:
determining an administrative region where the longitude and latitude information is located by inquiring a pre-generated administrative region boundary dictionary, and taking the determined administrative region as an administrative region where a user is located;
and longitude and latitude boundary coordinate sets respectively corresponding to different administrative regions are recorded in the administrative region boundary dictionary.
5. The method of claim 4,
the step of determining the administrative region where the longitude and latitude information is located by querying a pre-generated administrative region boundary dictionary comprises the following steps:
aiming at each longitude and latitude boundary coordinate set, respectively using a coordinate point corresponding to the longitude and latitude information as an endpoint to guide a ray, calculating the number of intersection points of the ray and the sides of a polygonal area constructed by the longitude and latitude boundary coordinate set, if the number of the intersection points is an odd number, determining that the longitude and latitude information is positioned in the polygonal area, and determining an administrative area corresponding to the polygonal area as an administrative area where the longitude and latitude information is positioned.
6. The method of claim 1,
the method further comprises the following steps: and if the multi-dimensional data information simultaneously contains the IP information and the longitude and latitude information, determining an administrative area where the user is located by combining the IP information and the longitude and latitude information.
7. The method of claim 6,
the determining the administrative region where the user is located by combining the IP information and the longitude and latitude information comprises the following steps:
determining an administrative region where the user is located according to the IP information;
determining an administrative region where the user is located according to the longitude and latitude information;
and comparing the administrative areas determined twice, if the administrative areas are consistent, taking the determined administrative areas as the administrative areas where the users are located, and if the administrative areas are not consistent, taking the administrative areas determined according to the longitude and latitude information as the administrative areas where the users are located.
8. An administrative area positioning device, comprising: an acquisition unit and a positioning unit;
the acquisition unit is used for acquiring multi-dimensional data information of a user;
the positioning unit is used for determining an administrative area where the user is located according to the IP information when the multi-dimensional data information contains the IP information of the user but does not contain the longitude and latitude information of the user, and determining the administrative area where the user is located according to the longitude and latitude information when the multi-dimensional data information contains the IP information of the user and the longitude and latitude information of the user at the same time.
9. The apparatus of claim 8,
the positioning unit determines an administrative region corresponding to the IP information by inquiring a pre-generated IP and administrative region comparison table, and takes the determined administrative region as the administrative region where the user is located;
and the administrative areas corresponding to different IP information are recorded in the IP and administrative area comparison table.
10. The apparatus of claim 8,
the positioning unit is further used for selecting longitude and latitude information with the highest priority according to a preset priority order if the multi-dimensional data information contains at least two kinds of longitude and latitude information, and determining an administrative region where the user is located according to the selected longitude and latitude information.
11. The apparatus of claim 8,
the positioning unit determines an administrative region where the longitude and latitude information is located by inquiring a pre-generated administrative region boundary dictionary, and takes the determined administrative region as an administrative region where a user is located;
and longitude and latitude boundary coordinate sets respectively corresponding to different administrative regions are recorded in the administrative region boundary dictionary.
12. The apparatus of claim 11,
the positioning unit guides a ray by taking a coordinate point corresponding to the longitude and latitude information as an endpoint respectively for each longitude and latitude boundary coordinate set, calculates the number of intersection points of the ray and the sides of a polygonal area constructed by the longitude and latitude boundary coordinate set, determines that the longitude and latitude information is positioned in the polygonal area if the number of the intersection points is an odd number, and determines an administrative area corresponding to the polygonal area as an administrative area where the longitude and latitude information is positioned.
13. The apparatus of claim 8,
the positioning unit is further used for determining an administrative area where the user is located by combining the IP information and the longitude and latitude information when the multi-dimensional data information simultaneously contains the IP information and the longitude and latitude information.
14. The apparatus of claim 13,
and the positioning unit determines the administrative region where the user is located according to the IP information, determines the administrative region where the user is located according to the longitude and latitude information, compares the administrative regions determined twice, if the administrative regions are consistent, the determined administrative region is used as the administrative region where the user is located, and if the administrative regions are inconsistent, the administrative region determined according to the longitude and latitude information is used as the administrative region where the user is located.
15. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the program implements the method of any one of claims 1 to 7.
16. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the method according to any one of claims 1 to 7.
CN201811101296.0A 2018-09-20 2018-09-20 Administrative region positioning method and device, computer equipment and storage medium Pending CN110928964A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811101296.0A CN110928964A (en) 2018-09-20 2018-09-20 Administrative region positioning method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811101296.0A CN110928964A (en) 2018-09-20 2018-09-20 Administrative region positioning method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110928964A true CN110928964A (en) 2020-03-27

Family

ID=69855498

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811101296.0A Pending CN110928964A (en) 2018-09-20 2018-09-20 Administrative region positioning method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110928964A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111753035A (en) * 2020-06-16 2020-10-09 福建票付通信息科技有限公司 Scenic spot name matching method based on administrative district division completion
CN112507051A (en) * 2020-12-03 2021-03-16 北京梧桐车联科技有限责任公司 Administrative division identification method, device, equipment and computer readable storage medium
CN112699560A (en) * 2020-12-31 2021-04-23 青岛海尔科技有限公司 Position recognition method and device, storage medium and electronic device
CN112702387A (en) * 2020-12-01 2021-04-23 深圳市和讯华谷信息技术有限公司 Distributed geographic position real-time processing method and system
CN115809277A (en) * 2023-02-06 2023-03-17 成都智元汇信息技术股份有限公司 Method for positioning administrative region of internet of things equipment based on longitude and latitude

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102538798A (en) * 2012-01-11 2012-07-04 广东好帮手电子科技股份有限公司 Navigation equipment as well as automatic switchover method and system of navigation display mode
CN103248723A (en) * 2013-04-10 2013-08-14 腾讯科技(深圳)有限公司 Determination method and device for IP address area
CN104080078A (en) * 2013-03-26 2014-10-01 百度在线网络技术(北京)有限公司 Base station positioning method and equipment
CN105142215A (en) * 2015-08-07 2015-12-09 成都亚讯星科实业有限公司 Method for locating and calculating multi-dimensional user position
CN105989024A (en) * 2015-01-30 2016-10-05 北京陌陌信息技术有限公司 Method and device for determining position regions of users
CN106651442A (en) * 2016-12-16 2017-05-10 合网络技术(北京)有限公司 Advertisement serving control method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102538798A (en) * 2012-01-11 2012-07-04 广东好帮手电子科技股份有限公司 Navigation equipment as well as automatic switchover method and system of navigation display mode
CN104080078A (en) * 2013-03-26 2014-10-01 百度在线网络技术(北京)有限公司 Base station positioning method and equipment
CN103248723A (en) * 2013-04-10 2013-08-14 腾讯科技(深圳)有限公司 Determination method and device for IP address area
CN105989024A (en) * 2015-01-30 2016-10-05 北京陌陌信息技术有限公司 Method and device for determining position regions of users
CN105142215A (en) * 2015-08-07 2015-12-09 成都亚讯星科实业有限公司 Method for locating and calculating multi-dimensional user position
CN106651442A (en) * 2016-12-16 2017-05-10 合网络技术(北京)有限公司 Advertisement serving control method and device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111753035A (en) * 2020-06-16 2020-10-09 福建票付通信息科技有限公司 Scenic spot name matching method based on administrative district division completion
CN112702387A (en) * 2020-12-01 2021-04-23 深圳市和讯华谷信息技术有限公司 Distributed geographic position real-time processing method and system
CN112507051A (en) * 2020-12-03 2021-03-16 北京梧桐车联科技有限责任公司 Administrative division identification method, device, equipment and computer readable storage medium
CN112699560A (en) * 2020-12-31 2021-04-23 青岛海尔科技有限公司 Position recognition method and device, storage medium and electronic device
CN115809277A (en) * 2023-02-06 2023-03-17 成都智元汇信息技术股份有限公司 Method for positioning administrative region of internet of things equipment based on longitude and latitude

Similar Documents

Publication Publication Date Title
CN110928964A (en) Administrative region positioning method and device, computer equipment and storage medium
CN107656913B (en) Map interest point address extraction method, map interest point address extraction device, server and storage medium
CN111090628B (en) Data processing method and device, storage medium and electronic equipment
CN110677815A (en) Stay point identification method and device, computer equipment and storage medium
US11216618B2 (en) Query processing method, apparatus, server and storage medium
CN107221328B (en) Method and device for positioning modification source, computer equipment and readable medium
CN108229364B (en) Building contour generation method and device, computer equipment and storage medium
KR20170117481A (en) Method and apparatus for processing text address
US10296497B2 (en) Storing a key value to a deleted row based on key range density
CN111125555B (en) Enterprise information acquisition method and device
CN109960554B (en) Method, device and computer storage medium for displaying reading content
CN110688544A (en) Method, device and storage medium for querying database
CN111061740B (en) Data synchronization method, device and storage medium
CN110134869B (en) Information pushing method, device, equipment and storage medium
US20200137512A1 (en) Deduplication of points of interest (pois) from different sources
CN110569218B (en) Offline modification method and device for EXT file system and storage medium
CN110110236B (en) Information pushing method, device, equipment and storage medium
CN107341221B (en) Index structure establishing and associated retrieving method, device, equipment and storage medium
CN110688434A (en) Method, device, equipment and medium for processing interest points
CN110175128B (en) Similar code case acquisition method, device, equipment and storage medium
CN109446433B (en) Method, device, server and storage medium for verifying failure of interest point
CN110753136B (en) Domain name resolution method, device, equipment and storage medium
CN111862052B (en) Method, device, equipment and medium for detecting gap
CN114154468A (en) Report synthesis method and device, electronic equipment and storage medium
CN108021656B (en) Method and device for generating comparison coordinates, server and storage medium

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200327

RJ01 Rejection of invention patent application after publication