A sensor atomization-based cross-model unmanned aerial vehicle anomaly detection method

CN122615696APending Publication Date: 2026-08-21GUANGDONG POLYTECHNIC NORMAL UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611087825.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-22
Publication Date
2026-08-21

AI Technical Summary

Technical Problem

然而,不同飞控平台的报文格式、字段位置、字节序与量化表均存在显著差异,导致每次更换机型都需要重新人工解析协议、标注字段语义、绘制传感器拓扑

Benefits of technology

(1)本发明通过传感器原子化表征方法,从MAVLink协议数据流中自动学习跨机型通用的传感器功能语义单元(即传感器原子),使得不同机型上功能相同的传感器(如惯性测量单元、全球定位系统接收机、气压高度计等)能够被映射到统一的功能语义表示空间中,从而消除MSG-ID(Message Identifier,消息标识符)差异带来的跨机型不兼容问题,摆脱人工传感器语义标注与机型绑定拓扑的先验依赖,解决了现有技术中特征表示与MSG-ID强绑定导致的跨机型不兼容问题,实现了跨机型通用性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122615696A_ABST
    Figure CN122615696A_ABST
Patent Text Reader

Abstract

The application provides a sensor atomization-based cross-model unmanned aerial vehicle anomaly detection method, which specifically comprises the following steps: S1, sensor atomization representation: through sequentially performing data acquisition and information entropy screening, BPE compression, BERT pre-training and DBSCAN clustering, sensor atoms are found, and heterogeneous report bytes are mapped into sensor function semantic units that are universal across models; S2, function semantic causality optimization: based on the sensor atoms, a self-organizing causality graph network based on NOTEARS and multi-head attention is constructed to realize cross-model anomaly detection. The application innovatively applies advanced technologies in the field of natural language processing and causality discovery algorithms to unmanned aerial vehicle sensor data analysis, forms an automatic pipeline from raw bytes to interpretable causal anomalies, and effectively overcomes defects such as difficulty in cross-model adaptation, poor interpretability and weak dynamic expansion of the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of UAV communication protocol security and anomaly detection technology, specifically to a sensor atomization representation method based on the data stream of the Micro Air Vehicle Link (MAVLink) communication protocol, and a cross-model UAV anomaly detection method implemented using this sensor atomization representation method. Background Technology

[0002] Today, unmanned aerial vehicles (UAVs), as key nodes in the next generation of the Industrial Internet of Things (IIoT), undertake increasingly complex autonomous flight tasks in scenarios such as power line inspection, emergency search and rescue, and logistics delivery. Anomaly detection of UAVs is a core component for ensuring flight safety and mission reliability. In recent years, anomaly detection methods based on graph neural networks (GNNs) and causal inference have shown great potential in explaining the root causes of anomalies by learning the dependencies between sensors. However, these methods generally rely on manually predefined sensor topologies and numerical analysis rules, facing significant challenges in the practical deployment of heterogeneous flight control platforms. How to automatically discover cross-model common sensor semantic units from raw message bytes and establish accurate causal dependency structures based on these units is a key scientific problem for achieving cross-platform deployment of UAV anomaly detection.

[0003] Specifically, existing research mainly suffers from the following four major problems: First, there's the issue of manually predefined sensor semantics. Existing methods like GDN and MTAD-GAT generally define graph nodes as manually pre-selected physical sensors, such as GPS, IMU (Inertial Measurement Unit), and barometers. The node semantics are then annotated field-by-field by domain experts according to the aircraft-specific MAVLink protocol manual. However, different flight control platforms have significant differences in message format, field positions, byte order, and quantization tables, requiring manual re-parse of the protocol, annotation of field semantics, and redrawing of the sensor topology every time the aircraft model is changed.

[0004] Second, there is the issue of device-specific numerical distribution. Traditional anomaly detection methods rely heavily on the numerical distribution range of the training data for their detection thresholds and prediction models. However, different device models may represent the same physical quantity very differently, leading to severe distribution shift problems when transferring detection models based on numerical distributions across different device models.

[0005] Third, there is the issue of the fixed nature of graph topology. Once training is complete, the graph adjacency structure of existing methods is frozen, making it unable to adapt to dynamic changes in sensor configuration, such as the addition or removal of redundant sensors. When model iterations lead to increases or decreases in the number of sensors, data must be collected again and the entire graph network retrained, lacking incremental evolution capabilities.

[0006] Fourth, there is the problem of missing functional semantics in sensor causal dependencies. Existing causal discovery methods such as NOTEARS treat the input as an unstructured numerical time series, assuming that the set of variables is known and fixed, lacking the ability to encode the functional semantics of sensors. When faced with heterogeneous MAVLink byte streams, redundant bytes and noise signals mixed in the original input interfere with the accuracy of causal discovery, causing NOTEARS to easily fit spurious causal associations. How to establish soft-constraint channels of physical meaning in the sensor's atomized functional semantic embedding space, so that causal discovery can move away from spurious correlations at the numerical level and turn to true physical causality at the functional semantic level, and support cross-model universality and online evolution, is a key problem that existing methods have not yet solved. Summary of the Invention

