Road position positioning method and device, electronic equipment and storage medium
By constructing a KD tree and generating an envelope box in the cloud, the problem of low efficiency in querying road information in digital twin data was solved, and the road location of the target point was quickly located.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-03
- Publication Date
- 2026-05-22
AI Technical Summary
In existing technologies, querying road information from digital twin data is inefficient and makes it difficult to quickly locate the road position of a target point.
The KD tree is constructed in the cloud. By receiving urban road network data, the bounding box of each road is generated and stored in the leaf nodes of the KD tree. In response to the latitude and longitude query information of the target point, the bounding box containing the target point is searched to achieve rapid positioning.
It enables rapid retrieval of road information from digital twin data, quickly locating the road position of a target point and improving query efficiency.
Smart Images

Figure CN117033814B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of big data processing and digital twin technology, and in particular to a road location positioning method, device, electronic device, and storage medium. Background Technology
[0002] Smart cities, through the application of intelligent computing technologies such as the Internet of Things, cloud computing, big data, and geospatial information integration, make key infrastructure components and services of cities, such as urban management, transportation, public utilities, and public safety, more interconnected, efficient, and intelligent.
[0003] Digital twin projects in smart cities comprehensively utilize information technologies such as sensing, computing, and modeling. Through software definition, they describe, diagnose, predict, and make decisions about physical space, thereby achieving interactive mapping between physical space and cyberspace (digital virtual space).
[0004] In related technologies, querying road information in digital twin data is done by associating fields, which is inefficient. Summary of the Invention
[0005] This application provides a road location positioning method, device, electronic device, and storage medium to achieve rapid road location positioning in the cloud.
[0006] The embodiments of this application adopt the following technical solutions:
[0007] In a first aspect, embodiments of this application provide a road location positioning method, wherein the method is executed by the cloud and includes:
[0008] Receive urban road network data, wherein the road network data includes at least a sequence of latitude and longitude coordinates of all roads;
[0009] Based on the road network data, construct a KD tree for all roads, where the K value in the KD tree corresponds to the road ID, and the Value value in the KD tree corresponds to the road's latitude and longitude information;
[0010] Based on the road network data, generate an envelope frame for each road and store the envelope frame of each road in the leaf node of the KD tree;
[0011] In response to the latitude and longitude query information of the target point, the envelope containing the latitude and longitude of the target point is found according to the KD tree;
[0012] Return the bounding box containing the latitude and longitude of the target point as the road location result.
[0013] In some embodiments, generating the envelope of each road includes:
[0014] Based on the road network data, record the maximum and minimum latitude and longitude values among all latitude and longitude coordinate points on each road;
[0015] The envelope of the road is generated based on the maximum and minimum latitude and longitude values and the latitude and longitude coordinates of the road itself on both sides.
[0016] In some embodiments, the step of searching for the envelope containing the latitude and longitude of the target point according to the KD tree in response to the latitude and longitude query information of the target point includes:
[0017] In response to the latitude and longitude query information of the target point, the child nodes are recursively searched starting from the root node of the KD tree;
[0018] During traversal, determine which child node of the root node contains the target point within its partitioned region;
[0019] Based on the results of the child node's region division, proceed to the corresponding leaf node.
[0020] In some embodiments, the step of responding to the latitude and longitude query information of the target point and searching for the envelope containing the latitude and longitude of the target point according to the KD tree further includes:
[0021] During traversal, for each leaf node, determine whether the envelope information contained in the leaf node contains a query point;
[0022] If so, record the road information represented by this envelope.
[0023] In some embodiments, returning the bounding box containing the latitude and longitude of the target point as a road location result includes:
[0024] When the envelope containing the latitude and longitude of the target point is returned, and the envelope includes at least one road, the location result is based on the at least one road.
[0025] When the returned bounding box contains the latitude and longitude of the target point, and if the bounding box includes multiple roads, the result is filtered based on the multiple roads and their names to determine the road location.
[0026] In some embodiments, constructing a KD tree for all roads based on the road network data, wherein the K value in the KD tree corresponds to the road ID, and the Value value in the KD tree corresponds to the road's latitude and longitude information, includes:
[0027] The latitude and longitude information of all roads in the city's road network data is merged into a set, and the set is then normalized.
[0028] Based on the city's road network data, the minimum longitude is lon. min The minimum latitude is lat min The maximum longitude is lon max The maximum latitude is lat max Subtract the minimum value from each latitude and longitude coordinate in the road, and then divide by the latitude and longitude range to obtain the normalized latitude and longitude coordinate values.
[0029] The normalized latitude and longitude coordinate values are sorted according to longitude, and the median is selected as the root node.
[0030] Roads with longitude less than the median are placed in the left subtree, and roads with longitude greater than or equal to the median are placed in the right subtree. After recursion, a KD tree is constructed for all roads.
[0031] In some embodiments, the target point is the location of the vehicle, and the method further includes:
[0032] The road network data of the city is segmented using the H3 index;
[0033] When it is first necessary to query the road information based on the location of the vehicle, obtain the road information where the H3 index corresponding to the current road network data is located.
[0034] The location of the road in the KD tree is calculated using the coordinate information of the vehicle's location.
[0035] When it is not the first time that the vehicle's location needs to be used to query the road information, the corresponding road ID in the KD tree is obtained, and all related road information is queried from the hash table of the KD tree based on the road ID.
[0036] Secondly, embodiments of this application also provide a road location positioning device, wherein the device includes:
[0037] The receiving module is used to receive urban road network data, wherein the road network data includes at least a sequence of latitude and longitude coordinates of all roads;
[0038] The KD tree construction module is used to construct a KD tree for all roads based on the road network data, wherein the K value in the KD tree corresponds to the road ID, and the Value value in the KD tree corresponds to the road latitude and longitude information;
[0039] The generation module is used to generate the envelope of each road based on the road network data and store the envelope of each road in the leaf node of the KD tree;
[0040] The response module is used to respond to the latitude and longitude query information of the target point and search for the envelope containing the latitude and longitude of the target point according to the KD tree;
[0041] The return module is used to return the envelope containing the latitude and longitude of the target point as the road location positioning result.
[0042] Thirdly, embodiments of this application also provide an electronic device, including: a processor; and a memory arranged to store computer-executable instructions, which, when executed, cause the processor to perform the above-described method.
[0043] Fourthly, embodiments of this application also provide a computer-readable storage medium that stores one or more programs, which, when executed by an electronic device including multiple applications, cause the electronic device to perform the above-described method.
[0044] The at least one technical solution adopted in this application embodiment can achieve the following beneficial effects: Road network data of the city is received in the cloud, and then a KD tree for all roads is constructed based on the road network data. Then, the cloud generates an envelope frame for each road based on the road network data and stores the envelope frame of each road in the leaf nodes of the KD tree. After the KD tree for all roads is established, in response to a query for the latitude and longitude of a target point, the envelope frame containing the latitude and longitude of the target point is searched according to the KD tree, and finally, the envelope frame containing the latitude and longitude of the target point is returned as the road location result. The above method, using the KD tree data structure, enables rapid searching of road information in digital twin data, thereby allowing for rapid location of the road location information of the target point (vehicle). Attached Figure Description
[0045] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0046] Figure 1 This is a flowchart illustrating the road location positioning method in the embodiments of this application;
[0047] Figure 2 This is a schematic diagram of the road location positioning device in the embodiments of this application;
[0048] Figure 3 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0049] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0050] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.
[0051] This application provides a method for locating a road position, such as... Figure 1 The diagram shows a road location positioning method according to an embodiment of this application. The method includes at least the following steps S110 to S140:
[0052] Step S110: Receive the city's road network data, wherein the road network data includes at least a sequence of latitude and longitude coordinates of all roads.
[0053] Each city has corresponding road network data, which is existing and received from the cloud. This road network data includes information such as the latitude and longitude coordinates of roads within the city.
[0054] In some embodiments, the latitude and longitude coordinates of the roads can be normalized, and the merged result can be used as a road network dataset.
[0055] Step S120: Based on the road network data, construct a KD tree for all roads, where the K value in the KD tree corresponds to the road ID, and the Value value in the KD tree corresponds to the road latitude and longitude information.
[0056] Based on the road network data from the above steps, a KD-tree for all roads can be constructed in the cloud, and a hash table for all roads can be built using a hash table approach. Here, K represents the corresponding road ID, and V represents all road-related information (including road latitude and longitude).
[0057] Step S130: Based on the road network data, generate the envelope frame of each road and store the envelope frame of each road in the leaf node of the KD tree.
[0058] In addition to constructing KD trees for all roads, the cloud also generates an envelope frame for each road based on the road network data and stores the envelope frame of each road in the leaf node of the corresponding KD tree. It can be understood that the "envelope frame of each road" here refers to the irregular shape obtained by dividing the road along its sides and at different latitudes and longitudes.
[0059] For example, the maximum and minimum latitude and longitude values of all coordinate points on the road are recorded to generate the envelope information of the road, and the envelope information is stored in the leaf nodes of the KD tree.
[0060] Step S140: In response to the latitude and longitude query information of the target point, find the envelope containing the latitude and longitude of the target point according to the KD tree.
[0061] "Target point latitude and longitude query information" refers to the latitude and longitude of the point to be queried. This is usually done by the user inputting the latitude and longitude coordinates of the point they want to query. For example, the latitude and longitude information of a vehicle.
[0062] The KD tree and its envelope information have been established through the above steps. In response to a query for the latitude and longitude of the target point in the cloud, the envelope containing the latitude and longitude of the target point is then located based on the KD tree.
[0063] It's important to note that the "target point" refers to the location point in the digital twin data corresponding to the vehicle's latitude and longitude in the real-world scenario. In other words, the response is based on the target's latitude and longitude, which corresponds to the digital twin data point in the digital twin system.
[0064] Furthermore, the cloud uses the KD tree to find the envelope containing the latitude and longitude of the target point, and the location of the road can be preliminarily determined within the envelope.
[0065] Step S150: Return the envelope containing the latitude and longitude of the target point as the road location positioning result.
[0066] Considering that a single latitude and longitude point may fall within the bounding boxes of multiple roads, the system may return multiple roads or only one road. Based on the bounding boxes, the following optimizations can be made:
[0067] The returned roads are sorted according to their distance from the query point (target point), with the closest road listed first, so that the cloud can locate the closest road to the query point (target point) more quickly.
[0068] By employing the above method, road information corresponding to a vehicle at a given latitude and longitude location can be quickly found. For the cloud, traffic control and related traffic management measures can be implemented based on road location information. However, for massive urban road network data, due to the large amount of road information, it is difficult to quickly locate road information using vehicle latitude and longitude, resulting in long response times. The above method, in response to a query for the latitude and longitude of a target point, searches for the envelope containing the latitude and longitude of the target point using the KD-tree; it returns the envelope containing the latitude and longitude of the target point as the road location result. This reduces the amount of data queryed while improving response speed.
[0069] By adopting the above method, the latitude and longitude information of vehicles in real-world scenarios can be processed in the cloud using digital twin data from a digital twin system to obtain corresponding query results. These results can then be returned to the vehicles in the real-world scenario via the cloud, enabling rapid location of the current road position.
[0070] By employing the above method, a KD tree for all roads is constructed in the cloud based on the road network data, where the K value in the KD tree corresponds to the road ID and the Value value in the KD tree corresponds to the road's latitude and longitude information; based on the road network data, an envelope frame for each road is generated and stored in the leaf nodes of the KD tree; thereby, the location of the corresponding road in the KD tree is calculated using the vehicle's coordinate information, the road ID is obtained, and finally, all relevant road information is retrieved from the hash table.
[0071] By adopting the above method, the cloud performs normalization processing on the received urban road network data, mapping the latitude and longitude coordinates of the roads to a unified range, which facilitates the establishment of KD trees and the subsequent query of latitude and longitude information.
[0072] In one embodiment of this application, generating the envelope of each road includes: recording the maximum and minimum latitude and longitude values among all latitude and longitude coordinate points on each road according to the road network data; and generating the envelope corresponding to the road based on the maximum and minimum latitude and longitude values and the latitude and longitude coordinate points on both sides of the road.
[0073] In practice, the cloud generates an envelope for each road. First, it records the maximum and minimum latitude and longitude values of all coordinate points on the road and then generates the envelope for that road. The envelope information is then stored in the leaf nodes of the established KD tree.
[0074] In one embodiment of this application, the step of responding to the latitude and longitude query information of the target point and searching for the envelope containing the latitude and longitude of the target point according to the KD tree includes: responding to the latitude and longitude query information of the target point, recursively searching for child nodes starting from the root node of the KD tree; during traversal, determining which child node of the target point is within the partitioned region of the root node; and entering the corresponding leaf node according to the partitioned region result of the child node.
[0075] In practice, the process begins by traversing downwards from the root node in the KD-tree. Further, during traversal, for the root node in the KD-tree, it is determined which child node's partitioned region the target point falls within; based on the partitioned region result of the child node, the corresponding leaf node is then entered.
[0076] In one embodiment of this application, the step of responding to the latitude and longitude query information of the target point and searching for the envelope containing the latitude and longitude of the target point according to the KD tree further includes: during traversal, for the leaf node, determining whether the envelope information contained in the leaf node contains the query point; if so, recording the road information represented by this envelope.
[0077] In practice, the envelope of a path is queried based on the leaf node. Since each leaf node stores the envelope information of a road, during traversal, for each leaf node, it is determined whether the envelope information contained in the leaf node contains the query point. If it does, it means that the road information exists in this envelope. That is, for each leaf node, it is determined whether its contained envelope contains the query point; if so, the road represented by this envelope is recorded.
[0078] In one embodiment of this application, returning the envelope containing the latitude and longitude of the target point as a road location positioning result includes: when the returned envelope contains the latitude and longitude of the target point, and the envelope includes at least one road, using the at least one road as the road location positioning result; when the returned envelope contains the latitude and longitude of the target point, and the envelope includes multiple roads, filtering based on the multiple roads and road names as the road location positioning result.
[0079] In practice, the returned results include roads containing the query's latitude and longitude coordinates. Since a single latitude and longitude point may fall within the bounding boxes of multiple roads, multiple roads may be returned. Users can further locate the road based on information such as its name. Furthermore, the results can be optimized by sorting the returned roads by their distance from the query point, placing the closest road at the top. This helps users locate the road closest to their query point more quickly.
[0080] In one embodiment of this application, constructing a KD tree for all roads based on the road network data, wherein the K value in the KD tree corresponds to the road ID and the Value value in the KD tree corresponds to the road's latitude and longitude information, includes: merging the latitude and longitude information of all roads in the city's road network data into a set, and performing normalization processing on the set; based on the minimum longitude of lon in the city's road network data... min The minimum latitude is lat min The maximum longitude is lon max The maximum latitude is lat max The process involves subtracting the minimum value from each latitude and longitude coordinate in the road and then dividing by the latitude and longitude range to obtain normalized latitude and longitude coordinate values. These normalized coordinate values are then sorted by longitude, and the median is selected as the root node. Roads with longitudes less than the median are placed in the left subtree, and roads with longitudes greater than or equal to the median are placed in the right subtree. This process is repeated recursively to construct a KD tree for all roads.
[0081] When constructing a hash table for all roads, K represents the corresponding road ID, and V represents all road-related information. Then, the dimension with the largest variance in latitude and longitude within the urban road network data is calculated. A KD Tree is constructed using this dimension. Assuming longitude has the largest variance, the acquired road latitude and longitude information is merged into a single set. This set is then normalized (assuming the minimum longitude is lon(min), the minimum latitude is lat(min), the maximum longitude is lon(max), and the maximum latitude is lat(max). We can then subtract the corresponding minimum value from each latitude and longitude coordinate and divide by the latitude and longitude range to obtain the normalized coordinate value).
[0082] For example, roads are sorted by longitude, and the median is selected as the root node. Roads with longitudes less than the median are then placed in the left subtree, and roads with longitudes greater than or equal to the median are placed in the right subtree. This logic is recursively applied to construct a complete KDTree.
[0083] It is important to note that the maximum longitude (lon) max ) and minimum longitude (lon min This refers to the maximum and minimum longitude ranges of all roads in the entire city's road network data. Maximum latitude (lat) max ) and minimum latitude (lat min () refers to the maximum and minimum latitudinal ranges of all roads in the entire city's road network data.
[0084] Normalization maps the latitude and longitude coordinates of roads to a uniform range. By subtracting the minimum value from each road's latitude and longitude coordinates and then dividing by the latitude and longitude range (i.e., maximum value minus minimum value), the coordinate values can be scaled to between 0 and 1, resulting in normalized latitude and longitude coordinates. This allows for consistent handling of latitude and longitude differences between different roads when constructing a KD-tree, facilitating node partitioning and query operations.
[0085] In one embodiment of this application, the target point is the location of the vehicle, and the method further includes: segmenting the city's road network data using an H3 index; when it is the first time that the road information is to be queried based on the vehicle's location, obtaining the road information corresponding to the H3 index of the current road network data; calculating the location of the road in the KD tree corresponding to the vehicle's location using the coordinate information of the vehicle's location; when it is not the first time that the road information is to be queried based on the vehicle's location, obtaining the corresponding road ID in the location of the road in the KD tree, and querying all related road information from the hash table of the KD tree based on the road ID.
[0086] In practical implementation, taking vehicles with latitude and longitude information as twin data as the target point as an example, when the vehicle's latitude and longitude information that needs to be processed appears for the first time, the road information corresponding to the H3 index is initially obtained. At this time, the amount of road information is large, making it difficult to quickly locate the road information based on the vehicle's latitude and longitude position. Therefore, when it is necessary to query the road information based on the vehicle's location for the first time, the road information corresponding to the H3 index of the current road network data is obtained. By segmenting the city to be queried using the H3 index, the segmented data is sent to different cloud servers for distributed processing. In this way, by assigning each corresponding index to a fixed cloud server, the amount of road information that needs to be queried each time can be reduced.
[0087] Furthermore, when it is not the first time that the vehicle's location needs to be queried for road information, the corresponding road ID in the road location in the KD tree is obtained, and then all relevant road information is queried from the hash table of the KD tree based on the road ID.
[0088] This application embodiment also provides a road location positioning device 200, such as Figure 2 The diagram shows a schematic representation of a road location positioning device in an embodiment of this application. The road location positioning device 200 includes at least: a receiving module 210, a KD tree construction module 220, a generation module 230, a response module 240, and a return module 250, wherein:
[0089] In one embodiment of this application, the receiving module 210 is specifically used to: receive urban road network data, wherein the road network data includes at least a sequence of latitude and longitude coordinates of all roads.
[0090] Each city has corresponding road network data, which is existing and received from the cloud. This road network data includes information such as the latitude and longitude coordinates of roads within the city.
[0091] In some embodiments, the latitude and longitude coordinates of the roads can be normalized, and the merged result can be used as a road network dataset.
[0092] In one embodiment of this application, the KD tree construction module 220 is specifically used to: construct a KD tree for all roads based on the road network data, wherein the K value in the KD tree corresponds to the road ID, and the Value value in the KD tree corresponds to the road latitude and longitude information.
[0093] Based on the road network data in the above modules, a KD-tree for all roads can be further constructed in the cloud, and a hash table for all roads can be built using a hash table approach. Where K: corresponding road ID; V: all road-related information (including road latitude and longitude information).
[0094] In one embodiment of this application, the generation module 230 is specifically used to: generate an envelope frame for each road based on the road network data and store the envelope frame for each road in the leaf node of the KD tree.
[0095] In addition to constructing KD trees for all roads, the cloud also generates an envelope frame for each road based on the road network data and stores the envelope frame of each road in the leaf node of the corresponding KD tree. It can be understood that the "envelope frame of each road" here refers to the irregular shape obtained by dividing the road along its sides and at different latitudes and longitudes.
[0096] For example, the maximum and minimum latitude and longitude values of all coordinate points on the road are recorded to generate the envelope information of the road, and the envelope information is stored in the leaf nodes of the KD tree.
[0097] In one embodiment of this application, the response module 240 is specifically used to: in response to the latitude and longitude query information of the target point, search for the envelope containing the latitude and longitude of the target point according to the KD tree. "Latitude and longitude query information of the target point" refers to the latitude and longitude to be queried. This is typically achieved by the user inputting a specific latitude and longitude coordinate point to be queried, such as the latitude and longitude information of a vehicle.
[0098] The KD tree and its envelope information are established using the modules described above. In response to a latitude and longitude query for the target point in the cloud, the envelope containing the latitude and longitude of the target point is found based on the KD tree.
[0099] It's important to note that the "target point" refers to the location point in the digital twin data corresponding to the vehicle's latitude and longitude in the real-world scenario. In other words, the response is based on the target's latitude and longitude, which corresponds to the digital twin data point in the digital twin system.
[0100] Furthermore, the cloud uses the KD tree to find the envelope containing the latitude and longitude of the target point, and the location of the road can be preliminarily determined within the envelope.
[0101] In one embodiment of this application, the return module 250 is specifically used to: return the envelope containing the latitude and longitude of the target point as a road location positioning result.
[0102] Considering that a single latitude and longitude point may fall within the bounding boxes of multiple roads, the system may return multiple roads or only one road. Based on the bounding boxes, the following optimizations can be made:
[0103] The returned roads are sorted according to their distance from the query point (target point), with the closest road listed first, so that the cloud can locate the closest road to the query point (target point) more quickly.
[0104] It is understood that the road location positioning device described above can realize each step of the road location positioning method provided in the foregoing embodiments. The relevant explanations of the road location positioning method are applicable to the road location positioning device, and will not be repeated here.
[0105] Figure 3 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Please refer to it. Figure 3 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for other business operations.
[0106] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 3 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0107] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.
[0108] The processor reads the corresponding computer program from non-volatile memory into main memory and then runs it, forming a road location positioning device at the logical level. The processor executes the program stored in memory and specifically performs the following operations:
[0109] Receive urban road network data, wherein the road network data includes at least a sequence of latitude and longitude coordinates of all roads;
[0110] Based on the road network data, construct a KD tree for all roads, where the K value in the KD tree corresponds to the road ID, and the Value value in the KD tree corresponds to the road's latitude and longitude information;
[0111] Based on the road network data, generate an envelope frame for each road and store the envelope frame of each road in the leaf node of the KD tree;
[0112] In response to the latitude and longitude query information of the target point, the envelope containing the latitude and longitude of the target point is found according to the KD tree;
[0113] Return the bounding box containing the latitude and longitude of the target point as the road location result.
[0114] The above is as stated in this application. Figure 1The method executed by the road location positioning device disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0115] The electronic device can also perform Figure 1 The method for executing the road location positioning device, and realizing the road location positioning device in Figure 1 The functions of the embodiments shown are not described in detail here.
[0116] This application also proposes a computer-readable storage medium that stores one or more programs, the programs including instructions that, when executed by an electronic device including multiple applications, enable the electronic device to perform... Figure 1 The method executed by the road location positioning device in the illustrated embodiment is specifically used to perform the following:
[0117] Receive urban road network data, wherein the road network data includes at least a sequence of latitude and longitude coordinates of all roads;
[0118] Based on the road network data, construct a KD tree for all roads, where the K value in the KD tree corresponds to the road ID, and the Value value in the KD tree corresponds to the road's latitude and longitude information;
[0119] Based on the road network data, generate an envelope frame for each road and store the envelope frame of each road in the leaf node of the KD tree;
[0120] In response to the latitude and longitude query information of the target point, the envelope containing the latitude and longitude of the target point is found according to the KD tree;
[0121] Return the bounding box containing the latitude and longitude of the target point as the road location result.
[0122] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0123] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0124] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0125] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1The steps of the function specified in one or more boxes.
[0126] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0127] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0128] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0129] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0130] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0131] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for locating a road, wherein, Executed in the cloud, the method includes: Receive urban road network data, wherein the road network data includes at least a sequence of latitude and longitude coordinates of all roads; Based on the road network data, construct a KD tree for all roads, where the K value in the KD tree corresponds to the road ID, and the Value value in the KD tree corresponds to the road's latitude and longitude information; Based on the road network data, generate an envelope frame for each road and store the envelope frame of each road in the leaf node of the KD tree; In response to the latitude and longitude query information of the target point, the envelope containing the latitude and longitude of the target point is found according to the KD tree; Return the bounding box containing the latitude and longitude of the target point as the road location result; The target point is the location of the vehicle, and the method further includes: The road network data of the city is segmented using the H3 index; When it is first necessary to query the road information based on the location of the vehicle, obtain the road information where the H3 index corresponding to the current road network data is located. The city to be queried is segmented using the H3 index, and the resulting data is then distributed across different cloud servers for processing. The location of the road in the KD tree is calculated using the coordinate information of the vehicle's location. When it is not the first time that the vehicle's location needs to be used to query the road information, the corresponding road ID in the KD tree is obtained, and all related road information is queried from the hash table of the KD tree based on the road ID.
2. The method as described in claim 1, wherein, The process of generating the envelope of each road includes: Based on the road network data, record the maximum and minimum latitude and longitude values among all latitude and longitude coordinate points on each road; The envelope of the road is generated based on the maximum and minimum latitude and longitude values and the latitude and longitude coordinates of the road itself on both sides.
3. The method as described in claim 2, wherein, The step of responding to the latitude and longitude query information of the target point by searching the envelope containing the latitude and longitude of the target point according to the KD tree includes: In response to the latitude and longitude query information of the target point, the child nodes are recursively searched starting from the root node of the KD tree; During traversal, determine which child node of the root node contains the target point within its partitioned region; Based on the results of the child node's region division, proceed to the corresponding leaf node.
4. The method as described in claim 1, wherein, The step of responding to the latitude and longitude query information of the target point and searching for the envelope containing the latitude and longitude of the target point according to the KD tree further includes: During traversal, for each leaf node, determine whether the envelope information contained in the leaf node contains a query point; If so, record the road information represented by this envelope.
5. The method as described in claim 1, wherein, The step of returning the bounding box containing the latitude and longitude of the target point as the road location result includes: When the envelope containing the latitude and longitude of the target point is returned, and the envelope includes at least one road, the location result is based on the at least one road. When the returned bounding box contains the latitude and longitude of the target point, and if the bounding box includes multiple roads, the result is filtered based on the multiple roads and their names to determine the road location.
6. The method of claim 1, wherein, The step involves constructing a KD tree for all roads based on the road network data, wherein the K value in the KD tree corresponds to the road ID, and the Value value in the KD tree corresponds to the road's latitude and longitude information, including: The latitude and longitude information of all roads in the city's road network data is merged into a set, and the set is then normalized. Based on the city's road network data, the minimum longitude is lon. min The minimum latitude is lat min The maximum longitude is lon max The maximum latitude is lat max Subtract the minimum value from each latitude and longitude coordinate in the road, and then divide by the latitude and longitude range to obtain the normalized latitude and longitude coordinate values. The normalized latitude and longitude coordinate values are sorted according to longitude, and the median is selected as the root node. Roads with longitudes less than the median are placed in the left subtree, and roads with longitudes greater than or equal to the median are placed in the right subtree. After recursion, a KD tree for all roads is constructed.
7. A road location positioning device, wherein, The device includes: The receiving module is used to receive urban road network data, wherein the road network data includes at least a sequence of latitude and longitude coordinates of all roads; The KD tree construction module is used to construct a KD tree for all roads based on the road network data, wherein the K value in the KD tree corresponds to the road ID, and the Value value in the KD tree corresponds to the road latitude and longitude information; The generation module is used to generate the envelope of each road based on the road network data and store the envelope of each road in the leaf node of the KD tree; The response module is used to respond to the latitude and longitude query information of the target point and search for the envelope containing the latitude and longitude of the target point according to the KD tree; The return module is used to return the envelope containing the latitude and longitude of the target point as the road location positioning result; The target point is the location of the vehicle, and the road network data of the city is segmented using the H3 index; When it is first necessary to query the road information based on the location of the vehicle, obtain the road information where the H3 index corresponding to the current road network data is located. The city to be queried is segmented using the H3 index, and the resulting data is then distributed across different cloud servers for processing. The location of the road in the KD tree is calculated using the coordinate information of the vehicle's location. When it is not the first time that the vehicle's location needs to be used to query the road information, the corresponding road ID in the KD tree is obtained, and all related road information is queried from the hash table of the KD tree based on the road ID.
8. An electronic device, comprising: processor; as well as A memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the method of any one of claims 1 to 6.
9. A computer-readable storage medium storing one or more programs, which, when executed by an electronic device including a plurality of applications, cause the electronic device to perform the method of any one of claims 1 to 6.
Citation Information
Patent Citations
Method and system for intelligently generating position description based on longitude and latitude
CN104317830A
Equipment aggregation method and device
CN114491307A