Electronic fence detection method and device, computer equipment and readable storage medium

By constructing the spatial index of electronic fences and combining position judgment and buffer detection, the problem of high detection error and high calculation amount in traditional methods when dealing with complex fences and large-scale monitoring scenarios is solved, and more efficient and accurate electronic fence detection is achieved.

CN120143047APending Publication Date: 2025-06-13CHINA SOUTHERN POWER GRID INTERNET SERVICE CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510229763.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-28
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

Traditional electronic fence detection methods are difficult to accurately match fences with complex irregular shapes, resulting in large detection errors. When processing large amounts of positioning data of monitoring objects, the calculation amount is high, making it difficult to meet the real-time requirements.

Method used

By constructing the spatial index of electronic fences, the fence areas that may intersect are quickly filtered out, and the position judgment and fence buffer are combined for detection, to obtain the position status of the target object in the target area.

Benefits of technology

It improves the accuracy of electronic fence detection, reduces the calculation amount of position judgment, and effectively improves the detection and processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120143047A_ABST
    Figure CN120143047A_ABST
Patent Text Reader

Abstract

The invention relates to an electronic fence detection method and device, computer equipment and a readable storage medium. The method comprises the following steps: constructing a spatial index of an electronic fence corresponding to a target area to be detected, performing positioning monitoring on each target object based on the target area, and constructing each point object for querying in the spatial index; according to the spatial index of the electronic fence, screening out a plurality of associated fence areas corresponding to each point object; obtaining a position judgment result of any point object by judging a position relationship between any point object and the corresponding multiple associated fence areas, and determining a buffer area detection result of any point object according to buffer area configuration information of the multiple associated fence areas corresponding to any point object; and in combination with the position judgment result of each point object and the buffer area detection result, obtaining the position state of each target object in the target area. By adopting the method, the calculation amount of position judgment can be reduced, and the accuracy and processing efficiency of electronic fence detection are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular, to an electronic fence detection method, device, computer device, computer-readable storage medium, and computer program product. Background Art

[0002] As an important means of spatial area monitoring, the electronic fence technology is widely used in vehicle management, personnel positioning, equipment tracking, etc. By analyzing the position data of monitored objects in real time, it is determined whether they are within a preset electronic fence area.

[0003] However, the traditional electronic fence detection method still has many limitations in practical applications. On the one hand, the traditional method usually relies on approximating complex fence shapes as simple geometric figures for approximation processing. It is difficult to accurately fit the irregular shapes of actual fences, resulting in large detection errors. Moreover, in actual application scenarios, fence boundaries often present complex polygons or irregular curves, and the approximation processing of simple geometric shapes easily leads to incorrect judgment of the target positions at the boundaries of the approximate areas, thus affecting the accuracy of detection results. On the other hand, when processing the positioning data of a large number of monitored objects, the traditional method usually needs to compare and calculate each object with the fence boundary one by one. As the number of monitored objects increases, the computational complexity grows linearly, resulting in a high time complexity of the algorithm and making it difficult to meet the real-time requirements.

[0004] Therefore, for complex fence shapes and large-scale monitoring scenarios, the related technologies have obvious deficiencies in terms of detection accuracy and computational efficiency. Summary of the Invention

[0005] Based on this, it is necessary to provide an electronic fence detection method, device, computer device, computer-readable storage medium, and computer program product that can improve the detection efficiency for the above technical problems.

[0006] In a first aspect, the present application provides an electronic fence detection method, and the method includes:

[0007] Construct a spatial index of the electronic fence corresponding to the target area to be detected, and for each target object for positioning monitoring based on the target area, construct point objects for querying in the spatial index;

[0008] According to the spatial index of the electronic fence, screen out multiple associated fence areas corresponding to each point object; there may be intersecting polygons between each associated fence area and the corresponding point object;

[0009] By determining the positional relationship between any point object and the corresponding multiple associated fence regions, obtaining the position determination result of the any point object, and determining the buffer detection result of the any point object according to the buffer configuration information of the multiple associated fence regions corresponding to the any point object;

[0010] Combining the position determination results and buffer detection results of each of the point objects to obtain the position status of each of the target objects in the target region.

[0011] In one embodiment, before the steps of constructing a spatial index of the electronic fence corresponding to the target region to be detected, and constructing each point object for querying in the spatial index based on each target object for positioning monitoring in the target region, the method further includes:

[0012] Obtaining the electronic fence corresponding to the target region and the positioning data of each object to be processed; the positioning data includes a plurality of continuously positioned position coordinates;

[0013] Performing coordinate rationality check according to the range of the electronic fence, and taking the object to be processed corresponding to the position coordinates passing the check as the monitoring object; the range of the electronic fence is represented by a sequence of polygon vertex coordinates.