[0007] The technical problem to be solved by the present invention is to overcome the shortcomings of the prior art and provide a UAV anomaly detection method that can automatically adapt to heterogeneous sensor messages of different models, reveal the causal dependencies between sensor functional units, and support dynamic expansion.

[0008] To achieve the above technical solution, this invention provides a cross-model UAV anomaly detection method based on sensor atomization, specifically including the following steps: S1. Sensor Atomization Characterization: Through sequential data acquisition and information entropy filtering, BPE compression, BERT pre-training, and DBSCAN clustering to discover sensor atoms, heterogeneous message bytes are mapped into cross-model common sensor functional semantic units. S2. Functional semantic causal optimization: Construct a self-organizing causal graph network based on NOTEARS and multi-head attention on the basis of sensor atoms to achieve cross-model anomaly detection.

[0009] In the above technical solution, the heterogeneous, low-level message bytes are automatically and unsupervisedly abstracted into high-level, cross-model universal "functional semantic units" (sensor atoms) through "sensor atomization representation". This solves the problem that the existing technology relies heavily on manual feature engineering and specific model parsing rules, and realizes the detection model's ability to quickly adapt to different models and achieve zero-sample transfer capability.

[0010] Preferably, in step S1, the specific process of data acquisition and information entropy filtering is as follows: (1) Obtain the tlog file of MAVLink recorded by the UAV during flight, and parse the tlog file into a raw byte stream using the pymavlink tool; (2) Automatically filter key dynamic parameters using information entropy for each byte position in the payload. b Calculate its information entropy throughout the entire flight log. : , in p ( x ) is bytes b Values x The probability of; (3) For each message, select the one with the highest entropy value. K Each byte is concatenated with MSG_ID to form the original Token: Token_raw = [MSG_ID, selected_byte_1, selected_byte_2].

[0011] In the above technical solution, by using information entropy to automatically filter key dynamic parameter bytes, redundant or constant data is discarded, and data streams with high information content are focused on, which significantly reduces the amount of data to be processed in the subsequent process and improves the model’s sensitivity to changes in core flight dynamic states.

[0012] Preferably, in step S1, the specific process of BPE compression is as follows: initialize the vocabulary with all single bytes {0,1,...,255}, and then repeat the following steps until the target vocabulary size is reached. V (1) Count the frequency of all adjacent byte pairs; (2) Merge the most frequent byte pairs into a new token; (3) Update the vocabulary and corpus encoding; The final vocabulary size is V = 256 + M ,in M This represents the number of merges.

[0013] In the above technical solution, the BPE compression algorithm is performed at the byte level, without relying on any prior knowledge of the message structure. It can adapt to different data formats, effectively compress the original data sequence, and reduce the dimensionality and complexity of the model input.

[0014] Preferably, in step S1, the specific process of BERT pre-training is as follows: (1) Let the embedding matrix be , ,in, e i No. iEmbedding vectors of individual tokens, For the first in the Token i One original discrete; (2) MTP randomly occludes some tokens, forcing the model to reconstruct the occluded items using the context; (3) Use the formula: Within the embedded space, relevant tokens are brought closer together, while irrelevant tokens are pushed away; among them, L MTP Predict the overall loss of the task for the message token; context( ) is the context encoding function; For a given context feature context(e i ) The model predicts the original token's content. The probability of.

[0015] In the above technical solution, the BERT model is pre-trained on a large amount of unlabeled flight data, enabling the model to autonomously learn the physical semantics and contextual relationships contained in the sensor data, providing a high-quality semantic embedding space for subsequent atom discovery and causal inference.

[0016] Preferably, in step S1, the specific process of DBSCAN clustering to discover sensor atoms is as follows: for each point in the embedding space, if its A point is marked as a core point if it contains at least MinPts neighbors within its radius. Core points are clustered into a sensor atom if their density reaches a certain level. Sparse points are marked as noise and discarded. The clustering result is the sensor atom. DBSCAN clustering automatically discovers "sensor atoms" from the semantic embedding space without manual annotation or definition of functional modules. This achieves unsupervised and automated discovery of functional semantic units, enhancing the automation and objectivity of the method.

[0017] Preferably, the specific process of constructing a self-organizing causal graph network based on NOTEARS and multi-head attention in step S2 is as follows: (1) Let the adjacency matrix be... Minimize the reconstruction loss and apply differentiable DAG constraints. :

[0018] After solving Quantitative Atoms j right i The causal effects; (2) Using multi-head attention as a secondary channel to capture long-range coupling that is non-causal but statistically relevant: ; (3) NOTERAS embeds PyTorch computation graphs to support incremental updates. Adding new atoms does not require retraining the entire graph, and it adapts to the dynamic addition and removal of sensors.

[0019] (4) In the anomaly detection stage, the sensor atom feature vectors of the time window to be detected are input into the dual-channel fusion model above to calculate the anomaly score of each sensor atom. When the final anomaly score exceeds the preset threshold, the time window is determined to be an anomaly.

[0020] In the aforementioned technical solution, the constructed dual-channel causal graph network based on NOTEARS and multi-head attention takes into account both the physical causal constraints between sensor functional modules (NOTEARS main channel) and the potential, complex statistical correlations (attention secondary channel). This fusion not only improves the reliability of anomaly detection, but its inherent acyclic structure (DAG) also enhances the model's interpretability, making anomaly attribution possible. Furthermore, this network supports incremental learning, enabling it to efficiently adapt to dynamic changes in sensor configuration during flight.

