Electronic fence generation method

Generating electronic fences through grid division and clustering algorithms solves the accuracy problem of drones when patrolling near border lines, and automatically handles the generation of ultra-large-scale electronic fences, reduces manual operations, improves computing efficiency and accuracy sex.

CN119277313APending Publication Date: 2025-01-07CHENGDU JOUAV DA PENG TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410899648.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-05
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

The existing drone electronic fence generation method cannot automatically handle ultra-large electronic fence scenarios, such as border lines and provincial and municipal administrative boundaries, which makes drones unable to accurately observe targets when performing large-scale patrol missions, and may even cross borders. It causes international disputes, and the manual production process is cumbersome and prone to omissions.

Method used

The grid division and clustering algorithm are used to generate electronic fences. By obtaining preset boundary line data, dividing grids, setting rectangular fence boxes, extracting the number of intersection points, using kmeans+elbow method to determine the number of clusters, and judging the number of intersection points to automatically generate Or manually add fence points to form electronic fences, avoiding the calculation resource consumption of the intersection points of conventional lines and lines.

Benefits of technology

It realizes automatic processing of the generation of ultra-large-scale electronic fences, reduces the cumbersomeness and omissions of manual operations, improves computing efficiency, and ensures accurate observation and mission execution of drones near the border line.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119277313A_ABST
    Figure CN119277313A_ABST
Patent Text Reader

Abstract

The invention discloses an electronic fence generation method, and relates to the technical field of unmanned aerial vehicles, and the method is characterized in that the method comprises the following steps: S1, obtaining preset boundary line data; s2, dividing the boundary line data according to longitude and latitude grids to obtain boundary grids; s3, manually drawing a rectangular fence frame of a cross-domain boundary on the map; s4, obtaining a corresponding boundary grid according to the longitude and latitude range of the vertexes of the rectangular fence frame; s5, according to the number of intersection points of the four edges of the rectangular fence frame and the boundary line data in the corresponding boundary grid, boundary data between the intersection points are extracted, and a target boundary line is obtained; and S6, manually adding fence points near the target boundary line, and finally forming a line-limited electronic fence formed by the target boundary line and the artificial fence points. According to the invention, oversized electronic fences limited by border lines, provincial and municipal administrative boundaries and the like are automatically processed, and the problems of complexity and omission caused by excessive dependence on manual manufacturing are avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of unmanned aerial vehicles, and more particularly to a method for generating an electronic fence. Background Art

[0002] Electronic fence is the most advanced perimeter anti-theft alarm system, which consists of an electronic fence host and a front-end detection fence. The electronic fence host generates and receives high-voltage pulse signals, and can generate alarm signals when the front-end detection fence is in a state of touching the network, short circuit, or open circuit, and sends the intrusion signal to the security alarm center; the front-end detection fence is a tangible perimeter composed of components such as poles and metal wires. Multi-level networking can be achieved through the control keyboard or control software. Electronic fence is an active intrusion prevention fence that counterattacks intrusion attempts, repel intruders, delays intrusion time, and does not threaten human life. It sends intrusion signals to the security department's monitoring equipment to ensure that management personnel can understand the situation in the alarm area in a timely manner and deal with it quickly.

[0003] Patent CN113671993A discloses a method, system, device and medium for controlling a no-fly zone and an electronic fence for drones. The method includes the following steps: obtaining the area type, judging whether the drone is in a legal area or an illegal area based on the area type; when the drone is in an illegal area, the drone is prohibited from taking off or forced to land on the spot; when the drone is in a legal area, the effective closest distance between the drone and the edge of the area is detected in real time; when the drone approaches the edge of the area, the drone is limited in speed or braked; when the drone is not close to the edge of the area, the drone continues to fly according to the original predetermined task. The embodiment of the present invention can ensure that the drone can cope with the no-fly zone or electronic fence with ease. The no-fly zone and electronic fence functions of the drone are integrated to realize online comprehensive detection and analysis, comprehensive management, and comprehensive control, and also realize comprehensive maintenance in the later stage. However, this method uses conventional ray method and circle center distance method, which cannot cope with a huge number of electronic fence scenarios. The current generation method cannot automatically handle large-scale electronic fences such as border lines, provincial and municipal administrative boundaries, etc. When drones perform large-scale patrol missions near border lines, if there are no accurate electronic fence points, the drones will not be able to observe the designated targets, and even cross the border to cause international disputes. The current method is to restrict by loading preset electronic fence coordinates, which is cumbersome and cannot adapt to changing mission requirements.

[0004] The electronic fences currently used by drones are made by manually connecting map coordinate points, which is a cumbersome process. The flight plan of a drone is usually formulated to perform a certain task or meet a certain operational requirement, and the task will be carried out at different times and in different areas. Therefore, the current electronic fence generation method is inconvenient to use and cannot adapt to flight plans based on mission requirements. There are too many manual operations and loopholes are prone to occur.