[0014] In one embodiment, the constructing a spatial index of the electronic fence corresponding to the target region to be detected, and constructing each point object for querying in the spatial index based on each target object for positioning monitoring in the target region includes:

[0015] Constructing the spatial index of the electronic fence by using the transformed data structure of the sequence of polygon vertex coordinates;

[0016] Taking any one of the monitoring objects as a target object, and constructing a point object for querying in the spatial index according to the position coordinates of the target object.

[0017] In one embodiment, the obtaining the position determination result of any point object by determining the positional relationship between the any point object and the corresponding multiple associated fence regions includes:

[0018] Performing grid division on the multiple associated fence regions to determine the polygons and the point object included in each grid;

[0019] Performing a positional relationship determination on any point object, the polygon of the grid where the any point object is located, and the polygons of the adjacent grids of the any point object to obtain first determination information;

[0020] Processing the arbitrary point object and the polygon of the grid where the arbitrary point object is located by using a preset ray judgment method to obtain second judgment information;

[0021] Combining the first judgment information and the second judgment information to obtain a position judgment result of the arbitrary point object.

[0022] In one embodiment, the buffer detection result is used to represent whether there is a secondary position judgment result. Determining the buffer detection result of the arbitrary point object according to the buffer configuration information of multiple associated fence regions corresponding to the arbitrary point object includes:

[0023] Determining a buffer boundary according to the buffer configuration information of multiple associated fence regions corresponding to the arbitrary point object;

[0024] If the position judgment result of the arbitrary point object is at the buffer boundary, re-judging by expanding the buffer and analyzing the position change trend based on the historical position record information of the monitoring object to obtain the secondary position judgment result of the arbitrary point object.

[0025] In one embodiment, combining the position judgment results and buffer detection results of each point object to obtain the position status of each target object in the target region includes:

[0026] In the case of having a secondary position judgment result, obtaining the position status of the corresponding target object in the target region according to the position judgment result and the secondary position judgment result.

[0027] In a second aspect, the present application further provides an electronic fence detection device, and the device includes:

[0028] An index construction module, configured to construct a spatial index of an electronic fence corresponding to a target region to be detected, and construct each point object for querying in the spatial index for each target object performing positioning monitoring based on the target region;

[0029] A fence region screening module, configured to screen out multiple associated fence regions corresponding to each point object according to the spatial index of the electronic fence; there may be intersecting polygons between each associated fence region and the corresponding point object;

[0030] A position judgment module, configured to obtain a position judgment result of an arbitrary point object by judging the position relationship between the arbitrary point object and the corresponding multiple associated fence regions, and determine the buffer detection result of the arbitrary point object according to the buffer configuration information of the multiple associated fence regions corresponding to the arbitrary point object;

[0031] A position status obtaining module, configured to obtain the position status of each target object in the target area by combining the position judgment results of each point object and the buffer detection results.

[0032] In a third aspect, the present application further provides a computer device, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the steps of the above method are implemented.

[0033] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0034] In a fifth aspect, the present application further provides a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0035] The above electronic fence detection method, device, computer device, computer-readable storage medium, and computer program product construct a spatial index of the electronic fence corresponding to the target area to be detected, and for each target object for positioning and monitoring based on the target area, construct each point object for querying in the spatial index. Then, according to the spatial index of the electronic fence, screen out multiple associated fence areas corresponding to each point object. There may be intersecting polygons between each associated fence area and the corresponding point object. By judging the position relationship between any point object and the corresponding multiple associated fence areas, obtain the position judgment result of any point object, and according to the buffer configuration information of the multiple associated fence areas corresponding to any point object, determine the buffer detection result of any point object. Furthermore, by combining the position judgment results and buffer detection results of each point object, obtain the position status of each target object in the target area, realizing the optimization of electronic fence detection. By quickly screening out the possibly intersecting fence areas based on the spatial index of the electronic fence, and combining position judgment and fence buffer for detection, obtain the position status of each target object in the target area, which can improve the accuracy of electronic fence detection, reduce the computational amount of position judgment, and effectively improve the detection and processing efficiency. Description of the Drawings

[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments of the present application or related technologies. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.

[0037] Figure 1 It is a schematic flowchart of an electronic fence detection method in an embodiment;

[0038] Figure 2 It is a schematic diagram of the electronic fence detection process in an embodiment;

[0039] Figure 3 It is a schematic flow diagram of an electronic fence detection method in another embodiment;

[0040] Figure 4 It is a structural block diagram of an electronic fence detection device in an embodiment;

[0041] Figure 5 It is the internal structure diagram of a computer device in an embodiment. Detailed implementation manners

[0042] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0043] In the field of logistics transportation, the application scenarios of electronic fence detection algorithms are very extensive. For example, for the real-time monitoring of logistics distribution vehicles, a specific circular fence can be set, such as a circular area centered on the distribution site. By calculating the distance between the vehicle position and the center of the circle and comparing it with the radius, it can be determined whether the vehicle deviates from the specified route or reaches the designated area; for the goods storage area of a large logistics warehouse, a rectangular fence can be used to define the goods storage range, and it can be determined whether the goods are placed in the correct position according to whether the goods coordinates are within the range defined by the four sides of the rectangle.