[0021] Preferably, in step S1, before data acquisition and information entropy filtering, the sensor atomization problem is formally defined as follows: Given a raw MAVLink message stream from a certain model, the goal is to automatically discover a set of sensor atoms. Each sensor atom s It is a functional semantic unit, corresponding to a coupled functional module constrained by physical equations in flight dynamics. By formally defining the sensor atomization problem, a clear and rigorous mathematical model and problem description framework are provided for the entire technical solution.

[0022] Preferably, after formally defining the sensor atomization problem, a causal dependency structure between atoms is established. Utilizing the high cohesion of sensor atoms in the BERT embedding space, a physically meaningful soft-constraint channel is constructed for NOTEARS. The specific process is as follows: (1) Let the set of atom sensors be... ,in For the number of atoms, each sensor atom A functional semantic vector corresponding to the BERT embedding space This vector is obtained by the aggregate representation of all token embeddings within an atom; NOTEARS uses a functional semantic matrix. As input, learn a weighted causal adjacency matrix. :

[0023] in For a DAG with no acyclic constraints, To reconstruct the loss, It is a nonlinear function. This represents the Hadamard product (element-by-element multiplication), which is the multiplication of corresponding elements of two matrices. (2) Introduce multi-head attention global jump connection as a secondary channel, and calculate the global dependency weights between all atomic pairs. ; (3) Dual-channel fusion:

[0024] in Controlling attentional secondary side contribution; (4) The NOTEARS solver is embedded in the PyTorch computation graph and supports sliding window incremental updates: when a new sensor atom is added... At that time, it is only necessary to calculate the new atoms and the existing ones. Causal edges of individual atoms do not require retraining the entire graph.

[0025] In the above technical solution, by utilizing the characteristics of BERT's embedding space and the PyTorch framework, "soft constraints" and "incremental updates" of causal graph networks are realized. While ensuring that causal discovery conforms to physical intuition, the practicality of the system in responding to dynamic changes is greatly improved.

[0026] The beneficial effects of the cross-model UAV anomaly detection method based on sensor atomization provided by this invention are as follows: (1) This invention uses a sensor atomization representation method to automatically learn cross-model universal sensor functional semantic units (i.e., sensor atoms) from the MAVLink protocol data stream, so that sensors with the same function on different models (such as inertial measurement units, global positioning system receivers, barometric altimeters, etc.) can be mapped to a unified functional semantic representation space, thereby eliminating the cross-model incompatibility problem caused by MSG-ID (Message Identifier) ​​differences, getting rid of the prior dependence of manual sensor semantic annotation and model binding topology, solving the cross-model incompatibility problem caused by strong binding of feature representation and MSG-ID in the prior art, and realizing cross-model universality.

[0027] (2) In this invention, the entire anomaly detection process starts from the native binary data frame of the MAVLink protocol, and automatically learns the semantic representation of sensor functions through BPE compression and BERT pre-training. There is no need to manually design features or set thresholds, which reduces the dependence on expert knowledge and specific model parameters and eliminates the dependence on manual feature engineering.

[0028] (3) The sensor functional semantic causal graph network constructed by the NOTEARS algorithm in this invention clarifies the causal dependencies between the functional semantic units of each sensor. NOTEARS only searches for causal edges between functionally related sensor atoms, avoiding interference from redundant bytes and noise tokens, and the resulting causal graph has physical interpretability. When an anomaly is detected, the source sensor atom of the anomaly can be located by tracing the propagation path in the causal graph, and then the specific physical sensor can be located, providing an interpretable basis for fault diagnosis and maintenance decisions.

[0029] (5) This invention has online evolution capability. The NOTEARS solver is embedded in the PyTorch computation graph and supports sliding window incremental updates: when a new sensor atom is added, only the causal edges between the new atom and the existing atoms need to be calculated, without retraining the entire graph, and the change in the original weights is less than a preset threshold. This mechanism enables the causal graph to have online evolution capability, which can adapt to the dynamic addition and subtraction of sensor configurations and meet the performance requirements of real-time anomaly detection of UAVs. Attached Figure Description

[0030] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation

[0031] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art without creative effort are within the protection scope of the present invention.

[0032] Example: An anomaly detection method for cross-model UAVs based on sensor atomization.

[0033] Reference Figure 1 As shown, a cross-model UAV anomaly detection method based on sensor atomization divides the processing of MAVLink message streams into two main stages: The first stage is the sensor atomization representation stage, which includes information entropy filtering, BPE compression, BERT pre-training, and DBSCAN clustering, mapping heterogeneous message bytes into sensor functional semantic units (i.e., sensor atoms) that are universal across different models.

[0034] The second stage is the functional semantic causal optimization stage, which builds a self-organizing causal graph network based on NOTEARS and multi-head attention on the basis of sensor atoms to achieve cross-model anomaly detection.

[0035] The specific process is as follows: Figure 1 As shown, each part will be described in detail below.

