Spatial collision detection method based on matrix hadamard product operation
By employing a spatial conflict detection method based on matrix Hadamard product operations, and utilizing global triplet coding and diamond grids, the computational complexity of spatial conflict detection is solved, achieving the effects of rapid detection and reduced computational load.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- THE 28TH RES INST OF CHINA ELECTRONICS TECH GROUP CORP
- Filing Date
- 2023-03-30
- Publication Date
- 2026-07-24
AI Technical Summary
Existing technologies are computationally complex and computationally intensive in airspace conflict detection, making it impossible to quickly handle large-scale airspace conflicts and provide effective data support for subsequent conflict resolution.
A method based on matrix Hadamard product operation is adopted to quickly detect airspace conflicts by hierarchical spatial domain, constructing a spatial domain data matrix and detecting spatial conflicts, and taking advantage of the small deformation of global triplet encoding and diamond grid.
It enables rapid detection of large-scale airspace conflicts, reduces the amount of computation required in the later stages, and provides effective data support for airspace conflict resolution.
Smart Images

Figure CN116541645B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a spatial conflict detection method based on matrix Hadamard product operations. Background Technology
[0002] With the continuous development of the aviation industry, the demand for airspace from various air-using units is growing rapidly, leading to frequent airspace flight conflicts. Airspace use plans for different missions originate from different sources, and coordination between them is often insufficient. This can easily result in multiple airspaces overlapping at different altitudes, times, and spatial ranges, causing flight conflicts, dangerous close encounters, or even mid-air collisions, greatly impacting flight safety and mission completion.
[0003] The traditional solution for airspace conflict detection involves cross-calculating the latitude and longitude ranges of airspaces. This means determining if there is an airspace conflict by cross-calculating the edges of the airspace required by each airspace usage plan. While this method can accurately calculate the conflicting airspace usage plans and the range of the conflicting airspaces, it is computationally complex, computationally intensive, and time-consuming, making it only suitable for detecting small-scale airspace conflicts. It cannot provide data support for subsequent airspace conflict resolution. Summary of the Invention
[0004] Objective of the Invention: The technical problem to be solved by this invention is to address the shortcomings of existing technologies by providing a spatial collision detection method based on matrix Hadamard product operations, comprising the following steps:
[0005] Step 1: Collect airspace information and classify airspace.
[0006] Step 2: Construct the spatial data matrix;
[0007] Step 3: Perform airspace conflict detection.
[0008] Step 1 includes: classifying airspace tasks according to their priority, sorting and entering them in order from early to late based on the start time of the airspace, grouping them in order from high to low, entering the latitude and longitude coordinates of the airspace boundary points according to the actual use of the airspace, converting the latitude and longitude coordinate system to the grid coordinate system, and dividing the airspace vertex code into three parts: diamond code, location code, and coordinate code, namely [a0, b, (i, j)].
[0009] Where a0 represents the diamond code, that is, the initial 10 diamond units, numbered from 0 to 9. The diamond formed by P0, P1, P2, and P6 is numbered 0, the diamond formed by P0, P2, P3, and P7 is numbered 1, and so on.
[0010] b represents the zone code, which consists of 4 bits, each of which is a number from 0 to 3;
[0011] (i, j) is the coordinate code, which represents the row and column number of the grid. It refers to the subdivision from the 4th layer to the 10th layer, that is, the grid cell of the 4th layer is further divided into 4096 small rhombus grids. That is, each side of the rhombus grid cell of the 4th layer is divided into 64 equal parts. The values of i and j are both 0 to 63. The grid coordinate system is established with the left vertex of the rhombus grid cell as the origin.
[0012] Step 2 includes:
[0013] Step 2-1: Let the latitude and longitude coordinates of the point be G(λ, φ), the radius of the Earth's equator be R, and the corresponding three-dimensional rectangular coordinates be C(X, Y, Z), where λ represents longitude and φ represents latitude. Establish the relationship for converting from spherical latitude and longitude coordinates to three-dimensional rectangular coordinates based on spatial geometric relationships.
[0014] Step 2-2: Given the coordinates of the grid boundary points P1, P2, P3, P4 and the coordinates of the point P to be determined, connect the midpoints of opposite edges of the grid to obtain the midpoint coordinates M1, M2, M3, M4, and divide the grid into four quadrants; determine the quadrant in which the point P to be determined is located, and perform hierarchical subdivisions sequentially up to the 10th level.
[0015] Steps 2-3: Obtain the coordinates of the spatial domain boundary points from the encoding of the spatial domain vertices. Connect the coordinates to obtain the spatial domain boundary. Calculate the grid occupied by the spatial domain and assign it a value of 1. Assign a value of 0 to other grids within the task area. This results in a 64×64 data matrix composed of 0s and 1s, which is the spatial domain data matrix.
[0016] In step 2-2, the rhombus code a0 is obtained based on the initial rhombus cell number where the point is located. That is, the initial 10 rhombus cells are numbered from 0 to 9.
[0017] In step 2-2, according to the definition of b, the location code of the grid where a point is located is determined. Only a maximum of 16 determinations are needed to determine the location code of the point from 256 numbers.
[0018] In step 2-2, determining the data matrix (i, j) includes:
[0019] Step 2-2-a1: Let N = 6 be the number of subdivisions. Subdivide the rhombic grid cells under the fourth layer once, until the tenth layer is reached. The four small rhombic grid cells are labeled 0, 1, 2, and 3 respectively. If the target point is located at cell 0, then i1 = 0 and j1 = 0; if it is located at cell 1, then i1 = 2. N-1 If j1 = 0, then if it is located at position 2, then i1 = 2. N-1 j1 = 2 N-1 If it is located at position 3, then i1 = 0, j1 = 2 N-1 Where i1 and j1 are the row and column labels after the first partitioning, respectively;
[0020] Step 2-2-a2: Perform the second subdivision. If the target point is located at position 0, then i2 = 0 + i1, j2 = 0 + j1; if it is located at position 1, then i2 = 2. N-2 +i1, j2=0+j1, if it is located at position 2, then i2=2 N-2 +i1,j2=2 N-2 If the value is +j1, then i2 = 0 + i1, j2 = 2. N-2 +j1; where i2 and j2 are the row and column labels after the second partitioning, respectively;
[0021] Step 2-2-a3: Perform the third subdivision. If the target point is located at position 0, then i3 = 0 + i2, j3 = 0 + j2; if it is located at position 1, then i3 = 2. N-3 +i2, j3=0+j2, if it is located at position 2, then i3=2 N-3 +i2,j3=2 N-3 If the value is +j2, then i3 = 0 + i2, j3 = 2. N-3 +j2; where i3 and j3 are the row and column labels after the third partitioning, respectively;
[0022] Step 2-2-a4: Based on steps 2-2-a1 to 2-2-a3, a total of six partitions are performed. The final results are i6 and j6, i6 and j6 are the row and column labels at the end of the partition, which are the data matrix (i, j) corresponding to the target point.
[0023] Based on the obtained [a0, b, (i, j)], the triplet encoding of the grid is obtained.
[0024] In step 2-2, determining the location of the target point includes: connecting the target point to each vertex of the rhombus to form four curved triangles; if the sum of the areas of the four curved triangles is equal to the area of the rhombus, the target point is located inside the rhombus; if the sum of the areas of the four curved triangles is greater than the area of the rhombus, the target point is outside the rhombus grid.
[0025] The area and discrimination methods are improved, and the specific calculation method is as follows:
[0026] Let the four vertices of the rhombus grid be A, B, C, and D, with the three-dimensional rectangular coordinates of point A (a1, a2, a3), point B (b1, b2, b3), and point C (c1, c2, c3). O is the center of the Earth, point M is the target point, and R is the radius of the Earth.
[0027] The normal vector of plane OAB is The normal vector of surface OAC is AP1 is an arc The tangent of AP2 is an arc. tangent;
[0028]
[0029]
[0030]
[0031]
[0032]
[0033] Let the area of rhombus ABCD be S1, then we get:
[0034] S1 = S ΔABC +S ΔBCD
[0035] S ΔABC =(∠A+∠ABC+∠ACB-π)R 2
[0036] S ΔBCD =(∠CBD+∠BCD+∠D-π)R 2
[0037] Where S ΔABC Let S represent the area of triangle ABC. ΔBCD Represents the area of triangle BCD;
[0038] Then calculate the areas of ΔMAB, ΔMAC, ΔMBD, and ΔMCD respectively. Let the sum of the areas of the four spherical triangles be S2. Then the area difference of point M with respect to rhombus ABCD is ΔS1 = S2 - S1, and the area difference of point M with respect to other rhombuses is ΔS2. Compare the area difference ΔS of point M with respect to different rhombuses. The smaller the area difference, the more likely point M is to fall within the rhombus grid. From this, we can obtain the position number of the grid where point M is located.
[0039] After determining the grid cell containing the vertices of the spatial domain, determine the grid cell position number occupied by the spatial domain: compare the grid determinant (i, j) of the four vertices, and let the minimum value of i be m and the maximum value be n, and the minimum value of j be p and the maximum value be q; traverse the center point of each grid cell within the range m << i << n, p << j << q, and determine whether point M is within the spatial domain. Connect point M with each vertex of the spatial domain to form a triangle, and compare the sum of the areas of the triangles with the area of the spatial domain. If the sum of the areas of the triangles is greater than the area of the spatial domain, it means that the point is outside the spatial domain; otherwise, it is inside the spatial domain. If the center point of the grid cell is inside the spatial domain, then the grid cell is occupied by the spatial domain.
[0040] Step 3 includes:
[0041] Step 3-1: Different airspace users submit airspace applications to the air traffic control department. After the time limit is reached, the air traffic control department conducts unified airspace conflict detection on the airspace, and at this time, the conflict determination of multiple airspaces is carried out.
[0042] Step 3-2: When there is a temporary airspace application or an emergency requiring the use of airspace, the airspace needs to be checked for conflict with the airspace group that has been processed in Step 3-1. The airspace group is treated as a whole and then compared with the airspace added later. At this time, the conflict determination between single airspace and multiple airspace is performed.
[0043] Step 3-1 includes:
[0044] Step 3-1-1, Time Conflict Detection: Compare whether there is overlap between the time periods of each airspace. First, sort the start times of each airspace. Let the start time of airspace A be start1 and the end time be end1, and the start time of airspace B be start2 and the end time be end2. When start1≤end2 and start2≤end1, there is a time conflict between the two airspaces. If there is a conflict, the corresponding airspace is retained for the next step of detection. Airspaces that do not have time conflicts with other airspaces are removed from the detection and classified as conflict-free airspaces.
[0045] Step 3-1-2, Height Conflict Detection: The detection method is the same as for time conflict detection. Let the lower limit of height for airspace A be min_H1, and the upper limit be max_H1. Let the lower limit of height for airspace B be min_H2, and the upper limit be max_H2. When min_H1 ≤ max_H2 and min_H2 ≤ max_H1, a time conflict exists between the two airspaces. Perform height detection on the airspace set after the detection in Step 3-1-2. Keep the airspaces with height conflicts and proceed to the next step of detection; otherwise, exit the detection process.
[0046] Step 3-1-3, Range Conflict Detection: Perform Hadamard product operation on the matrix, assign values to the data matrix (i, j), and sort the spatial domains according to task priority from high to low. The spatial domain with the highest priority is numbered 101. When a spatial domain occupies a grid cell, assign its number to the occupying grid cell; unoccupied grid cells are assigned a value of 0. The grid cell occupied by the first spatial domain is assigned a value of 101, forming matrix A1; the grid cell occupied by the second spatial domain is assigned a value of 102, forming matrix A2; and the grid cell occupied by the nth spatial domain is assigned a value of 10n, forming matrix A1. n Then each spatial domain corresponds to a 64×64 matrix consisting of 0 and its number;
[0047] Step 3-1-4, Matrix Operations: Let the judgment matrix be T. n The corresponding matrices for each spatial domain are A1 to A1 respectively. n ,get:
[0048] T2 = 1000A1 + A2
[0049] T3 = 1000T2 + A3
[0050] ...
[0051] T n =1000T n-1 +A n
[0052] Step 3-1-5, let t be an element in the judgment matrix. ij Iterate through all elements and perform integer and modulo operations on them respectively:
[0053] a1=[t ij [÷1000], b1=t ij -1000a1
[0054] a2=[a1÷1000], b2=a1-1000a2……
[0055] a n =[a n-1 ÷1000],b n =a n-1 -1000a n
[0056] a n The operation ends when n = 0. When n = 1, there is no spatial conflict. When n ≥ 2, there is a spatial conflict. In this case, the non-zero value of b is the conflicting spatial domain number.
[0057] Step 3-1-6: Output the final result. After all spatial matrices are processed, a spatial group is obtained. The spatial group as a whole is regarded as a matrix, and conflict detection is performed with the subsequently temporarily added single spatial domains.
[0058] Step 3-2 includes:
[0059] Step 3-2-1: Assign values to the data matrix (i, j). The default value in the data matrix (i, j) is 0. When the airspace occupies one grid cell, assign values to the elements at the corresponding positions in the data matrix (i, j). When inputting the airspace plan, input the coordinates of the airspace vertices in sequence. The resulting matrix is the airspace corresponding matrix, denoted as B1. The time and height are directly added to the matrices corresponding to the airspaces that conflict with the airspaces added later, denoted as B2.
[0060] Step 3-2-2, Matrix Operations: Let the judgment matrix be B3:
[0061] B3 = 1000B1 + B2;
[0062] Step 3-2-3, let t be an element in the judgment matrix. ij Iterate through all elements and perform integer and modulo operations respectively:
[0063] a1=[t ij [÷1000], b1=t ij -1000a1
[0064] a2=[a1÷1000],b2=a1-1000a2
[0065] ...
[0066] a n =[a n-1 ÷1000],b n =a n-1 -1000a n
[0067] a n The operation ends when n = 0. When n = 1, there is no spatial conflict; when n ≥ 2, there is a spatial conflict, and the non-zero value of b is the conflicting spatial domain number.
[0068] The present invention has the following beneficial effects:
[0069] 1. By adopting the global triplet encoding method, the location information of spatial coordinate points around the world can be obtained quickly, which facilitates the processing, retrieval and storage of spatial data;
[0070] 2. The rhombus grid has less deformation and is naturally similar to a matrix, which is beneficial for the next step of matrix Hadamard product calculation;
[0071] 3. To address large-scale airspace usage demands, the system enables rapid airspace conflict detection and generates conflicting airspace numbers, reducing data lookups and computational load for subsequent airspace conflict resolution. Attached Figure Description
[0072] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments, and the advantages of the present invention in the above and / or other aspects will become clearer.
[0073] Figure 1 This is a flowchart of the airspace conflict detection process of the present invention.
[0074] Figure 2 This is the spatial simulation diagram of the present invention.
[0075] Figure 3 This is a schematic diagram of the detection results of an embodiment of the present invention.
[0076] Figure 4 This is a schematic diagram of the detection time in an embodiment of the present invention. Detailed Implementation
[0077] like Figure 1 As shown, this invention provides a spatial collision detection method based on matrix Hadamard product operation, including the following steps:
[0078] Step 1: Collect airspace information and classify airspaces. Classify airspace tasks according to their priority, sorting and entering information from earliest to latest based on start time, and grouping by priority from highest to lowest. Establish an airspace coordinate database based on actual airspace usage, as shown in Table 1.
[0079] Table 1
[0080]
[0081]
[0082] Step 2: Construct the spatial data matrix: Convert the latitude and longitude coordinates of the spatial boundary points into three-dimensional spherical rectangular coordinates, perform three-dimensional spherical coordinate subdivision and positioning, and construct the global positioning code for the spatial coordinate points. For example... Figure 2 As shown, the airspace occupancy grid is determined.
[0083] Step 3: Perform airspace conflict detection.
[0084] In step 1, the spatial classification includes:
[0085] Tasks are categorized according to airspace priority, and grouped into groups I, II, III, etc., from highest to lowest, following the input method in Table 2. Under the premise of equal task priority, the airspace occupancy time is compared, and tasks are entered in order of start time from earliest to latest.
[0086] Table 2
[0087]
[0088] By representing the spatial grid as a data matrix, spatial data information is assigned to the grid. In the simulated spatial map, the intensity of the color indicates the number of spatial areas occupied by the grid at the same time. The location of conflicting grids can be quickly detected by judging the data information within the grid.
[0089] Step 2 includes:
[0090] Step 2-1: Let the latitude and longitude coordinates of the point be G(λ, φ), the radius of the Earth's equator be R, and the corresponding three-dimensional rectangular coordinates be C(X, Y, Z), where λ represents longitude and φ represents latitude. Establish the relationship for converting from spherical latitude and longitude coordinates to three-dimensional rectangular coordinates based on spatial geometric relationships.
[0091] Step 2-2: Given the coordinates of the grid boundary points P1, P2, P3, P4 and the coordinates of the point P to be determined, connect the midpoints of opposite edges of the grid to obtain the midpoint coordinates M1, M2, M3, M4, and divide the grid into four quadrants; determine the quadrant in which the point P to be determined is located, and perform hierarchical subdivisions sequentially up to the 10th level.
[0092] Steps 2-3: Obtain the coordinates of the spatial domain boundary points from the encoding of the spatial domain vertices. Connect the coordinates to obtain the spatial domain boundary. Calculate the grid occupied by the spatial domain and assign it a value of 1. Assign a value of 0 to other grids within the task area. This results in a 64×64 data matrix composed of 0s and 1s, which is the spatial domain data matrix.
[0093] In step 2-2, the rhombus code a0 is obtained based on the initial rhombus cell number where the point is located. That is, the initial 10 rhombus cells are numbered from 0 to 9.
[0094] In step 2-2, according to the definition of b, the location code of the grid where a point is located is determined. Only a maximum of 16 determinations are needed to determine the location code of the point from 256 numbers.
[0095] In step 2-2, determining the data matrix (i, j) includes:
[0096] Step 2-2-a1: Let N = 6 be the number of subdivisions. Subdivide the rhombic grid cells under the fourth layer once, until the tenth layer is reached. The four small rhombic grid cells are labeled 0, 1, 2, and 3 respectively. If the target point is located at cell 0, then i1 = 0 and j1 = 0; if it is located at cell 1, then i1 = 2. N-1 If j1 = 0, then if it is located at position 2, then i1 = 2. N-1 j1 = 2 N-1 If it is located at position 3, then i1 = 0, j1 = 2 N-1 Where i1 and j1 are the row and column labels after the first partitioning, respectively;
[0097] Step 2-2-a2: Perform the second subdivision. If the target point is located at position 0, then i2 = 0 + i1, j2 = 0 + j1; if it is located at position 1, then i2 = 2. N-2 +i1, j2=0+j1, if it is located at position 2, then i2=2 N-2 +i1,j2=2 N-2 If the value is +j1, then i2 = 0 + i1, j2 = 2. N-2 +j1; where i2 and j2 are the row and column labels after the second partitioning, respectively;
[0098] Step 2-2-a3: Perform the third subdivision. If the target point is located at position 0, then i3 = 0 + i2, j3 = 0 + j2; if it is located at position 1, then i3 = 2. N-3+i2, j3=0+j2, if it is located at position 2, then i3=2 N-3 +i2,j3=2 N-3 If the value is +j2, then i3 = 0 + i2, j3 = 2. N-3 +j2; where i3 and j3 are the row and column labels after the third partitioning, respectively;
[0099] Step 2-2-a4: Based on steps 2-2-a1 to 2-2-a3, a total of six partitions are performed. The final results are i6 and j6, i6 and j6 are the row and column labels at the end of the partition, which are the data matrix (i, j) corresponding to the target point.
[0100] Based on the obtained [a0, b, (i, j)], the triplet encoding of the grid is obtained.
[0101] In step 2-2, determining the location of the target point includes: connecting the target point to each vertex of the rhombus to form four curved triangles; if the sum of the areas of the four curved triangles is equal to the area of the rhombus, the target point is located inside the rhombus; if the sum of the areas of the four curved triangles is greater than the area of the rhombus, the target point is outside the rhombus grid.
[0102] The area and discrimination methods are improved, and the specific calculation method is as follows:
[0103] Let the four vertices of the rhombus grid be A, B, C, and D, with the three-dimensional rectangular coordinates of point A (a1, a2, a3), point B (b1, b2, b3), and point C (c1, c2, c3). O is the center of the Earth, point M is the target point, and R is the radius of the Earth.
[0104] The normal vector of plane OAB is The normal vector of surface OAC is AP1 is an arc The tangent of AP2 is an arc. tangent;
[0105]
[0106]
[0107]
[0108]
[0109]
[0110] Let the area of rhombus ABCD be S1, then we get:
[0111] S1 = S ΔABC +SΔBCD
[0112] S ΔABC =(∠A+∠ABC+∠ACB-π)R 2
[0113] S ΔBCD =(∠CBD+∠BCD+∠D-π)R 2
[0114] Where S ΔABC Let S represent the area of triangle ABC. ΔBCD Represents the area of triangle BCD;
[0115] Then calculate the areas of ΔMAB, ΔMAC, ΔMBD, and ΔMCD respectively. Let the sum of the areas of the four spherical triangles be S2. Then the area difference of point M with respect to rhombus ABCD is ΔS1 = S2 - S1, and the area difference of point M with respect to other rhombuses is ΔS2. Compare the area difference ΔS of point M with respect to different rhombuses. The smaller the area difference, the more likely point M is to fall within the rhombus grid. From this, we can obtain the position number of the grid where point M is located.
[0116] After determining the grid cell containing the vertices of the spatial domain, determine the grid cell position number occupied by the spatial domain: compare the grid determinant (i, j) of the four vertices, and let the minimum value of i be m and the maximum value be n, and the minimum value of j be p and the maximum value be q; traverse the center point of each grid cell within the range m << i << n, p << j << q, and determine whether point M is within the spatial domain. Connect point M with each vertex of the spatial domain to form a triangle, and compare the sum of the areas of the triangles with the area of the spatial domain. If the sum of the areas of the triangles is greater than the area of the spatial domain, it means that the point is outside the spatial domain; otherwise, it is inside the spatial domain. If the center point of the grid cell is inside the spatial domain, then the grid cell is occupied by the spatial domain.
[0117] Step 3 includes:
[0118] Step 3-1: Different airspace users submit airspace applications to the air traffic control department. After the time limit is reached, the air traffic control department conducts unified airspace conflict detection on the airspace, and at this time, the conflict determination of multiple airspaces is carried out.
[0119] Step 3-2: When there is a temporary airspace application or an emergency requiring the use of airspace, the airspace needs to be checked for conflict with the airspace group that has been processed in Step 3-1. The airspace group is treated as a whole and then compared with the airspace added later. At this time, the conflict determination between single airspace and multiple airspace is performed.
[0120] Step 3-1 includes:
[0121] Step 3-1-1, Time Conflict Detection: Compare whether there is overlap between the time periods of each airspace. First, sort the start times of each airspace. Let the start time of airspace A be start1 and the end time be end1, and the start time of airspace B be start2 and the end time be end2. When start1≤end2 and start2≤end1, there is a time conflict between the two airspaces. If there is a conflict, the corresponding airspace is retained for the next step of detection. Airspaces that do not have time conflicts with other airspaces are removed from the detection and classified as conflict-free airspaces.
[0122] Step 3-1-2, Height Conflict Detection: The detection method is the same as for time conflict detection. Let the lower limit of height for airspace A be min_H1, and the upper limit be max_H1. Let the lower limit of height for airspace B be min_H2, and the upper limit be max_H2. When min_H1 ≤ max_H2 and min_H2 ≤ max_H1, a time conflict exists between the two airspaces. Perform height detection on the airspace set after the detection in Step 3-1-2. Keep the airspaces with height conflicts and proceed to the next step of detection; otherwise, exit the detection process.
[0123] Step 3-1-3, Range Conflict Detection: Perform Hadamard product operation on the matrix, assign values to the data matrix (i, j), and sort the spatial domains according to task priority from high to low. The spatial domain with the highest priority is numbered 101. When a spatial domain occupies a grid cell, assign its number to the occupying grid cell; unoccupied grid cells are assigned a value of 0. The grid cell occupied by the first spatial domain is assigned a value of 101, forming matrix A1; the grid cell occupied by the second spatial domain is assigned a value of 102, forming matrix A2; and the grid cell occupied by the nth spatial domain is assigned a value of 10n, forming matrix A1. n Then each spatial domain corresponds to a 64×64 matrix consisting of 0 and its number;
[0124] Step 3-1-4, Matrix Operations: Let the judgment matrix be T. n The corresponding matrices for each spatial domain are A1 to A1 respectively. n ,get:
[0125] T2 = 1000A1 + A2
[0126] T3 = 1000T2 + A3
[0127] ...
[0128] T n =1000T n-1 +A n
[0129] Step 3-1-5, let t be an element in the judgment matrix. ijIterate through all elements and perform integer and modulo operations on them respectively:
[0130] a1=[t ij [÷1000], b1=t ij -1000a1
[0131] a2=[a1÷1000], b2=a1-1000a2……
[0132] a n =[a n-1 ÷1000],b n =a n-1 -1000a n
[0133] a n The operation ends when n = 0. When n = 1, there is no spatial conflict. When n ≥ 2, there is a spatial conflict. In this case, the non-zero value of b is the conflicting spatial domain number.
[0134] Step 3-1-6: Output the final result. All spatial domain matrices are processed to obtain a spatial domain group. The spatial domain group is considered as a single matrix, and conflict detection is performed with subsequently added individual spatial domains. For example... Figure 3 , Figure 4 The image shown is a diagram illustrating the collision detection results and the collision detection time in this embodiment.
[0135] Step 3-2 includes:
[0136] Step 3-2-1: Assign values to the data matrix (i, j). The default value in the data matrix (i, j) is 0. When the airspace occupies one grid cell, assign values to the elements at the corresponding positions in the data matrix (i, j). When inputting the airspace plan, input the coordinates of the airspace vertices in sequence. The resulting matrix is the airspace corresponding matrix, denoted as B1. The time and height are directly added to the matrices corresponding to the airspaces that conflict with the airspaces added later, denoted as B2.
[0137] Step 3-2-2, Matrix Operations: Let the judgment matrix be B3:
[0138] B3 = 1000B1 + B2;
[0139] Step 3-2-3, let t be an element in the judgment matrix. ij Iterate through all elements and perform integer and modulo operations respectively:
[0140] a1=[t ij [÷1000], b1=t ij -1000a1
[0141] a2=[a1÷1000],b2=a1-1000a2
[0142] ...
[0143] a n =[a n-1 ÷1000],b n =a n-1 -1000a n
[0144] a n The operation ends when n = 0. When n = 1, there is no spatial conflict; when n ≥ 2, there is a spatial conflict, and the non-zero value of b is the conflicting spatial domain number.
[0145] In its specific implementation, this application provides a computer storage medium and a corresponding data processing unit. The computer storage medium is capable of storing a computer program, which, when executed by the data processing unit, can run the invention's content regarding the spatial conflict detection method based on matrix Hadamard product operations, as well as some or all of the steps in various embodiments. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0146] Those skilled in the art will clearly understand that the technical solutions in the embodiments of the present invention can be implemented using computer programs and their corresponding general-purpose hardware platforms. Based on this understanding, the technical solutions in the embodiments of the present invention, or the parts that contribute to the prior art, can be embodied in the form of computer programs, i.e., software products. These computer program software products can be stored in a storage medium and include several instructions to cause a device containing a data processing unit (which may be a personal computer, server, microcontroller, MUU, or network device, etc.) to execute the methods described in various embodiments or certain parts of the embodiments of the present invention.
[0147] This invention provides a spatial conflict detection method based on matrix Hadamard product operations. Many methods and approaches exist for implementing this technical solution; the above description is merely a preferred embodiment of the invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this invention, and these improvements and modifications should also be considered within the scope of protection of this invention. All components not explicitly stated in this embodiment can be implemented using existing technologies.
Claims
1. A spatial collision detection method based on matrix operations, characterized in that, Includes the following steps: Step 1: Collect airspace information and classify airspace. Step 2: Construct the spatial data matrix; Step 3: Perform airspace conflict detection; Step 2 includes: Step 2-1: Let the latitude and longitude coordinates of the point be G(λ, φ), the radius of the Earth's equator be R, and the corresponding three-dimensional rectangular coordinates be C(X, Y, Z), where λ represents longitude and φ represents latitude. Establish the relationship for converting from spherical latitude and longitude coordinates to three-dimensional rectangular coordinates based on spatial geometric relationships. Step 2-2: Given the coordinates of the grid boundary points P1, P2, P3, P4 and the coordinates of the point P to be determined, connect the midpoints of opposite edges of the grid to obtain the midpoint coordinates M1, M2, M3, M4, and divide the grid into four quadrants; determine the quadrant in which the point P to be determined is located, and perform hierarchical subdivisions sequentially up to the 10th level. Steps 2-3: Obtain the coordinates of the spatial domain boundary points from the encoding of the spatial domain vertices, connect the coordinates to obtain the spatial domain boundary, calculate the grid occupied by the spatial domain and assign it a value of 1, assign the value of other grids in the task area to 0, and obtain a 64×64 data matrix composed of 0 and 1, which is the spatial domain data matrix. In step 2-2, it is necessary to determine the data matrix (i, j), including: Step 2-2-a1, record To determine the number of subdivisions, the rhombic grid cells under the fourth layer are subdivided once, and this process continues until the tenth layer is reached. The four smaller rhombic grid cells are labeled 0, 1, 2, and 3, respectively. If the target point is located at cell 0, then... , If it is located at number 1, then , If it is located at number 2, then , If it is located at number 3, then , ;in , These are the row and column labels after the first partitioning, respectively; Step 2-2-a2: Perform a second subdivision. If the target point is located at point 0, then... , If it is located at number 1, then , If it is located at number 2, then , If it is located at number 3, then , ;in , These are the row and column labels after the second partitioning; Step 2-2-a3: Perform the third subdivision. If the target point is located at point 0, then... , If it is located at number 1, then , If it is located at number 2, then , If it is located at number 3, then , ;in , These are the row and column labels after the third partitioning; Step 2-2-a4 involves performing six partitions based on steps 2-2-a1 to 2-2-a3, resulting in the final product. , , , These are the row and column labels at the end of the partitioning, which are the data matrix (i, j) corresponding to the target point. Based on the obtained [a0, b, (i, j)], the triplet encoding of the grid is obtained, where a0 represents the diamond code and b represents the position code.
2. The method according to claim 1, characterized in that, Step 1 includes: classifying airspace tasks according to their priority, sorting and entering them in order from early to late based on the start time of the airspace, grouping them in order from high to low, entering the latitude and longitude coordinates of the airspace boundary points according to the actual airspace usage, converting the latitude and longitude coordinate system to the grid coordinate system, and dividing the airspace vertex code into three parts: diamond code, location code, and coordinate code, namely [a0, b, (i, j)]. Where a0 represents the diamond code, that is, the initial 10 diamond units, numbered from 0 to 9. The diamond formed by P0, P1, P2, and P6 is numbered 0, the diamond formed by P0, P2, P3, and P7 is numbered 1, and so on. b represents the zone code, which consists of 4 bits, each of which is a number from 0 to 3; (i, j) are coordinate codes, which represent the row and column numbers of the grid. This means that the grid is divided from the 4th layer to the 10th layer, that is, the grid cell of the 4th layer is further divided into 4096 small rhombus grids. Each side of the rhombus grid cell of the 4th layer is divided into 64 equal parts. The values of i and j are both 0 to 63. The grid coordinate system is established with the left vertex of the rhombus grid cell as the origin.
3. The method according to claim 2, characterized in that, In step 2-2, the rhombus code a0 is obtained based on the initial rhombus cell number where the point is located. That is, the initial 10 rhombus cells are numbered from 0 to 9.
4. The method according to claim 3, characterized in that, In step 2-2, according to the definition of b, the location code of the grid where a point is located is determined. Only a maximum of 16 determinations are needed to determine the location code of the point from 256 numbers.
5. The method according to claim 4, characterized in that, In step 2-2, determining the location of the target point includes: connecting the target point to each vertex of the rhombus to form four curved triangles. If the sum of the areas of the four curved triangles is equal to the area of the rhombus, the target point is located inside the rhombus. If the sum of the areas of the four curved triangles is greater than the area of the rhombus, the target point is outside the rhombus grid. The area and discrimination methods are improved, and the specific calculation method is as follows: Let the four vertices of the rhombic grid be A, B, C, and D, and let the three-dimensional rectangular coordinates of point A be... 3D rectangular coordinates of point B 3D rectangular coordinates of point C O is the center of the Earth, M is the target point, and R is the radius of the Earth; The normal vector of plane OAB is The normal vector of surface OAC is , For the curve tangent, For the curve tangent; , , , , , Remember the rhombus The area is ,get: , , , in This represents the area of triangle ABC. Represents the area of triangle BCD; Then calculate separately , , , Let the sum of the areas of the four spherical triangles be denoted as . Then point M is relative to the rhombus area difference The area difference between point M and the other rhombuses is Compare the area differences of point M with respect to different rhombuses. The smaller the area difference, the more likely point M is to fall within the rhombus grid, thus deriving the grid number where point M is located. After determining the grid cell containing the vertices of the spatial domain, determine the grid cell position number occupied by the spatial domain: compare the grid determinant (i, j) of the four vertices, and denote the minimum value of i as m and the maximum value as n, and the minimum value of j as p and the maximum value as q; traverse... , For each grid center point within the range, determine whether point M is within the spatial domain. Connect point M to each vertex of the spatial domain to form triangles. Compare the sum of the areas of the triangles with the area of the spatial domain. If the sum of the triangle areas is greater than the area of the spatial domain, the point is outside the spatial domain; otherwise, it is inside the spatial domain. If the grid center point is inside the spatial domain, the grid is occupied by the spatial domain.
6. The method according to claim 5, characterized in that, Step 3 includes: Step 3-1: Different airspace users submit airspace applications to the air traffic control department. After the time limit is reached, the air traffic control department conducts unified airspace conflict detection on the airspace, and at this time, the conflict determination of multiple airspaces is carried out. Step 3-2: When there is a temporary airspace application or an emergency requiring the use of airspace, the airspace needs to be checked for conflict with the airspace group that has been processed in Step 3-1. The airspace group is treated as a whole and then compared with the airspace added later. At this time, the conflict determination between single airspace and multiple airspace is performed.
7. The method according to claim 6, characterized in that, Step 3-1 includes: Step 3-1-1, Time Conflict Detection: Compare whether there is overlap between the time periods of each airspace. First, sort the start times of each airspace. Let the start time of airspace A be start1 and the end time be end1, and the start time of airspace B be start2 and the end time be end2. When start1 ≤ end2 and start2 ≤ end1, there is a time conflict between the two airspaces. If there is a conflict, the corresponding airspace is retained for the next step of detection. Airspaces that do not have time conflicts with other airspaces are removed from the detection and classified as conflict-free airspaces. Step 3-1-2, Height Conflict Detection: The detection method is the same as that for time conflict detection. Let the lower limit of the height of airspace A be min_H1 and the upper limit of the height be max_H1. Let the lower limit of the height of airspace B be min_H2 and the upper limit of the height be max_H2. When min_H1≤ max_H2 and min_H2≤ max_H1, there is a time conflict between the two airspaces. After the airspace set after step 3-1-2 is detected, perform height detection on each airspace. Keep the airspaces with height conflicts and proceed to the next step of detection. If there are no airspaces with height conflicts, exit the detection. Step 3-1-3, Range Conflict Detection: Perform matrix operations, assign values to the data matrix (i, j), and sort the spatial domains according to task priority from high to low. The spatial domain with the highest priority is numbered 101. When a spatial domain occupies a grid cell, assign its number to the occupying grid cell; unoccupied grid cells are assigned a value of 0. The grid cell occupied by the first spatial domain is assigned a value of 101, forming matrix A1; the grid cell occupied by the second spatial domain is assigned a value of 102, forming matrix A2; and the grid cell occupied by the nth spatial domain is assigned a value of 10n, forming matrix A. n Then each spatial domain corresponds to a 64×64 matrix consisting of 0 and its number; Step 3-1-4, Matrix Operations: Let the judgment matrix be T. n The corresponding matrices for each spatial domain are A1 to A1 respectively. n ,get: , ,……, , Step 3-1-5, let t be an element in the judgment matrix. ij Iterate through all elements and perform integer and modulo operations on them respectively: , , , ,……, , , The operation ends when... At that time, there was no airspace conflict; when When there is an airspace conflict, the non-zero value of b is the conflict airspace number. Step 3-1-6: Output the final result. All spatial matrices are processed to obtain a spatial group, which is considered as a whole as a matrix.
8. The method according to claim 7, characterized in that, Step 3-2 includes: Step 3-2-1: Assign values to the data matrix (i, j). The default value in the data matrix (i, j) is 0. When the airspace occupies one grid cell, assign values to the elements at the corresponding positions in the data matrix (i, j). When inputting the airspace plan, input the coordinates of the airspace vertices in sequence. The resulting matrix is the airspace corresponding matrix, denoted as B1. The time and height are directly added to the matrices corresponding to the airspaces that conflict with the airspaces added later, denoted as B2. Step 3-2-2, Matrix Operations: Let the judgment matrix be B3: ; Step 3-2-3, let t be an element in the judgment matrix. ij Iterate through all elements and perform integer and modulo operations respectively: , , , ,……, , , The operation ends when... At that time, there was no airspace conflict; when When there is an airspace conflict, the non-zero value of b is the conflict airspace number.