[0044] However, for complex-shaped logistics areas, such as the boundaries of irregular logistics parks or special-shaped goods storage areas, traditional methods use simple geometric shape approximation or a large number of comparison calculations between the object and the fence boundary, and the calculation process is complicated and the efficiency is not high.

[0045] The present application proposes an electronic fence detection method. By quickly screening out the fence areas that may intersect based on the spatial index of the electronic fence, and further combining position judgment and fence buffer for detection, the position status of each target object in the target area can be obtained, thereby reducing the calculation amount of position judgment and effectively improving the electronic fence detection efficiency.

[0046] In an exemplary embodiment, such as Figure 1As shown in the figure, an electronic fence detection method is provided. In this embodiment, the method is applied to a terminal for illustration. It can be understood that the method can also be applied to a server or a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps 101 to 104. Among them:

[0047] Step 101: Construct a spatial index of the electronic fence corresponding to the target area to be detected, and for each target object for positioning and monitoring based on the target area, construct point objects for querying in the spatial index.

[0048] As an example, the target area can be a location area that needs to be monitored in terms of spatial area, such as a logistics park, a goods storage area in a large logistics warehouse, etc.

[0049] In practical applications, an R-tree structure can be used to construct a spatial index of the electronic fence corresponding to the target area to be detected, and for each target object that needs to be positioned and monitored, a point object is constructed according to the position coordinates of each target object for querying through the spatial index.

[0050] Step 102: According to the spatial index of the electronic fence, filter out multiple associated fence areas corresponding to each point object.

[0051] Among them, there may be intersecting polygons between each associated fence area and the corresponding point object.

[0052] After obtaining the spatial index of the electronic fence, based on the query function of the R-tree, for the point objects constructed according to the position coordinates of each target object, the polygons corresponding to the polygon boundary rectangles that may intersect with the point objects can be quickly filtered out, that is, multiple associated fence areas.

[0053] Exemplarily, starting from the root node of the R-tree, the position relationship between the point object and each minimum bounding rectangle (MBR) in the node can be compared. If the point object is within an MBR or intersects with the MBR, the corresponding child node of the MBR can be recursively queried until all possible intersecting polygons are found.

[0054] Step 103: By judging the position relationship between any point object and the corresponding multiple associated fence areas, obtain the position judgment result of the any point object, and determine the buffer detection result of the any point object according to the buffer configuration information of the multiple associated fence areas corresponding to the any point object.

[0055] Among them, the buffer configuration information is used to indicate the buffer parameters of the set polygon fence, such as the buffer width.

[0056] In a specific implementation, for the polygon filtered based on any point object, the grid differentiation method and the ray method can be combined to determine the position, so as to obtain the position determination result of any point object. Considering that the positioning data may have errors, buffer zones can be set at the fence boundaries for detection to obtain the buffer zone detection result of any point object.

[0057] Step 104: Combine the position determination results and buffer zone detection results of each point object to obtain the position status of each target object in the target area.

[0058] Exemplarily, according to the position determination results and buffer zone detection results, the position status of each target object to be monitored in the target area can be output.

[0059] Compared with the traditional method, the technical solution of this embodiment can improve the accuracy of electronic fence detection, accurately process fence areas with various complex shapes, and effectively reduce the false alarm rate by quickly filtering the potentially intersecting fence areas with the help of the R-tree structure, considering that the positioning data may have errors, and combining the set fence buffer zones for judgment. At the same time, when facing a large number of monitored objects and high-frequency positioning data updates, it can quickly and accurately determine the target position, reduce the computational amount of position determination, and effectively improve the detection and processing efficiency of the electronic fence.

[0060] In the above electronic fence detection method, by constructing the spatial index of the electronic fence corresponding to the target area to be detected, and for each target object performing positioning monitoring based on the target area, constructing each point object for querying in the spatial index, then according to the spatial index of the electronic fence, screening out multiple associated fence areas corresponding to each point object, by judging the position relationship between any point object and the corresponding multiple associated fence areas, obtaining the position determination result of any point object, and according to the buffer zone configuration information of the multiple associated fence areas corresponding to any point object, determining the buffer zone detection result of any point object. Furthermore, by combining the position determination results and buffer zone detection results of each point object, the position status of each target object in the target area is obtained, realizing the optimization of electronic fence detection. By quickly screening out the potentially intersecting fence areas based on the spatial index of the electronic fence, and combining position determination and fence buffer zones for detection, obtaining the position status of each target object in the target area, it can improve the accuracy of electronic fence detection, reduce the computational amount of position determination, and effectively improve the detection and processing efficiency.