[0036] (I) Unified Representation Model for Heterogeneous MAVLink Messages Traditional UAV anomaly detection methods typically assume that sensor data is a structured numerical vector, meaning that each physical quantity corresponds to a fixed field position and numerical range. However, in real-world deployments of heterogeneous flight control platforms, the format differences in MAVLink messages render this assumption invalid.

[0037] The MAVLink protocol uses a binary message format. For the first... A message, whose structure is represented by a triple.

[0038] MSG_ID is the message type identifier, and the payload contains the specific field data for that type. The payload contains the... The amount of information carried by each byte is determined by the distribution of its values ​​in the flight log.

[0039] Even when measuring the same physical quantity, the message representation may be completely different between heterogeneous machine models: the field positions are different, and the same parameter may be located in different MSG_ID and Payload offset positions in different machine models; the data types are different, and the same physical quantity may be encoded in different ways such as int16, int32 or float32; this heterogeneity makes the traditional method of relying on fixed field parsing face fundamental challenges when deploying across machine models.

[0040] To mitigate the aforementioned heterogeneity, this invention abandons traditional structured fields and treats the MAVLink message stream as a raw byte sequence. The key is that the statistical signature of physical dynamics remains unchanged across aircraft models; which bytes change cooperatively during flight is determined by the physical laws themselves, not by the message format. Therefore, this invention only needs to extract key dynamic parameters from the raw bytes to bypass the aircraft-specificity of field positions and data types.

[0041] (ii) Functional semantic objectives of sensor atomization Based on the aforementioned heterogeneous message streams, this invention formally defines the sensor atomization problem as follows: Given a raw MAVLink message stream from a certain device model, the goal is to automatically discover a set of sensor atoms. Each sensor atom s It is a functional semantic unit, corresponding to a coupled functional module in flight dynamics that is constrained by physical equations.

[0042] Sensor atoms should satisfy the following properties: (1) Functional semantics: Tokens within the same atom are related in physical function, such as being related to height control or attitude stability; (2) Cross-device consistency: Tokens with equivalent functions in different devices should be mapped to similar positions in the embedding space so that they are clustered into the same atom; (3) Dynamic coupling: The interaction between atoms should reflect the causal constraints of flight dynamics, such as the physical relationship between thrust, speed and altitude.

[0043] The mathematical essence of the core problem: Suppose that aircraft type A and aircraft type B have the same physical quantity. The message codes are respectively f and g ,generally f ≠ g (The field positions and data types are different). Traditional methods directly compare within the encoding space. This leads to cross-device failure. This invention utilizes BERT pre-training to... Mapping to the functional semantic embedding space enables tokens participating in the same physical process in different models to have similar embedding representations, thereby bypassing the heterogeneity at the encoding level and achieving consistent sensor atom discovery across different models.

[0044] (III) Graph Network Model for Functional Semantic Causal Optimization Building upon sensor atom discovery, it is necessary to further establish causal dependency structures between atoms. Traditional causal discovery methods, such as NOTEARS, treat the input as an unstructured numerical time series, assuming the variable set is known and fixed, lacking the ability to encode sensor functional semantics. When faced with heterogeneous MAVLink byte streams, redundant bytes and noise signals mixed in the original input interfere with the accuracy of causal discovery, causing NOTEARS to easily fit spurious causal associations. To address this, this invention proposes a graph network model for functional semantic causal optimization, utilizing the high cohesion of sensor atoms in the BERT embedding space to construct physically meaningful soft-constraint channels for NOTEARS.

[0045] Let the set of atom sensors be... ,in Number of atoms. Atoms per sensor. A functional semantic vector corresponding to the BERT embedding space This vector is obtained by aggregate representation (e.g., taking the mean or centroid) of all token embeddings within an atom. NOTEARS uses a functional semantic matrix. As input, learn a weighted causal adjacency matrix. :

[0046] in For a DAG with no acyclic constraints, To reconstruct the loss, It is a nonlinear function. This represents the Hadamard product (element-by-element multiplication), which is the element-wise multiplication of two matrices. The key difference from the original NOTEARS is that the input here... Instead of raw numerical values, the functional semantic vectors encoded by BERT allow NOTEARS to search for causal edges only between functionally related atoms due to the high cohesion of sensor atoms. Noise tokens are marked as sparse points and discarded during the DBSCAN stage, and NOTEARS cannot see low-entropy redundant bytes, fundamentally avoiding the fitting of spurious causal relationships.

[0047] However, NOTEARS can only capture direct physical causality; long-range couplings that are non-causal but statistically relevant also exist during flight. To address this, this invention introduces a multi-head attention global skip connection as a secondary channel to calculate the global dependency weights between all atom pairs. Dual-channel fusion:

[0048] in Controlling attentional secondary side contribution, A final The final adjacency matrix obtained by fusion; A NOTEARS A is the causal adjacency matrix output by the NOTEARS algorithm; attention This is the adjacency matrix obtained from the attention mechanism. NOTEARS provides a sparse causal skeleton to ensure physical interpretability, and multi-head attention supplements non-causal long-range associations to enhance expressiveness. The NOTEARS solver is embedded in the PyTorch computation graph and supports sliding window incremental updates: when a new sensor atom is added... At that time, it is only necessary to calculate the new atoms and the existing ones. Causal edges of individual atoms, no need to retrain the entire graph, existing... The weight changes are less than 3%. This mechanism enables the causal graph to evolve online, adapting to the dynamic addition or removal of sensor configurations.

