CN114880421A - Location service method, system, electronic device and storage medium - Google Patents

Location service method, system, electronic device and storage medium Download PDF

Info

Publication number
CN114880421A
CN114880421A CN202210797281.2A CN202210797281A CN114880421A CN 114880421 A CN114880421 A CN 114880421A CN 202210797281 A CN202210797281 A CN 202210797281A CN 114880421 A CN114880421 A CN 114880421A
Authority
CN
China
Prior art keywords
longitude
information
latitude coordinates
geohash coding
coding region
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.)
Granted
Application number
CN202210797281.2A
Other languages
Chinese (zh)
Other versions
CN114880421B (en
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.)
Beigu Electronics Co ltd
Beigu Electronics Co ltd Shanghai Branch
Beigu Electronics Wuxi Co ltd
Luogu Technology Shanghai Co ltd
Original Assignee
Beigu Electronics Co ltd Shanghai Branch
Beigu Electronics Wuxi Co ltd
Luogu Technology Shanghai Co ltd
North Valley Electronics 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 Beigu Electronics Co ltd Shanghai Branch, Beigu Electronics Wuxi Co ltd, Luogu Technology Shanghai Co ltd, North Valley Electronics Co ltd filed Critical Beigu Electronics Co ltd Shanghai Branch
Priority to CN202210797281.2A priority Critical patent/CN114880421B/en
Publication of CN114880421A publication Critical patent/CN114880421A/en
Application granted granted Critical
Publication of CN114880421B publication Critical patent/CN114880421B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/29Geographical information databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0806Multiuser, multiprocessor or multiprocessing cache systems
    • G06F12/0811Multiuser, multiprocessor or multiprocessing cache systems with multilevel cache hierarchies
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/907Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/909Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using geographical or spatial information, e.g. location

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Library & Information Science (AREA)
  • Remote Sensing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention provides a position service method, a position service system, electronic equipment and a storage medium, and belongs to the technical field of GIS data processing. The location service method comprises the following steps: inquiring whether the information of the Geohash coding area where the position service cache is located is stored or not according to the received longitude and latitude coordinates, and if not, obtaining the Geohash coding area where the longitude and latitude coordinates are located according to preset precision; calling a third-party position service system to acquire all position information in the Geohash coding region according to the contour information of the Geohash coding region, and storing the information of the Geohash coding region into the position service cache; and if so, acquiring target position information corresponding to the longitude and latitude coordinates according to the longitude and latitude coordinates and all position information in the Geohash coding region. The invention can obviously reduce the call volume of the third-party position service system and save the cost.

Description

