Construction of Civilian UAV Flight Trajectory Graph from Monitoring Data

In recent years, civilian unmanned aerial vehicles (UAVs) have seen exponential growth in applications ranging from aerial photography and agricultural management to infrastructure inspection and disaster response. However, this rapid expansion has introduced significant challenges in flight safety, airspace management, and operational efficiency. Traditional approaches to UAV flight analysis often rely solely on trajectory data, which limits the depth of insights into flight behaviors, environmental interactions, and technical performance. We recognize that a holistic understanding requires integrating diverse data sources, such as real-time weather conditions, UAV technical parameters, and sequential trajectory points. To address this gap, we propose a novel method for constructing a flight trajectory graph for civilian UAVs, leveraging entity-relationship extraction techniques to unify multi-source monitoring data into a structured knowledge graph. This approach not only enhances comprehensive flight analysis but also enables efficient querying and management through graph database technologies.

The core innovation lies in representing UAV flight operations as a graph, where nodes correspond to entities like trajectory points, weather conditions, and UAV models, and edges capture relationships such as temporal sequences and environmental influences. By incorporating time-series relationships and attributing properties to both nodes and edges, our method facilitates a nuanced exploration of flight patterns. We employ Neo4j, a graph database, for storage and retrieval, demonstrating through real-world experiments that our trajectory graph supports advanced queries and outperforms traditional databases in scenarios like aggregate, neighborhood search, and complex conditional queries. This paper details the entire pipeline, from data collection and preprocessing to graph construction and evaluation, providing a scalable framework for improving UAV monitoring and safety.

The integration of multiple data sources is crucial for a robust analysis of civilian UAV operations. Flight trajectory data, typically obtained from onboard GPS and sensors, includes timestamps, longitude, latitude, altitude, and velocity. Weather data, collected via APIs from services like Gaode Weather, provides temperature, wind speed, wind direction, visibility, and climate conditions. Technical parameters of civilian UAVs, sourced from manufacturer specifications, encompass model type, endurance, range, and identification details. These datasets are stored in structured databases, but their isolated nature hinders correlated analysis. Our method bridges this gap by extracting entities and relationships to build a cohesive graph, enabling queries that reveal how weather affects flight paths or how technical capabilities influence performance. For instance, we can analyze how a civilian UAV behaves under high winds or identify optimal flight modes based on endurance constraints.

Data preprocessing is a critical step to ensure quality. Trajectory data from civilian UAVs may contain anomalies due to signal interference or sensor errors. We apply techniques like interpolation for high-missing-rate fields and removal for redundant entries, such as duplicate points from hovering. Weather data, being relatively stable over short periods, requires minimal cleaning. Technical parameters are generally clean. The preprocessing ensures that the graph construction is based on reliable inputs, reducing noise in subsequent analyses. Below, we summarize the key data fields used in our study, highlighting the diversity of information integrated for civilian UAV monitoring.

Data Type Fields Description
Trajectory id, longitude, latitude, altitude, velocity, timestamp Flight path points from civilian UAV sensors
Weather temperature, climate, speed, director, visibility, timestamp Environmental conditions during flight
Technical Parameters id, type, endurance, range, model Specifications of civilian UAV models

To formalize our approach, we define the flight trajectory graph as a structured representation. Let $FG = (V, E, A)$ denote the flight trajectory graph, where $V$ is the set of entity nodes, $E$ is the set of edges representing relationships, and $A$ is the set of attributes associated with nodes and edges. The nodes are categorized into three types: trajectory nodes $F$, weather nodes $W$, and UAV technical parameter nodes $U$. Thus, $V \subseteq (F \cup W \cup U)$. Each node has a name and an attribute set; for example, a trajectory node $f_s$ is represented as $(\text{latitude}_s, \text{longitude}_s, \text{attribute}^f_s)$, where $\text{attribute}^f_s$ includes timestamp, ID, velocity, altitude, longitude, and latitude. Similarly, weather nodes use climate as the name, and UAV nodes use ID as the name. This formalization provides a foundation for systematic entity extraction.

The entity extraction process involves identifying these nodes from the raw datasets. We design an algorithm to traverse the data and create nodes with their properties. For trajectory data, each unique coordinate pair (latitude, longitude) forms a node, with attributes extracted from the corresponding record. Weather data yields nodes based on climate conditions, and UAV parameters produce nodes per model ID. This step transforms heterogeneous data into a unified node set, enabling relational linkages. The algorithm ensures that all relevant attributes are preserved, facilitating rich queries later. We encapsulate this in Algorithm 1, which outputs the node set $V$ and attribute set $A_v$.

Algorithm 1: Node and Node Attribute Extraction Algorithm

Input: Trajectory set $FS$, weather set $WS$, UAV parameter set $US$

Output: Node set $V$, attribute set $A_v$

1. Initialize $V = \emptyset$, $A_v = \emptyset$.

2. For each trajectory record $f \in FS$:

a. Create a node $f.(\text{latitude}, \text{longitude})$ in $F$.

b. Add $f.\text{attribute}$ to $A^f$.