[0049] (iv) Information entropy screening: Automatic extraction of key sensor parameters The information content of different bytes in the MAVLink message payload varies greatly: constant status flags and reserved bits carry very little information, while rapidly changing flight parameter bytes (such as the lower 16 bits of altitude and vertical velocity) carry the main dynamic state information. This invention utilizes Shannon Entropy to automatically filter key dynamic parameters. For each byte position in the payload... b Calculate its information entropy throughout the entire flight log. :

[0050] in p( x ) is bytes b Values x The probability of a byte having a high entropy value. Bytes with high entropy values ​​have a uniform distribution of values, change drastically, and carry a lot of dynamic information; bytes with low entropy values ​​are almost unchanging and contain very little information.

[0051] Filtering strategy: For each packet, select the one with the highest entropy value. K bytes (assuming) K =2 (i.e., the most volatile 2 bytes), concatenated with MSG_ID to form the original Token: Token_raw = [MSG_ID, selected_byte_1, selected_byte_2] Cross-device adaptation mechanism: The location of high-entropy bytes differs across device models, but the fundamental principle of physical dynamics dictates that the bytes experiencing the most dramatic changes are necessarily the key dynamic parameters—a rule applicable across device models. Therefore, entropy filtering automatically adapts to different device models, selecting functionally equivalent key bytes without requiring manual knowledge of field locations.

[0052] (v) BPE Compression: Compacting Function-Related Bytes The tokens after entropy filtering are still in bytes, resulting in a huge vocabulary space and lengthy sequences, making direct input into BERT computationally expensive. This invention introduces BPE, which compresses the vocabulary space by iteratively merging the most frequently co-occurring byte pairs. Bytes of the same physical quantity naturally appear adjacent in the message; for example, two bytes in the lower 16 bits of the height always appear consecutively. BPE automatically merges them into compact semantic units, shortening the sequence length and strengthening functional cohesion, thus compressing the vocabulary to a preset size. V .

[0053] The core iterative process of BPE is as follows: initialize the vocabulary with all single bytes {0, 1, ..., 255}, and then repeat the following steps until the target vocabulary size is reached. V (1) Count the frequency of all adjacent byte pairs; (2) Merge the most frequent byte pairs into a new token; (3) Update the vocabulary and corpus encoding. The final vocabulary size is... V = 256+ M ,in M This refers to the number of times the data is merged. Crucially, BPE requires no domain knowledge; frequent co-occurrence, or functionally relevant statistical facts, are determined by the data itself. Regardless of the aircraft model, bytes of the same flight parameter are always adjacent in the message, and BPE can correctly merge them based on the data itself, thus achieving universal compression across aircraft models.

[0054] (vi) BERT pre-training: Embedding encoding of physical signatures The token sequence after BPE remains discrete symbols and cannot be directly used for clustering and causal inference. MAVLink message streams exhibit structural homomorphism with natural language: the co-occurrence of symbols is constrained by the underlying generation mechanism: during ascent, thrust, velocity, and altitude tokens co-occur frequently, while during hovering, they tend to remain constant. This statistical pattern determined by physical laws is called a physical signature.

[0055] This invention introduces BERT, treating MAVLink Token as a flight language, and learns functional semantic embeddings through Masked TokenPrediction. Let the embedding matrix be... , in Token The embedding is:

[0056] in, e i No. i Embedding vectors of individual tokens, For the first in the Token i One original discrete.

[0057] MTP randomly occludes some tokens, forcing the model to reconstruct the occluded items using context. Functionally relevant tokens (such as height and velocity) always co-occur, while irrelevant tokens rarely co-occur. Therefore, BERT must bring relevant tokens closer together and push irrelevant tokens further apart in the embedding space. .

[0058] in, L MTP Predict the overall loss of the task for the message token; context( ) is the context encoding function; For a given context feature context(e i ) The model predicts the original token's content. The probability of.

[0059] After training, functional dimensions emerge in the embedding space: in terms of control attributes, the driving variable is positive and the controlled variable is negative; in terms of energy attributes, velocity aligns with kinetic energy and height aligns with potential energy. Although the functional equivalent tokens of different models have different values, they have similar context signatures because they participate in the same physical process. BERT encodes them as similar geometric positions, which is the representation basis for cross-model deployment.

[0060] (vii) DBSCAN Clustering: Unsupervised Discovery of Sensor Atoms After BERT encoding, each token is mapped to a d-dimensional continuous vector, with functionally related tokens clustered close to each other in the embedding space. However, these vectors remain scattered throughout the embedding space, not yet forming clear functional groups. The token distribution in the BERT embedding space exhibits a significant clustering structure: tokens with the same physical function (such as all highly related bytes) are highly clustered in local regions due to similar contextual patterns, while noisy tokens such as constant bytes and reserved bits are sparsely distributed. This is similar to the semantic clustering of word vectors in natural language embedding spaces.