[0061] In an exemplary embodiment, before the step of constructing the spatial index of the electronic fence corresponding to the target area to be detected, and for each target object performing positioning monitoring based on the target area, constructing each point object for querying in the spatial index, the following steps may further be included:

[0062] Obtain the electronic fence corresponding to the target area and the positioning data of each object to be processed; the positioning data includes a plurality of continuously located position coordinates; perform coordinate rationality checks according to the range of the electronic fence, and use the object to be processed corresponding to the position coordinates that pass the check as the monitored object; the range of the electronic fence is characterized by a sequence of polygon vertex coordinates.

[0063] Specifically, as Figure 2 shown, for the input data process, the positioning data is input in the form of an array, and each element contains the unique identifier of the object to be processed and the corresponding two-dimensional coordinates, such as [(id 1 , x 1 , y 1 ), (id 2 , x 2 , y 2 ), …].

[0064] In an example, for an irregular-shaped fence, it is represented by a sequence of polygon vertex coordinates (that is, the range of the electronic fence is characterized by a sequence of polygon vertex coordinates), and the vertices can be arranged in a clockwise or counterclockwise order. For example, taking an irregular pentagonal fence as an example, the coordinate sequence of its vertices arranged in a clockwise order is: [(0, 0), (4, 0), (4, 3), (2, 5), (0, 3)], where (0, 0) means the first vertex of the fence is located at the origin of coordinates, (4, 0) means the second vertex of the fence is 4 units away from the first vertex in the horizontal direction, (4, 3) means the third vertex of the fence is 3 units away from the second vertex in the vertical direction, (2, 5) means the fourth vertex of the fence is 2 units to the left of the third vertex in the horizontal direction and 2 units up from the third vertex in the vertical direction, and (0, 3) means the fifth vertex of the fence is 2 units to the left of the fourth vertex in the horizontal direction and 2 units down from the fourth vertex in the vertical direction.

[0065] Optionally, as Figure 2As shown in the figure, for the data preprocessing process, it is possible to check whether the coordinate values are within a reasonable range. If the application scenario is limited to a specific map area, the coordinate values need to be within the coordinate range corresponding to the specific map area. Values outside the range are regarded as abnormal data and excluded. It is also possible to check the continuity of the data. If abnormal situations such as sudden changes in coordinate values, duplicate data, or missing data occur, they can be corrected or excluded based on the previous and subsequent data. For example, if the position coordinates of the object to be processed are (X, Y), and there are significant changes in X and Y beyond the normal range, such as the coordinate (10, 10) suddenly changing to (100, 10) or (10, 100) or (100, 100), it is confirmed that there is a sudden change in coordinate values; duplicate data: multiple identical repeated time points or coordinates appear in the continuous positioning data; missing data: the data for a certain time point is missing in the continuous positioning data.

[0066] In this embodiment, by obtaining the electronic fence corresponding to the target area and the positioning data of each object to be processed, and then performing a coordinate rationality check according to the range of the electronic fence, the object to be processed corresponding to the position coordinates that pass the check is used as the monitoring object, which can efficiently screen out the monitoring objects that meet the requirements and provide data support for further electronic fence detection and processing.

[0067] In an exemplary embodiment, constructing a spatial index of the electronic fence corresponding to the target area to be detected, and for each target object performing positioning monitoring based on the target area, constructing each point object for querying in the spatial index may include the following steps:

[0068] Using the transformed data structure of the polygon vertex coordinate sequence, constructing the spatial index of the electronic fence; taking any one of the monitoring objects as the target object, and constructing a point object for querying in the spatial index according to the position coordinates of the target object.

[0069] In practical applications, the input polygon vertex coordinate sequence can be transformed into an internal data structure (i.e., the transformed data structure) convenient for the electronic fence detection algorithm to process, constructing an object containing vertex coordinates and edge information. Each edge is determined by two adjacent vertices, and the starting point, ending point coordinates, and slope k of the edge can be recorded.

[0070] For example, if the vertex coordinate sequence of a polygon is (0, 0), (4, 0), (4, 3), (2, 5), (0, 3), by connecting two adjacent vertices into an edge, with the previous vertex as the starting point and the next vertex as the ending point, the slope of each edge can be calculated. The formula for the slope can be (ending point Y coordinate - starting point Y coordinate) / (ending point X coordinate - starting point X coordinate), and then the starting point coordinates, ending point coordinates, and slope of each edge can be converted into the following format: {"edge 1": {"starting point": (0, 0), "ending point": (4, 0), "slope": 0}}, and integrated into the data structure.