[0005] Clustering is an important technique in machine learning. It can classify data in a dataset according to similarity. Kmeans clustering is the most commonly used algorithm in clustering. It divides the data in the dataset into k clusters so that the distance between data points in a cluster is as small as possible and the distance between clusters is as large as possible. However, in practical applications, how to determine the optimal number of clusters k is a difficult problem. The elbow rule is a method to determine the optimal number of clusters k by observing the changing trend of data. Specifically, it obtains the optimal number of clusters k by calculating the changing trend of the sum of squared clustering errors (SSE) under different numbers of clusters k. The sum of squared clustering errors SSE refers to the sum of the squares of the distances from each data point to the center of the cluster to which it belongs. When the number of clusters k is small, the SSE will gradually decrease; and when the number of clusters k continues to increase, the rate of decline of the SSE will gradually slow down until it finally stabilizes. Summary of the invention

[0006] The purpose of the present invention is to solve the above problems and provide an electronic fence generation method, which aims to automatically process ultra-large-scale electronic fences restricted by border lines, provincial and municipal administrative boundaries, etc., to avoid the tediousness and omissions caused by excessive reliance on manual production.

[0007] The above technical objectives of the present invention are achieved through the following technical solutions: a method for generating an electronic fence, the method comprising the following steps:

[0008] S1: Obtain preset boundary line data;

[0009] S2: Meshing the boundary line data obtained in S1 to obtain a boundary grid;

[0010] S3: A rectangular fence frame that demarcates the cross-domain boundary;

[0011] S4: Obtaining a corresponding boundary grid according to the longitude and latitude ranges of the vertices of the rectangular fence frame;

[0012] S5: extracting boundary data according to the number of intersections of the boundary grid obtained in S2 and the corresponding boundary grid obtained in S4 to obtain a target boundary line;

[0013] S6: Based on the target boundary line obtained in S5, fence points are added to finally form an electronic fence.

[0014] The present invention is further configured as follows: the boundary line data in S1 is composed of a large number of ordered boundary points.

[0015] The present invention is further configured as follows: the grid division method in S2 is divided according to longitude and latitude.

[0016] The present invention is further configured as follows: the rectangular fence frame in S3 is manually drawn on the map.

[0017] The present invention is further configured as follows: the number of intersection points is a set of boundary points whose distances between the boundary line data in the corresponding boundary grid and the four sides of the rectangular fence frame meet a distance threshold;

[0018] The formula for obtaining the boundary point set is as follows:

[0019] Horizontal side of rectangular fence frame:

[0020] |Lat 边境点 -Lat 横边 | <e

[0021] Rectangular fence frame vertical side:

[0022] |Lon 边境点 -Lon 竖边 | <e

[0023] Among them, the distance threshold e is the longitude and latitude range;

[0024] By adopting the above solution, the problem of quickly finding the intersection of a straight line and scattered points is solved.

[0025] The present invention is further configured as follows: the number of set centers obtained by the clustering algorithm of the boundary point set is the number of intersection points;

[0026] By adopting the above technical solution, the number of intersections between the rectangular fence frame and the boundary lines is determined using scattered point clusters.

[0027] The present invention is further configured as follows: the clustering algorithm adopts kmeans + elbow method, specifically, it obtains the optimal clustering number k by calculating the changing trend of the sum of squared clustering errors (SSE) under different clustering numbers k. The sum of squared clustering errors SSE refers to the sum of squares of the distances from each data point to the center of the cluster to which it belongs. When the number of clusters k is small, SSE will gradually decrease; and when the number of clusters k continues to increase, the rate of decrease of SSE will gradually slow down until it finally stabilizes; the specific algorithm steps are as follows:

[0028] S5-1: First, input the point set to obtain the number of intersection points; then create the k value set in sequence, create the cluster center set, initialize the k value set, and then set the maximum number of iterations, traverse the K value set. If the maximum number of iterations is reached, the traversal is terminated directly; if the maximum number of iterations is not reached, initialize the cluster center set, traverse the point set in sequence, traverse the cluster center, calculate the Euclidean distance from the current point set to the current cluster center, and assign it to the nearest neighbor cluster according to the minimum distance principle, and then terminate the traversal. Finally, recalculate the cluster center according to the category mean, end the traversal, end the iteration, and then calculate the degree of distortion of each category, and then end the traversal;

[0029] The Euclidean distance calculation formula is as follows:

[0030]

[0031] Among them, D is the Euclidean distance between points, n is the dimension of the point set, and x i is the coordinate of a point in the current cluster point set, m i is the cluster center coordinate of the current cluster point set;

[0032] The degree of distortion is calculated using the sum of squared errors, as follows:

[0033]

[0034] Among them, SSE is the sum of squared errors, k is the number of clustering points, p is the coordinate of a point in the current clustering point set, and m is the i is the cluster center coordinate of the current cluster point set;

[0035] S5-2: Select the value of the elbow point k of the degree of distortion in S5-1 as the number of intersection points;