[0061] Based on the above findings, this invention introduces DBSCAN to perform density clustering in the BERT embedding space. DBSCAN does not require pre-specifying the number of clusters; it automatically discovers high-density regions and defines them as a cluster using two parameters: the neighborhood radius ε and the minimum number of samples MinPts. Specifically, for each point in the embedding space, if its... A token within a radius containing at least MinPts neighbors is marked as a core point; the density of core points can be such that the region is connected to form a single sensor atom. Sparse points are marked as noise and discarded. This mechanism is naturally suited to the characteristics of the BERT embedding space: functionally relevant tokens form high-density clusters, while irrelevant noise tokens are naturally filtered out.

[0062] The clustering results are sensor atoms: each cluster is a set of message tokens that are physically coupled (e.g., height low byte, relative height byte, and vertical velocity byte cluster into a height dynamics cluster). Crucially, functionally equivalent tokens across different models are encoded into similar geometric positions by BERT, allowing DBSCAN to group them into the same atom without any model labeling. The number of sensor atoms is determined by the data itself, requiring no manual pre-setting, thus achieving true unsupervised functional semantic discovery. (viii) Self-organizing causal graph network based on NOTEARS and multi-head attention After the sensor detects the atoms, their dependencies still need to be established. Atoms in flight do not operate independently; throttle changes are transmitted as velocity changes, and the integral of the velocity is reflected in the altitude reading. Treating this causal chain of which drives which, if merely considered an undirected correlation, will obscure the root cause of the anomaly.

[0063] This invention introduces NOTEARS to transform causal discovery into continuous optimization. Let the adjacency matrix be... Minimize the reconstruction loss and apply differentiable DAG constraints. :

[0064] After solving Quantitative Atoms j right iThe causal effects. However, NOTEARS only captures direct causality; in flight, there are also non-causal but statistically relevant long-range couplings (such as the synchronous change of GPS and attitude during turns). This invention uses multi-head attention as a secondary channel to capture such dependencies:

[0065] A sparse causal framework ensures physical interpretability, while attention-based secondary edges supplement long-range correlations. NOTEARS embedding into the PyTorch computation graph supports incremental updates; adding new atoms does not require retraining the entire graph, and it adapts to dynamic additions and removals of sensors.

[0066] In the anomaly detection phase, the sensor atom feature vectors for the time window to be detected are input into the aforementioned dual-channel fusion model to calculate the anomaly score for each sensor atom. When the final anomaly score exceeds a preset threshold, the time window is determined to be an anomaly. By tracing the propagation path of the causal graph, the source sensor atom of the anomaly can be located, enabling interpretable root cause analysis of the anomaly.

[0067] The main innovation of this invention lies in disclosing a cross-model UAV anomaly detection method based on sensor atomization, and designing a self-organizing graph network that integrates functional semantic causal optimization to achieve accurate modeling and online evolution of sensor-dependent structures across different models. This effective attempt to apply unsupervised functional semantic representation and causal inference techniques to heterogeneous UAV safety monitoring scenarios can provide a technical solution for the rapid deployment of cross-model anomaly detection systems for industrial UAVs.

[0068] This invention also utilizes the high cohesion of sensor atoms in the embedded space to construct a physically "soft constraint" channel for the NOTEARS causal discovery mechanism. This effectively filters out the interference of redundant bytes and noise signals in heterogeneous protocols, discovering the true causal dependencies between sensor atoms at the functional semantic level rather than the numerical level, ensuring the physical interpretability of the causal graph. Furthermore, a multi-head attention mechanism with global jump connections is introduced as a secondary channel. Under the constraint of the causal skeleton, the attention weights between sensor functional semantic units are learned, collaboratively capturing direct causal drivers and long-range statistical dependencies between atoms. After the dual channels are fused, the expressive power is enhanced while ensuring physical interpretability, achieving high-precision, interpretable cross-model anomaly detection, and supporting the dynamic addition, removal, and online evolution of sensor configurations.

[0069] To further explain the present invention, the ArduCopter quadcopter drone platform is used as an example to demonstrate the application process and effects of the method of the present invention in a real-world scenario.

[0070] (1) Data Acquisition and Information Entropy Filtering: The ArduCopter quadcopter UAV was connected via Mission Planner ground station software, and MAVLink telemetry log (tlog) files were recorded during flight. The tlog file recorded all MAVLink data frames transmitted between the flight controller and the ground station. Each data frame contained a frame header, MSG_ID, payload, and checksum. The tlog file was parsed into a raw byte stream using the pymavlink tool. A sliding window information entropy calculation was performed on the raw byte stream with a window length of 16 bytes and a step size of 16 bytes. The top 256 windows with the highest information entropy were selected as high information entropy data segments. This filtering process automatically selected the byte positions of the key dynamic parameters without the need for manual parsing of the MAVLink protocol manual.

[0071] (2) BPE Compression: The BPE vocabulary size is set to 512, and BPE compression is performed on high information entropy data segments. Initially, 256 bytes (0-255) are used as the base tokens. Then, the most frequent adjacent byte pairs are merged 256 times, resulting in 512 tokens. The original byte stream is converted into a token ID sequence. During this process, functionally related byte pairs are automatically merged into compact semantic units, such as merging the two bytes of the lower 16 bits of the height into a "height word" token.

