Method and device for judging area where vehicle is located, electronic equipment and vehicle
By using the list of adjacent administrative districts and the ray method to determine the location of the vehicle, the problem of low efficiency in determining the administrative division where the vehicle is located in the existing technology is solved, and efficient administrative division judgment under weak or no network conditions is achieved.
Patent Information
- Application Number
- CN202410809217.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-06-21
AI Technical Summary
Under weak or no network conditions, it is difficult to determine the administrative division where the vehicle is located in a timely manner. The existing algorithm is highly complex and cannot meet the computing resource requirements of the end-side equipment, resulting in the inability to determine the administrative division where the vehicle is located in a timely manner.
By obtaining the current location point of the target vehicle and the historical administrative area, using the adjacent administrative area list for efficient matching, combining the inscribed rectangle, circumscribed rectangle and shape point array, using the ray method to determine whether the vehicle location point is within the administrative area, reducing the computational complexity , to achieve rapid regional judgment.
It improves the efficiency of determining the administrative area where the vehicle is located, reduces the cost of computing resources, and can promptly determine the administrative area where the vehicle is located under weak or no network conditions to meet real-time driving needs.
Smart Images

Figure CN118708664A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method, device, electronic equipment and vehicle for determining a vehicle location area. Background Art
[0002] It is necessary for the in-vehicle navigation to determine the location of the vehicle. When the vehicle has a weak network or no network, it is impossible to use the massive computing resources of the cloud server, and can only use the hardware resources in the in-vehicle entertainment controller (IVI) or other controllers on the end side for calculation. The traditional judgment method is that the end-side device stores the geographic location point data of all prefecture-level administrative districts, uses the vehicle positioning data, traverses all district and county administrative district data, and uses the position relationship algorithm between the judgment point and any polygon to judge. Since the district and county administrative district polygon data is massive data, the ray casting method is generally used for judgment. The algorithm complexity of judging whether the ray and the line segment intersect is O(log2). The complexity of the algorithm for judging the relationship between a parking space and an administrative district is proportional to the shape point of the prefecture-level administrative district. The worst case of judging which specific administrative area the parking space is in requires judging all district and county administrative divisions, so the algorithm complexity is O(x*y*log2). Since the shape points of all county and district administrative areas (with 100m as the minimum unit) are close to 1 billion, and since the vehicle needs to be calculated once per second during driving, the terminal equipment resources cannot meet the calculation conditions. Therefore, when the network is weak or there is no network, it is generally impossible to timely determine the administrative area where the vehicle is located. Summary of the invention
[0003] The present invention aims to solve the problem of related technical limitations at least to a certain extent. To this end, the present invention provides a method, device, electronic device and vehicle for determining the area where a vehicle is located, which can effectively determine the area where the vehicle is located.
[0004] On the one hand, an embodiment of the present invention provides a method for determining a region where a vehicle is located, comprising:
[0005] Obtain the first location point of the target vehicle at the current moment and the historical administrative region where the target vehicle was located at the previous moment; use the first location point as the target location point and the historical administrative region as the first region;
[0006] Obtaining the adjacent administrative districts of the first region; and obtaining an administrative district set according to the first region and its adjacent administrative districts;
[0007] Get an administrative region from the administrative region collection as the second region;
[0008] Get the administrative district data of the second region;
[0009] Performing area matching based on the target location point and the administrative area data; when the result of the area matching is a successful match, determining the second area as the target administrative area where the target vehicle is currently located, otherwise, obtaining an administrative area that has not been area matched from the administrative area set as the second area, and then returning to execute the step of obtaining the administrative area data of the second area until the target administrative area where the target vehicle is currently located is determined;
[0010] Obtain the second position point of the target vehicle at the next moment; use the second position point as the target position point, use the target administrative area as the first area, and then return to execute the step of obtaining the adjacent administrative area of the first area, and continuously update the area where the target vehicle is located.
[0011] In some embodiments, the administrative district data includes a bounding rectangle, an inscribed rectangle, and a shape point array of the second area; performing area matching based on the target location point and the administrative district data includes the following steps:
[0012] Determine whether the target position point is within the inscribed rectangle;
[0013] When the target location point is within the inscribed rectangle, the result of determining the area matching is a successful match;
[0014] When the target position point is not within the inscribed rectangle, determine whether the target position point is within the circumscribed rectangle;
[0015] When the target position point is within the circumscribed rectangle, the ray method is used to determine whether the target position point is within the second area based on the target position point and the shape point array;
[0016] When the target location point is within the second area, the result of determining the area matching is that the matching is successful.
[0017] In some embodiments, the method further comprises the following steps:
[0018] When the target location point is not within the bounding rectangle, the result of determining the area matching is a matching failure.
[0019] In some embodiments, the method further comprises the following steps:
[0020] When the target location point is not within the second area, the result of determining the area matching is a matching failure.
[0021] In some embodiments, the shape point array includes a plurality of shape point coordinates, and based on the target position point and the shape point array, determining whether the target position point is within the second region by using a ray method includes the following steps:
[0022] Taking the target position point as the starting point, the target ray is constructed along the preset direction;
[0023] Sequentially traverse the coordinates of each shape point in the shape point array to construct a contour shape of the second area;
[0024] Determine the spatial relationship between the target ray and the contour shape, and obtain the number of intersections between the target ray and the contour shape;
[0025] When the number of intersection points is odd, it is determined that the target location point is within the second area; otherwise, it is determined that the target location point is not within the second area.
[0026] In some embodiments, the method further comprises the following steps:
[0027] When the spatial relationship determination is completed, the target ray in the preset memory is released;
[0028] The preset memory is used to buffer the constructed target ray, and the spatial relationship determination is performed by obtaining the target ray from the preset memory.
[0029] In some embodiments, the contour shape includes a plurality of line segments, and the line segments are constructed based on the coordinates of two adjacent shape points in a sequential traversal process; determining the spatial relationship between the target ray and the contour shape to obtain the number of intersections between the target ray and the contour shape includes the following steps:
[0030] Initialize the number of intersection points to 0, and obtain a line segment from the contour shape as the target line segment;
[0031] Determine the spatial relationship between the target ray and the target line segment. When the spatial relationship between the target ray and the target line segment is an intersection, add 1 to the number of intersection points.
[0032] A line segment whose spatial relationship has not been judged is obtained from the contour shape as the target line segment, and then the step of judging the spatial relationship between the target ray and the target line segment is returned to execute until the spatial relationship between all line segments in the contour shape and the target ray is judged, and the number of intersections between the target ray and the contour shape is obtained.
[0033] In some embodiments, obtaining administrative district data of the second region includes the following steps:
[0034] The administrative district data is obtained by indexing from a preset administrative district data queue based on the administrative district data pointer of the second region.
[0035] On the other hand, an embodiment of the present invention provides a device for determining a region where a vehicle is located, comprising:
[0036] The first module is used to obtain the first position point of the target vehicle at the current moment and the historical administrative area where the target vehicle was located at the previous moment; the first position point is used as the target position point, and the historical administrative area is used as the first area;
[0037] The second module is used to obtain the adjacent administrative districts of the first region; and to obtain an administrative district set according to the first region and its adjacent administrative districts;
[0038] A third module is used for obtaining an administrative region from the administrative region set as a second region;
[0039] The fourth module is used to obtain administrative district data of the second region;
[0040] The fifth module is used to perform region matching based on the target location point and the administrative area data; when the result of the region matching is a successful match, the second region is determined to be the target administrative area where the target vehicle is currently located; otherwise, an administrative area that has not been region matched is obtained from the administrative area set as the second area, and then the fourth module is returned to execute until the target administrative area where the target vehicle is currently located is determined;
[0041] The sixth module is used to obtain the second position point of the target vehicle at the next moment; the second position point is used as the target position point, the target administrative area is used as the first area, and then return to execute the second module to continuously update the area where the target vehicle is located.
[0042] In some embodiments, the apparatus further comprises:
[0043] The seventh module is used to determine that the result of the area matching is a matching failure when the target location point is not within the circumscribed rectangle.
[0044] In some embodiments, the apparatus further comprises:
[0045] The eighth module is used to determine that the result of the area matching is a matching failure when the target location point is not within the second area.
[0046] In some embodiments, the apparatus further comprises:
[0047] The ninth module is used to release the target ray in the preset memory after completing the spatial relationship determination;
[0048] The preset memory is used to buffer the constructed target ray, and the spatial relationship determination is performed by obtaining the target ray from the preset memory.
[0049] On the other hand, an embodiment of the present invention provides an electronic device, including: a processor and a memory; the memory is used to store programs; the processor executes the program to implement the above-mentioned method for determining the area where the vehicle is located.
[0050] On the other hand, an embodiment of the present invention provides a computer storage medium, in which a program executable by a processor is stored. When the program executable by the processor is executed by the processor, it is used to implement the above-mentioned method for determining the area where the vehicle is located.
[0051] On the other hand, an embodiment of the present invention provides a vehicle, which includes the above-mentioned device for determining the area where the vehicle is located or the above-mentioned electronic device.
[0052] The embodiment of the present invention obtains the first position point of the target vehicle at the current moment and the historical administrative area where it was located at the previous moment; takes the first position point as the target position point and the historical administrative area as the first area; obtains the adjacent administrative areas of the first area; obtains an administrative area set according to the first area and its adjacent administrative areas; obtains an administrative area from the administrative area set as the second area; obtains administrative area data of the second area; performs area matching based on the target position point and the administrative area data; when the result of the area matching is a successful match, the second area is determined to be the target administrative area where the target vehicle is currently located, otherwise, an administrative area that has not been area matched is obtained from the administrative area set as the second area, and then returns to execute the step of obtaining the administrative area data of the second area until the target administrative area where the target vehicle is currently located is determined; obtains the second position point of the target vehicle at the next moment; takes the second position point as the target position point and the target administrative area as the first area, and then returns to execute the step of obtaining the adjacent administrative areas of the first area, and continuously updates the area where the target vehicle is located. The embodiment of the present invention is based on the continuity of vehicle travel. Based on this feature, a list of adjacent administrative districts is added to the administrative district data during the map compilation stage. By traversing and matching historical administrative areas and their adjacent administrative districts, efficient judgment of the area where the vehicle is located can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The accompanying drawings are used to provide a further understanding of the technical solution of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the technical solution of the present invention and do not constitute a limitation on the technical solution of the present invention.
[0054] Figure 1 This is a schematic diagram of an implementation environment for determining a vehicle location area provided by an embodiment of the present invention;
[0055] Figure 2 It is a flow chart of a method for determining a region where a vehicle is located provided by an embodiment of the present invention;
[0056] Figure 3 A schematic diagram of an example of a data structure of administrative district data provided by an embodiment of the present invention;
[0057] Figure 4 A schematic diagram of the expansion process of region matching provided by an embodiment of the present invention;
[0058] Figure 5 A schematic diagram of a flow chart of the expansion of the ray method provided in an embodiment of the present invention for determining the positional relationship between a target position point and a second area;
[0059] Figure 6 A schematic diagram of an expanded flow chart for determining the spatial relationship between target rays and contour shapes provided by an embodiment of the present invention;
[0060] Figure 7 A schematic diagram of the traditional process for determining the administrative district where the vehicle is located;
[0061] Figure 8 A schematic diagram of the overall process principle of the method for determining the area where a vehicle is located provided by an embodiment of the present invention;
[0062] Fig. 9 A schematic diagram of the structure of a device for determining a vehicle location area provided by an embodiment of the present invention;
[0063] Fig.10 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0064] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0065] It should be noted that, although the functional modules are divided in the system schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the system or the order in the flowchart. The terms "first / S100", "second / S200", etc. in the specification, claims and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0066] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0067] It is understandable that the method for determining the area where the vehicle is located provided in the embodiment of the present invention can be applied to any computer device with data processing and computing capabilities, and this computer device can be various types of terminals or servers. When the computer device in the embodiment is a server, the server is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. In some embodiments, the terminal is a smart phone, a tablet computer, a laptop computer, and a desktop computer, but is not limited to this.
[0068] like Figure 1 FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the invention. Figure 1 The implementation environment includes at least one terminal 102 and a server 101. The terminal 102 and the server 101 can be connected to a network wirelessly or wired to complete data transmission and exchange.
[0069] Server 101 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms.
[0070] In addition, the server 101 can also be a node server in the blockchain network. Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm.
[0071] The terminal 102 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc. The terminal 102 may also be a vehicle-mounted terminal of various device types described above, but is not limited thereto. The terminal 102 and the server 101 may be directly or indirectly connected via wired or wireless communication, which is not limited in this embodiment of the present invention.
[0072] Based on the example Figure 1In the implementation environment shown, an embodiment of the present invention provides a method for determining the area where a vehicle is located. The following is explained using the example of the method for determining the area where a vehicle is located being applied to the server 101. It can be understood that the method for determining the area where a vehicle is located can also be applied to the terminal 102.
[0073] Reference Figure 2 , Figure 2 The flowchart of the method for determining the area where a vehicle is located applied to a server provided in an embodiment of the present invention, the execution subject of the method for determining the area where a vehicle is located can be any of the aforementioned computer devices (including a server or a terminal). Figure 2 , the method may include the following steps:
[0074] S100, obtaining a first location point of the target vehicle at the current moment and a historical administrative region where the target vehicle was located at the previous moment; taking the first location point as the target location point and taking the historical administrative region as the first region;
[0075] Among them, the scheme of the embodiment of the present invention is mainly aimed at application scenarios where the massive computing resources of the cloud server cannot be used when the vehicle has a weak network or no network, and only the hardware resources in the in-vehicle entertainment controller (IVI for short) or other controllers on the end side can be used for calculations. It should be noted that the weak network or no network of the vehicle usually occurs during driving (for example, passing through tunnels or mountainous areas with poor signals). When the previous moment is the initial moment of the vehicle's driving, that is, the moment the car starts, there is usually no weak network or no network. The cloud server can quickly identify the area where the vehicle is located when it starts. Moreover, even if the vehicle is in a weak network or no network at the initial moment of the vehicle's driving, the area where it is located can be determined by obtaining manual input. It should be understood that when the previous moment is the moment when the car starts, the embodiment of the present invention does not limit the confirmation method of the historical administrative area.
[0076] S200, obtaining the neighboring administrative districts of the first region; and obtaining an administrative district set according to the first region and its neighboring administrative districts;
[0077] S300, obtaining an administrative region from the administrative region set as a second region;
[0078] S400, obtaining administrative district data of the second region;
[0079] It should be noted that, in some embodiments, step S400 may include the following steps: obtaining administrative district data by indexing from a preset administrative district data queue based on the administrative district data pointer of the second region.
[0080] For example, in some specific implementations, due to the continuous characteristics of vehicle travel, vehicles generally travel across adjacent areas. Based on this characteristic, during the map compilation stage (map preprocessing), a list of adjacent administrative districts is added to the administrative district data. The data index position is recorded in the adjacent administrative district list, which can be directly pointed to during budgeting, which can reduce the overall efficiency overhead by more than 1 / 2. The data structure is shown as follows: Figure 3 shown.
[0081] S500, performing region matching based on the target location point and the administrative district data; when the result of the region matching is a successful match, determining that the second region is the target administrative region where the target vehicle is currently located, otherwise, obtaining an administrative region that has not been region matched from the administrative district set as the second region, and then returning to execute the step of obtaining the administrative district data of the second region until the target administrative region where the target vehicle is currently located is determined;
[0082] It should be noted that the administrative area data includes the circumscribed rectangle, the inscribed rectangle and the shape point array of the second area; in some embodiments, such as Figure 4 As shown, performing regional matching based on the target location point and administrative district data may include the following steps: S510, determining whether the target location point is within the inscribed rectangle; S520, when the target location point is within the inscribed rectangle, determining that the result of the regional matching is a successful match; S530, when the target location point is not within the inscribed rectangle, determining whether the target location point is within the circumscribed rectangle; S540, when the target location point is within the circumscribed rectangle, determining whether the target location point is within the second area by using a ray method based on the target location point and the shape point array; S550, when the target location point is within the second area, determining that the result of the regional matching is a successful match.
[0083] For example, in some specific implementations, starting from the data structure design, the following data structure is added in the map compilation stage (map preprocessing): the administrative district data at each level adds the circumscribed rectangle data (the rectangle formed by the maximum and minimum points of the coordinates of all shape points in the x and y directions) and the inscribed rectangle data (the largest rectangle that can be placed in the polygon formed by all shape points). Among them, the circumscribed rectangle and inscribed rectangle in the administrative district data can be pre-defined and constructed based on the shape point data, and the construction principle can be as follows:
[0084] The bounding rectangle can be directly determined based on the maximum and minimum coordinates of all shape points in the horizontal and vertical directions. For example, by traversing the horizontal coordinates of all shape points, it is determined that the maximum value of the vertical coordinate is 5 and the minimum value is 2. By traversing the vertical coordinates of all shape points, it is determined that the maximum value of the vertical coordinate is 4 and the minimum value is 1. Then the bounding rectangle is determined based on the four coordinate points (2,4), (2,1), (5,4) and (5,1).
[0085] The inscribed rectangle can be determined based on the idea of center expansion, as follows:
[0086] 1. First, determine the contour shape of the corresponding area based on the shape point data, and then use the idea of image to search, use the black image as the background, fill the contour part with white, and generate a binary image Q.
[0087] 2. Take the centroid of the contour polygon (outline shape) as the starting point.
[0088] 3. Starting from the centroid of the figure, gradually expand outward, searching pixel by pixel to see if it is a connected area, and finally determine the inscribed rectangle of the corresponding area.
[0089] In some embodiments, the method may further include the following steps: when the target location point is not within the bounding rectangle, determining that the result of the area matching is a matching failure.
[0090] In some embodiments, the method may further include the following steps: when the target location point is not within the second area, determining that the result of the area matching is a matching failure.
[0091] It should be noted that the shape point array includes multiple shape point coordinates. In some embodiments, Figure 5 As shown, based on the target position point and the shape point array, the ray method is used to determine whether the target position point is in the second area, including the following steps: S541, taking the target position point as the starting point, constructing a target ray along a preset direction; S542, sequentially traversing each shape point coordinate in the shape point array to construct a contour shape of the second area; S543, determining the spatial relationship between the target ray and the contour shape, and obtaining the number of intersections between the target ray and the contour shape; S544, when the number of intersections is odd, determining that the target position point is in the second area, otherwise, determining that the target position point is not in the second area.
[0092] In some embodiments, the contour shape includes multiple line segments, and the line segments are constructed based on the coordinates of two adjacent shape points in a sequential traversal process; Figure 6 As shown, determining the spatial relationship between the target ray and the contour shape and obtaining the number of intersections between the target ray and the contour shape may include the following steps: S5431, initializing the number of intersections to 0, obtaining a line segment from the contour shape as the target line segment; S5432, determining the spatial relationship between the target ray and the target line segment, and when the spatial relationship between the target ray and the target line segment is an intersection, adding 1 to the number of intersections; S5433, obtaining a line segment from the contour shape that has not undergone a spatial relationship determination as the target line segment, and then returning to the step of determining the spatial relationship between the target ray and the target line segment, until the spatial relationship between all line segments in the contour shape and the target ray is determined, and the number of intersections between the target ray and the contour shape is obtained.
[0093] For example, in some specific implementations, for any closed curve in a plane, it can be intuitively considered that the curve divides the plane into two parts, the inner part and the outer part, where the "inner" part is the so-called polygonal area (i.e., the area corresponding to the second area or the contour shape). Based on this understanding, for any straight line in a plane, the following conclusions can be drawn:
[0094] When a straight line crosses the boundary of a polygon, there are only two situations: entering the polygon or passing through the polygon.
[0095] Without considering non-Euclidean space, a straight line cannot enter a polygon from the inside or pass through a polygon from the outside, that is, two consecutive crossings of the boundary must be a pair. A straight line can extend infinitely, while the area enclosed by a closed curve is finite, so the last crossing of the polygon boundary must be passing through the polygon and reaching the outside.
[0096] If we draw a ray from a given point, we can also draw the following two conclusions: If the point is inside the polygon, the ray must go out of the polygon when it crosses the boundary for the first time.
[0097] If the point is outside the polygon, the ray's first crossing of the boundary must be into the polygon.
[0098] Summarizing the above conclusions, we can conclude that:
[0099] When the number of times the ray crosses the polygon boundary is even, all even-numbered (including the last) crossings are outgoing, so all odd-numbered (including the first) crossings are ingoing, from which it can be inferred that the point is outside the polygon. When the number of times the ray crosses the polygon boundary is odd, all odd-numbered (including the first and last) crossings are outgoing, from which it can be inferred that the point is inside the polygon.
[0100] Among them, some problems and solutions of the ray method in practical applications in some practical application scenarios are as follows:
[0101] Special issues:
[0102] 1. The point is on the edge of the polygon; 2. The point and the vertex of the polygon coincide; 3. The ray passes through the vertex of the polygon; 4. The ray just passes through one edge of the polygon. This is a special case of the previous case, that is, the ray passes through two adjacent vertices of the polygon continuously.
[0103] Corresponding solutions:
[0104] 1. There are many ways to determine whether a point is on a line. A relatively simple and direct way is to calculate whether the slope of the line connecting the point and the two polygon vertices is equal. This is learned in middle school mathematics. 2. The situation where a point and a polygon vertex coincide is even simpler. Just compare the coordinates of the point. 3. The prerequisite for a ray to pass through a line segment is that the two endpoints of the line segment are on both sides of the ray. As long as you understand this point, the vertex crossing is solved. In this way, you only need to stipulate that the points crossed by the ray are counted as one side. 4. Once point 3 is solved, this point is not difficult at all. According to the above assumptions, the two vertices that the ray passes through consecutively are obviously on the side above the ray, so this situation can be regarded as no crossing. Since the solution to the third point actually covers this special case, no special processing is required.
[0105] In some embodiments, the method may further include the following steps: when the spatial relationship determination is completed, the target rays in the preset memory are released; wherein the preset memory is used to buffer the constructed target rays, and the spatial relationship determination is performed by obtaining the target rays from the preset memory.
[0106] S600, obtaining a second position point of the target vehicle at the next moment; taking the second position point as the target position point, taking the target administrative area as the first area, and then returning to execute the step of obtaining the adjacent administrative area of the first area, and continuously updating the area where the target vehicle is located.
[0107] In order to explain the principle of the technical solution of the present invention in detail, the overall process of the present invention is described below in combination with some specific embodiments. It is easy to understand that the following is an explanation of the technical principle of the present invention and cannot be regarded as a limitation of the present invention.
[0108] First of all, it should be noted that the polygonal data of district and county administrative areas is massive data. Generally, the ray casting method is used to judge whether the ray and the line segment intersect. The complexity of the algorithm for judging the relationship between a parking space and an administrative area is proportional to the shape points of the prefecture-level administrative area. To determine which specific administrative area a parking space is in, the worst case requires judging all district and county administrative divisions, so the algorithm complexity is O(x*y*log2). Since the shape points of all district and county administrative areas (with 100m as the smallest unit) approach 1 billion, and since the vehicle needs to be calculated once per second during driving, the terminal equipment resources cannot meet the calculation conditions. Therefore, when the network is weak or there is no network, it is generally impossible to determine the administrative area where the vehicle is located in time. The traditional process of determining the administrative area where the vehicle is located is as follows: Figure 7 shown.
[0109] In view of the problems existing in the prior art, the embodiments of the present invention make the following improvements:
[0110] Improved algorithm 1:
[0111] Due to the continuous characteristics of vehicle driving, vehicles generally travel across adjacent areas. Based on this feature, during the map compilation stage (map preprocessing), a list of adjacent administrative districts is added to the administrative district data. The data index position is recorded in the adjacent administrative district list, which can be directly pointed to during budgeting, which can reduce the overall efficiency overhead by more than 1 / 2. The data structure is shown as follows: Figure 3 shown.
[0112] Improved algorithm 2:
[0113] The improved algorithm starts with data structure design. In the map compilation stage (map preprocessing), the following data structures are added: administrative district data at all levels add circumscribed rectangle data (i.e. the largest rectangle of the administrative district in the flowchart, the rectangle formed by the largest and smallest points in the x and y directions of all shape points) and inscribed rectangle data (i.e. the smallest rectangle of the administrative district in the flowchart, the largest rectangle that can be placed in the polygon formed by all shape points). Figure 8 As shown, the calculation method is improved to:
[0114] 1. Collect vehicle locations updated in real time;
[0115] 2. Based on the historical administrative region determined at the last moment, determine its adjacent administrative region; and perform a cyclic traversal determination of the vehicle position based on the historical administrative region and its adjacent administrative region;
[0116] 3. Determine whether the vehicle position is within the minimum rectangle of the administrative area (the area selected from the historical administrative area and its adjacent administrative areas for participating in the determination). If so, directly determine the administrative area where the current vehicle position is located based on the area currently participating in the determination; otherwise, execute step 4;
[0117] 4. Determine whether the vehicle position is within the maximum rectangle of the administrative area (the area selected from the historical administrative area and its adjacent administrative areas for participating in the determination). If not, reselect the area for participating in the determination from the historical administrative area and its adjacent administrative areas, and then return to step 3; otherwise, execute step 5;
[0118] 5. Construct the vehicle position point ray based on the vehicle position point (and buffer it into memory);
[0119] 6. Perform circular judgment on the administrative area shape points to determine the spatial relationship between the ray and the line segment formed by the adjacent shape points (point n and point n+1);
[0120] 7. When the intersection of the ray and all the line segments is an odd number, the vehicle position point is determined to be within the administrative area, and the administrative area where the current vehicle position is located is directly determined based on the area currently involved in the determination; otherwise, the area used for determination is reselected from the historical administrative area and its adjacent administrative areas, and then return to step 3 until the administrative area where the current vehicle position is located is determined;
[0121] 8. After determining the administrative district where the current vehicle position is located, release the vehicle position point ray in the memory; then continue to update the vehicle position to continuously determine the administrative district where the vehicle is located.
[0122] On the other hand, Fig. 9 As shown, an embodiment of the present invention provides a device 900 for determining a vehicle location area, which may include:
[0123] The first module 910 is used to obtain the first position point of the target vehicle at the current moment and the historical administrative region where the target vehicle was located at the previous moment; the first position point is used as the target position point, and the historical administrative region is used as the first region;
[0124] The second module 920 is used to obtain the adjacent administrative districts of the first region; and to obtain an administrative district set according to the first region and its adjacent administrative districts;
[0125] The third module 930 is used to obtain an administrative area from the administrative area set as the second area;
[0126] The fourth module 940 is used to obtain administrative district data of the second area;
[0127] The fifth module 950 is used to perform region matching based on the target location point and the administrative area data; when the result of the region matching is a successful match, the second region is determined to be the target administrative area where the target vehicle is currently located; otherwise, an administrative area that has not been region matched is obtained from the administrative area set as the second area, and then the fourth module is returned to execute until the target administrative area where the target vehicle is currently located is determined;
[0128] The sixth module 960 is used to obtain the second position point of the target vehicle at the next moment; the second position point is used as the target position point, the target administrative area is used as the first area, and then return to execute the second module to continuously update the area where the target vehicle is located.
[0129] In some embodiments, the apparatus may further include:
[0130] The seventh module is used to determine that the result of the area matching is a matching failure when the target location point is not within the circumscribed rectangle.
[0131] In some embodiments, the apparatus may further include:
[0132] The eighth module is used to determine that the result of the area matching is a matching failure when the target location point is not within the second area.
[0133] In some embodiments, the apparatus may further include:
[0134] The ninth module is used to release the target ray in the preset memory after completing the spatial relationship determination;
[0135] The preset memory is used to buffer the constructed target ray, and the spatial relationship determination is performed by obtaining the target ray from the preset memory.
[0136] The contents of the method embodiments of the present invention are all applicable to the device embodiments. The functions specifically implemented by the device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0137] On the other hand, an embodiment of the present invention further provides an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the above-mentioned method for determining the area where the vehicle is located when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a vehicle-mounted computer, etc.
[0138] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0139] like Fig.10 As shown, Fig.10 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0140] The processor 1001 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present invention;
[0141] The memory 1002 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1002 can store an operating system and other applications. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1002, and the processor 1001 calls and executes the network node population optimization method of the embodiment of the present invention;
[0142] Input / output interface 1003, used to implement information input and output;
[0143] The communication interface 1004 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);
[0144] A bus 1005 , which transmits information between various components of the device (e.g., the processor 1001 , the memory 1002 , the input / output interface 1003 , and the communication interface 1004 );
[0145] The processor 1001 , the memory 1002 , the input / output interface 1003 and the communication interface 1004 are connected to each other in communication within the device via the bus 1005 .
[0146] The electronic device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0147] The contents of the method embodiments of the present invention are all applicable to the electronic device embodiments. The functions specifically implemented by the electronic device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0148] Another aspect of an embodiment of the present invention further provides a computer-readable storage medium, wherein the storage medium stores a program, and the program is executed by a processor to implement the above method.
[0149] It should be noted that the computer-readable medium shown in the embodiment of the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (Compact Disc Read to Only Memory, CD to ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0150] The contents of the method embodiments of the present invention are all applicable to the computer-readable storage medium embodiments. The functions specifically implemented by the computer-readable storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0151] The embodiment of the present invention also discloses a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device can read the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the above method.
[0152] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0153] It should be noted that, although several modules of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0154] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD to ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation of the present invention.
[0155] In some selectable embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the present invention is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Selectable embodiments are expected, wherein the order of various operations is changed and the sub-operation of a part for which is described as a larger operation is performed independently.
[0156] In addition, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise specified, one or more of the functions and / or features can be integrated into a single physical device and / or software module, or one or more functions and / or features can be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present invention. More specifically, in view of the properties, functions and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional skills of the engineer. Therefore, those skilled in the art can implement the present invention set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.
[0157] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0158] The logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be embodied in any computer-readable medium for use by an instruction execution device, apparatus or device (such as a computer-based device, a device including a processor, or other device that can fetch instructions from an instruction execution device, apparatus or device and execute the instructions), or in conjunction with such instruction execution device, apparatus or device. For purposes of this specification, "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution device, apparatus or device, or in conjunction with such instruction execution device, apparatus or device.
[0159] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0160] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution device. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0161] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0162] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
[0163] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present invention.
Claims
1. A method for determining a vehicle location, characterized in that: The following steps are involved: Obtaining a first location point of the target vehicle at the current moment and a historical administrative region where the target vehicle was located at the previous moment; using the first location point as the target location point and the historical administrative region as the first region; Obtaining the adjacent administrative districts of the first region; and obtaining an administrative district set according to the first region and the adjacent administrative districts; Acquire an administrative region from the set of administrative regions as a second region; Obtaining administrative district data of the second region; Performing area matching based on the target location point and the administrative area data; when the result of the area matching is a successful match, determining that the second area is the target administrative area where the target vehicle is currently located, otherwise, obtaining an administrative area that has not been area matched from the administrative area set as the second area, and then returning to execute the step of obtaining the administrative area data of the second area until the target administrative area where the target vehicle is currently located is determined; Obtaining a second position point of the target vehicle at a next moment; The second location point is used as the target location point, the target administrative area is used as the first area, and then the step of obtaining the adjacent administrative areas of the first area is returned to continuously update the area where the target vehicle is located.
2. The method for determining the area where a vehicle is located according to claim 1, characterized in that: The administrative district data includes a circumscribed rectangle, an inscribed rectangle and a shape point array of the second area; performing area matching based on the target location point and the administrative district data includes the following steps: Determine whether the target location point is within the inscribed rectangle; When the target location point is within the inscribed rectangle, determining the result of the area matching is a successful match; When the target location point is not within the inscribed rectangle, determining whether the target location point is within the circumscribed rectangle; When the target position point is within the circumscribed rectangle, judging whether the target position point is within the second area by using a ray method based on the target position point and the shape point array; When the target location point is within the second area, the result of the area matching is determined to be a successful match.
3. The method for determining the area where a vehicle is located according to claim 2, characterized in that: The method further comprises the following steps: When the target location point is not within the circumscribed rectangle, it is determined that the result of the area matching is a matching failure.
4. The method for determining the area where a vehicle is located according to claim 2, characterized in that: The method further comprises the following steps: When the target location point is not within the second area, it is determined that the result of the area matching is a matching failure.
5. The method for determining the area where a vehicle is located according to claim 2, characterized in that: The shape point array includes a plurality of shape point coordinates, and judging whether the target position point is within the second area by using a ray method based on the target position point and the shape point array includes the following steps: Taking the target position point as the starting point, construct a target ray along a preset direction; Sequentially traverse the coordinates of each shape point in the shape point array to construct a contour shape of the second area; Determine the spatial relationship between the target ray and the contour shape to obtain the number of intersections between the target ray and the contour shape; When the number of the intersection points is odd, it is determined that the target location point is within the second area; otherwise, it is determined that the target location point is not within the second area.
6. The method for determining the area where a vehicle is located according to claim 5, characterized in that: The method further comprises the following steps: When the spatial relationship determination is completed, the target ray in the preset memory is released; The preset memory is used to buffer the constructed target ray, and the spatial relationship determination is performed by obtaining the target ray from the preset memory.
7. The method for determining the area where a vehicle is located according to claim 5, characterized in that: The contour shape includes a plurality of line segments, and the line segments are constructed based on the coordinates of two adjacent shape points in the sequential traversal process; the spatial relationship between the target ray and the contour shape is determined to obtain the number of intersections between the target ray and the contour shape, including the following steps: Initialize the number of intersection points to 0, and obtain one of the line segments from the contour shape as a target line segment; Determine the spatial relationship between the target ray and the target line segment, and when the spatial relationship between the target ray and the target line segment is an intersection, add 1 to the number of intersection points; A line segment for which the spatial relationship has not been judged is obtained from the contour shape as the target line segment, and then the step of judging the spatial relationship between the target ray and the target line segment is returned to execute until the spatial relationship between all the line segments in the contour shape and the target ray is judged, thereby obtaining the number of intersections between the target ray and the contour shape.
8. The method for determining the area where a vehicle is located according to claim 1, characterized in that: The step of obtaining the administrative district data of the second region comprises the following steps: The administrative district data is obtained by indexing from a preset administrative district data queue based on the administrative district data pointer of the second area.
9. A device for determining the area where a vehicle is located, characterized in that: include: The first module is used to obtain the first location point of the target vehicle at the current moment and the historical administrative area where it was located at the previous moment; Taking the first location point as the target location point and taking the historical administrative area as the first area; The second module is used to obtain the adjacent administrative districts of the first area; Obtaining an administrative district set according to the first region and its adjacent administrative districts; A third module is used to obtain an administrative area from the administrative area set as a second area; A fourth module is used to obtain administrative district data of the second area; The fifth module is used to perform area matching based on the target location point and the administrative area data; when the result of the area matching is a successful match, the second area is determined to be the target administrative area where the target vehicle is currently located; otherwise, an administrative area that has not been area matched is obtained from the administrative area set as the second area, and then the fourth module is returned to execute until the target administrative area where the target vehicle is currently located is determined; The sixth module is used to obtain the second position point of the target vehicle at the next moment; The second location point is used as the target location point, the target administrative area is used as the first area, and then the second module is returned to be executed to continuously update the area where the target vehicle is located.
10. An electronic device, characterized in that: including a processor and a memory; The memory is used to store programs; The processor executes the program to implement the method according to any one of claims 1 to 8.
11. A computer storage medium storing a program executable by a processor, characterized in that: The program executable by the processor is used to implement the method according to any one of claims 1 to 8 when executed by the processor.
12. A vehicle, characterized in that: The vehicle includes the device for determining the area where the vehicle is located as claimed in claim 9 or the electronic device as claimed in claim 10.
Citation Information
Patent Citations
Method for judging whether vehicle has cross-area behavior
CN109544968A
Three-dimensional model data dynamic loading method
CN113703864A
Method and device for predicting vehicle destination, storage medium and terminal
CN114169589A
VOCs emission real-time calculation method in volatile chemical transportation process
CN115934796A
Vehicle route deviation detection method and device, storage medium and electronic equipment
CN117367456A
Cited By
Method and apparatus for determining region where vehicle is located, and electronic device and vehicle
WO2025261488A1
