CN110427449B - Method and system for searching geographical location information in embedded equipment - Google Patents

Method and system for searching geographical location information in embedded equipment Download PDF

Info

Publication number
CN110427449B
CN110427449B CN201910721918.8A CN201910721918A CN110427449B CN 110427449 B CN110427449 B CN 110427449B CN 201910721918 A CN201910721918 A CN 201910721918A CN 110427449 B CN110427449 B CN 110427449B
Authority
CN
China
Prior art keywords
data
node
document
database
longitude
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910721918.8A
Other languages
Chinese (zh)
Other versions
CN110427449A (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.)
Shenzhen Apical Technology Co ltd
Original Assignee
Shenzhen Apical 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 Shenzhen Apical Technology Co ltd filed Critical Shenzhen Apical Technology Co ltd
Priority to CN201910721918.8A priority Critical patent/CN110427449B/en
Publication of CN110427449A publication Critical patent/CN110427449A/en
Application granted granted Critical
Publication of CN110427449B publication Critical patent/CN110427449B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01SRADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
    • G01S19/00Satellite radio beacon positioning systems; Determining position, velocity or attitude using signals transmitted by such systems
    • G01S19/38Determining a navigation solution using signals transmitted by a satellite radio beacon positioning system
    • G01S19/39Determining a navigation solution using signals transmitted by a satellite radio beacon positioning system the satellite radio beacon positioning system transmitting time-stamped messages, e.g. GPS [Global Positioning System], GLONASS [Global Orbiting Navigation Satellite System] or GALILEO
    • G01S19/42Determining position
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Remote Sensing (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a method and a system for searching geographic position information in embedded equipment, wherein a computer terminal firstly builds a quadtree database structure according to longitude and latitude coordinates of a first document and then stores the quadtree database structure as a second document, and builds a database after compressing the volume of the second document, and the database built after compressing the volume of the second document only stores effective information and identification bits, so that the database has very small volume, the database can be imported into the embedded equipment with relatively small storage space, the embedded equipment can obtain GPS coordinates of a target position, and geographic position service information around the target position is searched in the database according to the longitude and latitude coordinates of the target position.

Description

Method and system for searching geographic position information in embedded equipment
Technical Field
The invention relates to the field of embedded equipment, in particular to a method and a system for searching geographical location information in the embedded equipment.
Background
The embedded device mainly comprises an embedded processor, related supporting hardware and an embedded system, and is an independent working 'device' integrating software and hardware. The embedded processor mainly comprises a single chip microcomputer or a Microcontroller (MCU). The relevant support hardware includes a display card, a storage medium (ROM, RAM, etc.), a communication device, an IC card or credit card reading device, and the like. An embedded system is different from a general computer processing system, and does not have a storage medium with a large capacity like a hard disk, and a Flash Memory (Flash Memory) is mostly used as the storage medium. For example, an embedded device product has a CPU dominant frequency of 600MHz, a memory of 64MB, a disk of SPI Flash, and a capacity of 32MB.
At present, the ROM of some embedded devices stores a geographic location information database, such as embedded products like GPS navigation, DVR, etc., and the embedded devices can provide information of nearby gas stations, maintenance points, parking lots, etc. in real time according to the current location of the vehicle, and also can provide information of whether the current road section has vehicle speed limitation, illegal photography and shooting, etc. in real time.
At present, a relational database (such as Oracle and mySQL) is mostly adopted for a geographical location information base, but the relational database is mostly used for a server device, the hardware configuration of an embedded device is far lower than that of the server device, and the geographical location information base adopting the relational database is applied to the embedded device, so that the stored geographical location information is very little, the searching speed is very slow, and the geographical location information base adopting the relational database is not suitable for the embedded device. It can be seen that there is a need for a geolocation information repository that enables its application to store more geolocation information on embedded devices.
Thus, there is a need for improvement and development of the prior art.
Disclosure of Invention
In view of the foregoing deficiencies of the prior art, an object of the present invention is to provide a method and a system for searching for geographic location information in an embedded device, which aims to solve the problem in the prior art that the geographic location information database applied to the embedded device can store less geographic location information.
In a first aspect, the present invention provides a method for searching geographic location information in an embedded device, wherein the method includes the steps of:
constructing geographic position information into a database through a quadtree computer data structure in advance;
importing the database into the embedded device;
and acquiring the GPS coordinates of the target position, and searching the geographic position service information around the target position by calling the database.
Further, the step of constructing the geographical location information into the database through the quadtree computer data structure specifically includes:
sequentially reading each line of data in a first document, extracting a longitude coordinate and a latitude coordinate of each line of data in the first document, and establishing a quadtree data structure according to the longitude coordinate and the latitude coordinate;
sequentially reading each node in the quad-tree data structure and storing the node in a second document; one node in the quad tree data structure corresponds to one line of data in the second document, the formats of all lines of data in the second document are the same, and each line of data in the second document comprises a number, a quad tree storage area, geographic position information and a child node of a current node;
and sequentially reading each line of data in the second document, extracting the geographical position information and the child nodes of the current node to form composite data, and constructing a database according to the composite data.
Further, the step of sequentially reading each row of data in the first document, extracting the longitude coordinate and the latitude coordinate of each row of data in the first document, and establishing the quadtree data structure according to the longitude coordinate and the latitude coordinate further includes:
the method comprises the steps of storing a first document in advance, wherein the data format of each line in the first document is the same, and the data of each line in the first document comprises longitude coordinates and latitude coordinates.
Furthermore, the data of each line in the first document further includes geographic location service information, and the geographic location service information includes one or more of a driving direction angle, a speed limit value or a camera type.
Still further, the quadtree data structure includes a root node, non-leaf nodes, and leaf nodes, one of the leaf nodes storing a row of data in the first document.
Furthermore, the step of sequentially reading each row of data in the second document, extracting the geographical location information and the child node of the current node, combining the geographical location information and the child node of the current node into composite data, and generating the database specifically includes:
reading each line of data in the second document in sequence, extracting the geographical position information in each line of data and the child node of the current node, and detecting whether at least one piece of subdata in the geographical position information in each line of data and the child node of the current node is not 0;
if so, combining the geographical position information with the child nodes of the current node to obtain composite data, and setting an identification position;
and constructing a database by using all the obtained composite data.
Further, the step of acquiring the GPS coordinates of the target location and searching for the geographical location information around the target location by calling the database specifically includes:
acquiring a GPS coordinate of a target position to obtain a longitude coordinate and a latitude coordinate of the target position;
and searching the database for composite data corresponding to the longitude coordinate and the latitude coordinate according to the longitude coordinate and the latitude coordinate, and outputting geographic position service information in the composite data.
In a second aspect, the present invention provides a system for searching geographic location information in an embedded device, including a terminal and an embedded device in communication connection with the terminal, where the terminal is configured to construct a database of geographic location information in advance through a quadtree computer data structure, and import the database into the embedded device; the embedded device is used for acquiring the GPS coordinates of the target position and searching the geographic position service information around the target position by calling the database.
Compared with the prior art, the invention provides a method and a system for searching geographic position information in embedded equipment, firstly, a computer terminal constructs a quadtree database structure according to longitude and latitude coordinates of a first document, then stores the quadtree database structure as a second document, and constructs a database after compressing the volume of the second document, and because the database constructed after compressing the volume of the second document only stores effective information and identification bits, the database has very small volume, the database can be imported into embedded equipment with relatively small storage space, the embedded equipment can obtain GPS coordinates of a target position, and geographic position service information around the target position is searched in the database according to the longitude and latitude coordinates of the target position.
Drawings
Fig. 1 is a flowchart of a method for searching geographical location information in an embedded device according to the present invention.
FIG. 2 is a diagram illustrating a portion of line data in a first document according to an embodiment of the present invention.
FIG. 3 is a schematic diagram of a root node for building a quadtree data structure in a computer memory according to an embodiment of the present invention.
Fig. 4 is a schematic diagram of storing an a coordinate point on a root node in an embodiment of the present invention.
Fig. 5 is a schematic diagram of coordinate points A, B stored in a root node according to an embodiment of the present invention.
FIG. 6 is a diagram illustrating a portion of line data in a second document according to an embodiment of the present invention.
Detailed Description
The invention provides a method and a system for searching geographical location information in embedded equipment, and the invention is further described in detail below in order to make the purpose, the technical scheme and the effect of the invention clearer and clearer. It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the invention.
In a first aspect, the present invention provides a method for searching geographic location information in an embedded device, referring to fig. 1, including the following steps:
s10, constructing geographic position information into a database in advance through a quadtree computer data structure;
specifically, a quadtree is a tree-like data structure with four sub-blocks at each node, and is often used for analyzing and classifying two-dimensional spatial data, and it divides the data into four regions, and the data range may be a square or a rectangle or any other arbitrary shape.
In view of the characteristics of the quadtree data structure, the geographic position information can be divided into four areas according to the longitude coordinate and the latitude coordinate, so that the geographic position information database is constructed. Compared with the geographic position information database constructed by adopting a relational database, under the condition of storing the same amount of geographic position information, the size of the geographic position information database constructed by adopting a quadtree data structure is relatively small and is very fast according to longitude and latitude coordinates.
Further, step S10 specifically includes:
s101, storing a first document in advance, wherein the data formats of all lines in the first document are the same, and the data of all lines in the first document comprise longitude coordinates and latitude coordinates;
furthermore, the data of each line in the first document further includes geographic location service information, and the geographic location service information includes one or more of a driving direction angle, a speed limit speed value or a camera type.
Specifically, the first document is a txt or csv file, which can be converted from an excel table, see fig. 2, where there are multiple rows of data (only a few data in the figure) and the data format of each row is the same, each row of data represents a piece of geographic location information, for example, one row of data is 35.660472.76329872 234 20 102 3, when viewed from left to right, the first two data are respectively latitude and longitude coordinates, 234 is the driving direction angle, 20 is the speed limit speed value of driving, and the last two numbers represent the type of camera (e.g., fixed speed camera).
S102, sequentially reading each row of data in a first document, extracting a longitude coordinate and a latitude coordinate of each row of data in the first document, and establishing a quadtree data structure according to the longitude coordinate and the latitude coordinate;
still further, the quadtree data structure includes a root node, non-leaf nodes, and leaf nodes, one of the leaf nodes storing a row of data in the first document.
Specifically, the quadtree data structure is built by using longitude coordinates and latitude coordinates according to the characteristics of the quadtree data structure, for example, referring to fig. 3-5 at the same time, the building of the quadtree data structure is briefly described:
referring to fig. 3, first, a root node root of a quadtree data structure is established in a computer memory, and if north latitude is represented by a positive number and south latitude is represented by a negative number, the latitude range is (-180, 180), and if east longitude is represented by a positive number and west longitude is represented by a negative number, the longitude range is (-90,90), so that the root node represents the entire map plane and represents a rectangular area with coordinate ranges of (-180, -90) to (180,90).
Referring to fig. 4, the computer then reads the first row of data in the first document, and if the longitude and latitude coordinates in the first row of data are (35.660472,37.76329872), and the coordinate point is marked as a, the a coordinate point is in the rectangular area of the root node, and since the root node does not store data at this time, the a coordinate point can be stored in the root node, that is, the first row of data in the first document is stored in the root node.
Referring to fig. 5, the computer then reads the second line data in the first document, and if the longitude and latitude coordinates in the second line data are (35.6076454,22.201528), it records this coordinate point as B, although the B coordinate point is in the rectangular area of the root node, since the root node already stores the a coordinate point, the B coordinate point can no longer be stored, so it needs to expand the root node, and expand 1, 2,3, 4 four sub-nodes, i.e. the rectangular area represented by the root node is divided into 1, 2,3, 4 sub-rectangular areas, and then stores the a coordinate point again, since the a coordinate point is in the sub-rectangular area numbered 4, the a coordinate point can be stored in the sub-rectangular area numbered 4, i.e. on the sub-node numbered 4.
Then, since the B-coordinate point is stored in the sub-rectangular region numbered 4, and since the sub-node numbered 4 already stores the a-coordinate point, the sub-node numbered 4 needs to be expanded to have four sub-nodes 5, 6, 7, and 8, that is, the rectangular region of the sub-node numbered 4 is divided into four sub-rectangular regions 5, 6, 7, and 8,
and then newly storing the a-coordinate point, since the a-coordinate point is in the sub-rectangular region numbered 5, the a-coordinate point may be stored in the sub-rectangular region numbered 5, that is, on the sub-node numbered 5. And then, the B coordinate point is stored continuously, but because the B coordinate point is also in the sub-rectangular region numbered 5, the B coordinate point needs to be expanded again (the expansion process is not repeated), and finally the a coordinate point is stored in the sub-node numbered 11, and the B coordinate point is stored in the sub-node numbered 9.
Therefore, the computer reads a row of data of the first document, and builds a quadtree data structure according to the longitude coordinate and the latitude coordinate of the row of data, and when the last row of data of the first document is read, the corresponding quadtree data structure is built, so that the built quadtree data structure can be temporarily stored in the memory without wasting storage resources. Finally, the quadtree data structure includes a root node root, a plurality of non-leaf nodes and leaf nodes (the number of the non-leaf nodes and the leaf nodes is positively correlated with how many rows of data of the first document are), and one leaf node stores one row of data in the first document, for example, referring to fig. 5, the leaf nodes 9 and 11 store B and a respectively, that is, the leaf node 9 stores one row of data of the first document, and the leaf node 11 stores another row of data of the first document, and it can also be seen that the non-leaf nodes do not store data (for example, the non-leaf node labeled 5).
If any given coordinate (x, y) is given, wherein x is a longitude coordinate and y is a latitude coordinate, the quadtree data structure constructed in this way can search out the leaf node corresponding to the coordinate point according to x and y, in other words, the leaf node is located in which rectangular area, and then the data stored by the leaf node is obtained. It can be seen that the search mode in the quad data structure can be understood as binary search on a two-dimensional plane, while the search mode in the relational data structure needs to search through one layer of relational search to obtain data (simple understanding is multi-dimensional search), so that, compared with the search mode in the quad data structure, the search speed is higher, and the search mode is simpler and more efficient under the low configuration (such as a product described in the background art) of the embedded device, so that the memory occupation can be effectively reduced; due to the searching mode, data can be further compressed, and the volume of a database constructed subsequently is reduced.
As a preferred embodiment, a function may be created, and when the computer executes the function, a line of data in the first document is read, and then a corresponding quadtree data structure is constructed according to the longitude and latitude coordinates of the line of data, but in the function, when the construction of the quadtree data structure is completed, the function is called again, that is, a recursive function call (a recursive function is used to reduce a code and improve the readability of the code) is performed, that is, each line of data in the first document may be sequentially read, and a quadtree data structure is constructed, and finally, when the function operation is completed, the quadtree data structure corresponding to the first document may be obtained and temporarily stored in the memory of the computer.
S103, reading each node in the quad-tree data structure in sequence and storing the node in a second document; one node in the quad tree data structure corresponds to one line of data in the second document, the formats of all lines of data in the second document are the same, and each line of data in the second document comprises a number, a quad tree storage area, geographic position information and a child node of a current node;
specifically, the quadtree data structure obtained in step S102 is temporarily stored in a computer memory, and needs to be stored, so that each node (including a root node, a non-leaf node, and a leaf node) in the quadtree data structure is read and stored in a second document, which may be a txt or csv file.
Referring to fig. 6, the root node is read first and then saved in the second document, for example, the first row data in the second document is 0 (-180000000-90000000 180000000 90000000) (0 0000000 0) (0 00 1), and when viewed from left to right, the foremost 0 is a number, which indicates that the root node is stored in the second row of the second document (the row number is numbered from O); the data in the first bracket is a quadtree storage area and represents a rectangular area represented by the node in the quadtree data structure; the data in the second bracket is geographical location information, which indicates that the node stores the longitude and latitude and geographical location service information mentioned above (since the root node does not store data, both are 0); the data in the third parenthesis is the child node of the current node, and represents the number of the child node under the current node.
It can be seen that, after the quadtree data structure obtained in step S102 is read, there are how many nodes in the quadtree data structure and how many rows of data exist in the second document, and the formats of each row of data are the same. In addition, it can be seen that if the read node is a non-leaf node, since the non-leaf node does not store data but has a child node, in the corresponding row of data in the second document, the data (i.e., the geographical location information) in the second parenthesis is all 0, and the data is stored in the third parenthesis (i.e., the child node of the current node); if the read child node is a leaf node, since the leaf node stores data but does not have a child node, in the corresponding row of data in the second document, data (i.e., geographical location information) in the second parenthesis is stored, and data in the third parenthesis (i.e., the child node of the current node) is 0.
S104, reading each row of data in the second document in sequence, extracting the geographical position information and the child nodes of the current node to form composite data, and constructing a database according to the composite data.
Further, the step S104 specifically includes:
s1041, sequentially reading each line of data in the second document, extracting the geographical position information in each line of data and the child node of the current node, and detecting whether at least one subdata in the geographical position information in each line of data and the child node of the current node is not 0;
specifically, in the process of constructing the quadtree data structure in step S102, it may not be possible to avoid generating a large number of empty leaf nodes (i.e. leaf nodes that do not store data), so in the second document in step S103, all the empty leaf nodes have corresponding rows of data, and the rows of written data not only occupy no storage space, but also need to be filtered out for the limited storage space of the embedded device, so as to reduce the volume of the second document, and further reduce the volume of the constructed database.
In step S103, since the empty leaf node does not store any data nor has any child node, not only the data (i.e., the geographical location information) in the second parenthesis is 0, but also the data (i.e., the child node of the current node) in the third parenthesis is 0, so that the geographical location information of each line of data in the second document and the child node of the current node can be detected, and if at least one of the two pieces of data is not 0, it indicates that the line of data is not stored by the empty leaf node, and needs to be saved.
S1042, if yes, combining the geographical position information with the child nodes of the current node to obtain composite data, and setting an identification bit;
and S1043, constructing a database by using all the obtained composite data.
Specifically, if it is detected in step S1041 that the row of data is valid (not an empty leaf node), it indicates that the row of data needs to be saved, and all rows of data that do not satisfy this condition (i.e., representing empty leaf nodes) are not saved, so the volume of the second document after construction can be effectively reduced, and the volume of the database after construction can be further reduced.
However, in actual product applications, the number of the geographical location information of the speed limit violation photography is as much as more than 100 ten thousand, which is a huge data volume, and if the volume of the second document is not further compressed, the volume of the constructed database is still not small, and for the small storage memory of the embedded device, only a part of the geographical location information of the speed limit violation photography can be discarded by the constructed database, so that it is very necessary to further compress the volume of the second document.
Referring to fig. 6, the second document after step S1041 retains valid data, and at this time, a certain row of data corresponding to a non-leaf node is, for example, 0 (-180000000-90000000 180000000 90000000) (0 0000000 00 0) (0 000 1), a certain row of data corresponding to a leaf node is 22 (450000000 53437500 50625000 56250000) (48733911 55607322 195-1-1-1-90 22) (0 0 0), and a number indicates a row number of the second document in the file, and the data is unnecessary data and may not be retained; for the quad-tree storage area (data in the first bracket), the rectangular range corresponding to each node can be dynamically calculated in the searching process, so that the quad-tree storage area does not need to be stored; for the data that the geographical location information (the data in the third bracket) and the child node of the current node (the data in the fourth bracket) must need in the search process, it needs to be saved and can be merged together for storage, and since in each row of data, the data of either the geographical location information is 0 or the data of the child node of the current node is 0 (for the reason, see the discussion of step S103), it needs to set an identification bit to distinguish the types in the search process, preferably 1 is used to represent the non-leaf node, and 0 is used to represent the leaf node.
After step S1042, the data in each row in the second document only has the geographic location information, the child node of the current node, and the identification bit, and the data in each row is a composite data, and finally all the obtained composite data are constructed into the geographic location information database.
In one embodiment, the first document contains about 60 pieces of geographical location information, and the size of the geographical location information database (which is a file in the format of edb) obtained after the processing of step S10 is between 16 MB and 20MB, so that the first document can be imported into an embedded device for use.
S20, importing the database into the embedded equipment;
specifically, the geographical location information database constructed in step S10 is more suitable for the embedded device because it is smaller in size in the case of storing the same amount of geographical location information, and because the storage capacity of the embedded device is very small. The introduction of the geographic location information base into the embedded device belongs to the prior art, and is not described herein again.
And S30, acquiring the GPS coordinates of the target position, and searching the geographic position service information around the target position by calling the database.
Further, step S30 specifically includes:
s301, acquiring a GPS coordinate of a target position to obtain a longitude coordinate and a latitude coordinate of the target position;
s302, searching composite data corresponding to the longitude coordinate and the latitude coordinate in the database according to the longitude coordinate and the latitude coordinate, and outputting geographic position service information in the composite data.
Specifically, in the embedded device after step S20, the embedded device may acquire the GPS coordinates (which may be obtained by GPS positioning or by input), and further acquire the longitude coordinates and the latitude coordinates thereof, and record the target position as the C coordinate point.
When the embedded device searches in the database, according to the longitude and latitude coordinates of the C coordinate point, dynamically calculating a rectangular range corresponding to the composite data (which can be understood as a node), judging whether the rectangular area contains the C coordinate point, then according to the identification bit of the composite data, judging the type of the composite data, if the rectangular area is a non-leaf node, performing next-level search according to the child nodes of the non-leaf node (the child nodes of the non-leaf node may be leaf nodes or non-leaf nodes); if the node is a leaf node, stopping searching, and outputting the geographic position service information (namely the geographic position service information around the target position) in the composite data.
For example, as shown in fig. 5, according to the a-coordinate point search, first searching a first composite data (i.e., a root node), obviously, a rectangular region represented by the root node includes the a-coordinate point, since an identification bit of the first composite data indicates that the first composite data is a non-leaf node, continuing to search for a child node of the first composite data, and so on, finally searching composite data corresponding to the child node with the number of 11, since the identification bit of the composite data indicates that the composite data is a leaf node, and finally outputting the geographic location service information in the composite data, since the information is derived from the geographic location service information in the first document, the output information includes one or more of a driving direction angle, a speed limit value, or a camera type.
In addition, when the data volume of the geographical position information of speed limit and illegal photographing is large (for example, about 100 ten thousand pieces of information exist on domestic products), the updating frequency of the GPS coordinates is basically once per second, that is, the embedded device searches out relevant data in the 100 ten thousand pieces of data within one second at most. If the CPU utilization rate is too high during a search in the database (the amount of data contained in the database is very large) for such a low CPU master frequency of the embedded device, the search speed is reduced, and the output information does not have real-time performance. Therefore, it is worth mentioning that, because the data structure of the quadtree database and the two-dimensional searching mode are adopted during searching, when the searching method is used for searching according to the longitude coordinate and the latitude coordinate of the coordinate point, the composite data can be released after one composite data is searched during searching, so that the embedded device does not occupy too large CPU during searching in the database, for example, when searching for an a coordinate point as shown in fig. 5, the root node is first searched and then the root node is released, and then the node with the number of 4 is searched. In an embodiment, the geographic location information database obtained after the processing of step S10 has 60 ten thousand pieces of geographic location information, the CPU dominant frequency of the embedded device is 600MHz, when the embedded device searches in the database according to a coordinate point, the CPU utilization rate is about 2%, and the search speed is relatively fast.
Compared with the prior art, the method for searching the geographic position information in the embedded equipment comprises the steps that firstly, a computer terminal builds a quadtree database structure according to longitude and latitude coordinates of a first document and then stores the quadtree database structure as a second document, and builds a database after compressing the volume of the second document, and the database built after compressing the volume of the second document only stores effective information and identification bits, so that the database is very small in volume, the database can be led into the embedded equipment with relatively small storage space, the embedded equipment can obtain GPS coordinates of a target position, and geographic position service information around the target position is searched in the database according to the longitude and latitude coordinates of the target position.
In a second aspect, the present invention provides a system for searching geographic location information in an embedded device, including a terminal and an embedded device in communication connection with the terminal, where the terminal is configured to construct a database of geographic location information in advance through a quadtree computer data structure, and import the database into the embedded device; the embedded device is configured to obtain a GPS coordinate of a target location, and search for geographic location service information around the target location by calling the database, as described above.
It will be understood that the invention is not limited to the examples described above, but that modifications and variations will occur to those skilled in the art in light of the above teachings, and that all such modifications and variations are considered to be within the scope of the invention as defined by the appended claims.

Claims (5)

1. A method for searching for geographical location information in an embedded device, comprising the steps of:
constructing geographic position information into a database through a quadtree computer data structure in advance;
importing the database into the embedded device;
acquiring a GPS coordinate of a target position, and searching geographic position service information around the target position by calling the database;
the step of constructing the geographical location information into a database via a quadtree computer data structure specifically comprises:
sequentially reading each line of data in a first document through a recursion function, extracting a longitude coordinate and a latitude coordinate of each line of data in the first document, and establishing a quadtree data structure according to the longitude coordinate and the latitude coordinate; the quadtree data structure comprises a root node, a non-leaf node and leaf nodes, wherein one leaf node stores a line of data in the first document; after the construction of the quadtree data structure is completed, calling the recursive function again for reducing codes;
sequentially reading each node in the quad-tree data structure and storing the node in a second document; one node in the quadtree data structure corresponds to one line of data in the second document, the formats of all lines of data in the second document are the same, and each line of data in the second document comprises a serial number, a quadtree storage area, geographical position information and a child node of a current node;
sequentially reading each row of data in the second document, extracting the geographical position information and the child nodes of the current node to form composite data, and constructing the database according to the composite data;
compressing the volume of the second document to reduce the volume of the constructed database, comprising: not saving the quadtree storage area; merging and storing necessary data, and setting an identification bit for the necessary data to distinguish node types, wherein 1 represents the non-leaf node, and 0 represents the leaf node, and the necessary data comprises geographical position information and a child node of a current node;
the step of acquiring the GPS coordinates of the target location and searching for the geographical location information around the target location by calling the database specifically includes:
acquiring a GPS coordinate of a target position to obtain a longitude coordinate and a latitude coordinate of the target position;
according to the longitude coordinate and the latitude coordinate, dynamically calculating a rectangular range corresponding to the composite data, judging whether the rectangular range contains the longitude and latitude coordinate, and then according to the identification bit of the composite data, judging the type of the composite data, wherein the judging comprises the following steps:
when the embedded device searches in a database, searching a first root node, judging whether a rectangular range corresponding to the first root node contains longitude and latitude coordinates, if so, judging whether the rectangular range contains the longitude and latitude coordinates for all child nodes of the first root node, if so, stopping searching, and outputting geographic position service information in the child nodes; and if the rectangular ranges corresponding to all the child nodes in the first root node do not contain the longitude and latitude coordinates, performing next-level search on all the child nodes in the first root node until the rectangular ranges corresponding to the searched child nodes contain the longitude and latitude coordinate positions, stopping the search, and outputting the geographic position service information in the composite data.
2. The method for searching for geographical location information in an embedded device of claim 1, wherein the steps of reading each row of data in the first document in turn, extracting longitude and latitude coordinates of each row of data in the first document, and building a quadtree data structure according to the longitude and latitude coordinates further comprise:
the method comprises the steps of storing a first document in advance, wherein the data format of each line in the first document is the same, and the data of each line in the first document comprises longitude coordinates and latitude coordinates.
3. The method for searching the geographical location information in the embedded device according to claim 2, wherein the data of each line in the first document further comprises geographical location service information, and the geographical location service information comprises one or more of driving direction angle, speed limit value or camera type.
4. The method for searching for geographical location information in an embedded device according to claim 1, wherein the step of sequentially reading each line of data in the second document, extracting the geographical location information and child nodes of a current node, combining the geographical location information and child nodes of the current node into composite data, and generating the database specifically comprises:
reading each line of data in the second document in sequence, extracting the geographical position information in each line of data and the child node of the current node, and detecting whether at least one piece of subdata in the geographical position information in each line of data and the child node of the current node is not 0;
if so, combining the geographical position information with the child nodes of the current node to obtain composite data, and setting an identification position;
and constructing a database by using all the obtained composite data.
5. A system for searching geographical location information in embedded equipment is characterized by comprising a terminal and the embedded equipment in communication connection with the terminal, wherein the terminal is used for constructing the geographical location information into a database in advance through a data structure of a quad-tree computer and importing the database into the embedded equipment; the embedded equipment is used for acquiring a GPS coordinate of a target position and searching geographic position service information around the target position by calling the database;
the step of constructing the geographical location information into a database via a quadtree computer data structure specifically comprises:
sequentially reading each line of data in a first document through a recursion function, extracting a longitude coordinate and a latitude coordinate of each line of data in the first document, and establishing a quadtree data structure according to the longitude coordinate and the latitude coordinate; the quadtree data structure comprises a root node, a non-leaf node and leaf nodes, wherein one leaf node stores a line of data in the first document; after the construction of the quadtree data structure is completed, calling the recursive function again for reducing codes;
sequentially reading each node in the quad-tree data structure and storing the node in a second document; one node in the quad tree data structure corresponds to one line of data in the second document, the formats of all lines of data in the second document are the same, and each line of data in the second document comprises a number, a quad tree storage area, geographic position information and a child node of a current node;
sequentially reading each row of data in the second document, extracting the geographical position information and the child nodes of the current node to form composite data, and constructing the database according to the composite data;
compressing the volume of the second document to reduce the volume of the constructed database, comprising: not saving the quadtree storage area; merging and storing necessary data, and setting an identification bit for the necessary data to distinguish node types, wherein 1 represents the non-leaf node, and 0 represents the leaf node, and the necessary data comprises geographical position information and a child node of a current node;
the step of acquiring the GPS coordinates of the target location and searching for the geographical location information around the target location by calling the database specifically includes:
acquiring a GPS coordinate of a target position to obtain a longitude coordinate and a latitude coordinate of the target position;
according to the longitude coordinate and the latitude coordinate, dynamically calculating a rectangular range corresponding to the composite data, judging whether the rectangular range contains the longitude and latitude coordinate, and then according to the identification bit of the composite data, judging the type of the composite data, wherein the judging comprises the following steps:
when the embedded device searches in a database, searching a first root node, judging whether a rectangular range corresponding to the first root node contains longitude and latitude coordinates, if so, judging whether the rectangular range contains the longitude and latitude coordinates for all child nodes of the first root node, if so, stopping searching, and outputting geographic position service information in the child nodes; and if the rectangular ranges corresponding to all the child nodes in the first root node do not contain longitude and latitude coordinates, performing next-level search on all the child nodes in the first root node until the searched rectangular ranges corresponding to the child nodes contain longitude and latitude coordinate positions, stopping the search, and outputting geographic position service information in the composite data.
CN201910721918.8A 2019-08-06 2019-08-06 Method and system for searching geographical location information in embedded equipment Active CN110427449B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910721918.8A CN110427449B (en) 2019-08-06 2019-08-06 Method and system for searching geographical location information in embedded equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910721918.8A CN110427449B (en) 2019-08-06 2019-08-06 Method and system for searching geographical location information in embedded equipment

Publications (2)

Publication Number Publication Date
CN110427449A CN110427449A (en) 2019-11-08
CN110427449B true CN110427449B (en) 2023-04-14

Family

ID=68412861

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910721918.8A Active CN110427449B (en) 2019-08-06 2019-08-06 Method and system for searching geographical location information in embedded equipment

Country Status (1)

Country Link
CN (1) CN110427449B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101996199A (en) * 2009-08-20 2011-03-30 浙江省公众信息产业有限公司 System and method for realizing GIS (Geographic Information System) engine based on embedded environment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102945261B (en) * 2012-10-20 2016-03-02 江苏大学 The one-touch target search optimization method of intelligent vehicle-carried information service terminal
US10133751B2 (en) * 2016-07-22 2018-11-20 Adobe Systems Incorporated Facilitating location-aware analysis
EP3507720B1 (en) * 2016-08-31 2023-09-27 Pointerra Technologies Pty Ltd Method and system for storing and retrieving multi-dimensional data
CN108628951A (en) * 2018-04-03 2018-10-09 苏州舆图数据科技有限公司 Spatial data massive texture storage based on document model and abbreviation compression method
CN111367913A (en) * 2020-03-03 2020-07-03 青岛大学 Modeling method of data model facing to full space

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101996199A (en) * 2009-08-20 2011-03-30 浙江省公众信息产业有限公司 System and method for realizing GIS (Geographic Information System) engine based on embedded environment

Also Published As

Publication number Publication date
CN110427449A (en) 2019-11-08

Similar Documents

Publication Publication Date Title
CN109165215B (en) Method and device for constructing space-time index in cloud environment and electronic equipment
CN107547633B (en) User constant standing point processing method and device and storage medium
CN101346000B (en) System for providing local mobile geographic information service based on GPS and mobile terminal
JP7407209B2 (en) Information push method and device
US9223801B2 (en) Information management method and information management apparatus
CN104539750A (en) IP locating method and device
CN110633262A (en) Map intersection area calculation method and system based on Spark
CN111221813A (en) Database index and database query processing method, device and equipment
CN111459723A (en) Terminal data processing system
CN117893636A (en) Linear basic geographic entity and thematic geographic entity boundary fusion method and system
CN110427449B (en) Method and system for searching geographical location information in embedded equipment
CN111813773A (en) Power grid meter reading data storage method, uploading method, device and storage device
CN111506682B (en) Map data processing method, data query method, device and electronic equipment
CN113076334B (en) Data query method, index generation method, device and electronic equipment
CN116383282A (en) Method and device for rapidly counting area of coverage area of fence
CN111382220A (en) POI data dividing method and device
CN111611337B (en) Terminal data processing system
CN111949706B (en) Storage method for land big data distributed mining analysis
CN106649341B (en) Data processing method and device
CN108132992B (en) Personnel information basic address coding method and system and electronic equipment
CN111611336B (en) Terminal data processing system
CN112184904B (en) Digital integration method and device
CN116010677B (en) Spatial index method and device and electronic equipment thereof
CN112015929B (en) Raster data access method and device, electronic equipment and computer storage medium
CN109284290B (en) Data reading method based on distributed storage space

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
PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A method and system for searching geographic location information in embedded devices

Granted publication date: 20230414

Pledgee: Shenzhen small and medium sized small loan Co.,Ltd.

Pledgor: SHENZHEN APICAL TECHNOLOGY CO.,LTD.

Registration number: Y2024980016140