[0072] (3) BERT pre-training: A Tiny-BERT model was constructed with a hidden layer dimension of 512, an encoder layer of 4 layers, and an attention head of 8. The token ID sequence was split into segments of length 128, and 15% of the tokens were randomly masked (80% were replaced with [MASK], 10% were replaced with random tokens, and 10% remained unchanged). The model was trained to predict the original tokens that were masked. The AdamW optimizer was used with a learning rate of 2e-5, a batch size of 256, and 200 training epochs. After training, a 512-dimensional vector representation of each token was extracted from the embedding layer.

[0073] (4) DBSCAN clustering to discover sensor atoms: Input the token embedding vector into the DBSCAN algorithm and set the neighborhood radius parameter. ε The minimum sample size (MinPts) is 5, with a value of 0.5. Clustering yields 6 main sensor atoms (corresponding to inertial measurement unit, global positioning system, compass, barometer, actuator, and remote control channel functions, respectively) and a small number of noise points. Each sensor atom contains a set of message tokens that are physically coupled, and noise points are automatically filtered out. Each cluster is defined as a sensor atom, and the cluster center vector and the set of tokens it contains are calculated.

[0074] (5) NOTEARS Cause-Effect Graph Construction and Anomaly Detection: A frequency feature matrix of sensor atoms was constructed using a sample length of 50 time windows and a step size of 25 time windows. The NOTEARS algorithm was employed. [7] By studying causal graphs, setting the L1 regularization coefficient to 0.05 and the DAG constraint weights to 10, a sparse causal adjacency matrix is ​​obtained after augmented Lagrangian optimization. An anomaly detection model incorporating a 4-head attention mechanism and a feedforward network is constructed, fusing the NOTEARS causal backbone with multi-head attention global jump connections (fusion weights). β (Set to 0.3), training and inference are performed under causal graph constraints. When an anomaly is detected, the source sensor atom of the anomaly is located by tracing the propagation path of the causal graph.

[0075] Cross-model compatibility verification: To verify the cross-aircraft versatility of the method of this invention, this embodiment independently runs the complete SAD-CP processing flow on the ArduCopter quadcopter and ArduPlane fixed-wing aircraft respectively, to verify whether the sensor atoms obtained by the two aircraft have consistency at the sensor functional semantic level. The independent operation means that the complete processing flow of steps (1) to (5) is executed for each aircraft, and each aircraft is independently calculated and trained in each step without transferring any intermediate parameters.

[0076] Specifically, the two models independently perform information entropy filtering, independently train the BPE compression model, independently pre-train the BERT model, independently perform DBSCAN clustering, and independently learn the NOTEARS causal graph. That is, each model recalculates and trains using its own MAVLink data in each step, without sharing BPE merging rules, BERT weight parameters, DBSCAN cluster center vectors, and NOTEARS causal graph adjacency matrices.

[0077] The verification process is as follows: (1) Sensor Functional Semantic Consistency Verification. For each sensor atom obtained from DBSCAN clustering of the ArduCopter model, the MAVLink message identifier MSG_ID corresponding to the token contained therein is manually analyzed to determine the functional semantic type of each sensor atom (such as inertial measurement unit, global positioning system, compass, barometer, actuator, remote control channel, etc.). The same analysis process is repeated for the ArduPlane model. Then, the sensor atom classification results of the two models are compared to verify whether sensor atoms with the same sensor function are found in both models. The expected result is: sensor atoms with inertial measurement unit, global positioning system, and barometer functions are found in both models, verifying that the sensor atomization method can automatically identify sensor functional units with equivalent functional semantics from the MAVLink data stream of different models.

[0078] (2) Quantitative Verification of Sensor Atom Purity. A hybrid test set containing both ArduCopter and ArduPlane data was selected, in which each MAVLink data frame was pre-labeled with its MSG_ID corresponding sensor function type (as a real label). Sensor atoms obtained from both models were applied to this hybrid test set, and the purity index and mutual information (MI) index of the MSG_ID function type label within each sensor atom were calculated. The purity index is defined as the proportion of the most frequent function type within the sensor atom; the mutual information index is used to measure the statistical correlation between the sensor atom partitioning and the real function type partitioning. Experimental results show that the sensor atoms of both models achieved high purity and mutual information values ​​on the hybrid test set, proving that the sensor atomization method has good cross-model functional semantic consistency.

[0079] The cross-model verification described above demonstrates the core design concept of this invention: sensor atoms are defined at the sensor functional semantic level and are independent of the MAVLink message identifier MSG_ID used by a specific model. Therefore, even if different models have different MSG_ID sets, the method of this invention can still discover functionally equivalent sensor atoms from their respective MAVLink data streams and achieve cross-model universal anomaly detection.

[0080] The above description is only a preferred embodiment of the present invention, but the present invention should not be limited to the content disclosed in the embodiments and drawings. Therefore, any equivalent or modified embodiments made without departing from the spirit of the present invention shall fall within the protection scope of the present invention.

Claims