[0071] In one example, as Figure 2 shown, an R-tree structure can be used to build a spatial index, and the polygon boundary rectangle of the electronic fence is inserted into the R-tree as a data item. By calculating the minimum bounding rectangle of the polygon, that is, finding the minimum value x min and the maximum value x max of the x coordinates among all the vertices of the polygon, and the minimum value y min and the maximum value y max of the y coordinates, a bounding rectangle (x min , y min , x max , y max ) is formed, and it is inserted into the R-tree after being associated with the corresponding polygon data. For the position of each monitoring object, a point object can be constructed based on its coordinates.

[0072] In this embodiment, by adopting the transformed data structure of the polygon vertex coordinate sequence, building the spatial index of the electronic fence, taking any monitoring object as the target object, and constructing a point object for querying in the spatial index according to the position coordinates of the target object, the query can be optimized, which helps to improve the detection efficiency of the electronic fence.

[0073] In an exemplary embodiment, the obtaining of the position judgment result of any point object by judging the position relationship between any point object and the corresponding multiple associated fence regions may include the following steps:

[0074] Perform grid division on the multiple associated fence regions to determine the polygons and the point object included in each grid; judge the position relationship for any point object, the polygon in the grid where the point object is located, and the polygons in the adjacent grids of the point object to obtain the first judgment information; use a preset ray judgment method to process the point object and the polygon in the grid where the point object is located to obtain the second judgment information; combine the first judgment information and the second judgment information to obtain the position judgment result of the point object.

[0075] In specific implementation, asFigure 2 As shown, for the position determination process, based on the selected polygons, the range of the entire space can be determined by combining the grid division method. By dividing it into m×n grid cells, traversing all polygons and point objects, the grid cell where a polygon or point object is located can be determined according to its coordinates, and the polygons and point objects contained in each grid cell can be recorded. For each point object, the polygons in its own grid cell and adjacent grid cells can be mainly considered. If a point object and a polygon are not in the same grid or adjacent grids, then the point object and the polygon do not intersect, and the polygon can be directly excluded, that is, the first judgment information.

[0076] In one example, the ray method can be used to judge the polygon to obtain the second judgment information. By drawing a ray from the monitoring object position (x 0 , y 0 ) in the positive x-axis direction, the number of intersections of the ray with each side of the polygon is calculated to judge the positional relationship between the point and the polygon. If the side is a horizontal side (y 1 ==y 2 ) and y 1 ≠y 0 , then the side does not intersect the ray; if the side is a vertical side (x 1 ==x 2 ): when x 1 ==x 0 , according to the relationship between y 1 and y 2 and y 0 , if y 1 ≤y 0 ≤y 2 (or y 2 ≤y 0 ≤y 1 ), then the number of intersections is incremented by 1; when x 1 ≠x 0 , there is no intersection. For non-horizontal and non-vertical sides, based on the straight-line equation y - y 1 = k(x - x 1 ), the abscissa x of the intersection point is calculated. If x≥x 0 , the number of intersections is incremented by 1; if the number of intersections is odd, the point is inside the polygon, and if it is even, the point is outside the polygon. Combining the grid division method and the ray method for judgment, the position judgment result of any point object can be obtained.

[0077] In this embodiment, by performing grid division on multiple associated fence regions, polygons and point objects included in each grid are determined. For any point object, the polygon of the grid where the point object is located, and the polygons of the adjacent grids of the point object, a positional relationship judgment is made to obtain first judgment information. The preset ray judgment method is used to process any point object and the polygon of the grid where the point object is located to obtain second judgment information. Furthermore, by combining the first judgment information and the second judgment information, a position judgment result of any point object is obtained, which can reduce the calculation range and help improve the efficiency and accuracy of position judgment.

[0078] In an exemplary embodiment, the buffer detection result can be used to characterize whether there is a secondary position judgment result. The determining the buffer detection result of any point object according to the buffer configuration information of the multiple associated fence regions corresponding to the any point object may include the following steps:

[0079] According to the buffer configuration information of the multiple associated fence regions corresponding to the any point object, a buffer boundary is determined; if the position judgment result of the any point object is within the buffer boundary, re-judgment is performed by expanding the buffer, and based on the historical position record information of the monitoring object, the position change trend is analyzed to obtain the secondary position judgment result of the any point object.

[0080] In practical applications, considering that positioning data may have errors, a buffer can be set at the fence boundary, and the buffer width can be determined according to the positioning accuracy and the actual application scenario. For example, if the standard deviation of the positioning error is "σ", a width of "3σ" can be set. For a polygon fence, by using the starting and ending coordinates of the side to determine the direction vector of the side, a perpendicular vector can be obtained. Then, by moving the buffer width along the perpendicular direction from both endpoints of the side, new endpoints can be obtained, and connecting multiple new endpoints can construct the buffer.