[0036] By adopting the above technical solution: the number of intersections between the four sides of the rectangular fence and the boundary / border line data is determined by clustering method, avoiding the conventional method of using line intersection to find intersection points, and greatly reducing the consumption of computing resources.

[0037] The present invention is further configured such that: the number of intersections is greater than 2, and an electronic fence cannot be automatically generated.

[0038] The present invention is further configured as follows: the number of intersection points is equal to 2, and boundary data between the intersection points are extracted to obtain a target boundary line.

[0039] The present invention is further configured as follows: the fence point adding method in S6 is: manually adding fence points near the target boundary line obtained in S5, and finally forming an electronic fence with boundary restrictions consisting of the target boundary line and artificial fence points.

[0040] In summary, the present invention has the following beneficial effects:

[0041] The present invention adopts a human-computer interactive electronic fence generation method, firstly obtains the preset boundary line or border line data composed of a large number of orderly boundary points from a remote sensing test company; divides the boundary / border line data according to the longitude and latitude grid to obtain the boundary / border grid for easy search; then manually draws a cross-domain boundary / border rectangular fence frame on the map, and obtains the corresponding boundary / border grid according to the longitude and latitude range of the vertices of the rectangular fence frame; judges whether there are intersections between the four sides of the rectangular fence frame and the boundary / border line data in the corresponding boundary / border grid; when the number of intersection points is greater than 2, it is said that If there is an enclave in the intersection area between the clear boundary / border and the rectangular fence frame or all the vertices of the rectangular fence frame are outside the boundary / border, the electronic fence cannot be automatically generated; when the number of intersection points is equal to 2, the boundary / border point data between the intersection points are extracted to obtain the target boundary / border; finally, fence points are manually added near the target boundary / border, and finally an electronic fence restricted by the boundary / border is formed by the target boundary / border and the artificial fence points; this method can automatically process ultra-large-scale electronic fences restricted by border lines, provincial and municipal administrative boundaries, etc., avoiding the tediousness and omissions caused by excessive reliance on manual production;

[0042] The present invention adopts a kmeans+elbow method to determine the optimal clustering number k by observing the changing trend of data, and obtains the optimal clustering number k by calculating the changing trend of the sum of squared clustering errors (SSE) under different clustering numbers k. The sum of squared clustering errors SSE refers to the sum of squares of the distances from each data point to the center of the cluster to which it belongs. When the clustering number k is small, the SSE will gradually decrease; and when the clustering number k continues to increase, the rate of decrease of the SSE will gradually slow down until it finally stabilizes; the clustering method is used to determine the number of intersections between the four sides of the rectangular fence frame and the boundary / border line data, avoiding the conventional method of using line-to-line intersection to find the intersection point, greatly reducing the consumption of computing resources; the target boundary / border line can be quickly extracted, and combined with the manually marked position to generate an accurate electronic fence restricted by the boundary / border line. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 is a flow chart of a method for generating an electronic fence constrained by a boundary line in an embodiment of the present invention;

[0044] Figure 2 is a flow chart of a method for generating an electronic fence for a drone based on geographic information objects and flight missions in Embodiment 9 of the present invention;

[0045] Figure 3 are the boundary lines and boundary points of the geographic information object selected in Embodiment 9 of the present invention;

[0046] Figure 4 is a schematic diagram of generating an electronic fence through Delaunay triangulation in Example 9 of the present invention;

[0047] Figure 5 It is a schematic diagram of expanding a triangulated network using the broken line parallel line method in Example 9 of the present invention;

[0048] Figure 6 is a flow chart of a method for online generation of an obstacle electronic fence based on a perception system in Embodiment 10 of the present invention;

[0049] Figure 7 This is the process in which the drone in Embodiment 10 of the present invention obtains the obstacle point cloud through the perception system;

[0050] Figure 8 It is a schematic diagram of the process of generating an electronic fence from an obstacle point cloud in Example 10 of the present invention. DETAILED DESCRIPTION

[0051] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solution of the present invention will be further described in detail below in conjunction with the embodiments of the present invention and the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0052] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present invention can be combined with each other. The present invention will be described in detail below in conjunction with the embodiments.

[0053] Embodiment 1:

[0054] A method for generating an electronic fence, the method comprising the following steps:

[0055] S1: Obtain preset boundary line data;

[0056] The boundary / border line data is directly obtained through remote sensing testing and other units, and consists of thousands of orderly boundary points;

[0057] S2: Meshing the boundary line data obtained in S1 to obtain a boundary grid;

[0058] S3: A rectangular fence frame that demarcates the cross-domain boundary;

[0059] S4: Obtaining a corresponding boundary grid according to the longitude and latitude ranges of the vertices of the rectangular fence frame;

[0060] S5: extracting boundary data according to the number of intersections of the boundary grid obtained in S2 and the corresponding boundary grid obtained in S4 to obtain a target boundary line;

[0061] S6: Based on the target boundary line obtained in S5, fence points are added to finally form an electronic fence.

