Avionics system defect positioning system based on code semantic analysis
The avionics system defect location system based on code semantic analysis solves the problems of large defect location range and low accuracy in existing technologies, and realizes efficient and accurate location and root cause analysis of avionics system defects, thereby improving the engineering application value of avionics systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- DALIAN MARITIME UNIVERSITY
- Filing Date
- 2026-04-03
- Publication Date
- 2026-05-01
AI Technical Summary
Existing technologies struggle to effectively utilize code context semantic relationships in avionics system defect localization, resulting in an excessively large localization range, insufficient accuracy, low efficiency, and a high risk of missed or false detections. Defect localization is particularly difficult in scenarios involving complex control logic and coupled logic.
A defect localization system based on code semantic analysis is adopted. Through units such as rule knowledge base, code preprocessing, semantic sample generation, semantic feature extraction, spectral feature extraction and mutation feature extraction, combined with the KAN fusion model, a defect localization model of avionics system is established to achieve joint representation of the logical role, control relationship and local semantic environment of candidate code units and identify complex defect patterns.
It improves the accuracy and efficiency of avionics system defect location, enabling more accurate identification of hidden defects caused by condition judgment deviations, state machine anomalies, and interface control mismatches, reducing false alarms and missed detections, and enhancing the interpretability and stability of engineering applications.
Smart Images

