Data processing method and apparatus, electronic device, and computer program product
By first determining whether the location is within a specified rule-based graphic during location data processing, unnecessary calculations using specific algorithms are avoided, thus solving the pressure problem of location data processing services and improving processing efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
- Filing Date
- 2021-11-18
- Publication Date
- 2026-04-21
AI Technical Summary
Existing virtualization applications based on location data require a large amount of computation, which puts excessive pressure on location data processing services.
By determining whether the location corresponding to the positioning data is within the specified rule graphic corresponding to the preset path or preset area, if it is not within the preset area, no specific algorithm calculation is performed, and the location is directly determined to be off-center or not within the preset path or area.
This reduces the data processing pressure on location data processing services and improves processing efficiency.
Smart Images

Figure CN114114349B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of mobile transportation and security technology, and in particular to a data processing method, apparatus, electronic device and computer program product. Background Technology
[0002] Currently, there are many virtualization applications based on location data such as GPS (Global Positioning System) data, such as geofencing and trajectory deviation. For this type of application, a preset path needs to be configured, and real-time location data and the preset path are used as parameters. Based on a specific algorithm (calculating the distance relationship between the location and the preset path points or line segments), a conclusion is drawn as to whether the user has entered or left the fence or deviated from the trajectory.
[0003] Practice has shown that the frequency of location data reporting is usually quite high, meaning there is a large amount of location data being reported. This necessitates a significant amount of calculation based on specific algorithms, putting considerable pressure on the location data processing service. Summary of the Invention
[0004] In view of this, this application provides a data processing method, apparatus, electronic device, and computer program product to reduce the data processing pressure of GPS data processing services.
[0005] According to a first aspect of the embodiments of this application, a data processing method is provided, comprising:
[0006] Receive location data reports;
[0007] Determine whether the target location corresponding to the currently received positioning data is inside a specified rule pattern corresponding to a preset path or preset area; wherein, the preset path or preset area is inside the specified rule pattern;
[0008] If the target location is not within the specified rule graph, it is determined that the target location deviates from the preset path or is not within the preset area.
[0009] According to a second aspect of the embodiments of this application, a data processing apparatus is provided, comprising:
[0010] The receiving unit is used to receive location data reports;
[0011] A determining unit is used to determine whether the target location corresponding to the positioning data currently received by the receiving unit is inside a specified rule pattern corresponding to a preset path or preset area; wherein the preset path or preset area is inside the specified rule pattern;
[0012] The processing unit is configured to determine, when the target location is not within the specified rule graph, that the target location deviates from the preset path or is not within the preset area.
[0013] According to a third aspect of the embodiments of this application, an electronic device is provided, including a processor and a memory, wherein...
[0014] Memory, used to store computer programs;
[0015] The processor, when executing a program stored in memory, implements the data processing method provided in the first aspect.
[0016] According to a fourth aspect of the embodiments of this application, a machine-readable storage medium is provided, which stores machine-executable instructions that, when executed by a processor, implement the data processing method provided in the first aspect.
[0017] According to a fifth aspect of the embodiments of this application, a computer program is provided, which is stored in a machine-readable storage medium, and when a processor executes the computer program, causes the processor to perform the data processing method provided in the first aspect.
[0018] According to a sixth aspect of the embodiments of this application, a computer program product is provided, the computer program product including a computer program that, when a processor executes the computer program, causes the processor to perform the data processing method provided in the first aspect.
[0019] The data processing method of this application embodiment determines a specified rule pattern corresponding to a preset path or preset area. For the received reported location data, before performing calculations according to a specific algorithm, it can first determine whether the location corresponding to the location data is inside the specified rule pattern corresponding to the preset path or preset area. If the location corresponding to the location data is not inside the specified rule pattern corresponding to the preset path or preset area, it is not necessary to perform calculations according to a specific algorithm. It can directly determine that the location corresponding to the location data deviates from the preset path or is not in the preset area, thereby reducing the data processing pressure of the location data processing service. Attached Figure Description
[0020] Figure 1 This is a flowchart illustrating a data processing method provided in an embodiment of this application;
[0021] Figure 2 This is a schematic diagram of the structure of a data processing system provided in an embodiment of this application;
[0022] Figure 3 This is a flowchart illustrating a data processing method provided in an embodiment of this application;
[0023] Figure 4A This is a schematic diagram of a geofencing scenario provided in an embodiment of this application;
[0024] Figure 4B This is a schematic diagram of a circle corresponding to a preset area in a geofencing scenario provided in an embodiment of this application;
[0025] Figure 5A This is a schematic diagram of a trajectory yaw scenario provided in an embodiment of this application;
[0026] Figure 5B This is a schematic diagram of a circle corresponding to a preset path in a trajectory yaw scenario provided in an embodiment of this application;
[0027] Figure 6 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application;
[0028] Figure 7 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0029] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0030] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0031] To enable those skilled in the art to better understand the technical solutions provided in the embodiments of this application, the configuration implementation of the preset path will be briefly explained below.
[0032] For example, a preset path or preset area can be configured by configuring an ordered set of path points, which typically includes at least two path points, and these path points are ordered. The path configuration system can connect adjacent path points sequentially to obtain the preset path.
[0033] For example, for a preset area, such as a geofence, the starting and ending path points are the same. By connecting the adjacent path points in sequence, a closed area (i.e., a fenced area) can be obtained.
[0034] To make the above-mentioned objectives, features and advantages of the embodiments of this application more apparent and understandable, the technical solutions of the embodiments of this application will be further described in detail below with reference to the accompanying drawings.
[0035] It should be noted that the sequence number of each step in the embodiments of this application does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0036] Please see Figure 1 This is a flowchart illustrating a data processing method provided in an embodiment of this application, as shown below. Figure 1 As shown, the data processing method may include the following steps:
[0037] Step S100: Receive location data reports.
[0038] Step S110: Determine whether the target location corresponding to the currently received positioning data is within a specified rule shape corresponding to a preset path or preset area; wherein, the preset path or preset area is within the specified rule shape. If not, proceed to step S120.
[0039] In this embodiment of the application, the positioning data may include, but is not limited to, GPS data.
[0040] For ease of description and understanding, the following text will use GPS data as the location data example.
[0041] In this embodiment of the application, considering that in real-world scenarios, in virtualization applications based on GPS data, the preset path or preset area is relatively small compared to the actual activity area of the GPS data reporting entity (such as a vehicle), and the GPS data reporting entity is mostly active outside the preset path or preset area.
[0042] For example, in geofencing applications, the entities that report GPS data are mostly active outside the fence.
[0043] Therefore, for any preset path or preset area, a regular pattern (referred to as the specified regular pattern in this paper) can be determined to cover the preset path or preset area. When the location corresponding to the GPS data is outside the specified regular pattern, it can be determined that the location corresponding to the GPS data deviates from the preset path or is not in the preset area. It is not necessary to perform calculations based on the preset path and GPS data parameters according to a specific algorithm. That is, by determining the specified regular pattern corresponding to the preset path or preset area, the GPS data corresponding to the location outside the specified regular pattern can be used to draw relevant conclusions (such as deviating from the preset path, not in the preset area, etc.) without performing calculations based on a specific algorithm. GPS data filtering is performed based on the specified regular pattern to filter out GPS data that does not require calculations based on a specific algorithm.
[0044] For example, not being in a preset area can include not entering or leaving the preset area.
[0045] For example, assuming the preset area is a fenced area, not being in the preset area can include not entering the fenced area or leaving the fenced area.
[0046] For example, the specified rule area may include, but is not limited to, a circle, a rectangle, or a triangle.
[0047] Accordingly, upon receiving the reported GPS data, before performing calculations based on a specific algorithm, the location corresponding to the GPS data (referred to as the target location in this document) can be determined based on the currently received GPS data, and it can be determined whether the target location is within the specified rule graph corresponding to the aforementioned preset path or preset area.
[0048] Step S120: Determine that the target location deviates from the preset path or is not in the preset area.
[0049] In this embodiment of the application, when the target location is not within the specified rule graphic corresponding to the preset path or preset area, it is not necessary to perform calculations based on a specific algorithm. Instead, a conclusion can be directly drawn that the target location deviates from the preset path or is not within the preset area.
[0050] For example, taking geofencing as an example, if the target location is not inside the specified rule graph corresponding to the preset path or preset area, it can be determined that the target location is outside the geofencing without needing to perform calculations based on a specific algorithm.
[0051] It can be seen that, in Figure 1In the method flow shown, by determining the specified rule pattern corresponding to the preset path or preset area, for the received reported location data, before performing calculations according to a specific algorithm, it can be determined whether the location corresponding to the location data is inside the specified rule pattern corresponding to the preset path or preset area. If the location corresponding to the location data is not inside the specified rule pattern corresponding to the preset path or preset area, it is not necessary to perform calculations according to a specific algorithm, thus reducing the data processing pressure of the location data processing service.
[0052] In some embodiments, after determining whether the target location corresponding to the currently received positioning data is within a specified rule graph corresponding to a preset path or preset area in step S110, the method may further include:
[0053] If the target location is within the specified regular graphic, a specific algorithm is used to calculate whether the target location deviates from the preset path or is within the preset area.
[0054] For example, when the target location is inside a specified rule-based graphic, a specific algorithm can be used to calculate whether the target location deviates from a preset path or is within a preset area.
[0055] In one example, the above calculation based on a specific algorithm to determine whether the target location deviates from the preset path may include:
[0056] Determine the minimum distance among the line segments in the preset path from the target location, and compare this minimum distance with the target distance threshold; if the minimum distance is greater than the target distance threshold, determine that the target location deviates from the preset path; otherwise, determine that the target location does not deviate from the preset path.
[0057] For example, consider a scenario with a preset path, such as a trajectory deviation scenario.
[0058] For example, a preset path is usually obtained by connecting adjacent sets of trajectory points in sequence using line segments from a pre-configured ordered set of trajectory points.
[0059] If the target location is determined not to be within the specified rule graphic corresponding to the preset path, the distance from the target location to each line segment in the preset path can be determined separately, and the minimum value among the distances from the target location to each line segment in the preset path can be determined (which can be called the minimum distance).
[0060] Once the minimum distance is determined, it can be compared with the target distance threshold.
[0061] For example, the target distance threshold can be 0, or the target distance threshold can be a distance threshold set during path configuration.
[0062] Specifically, if the target distance threshold is 0, the target location is not on the preset path, which means the target location is deviating from the preset path.
[0063] For example, if the minimum distance is greater than the target distance threshold, it can be determined that the target position deviates from the preset path; if the minimum distance is less than or equal to the target distance threshold, it can be determined that the target position does not deviate from the preset path.
[0064] In one example, the above calculation based on a specific algorithm to determine whether the target location is within a preset area may include:
[0065] The target distance threshold is extended outward from the boundary of the preset area to obtain the extended preset area; the ray method is used to determine whether the target position is inside the extended preset area; if the target position is inside the extended preset area, the target position is determined to be within the preset area; if the target position is not inside the extended preset area, the target position is determined to be outside the preset area.
[0066] For example, consider a scenario with a preset area, such as a geofence scenario.
[0067] For example, in order to determine whether the target location is within a preset area, the target distance threshold can be extended outward from the boundary of the preset area to obtain the extended preset area.
[0068] For example, the target distance threshold can be 0, or it can be a distance threshold set during the region configuration.
[0069] When the target distance threshold is 0, the expanded preset area is the same as the original preset area.
[0070] For example, for a target location, the ray casting method can be used to determine whether the target location is within the expanded preset area.
[0071] For example, a ray can be drawn from the target location, and the number of intersections between the ray and the boundary of the expanded preset area can be determined. If the number of intersections is odd, the target location is determined to be inside the expanded preset area; if the number of intersections is even, the target location is determined to be outside the expanded preset area.
[0072] In some embodiments, for any given location data, the computational complexity of determining whether the location corresponding to the location data is within a specified rule graph is lower than the computational complexity of calculating based on a specific algorithm.
[0073] For example, in order to reduce the data processing pressure of GPS data processing services, the computational complexity of calculating whether the location corresponding to GPS data is within a specified regular graphic should be lower than the computational complexity of calculating based on a specific algorithm.
[0074] In some embodiments, before determining whether the target location corresponding to the currently received positioning data is within a specified rule graph corresponding to a preset path or preset area, the method may further include:
[0075] Upon receiving a configuration request for the preset path or preset region, determine the specified rule graph corresponding to the preset path or preset region.
[0076] For example, in order to improve data processing efficiency, for any preset path or preset area, upon receiving a configuration request for the preset path or preset area, the specified rule pattern corresponding to the preset path or preset area can be determined. Thus, in subsequent processes, upon receiving reported GPS data, it can be directly determined whether the location corresponding to the GPS data is within the specified rule pattern corresponding to the preset path or preset area, without needing to determine the specified rule pattern corresponding to the preset path or preset area again.
[0077] In one example, the configuration request above may include specifying the type of rule graph;
[0078] The aforementioned determination of the specified rule graph corresponding to the preset path or preset area may include:
[0079] Based on the type of specified graphic included in the configuration request, determine the specified rule graphic of that type corresponding to the preset path or preset area.
[0080] For example, to improve the flexibility and controllability of determining the specified rule graphic corresponding to a preset path or preset area, when configuring a preset path or preset area, the type of the specified rule graphic corresponding to that preset path or preset area can also be specified, such as a circle or a rectangle.
[0081] For example, the type of the specified rule graphic corresponding to the preset path or preset area can be set by the configuration personnel of the preset path or preset area according to their needs.
[0082] Accordingly, upon receiving a configuration request for a preset path or preset region, the type of the specified rule graph included in the configuration request can be obtained, and the specified rule graph of that type corresponding to the preset path or preset region can be determined based on the type of the specified rule graph.
[0083] It should be noted that, in the embodiments of this application, the type of the specified rule graphic corresponding to the preset path or preset area can also be configured by default, such as the default configuration being a circle. For any preset path or preset area, when the specified rule graphic corresponding to the preset path or preset area is determined, the circle corresponding to the preset path or preset area can be determined.
[0084] In some embodiments, the specified rule graph corresponding to the preset path or preset region is the minimum bounding specified rule graph of the preset path.
[0085] For example, considering that the larger the area covered by the specified rule pattern, the worse the GPS data filtering effect, in order to improve the effect of GPS data filtering based on the specified rule pattern and reduce the data processing pressure of the GPS data processing service to a greater extent, the specified rule pattern corresponding to the preset path or preset area can be the minimum bounding specified rule pattern of the preset path or preset area, so as to ensure that the area covered by the specified rule pattern is minimized as much as possible when GPS data filtering can be performed based on the specified rule pattern.
[0086] In some embodiments, when a preset distance threshold is set for a preset path, the specified rule graph corresponding to the preset path or preset region is obtained by extending the preset distance threshold outward from the minimum bounding specified rule graph of the preset path or preset region.
[0087] For example, in some scenarios, the corresponding event may only be triggered when the distance between the real-time location and the preset path is less than or equal to a preset distance threshold, or exceeds the preset distance threshold.
[0088] For example, taking trajectory deviation as an example, a trajectory deviation event is usually triggered when the distance between the GPS data reporting entity and the preset path exceeds a preset distance threshold.
[0089] Accordingly, in order to filter GPS data more accurately based on the specified rule pattern, when a preset distance threshold is set for a preset path or preset area, the specified rule pattern corresponding to the preset path or preset area can be obtained by extending the minimum circumscribed specified rule pattern of the preset path or preset area outward by the preset distance threshold.
[0090] For example, assuming the specified regular shape is a circle, to determine the specified regular shape corresponding to a preset path or preset region, one can first determine the minimum circumscribed circle of the preset path or preset region, and then extend this minimum circumscribed circle outward by a preset distance threshold to obtain the circle corresponding to the preset path or preset region. The radius of this circle is the sum of the radius of the minimum circumscribed circle of the preset path or preset region and the preset distance threshold. Alternatively, one can first determine the radius of the minimum circumscribed circle of the preset path or preset region, and then use the sum of the radius of the minimum circumscribed circle and the preset distance threshold as the radius of the circle obtained by extending this minimum circumscribed circle outward by the preset distance threshold. A circle can then be drawn based on this radius to obtain the specified regular shape.
[0091] For example, assuming the specified regular shape is a rectangle, in order to determine the specified regular shape corresponding to the preset path or preset area, we can first determine the smallest bounding rectangle of the preset path or preset area, and then extend all four sides of the small bounding rectangle outward by a preset distance threshold to obtain the rectangle corresponding to the preset path or preset area.
[0092] In one example, the specified rule graphic corresponding to the preset path or preset area is a circle;
[0093] The minimum bounding rule graph for determining the preset path or preset region mentioned above may include:
[0094] If the number of path points in the path point set corresponding to the preset path or preset area is greater than 3, determine the first path point and the second path point with the largest distance in the path point set.
[0095] Determine the third path point that is the longest distance from the target line to the set of path points. The target line is the line that passes through the first and second path points.
[0096] Determine the circumcircle of the triangle formed by the first path point, the second path point, and the third path point.
[0097] For example, let's take a circle as an example, as specified in the above rules.
[0098] If the number of path points in the path point set corresponding to the preset path or preset area is greater than 3, the distance between each path point in the path point set can be determined, and the two path points with the largest distance can be determined (referred to as the first path point and the second path point in this article).
[0099] Once the first and second path points are determined, the distances from each of the other path points to the straight line passing through the first and second path points (referred to as the target straight line in this paper) can be determined, and the path point with the largest distance to the target straight line (referred to as the third path point in this paper) can be determined.
[0100] Once the first path point, the second path point, and the third path point are determined, the circumcircle of the triangle formed by the first path point, the second path point, and the third path point can be defined as the minimum circumcircle of the preset path or the preset region.
[0101] It should be noted that when there are 2 path points in the path point set, or when there are 3 path points in the path point set but the 3 path points are collinear, the circle with the line connecting the 2 path points as its diameter can be determined as the minimum contiguous circle of the preset path.
[0102] If the number of path points in the path point set is 3, and these 3 points are not collinear, the circumcircle of the triangle formed by these 3 path points can be determined as the minimum circumcircle of the preset path or preset region.
[0103] In some embodiments, the specified rule graphic is a circle.
[0104] In step S110, determining whether the target location corresponding to the currently received positioning data is within the specified rule graph corresponding to the preset path or preset area may include:
[0105] Determine the distance from the target location to the center of the circle corresponding to the preset path or preset area;
[0106] If the distance is greater than the radius of the circle corresponding to the preset path or preset area, it is determined that the target position corresponding to the currently received positioning data is not inside the circle corresponding to the preset path or preset area.
[0107] If the distance is less than or equal to the radius of the circle corresponding to the preset path or preset area, it is determined that the target position corresponding to the currently received positioning data is inside the specified rule graphic corresponding to the preset path or preset area.
[0108] For example, let's take a circle as an example, as specified in the above rules.
[0109] For the currently received GPS data, the distance from the location corresponding to the GPS data (i.e. the aforementioned target location) to the center of the circle corresponding to the preset path or preset area can be determined, and the distance can be compared with the radius of the circle.
[0110] If the distance is greater than the radius of the circle, it can be determined that the target location corresponding to the currently received GPS data is not inside the circle corresponding to the preset path or preset area.
[0111] If the distance is less than or equal to the radius of the circle, it can be determined that the target corresponding to the currently received GPS data is inside the circle corresponding to the preset path or preset area.
[0112] As can be seen, when the specified rule shape is a circle, it is only necessary to calculate the distance from the location corresponding to the real-time positioning data to the center of the circle corresponding to the preset path or preset area, and compare the distance with the radius of the circle to determine whether the location corresponding to the real-time positioning data is inside the specified rule shape corresponding to the preset path or preset area, thereby achieving positioning data filtering and greatly reducing the computational complexity.
[0113] However, it should be recognized that the specified regular shape is not limited to a circle, and compared to a circle, the area covered by other specified regular shapes such as rectangles or triangles can usually be smaller, and their positioning data filtering effect can be better. That is, for specified regular shapes other than circles such as rectangles or triangles, although the computational complexity of positioning data filtering is higher, it may achieve better positioning data filtering effect. Therefore, in practical applications, the specified regular shape corresponding to the preset path or preset area can be determined according to the needs of the actual scenario.
[0114] To enable those skilled in the art to better understand the technical solutions provided in the embodiments of this application, the technical solutions provided in the embodiments of this application are described below with reference to specific examples.
[0115] In this embodiment, GPS data is used as the location data.
[0116] Considering that in real-world scenarios, preset paths or preset areas are usually relatively small, and GPS data reporting entities (such as vehicles) often travel in relatively large areas outside of preset paths or preset areas, this characteristic can be used to effectively reduce the number of calculations for specific algorithms, reduce the data processing pressure on GPS data processing services, and improve the processing performance of GPS data processing services.
[0117] In this embodiment, such as Figure 2 As shown, the data processing system may include a GPS data receiving module, a preset path / area module, a GPS data preprocessing module, a specific algorithm calculation module, and a conclusion processing module. Among them:
[0118] The preset path / region module can receive preset paths or preset regions configured by the user, and upon receiving a configuration request, determine the specified rule graph corresponding to the preset path or preset region.
[0119] The GPS data preprocessing module adds a fast basic verification before executing specific algorithm processing to determine whether the location corresponding to the received GPS data is within the specified rule map corresponding to the preset path or preset area.
[0120] In this embodiment, a circle is taken as an example of the specified rule shape.
[0121] For example, such as Figure 3 As shown, during the process of receiving GPS data reports, for the currently received GPS data, the distance between the location corresponding to the GPS data (i.e., the target location mentioned above) and the center of the circle corresponding to the preset path or preset area can be determined, and the distance can be compared with the radius of the circle.
[0122] If the distance is greater than the radius of the circle, that is, if the target location corresponding to the currently received GPS data is not inside the circle corresponding to the preset path or preset area, it is not necessary to perform specific algorithm calculations (i.e., it is not necessary to use the preset path or preset area and GPS data as parameters to perform calculations according to a specific algorithm), and relevant conclusions can be drawn.
[0123] For example, in a geofencing scenario, it can be determined whether the entity reporting GPS data has not entered the fence or has left the fence.
[0124] If the distance is less than or equal to the radius of the circle, that is, if the target location corresponding to the currently received GPS data is inside the circle corresponding to the preset path or preset area, a specific algorithm can be used to calculate and draw relevant conclusions based on the results of the specific algorithm calculation, that is, to determine whether the target location deviates from the preset path, or whether it is in the preset area (whether it has entered the preset area or left the preset area, etc.).
[0125] As can be seen, by adding a GPS data preprocessing module, the GPS data preprocessing module only needs to perform the calculation of the straight-line distance between two points and the comparison of distance and radius, with a time complexity of O(1). Compared with the performance consumption of performing specific algorithm calculations each time, the performance consumption is almost negligible.
[0126] For example, the geofencing algorithm is generally the ray method, with a time complexity of O(N), and the path yaw algorithm also has a time complexity of O(N); N is the number of path points in the path point set corresponding to the preset path or preset area. When the number of path points in the path point set corresponding to the preset path or preset area is large, the computational cost of a particular algorithm is greater.
[0127] In this embodiment, considering that in practical applications, for virtualization applications with preset paths or preset regions, a distance threshold (i.e., the aforementioned preset distance threshold) can also be set.
[0128] Let's take geofencing and trajectory deviation as examples again.
[0129] For geofencing, a pre-triggered fence distance (i.e., a preset distance threshold) can be set to enrich the application of geofencing. For example, ... Figure 4AAs shown, when the GPS data reports that the location of an entity is close to the fenced area and reaches a preset distance threshold (which can be denoted as distance), an early warning will be issued first.
[0130] In this scenario, the circle corresponding to the preset area can be determined in the following way:
[0131] Calculate the minimum circumcircle of the fenced area (assuming the center is C1 and the radius is R1);
[0132] Based on a preset distance, the minimum circumcircle is expanded outward to obtain a circle corresponding to the preset region, i.e., a circle with center C1 and radius R1 + distance, which is used to filter GPS data. A schematic diagram can be shown below. Figure 4B As shown.
[0133] For trajectory deviations, a trigger distance for the deviation can be set (i.e., a preset distance threshold). For example, Figure 5A As shown, when the GPS reports the location of an entity deviates from the preset path and reaches a preset distance threshold (such as the distance mentioned above), a prompt can be issued.
[0134] In this scenario, the circle corresponding to the preset path can be determined in the following way:
[0135] Calculate the minimum circumcircle of the preset path (assuming the center is C2 and the radius is R2);
[0136] Based on the preset distance, the minimum circumcircle is expanded outward to obtain the circle corresponding to the preset path, that is, a circle with center C2 and radius R2 + distance, which is used to filter GPS data. A schematic diagram can be shown below. Figure 5B As shown.
[0137] It should be noted that the minimum circumcircle of a preset path can be calculated by calculating the minimum circumcircle of a polygon. For yaw path scenarios, although the preset path is not a polygon, it can be assumed that the beginning and end points of the path are connected, forming a polygon. Therefore, the minimum circumcircle of the preset path can be obtained by calculating the minimum circumcircle of the polygon.
[0138] The following explains how to calculate the minimum circumcircle of a polygon.
[0139] 1. For scenarios where the number of path points in the path point set is less than or equal to 3:
[0140] 1.1 If the number of path points is 2, or the number of path points is 3, but the 3 path points are collinear, then the circle with the diameter of the straight line passing through the 2 or 3 path points is the minimum circumcircle of the preset path or preset area.
[0141] 1.2 If there are 3 path points and these 3 path points are not collinear, then the smallest circumcircle of the triangle formed by these 3 path points is the smallest circumcircle of the preset path or preset region.
[0142] 2. For scenarios where the number of path points in the path point set exceeds 3:
[0143] 2.1 Determine the path points A and B with the largest distance in the path point set (i.e., the first and second path points mentioned above);
[0144] 2.2 Calculate the path point C (i.e. the third path point mentioned above) that is the furthest from the line AB among the other path points in the path point set, excluding path points A and B.
[0145] 2.3. Path points A, B, and C form triangle ABC. Calculate the minimum circumcircle of triangle ABC, which is the minimum circumcircle of the preset path or preset region.
[0146] It should be noted that the minimum circumscribed shape of the preset path or preset area is not limited to a circle, but a circle has many general advantages. For example, after calculating the circumscribed circle, you only need to save the center and radius. To determine the position relationship between the real-time GPS data and the circle, you only need to calculate the distance between the GPS data location and the center of the circle and compare that distance with the radius of the circle.
[0147] However, in certain special scenarios, such as a very complex set of points with both a minimum bounding rectangle and a minimum bounding circle, the area covered by the minimum bounding rectangle is usually smaller than that covered by the minimum bounding circle. In such scenarios, the minimum bounding rectangle can filter out more GPS data, reducing the amount of GPS data that needs to be calculated using specific algorithms. From the perspective of the amount of GPS data that can be filtered out, the minimum bounding rectangle has an advantage. However, from the perspective of the complexity of calculating the positional relationship (whether it is inside or not) between the location corresponding to the real-time GPS data and the minimum bounding regular shape, the minimum bounding circle has an advantage. Therefore, the minimum bounding regular shape can be selected according to actual needs.
[0148] The method provided in this application has been described above. The apparatus provided in this application is described below:
[0149] Please see Figure 6 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application, as shown below. Figure 6 As shown, the data processing apparatus may include:
[0150] The receiving unit 610 is used to receive location data reports;
[0151] The determining unit 620 is used to determine whether the target location corresponding to the positioning data currently received by the receiving unit 610 is inside a specified rule pattern corresponding to a preset path or preset area; wherein, the preset path or preset area is inside the specified rule pattern;
[0152] The processing unit 630 is configured to determine, when the target position is not within the specified rule graphic, that the target position deviates from the preset path or is not within the preset area.
[0153] In some embodiments, the processing unit 630 is further configured to perform calculations based on a specific algorithm to determine whether the target location deviates from the preset path or is within the preset area when the target location is within the specified rule graph.
[0154] In some embodiments, the processing unit 630 is specifically configured to determine the minimum value among the distances from the target location to each line segment in the preset path, and compare the minimum value with a preset distance threshold; if the minimum value is greater than the preset distance threshold, determine that the target location deviates from the preset path; otherwise, determine that the target location does not deviate from the preset path.
[0155] In some embodiments, the processing unit 630 is specifically configured to extend the boundary of the preset area outward by a target distance threshold to obtain an extended preset area; determine whether the target position is inside the extended preset area using a ray method; if the target position is inside the extended preset area, determine that the target position is in the preset area; if the target position is not inside the extended preset area, determine that the target position is not in the preset area.
[0156] In some embodiments, the specified rule graph corresponding to the preset path or preset region is the minimum bounding specified rule graph of the preset path.
[0157] In some embodiments, when a preset distance threshold is set for a preset path or preset region, the specified rule graph corresponding to the preset path or preset region is obtained by extending the preset distance threshold outward from the minimum bounding specified rule graph of the preset path or preset region.
[0158] In some embodiments, for any location data, the computational complexity of determining whether the location corresponding to the location data is inside the specified rule graph is lower than the computational complexity of calculating according to a specific algorithm.
[0159] In some embodiments, the specified rule graphic corresponding to the preset path or preset region is a circle;
[0160] The determining unit is specifically used to determine the distance from the target location to the center of the circle corresponding to the preset path or preset area; if the distance is greater than the radius of the circle corresponding to the preset path or preset area, it is determined that the target location is not inside the circle corresponding to the preset path or preset area; if the distance is less than or equal to the radius of the circle corresponding to the preset path or preset area, it is determined that the target location is inside the circle corresponding to the preset path or preset area.
[0161] This application also provides an electronic device, including a processor and a memory, wherein the memory is used to store computer programs; and the processor is used to execute the programs stored in the memory to implement the data processing method described above.
[0162] Please see Figure 7 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. The electronic device may include a processor 701 and a memory 702 storing machine-executable instructions. The processor 701 and the memory 702 can communicate via a system bus 703. Furthermore, by reading and executing the machine-executable instructions corresponding to data processing logic in the memory 702, the processor 701 can execute the data processing method described above.
[0163] The memory 702 mentioned in this document can be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, etc. For example, machine-readable storage media can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid-state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or combinations thereof.
[0164] In some embodiments, a machine-readable storage medium, such as Figure 7 The memory 702 in the memory, which is a machine-readable storage medium, stores machine-executable instructions that, when executed by a processor, implement the data processing method described above. For example, the machine-readable storage medium may be ROM, RAM, CD-ROM, magnetic tape, floppy disk, or optical data storage device.
[0165] This application also provides a computer program product, which includes a computer program, and when a processor executes the computer program, it causes the processor to perform the data processing method described above.
[0166] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, 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 limitations, 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.
[0167] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A data processing method, characterized in that, include: Receive location data reports; Determine whether the target location corresponding to the currently received positioning data is inside a specified rule pattern corresponding to a preset path or preset area; wherein, the preset path or preset area is inside the specified rule pattern; If the target location is not within the specified rule graphic, it is determined that the target location deviates from the preset path or is not within the preset area; If the target location is within the specified rule shape, a specific algorithm is used to calculate whether the target location deviates from the preset path or is within the preset area. Among them, for any location data, the computational complexity of determining whether the location corresponding to the location data is inside the specified rule graph is lower than the computational complexity of calculating according to a specific algorithm. The step of determining whether the target location deviates from the preset path or is within the preset area based on a specific algorithm includes: Determine the minimum distance among the line segments in the preset path from the target location, and compare the minimum distance with a target distance threshold; if the minimum distance is greater than the target distance threshold, determine that the target location deviates from the preset path; otherwise, determine that the target location does not deviate from the preset path. or, The target distance threshold is extended outward from the boundary of the preset area to obtain the extended preset area; the ray method is used to determine whether the target position is inside the extended preset area; if the target position is inside the extended preset area, the target position is determined to be in the preset area; if the target position is not inside the extended preset area, the target position is determined not to be in the preset area.
2. The method according to claim 1, characterized in that, The specified rule graph corresponding to the preset path or preset region is the minimum bounding specified rule graph of the preset path or preset region. or, When a preset distance threshold is set for a preset path or preset area, the specified rule graph corresponding to the preset path or preset area is obtained by extending the preset distance threshold outward from the minimum bounding specified rule graph of the preset path or preset area.
3. The method according to claim 1, characterized in that, The specified rule graphic corresponding to the preset path or preset area is a circle; Determining whether the target location corresponding to the currently received positioning data is within a specified rule graph corresponding to a preset path or preset area includes: Determine the distance from the target location to the center of the circle corresponding to the preset path or preset area; If the distance is greater than the radius of the circle corresponding to the preset path or preset area, it is determined that the target position is not inside the circle corresponding to the preset path or preset area. If the distance is less than or equal to the radius of the circle corresponding to the preset path or preset area, the target position is determined to be inside the circle corresponding to the preset path or preset area.
4. A data processing apparatus, characterized in that, include: The receiving unit is used to receive location data reports; A determining unit is used to determine whether the target location corresponding to the positioning data currently received by the receiving unit is inside a specified rule pattern corresponding to a preset path or preset area; wherein the preset path or preset area is inside the specified rule pattern; The processing unit is configured to determine that the target location deviates from the preset path or is not within the preset area when the target location is not within the specified rule graphic. The processing unit is further configured to, when the target position is within the specified rule graphic, perform calculations according to a specific algorithm to determine whether the target position deviates from the preset path or is within the preset area; Among them, for any location data, the computational complexity of determining whether the location corresponding to the location data is inside the specified rule graph is lower than the computational complexity of calculating according to a specific algorithm. Specifically, the processing unit is used to determine the minimum distance among the distances from the target location to each line segment in the preset path, and compare the minimum distance with a preset distance threshold; if the minimum distance is greater than the preset distance threshold, determine that the target location deviates from the preset path; otherwise, determine that the target location does not deviate from the preset path. or, The target distance threshold is extended outward from the boundary of the preset area to obtain the extended preset area; the ray method is used to determine whether the target position is inside the extended preset area; if the target position is inside the extended preset area, the target position is determined to be in the preset area; if the target position is not inside the extended preset area, the target position is determined not to be in the preset area.
5. The apparatus according to claim 4, characterized in that, The specified rule graph corresponding to the preset path or preset region is the minimum bounding specified rule graph of the preset path. or, When a preset distance threshold is set for a preset path or preset region, the specified rule graph corresponding to the preset path or preset region is obtained by expanding the preset distance threshold outward from the minimum bounding specified rule graph of the preset path or preset region. And / or, The specified rule graphic corresponding to the preset path or preset area is a circle; The determining unit is specifically used to determine the distance from the target location to the center of the circle corresponding to the preset path or preset area; if the distance is greater than the radius of the circle corresponding to the preset path or preset area, it is determined that the target location is not inside the circle corresponding to the preset path or preset area; if the distance is less than or equal to the radius of the circle corresponding to the preset path or preset area, it is determined that the target location is inside the circle corresponding to the preset path or preset area.
6. An electronic device, characterized in that, The method includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the method as described in any one of claims 1-3.
7. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, causes the processor to perform the method described in any one of claims 1-3.
Citation Information
Patent Citations
Robot positioning method, positioning device, management system and storage medium
CN113390415A