[0062] Embodiment 2:

[0063] A method for generating an electronic fence, which differs from Embodiment 1 in that the method comprises the following steps:

[0064] S1: Obtain preset boundary line data;

[0065] S2: Meshing the boundary line data obtained in S1 to obtain a boundary grid;

[0066] The boundary / border line data is divided into grids according to longitude and latitude, which makes it easier to search;

[0067] S3: A rectangular fence frame that demarcates the cross-domain boundary;

[0068] S4: Obtaining a corresponding boundary grid according to the longitude and latitude ranges of the vertices of the rectangular fence frame;

[0069] S5: extracting boundary data according to the number of intersections of the boundary grid obtained in S2 and the corresponding boundary grid obtained in S4 to obtain a target boundary line;

[0070] S6: Based on the target boundary line obtained in S5, fence points are added to finally form an electronic fence.

[0071] Embodiment 3:

[0072] A method for generating an electronic fence, which differs from Embodiment 1 in that the method comprises the following steps:

[0073] S1: Obtain preset boundary line data;

[0074] S2: Meshing the boundary line data obtained in S1 to obtain a boundary grid;

[0075] S3: A rectangular fence is manually drawn on the map to indicate the boundary of the cross-domain.

[0076] S4: Obtaining a corresponding boundary grid according to the longitude and latitude ranges of the vertices of the rectangular fence frame;

[0077] S5: extracting boundary data according to the number of intersections of the boundary grid obtained in S2 and the corresponding boundary grid obtained in S4 to obtain a target boundary line;

[0078] S6: Based on the target boundary line obtained in S5, fence points are added to finally form an electronic fence.

[0079] Embodiment 4:

[0080] like Figure 1 As shown, a method for generating an electronic fence is different from that of embodiment 1 in that the method comprises the following steps:

[0081] S1: Obtain preset boundary line data;

[0082] S2: Meshing the boundary line data obtained in S1 to obtain a boundary grid;

[0083] S3: A rectangular fence frame that demarcates the cross-domain boundary;

[0084] S4: Obtaining a corresponding boundary grid according to the longitude and latitude ranges of the vertices of the rectangular fence frame;

[0085] S5: extracting boundary data according to the number of intersections of the boundary grid obtained in S2 and the corresponding boundary grid obtained in S3 to obtain a target boundary line;

[0086] If the number of intersections is greater than 2, the electronic fence cannot be automatically generated;

[0087] When the number of intersection points is equal to 2, the boundary data between the intersection points is extracted to obtain the target boundary line;

[0088] The number of intersection points is 4, which means that there is an enclave in the intersection area between the boundary / border line and the rectangular fence frame, or all the vertices of the rectangular fence frame are outside the boundary / border line, and the electronic fence cannot be automatically generated;

[0089] Under normal circumstances, when the number of intersection points is equal to 2, the boundary / border data between the intersection points are extracted to obtain the target boundary / border line;

[0090] S6: Based on the target boundary line obtained in S5, fence points are added to finally form an electronic fence.

[0091] Example 5

[0092] like Figure 1 As shown, a method for generating an electronic fence is different from that of embodiment 1 in that the method comprises the following steps:

[0093] S1: Obtain preset boundary line data;

[0094] S2: Meshing the boundary line data obtained in S1 to obtain a boundary grid;

[0095] S3: A rectangular fence frame that demarcates the cross-domain boundary;

[0096] S4: Obtaining a corresponding boundary grid according to the longitude and latitude ranges of the vertices of the rectangular fence frame;

[0097] S5: extracting boundary data according to the number of intersections of the boundary grid obtained in S2 and the corresponding boundary grid obtained in S4 to obtain a target boundary line;

[0098] The intersection point is the set of boundary points in which the distance between the boundary line data in the corresponding boundary grid and the four sides of the rectangular fence box meets the distance threshold; the default initial value of the distance threshold is 1km. If there is no fence point within the range, it will be increased iteratively.

[0099] S6: Based on the target boundary line obtained in S5, fence points are added to finally form an electronic fence.

[0100] Embodiment 6:

[0101] like Figure 1 As shown, a method for generating an electronic fence is different from that of embodiment 5 in that the method comprises the following steps:

[0102] S1: Obtain preset boundary line data;

[0103] S2: Meshing the boundary line data obtained in S1 to obtain a boundary grid;

[0104] S3: A rectangular fence frame that demarcates the cross-domain boundary;

[0105] S4: Obtaining a corresponding boundary grid according to the longitude and latitude ranges of the vertices of the rectangular fence frame;

[0106] S5: extracting boundary data according to the number of intersections of the boundary grid obtained in S2 and the corresponding boundary grid obtained in S4 to obtain a target boundary line;

[0107] The intersection point is a set of boundary points in which the distances between the boundary line data in the corresponding boundary grid and the four sides of the rectangular fence meet the distance threshold;