Figure CN121958136A_ABST
Abstract
Description
A Defect Location System for Avionics Systems Based on Code Semantic Analysis Technical Field
[0001] This invention relates to the field of avionics system technology, and in particular to an avionics system defect location system based on code semantic analysis. Background Technology
[0002] In existing technologies, when locating defects in avionics systems implemented by FPGAs, the VHDL, Verilog, or SystemVerilog designs that handle flight control logic, navigation and sensor data processing, avionics bus interfaces, and timing control functions are typically used as the target for location. When simulation failures, board-level integration anomalies, interface communication errors, state machine out-of-sync issues, or functional output deviations occur, the fault phenomena are initially mapped to the flight control computing unit, sensor driver and preprocessing unit, ARINC 429 or MIL-STD-1553 bus interface units, redundancy management units, or clock reset control units based on avionics functional partitions, requirement tracking relationships, and module hierarchies. Then, the candidate suspicious range is constructed by combining failure test stimuli, expected outputs, register observations, state machine state transitions, constraint files, and synthesis and placement and routing results.
[0003] In the specific positioning process, existing solutions typically integrate the passed and failed test cases generated by requirements-based verification, HDL code coverage, branch and condition coverage, assertion coverage, formal verification counterexamples, static timing analysis reports, and simulation waveforms to sort the suspicion of HDL statements, combinational logic conditions, register transfer assignments, state machine transition arcs, cross-clock domain synchronization logic, and interface control paths, and perform dependency backtracking or minimum diagnostic set solving. In particular, given the characteristics of avionics systems, such as a large amount of sequential logic, strict interface timing, and error propagation that manifests across multiple clock cycles, dynamic execution tracing or time-aware spectrum analysis unfolded according to clock cycles is also introduced to backtrack and analyze the internal node flipping relationships, enable conditions, data propagation chains, and control dependency chains several cycles before the failure occurs. During board-level verification, prototype verification, or airborne testing, on-chip debugging logic such as ILA, VIO, JTAG debug cores, or Signal Tap is further inserted into the design to capture internal signals during runtime without occupying external test pins. The measured waveforms are then compared with the simulated waveforms, formal counterexamples, and timing violation paths to gradually converge defects to specific module instances, HDL statements, state machine states, interface handshake logic, or critical timing paths.
[0004] Existing defect localization methods rely heavily on test execution information, suspicion formulas, waveform analysis, and engineer experience. They do not make sufficient use of code context semantic relationships, defect propagation links, and cross-module interaction behaviors. When the defect is not an isolated statement error, but is caused by condition judgment deviation, control flow propagation, interface timing coupling, or multi-module collaboration mismatch, it is easy to have problems such as an excessively large localization range, insufficient localization accuracy, low investigation efficiency, and the coexistence of missed and false detections.
[0005] Therefore, a method is needed to locate defects by combining the semantic relationships of the code context. Summary of the Invention
[0006] To address the aforementioned technical problems, this invention provides an avionics system defect localization system based on code semantic analysis. By establishing an effective correlation between fault phenomena and code semantics, execution behavior, and cross-module propagation relationships in complex avionics functional scenarios, this invention improves defect tracing capabilities, localization accuracy, and engineering application efficiency.
[0007] The technical means employed in this invention are as follows:
[0008] A defect localization system for avionics systems based on code semantic analysis includes: a rule knowledge base, a code preprocessing unit, a semantic sample generation unit, a semantic feature extraction unit, a spectral feature extraction unit, a variant feature extraction unit, a feature fusion modeling unit, and a root cause analysis output unit. The rule knowledge base is constructed based on a fault sample set and common fault modes of the avionics system, serving as the basis for root cause analysis and fault localization. The code preprocessing unit preprocesses and parses the HDL code of the avionics system. The semantic sample generation unit generates semantic analysis samples and extracts code sequence representations from the preprocessed HDL code output by the code preprocessing unit. The semantic feature extraction unit extracts semantic features from the semantic analysis samples. The spectral feature extraction unit extracts spectral features from the semantic analysis samples. The variant feature extraction unit extracts variant features from the semantic analysis samples. The feature fusion modeling unit fuses the extracted semantic features, spectral features, and variant features to establish a defect localization model and calculates the defect suspicion level. The root cause analysis output unit determines the location of the defective HDL code based on the defect suspicion level, thus achieving defect localization.
[0009] Furthermore, the rule knowledge base includes at least state machine transition exception rules, timing handshake exception rules, reset initialization exception rules, counter overflow rules, cross-clock domain synchronization rules, bus protocol consistency rules, redundancy switching rules, and sensor interface control rules; the fault sample set includes at least HDL source code, historical version data, fault repair records, test stimulus files, simulation result files, waveform files, assertion results, coverage information, and functional requirement constraint information.
[0010] Furthermore, the code preprocessing unit reads the source code file to be analyzed and performs comment removal, whitespace normalization, and syntax cleaning on the source code; it calls external parsing tools to perform structured analysis on the code, generating an abstract syntax tree and an equivalent syntax structure representation; during the structured analysis process, it establishes a mapping relationship between source files, modules, procedural blocks, statements, and line numbers, so that each candidate code unit can establish a correspondence with its module level, source file location, and syntax context.
[0011] Furthermore, the semantic sample generation unit uses process blocks, state machine branch blocks, and statement windows of preset length as basic analysis units to extract candidate code units and surrounding code fragments; it sets boundary markers for candidate code units to explicitly identify candidate defect locations; it performs lexical segmentation on the code fragments to obtain a token sequence composed of keywords, identifiers, constants, logical operators, comparison operators, bit-width symbols, control symbols, and delimiters; it performs normalized replacement on user-defined identifiers and performs uniform length standardization processing on the token sequence.
[0012] Furthermore, the semantic feature extraction unit inputs the token sequence into a vectorization model to obtain a dense vector representation of the token sequence; the dense vector representation is input into a bidirectional long short-term memory network (BiLSTM) to perform bidirectional semantic encoding on the preceding and following context code segments of the candidate code unit, and to extract a deep semantic representation reflecting the candidate code unit in local control structure, contextual logical relationship and semantic dependency relationship; the semantic features are used to characterize the structural role and semantic pattern of the candidate statement in avionics logic.
[0013] Furthermore, the spectrum feature extraction unit performs functional tests, boundary condition tests, anomaly injection tests, interface consistency tests, and timing constraint tests on the target avionics system, records the pass or fail results of each test case, and statistically analyzes the execution coverage of each candidate code unit, state machine transition edge, logic block, or module instance in the pass and fail test cases. Based on the number of times the candidate code unit is executed by the pass test cases, the number of times it is executed by the fail test cases, the number of times it is not executed by the pass test cases, and the number of times it is not executed by the fail test cases, a spectrum statistical vector is constructed, and the corresponding statement suspicion degree is calculated.
[0014] Furthermore, the mutation feature extraction unit generates a mutation design for the candidate code unit according to a preset mutation operator. The mutation operator includes relational operator replacement, logical operator replacement, condition negation, constant replacement, state code replacement, bit selection range adjustment, assignment direction adjustment, reset polarity reversal, clock enable condition perturbation, and branch condition deletion. The original design and the mutation design are simulated under the same test set, and the test results, waveform differences, state change differences, and assertion failure differences are compared. The perturbation intensity of the candidate code unit on the system behavior after the introduction of mutation is extracted to form a corresponding mutation feature vector. The mutation feature vector is used to characterize the degree of influence of the candidate code unit on fault propagation and abnormal system behavior.
[0015] Furthermore, the feature fusion modeling unit utilizes the semantic features, spectral features, and mutation features combined with the matching results of the rule knowledge base to construct a multi-dimensional feature vector; the defect localization model is constructed based on the KAN fusion model, which introduces trainable univariate nonlinear functions into each input dimension to adaptively model the complex nonlinear relationship between semantic information, execution information, behavioral perturbation information, and rule constraint information, and outputs the defect suspicion score of each candidate code unit.
[0016] Furthermore, the root cause analysis output unit sorts the candidate code units, candidate logic blocks, candidate state machine transition edges, and candidate modules in descending order based on the defect suspicion score, forming a defect localization result list. For the top-ranked candidate code units, the unit combines the mapping relationship and rule knowledge base to provide the file to which they belong, module name, statement position, associated signal, affected functional link, potentially violated rule items, and corresponding explanation of system behavior anomalies. The result list is displayed in a two-level manner at the file level and statement level. The result list includes statement content, semantic feature summary, spectral feature score, mutation feature score, and fused defect suspicion score, enabling the backtracking from system anomalies to specific HDL code locations.
[0017] Compared with existing technologies, this invention has the following advantages: The avionics system defect localization system based on code semantic analysis provided by this invention is designed for avionics systems implemented using FPGAs. Addressing the problem that traditional fault localization methods mainly rely on test coverage, log analysis, and manual waveform inspection, making it difficult to effectively utilize code context semantic relationships, this invention combines code structure parsing, semantic vectorization representation, and deep context modeling to jointly represent the logical role, control relationship, and local semantic environment of candidate code units. This allows the defect localization process to move beyond isolated analysis of single statements and instead identify anomaly propagation paths by combining related statements, branch conditions, state transitions, and local logical structures. This invention can more effectively discover hidden defects in avionics systems caused by condition judgment deviations, state machine transition anomalies, interface control mismatches, and cross-statement propagation, improving the defect tracing capability in complex control logic and coupled logic scenarios.
[0018] This invention jointly models spectral features, variation features, and semantic features, and introduces a statement frequency weighting mechanism for spectral features based on test execution information. This makes the responsibility allocation of candidate code units more reasonable in scenarios with small coverage of failed test cases, short fault propagation chains, or concentrated local logical anomalies. Simultaneously, by implementing program perturbations on candidate code units and analyzing changes in system behavior before and after the perturbations, this invention can identify key code locations that have a real impact on abnormal results. This avoids the problems of excessively large location range, numerous false alarms, and high manual screening costs associated with traditional methods that rely solely on co-occurrence relationships for ranking. This invention can more accurately distinguish between the key code units that truly cause anomalies and unrelated code units that are merely executed in conjunction with them, even in situations involving multi-module collaboration, complex timing relationships, and concealed fault propagation in avionics systems.
[0019] This invention employs the KAN model to uniformly fuse semantic features, spectral features, and mutation features. It uses a learnable univariate function to model the complex nonlinear relationships between multi-source heterogeneous features at a finer granularity. Compared to traditional MLP and other fusion methods, it can more fully explore the complementary relationships between code semantics, dynamic execution behavior, and program disturbance responses, thereby improving the accuracy, stability, and interpretability of defect suspicion ranking results. Experimental results show that this multi-feature fusion method outperforms the main comparison methods in Top-1, Top-5, MAR, and MFR metrics, indicating that this invention can more effectively rank real defects at the top of the candidate list, reducing the average number of statements developers need to check. Furthermore, this method maintains good localization capabilities under different FPGA simulation tool scenarios, demonstrating its good versatility and engineering applicability. This invention not only improves the defect localization efficiency of FPGA-implemented avionics systems but also enhances the stability, reproducibility, and engineering application value of the output results. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 is a schematic diagram of the structure of the avionics system defect localization system based on code semantic analysis in this invention. Detailed Implementation
[0022] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0023] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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. The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the present invention or its application or use. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0024] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0025] Unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps described in these embodiments do not limit the scope of the invention. It should also be understood that, for ease of description, the dimensions of the various parts shown in the drawings are not drawn to actual scale. Techniques, methods, and devices known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and devices should be considered part of the specification. In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values. It should be noted that similar reference numerals and letters in the following figures denote similar items; therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0026] As shown in Figure 1, this invention provides an avionics system defect localization system based on code semantic analysis, comprising: a rule knowledge base, a code preprocessing unit, a semantic sample generation unit, a semantic feature extraction unit, a spectral feature extraction unit, a variant feature extraction unit, a feature fusion modeling unit, and a root cause analysis output unit. The rule knowledge base is constructed based on the avionics system's fault sample set and common fault modes, serving as the basis for root cause analysis and fault localization. The code preprocessing unit preprocesses and parses the HDL code of the avionics system. The semantic sample generation unit generates semantic analysis samples and extracts code sequence representations from the preprocessed HDL code output by the code preprocessing unit. The semantic feature extraction unit extracts semantic features from the semantic analysis samples. The spectral feature extraction unit extracts spectral features from the semantic analysis samples. The variant feature extraction unit extracts variant features from the semantic analysis samples. The feature fusion modeling unit fuses the extracted semantic features, spectral features, and variant features to establish a defect localization model and calculates the defect suspicion level. The root cause analysis output unit determines the location of the defective HDL code based on the defect suspicion level, thus achieving defect localization.
[0027] In a preferred embodiment of this invention, the rule knowledge base includes at least state machine transition exception rules, timing handshake exception rules, reset initialization exception rules, counter overflow rules, cross-clock domain synchronization rules, bus protocol consistency rules, redundancy switching rules, and sensor interface control rules. The fault sample set includes at least HDL source code, historical version data, fault repair records, test stimulus files, simulation result files, waveform files, assertion results, coverage information, and functional requirement constraint information. Fault samples containing real defects are extracted from historical versions, and statement-level or logic block-level annotation data is established.
[0028] In a preferred embodiment of this invention, the code preprocessing unit reads the source code file to be analyzed and performs comment removal, whitespace normalization, and syntax cleaning on the source code; it then calls an external parsing tool to perform structured analysis on the code, generating an abstract syntax tree and an equivalent syntax structure representation; during the structured analysis process, it establishes mapping relationships between source files, modules, process blocks, statements, and line numbers, enabling each candidate code unit to establish a correspondence with its module level, source file location, and syntax context, so as to facilitate subsequent semantic modeling and localization result display. State machine statements, combinational logic statements, sequential logic statements, interface control statements, and register transfer statements in avionics systems are all considered as candidate analysis objects for subsequent defect localization.
[0029] In a specific implementation, as a preferred embodiment of the present invention, the semantic sample generation unit uses process blocks, state machine branch blocks, and statement windows of preset length as basic analysis units to extract candidate code units and surrounding code fragments; it sets boundary markers for candidate code units to explicitly identify candidate defect locations; it performs lexical segmentation on the code fragments to obtain a token sequence composed of keywords, identifiers, constants, logical operators, comparison operators, bit-width symbols, control symbols, and delimiters; it performs normalized replacement of user-defined identifiers to reduce the vocabulary size and improve cross-project generalization ability; and it performs uniform length standardization processing on the token sequence so that different samples meet the subsequent model input requirements.
[0030] In a preferred embodiment of the invention, the semantic feature extraction unit inputs the token sequence into a vectorization model to obtain a dense vector representation of the token sequence. This dense vector representation is then input into a bidirectional long short-term memory (BiLSTM) network to perform bidirectional semantic encoding on the preceding and following code segments of the candidate code unit, extracting a deep semantic representation reflecting the candidate code unit's local control structure, contextual logical relationships, and semantic dependencies. The semantic features are used to characterize the structural role and semantic pattern of candidate statements in avionics logic, thereby enhancing the model's ability to identify complex defect patterns such as condition judgment errors, state switching errors, interface control errors, and timing constraint errors.
[0031] In a preferred embodiment of this invention, the spectrum feature extraction unit performs functional tests, boundary condition tests, anomaly injection tests, interface consistency tests, and timing constraint tests on the target avionics system. It records the pass / fail results of each test case and statistically analyzes the execution coverage of each candidate code unit, state machine transition edge, logic block, or module instance in both passed and failed test cases. Based on the number of times each candidate code unit is executed by passed test cases, failed test cases, unexecuted test cases, and unexecuted test cases, a spectrum statistical vector is constructed, and the corresponding statement suspicion level is calculated. Preferably, the spectrum features can be weighted according to the execution frequency of candidate statements in the test cases. This further amplifies the responsibility contribution of each executed statement when only a small number of statements are executed in failed test cases, thereby enhancing the ability to identify defective statements in short fault propagation chain scenarios.
[0032] In a specific implementation, as a preferred embodiment of the present invention, the mutation feature extraction unit generates a mutation design for the candidate code unit according to a preset mutation operator. The mutation operator includes relational operator replacement, logical operator replacement, condition negation, constant replacement, state code replacement, bit selection range adjustment, assignment direction adjustment, reset polarity reversal, clock enable condition perturbation, and branch condition deletion. The original design and the mutation design are simulated under the same test set, and the test results, waveform differences, state change differences, and assertion failure differences are compared. The perturbation intensity of the candidate code unit on the system behavior after the introduction of mutation is extracted to form the corresponding mutation feature vector. The mutation feature vector is used to characterize the degree of influence of the candidate code unit on fault propagation and abnormal system behavior, so as to supplement the causal relationship that is difficult to reflect when relying solely on static semantics and dynamic coverage information.
[0033] In a preferred embodiment of this invention, the feature fusion modeling unit constructs a multi-dimensional feature vector by combining semantic features, spectral features, and mutation features with the matching results of the rule knowledge base. The defect localization model is built based on the KAN fusion model. This model introduces trainable univariate nonlinear functions into each input dimension to adaptively model the complex nonlinear relationships between semantic information, execution information, behavioral perturbation information, and rule constraint information, outputting a defect suspicion score for each candidate code unit. Compared to traditional multilayer perceptron models, the KAN model can express higher-order coupling relationships between different features with finer granularity, thereby improving the localization accuracy and interpretability of results in complex avionics defect scenarios.
[0034] In a preferred embodiment of this invention, the root cause analysis output unit sorts candidate code units, candidate logic blocks, candidate state machine transition edges, and candidate modules in descending order based on the defect suspicion score, forming a defect location result list. For the top-ranked candidate code units, the system combines mapping relationships and a rule knowledge base to provide the file to which they belong, module name, statement location, associated signals, affected functional links, potentially violated rule items, and corresponding explanations of system behavior anomalies. The result list is displayed in a two-tiered manner at the file and statement levels. The result list includes statement content, semantic feature summary, spectral feature score, variation feature score, and fused defect suspicion score, enabling developers to trace back from system anomalies to specific HDL code locations, thus achieving automatic location and assisted root cause analysis of avionics system defects.
[0035] This invention provides a defect localization system for avionics systems implemented using FPGAs. It is applicable to HDL code defect localization in avionics functional modules such as flight control calculation logic, sensor data processing logic, bus interface logic, redundancy management logic, timing control logic, and fault monitoring logic. By extracting code semantic features, test execution spectrum features, and program variation features, and combining these with avionics domain rules for multi-feature fusion, a correlation between code statements and system behavioral anomalies is established, thereby achieving automatic location and root cause analysis of avionics system defects.
[0036] During the operation of the avionics system, the backend defect location service is executed automatically. The defect location service follows a closed loop of "task creation, feature extraction, model reasoning, and result update". During the task execution, intermediate features and final results are persistently stored to support subsequent result display, historical task tracking, and analysis report output.
[0037] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A defect location system for avionics systems based on code semantic analysis, characterized in that, include: The system comprises a rule knowledge base, a code preprocessing unit, a semantic sample generation unit, a semantic feature extraction unit, a spectral feature extraction unit, a variation feature extraction unit, a feature fusion modeling unit, and a root cause analysis output unit. The rule knowledge base is constructed based on the fault sample set of the avionics system and common fault modes of the avionics system, and is used as the basis for root cause analysis and fault location. The code preprocessing unit is used to preprocess and parse the HDL code of the avionics system; the semantic sample generation unit is used to generate semantic analysis samples and extract code sequence representations using the preprocessed HDL code output by the code preprocessing unit; the semantic feature extraction unit is used to extract semantic features from the semantic analysis samples; the spectral feature extraction unit is used to extract spectral features from the semantic analysis samples; the variation feature extraction unit is used to extract variation features from the semantic analysis samples; the feature fusion modeling unit is used to fuse the extracted semantic features, spectral features, and variation features to establish a defect location model and calculate the defect suspicion degree; the root cause analysis output unit determines the location of the defective HDL code based on the defect suspicion degree to achieve defect location.
2. The avionics system defect location system based on code semantic analysis according to claim 1, characterized in that, The rule knowledge base includes at least state machine transition exception rules, timing handshake exception rules, reset initialization exception rules, counter overflow rules, cross-clock domain synchronization rules, bus protocol consistency rules, redundancy switching rules, and sensor interface control rules; the fault sample set includes at least HDL source code, historical version data, fault repair records, test stimulus files, simulation result files, waveform files, assertion results, coverage information, and functional requirement constraint information.
3. The avionics system defect location system based on code semantic analysis according to claim 1, characterized in that, The code preprocessing unit reads the source code file to be analyzed and performs comment removal, whitespace normalization, and syntax cleaning on the source code; it then calls external parsing tools to perform structured analysis on the code, generating an abstract syntax tree and an equivalent syntax structure representation. In the structured analysis process, a mapping relationship is established between source files, modules, procedure blocks, statements, and line numbers, so that each candidate code unit can establish a correspondence with its module level, source file location, and syntax context.
4. The avionics system defect location system based on code semantic analysis according to claim 1, characterized in that, The semantic sample generation unit uses process blocks, state machine branch blocks, and statement windows of preset length as basic analysis units to extract candidate code units and surrounding code fragments; it sets boundary markers for candidate code units to explicitly identify candidate defect locations; it performs lexical segmentation on the code fragments to obtain a token sequence composed of keywords, identifiers, constants, logical operators, comparison operators, bit-width symbols, control symbols, and delimiters; it performs normalized replacement on user-defined identifiers and performs uniform length standardization processing on the token sequence.
5. The avionics system defect location system based on code semantic analysis according to claim 4, characterized in that, The semantic feature extraction unit inputs the token sequence into a vectorization model to obtain a dense vector representation of the token sequence; the dense vector representation is then input into a bidirectional long short-term memory network (BiLSTM) to perform bidirectional semantic encoding on the preceding and following context code segments of the candidate code unit, extracting a deep semantic representation reflecting the candidate code unit in local control structure, contextual logical relationship, and semantic dependency relationship; the semantic features are used to characterize the structural role and semantic pattern of the candidate statement in avionics logic.
6. The avionics system defect location system based on code semantic analysis according to claim 4, characterized in that, The spectrum feature extraction unit performs functional tests, boundary condition tests, anomaly injection tests, interface consistency tests, and timing constraint tests on the target avionics system, records the pass or fail results of each test case, and statistically analyzes the execution coverage of each candidate code unit, state machine transition edge, logic block, or module instance in the pass and fail test cases. Based on the number of times the candidate code unit is executed by the pass test cases, the number of times it is executed by the fail test cases, the number of times it is not executed by the pass test cases, and the number of times it is not executed by the fail test cases, a spectrum statistical vector is constructed, and the corresponding statement suspicion degree is calculated.
7. The avionics system defect location system based on code semantic analysis according to claim 1, characterized in that, The mutation feature extraction unit generates a mutation design for the candidate code unit according to a preset mutation operator. The mutation operator includes relational operator replacement, logical operator replacement, condition negation, constant replacement, state code replacement, bit selection range adjustment, assignment direction adjustment, reset polarity reversal, clock enable condition perturbation, and branch condition deletion. The original design and the mutation design are simulated under the same test set, and the test results, waveform differences, state change differences, and assertion failure differences are compared. The perturbation intensity of the candidate code unit on the system behavior after the introduction of mutation is extracted to form the corresponding mutation feature vector. The mutation feature vector is used to characterize the degree of influence of the candidate code unit on fault propagation and abnormal system behavior.
8. The avionics system defect location system based on code semantic analysis according to claim 1, characterized in that, The feature fusion modeling unit uses the semantic features, spectral features, and variation features combined with the matching results of the rule knowledge base to construct a multidimensional feature vector; The defect localization model is built based on the KAN fusion model. By introducing trainable univariate nonlinear functions in each input dimension, the defect localization model adaptively models the complex nonlinear relationship between semantic information, execution information, behavioral perturbation information and rule constraint information, and outputs the defect suspicion score of each candidate code unit.
9. The avionics system defect location system based on code semantic analysis according to claim 8, characterized in that, The root cause analysis output unit sorts candidate code units, candidate logic blocks, candidate state machine transition edges, and candidate modules in descending order based on the defect suspicion score, forming a defect localization result list. For the top-ranked candidate code units, the unit combines mapping relationships and rule knowledge base to provide the file, module name, statement position, associated signals, affected functional links, potentially violated rule items, and corresponding explanations of system behavior anomalies. The result list is displayed in a two-tiered manner at the file and statement levels. The result list includes statement content, semantic feature summary, spectral feature score, mutation feature score, and fused defect suspicion score, enabling backtracking from system anomalies to specific HDL code locations.
Citation Information
Patent Citations
Software defect positioning method and system based on multi-stream model fusion
CN121029619A
WebShell malicious behavior fine grit method based on abstract syntax tree and de-confusion
CN121561904A