3. For each weather record $w \in WS$:

a. Create a node $w.\text{climate}$ in $W$.

b. Add $w.\text{attribute}$ to $A^w$.

4. For each UAV parameter record $u \in US$:

a. Create a node $u.\text{model}$ in $U$.

b. Add $u.\text{attribute}$ to $A^u$.

5. Combine: $V \leftarrow F + W + U$, $A_v \leftarrow A^f + A^w + A^u$.

6. Return $V$, $A_v$.

Relationship extraction is equally vital, as it connects nodes to form meaningful patterns. We define relationships based on ID matching and temporal constraints. The ID relationship links a civilian UAV node to its trajectory nodes, representing the fact that the UAV traverses those points. Temporal relationships are of two types: between trajectory and weather nodes, and among trajectory nodes themselves. For trajectory-weather, we establish a connection if the time difference between a trajectory point and a weather record is below a threshold $\epsilon$. Mathematically, for a trajectory node $f$ with timestamp attribute $T_f$ and a weather node $w$ with timestamp $T_w$, the condition is:

$$|T_f – T_w| < \epsilon$$

where $\epsilon$ is a small value (e.g., 10 seconds), ensuring that the weather data corresponds closely to the flight moment. This relationship, denoted as $FW_T$, has the attribute “HAS_WEATHER” to indicate that the trajectory point experiences specific weather conditions.

For trajectory-trajectory relationships, we introduce a sequential order to capture the time-series nature of flight paths. Given trajectory nodes from the same civilian UAV ID, we compare their timestamps to determine precedence. For nodes $f[a]$ and $f[b]$ with timestamps $T_a$ and $T_b$, respectively, if $T_a < T_b$, we create a directed edge from $f[a]$ to $f[b]$. This relationship, denoted as $FF_T$, has the attribute “NEXT” to signify the next point in the flight sequence. It enables queries that trace the entire path of a civilian UAV, useful for analyzing flight patterns or detecting anomalies.

The ID relationship, denoted as $UF_ID$, connects a UAV technical parameter node to its associated trajectory nodes based on matching ID fields. Its attribute is “CONNECTED_TO”, indicating that the UAV is linked to those flight points. These relationships collectively form the edge set $E$, with attributes $A_E$. We summarize the relationship types and their properties in the table below, emphasizing their role in the civilian UAV context.

Relationship Type Nodes Connected Attribute Description
UF_ID UAV to Trajectory CONNECTED_TO Links a civilian UAV to its flight points
FW_T Trajectory to Weather HAS_WEATHER Associates a point with weather conditions
FF_T Trajectory to Trajectory NEXT Sequential order of flight points

Algorithm 2 details the relationship extraction process, incorporating the temporal logic. It iterates through nodes, applies the conditions, and builds edges with attributes. This algorithm ensures that the graph reflects both spatial and temporal dynamics of civilian UAV flights, enabling complex queries like “find all trajectories in rainy weather” or “trace the path of a specific UAV model”.

Algorithm 2: Relation and Relation Attribute Extraction Algorithm

Input: Trajectory nodes $F$, weather nodes $W$, UAV nodes $U$

Output: Edge set $E$, attribute set $A_E$

1. Initialize $E = \emptyset$, $A_E = \emptyset$.

2. Define $\Delta T = f.\text{attribute}_T – w.\text{attribute}_T$ for trajectory $f$ and weather $w$.

3. For each $f \in F$ and $u \in U$:

a. If $f.\text{attribute}_{ID} = u.\text{attribute}_{ID}$:

i. For $a$ from 1 to $n$ (number of trajectory nodes for that ID):

– For $b$ from $a+1$ to $n$:

* If $f[a].\text{attribute}_T < f[b].\text{attribute}_T$:

+ Create edge $FF_T$ in $E$.

+ Set $FF_T.\text{attribute} \leftarrow \text{NEXT}$.

+ Add to $A^{ff}$.

ii. Create edge $UF_ID$ in $E$.

iii. Set $UF_ID.\text{attribute} \leftarrow \text{CONNECTED_TO}$.

iv. Add to $A^{uf}$.

4. For each $f \in F$ and $w \in W$:

a. If $|\Delta T| < \epsilon$ (e.g., $\epsilon = 10$ seconds):

i. Create edge $FW_T$ in $E$.

ii. Set $FW_T.\text{attribute} \leftarrow \text{HAS_WEATHER}$.

iii. Add to $A^{fw}$.

5. Combine: $E \leftarrow FF_T + UF_ID + FW_T$, $A_E \leftarrow A^{ff} + A^{uf} + A^{fw}$.

6. Return $E$, $A_E$.

With nodes and relationships extracted, we store the flight trajectory graph in Neo4j, a graph database optimized for connected data. Neo4j uses the Cypher query language, which allows intuitive pattern matching and retrieval. Our graph includes thousands of nodes and edges, representing real civilian UAV flights. For instance, a typical graph might contain trajectory nodes with properties like latitude, longitude, and speed, connected via “NEXT” edges to form paths, and linked to weather nodes with “HAS_WEATHER” edges. This structure enables powerful queries, such as finding all flights under high wind conditions or calculating the average speed of a civilian UAV model across different weather scenarios.