[0108] The number of set centers obtained by the clustering algorithm for the boundary point set is the number of intersection points;

[0109] The clustering algorithm uses kmeans + elbow method;

[0110] The intersection point is obtained by clustering the boundary point set whose distance from the boundary / border line data in the corresponding boundary / border grid to the four sides of the rectangular fence is less than the distance threshold e; the formula for obtaining the boundary point set is as follows:

[0111] Horizontal side of rectangular fence frame:

[0112] |Lat 边境点 -Lat 横边 | <e

[0113] Rectangular fence frame vertical side:

[0114] |Lon边境点 -Lon 竖边 | <e

[0115] The distance threshold e is the longitude and latitude range.

[0116] S6: Based on the target boundary line obtained in S5, fence points are added to finally form an electronic fence.

[0117] Embodiment 7:

[0118] A method for generating an electronic fence, which differs from Embodiment 6 in that the method comprises the following steps:

[0119] S1: Obtain preset boundary line data;

[0120] S2: Meshing the boundary line data obtained in S1 to obtain a boundary grid;

[0121] S3: A rectangular fence frame that demarcates the cross-domain boundary;

[0122] S4: Obtaining a corresponding boundary grid according to the longitude and latitude ranges of the vertices of the rectangular fence frame;

[0123] S5: extracting boundary data according to the number of intersections of the boundary grid obtained in S2 and the corresponding boundary grid obtained in S4 to obtain a target boundary line;

[0124] The intersection point is a set of boundary points in which the distances between the boundary line data in the corresponding boundary grid and the four sides of the rectangular fence meet the distance threshold;

[0125] The number of set centers obtained by the clustering algorithm for the boundary point set is the number of intersection points;

[0126] The clustering algorithm uses kmeans + elbow method;

[0127] The intersection point is obtained by clustering the boundary point set whose distance from the boundary / border line data in the corresponding boundary / border grid to the four sides of the rectangular fence is less than the distance threshold e; the formula for obtaining the boundary point set is as follows:

[0128] Horizontal side of rectangular fence frame:

[0129] |Lat 边境点 -Lat 横边 | <e

[0130] Rectangular fence frame vertical side:

[0131] |Lon 边境点 -Lon 竖边 | <e

[0132] The distance threshold e is the longitude and latitude range.

[0133] The dotted circles are multiple circular ranges formed with the boundary point closest to the four sides of the rectangular fence as the center and the distance threshold as the radius. Each circle contains multiple boundary points to form a boundary point set. The boundary point set can be obtained by a common clustering algorithm, such as elbow method + kmeans, and the number of point set centers is the number of intersection points.

[0134] Elbow method + kmeans, it obtains the optimal number of clusters k by calculating the trend of the sum of squared clustering errors (SSE) under different number of clusters k. The sum of squared clustering errors SSE refers to the sum of the squares of the distances from each data point to the center of the cluster to which it belongs. When the number of clusters k is small, SSE will gradually decrease; and when the number of clusters k continues to increase, the rate of decrease of SSE will gradually slow down until it finally stabilizes;

[0135] The algorithm for determining the intersection point using kmeans + elbow method is as follows:

[0136] Input: Point set

[0137] Output: number of intersections

[0138] Create k value sets

[0139] Create cluster center sets

[0140] Initialize k value set

[0141] Set the maximum number of iterations

[0142] Traverse the K value set

[0143] The maximum number of iterations was not reached

[0144] Initialize the cluster center set

[0145] Traversing point sets

[0146] Traversing cluster centers

[0147] Calculate the Euclidean distance from the current point to the current cluster center and assign it to the nearest neighbor cluster according to the principle of minimum distance.

[0148] End traversal

[0149] Recalculate the cluster center based on the category mean

[0150] End traversal

[0151] End iteration

[0152] Calculate the degree of distortion for each category

[0153] End traversal

[0154] Select the distortion elbow point k value as the number of intersection points

[0155] In the above algorithm, the Euclidean distance calculation formula is as follows:

[0156]

[0157] Among them, D is the Euclidean distance between points, n is the dimension of the point set, and x i is the coordinate of a point in the current cluster point set, m i is the cluster center coordinate of the current cluster point set;

[0158] The degree of distortion is calculated using the sum of squared errors, as follows:

[0159]

[0160] Among them, SSE is the sum of squared errors, k is the number of clustering points, p is the coordinate of a point in the current clustering point set, and m is the i is the cluster center coordinate of the current cluster point set;

[0161] This method uses clustering to determine the number of intersections between the four sides of the rectangular fence and the boundary / border line data, avoiding the conventional method of using line-by-line intersection to find the intersection points, greatly reducing the consumption of computing resources;

[0162] S6: Based on the target boundary line obtained in S5, fence points are added to finally form an electronic fence.

[0163] Embodiment 8:

[0164] A method for generating an electronic fence, which differs from Embodiment 1 in that the method comprises the following steps:

[0165] S1: Obtain preset boundary line data;