[0081] In one example, as Figure 2 shown, when it is detected that the monitored object is near the buffer boundary, that is, the shortest distance from the monitored object to the side of the polygon fence is less than or equal to the buffer width. On the one hand, the buffer width can be expanded to k times the original width (such as k = 2), the expanded buffer is reconstructed, and the ray method can be used to re-judge the object position; on the other hand, in combination with the historical position record list of the monitored object, the distances from the nearest m position points to the fence boundary are calculated, and the change trend is analyzed. Furthermore, the true position state of the monitored object can be determined by comprehensively considering these two judgment results, that is, the secondary position judgment result of any point object is obtained.

[0082] In an alternative embodiment, if the distances from the most recent m position points to the fence boundary increase while the distance from the fence center also increases, then the trend is that they are gradually moving away from the fence; if the distances from the most recent m position points to the fence boundary decrease while the distance from the fence center also decreases, then the trend is that they are gradually approaching the fence; if the distances of the most recent m position points from the fence boundary fluctuate within a certain range without an obvious tendency to approach or move away, then the trend is that they are stable near the fence.

[0083] In this embodiment, by determining the buffer boundary according to the buffer configuration information of multiple associated fence regions corresponding to any point object, if the position judgment result of any point object is at the buffer boundary, re-judging by expanding the buffer, and analyzing the position change trend based on the historical position record information of the monitored object, the secondary position judgment result of any point object is obtained, which can improve the accuracy of the electronic fence detection for the case where there are errors in the positioning data.

[0084] In an exemplary embodiment, combining the position judgment results and buffer detection results of each of the point objects to obtain the position status of each of the target objects in the target region may include the following steps:

[0085] In the case of having a secondary position judgment result, according to the position judgment result and the secondary position judgment result, obtain the position status of the corresponding target object in the target region.

[0086] In one example, as Figure 2 shown, when it is detected that the monitored object is not at the buffer boundary, the primary judgment result is used as the standard; when it is detected that the monitored object is at the buffer boundary, secondary judgment can be performed, combining the position judgment result and the secondary position judgment result, output the position status of the corresponding target object in the target region, and the position judgment result can be recorded in the database.

[0087] In this embodiment, by obtaining the position status of the corresponding target object in the target region according to the position judgment result and the secondary position judgment result in the case of having a secondary position judgment result, it is possible to accurately process fence regions of various complex shapes and reduce the false judgment rate.

[0088] In an exemplary embodiment, as Figure 3 shown, a flowchart of another electronic fence detection method is provided. In this embodiment, the method includes the following steps:

[0089] In step 301, obtain the electronic fence corresponding to the target area and the positioning data of each object to be processed. Check the coordinate rationality according to the range of the electronic fence, and use the object to be processed corresponding to the position coordinates that pass the check as the monitored object. In step 302, adopt the transformed data structure of the polygon vertex coordinate sequence to construct the spatial index of the electronic fence. Use any monitored object as the target object, and construct a point object for querying in the spatial index according to the position coordinates of the target object. In step 303, according to the spatial index of the electronic fence, filter out multiple associated fence areas corresponding to each point object, perform grid division on the multiple associated fence areas, and determine the polygons and point objects included in each grid. In step 304, determine the position relationship for any point object, the polygon of the grid where the point object is located, and the polygons of the adjacent grids of the point object to obtain the first judgment information, and use the preset ray judgment method to process the point object and the polygon of the grid where the point object is located to obtain the second judgment information. In step 305, combine the first judgment information and the second judgment information to obtain the position judgment result of any point object. In step 306, determine the buffer boundary according to the buffer configuration information of the multiple associated fence areas corresponding to any point object. If the position judgment result of any point object is on the buffer boundary, re-judge by expanding the buffer, and analyze the position change trend based on the historical position record information of the monitored object to obtain the secondary position judgment result of any point object. In step 307, obtain the position status of the corresponding target object in the target area according to the position judgment result and the secondary position judgment result.

[0090] It should be noted that the specific limitations of the above steps can refer to the specific limitations of an electronic fence detection method described above, and will not be elaborated here.

[0091] It should be understood that although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or steps or stages in other steps.

[0092] Based on the same inventive concept, an embodiment of the present application further provides an electronic fence detection device for implementing the above-mentioned electronic fence detection method. The solution provided by this device for solving problems is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the electronic fence detection device provided below can refer to the limitations on the electronic fence detection method in the foregoing, and will not be repeated here.

[0093] In an exemplary embodiment, as Figure 4 shown, an electronic fence detection device is provided, including:

[0094] An index construction module 401, configured to construct a spatial index of an electronic fence corresponding to a target area to be detected, and construct point objects for querying in the spatial index for each target object for positioning monitoring based on the target area;

[0095] A fence area screening module 402, configured to screen out a plurality of associated fence areas corresponding to each point object according to the spatial index of the electronic fence; there may be intersecting polygons between each associated fence area and the corresponding point object;