To validate our method, we conducted experiments using real-world data collected from civilian UAV operations over several months. The dataset includes flight trajectories from 10 different UAV models, encompassing various speeds, altitudes, and weather conditions like sunny, cloudy, and rainy days. We preprocessed the data to remove duplicates and fill missing values, then applied Algorithms 1 and 2 to construct the graph. The resulting graph statistics are summarized below, demonstrating the scale of our civilian UAV knowledge base.

Graph Component Count
Trajectory Nodes 14,920
Weather Nodes 1,520
UAV Parameter Nodes 41
ID Relationships (UF_ID) 44,760
Temporal Relationships (FF_T and FW_T) 143,851
Total Attributes Combined from all nodes and edges

We leveraged Neo4j’s visualization capabilities to explore the graph interactively. For example, we can query for all trajectory points under a specific weather condition, such as “sunny with moderate wind”, and visualize the connected nodes. This reveals how civilian UAV paths distribute under such conditions, aiding in weather-aware flight planning. Another query might involve constraints on flight parameters: selecting trajectory nodes where altitude exceeds 300 meters and velocity exceeds 20 m/s, then linking them to UAV models to identify performance trends. These queries are executed efficiently using Cypher, showcasing the practical utility of our graph for civilian UAV analysis.

To quantitatively assess the efficiency of our graph-based approach, we compared query performance against traditional databases like MySQL and Redis. We created five datasets of varying sizes by randomly selecting 20% to 100% of the UAV technical parameters and matching them with trajectory and weather data. For each dataset, we measured response times for four query types: basic queries (e.g., retrieve a node by ID), aggregate queries (e.g., count nodes per condition), neighborhood search queries (e.g., find connected nodes within a path), and complex conditional queries (e.g., multi-constraint filters). All queries were designed to return identical results across databases to ensure fairness. The average response times over 30 runs are presented below, highlighting the advantages of Neo4j for civilian UAV data management.

Query Type Database Response Time (ms) for Dataset Sizes (20% to 100%)
Basic Query Neo4j 2.1, 2.3, 2.5, 2.6, 2.8
MySQL 1.5, 1.6, 1.7, 1.8, 1.9
Redis 1.4, 1.5, 1.6, 1.7, 1.8
Aggregate Query Neo4j 3.2, 3.4, 3.6, 3.9, 4.1
MySQL 3.0, 3.5, 4.0, 4.5, 5.0
Redis 3.1, 3.6, 4.2, 4.8, 5.3
Neighborhood Search Neo4j 4.5, 4.8, 5.2, 5.5, 5.9
MySQL 7.0, 8.2, 9.5, 10.8, 12.0
Redis 7.5, 8.8, 10.1, 11.4, 12.7
Complex Conditional Neo4j 6.8, 7.2, 7.9, 8.5, 9.1
MySQL 15.0, 20.5, 28.3, 35.0, 42.5
Redis 16.2, 22.0, 30.1, 38.0, 45.8

The results show that while traditional databases like MySQL and Redis excel at basic queries due to their optimized key-value or relational structures, Neo4j outperforms them significantly in neighborhood search and complex conditional queries. This is because graph databases natively support traversals and pattern matching, which are essential for analyzing connected civilian UAV data. For instance, a query like “find all trajectories of a civilian UAV model that flew in rainy weather and had speed variations” involves multiple joins and conditions in SQL, but in Cypher, it translates to a concise pattern match, reducing response time. This efficiency gain becomes more pronounced as data scales, making our graph method suitable for large-scale civilian UAV monitoring systems.

Beyond query performance, our flight trajectory graph enables deeper insights into civilian UAV operations. By integrating weather and technical parameters, we can conduct correlation analyses, such as studying how wind speed affects flight stability or how UAV endurance impacts mission duration. The temporal relationships allow for sequence mining, identifying common flight patterns or anomalous behaviors. For example, we can detect if a civilian UAV deviates from its planned path under certain weather conditions, prompting safety investigations. Moreover, the graph serves as a knowledge base for regulatory bodies, facilitating airspace management and policy-making by providing a holistic view of UAV activities.

In conclusion, we have presented a comprehensive method for constructing a flight trajectory graph for civilian UAVs, integrating multi-source monitoring data through entity-relationship extraction. Our approach addresses the limitations of isolated data analysis by unifying trajectory, weather, and technical information into a graph structure enriched with temporal relationships. Stored in Neo4j, this graph supports efficient and intuitive queries, outperforming traditional databases in complex scenarios. The experiments with real data validate the practicality and scalability of our method for enhancing civilian UAV monitoring and safety. Future work will focus on expanding data sources, such as incorporating aerial imagery or geographic data, and exploring advanced graph algorithms for predictive analytics. By continuously refining this knowledge graph, we aim to contribute to smarter and safer civilian UAV ecosystems, where flight operations are seamlessly analyzed and managed.

Scroll to Top