[0166] S2: Meshing the boundary line data obtained in S1 to obtain a boundary grid;

[0167] S3: A rectangular fence frame that demarcates the cross-domain boundary;

[0168] S4: Obtaining a corresponding boundary grid according to the longitude and latitude ranges of the vertices of the rectangular fence frame;

[0169] S5: extracting boundary data according to the number of intersections of the boundary grid obtained in S2 and the corresponding boundary grid obtained in S4 to obtain a target boundary line;

[0170] S6: manually adding fence points near the target boundary line obtained in S5, and finally forming an electronic fence with boundary restrictions consisting of the target boundary line and the artificial fence points.

[0171] The present invention aims to solve the difficulty of manually setting up electronic fences when dealing with border lines. In fact, after setting up a rectangular fence frame, this solution can automatically generate an electronic fence. However, in most cases, some fence points (non-border lines) of the electronic fence can be manually modified according to needs.

[0172] Working principle: First, obtain the preset boundary line or border line data composed of thousands of orderly boundary points from the remote sensing testing company; divide the boundary / border line data according to the latitude and longitude grid to obtain the boundary / border grid for easy search; then manually draw a rectangular fence frame across the domain boundary / border line on the map, and obtain the corresponding boundary / border grid according to the latitude and longitude range of the vertices of the rectangular fence frame; determine whether there is an intersection between the four sides of the rectangular fence frame and the boundary / border line data in the corresponding boundary / border grid; the intersection is obtained by clustering the boundary point set whose distance between the boundary / border line data in the corresponding boundary / border grid and the four sides of the rectangular fence frame is less than the distance threshold e; through the elbow method + kmeans clustering method, the number of point set centers that can be obtained is the number of intersection points. The number of intersection points between the four sides of the rectangular fence frame and the boundary / border line data is determined by the clustering method, avoiding the conventional method of using line intersection to find the intersection point, greatly reducing the consumption of computing resources;

[0173] When the number of intersection points is greater than 2, it means that there is an enclave in the intersection area between the boundary / border and the rectangular fence frame, or all the vertices of the rectangular fence frame are outside the boundary / border, and the electronic fence cannot be automatically generated; when the number of intersection points is equal to 2, the boundary / border point data between the intersection points are extracted to obtain the target boundary / border; finally, fence points are manually added near the target boundary / border, and finally an electronic fence restricted by the boundary / border is formed by the target boundary / border and the artificial fence points; this method can automatically handle ultra-large-scale electronic fences restricted by borders, provincial and municipal administrative boundaries, etc., avoiding the tediousness and omissions caused by excessive reliance on manual production.

[0174] Example 9

[0175] like Figures 2 to 4 As shown, a method for generating an electronic fence for a drone is provided. The method generates an electronic fence for a drone based on a geographic information object and a flight mission, and comprises the following steps:

[0176] S1: Select the geographic information object of interest and automatically set the electronic fence focus point;

[0177] The setting methods of the points of interest include selecting geographic information objects, manually selecting points of interest, and importing business data. Geographic information objects are objects contained in remote sensing maps and navigation maps (such as schools, hospitals, stations, factories, reservoirs, and bridges), and business data are business data of their geographical locations (such as common fire points, traffic accident-prone areas, geological disaster risk points, power grid wires, and poles and towers);

[0178] S2: adding the focus point to the pre-selected point set S;

[0179] S3: Set the geo-fence airspace attribute to no entry or no exit;

[0180] S4: The final fence points are formed through algorithm screening;

[0181] In S3, the airspace attribute of the electronic fence is set to be prohibited from entering, and the algorithm in S4 includes the following steps: S4-1: first clustering the unordered scattered points in the pre-selected point set S to obtain multiple pre-selected point subsets;

[0182] S4-2: using Delaunay triangulation for each of the pre-selected point subsets, and removing the extra-long edges of the outermost non-geographic information object boundary to obtain a unique triangulated network;

[0183] S4-3: Expand the triangulated network using the polyline parallel line method to obtain the electronic fence coverage area;

[0184] S4-4: The vertices of the polygon of the electronic fence coverage area are the fence points finally generated

[0185] In S3, the geo-fence airspace attribute is set to "no exit", and the algorithm in S4 includes the following steps:

[0186] S4-a: Setting fence concavity;

[0187] S4-b: For the concave electronic fence, continue to execute steps S4-2 to S4-4;

[0188] For a convex hull geo-fence, continue with the following steps:

[0189] S4-c: Delaunay triangulates the disordered scattered points in the pre-selected point set to obtain a unique triangulated network;

[0190] S4-d: using the polyline parallel line method to shrink the triangulated network to obtain the electronic fence coverage area;

[0191] S4-e: The vertices of the polygon of the electronic fence coverage area are the fence points finally generated.

[0192] This embodiment takes the school as the object of attention and generates an electronic fence, which is as follows