[0096] A position judgment module 403, configured to obtain a position judgment result of any point object by judging the position relationship between any point object and the corresponding plurality of associated fence areas, and determine a buffer detection result of any point object according to buffer configuration information of the plurality of associated fence areas corresponding to any point object;

[0097] A position status obtaining module 404, configured to obtain the position status of each target object in the target area by combining the position judgment results and buffer detection results of each point object.

[0098] In one of the embodiments, the device further includes:

[0099] A coordinate acquisition module, configured to acquire the electronic fence corresponding to the target area and positioning data of each object to be processed; the positioning data includes a plurality of position coordinates of continuous positioning;

[0100] A coordinate rationality check module, configured to perform coordinate rationality check according to the range of the electronic fence, and use the object to be processed corresponding to the position coordinates passing the check as a monitoring object; the range of the electronic fence is represented by a sequence of polygon vertex coordinates.

[0101] In one embodiment, the index construction module 401 is specifically configured to construct a spatial index of the electronic fence by using the transformed data structure of the polygon vertex coordinate sequence; use any one of the monitoring objects as a target object, and construct a point object for querying in the spatial index according to the position coordinates of the target object.

[0102] In one embodiment, the position determination module 403 is specifically configured to perform grid division on the multiple associated fence regions to determine the polygons and the point objects included in each grid; perform a position relationship determination on any point object, the polygon of the grid where the point object is located, and the polygons of the adjacent grids of the point object to obtain first determination information; use a preset ray determination method to process the point object and the polygon of the grid where the point object is located to obtain second determination information; combine the first determination information and the second determination information to obtain the position determination result of the point object.

[0103] In one embodiment, the buffer detection result is used to represent whether there is a secondary position determination result. The position determination module 403 is specifically configured to determine a buffer boundary according to the buffer configuration information of the multiple associated fence regions corresponding to any point object; if the position determination result of the point object is within the buffer boundary, perform a re-determination by expanding the buffer, and analyze the position change trend based on the historical position record information of the monitoring object to obtain the secondary position determination result of the point object.

[0104] In one embodiment, the position status obtaining module 404 is specifically configured to, in the case of having a secondary position determination result, obtain the position status of the corresponding target object in the target region according to the position determination result and the secondary position determination result.

[0105] Each module in the above electronic fence detection device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above respective modules.

[0106] In an exemplary embodiment, a computer device is provided. The computer device can be a terminal, and its internal structure diagram can be as Figure 5As shown in the figure. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC), or other technologies. When the computer program is executed by the processor, it implements an electronic fence detection method. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the computer device housing, or an external keyboard, touchpad, or mouse, etc.

[0107] Those skilled in the art can understand that Figure 5 the structure shown in the figure is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0108] In an exemplary embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the following steps are implemented:

[0109] Construct a spatial index of the electronic fence corresponding to the target area to be detected, and for each target object for positioning and monitoring based on the target area, construct each point object for querying in the spatial index;

[0110] According to the spatial index of the electronic fence, filter out multiple associated fence areas corresponding to each point object; there may be intersecting polygons between each associated fence area and the corresponding point object;

[0111] By determining the positional relationship between any point object and the corresponding multiple associated fence regions, obtaining the position determination result of the any point object, and determining the buffer detection result of the any point object according to the buffer configuration information of the multiple associated fence regions corresponding to the any point object;

[0112] Combining the position determination results and buffer detection results of each of the point objects to obtain the position status of each of the target objects in the target region.

[0113] In one embodiment, when the processor executes the computer program, it also implements the steps of the electronic fence detection method in the above other embodiments.

[0114] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

[0115] Construct a spatial index of the electronic fence corresponding to the target region to be detected, and for each target object for positioning monitoring based on the target region, construct each point object for querying in the spatial index;

[0116] According to the spatial index of the electronic fence, filter out the multiple associated fence regions corresponding to each of the point objects; there may be intersecting polygons between each of the associated fence regions and the corresponding point object;

[0117] By determining the positional relationship between any point object and the corresponding multiple associated fence regions, obtaining the position determination result of the any point object, and determining the buffer detection result of the any point object according to the buffer configuration information of the multiple associated fence regions corresponding to the any point object;

[0118] Combining the position determination results and buffer detection results of each of the point objects to obtain the position status of each of the target objects in the target region.

[0119] In one embodiment, when the computer program is executed by a processor, it also implements the steps of the electronic fence detection method in the above other embodiments.

[0120] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the following steps are implemented:

[0121] Construct a spatial index of the electronic fence corresponding to the target region to be detected, and for each target object for positioning monitoring based on the target region, construct each point object for querying in the spatial index;

[0122] According to the spatial index of the electronic fence, multiple associated fence areas corresponding to each of the point objects are filtered out; there may be intersecting polygons between each of the associated fence areas and the corresponding point object.