Location service method, system, electronic device and storage medium
Technical Field
The invention relates to the technical field of GIS data processing, in particular to a position service method, a position service system, electronic equipment and a storage medium.
Background
In the non-road equipment management system, equipment acquires longitude and latitude information, and when the non-road equipment management system receives the longitude and latitude information uploaded by the equipment, the longitude and latitude of the equipment needs to be converted into position information. In the prior art, a third-party location service provider (including but not limited to, high-grade, hundredth, etc.) is frequently called in an http manner to obtain location information. Position information needs to be acquired by a third-party position service provider every time longitude and latitude information is updated, the calling amount is extremely large, the cost needs to be paid to the third-party position service provider according to the calling times under the common condition, and the cost is high; but also depends heavily on the location service system of the third-party location service provider, and the performance of the non-road equipment management system also depends heavily on the location service system of the third-party location service provider.
Therefore, how to provide a location service method to reduce the dependence on third-party location service providers and improve the performance of the non-road equipment management system is becoming one of the technical problems to be solved by those skilled in the art.
It is noted that the information disclosed in this background section is only for enhancement of understanding of the general background of the invention and should not be taken as an acknowledgement or any form of suggestion that this information forms the prior art already known to a person skilled in the art.
Disclosure of Invention
The invention aims to provide a position service method, a position service system, electronic equipment and a storage medium aiming at the problems of strong dependence on a third-party position service provider and higher cost in the prior art when the position information of non-road mobile mechanical equipment is acquired.
In order to achieve the above object, the present invention is implemented by the following technical solutions, and a location service method includes:
s100: inquiring whether the information of the Geohash coding area where the longitude and latitude coordinates are located is stored in a location service cache according to the received longitude and latitude coordinates, and if not, executing S200; if yes, executing S300; the information of the Geohash coding region comprises contour information of the Geohash coding region and all position information in the Geohash coding region;
s200: according to the longitude and latitude coordinates and preset precision, obtaining a Geohash coding area where the longitude and latitude coordinates are located; calling a third-party location service system to acquire all location information in the Geohash coding region according to the contour information of the Geohash coding region, and storing the contour information of the Geohash coding region and all the location information in the Geohash coding region into the location service cache;
s300: acquiring target position information corresponding to the longitude and latitude coordinates according to the longitude and latitude coordinates and all position information in the Geohash coding region; and outputs the target position information.
Optionally, the location service cache stores the information of the Geohash coding region in a hierarchical manner, where the hierarchical manner includes:
storing province information as a first level, wherein each province information comprises a name, an identification code, a province center point coordinate and a province boundary longitude and latitude coordinate of the province;
storing city information as a second level, wherein each city information comprises a name, an identification code, a province identification code, a city center point coordinate and a city boundary longitude and latitude coordinate of the city;
storing the information of the Geohash coding regions as a third level, wherein the information of each Geohash coding region comprises contour information corresponding to the Geohash coding and an identification code list of all position information in the Geohash coding region;
and storing the position information as a third level, wherein each position information comprises an identification code, longitude and latitude coordinates, a name of a city where the position information is located, a political area where the position information is located, a town where the position information belongs and address information of the position information.
Optionally, step S100, according to the received longitude and latitude coordinates, queries whether information of a Geohash coding region where the longitude and latitude coordinates are located is stored in a location service cache, where the querying includes:
acquiring a province identification code of the longitude and latitude coordinate by adopting a PostGIS according to the longitude and latitude coordinate and a province boundary longitude and latitude coordinate of the province information in the location service cache;
acquiring the longitude and latitude coordinates of the city boundary where the longitude and latitude coordinates are located by adopting a PostGIS according to the longitude and latitude coordinates, the province identification codes and the city information in the location service cache;
and inquiring whether the Geohash coding area information where the longitude and latitude coordinates are located is stored in a location service cache or not according to the longitude and latitude coordinates, the city boundary longitude and latitude coordinates and the Geohash coding area information.
Optionally, the province information and the city information are acquired through a third-party location service system.
Optionally, in step S200, obtaining, according to the longitude and latitude coordinates and according to a preset precision, a Geohash coding region where the longitude and latitude coordinates are located includes:
converting the longitude and latitude coordinates into a Geohash code according to the preset precision;
acquiring a rectangular area corresponding to the Geohash code, and taking the rectangular area as the Geohash code area where the longitude and latitude coordinate information is located;
and acquiring longitude and latitude coordinates of four vertexes of the Geohash coding area according to the Geohash coding of the rectangular area.
Optionally, in step S300, obtaining target location information corresponding to the longitude and latitude coordinates according to the longitude and latitude coordinates and all location information in the Geohash coding region, where the obtaining includes:
acquiring longitude and latitude coordinates of the position information corresponding to the identification code according to the identification code of each position information in the information of the Geohash coding area and the position information in the position service cache;
acquiring an identification code of the position information with the minimum distance with the longitude and latitude coordinates as an identification code of a target position corresponding to the longitude and latitude coordinates according to the longitude and latitude coordinates and the longitude and latitude coordinates of each position information;
and acquiring the target position information corresponding to the longitude and latitude coordinates according to the identification code of the target position and the position information in the position service cache.
Optionally, step S300 outputs the target location information, including:
and the target position information is output in the modes of country, province, city, administrative district, town and name.
In order to achieve the above object, the present invention further provides a location service system, including a first location information acquiring unit, a second location information acquiring unit, and a third location information acquiring unit, wherein:
the first location information acquiring unit is configured to inquire whether information of a Geohash coding area where the longitude and latitude coordinates are located is stored in a location service cache according to the received longitude and latitude coordinates, and if not, the second location information acquiring unit acquires target location information corresponding to the longitude and latitude coordinates; if yes, acquiring target position information corresponding to the longitude and latitude coordinates through the position information third acquisition unit; the information of the Geohash coding region comprises contour information of the Geohash coding region and all position information in the Geohash coding region;
the position information second acquisition unit is configured to obtain a Geohash coding area where the longitude and latitude coordinates are located according to the longitude and latitude coordinates and preset precision; calling a third-party location service system to acquire all location information in the Geohash coding region according to the contour information of the Geohash coding region, storing the contour information of the Geohash coding region and all the location information in the Geohash coding region into the location service cache, and acquiring target location information corresponding to the longitude and latitude coordinates through a third location information acquisition unit;
the position information third acquisition unit is configured to acquire target position information corresponding to the longitude and latitude coordinates according to the longitude and latitude coordinates and all position information in the Geohash coding region; and outputs the target position information.
In order to achieve the above object, the present invention further provides an electronic device, which includes a processor and a memory, wherein the memory stores a computer program, and the computer program realizes the location service method according to any one of the above items when being executed by the processor.
In order to achieve the above object, the present invention further provides a readable storage medium having a computer program stored therein, the computer program, when executed by a processor, implementing the location service method of any one of the above.
Compared with the prior art, the location service method, the location service system, the electronic equipment and the storage medium provided by the invention have the following advantages: the location service method provided by the invention comprises the following steps: step S100: inquiring whether the information of the Geohash coding area where the longitude and latitude coordinates are located is stored in a location service cache according to the received longitude and latitude coordinates, and if not, executing S200; if yes, executing S300; the information of the Geohash coding region comprises contour information of the Geohash coding region and all position information in the Geohash coding region; step S200: according to the longitude and latitude coordinates and preset precision, obtaining a Geohash coding area where the longitude and latitude coordinates are located; calling a third-party location service system to acquire all location information in the Geohash coding region according to the contour information of the Geohash coding region, and storing the contour information of the Geohash coding region and all the location information in the Geohash coding region into the location service cache; step S300: acquiring target position information corresponding to the longitude and latitude coordinates according to the longitude and latitude coordinates and all position information in the Geohash coding region; and outputs the target position information. With the configuration, the position service method provided by the invention stores the position information acquired through the third-party position service by using the position service cache, can obviously reduce the call volume of a third-party position service system, saves the cost, and is particularly suitable for acquiring the position information of the non-road mobile mechanical mobile equipment.
Further, in the location service method provided by the invention, the location service cache stores the location information in a hierarchical storage manner, which is more beneficial to acquiring corresponding province information, city information and information of a Geohash coding region according to the longitude and latitude coordinates and then acquiring target location information corresponding to the longitude and latitude coordinates, and the location information corresponding to the longitude and latitude coordinates is acquired in a manner of gradually narrowing an inquiry range from a large range to a small range, so that the acquisition efficiency of the location information can be obviously improved.
Furthermore, when position information has to be acquired through a third-party position service, the position service method provided by the invention converts the received longitude and latitude coordinates into a Geohash coding area through a Geohash technology; and all position information in the Geohash coding region can be acquired through a PostGIS technology, so that the research and development cost and the time cost can be obviously saved.
The location service system, the electronic device and the storage medium provided by the invention belong to the same inventive concept as the location service method provided by the invention, so the location service system, the electronic device and the storage medium have at least the same beneficial effects and are not repeated.
Drawings
Fig. 1 is a schematic overall flowchart of a location service method according to one embodiment of the present invention;
FIG. 2 is a detailed flowchart of step S100 provided in one embodiment of FIG. 1;
FIG. 3 is a detailed flowchart of step S200 provided in one embodiment of FIG. 1;
FIG. 4 is a schematic diagram of the basic principle of Geohash encoding to divide the earth into four regions;
FIG. 5 is a diagram of recursive partitioning within a small range of the basic principle of Geohash encoding;
FIG. 6 is a detailed flowchart of step S300 provided in one embodiment of FIG. 1;
FIG. 7 is a schematic diagram illustrating comparison of the amount of third party location service calls before and after the location service method provided by the present invention is applied;
fig. 8 is a schematic structural diagram of a location service system according to a second embodiment of the present invention;
fig. 9 is a schematic block diagram of an electronic device according to a third embodiment of the present invention.
Wherein the reference numbers are as follows:
110-first acquisition unit of position information, 120-second acquisition unit of position information, 130-third acquisition unit of position information;
210-processor, 220-communication interface, 230-memory, 240-communication bus.
Detailed Description
The location service method, system, electronic device and storage medium according to the present invention will be described in further detail with reference to the accompanying drawings. The advantages and features of the present invention will become more apparent from the following description. It is to be noted that the drawings are in a very simplified form and are all used in a non-precise scale for the purpose of facilitating and distinctly aiding in the description of the embodiments of the present invention. To make the objects, features and advantages of the present invention comprehensible, reference is made to the accompanying drawings. It should be understood that the structures, proportions, sizes, and other elements shown in the drawings and described herein are illustrative only and are not intended to limit the scope of the invention, which is to be given the full breadth of the appended claims and any and all modifications, equivalents, and alternatives to those skilled in the art should be construed as falling within the spirit and scope of the invention.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The core idea of the invention is to solve the problems of strong dependence on a third-party location service provider and higher cost when acquiring the location information of the non-road mobile mechanical equipment in the prior art.
In order to realize the above idea, the inventor of the present invention finds out through continuous and intensive practice and extensive research: the non-road mobile mechanical equipment has smaller change of the position moving range than the road mechanical equipment, and a plurality of mechanical equipment move in the same area, so that the position information repetition rate is high, and the correlation is larger. Based on the above research, the inventor of the present invention has creatively proposed a location service method, system, electronic device, and storage medium, and the present invention can significantly reduce the call volume for third-party location services and save the cost.
It should be particularly noted that, as will be understood by those skilled in the art, the location service method provided by the present invention is more suitable for acquiring the location information of the non-road mobile machinery, but it is obvious that the present invention is not limited thereto, and is also suitable for non-road mobile machinery and road mobile machinery.
The location service method, system, electronic device and storage medium provided by the present invention are described in detail below.
Example one
The embodiment provides a location service method. Specifically, please refer to fig. 1, which schematically shows an overall flow chart of the location service method according to an embodiment of the present invention. As can be seen from fig. 1, the location service method provided by this embodiment includes the following steps:
s100: inquiring whether the information of the Geohash coding area where the longitude and latitude coordinates are located is stored in a location service cache according to the received longitude and latitude coordinates, and if not, executing S200; if yes, executing S300; the information of the Geohash coding region comprises contour information of the Geohash coding region and all position information in the Geohash coding region;
s200: according to the longitude and latitude coordinates and preset precision, obtaining a Geohash coding area where the longitude and latitude coordinates are located; calling a third-party location service system to acquire all location information in the Geohash coding region according to the contour information of the Geohash coding region, and storing the contour information of the Geohash coding region and all the location information in the Geohash coding region into the location service cache;
s300: acquiring target position information corresponding to the longitude and latitude coordinates according to the longitude and latitude coordinates and all position information in the Geohash coding region; and outputs the target position information.
With such a configuration, the location service method provided by the embodiment stores the location information acquired through the third-party location service by using the location service cache, so that the call volume of the third-party location service system can be significantly reduced, the cost is saved, and the method is particularly suitable for acquiring the location information of the non-road mobile mechanical mobile device.
It should be noted that, unless otherwise specified, the received longitude and latitude coordinates and the longitude and latitude coordinates are both the longitude and latitude coordinates of the non-road mobile mechanical device that needs to acquire the location information.
Preferably, in one exemplary implementation, in step S100, the location service cache stores the information of the Geohash coding region in a hierarchical manner, where the hierarchical manner includes:
storing province information as a first level, wherein each province information comprises the name of the province, an identification code (namely the code of the province), the coordinates of a province center point and the latitude and longitude coordinates of a province boundary (namely the province boundary information);
storing city information as a second level, wherein each city information comprises the name and identification code of the city (namely the code of the city), the province identification code of the city, the coordinate of the center point of the city and the longitude and latitude coordinates of the boundary of the city (namely the information of the boundary of the city);
storing the information of the Geohash coding regions as a third level, wherein the information of each Geohash coding region comprises contour information corresponding to the Geohash coding and an identification code list of all position information in the Geohash coding region;
and storing the position information as a third level, wherein each position information comprises an identification code, longitude and latitude coordinates, a name of a city where the position information is located, a political area where the position information is located, a town where the position information belongs and address information of the position information.
With such configuration, in the location service method provided by this embodiment, the location service cache stores the location information in a hierarchical storage manner, which is more beneficial to obtain corresponding province information, city information, and information of a Geohash coding region according to the longitude and latitude coordinates and then obtain target location information corresponding to the longitude and latitude coordinates, and the location information corresponding to the longitude and latitude coordinates is obtained in a manner of gradually narrowing an inquiry range from a large range to a small range, so that the obtaining efficiency of the location information can be significantly improved.
It should be noted that, as will be understood by those skilled in the art, the location information is POI (Point of Interest) information, and a POI includes, but is not limited to, a house, a shop, a mailbox, a bus station, and the like. In addition, the data types in the following table i, table ii, table iii and table iv are all the data types of PostGIS, and the contents of PostGIS are explained in detail below and are not expanded here for the sake of avoiding redundant description.
Specifically, please refer to table one, which schematically shows the details of the province information provided by an embodiment:
information of table one, province
Name (R) Data type Remarks for note
Id bigint
province text Name of province
ad_code text Provincial identification code
center geometry(Point) Center point
polygon geometry(MultiPolygon) Provincial boundary information
Further, please refer to table two, which schematically shows the specific content of the city information provided by an embodiment:
information of second and city
Name (R) Data type Remarks to note
Id bigint
city_name text Name of city
city_code text City identification code
province text Province id
center geometry(Point) Center point
polygon geometry(MultiPolygon) City boundary information
Further, please refer to table three, which schematically shows the specific content of the information of the Geohash coding region (i.e. the historical Geohash coding region of the non-road mobile mechanical device) provided by an embodiment:
table three, information of Geohash coding region
Name(s) Data type Remarks for note
polygon geometry(Polygon) Geohash encoded rectangular boundaries
ref_city_id geometry(MultiPolygon) Id reference to City poi Point Table
Still further, please refer to table four, which schematically shows the specific content of the location information provided by an embodiment:
TABLE IV, location (POI) information
Name (R) Data type Remarks for note
Id bigint
city text Name of city
geo geometry(Point) Longitude and latitude point
district text Zone(s)
township text Town and town
address text Address
As will be understood by those skilled in the art, the id in the above table one, table two, table three, and table four is an identification of each piece of information in the location service cache.
Preferably, in an exemplary implementation manner, referring to fig. 2, a detailed flowchart of step S100 is schematically shown, and as can be seen from fig. 2, step S100 queries, according to the received longitude and latitude coordinates, whether information of a Geohash coding area where the longitude and latitude coordinates are located is already stored in a location service cache, where the information includes:
s110: acquiring a province identification code of the longitude and latitude coordinate by adopting a PostGIS according to the longitude and latitude coordinate and a province boundary longitude and latitude coordinate of the province information in the location service cache;
s120: acquiring the longitude and latitude coordinates of the city boundary where the longitude and latitude coordinates are located by adopting a PostGIS according to the longitude and latitude coordinates, the province identification codes and the city information in the location service cache;
s130: and inquiring whether the Geohash coding area information where the longitude and latitude coordinates are located is stored in a location service cache or not according to the longitude and latitude coordinates, the city boundary longitude and latitude coordinates and the Geohash coding area information.
With the configuration, the location service method provided by the invention firstly acquires the corresponding province information, city information and information of the Geohash coding region according to the longitude and latitude coordinates, and then acquires the target location information corresponding to the longitude and latitude coordinates, and the location information corresponding to the longitude and latitude coordinates is acquired in a manner of gradually narrowing the query range from a large range to a small range, so that the acquisition efficiency of the location information can be obviously improved.
In order to facilitate understanding of the present invention, the PostGIS is briefly described, and then the steps S110, S120, and S130 are described in detail in the form of pseudo codes based on the above table one, table two, table three, and table four.
As will be understood by those skilled in the art, PostGIS is an extension of the object relational database system PostgreSQL, which provides the following spatial information service functions: spatial objects, spatial indices, spatial operation functions, and spatial operators. Meanwhile, the PostGIS follows the specification of the OpenGIS, so that the position service method provided by the invention can obviously save research and development cost and time cost by utilizing the existing space object and space operation function of the PostGIS.
Specifically, in one exemplary implementation, the step S110 obtains the province identification code where the longitude and latitude coordinates are located, and the examples of the province identification code are as follows:
select id, province, ad_code
from public.province_polygon
where st_within(ST_MakePoint(-0.63098, 51.18291), polygon)
limit 1
in the above-described example of the present invention,(-0.63098, 51.18291)for the received latitude and longitude coordinates, the latitude and longitude coordinates are,where st_ withinfor postGIS space operation function to judge whether the longitude and latitude coordinates are in the provincepolygon(provincial boundary information, contour boundary) range.
Therefore, by acquiring the province information of the longitude and latitude coordinates, the search range can be greatly reduced, and the query efficiency is improved.
More specifically, in one exemplary implementation manner, the step S120 obtains an example code of the city identification code where the longitude and latitude coordinates are located as follows:
from public.city_polygon
where st_within(ST_MakePoint(-0.63098, 51.18291), polygon)
limit 1
in the above-mentioned code, the code is,(-0.63098, 51.18291)for the received latitude and longitude coordinates, the latitude and longitude coordinates are,where st_ withinis a space operation function of PostGIS to judge whether the longitude and latitude coordinates are in the citypolygon(city boundary information, contour boundary) range.
Therefore, after acquiring the province information of the longitude and latitude coordinates, the city information of the longitude and latitude is further acquired, the search range can be further reduced, and the query efficiency is improved.
Similarly, in one exemplary implementation, the example code of the step S130 inquiring whether the information of the Geohash coding region where the longitude and latitude coordinates are located is already stored in the location service cache is as follows:
select
ref_city_id
from public.history_geo_point
where st_within(ST_MakePoint(-0.63098, 51.18291), polygon)
limit 1
in the above-mentioned code, the code is,(-0.63098, 51.18291)for the received latitude and longitude coordinates, the latitude and longitude coordinates are,where st_ withinfor the space operation function of PostGIS to judge whether the longitude and latitude coordinates are in the Geohash coding regionpolygon(boundary region) range.
Preferably, in one exemplary implementation, the province information and the city information are acquired through a third-party location service system.
It is specifically noted that, as will be appreciated by those skilled in the art, the present invention is not limited in any way to third party location service providers, including but not limited to, grand, hundredths, etc.
Preferably, in an exemplary implementation, referring to fig. 3, a specific flowchart of the step S200 is schematically shown, where the Geohash coding region where the longitude and latitude coordinates are located is obtained according to the longitude and latitude coordinates and according to a preset precision, and as can be seen from fig. 3, obtaining the Geohash coding region where the longitude and latitude coordinates are located includes the following steps:
s210: converting the longitude and latitude coordinates into a Geohash code according to the preset precision;
s220: acquiring a rectangular area corresponding to the Geohash code, and taking the rectangular area as the Geohash code area where the longitude and latitude coordinate information is located;
s230: and acquiring longitude and latitude coordinates of four vertexes of the Geohash coding region according to the Geohash coding of the rectangular region.
With such configuration, the location service method provided by this embodiment, based on the GeoHash technology, not only lays a foundation for further using the space query technology of PostGIS according to the GeoHash coding region where the longitude and latitude coordinates are located, but also provides theoretical and practical bases for hierarchical storage of location service caches and non-coincidence of location information in each GeoHash coding region.
For ease of understanding, the basic principles of the Geohash encoding are briefly described below:
the GeoHash is an address coding method, and the method can code two-dimensional space longitude and latitude data into a character string. As will be understood by those skilled in the art, the longitude ranges from 180 degrees east longitude to 180 degrees west longitude, the latitude ranges from 90 degrees south latitude to 90 degrees north latitude, the west longitude is set negative, the south latitude is set negative, so the longitude ranges on earth are-180 °, and the latitude ranges are-90 °, 90 °. The earth can be divided into 4 parts if bounded by the meridian and equator of this initial meridian. Referring to fig. 4, a schematic diagram of the basic principle of Geohash coding to divide the earth into four regions is schematically shown. As can be seen from fig. 4, if the latitude range of-90 °, 0 ° is represented by binary 0, (0 °, 90 ° ] is represented by binary 1, the longitude range of-180 °, 0 ° is represented by binary 0, (0 °, 180 ° ] is represented by binary 1, the earth can be divided into 4 parts of 00, 01, 10, 11. Referring to fig. 5, a schematic diagram of the small-scale recursive partitioning of the basic principle of Geohash coding is schematically shown. As can be seen from fig. 5, recursive halving within each small partition range can partition more partitions, and the more partitions, the smaller the area of the region, and the more accurate it is.
Next, a process of converting the longitude and latitude coordinates into the Geohash code is briefly described by taking the longitude and latitude coordinates (116.389550, 39.928167) as an example as follows:
firstly, the latitude 39.928167 is approximatively coded, and according to the basic principle of the Geohash coding, the earth latitude interval is [ -90 degrees and 90 degrees ], the interval [ -90 degrees and 90 degrees ] is divided into two intervals of [ -90 degrees and 0 degrees and [0 degrees and 90 degrees ], namely left and right intervals, so that the 39.928167 can be determined to belong to the right interval [0 degrees and 90 degrees ], and the mark is 1; then, the interval [0 degrees and 90 degrees ] is divided into two intervals [0 degrees and 45 degrees ], [45 degrees and 90 degrees ], and 39.928167 can be determined to belong to the left interval [0 degrees and 45 degrees ], and the left interval is marked as 0; by analogy, if a given latitude x (39.928167) belongs to the left interval, a 0 is recorded, if it belongs to the right interval, a 1 is recorded, and the above process 39.928167 recurs continuously and always belongs to a certain interval [ a °, b ° ], and the interval [ a °, b ° ] is always reduced with each iteration and approaches 39.9281674 more and more. The length of the sequence is related to the number of partitions of a given interval. As shown in table five below:
table five: the Geohash code for latitude 39.928167 represents an example:
latitude range Partition area 0 Dividing compartment 1 39.928167
1 (-90°,90°) (-90°,0.0°) (0.0°,90°) 1
2 (0.0°,90°) (0.0°,45.0°) (45.0°,90°) 0
3 (0.0°,45.0°) (0.0°,22.5°) (22.5°,45.0°) 1
4 (22.5°,45.0°) (22.5°,33.75°) (33.75°,45.0°) 1
5 (33.75°,45.0°) (33.75°,39.375°) (39.375°,45.0°) 1
6 (39.375°,45.0°) (39.375°,42.1875°) (42.1875°,45.0°) 0
7 (39.375°,42.1875°) (39.375°,40.7812°) (40.7812°,42.1875°) 0
8 (39.375°,40.7812°) (39.375°,40.0781°) (40.0781°,40.7812°) 0
9 (39.375°,40.0781°) (39.375°,39.7265°) (39.7265°,40.0781°) 1
10 (39.7265°,40.0781°) (39.7265°,39.9023°) (39.9023°,40.0781°) 1
11 (39.9023°,40.0781°) (39.9023°,39.9902°) (39.9902°,40.0781°) 0
12 (39.9023°,39.9902°) (39.9023°,39.9462°) (39.9462°,39.9902°) 0
13 (39.9023°,39.9462°) (39.9023°,39.9243°) (39.9243°,39.9462°) 1
14 (39.9243°,39.9462°) (39.9243°,39.9353°) (39.9353°,39.9462°) 0
15 (39.9243°,39.9353°) (39.9243°,39.9408°) (39.9408°,39.9353°) 0
Similarly, according to the basic principle of Geohash coding, the longitude 116.389550 is coded when the earth longitude interval is [ -180 °, 180 ° ], and through the above calculation, the Geohash code corresponding to the longitude 116.389550 is: 110100101100010, respectively; the Geohash code corresponding to the latitude 39.928167 is: 101110001100100. and finally, combining the Geohash codes corresponding to the longitude and the latitude, setting the longitude at the even number position and setting the latitude at the odd number position, and combining the two strings of codes as shown in the following table six:
table six: and (3) encoding after merging of longitude and latitude Geohash codes (longitude is shown in even number and latitude is shown in odd number):
encoding 1 1 1 0 0 1 1 1 0 1 0 0 1 0 0
Serial number 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Continuing the table six:
encoding 0 1 1 1 1 0 0 0 0 0 1 1 0 0 0
Serial number 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
Thus, the latitude and longitude coordinates can be converted into a Geohash coding region by the Geohash technique, in other words: the Geohash code corresponding to the longitude and latitude coordinates represents not a point but a rectangular area. The process of Geohash encoding and decoding is the inverse process of the above encoding process, and those skilled in the art should be able to deduce the above disclosure, and therefore, the details are not repeated herein.
Specifically, the following is an example code segment for converting longitude and latitude coordinates into a Geohash code and then into rectangular longitude and latitude coordinates by taking a library provided by Java as an example:
<dependency>
<groupId>ch.hsr</groupId>
<artifactId>geohash</artifactId>
<version>1.4.0</version>
</dependency>
v/converting latitude and longitude to geohash
GeoHash = GeoHash with CharacterPrecision (longitude, latitude, 7);/7 table Indicating accuracy, the larger the value, the more accurate
BoundingBox boundingBox = geoHash.getBoundingBox();
Angle of southwest
WGS84Point southWestCorner = boundingBox.getSouthWestCorner();
// southeast corner
WGS84Point southEastCorner = boundingBox.getSouthEastCorner();
// northeast corner
WGS84Point northEastCorner = boundingBox.getNorthEastCorner();
// northwest corner
WGS84Point northWestCorner = boundingBox.getNorthWestCorner();
Preferably, in one exemplary implementation, please refer to fig. 6, which schematically shows a detailed flowchart of step S300 provided in one exemplary implementation. As can be seen from fig. 6, in step S300, according to the longitude and latitude coordinates and all the location information in the Geohash coding region, the target location information corresponding to the longitude and latitude coordinates is obtained, which includes:
s310: acquiring longitude and latitude coordinates of the position information corresponding to the identification code according to the identification code of each position information in the information of the Geohash coding area and the position information in the position service cache;
s320: acquiring an identification code of the position information with the minimum distance with the longitude and latitude coordinates as an identification code of a target position corresponding to the longitude and latitude coordinates according to the longitude and latitude coordinates and the longitude and latitude coordinates of each position information;
s330: and acquiring the target position information corresponding to the longitude and latitude coordinates according to the identification code of the target position and the position information in the position service cache.
With the configuration, the position service method provided by the invention stores the position information through the Geohash code and the position service cache, avoids frequently calling a third-party position service, improves the efficiency of position information query, and can obviously reduce the cost.
In one exemplary implementation, in step S300, according to the longitude and latitude coordinates and all location information in the Geohash coding region, an example code of the target location information corresponding to the longitude and latitude coordinates is obtained as follows:
select
st_x(geo) as longitude,
st_y(geo) as latitude,
district,
township,
address,
st_distancesphere(ST_MakePoint(-0.63098, 51.18291),geo)
as distance
from public.city_geo_point
where id in (ref_city_id) order by geo <-> ST_MakePoint(-0.63098, 51.18291)
limit 1
preferably, in one exemplary implementation, step S300 outputs the target position information, including: and the target position information is output in the modes of country, province, city, administrative district, town and name. Such as output: for the received latitude and longitude coordinates:116.41457000919418,37.435764650093574,the returned position information is: the east medical center of deqiao town of dezhou city of dezhou, Shandong, China (in construction).
In one exemplary embodiment, the location service method provided by the present invention provides services to the outside using a rest style, and the service interfaces are exemplified as follows:
1. GET request:
http://127.0.0.1:9977/v3/geocode/regeo
2. parameter examples:
location: 116.41457000919418,37.435764650093574
3. response example
<response>
<status>1</status>
<info>ok</info>
<regeocode>
<addressComponent>
<city>City of Texas</city>
<province>Shandong province</province>
<district>De city area</district>
<country>China</country>
<township>Yuan Qiao Zhen</township>
<citycode>0534</citycode>
</addressComponent>
<formatted_address>Dong Yi of Yuan bridge Zhen of Denzhou city of Texas province in China Therapy center (construction middle)</formatted_address>
</regeocode>
<infocode>10000</infocode>
</response>
It should be particularly noted that, as will be understood by those skilled in the art, all codes in this document are only exemplary descriptions and are not limitations of the present invention, and the location service method provided by the present invention does not impose any requirements or limitations on the computer language used in the implementation.
Referring to fig. 7, a schematic diagram of comparison between the call volume of the third party location service before and after applying the location service method provided by the present invention is schematically shown. As can be seen from fig. 7, the location service method provided by the present invention can exponentially reduce the amount of third-party location service calls under the same conditions, thereby greatly reducing the cost.
In summary, the location service method provided by the invention stores the location information acquired through the third-party location service by using the location service cache, can significantly reduce the call volume to the third-party location service system, saves the cost, and is particularly suitable for acquiring the location information of the non-road mobile mechanical mobile device.
Example two
The embodiment provides a location service system. Specifically, please refer to fig. 8, which schematically shows a structural diagram of the location service system provided in the present embodiment. As can be seen from fig. 8, the location service system includes a location information first acquisition unit 110, a location information second acquisition unit 120, and a location information third acquisition unit 130.
Specifically, the first location information obtaining unit 110 is configured to query, according to the received longitude and latitude coordinates, whether information of a Geohash coding region where the longitude and latitude coordinates are located is stored in a location service cache, and if not, obtain, by the second location information obtaining unit, target location information corresponding to the longitude and latitude coordinates; if yes, acquiring target position information corresponding to the longitude and latitude coordinates through the position information third acquisition unit; the information of the Geohash coding region comprises contour information of the Geohash coding region and all position information in the Geohash coding region. The second location information acquiring unit 120 is configured to obtain, according to the longitude and latitude coordinates and according to a preset precision, a Geohash coding region where the longitude and latitude coordinates are located; and calling a third-party location service system to acquire all location information in the Geohash coding region according to the contour information of the Geohash coding region, storing the contour information of the Geohash coding region and all the location information in the Geohash coding region into the location service cache, and acquiring target location information corresponding to the longitude and latitude coordinates through a third location information acquisition unit. The third location information acquiring unit 130 acquires target location information corresponding to the longitude and latitude coordinates according to the longitude and latitude coordinates and all location information in the Geohash coding region; and outputs the target position information.
Since the basic principle of the location service system provided in this embodiment is the same as that of the location service method provided in the first embodiment, for avoiding redundancy, the description is relatively rough, and for more details, refer to the related description of the first embodiment. Further, since the location service system provided by the present embodiment and the location service method provided by the first embodiment belong to the same inventive concept, the same advantageous effects as the location service method are obtained: the location service system provided by the embodiment stores the location information acquired through the third-party location service by using the location service cache, can remarkably reduce the call volume of the third-party location service system, saves the cost, and is particularly suitable for acquiring the location information of the non-road mobile mechanical mobile equipment.
EXAMPLE III
Based on the same inventive concept, the present invention further provides an electronic device, please refer to fig. 9, which schematically shows a block structure diagram of the electronic device according to an embodiment of the present invention. As shown in fig. 9, the electronic device comprises a processor 210 and a memory 230, wherein the memory 230 stores a computer program, and the computer program realizes the location service method described above when being executed by the processor 210.
As shown in fig. 9, the electronic device further includes a communication interface 220 and a communication bus 240, wherein the processor 210, the communication interface 220, and the memory 230 are communicated with each other via the communication bus 240. The communication bus 240 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus 240 may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this is not intended to represent only one bus or type of bus. The communication interface 220 is used for communication between the electronic device and other devices.
The Processor 210 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like, and the processor 210 is the control center of the electronic device and connects the various parts of the whole electronic device by various interfaces and lines.
The memory 230 may be used for storing the computer program, and the processor 210 implements various functions of the electronic device by running or executing the computer program stored in the memory 230 and calling data stored in the memory 230.
The memory 230 may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
Since the electronic device provided in this embodiment and the location service method provided in the first embodiment belong to the same inventive concept, the electronic device has the same beneficial effects as the location service method, and for avoiding redundancy, description thereof is omitted.
Example four
The present embodiment provides a readable storage medium having stored therein a computer program which, when executed by a processor, may implement the location service method described above.
The readable storage media of embodiments of the invention may take any combination of one or more computer-readable media. The 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 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 this context, 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 many 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.
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 + +, 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 summary, compared with the prior art, the location service method, the location service system, the electronic device and the storage medium provided by the invention have the following advantages: the position service method provided by the invention stores the position information acquired through the third-party position service by utilizing the position service cache, can obviously reduce the call amount of a third-party position service system, saves the cost, and is particularly suitable for acquiring the position information of non-road mobile mechanical mobile equipment. Further, in the location service method provided by the invention, the location service cache stores the location information in a hierarchical storage manner, which is more beneficial to acquiring corresponding province information, city information and information of a Geohash coding region according to the longitude and latitude coordinates and then acquiring target location information corresponding to the longitude and latitude coordinates, and the location information corresponding to the longitude and latitude coordinates is acquired in a manner of gradually narrowing an inquiry range from a large range to a small range, so that the acquisition efficiency of the location information can be obviously improved. Furthermore, when position information has to be acquired through a third-party position service, the position service method provided by the invention converts the received longitude and latitude coordinates into a Geohash coding area through a Geohash technology; and all position information in the Geohash coding region can be acquired through a PostGIS technology, so that the research and development cost and the time cost can be obviously saved. The location service system, the electronic device and the storage medium provided by the invention belong to the same inventive concept as the location service method provided by the invention, so the location service system, the electronic device and the storage medium have at least the same beneficial effects and are not repeated.
It should be noted that the apparatuses and methods disclosed in the embodiments herein may be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of management systems, methods and computer program products according to various embodiments herein. In this regard, each block in the flowchart or block diagrams may represent a module, a program, or a portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments herein may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The above description is only for the purpose of describing the preferred embodiments of the present invention, and is not intended to limit the scope of the present invention, and any variations and modifications made by those skilled in the art based on the above disclosure are within the scope of the present invention. It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, it is intended that the present invention also include such modifications and variations as come within the scope of the invention and their equivalents.

Claims (10)

1. A location service method, comprising:
s100: inquiring whether the information of the Geohash coding area where the longitude and latitude coordinates are located is stored in a location service cache according to the received longitude and latitude coordinates, and if not, executing S200; if yes, executing S300; the information of the Geohash coding region comprises contour information of the Geohash coding region and all position information in the Geohash coding region;
s200: according to the longitude and latitude coordinates and preset precision, obtaining a Geohash coding area where the longitude and latitude coordinates are located; calling a third-party location service system to acquire all location information in the Geohash coding region according to the contour information of the Geohash coding region, and storing the contour information of the Geohash coding region and all the location information in the Geohash coding region into the location service cache;
s300: acquiring target position information corresponding to the longitude and latitude coordinates according to the longitude and latitude coordinates and all position information in the Geohash coding region; and outputs the target position information.
2. The location service method according to claim 1, wherein the location service cache stores the information of the Geohash coding region in a hierarchical manner, the hierarchical manner comprising:
storing province information as a first level, wherein each province information comprises a name, an identification code, a province central point coordinate and a province boundary longitude and latitude coordinate of the province;
storing city information as a second level, wherein each city information comprises a name, an identification code, a province identification code, a city center point coordinate and a city boundary longitude and latitude coordinate of the city;
storing the information of the Geohash coding regions as a third level, wherein the information of each Geohash coding region comprises contour information corresponding to the Geohash coding and an identification code list of all position information in the Geohash coding region;
and storing the position information as a third level, wherein each position information comprises an identification code, longitude and latitude coordinates, a name of a city where the position information is located, a political area where the position information is located, a town where the position information belongs and address information of the position information.
3. The location service method according to claim 2, wherein the step S100 of querying whether the information of the Geohash coding region where the longitude and latitude coordinates are located is stored in the location service cache according to the received longitude and latitude coordinates comprises:
acquiring a province identification code of the longitude and latitude coordinate by adopting a PostGIS according to the longitude and latitude coordinate and a province boundary longitude and latitude coordinate of the province information in the location service cache;
acquiring the longitude and latitude coordinates of the city boundary where the longitude and latitude coordinates are located by adopting a PostGIS according to the longitude and latitude coordinates, the province identification codes and the city information in the location service cache;
and inquiring whether the Geohash coding area information where the longitude and latitude coordinates are located is stored in a location service cache or not according to the longitude and latitude coordinates, the city boundary longitude and latitude coordinates and the Geohash coding area information.
4. The location service method of claim 2, wherein the province information and the city information are acquired through a third party location service system.
5. The location service method according to claim 1, wherein the step S200 of obtaining, according to the longitude and latitude coordinates and according to a preset precision, a Geohash coding region where the longitude and latitude coordinates are located includes:
converting the longitude and latitude coordinates into a Geohash code according to the preset precision;
acquiring a rectangular area corresponding to the Geohash code, and taking the rectangular area as the Geohash code area where the longitude and latitude coordinate information is located;
and acquiring longitude and latitude coordinates of four vertexes of the Geohash coding region according to the Geohash coding of the rectangular region.
6. The location service method according to claim 1, wherein the step S300 obtains the target location information corresponding to the longitude and latitude coordinates according to the longitude and latitude coordinates and all location information in the Geohash coding region, and includes:
acquiring longitude and latitude coordinates of the position information corresponding to the identification code according to the identification code of each position information in the information of the Geohash coding area and the position information in the position service cache;
acquiring an identification code of the position information with the minimum distance with the longitude and latitude coordinates as an identification code of a target position corresponding to the longitude and latitude coordinates according to the longitude and latitude coordinates and the longitude and latitude coordinates of each position information;
and acquiring the target position information corresponding to the longitude and latitude coordinates according to the identification code of the target position and the position information in the position service cache.
7. The location service method according to claim 1, wherein the step S300 outputs the target location information, comprising:
and the target position information is output in the modes of country, province, city, administrative district, town and name.
8. A location service system for implementing the location service method of claim 1, comprising a first location information acquisition unit, a second location information acquisition unit, and a third location information acquisition unit, wherein:
the first location information acquiring unit is configured to inquire whether information of a Geohash coding area where the longitude and latitude coordinates are located is stored in a location service cache according to the received longitude and latitude coordinates, and if not, the second location information acquiring unit acquires target location information corresponding to the longitude and latitude coordinates; if yes, acquiring target position information corresponding to the longitude and latitude coordinates through the position information third acquisition unit; the information of the Geohash coding region comprises contour information of the Geohash coding region and all position information in the Geohash coding region;
the position information second acquisition unit is configured to obtain a Geohash coding area where the longitude and latitude coordinates are located according to the longitude and latitude coordinates and preset precision; calling a third-party location service system to acquire all location information in the Geohash coding region according to the contour information of the Geohash coding region, storing the contour information of the Geohash coding region and all the location information in the Geohash coding region into the location service cache, and acquiring target location information corresponding to the longitude and latitude coordinates through a third location information acquisition unit;
the position information third acquisition unit is configured to acquire target position information corresponding to the longitude and latitude coordinates according to the longitude and latitude coordinates and all position information in the Geohash coding region; and outputs the target position information.
9. An electronic device, comprising a processor and a memory, the memory having stored thereon a computer program which, when executed by the processor, implements the location service method of any one of claims 1 to 7.
10. A readable storage medium, in which a computer program is stored which, when executed by a processor, implements the location service method of any one of claims 1 to 7.
CN202210797281.2A 2022-07-08 2022-07-08 Location service method, system, electronic device and storage medium Active CN114880421B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210797281.2A CN114880421B (en) 2022-07-08 2022-07-08 Location service method, system, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210797281.2A CN114880421B (en) 2022-07-08 2022-07-08 Location service method, system, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN114880421A true CN114880421A (en) 2022-08-09
CN114880421B CN114880421B (en) 2022-10-18

Family

ID=82682922

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210797281.2A Active CN114880421B (en) 2022-07-08 2022-07-08 Location service method, system, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN114880421B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117251486A (en) * 2023-11-10 2023-12-19 广州斯沃德科技有限公司 Information processing method and device based on GeoHash coding
CN117312471A (en) * 2023-09-26 2023-12-29 中国人民解放军91977 部队 Sea-land attribute judging method and device for massive position points

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120226889A1 (en) * 2011-03-01 2012-09-06 Dwight Merriman System and method for determining exact location results using hash encoding of multi-dimensioned data
CN103530330A (en) * 2013-09-29 2014-01-22 天泽信息产业股份有限公司 Processing method of reverse geocoding processing system
CN106708833A (en) * 2015-08-03 2017-05-24 腾讯科技(深圳)有限公司 Position information-based data obtaining method and apparatus
CN111666508A (en) * 2020-06-02 2020-09-15 厦门卫星定位应用股份有限公司 Method and device for extracting detailed addresses corresponding to longitude and latitude
CN112486987A (en) * 2020-11-27 2021-03-12 北京三快在线科技有限公司 City inquiry method, device, equipment and storage medium based on longitude and latitude
CN112948674A (en) * 2021-02-26 2021-06-11 平安科技(深圳)有限公司 Redis-based intelligent push service method and device and computer equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120226889A1 (en) * 2011-03-01 2012-09-06 Dwight Merriman System and method for determining exact location results using hash encoding of multi-dimensioned data
CN103530330A (en) * 2013-09-29 2014-01-22 天泽信息产业股份有限公司 Processing method of reverse geocoding processing system
CN106708833A (en) * 2015-08-03 2017-05-24 腾讯科技(深圳)有限公司 Position information-based data obtaining method and apparatus
CN111666508A (en) * 2020-06-02 2020-09-15 厦门卫星定位应用股份有限公司 Method and device for extracting detailed addresses corresponding to longitude and latitude
CN112486987A (en) * 2020-11-27 2021-03-12 北京三快在线科技有限公司 City inquiry method, device, equipment and storage medium based on longitude and latitude
CN112948674A (en) * 2021-02-26 2021-06-11 平安科技(深圳)有限公司 Redis-based intelligent push service method and device and computer equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117312471A (en) * 2023-09-26 2023-12-29 中国人民解放军91977 部队 Sea-land attribute judging method and device for massive position points
CN117312471B (en) * 2023-09-26 2024-05-28 中国人民解放军91977部队 Sea-land attribute judging method and device for massive position points
CN117251486A (en) * 2023-11-10 2023-12-19 广州斯沃德科技有限公司 Information processing method and device based on GeoHash coding
CN117251486B (en) * 2023-11-10 2024-03-15 广州斯沃德科技有限公司 Information processing method and device based on GeoHash coding

Also Published As

Publication number Publication date
CN114880421B (en) 2022-10-18

Similar Documents

Publication Publication Date Title
CN114880421B (en) Location service method, system, electronic device and storage medium
US9719790B2 (en) Mapping uncertain geometries to graticules
US8949196B2 (en) Systems and methods for matching similar geographic objects
CN106919567B (en) Method and device for processing POI (Point of interest) address
Bakshi et al. Exploiting online sources to accurately geocode addresses
KR100686287B1 (en) Distorting Modeling method for Transforming the Presize Position of Partial/Positional information
CN111026978A (en) Position query method and device, computer equipment and storage medium
US6865479B2 (en) Programmatically calculating paths from a spatially-enabled database
CN112486987A (en) City inquiry method, device, equipment and storage medium based on longitude and latitude
WO2020005594A1 (en) Geocode interpolation
CN110475204B (en) Method, device and equipment for analyzing reverse address of geographic fence
CN111078806B (en) Position query method, device, computer equipment and storage medium
CN113093240A (en) Positioning correction method, device and equipment and computer readable storage medium
CN110995849A (en) Transmission and storage method of vector data position information
CN115858709A (en) Multi-scale spatial data processing method, electronic device and storage medium
CN116303870A (en) Gas flow value mapping method and system for gas pipe network data management
CN114387419B (en) Three-dimensional geographic entity coding method and device based on multi-dimensional space subdivision
CN111506576B (en) Land block coding method and device based on regional quadtree
CN114814802A (en) Positioning method and device
Yu et al. Research on offline reverse geocoding algorithm based on kd tree
CN112445880A (en) Method and device for automatically gridding enterprise data in geographic space and related equipment
CN106568429B (en) Method and device for establishing interest points
CN111818457A (en) Method and device for determining geographic fence, electronic equipment and storage medium
CN114490902B (en) Multi-dimensional space self-adaptive subdivision and coding method and system for two-dimensional geographic entity
CN118093594A (en) POI (Point of interest) acquisition method and device, computer equipment and computer readable 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
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

Address after: Building 1 and 1-3 floors of Building 2 of Jinan Energy Industry Park, No. 1815 Gangyuan 7th Road, High tech Zone, Jinan City, Shandong Province, 250104

Patentee after: Beigu Electronics Co.,Ltd.

Patentee after: Beigu Electronics (Wuxi) Co.,Ltd.

Patentee after: Luogu Technology (Shanghai) Co.,Ltd.

Patentee after: Beigu Electronics Co.,Ltd. Shanghai Branch

Address before: 250104 building 20, zhizaogu, 2966 Chunhui Road, high tech Zone, Jinan City, Shandong Province

Patentee before: NORTH VALLEY ELECTRONICS Co.,Ltd.

Patentee before: Beigu Electronics (Wuxi) Co.,Ltd.

Patentee before: Luogu Technology (Shanghai) Co.,Ltd.

Patentee before: Beigu Electronics Co.,Ltd. Shanghai Branch

CP03 Change of name, title or address