[0193] S1: Select school as the geographic information object of interest. Select the school to automatically set the boundary points of the school geographic objects (primary school, middle school, university, kindergarten, etc.) within the map range as the electronic fence focus points;

[0194] S2: Add the electronic fence focus points to the pre-selected point set S;

[0195] S3: Set the geo-fence airspace attribute to no entry;

[0196] S4: Use a clustering algorithm such as Kmeans to cluster the disordered scattered points in the pre-selected point set to obtain multiple pre-selected point subsets s. The clustering process regards the schools that are clustered together as the same no-fly zone. The three schools in the map are close to each other, forming a no-fly zone, and obtaining a pre-selected point subset;

[0197] Delaunay triangulation is applied to the pre-selected point subset, and the extra-long edges of the outermost non-geographic information object boundary are eliminated (the boundary of the geographic information object itself is used as the basic boundary of the electronic fence and cannot be eliminated), and a unique triangulated network △ is obtained;

[0198] The principle of Delaunay triangulation algorithm is as follows:

[0199] Input: Vertex list

[0200] Output: List of determined triangles

[0201] Initialize the vertex list

[0202] Determine the super triangle

[0203] Add the super triangle vertices to the end of the vertex list

[0204] Add the super triangle to the triangle list

[0205] Iterate over the vertex list

[0206] Initialize edge list

[0207] Iterate over the triangle list

[0208] Calculate the center and radius of the circumcircle of the current triangle

[0209] If the current point is in the circumcircle of the current triangle, add the current triangle to the edge list three times and remove the current triangle from the triangle list

[0210] End if

[0211] End traversal

[0212] Remove all duplicate edges from the edge list

[0213] Add all triangles consisting of the edges in the edge list and the current triangle to the triangle list

[0214] End traversal

[0215] Remove the triangle associated with the super triangle vertex from the triangle list

[0216] Finally, the triangulated network is expanded using the polyline parallel line method to obtain the coverage area of ​​the electronic fence;

[0217] like Figure 5 As shown, for each vertex P of the triangulated network △, point Q is obtained by dilation. The formula of the broken line parallel method is as follows:

[0218]

[0219] Where d is the expansion distance, is the vector of the line parallel to point P to the L1 line segment through point Q, is the vector of the line parallel to point P to the L2 line segment through point Q, is the vector from point A to point P, is the vector from point B to point P, is the modulus of its corresponding vector, P x , Q x is the x-axis coordinate of point P and point Q, P y , Q y are the y-axis coordinates of points P and Q.

[0220] The vertices of the polygons in the electronic fence coverage area are the fence points that are finally generated. Aircraft are prohibited from crossing this area (intensive teaching area) when flying in this area.

[0221] Example 10

[0222] like Figures 6 to 8 As shown, a method for generating an electronic fence for a drone is different from Example 1 in that the method generates an obstacle electronic fence online based on a perception system, and includes the following steps:

[0223] Sa: During the flight mission, the onboard perception system continuously perceives the environment around the aircraft; the onboard perception system is a device with three-dimensional space perception capabilities, including depth cameras, stereo cameras, laser radars, millimeter-wave radars, and ultrasonic radars;

[0224] Sb: When the perception system detects an obstacle within the safety distance or has triggered obstacle avoidance, it will build an electronic fence around the obstacle; the safety distance is consistent with the obstacle avoidance distance and can be adjusted dynamically;

[0225] Sc: After confirming the construction of the obstacle electronic fence, according to the corresponding drone position information when the obstacle is perceived, including aircraft posture, sensor calibration parameters, etc., the obstacle 3D point cloud is converted to the navigation coordinate system (North East Earth NED, Northeast Sky ENU);

[0226] Obstacle point cloud c Usually relative to the sensor coordinate system, the sensor external parameters And the current position of the aircraft Convert the point cloud to the navigation coordinate system and get p n ;

[0227]

[0228] Sd: Processing the converted three-dimensional point cloud by a point cloud processing algorithm to obtain an obstacle electronic fence; including the following steps:

[0229] Sd-1: Downsample the point cloud obtained by the perception system (uniform or voxel filtering) to reduce the amount of data, and then remove outliers through radius or statistical filters;

[0230] Sd-2: Project the filtered sparse 3D point cloud to the aircraft height plane (i.e. set the point cloud height to the aircraft height);

[0231] Sd-3: Delaunay triangulates the disordered point cloud to obtain a unique triangulated network, which is then expanded according to the aircraft attributes (size) to finally obtain the obstacle fence points;

[0232] The point cloud processing algorithm includes downsampling the point cloud (uniform or voxel filtering) to reduce the amount of subsequent processing data, then removing outliers through radius or statistical filters, and then projecting the filtered sparse three-dimensional point cloud to the aircraft altitude plane (that is, setting the point cloud altitude to the aircraft altitude). After obtaining the processed point cloud, the obstacle electronic fence is obtained by Delaunay triangulation to generate a unique triangulated network, and triangulated network expansion combined with aircraft attributes;