1. A method for anomaly detection across UAV models based on sensor atomization, characterized in that... Specifically, the steps include the following: S1. Sensor Atomization Characterization: Through sequential data acquisition and information entropy filtering, BPE compression, BERT pre-training, and DBSCAN clustering to discover sensor atoms, heterogeneous message bytes are mapped into cross-model common sensor functional semantic units. S2. Functional semantic causal optimization: Construct a self-organizing causal graph network based on NOTEARS and multi-head attention on the basis of sensor atoms to achieve cross-model anomaly detection.

2. The cross-model UAV anomaly detection method based on sensor atomization as described in claim 1, characterized in that, In step S1, the specific process of data acquisition and information entropy filtering is as follows: (1) Obtain the tlog file of MAVLink recorded by the UAV during flight, and parse the tlog file into a raw byte stream using the pymavlink tool; (2) Automatically filter key dynamic parameters using information entropy for each byte position in the payload. b Calculate its information entropy throughout the entire flight log. : , in p ( x ) is bytes b Values x The probability of; (3) For each message, select the one with the highest entropy value. K Each byte is concatenated with MSG_ID to form the original Token: Token_raw = [MSG_ID, selected_byte_1, selected_byte_2].

3. The cross-model UAV anomaly detection method based on sensor atomization as described in claim 1, characterized in that, In step S1, the specific process of BPE compression is as follows: initialize the vocabulary with all single bytes {0, 1, ..., 255}, and then repeat the following steps until the target vocabulary size is reached. V (1) Count the frequency of all adjacent byte pairs; (2) Merge the most frequent byte pairs into a new token; (3) Update the vocabulary and corpus encoding; The final vocabulary size is V = 256 + M ,in M This represents the number of merges.

4. The cross-model UAV anomaly detection method based on sensor atomization as described in claim 1, characterized in that, In step S1, the specific process of BERT pre-training is as follows: (1) Let the embedding matrix be , ,in, e i No. i Embedding vectors of individual tokens, For the first in the Token i One original discrete; (2) MTP randomly occludes some tokens, forcing the model to reconstruct the occluded items using the context; (3) Use the formula: Within the embedded space, relevant tokens are brought closer together, while irrelevant tokens are pushed away; among them, L MTP Predict the overall loss of the task for the message token; context( ) is the context encoding function; For a given context feature context(e i ) The model predicts the original token's content. The probability of.

5. The cross-model UAV anomaly detection method based on sensor atomization as described in claim 1, characterized in that, In step S1, the specific process of DBSCAN clustering to discover sensor atoms is as follows: For each point in the embedding space, if its If a point contains at least MinPts neighbors within its radius, it is marked as a core point. The density of core points can be such that the region is connected to form a sensor atom. Sparse points are marked as noise and discarded. The clustering result is the sensor atom.

6. The cross-model UAV anomaly detection method based on sensor atomization as described in claim 1, characterized in that, The specific process of constructing a self-organizing causal graph network based on NOTEARS and multi-head attention in step S2 is as follows: (1) Let the adjacency matrix be... Minimize the reconstruction loss and apply differentiable DAG constraints. : After solving Quantitative Atoms j right i The causal effect; (2) Using multi-head attention as a secondary channel to capture long-range coupling that is non-causal but statistically relevant: ; (3) NOTEARS embeds PyTorch computation graphs to support incremental updates. Adding new atoms does not require retraining the entire graph, and it adapts to the dynamic addition and removal of sensors. (4) In the anomaly detection stage, the sensor atom feature vector of the time window to be detected is input into the dual-channel fusion model to calculate the anomaly score of each sensor atom; when the final anomaly score exceeds the preset threshold, the time window is judged as an anomaly.

7. The cross-model UAV anomaly detection method based on sensor atomization as described in claim 1, characterized in that, In step S1, before data acquisition and information entropy filtering, the sensor atomization problem is formally defined as follows: Given a raw MAVLink message stream from a certain model, the goal is to automatically discover a set of sensor atoms. Each sensor atom s It is a functional semantic unit, corresponding to a coupled functional module in flight dynamics that is constrained by physical equations.

8. The cross-model UAV anomaly detection method based on sensor atomization as described in claim 7, characterized in that, After formally defining the sensor atomization problem, a causal dependency structure between atoms is established. Utilizing the high cohesion of sensor atoms in the BERT embedding space, a physically meaningful soft-constraint channel is constructed for NOTEARS. The specific process is as follows: (1) Let the set of atom sensors be... ,in For the number of atoms, each sensor atom A functional semantic vector corresponding to the BERT embedding space This vector is obtained by the aggregate representation of all token embeddings within an atom; NOTEARS uses a functional semantic matrix. As input, learn a weighted causal adjacency matrix. : in For a DAG with no acyclic constraints, To reconstruct the loss, It is a nonlinear function. This represents the Hadamard product, which is the element-wise multiplication of two matrices at corresponding positions. (2) Introduce multi-head attention global jump connection as a secondary channel and calculate the global dependency weights between all atomic pairs. ; (3) Dual-channel fusion: in Controlling attentional secondary side contribution; (4) The NOTEARS solver is embedded in the PyTorch computation graph and supports sliding window incremental updates: when a new sensor atom is added... At that time, it is only necessary to calculate the new atoms and the existing ones. Causal edges of individual atoms do not require retraining the entire graph.