[0123] By determining the positional relationship between any point object and the corresponding multiple associated fence areas, a position determination result of the any point object is obtained, and according to the buffer configuration information of the multiple associated fence areas corresponding to the any point object, a buffer detection result of the any point object is determined.

[0124] Combining the position determination results and buffer detection results of each of the point objects, the position states of each of the target objects in the target area are obtained.

[0125] In one embodiment, when the computer program is executed by a processor, the steps of the electronic fence detection method in the above other embodiments are also implemented.

[0126] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.

[0127] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in this application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in this application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, artificial intelligence (AI) processors, etc., without limitation.

[0128] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered to be within the scope recorded in this application.

[0129] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims

1. An electronic fence detection method, characterized in that: The method comprises: Constructing a spatial index of the electronic fence corresponding to the target area to be detected, and constructing each point object for querying in the spatial index based on each target object to be located and monitored in the target area; According to the spatial index of the electronic fence, a plurality of associated fence areas corresponding to each of the point objects are screened out; there may be an intersecting polygon between each of the associated fence areas and the corresponding point object; By determining the position relationship between any point object and the corresponding multiple associated fence areas, a position determination result of the any point object is obtained, and according to the buffer configuration information of the multiple associated fence areas corresponding to the any point object, a buffer detection result of the any point object is determined; The position status of each target object in the target area is obtained by combining the position judgment result of each point object and the buffer zone detection result.

2. The method according to claim 1, characterized in that Before the step of constructing a spatial index of the electronic fence corresponding to the target area to be detected, and constructing each point object for querying in the spatial index based on each target object for positioning and monitoring in the target area, the method further includes: Acquire the electronic fence corresponding to the target area and the positioning data of each object to be processed; the positioning data includes a plurality of position coordinates of continuous positioning; A coordinate rationality check is performed according to the range of the electronic fence, and the object to be processed corresponding to the position coordinates that pass the check is used as the monitoring object; the range of the electronic fence is represented by a polygon vertex coordinate sequence.

3. The method according to claim 2, characterized in that The step of constructing a spatial index of an electronic fence corresponding to a target area to be detected, and constructing each point object for querying in the spatial index based on each target object for positioning and monitoring in the target area includes: Using the transformed data structure of the polygon vertex coordinate sequence to construct the spatial index of the electronic fence; Any of the monitored objects is taken as a target object, and a point object for querying in the spatial index is constructed according to the position coordinates of the target object.

4. The method according to claim 1, characterized in that: The obtaining of the position determination result of any point object by determining the position relationship between any point object and the corresponding multiple associated fence areas includes: Meshing the multiple associated fence areas to determine the polygons and point objects contained in each mesh; Performing positional relationship judgment on any point object, a polygon of a grid where the any point object is located, and a polygon of a grid adjacent to the any point object to obtain first judgment information; Processing the arbitrary point object and the polygon of the grid where the arbitrary point object is located by using a preset ray judgment method to obtain second judgment information; The first judgment information and the second judgment information are combined to obtain a position judgment result of the arbitrary point object.

5. The method according to any one of claims 1 to 4, characterized in that: The buffer zone detection result is used to indicate whether there is a secondary position determination result, and the buffer zone detection result of the any point object is determined according to the buffer zone configuration information of the multiple associated fence areas corresponding to the any point object, including: Determining a buffer zone boundary according to buffer zone configuration information of a plurality of associated fence zones corresponding to any point object; If the position determination result of any point object is within the boundary of the buffer zone, the buffer zone is expanded for further determination, and the position change trend is analyzed based on the historical position record information of the monitored object to obtain a secondary position determination result of the any point object.

6. The method according to claim 5, characterized in that Combining the position determination result of each point object and the buffer detection result to obtain the position status of each target object in the target area includes: In the case of having a secondary position determination result, the position state of the corresponding target object in the target area is obtained according to the position determination result and the secondary position determination result.

7. An electronic fence detection device, characterized in that: The device comprises: An index building module, used to build a spatial index of the electronic fence corresponding to the target area to be detected, and to build each point object for querying in the spatial index based on each target object for positioning and monitoring in the target area; A fence area screening module, used for screening out a plurality of associated fence areas corresponding to each of the point objects according to the spatial index of the electronic fence; there may be an intersecting polygon between each of the associated fence areas and the corresponding point object; A position determination module, configured to obtain a position determination result of any point object by determining a position relationship between any point object and the corresponding multiple associated fence areas, and to determine a buffer zone detection result of any point object according to buffer zone configuration information of the multiple associated fence areas corresponding to the any point object; The position state obtaining module is used to obtain the position state of each target object in the target area by combining the position judgment result of each point object and the buffer zone detection result.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • Statistical method and system for vehicles in shared vehicle electronic fence

    CN121304303A

  • Electronic fence intrusion detection method and device, medium and equipment

    CN121482929A