[0233] Se: Finally, convert the electronic fence point to latitude and longitude, and add it to the obstacle electronic fence map. The obstacle map will check and warn the route when the next flight plan is uploaded.

[0234] The navigation coordinate system is converted to longitude, latitude and altitude using the following formula:

[0235] NED origin latitude and longitude Ori(O lat ,O lon ,O alt )

[0236] Fence point NED position P(x,y,z)

[0237] Earth's equatorial radius: E a =6378137

[0238] Earth's eccentricity e

[0239] Latitude coefficient: Rlat = E a (1-e 2 ) / (1-e 2 sin(O lat ) 2 )3 / 2 +O alt

[0240] Longitude coefficient: Rlon=(E a / (1-e 2 sin(O lat ) 2 ) 1 / 2 +O alt )*cos(O lat )

[0241] lat=x / Rlat+O lat

[0242] lon=y / Rlon+O lon

[0243] This specific embodiment is merely an explanation of the present invention and is not a limitation of the present invention. After reading this specification, those skilled in the art may make non-creative modifications to the present embodiment as needed. However, as long as they are within the scope of the claims of the present invention, they are protected by the patent law.

Claims

1. A method for generating an electronic fence, characterized in that: The method comprises the following steps: S1: Obtaining preset boundary line data; S2: Meshing the boundary line data obtained in S1 to obtain a boundary grid; S3: A rectangular fence frame that demarcates the cross-domain boundary; S4: Obtaining a corresponding boundary grid according to the longitude and latitude ranges of the vertices of the rectangular fence frame; S5: extracting boundary data according to the number of intersections of the boundary grid obtained in S2 and the corresponding boundary grid obtained in S4 to obtain a target boundary line; S6: Add fence points to the target boundary line obtained in S5 to form an electronic fence.

2. The method for generating an electronic fence according to claim 1, characterized in that: The boundary line data in S1 is composed of a large number of ordered boundary points.

3. The method for generating an electronic fence according to claim 1, characterized in that: The grid division method in S2 is based on longitude and latitude.

4. The method for generating an electronic fence according to claim 1, characterized in that: The rectangular fence frame in S3 is drawn manually on the map.

5. The method for generating an electronic fence according to claim 1, characterized in that: The number of intersection points in S5 is a set of boundary points whose distances between the boundary line data in the corresponding boundary grid and the four sides of the rectangular fence frame meet the distance threshold; The formula for obtaining the boundary point set is as follows: Horizontal side of rectangular fence frame: |Years 边境点 -Years 横边 | <e Rectangular fence frame vertical side: |Lon 边境点 -Lon 竖边 |<e The distance threshold e is the longitude and latitude range.

6. The method for generating an electronic fence according to claim 5, characterized in that: The number of set centers obtained by the clustering algorithm of the boundary point set is the number of intersection points.

7. The method for generating an electronic fence according to claim 6, characterized in that: The clustering algorithm adopts kmeans + elbow method, and the algorithm steps are as follows: S5-1: First, input the point set to obtain the number of intersection points; then create the k value set in sequence, create the cluster center set, initialize the k value set, and then set the maximum number of iterations, traverse the K value set. If the maximum number of iterations is reached, the traversal is terminated directly; if the maximum number of iterations is not reached, initialize the cluster center set, traverse the point set in sequence, traverse the cluster center, calculate the Euclidean distance from the current point set to the current cluster center, and assign it to the nearest neighbor cluster according to the minimum distance principle, and then terminate the traversal. Finally, recalculate the cluster center according to the category mean, end the traversal, end the iteration, and then calculate the degree of distortion of each category, and then end the traversal; The Euclidean distance calculation formula is as follows: Among them, D is the Euclidean distance between points, n is the dimension of the point set, and x i is the coordinate of a point in the current cluster point set, m i is the cluster center coordinate of the current cluster point set; The degree of distortion is calculated using the sum of squared errors, as follows: Among them, SSE is the sum of squared errors, k is the number of clustering points, p is the coordinate of a point in the current clustering point set, and m is the i is the cluster center coordinate of the current cluster point set; S5-2: Select the distortion elbow point k value in S5-1 as the number of intersection points.

8. The method for generating an electronic fence according to claim 1, characterized in that: When the number of intersections in S5 is greater than 2, the vertices of the rectangular fence frame are all outside the boundary line, and the electronic fence cannot be automatically generated.

9. The method for generating an electronic fence according to claim 1, characterized in that: When the number of intersection points in S5 is equal to 2, the boundary data between the intersection points are extracted to obtain the target boundary line.

10. The method for generating an electronic fence according to claim 1, characterized in that: The method of adding fence points in S6 to form an electronic fence is: manually adding fence points near the target boundary line obtained in S5 to form an electronic fence with boundary restrictions consisting of the target boundary line and manual fence points.

Citation Information

Patent Citations

  • Unmanned aerial vehicle no-fly zone and electronic fence control method and system, equipment and medium

    CN113671993A