Knx protocol consistency automatic verification method and system based on neural-symbolic reasoning
By using a neural symbolic reasoning method, the KNX protocol specification document is automatically parsed, a test set is generated, and formal verification is performed. This solves the problem of manual reliance in existing systems and achieves efficient and accurate protocol consistency verification and secure encrypted communication.
Patent Information
- Application Number
- CN202611646070.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-23
- Publication Date
- 2026-11-20
AI Technical Summary
Existing KNX protocol conformance verification systems lack automatic disambiguation mechanisms when parsing natural language protocol specifications, resulting in rule conversion being highly dependent on manual intervention, limiting accuracy, and affecting verification efficiency.
A neural symbolic reasoning-based approach is adopted. By receiving the KNX protocol specification document, extracting text data and generating atomic reduction text, constructing an abstract syntax tree, compiling temporal logic formulas, constructing shadow state transition rules, generating a test set, performing state space search in the protocol state transition structure, and generating a formal verification report.
It achieves automated and accurate protocol consistency verification, reduces manual intervention, improves verification efficiency, balances the security of encrypted communication and the depth of testing, and enhances the traceability of test reports.
Smart Images

Figure CN123145334A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication protocol testing technology, specifically to an automatic verification method and system for KNX protocol conformance based on neural symbolic reasoning. Background Technology
[0002] The KNX protocol plays a crucial role in communication connectivity within smart home and building automation networks. To ensure interoperability between devices from different manufacturers on the same network, a protocol conformance verification system is typically used to check the compliance of device communication behavior. This type of verification system analyzes various constraints in the protocol specification document, translates them into specific test commands, and interacts with the device under test to verify whether the device's operating status at different protocol layers conforms to the standard's logic and timing requirements.
[0003] Current verification systems typically perform these tasks by sending messages to the device under test (DUT) through pre-defined test scripts, then capturing the device's response data for routine comparison. During the test script development phase, the verification system primarily relies on testers directly reading specification documents and manually writing test cases, or using basic text extraction tools to extract certain test fields. This semi-automatic approach maintains the entire verification process.
[0004] Existing verification systems struggle to accurately translate protocol specifications written in natural language directly into machine-executable logic. The inherent ambiguity and vague references of natural language often lead to ambiguities during rule parsing. Extensive human intervention not only increases the burden of pre-test preparation but also risks subjective interpretations causing the generated test rules to deviate from the specification's intent. Furthermore, current systems lack automatic identification and elimination mechanisms for ambiguous branches within complex constraint clauses embedded in specification documents. This limits the accuracy of machine reading and conversion of protocol specifications, consequently impacting the overall coherence and efficiency of protocol consistency verification. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides an automatic KNX protocol consistency verification method based on neural symbolic reasoning. This method solves the problem that existing verification systems lack automatic disambiguation mechanisms when parsing natural language protocol specifications, leading to rule conversion that is highly dependent on manual intervention and has limited accuracy, thereby reducing the efficiency of protocol consistency verification.
[0006] To achieve the above objectives, the present invention provides the following technical solution: an automatic verification method for KNX protocol consistency based on neural symbolic reasoning, comprising the following steps: Step S1: Receive the KNX protocol specification document, extract the text data from it and degrade it to generate atomic specification text; Step S2: Parse the atomic reduction text to generate an abstract syntax tree, and extract the constraint nodes in the abstract syntax tree to compile them into temporal logic formulas; Step S3: Transform the abstract syntax tree into deduction rules, construct a set of basic facts and state transition rules, and perform formal deduction according to the deduction rules to output consistency verification results and a list of conflict-free specifications; Step S4: When the consistency verification result passes, construct a protocol state transition structure representing the KNX device under test based on the conflict-free protocol list, and perform a state space search in the protocol state transition structure using the timing logic formula to generate a test set. Step S5: Send message interaction sequence to the KNX device under test according to the test set and receive response data, extract dynamic features and inject them into the basic fact set to perform closed-loop constraint solution, and generate a formal verification report based on the solution results.
[0007] Preferably, step S1 specifically includes: obtaining the full text of the KNX protocol specification document, performing noise reduction processing and special character normalization replacement on the full text to generate plain text; According to the protocol specification numbering rules, the paragraph start positions in the plain text are matched, the plain text is divided into independent complex contract entries, and all the complex contract entries are aggregated to generate a complex contract set; A preset syntactic degradation algorithm is invoked to segment the complex contract entries containing multiple constraints in the complex contract set, thereby degrading the complex sentence with multiple temporal and data constraints into independent atomic contract texts containing only a single-dimensional protocol constraint.
[0008] Preferably, in step S2, the step of parsing the atomic reduction text to generate an abstract syntax tree specifically includes: constructing a context-free grammar, expressing the context-free grammar using Backus normal form, and generating a set of BNF grammar rules containing four types of reduction patterns: temporal constraints, state constraints, data constraints, and action constraints. The recursive descent parsing algorithm is invoked to traverse the character sequence of the atomic reduction text to match the grammatical expressions in the BNF grammar rule set, generating a basic abstract syntax tree; An array-type data structure is introduced at the ambiguous nodes where there is semantic ambiguity in the basic abstract syntax tree to generate a multi-branch abstract syntax tree containing a set of candidate syntax subtrees. Logical pre-inference operations are performed on the set of candidate syntax subtrees to eliminate conflicting subtree branches, and the verified candidate abstract syntax subtrees are retained to generate the abstract syntax tree.
[0009] Preferably, in step S2, the step of extracting the constraint nodes in the abstract syntax tree and compiling them into a temporal logic formula specifically includes: extracting the temporal constraint nodes in the abstract syntax tree, wherein the temporal constraint nodes include premise triggering event nodes, time threshold nodes, and target response event nodes; The logical relationships in the time-series constraint nodes are mapped to linear time-series logic operators, the root logical attributes of the time-series constraint nodes are extracted and matched as global operators, and the constraint values in the time threshold nodes are read and matched as future operators with time window constraints. According to the dependency logic of the protocol specification, a linear timing logic formula with time window constraints is generated as the timing logic formula. The timing logic formula indicates that the target response event node will necessarily occur after the occurrence of the premise triggering event node and within the time parameter limited by the time threshold node.
[0010] Preferably, step S3 specifically includes: establishing a logical association between the internal encryption state of the KNX device under test and the external side channel metadata, and extracting the length change, transmission and reception time interval, and message sequence number of the continuous interaction messages as the external side channel metadata; Combining the extracted external side channel metadata with the internal encryption state, a shadow state transition rule formula is constructed. The shadow state transition rule formula represents that the KNX device under test transitions to the next internal security state if and only if the KNX device under test is in the current internal security state and the length change, the transmission and reception time interval, and the increment of the message sequence number of the subsequently captured physical messages all meet the preset boundary conditions.
[0011] Preferably, in step S4, the step of constructing a protocol state transition structure representing the KNX device under test based on the conflict-free protocol list specifically includes: extracting the protocol state data of the KNX device under test, converting the protocol state data into a Kripke structure as the protocol state transition structure, wherein the Kripke structure is defined as a quintuple structure, and the quintuple structure includes a finite set of states, an initial set of states, a state transition relation matrix, a set of atomic propositions, and a state labeling function; The finite state set contains all the legal working states of the KNX device under test. The initial state set is a subset of the finite state set and represents the basic connection state. The state transition relation matrix records the jump paths between the states within the finite state set. The atomic proposition set contains the basic Boolean expressions describing the attributes of the KNX device under test. The state labeling function establishes the mapping between the finite state set and the atomic proposition set.
[0012] Preferably, in step S4, the step of using the temporal logic formula to perform state space search in the protocol state transition structure to generate a test set specifically includes: using the temporal logic formula as the attribute condition to be verified, calling the nested depth-first search algorithm to match the protocol state transition path that satisfies the attribute condition to be verified in the state space of the Kripke structure, converting the successfully matched search path into a positive test case, converting the negative example path that violates the attribute condition to be verified into a negative test case, and aggregating to generate an initial test set; The differential debugging algorithm is invoked to perform state equivalence class pruning on the initial test set, eliminating duplicate test cases that cover the same protocol state transition path, and outputting a set of minimal execution sequences consisting of the deduplicated minimal execution sequences as the test set.
[0013] Preferably, in step S5, the step of sending a message interaction sequence to the KNX device under test based on the test set and receiving response data, extracting dynamic features and injecting them into the basic fact set to perform closed-loop constraint solving, and generating a formal verification report based on the solution results, specifically includes: Test messages are injected into the KNX device under test, and the encrypted message is subjected to link layer feature extraction without parsing the encrypted message data payload. The receiving timestamp is recorded and the plaintext header field is read to obtain the total message length data and plaintext sequence number data. The data is aggregated to generate a multi-dimensional dynamic feature vector set as the dynamic feature. The multidimensional dynamic feature vector set is converted into a dynamic fact predicate expression and injected into the basic fact set to construct a closed-loop inference fact set; The logical deduction algorithm is invoked to substitute the parameters in the dynamic fact predicate expression into the metadata variables of the state transition rule to perform closed-loop constraint solving operations, deducing the internal encrypted state transition path of the tested KNX device and comparing it with the state transition path of the protocol state transition structure. Based on the comparison verification results and the collected multidimensional dynamic feature vector set, the formal verification report is generated.
[0014] Preferably, before generating the formal verification report in step S5, the process of constructing an audit traceability chain is also included: extracting the test case number corresponding to the state determination result, using the timestamp parameter and sequence number parameter in the multi-dimensional dynamic feature vector set to index and match the full number of interactive message records, and mapping the underlying physical execution record to the state transition path of the protocol state transition structure; The state transition path of the protocol state transition structure is traced upwards to the abstract syntax tree node, and the protocol field data carried by the abstract syntax tree node is extracted and mapped to the corresponding atomic specification text, thereby constructing a full-link audit traceability chain from the underlying physical communication message to the top-level natural language specification text and encapsulating it into the formal verification report.
[0015] An automatic KNX protocol consistency verification system based on neural symbolic reasoning includes: a processor, a memory, a communication interface, and a communication bus. The memory is pre-written with computer program instructions. The processor reads the computer program instructions from the memory and, in conjunction with the external data transmission and reception capabilities of the communication interface, executes the system to achieve the following: The document preprocessing module is used to receive the KNX protocol specification document, extract the text data from it, degrade it, and generate atomic specification text. The parsing and compilation module is used to parse the atomic reduction text to generate an abstract syntax tree, extract the constraint nodes in the abstract syntax tree, and compile them into temporal logic formulas. The formal deduction module is used to transform the abstract syntax tree into deduction rules, construct a set of basic facts and state transition rules, perform formal deduction according to the deduction rules, and output consistency verification results and a list of conflict-free specifications. The test generation module is used to construct a protocol state transition structure representing the KNX device under test based on the conflict-free protocol list when the consistency verification result passes, and to perform a state space search in the protocol state transition structure using the timing logic formula to generate a test set. The execution and verification module is used to send message interaction sequences to the KNX device under test according to the test set and receive response data, extract dynamic features and inject them into the basic fact set to perform closed-loop constraint solving, and generate a formal verification report based on the solution results.
[0016] This invention provides an automatic KNX protocol consistency verification method based on neural symbolic reasoning. It has the following beneficial effects: 1. This invention establishes an automatic protocol specification extraction mechanism by progressively degrading the KNX protocol document into atomic specification text and then using grammatical parsing to convert it into an abstract syntax tree containing temporal logic formulas. By combining this with logical pre-reasoning based on a set of fundamental facts, the system can automatically identify and eliminate invalid parsing branches caused by semantic ambiguity in natural language. This approach reduces the workload and subjective bias associated with manually extracting test rules, making the machine-based reading process of complex protocol specifications more coherent and accurate.
[0017] 2. This invention provides a non-intrusive consistency verification method for encrypted communication protocols by constructing shadow state transition rules. During testing, it eliminates the need to decrypt the data payload of the message; instead, it extracts dynamic features such as message length changes, transmission and reception time intervals, and plaintext sequence numbers to participate in solving closed-loop constraints. This not only avoids the technical barriers to cracking encrypted data but also reasonably deduces the secure state transition path within the device, balancing the execution depth of protocol testing with data security.
[0018] 3. This invention introduces state space search and differential debugging algorithms into the protocol state transition structure to automatically generate test sets and prune redundant paths, resulting in output test interaction sequences that are both concise and targeted for verification. Simultaneously, dynamic feature data is used to map and associate the underlying physical communication records with the top-level specification text, constructing a full-link audit traceability chain. When device responses are abnormal, it can guide reviewers to directly locate the specific specification clause causing the conflict, improving the problem tracing capability and practical value of the test report. Attached Figure Description
[0019] Figure 1 This is a module architecture diagram of the KNX protocol conformance automatic verification system of the present invention; Figure 2 A schematic diagram illustrating the construction and pruning process of the target abstract syntax tree of this invention; Figure 3 This is a schematic diagram of the compilation process for the linear sequential logic formula of this invention; Figure 4 This is a flowchart illustrating the automatic verification method for KNX protocol consistency based on neural symbolic reasoning of the present invention. Figure 5 This is a block diagram of the hardware structure of the electronic device of the present invention. Detailed Implementation
[0020] The technical solutions in 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. 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.
[0021] See attached document Figure 1 This invention provides an automatic verification system for KNX protocol conformance. The automatic verification system may include: a document preprocessing module, a parsing and compilation module, a formal deduction module, a test generation module, and an execution and verification module.
[0022] In terms of hardware deployment, the automated verification system is deployed in the terminal device, which establishes a network connection with the KNX device under test through a wireless communication interface.
[0023] In the initial stage of system operation, the document preprocessing module receives the KNX protocol specification document as input data, extracts the text data and performs text preprocessing and segmentation extraction operations. Subsequently, the module divides the text data into multiple independent complex specification entries according to the specification numbering rules, and further performs syntactic segmentation on the complex specification entries, degrading the compound sentences containing multiple constraints into independent atomic specification texts.
[0024] After completing the text processing, the parsing and compilation module receives the atomic reduction text output above, and parses it using a context-free grammar to generate an abstract syntax tree. Then, the module extracts the logical constraint nodes in the abstract syntax tree and compiles the temporal constraint part into a linear temporal logic formula with time window constraints.
[0025] Subsequently, the formal deduction module receives the aforementioned abstract syntax tree and linear temporal logic formula. This module internally stores basic factual data including protocol states and message types, and can transform logical constraint nodes into deduction rules. At the same time, this module constructs shadow state transition rules to establish the mapping relationship between message length changes, transmission and reception time intervals, message sequence numbers, and the internal encryption state transitions of the tested KNX device. Based on the above, the formal deduction module performs formal verification according to the deduction rules to determine the consistency between rules. If the consistency verification fails, it marks the conflicting specification and records the conflict data.
[0026] After the deduction and verification phase, if the consistency verification passes, the test generation module will automatically generate a test set. This module first constructs a Kripke structure model representing the KNX protocol state machine, then inputs the linear time-series logic formula into the model to perform a state space search, and finally extracts test cases based on the search path and performs deduplication on them to generate a test set containing message interaction sequences.
[0027] Finally, the execution and verification module receives the test set and performs automated conformance testing accordingly. This involves sending a message interaction sequence to the KNX device under test and receiving its response data, thereby collecting test results and execution traces. For encrypted protocol interactions, the execution and verification module extracts metadata such as the length, timestamp, and sequence number of the response message and injects it into the formal deduction module. The formal deduction module combines linear temporal logic formulas and shadow state transition rules to dynamically constrain and solve the extracted metadata. Finally, the execution and verification module generates a formal verification report based on the dynamic constraint solution results and outputs a compliance certificate.
[0028] Within the overall operational framework of the aforementioned system, the specific execution details of each module are as follows: First, the document preprocessing stage begins. The specific execution process of the document preprocessing module is as follows: The document preprocessing module receives the KNX protocol specification document as input data and extracts its full text. After obtaining the full text, the module performs noise reduction, removes header and footer data, and merges broken paragraphs across pages. To ensure a consistent data format, it also performs normalization replacement on special characters, replacing non-standard encoded special symbols with standard characters to generate plain text.
[0029] Based on the generated plain text, the document preprocessing module performs specification boundary identification. The module matches the start positions of paragraphs in the plain text according to the protocol specification numbering rules, which include matching logic for a specific hierarchical numerical arrangement. Based on the matched paragraph start positions, the module segments the plain text into multiple independent complex specification entries. Each complex specification entry contains specification number data, title data, and body description data. The module aggregates all complex specification entries to generate a complex specification set.
[0030] After generating the complex contract set, the document preprocessing module performs syntactic atomization degradation operations on the complex contract entries, defining the input KNX protocol specification document as a document. The set of complex contracts is a set The document preprocessing module calls the preset syntactic degradation function. This process involves segmenting complex contract entries containing multiple constraints, thereby degrading complex sentences with multiple temporal and data constraints into independent atomic contract texts.
[0031] Specifically, the document preprocessing module uses syntactic degradation functions. set The complex specification entries in the code are mapped to a set of atomic specification texts. .
[0032] Through the degradation mapping process, the set Each atomic reduction text in It contains only single-dimensional protocol constraints, which can be independent time constraints, state constraints, or data constraints. After the extraction operation is completed, the document preprocessing module will reduce the atomic specification text set. The output is sent to the parsing and compilation module to complete the preprocessing and atomization degradation of the protocol specification document.
[0033] Next, we enter the parsing and compilation phase. The specific execution logic of the parsing and compilation module is as follows: The parsing and compilation module receives the atomic reduction text set output by the document preprocessing module. After obtaining the atomic reduction text set, the parsing and compilation module constructs a protocol-specific context-free grammar rule set based on the grammatical features of the KNX protocol. Then, the parsing and compilation module expresses the context-free grammar rule set using Backus normal form to generate a BNF grammar rule base.
[0034] The BNF grammar rule base covers four types of reduction patterns: temporal constraints, state constraints, data constraints, and action constraints. The parsing and compilation modules define the grammar rule expression of the temporal constraint pattern as a sequence structure composed of time preposition marker nodes, duration element nodes, and action sequence nodes concatenated in sequence.
[0035] Meanwhile, the parsing and compilation module defines the grammar rule expression of the state constraint pattern as a sequence structure composed of condition trigger nodes, prerequisite state element nodes, and action sequence nodes concatenated sequentially. The parsing and compilation module defines the grammar rule expression of the data constraint pattern as a sequence structure composed of message field names, comparison operator nodes, and threshold values concatenated sequentially.
[0036] Furthermore, the parsing and compilation modules define the grammar rule expression of the action constraint pattern as a structure containing three logical selection branches. These three logical selection branches include a message sending branch, a state transition branch, and a packet loss branch. The message sending branch contains the message type element, the state transition branch contains the state transition target element, and the packet loss branch contains the element of the dropped data packets.
[0037] After establishing the BNF grammar rule base, the parsing and compilation module calls the recursive descent parser. Subsequently, the recursive descent parser performs syntactic analysis on each atomic reduction text in the atomic reduction text set. Specifically, during execution, the parsing and compilation module traverses the character sequence of the atomic reduction text through the recursive descent parser and matches it with the grammar expressions in the BNF grammar rule base.
[0038] Through grammar matching operations, the parsing and compilation module generates a corresponding abstract syntax tree for each atomic specification text. The abstract syntax tree contains a root node, non-terminal nodes, and leaf nodes. The leaf nodes store the protocol field data and constraint parameters in the atomic specification text. After the construction is completed, the parsing and compilation module outputs the generated abstract syntax tree to the subsequent logical compilation processing stage.
[0039] See attached document Figure 2 In the process of constructing the abstract syntax tree, the specific layer-by-layer parsing operations include: Upon receiving the atomic specification text, the parsing and compilation module calls the recursive descent parser to parse the atomic specification text layer by layer according to the BNF grammar rule library. Through the layer-by-layer parsing operation, the parsing and compilation module maps the atomic specification text into a tree-like logical structure, generating a basic abstract syntax tree. The basic abstract syntax tree contains a root node, non-terminal nodes, and leaf nodes. The root node represents the specification logic, the non-terminal nodes map the branch paths of the grammar rules, and the leaf nodes store the protocol entity data and constraint numerical parameters.
[0040] During the parsing and compilation module's syntax analysis, when the recursive descent parser detects semantic ambiguity in the atomic reduction text, the parsing and compilation module triggers a multi-branch retention mechanism. Semantic ambiguity includes state descriptions without explicit protocol levels and logical combinations with multiple matching paths. To achieve compatibility of multi-branch data structures, the parsing and compilation module introduces an array-type data structure at the ambiguous nodes of the basic abstract syntax tree.
[0041] Based on the array-type data structure described above, the parsing and compilation modules generate multiple parsing branches for text nodes with semantic ambiguity according to the matching items in the BNF grammar rule base, transform them into candidate abstract syntax subtrees, and then aggregate all candidate abstract syntax subtrees to build a candidate syntax subtree pool. The multi-branch abstract syntax tree containing the subtree pool is then recorded in the memory space.
[0042] After completing the recording operation, the parsing and compilation module transmits the multi-branch abstract syntax tree to the formal deduction module. The formal deduction module uses the fact base data to perform logical pre-inference on the candidate syntax subtree pool and outputs consistency verification results. The parsing and compilation module receives the consistency verification results from the formal deduction module. Based on the received verification results, the parsing and compilation module performs pruning operations on the conflicting subtree branches in the candidate syntax subtree pool. The parsing and compilation module retains the candidate abstract syntax subtrees that have passed the consistency verification, thus completing the construction of the target abstract syntax tree.
[0043] See attached document Figure 3 To compile the sequential logic formulas, the parsing and compilation module further performs the following operations: After constructing the target abstract syntax tree, the parsing and compilation module traverses the target abstract syntax tree. Through the traversal operation, the parsing and compilation module identifies the timing constraint nodes in the target abstract syntax tree. The timing constraint nodes include prerequisite triggering event nodes, time threshold nodes, and target response event nodes.
[0044] After the recognition operation is completed, the parsing and compilation module maps the logical relationships in the temporal constraint nodes to linear temporal logic operators. To achieve accurate mapping, the parsing and compilation module extracts the root logical attributes of the temporal constraint nodes and matches the globally effective constraint attributes to global operators. At the same time, the parsing and compilation module reads the constraint values in the time threshold nodes and matches the action execution attributes within the specified time limit to future operators with time window constraints.
[0045] During compilation, the parsing and compilation modules generate linear temporal logic formulas based on the mapped linear temporal logic operators and temporal constraint nodes. The parsing and compilation modules define the prerequisite triggering event nodes as events. Define the time threshold node as a time parameter. Define the target response event node as an event. .
[0046] Based on the defined parameters above, the parsing and compilation module, according to the dependency logic of the protocol specification, converts the node feature parameters into formal mathematical expressions, generating linear time-series logic formulas with time window constraints:
[0047] In the above linear sequential logic formula, Represents a global operator. Representing the future operator, the aforementioned linear temporal logic formula characterizes the event... Time parameters after occurrence within, event This will inevitably happen. After completing the formula transformation of a single specification, the parsing and compilation modules will aggregate all the generated linear sequential logic formulas to generate a set of linear sequential logic formulas. .
[0048] After compilation, the parsing and compilation module will convert the set of linear sequential logic formulas. The set of linear time-series logic formulas is transmitted to the formal deduction module and the test generation module. This is used to support the consistency deduction and protocol state space search operations for subsequent system execution.
[0049] Subsequently, the system enters the deduction and verification phase. The formal deduction module first begins to build the basic fact base, the process of which is as follows: After receiving the abstract syntax tree output by the parsing and compilation module, the formal deduction module parses the domain knowledge data of the KNX protocol. The domain knowledge data includes protocol state definition data, message type hierarchy data, and address space structure data.
[0050] After the parsing operation is completed, the formal inference module calls the Datalog logic programming engine to transform the domain knowledge data into fact data. Subsequently, the formal inference module establishes a basic fact base and persistently stores the transformed fact data in the basic fact base.
[0051] When writing specific execution data, the formal inference module writes state definition facts into the basic fact base. The state definition facts include device connection status, device disconnection status, and device authentication status. To adapt to the inference engine format, the formal inference module maps the state definition facts into univariate predicate expressions, which contain state identifier parameters.
[0052] Meanwhile, the formal deduction module writes message layering facts into the basic fact base based on the network layer of the KNX protocol. The message layering facts define the protocol stack affiliation attributes of application layer messages, transport layer messages, network layer messages, and link layer messages. The formal deduction module maps the message layering facts into binary predicate expressions, which contain message type parameters and protocol layer parameters.
[0053] Similarly, the formal deduction module writes address space facts into the basic fact base. These address space facts define the legal boundaries of device physical addresses and group addresses. After constructing the basic fact data, the formal deduction module extracts logical constraint nodes from the abstract syntax tree. The formal deduction module then transforms these logical constraint nodes into Datalog deduction rules.
[0054] Finally, the formal inference module performs a structured mapping between the basic fact base and the Datalog inference rules. The basic fact base and the Datalog inference rules are used to support the automatic verification system in performing consistent logical inference operations.
[0055] To perform verification without decryption, the formal deduction module further constructs shadow state transition rules: The formal deduction module constructs shadow state transition rules for the KNXDataSecure protocol. The formal deduction module establishes the logical association between the internal encrypted state of the tested KNX device and the external side channel metadata. The external side channel metadata includes unencrypted feature data that can be directly captured in the communication tunnel.
[0056] After clarifying the logical relationships, the formal deduction module extracts the message length variation, the transmit / receive time interval, and the message sequence number as external side-channel metadata. To quantify the external side-channel metadata, the formal deduction module defines the length variation of continuously interacting messages as a parameter. The lower and upper bounds of the legal length change corresponding to the internal safe state transition are defined as parameters. With parameters The continuous interactive message contains the first Step-by-step interaction message and the first Step-by-step interactive message, the length change is the first step. Step-by-step interaction message length and the first The absolute difference in the length of the step-by-step interaction messages.
[0057] Simultaneously, the formal deduction module defines the time interval between sending and receiving consecutive interactive messages as a parameter. The time interval between sending and receiving is the first... Step-by-step interaction message reception timestamp and the first The difference in timestamps between the received interactive messages is used by the formal deduction module to define the time threshold for the state keep-alive or timeout mechanism specified in the protocol as a parameter. The formal inference module will be the first The message sequence number captured by the step interaction is defined as a parameter. , will the The message sequence number captured by the step interaction is defined as a parameter. .
[0058] Regarding the state parameter settings, the formal deduction module will perform a formal deduction of the KNX device under test at the [number]th [period]. The internal security state during step interaction is defined as a state parameter. The formal inference module will test the KNX device in the first... The internal security state during step interaction is defined as a state parameter. .
[0059] By combining the extracted metadata parameters and state parameters, the formal deduction module constructs the shadow state transition rule formula:
[0060] The shadow state transition rule formula indicates that the KNX device under test will transition to the next internal security state if and only if the KNX device under test is in the current internal security state and the changes in physical message length, time interval, and sequence number increment of subsequent captured messages all meet the preset boundary conditions.
[0061] After the shadow state transition rule formula is constructed, the formal deduction module writes the shadow state transition rule formula as a deduction rule into the preset deduction rule set. The shadow state transition rule formula supports the automatic verification system to complete the deduction calculation of the encrypted state transition logic inside the tested KNX device without performing message decryption operation.
[0062] In the consistency deduction and feedback phase, the main execution logic of the formal deduction module is as follows: The formal deduction module loads the basic fact base and the preset deduction rule set. The deduction rule set includes Datalog deduction rules for logical constraint node transformation and shadow state transition rules. After the data is loaded, the formal deduction module calls the built-in Datalog logic programming engine to perform incremental logical deduction operations on the basic fact base and the deduction rule set.
[0063] During the incremental logical deduction operation, the formal deduction module checks the logical consistency within the deduction rule set. The formal deduction module compares different deduction rules to determine whether there are contradictory rules that generate mutually exclusive action requirements for the same protocol scenario. Simultaneously, the formal deduction module identifies redundant rules covered by general rules and detects missing state paths in the protocol state transition graph that lack specification constraints.
[0064] When processing multi-branch natural language data, the formal inference module obtains the multi-branch abstract syntax tree (API) transmitted by the parsing and compilation modules. This API contains a pool of candidate abstract syntax subtrees. The formal inference module then extracts multiple candidate API subtrees from this pool.
[0065] Subsequently, the formal deduction module transforms the extracted candidate abstract syntax subtrees into candidate deduction rules one by one. The formal deduction module then substitutes the candidate deduction rules into the basic fact base to perform logical pre-inference operations. Based on the calculation results of the logical pre-inference operations, the formal deduction module determines whether each candidate deduction rule causes a system logic conflict, that is, whether the pre-inference operations derive mutually exclusive protocol state facts or violate the address space constraints in the basic fact base.
[0066] When a candidate deduction rule causes a system logic conflict, the formal deduction module marks the corresponding candidate abstract syntax subtree as an invalid branch. When a candidate deduction rule does not cause a system logic conflict and passes the deduction verification, the formal deduction module marks the corresponding candidate abstract syntax subtree as a valid branch.
[0067] After completing the pre-inference operations for all candidate inference rules, the formal inference module summarizes the labeled data of all branches and generates a consistency verification result. Next, the formal inference module feeds back the consistency verification result to the parsing and compilation module. The parsing and compilation module removes invalid branches and solidifies valid branches based on the consistency verification result. Finally, the formal inference module writes the detected contradictory rules and missing state paths into the conflict data record, completing the static consistency inference and bidirectional feedback process.
[0068] After the inference process is completed, the test generation module begins to build the Kripke model. The specific process is as follows: After the deduction process is completed, the test generation module receives the consistency verification results and conflict-free protocol list output by the formal deduction module. Combining the conflict-free protocol list, the test generation module extracts the protocol state data of the KNX device under test. The test generation module transforms the protocol state data into a Kripke structural model and uses the Kripke structural model to characterize the logical behavior boundaries of the KNX device under test during the protocol interaction process.
[0069] In the specific model definition phase, the test generation module defines the Kripke structure model as a quintuple structure, and the mathematical logical expression of the quintuple structure is:
[0070] For the parameter setting of the quintuple structure, the test generation module defines the finite set of states as a parameter. Parameters The test generation module has all legal operating states of the KNX device under test at the application layer, transport layer, network layer, and link layer. The initial state set is defined as a parameter. Parameters For a finite set of states A subset of represents the basic connection state of the KNX device under test during a reset operation or power-on startup.
[0071] To determine the state transition logic, the test generation module defines the state transition relation matrix as a parameter. Parameters Record a finite set of states Based on the transition paths between various internal states, the test generation module extracts the stimulus events and response actions from the KNX protocol specification and establishes mapping data between message reception events, timeout events and state transition targets in the state transition relationship matrix.
[0072] Subsequently, the test generation module defines the set of atomic propositions as a parameter. Parameters It contains a basic Boolean expression describing the attributes of the KNX device under test. This basic Boolean expression includes a receive buffer overflow determination condition and a security authentication pass determination condition. The test generation module defines the status flag function as a parameter. The test generation module establishes a finite set of states through a state marking function. With the set of atomic propositions The mapping maps a specific state to a combination of atomic propositions that hold true in the target state.
[0073] After completing the above mapping, the test generation module completes the conversion operation from KNX protocol state data to the Kripke structural model. The test generation module stores the completed Kripke structural model in memory space to support subsequent execution of state space search operations based on linear time-series logic formulas.
[0074] After the build process is complete, the test generation module reads the Kripke structure model from the memory space and obtains the set of linear sequential logic formulas output by the parsing and compilation modules. The test generation module will generate a set of linear sequential logic formulas. As a condition for the attribute to be verified in model search.
[0075] Based on the attributes to be verified, the test generation module invokes a nested depth-first search algorithm to traverse the state space of the Kripke structural model. The test generation module then matches protocol state transition paths within the Kripke structural model's state space that satisfy the attributes to be verified.
[0076] During the model state traversal, the test generation module determines the set of linear sequential logic formulas. The test generation module extracts the successfully matched search paths for each formula in the search path. When the target linear timing logic formula is fully true in the search path, the test generation module extracts the successfully matched search paths and converts them into positive test cases. The positive test cases are used to verify that the KNX device under test correctly implements the specification requirements.
[0077] Corresponding to the positive extraction logic, when the target linear timing logic formula does not hold true on the search path, the test generation module extracts the counterexample path that violates the conditions of the attribute to be verified. The test generation module converts the counterexample path into negative test cases. The negative test cases are used to verify that the KNX device under test has the ability to correctly reject abnormal interactive behavior.
[0078] After completing the model state traversal operation, the test generation module aggregates positive and negative test cases to generate an initial test set. To eliminate redundant test cases, the test generation module calls the differential debugging algorithm to perform state equivalence class pruning on the initial test set.
[0079] During the specific trimming and execution, the test generation module compares each test case in the initial test set based on the principle of protocol state equivalence partitioning. If different test cases trigger the same state transition node sequence in the Kripke structural model and the message parameters belong to the same numerical range, the test generation module determines the corresponding test cases as equivalent test cases. The test generation module removes duplicate test cases that cover the same Kripke model state transition path, so that each remaining test case covers a unique protocol interaction logic path.
[0080] After test case equivalence trimming, the test generation module outputs a minimal set of deduplicated execution sequences. Minimize the set of execution sequences Includes the compiled message sending list, expected response list, and timing constraint parameters. After the data is packaged, the test generation module will minimize the execution sequence set. The data is transmitted to the execution and verification module to provide test case data support for automated conformance testing of physical devices.
[0081] After test cases are issued, the execution and verification module is responsible for capturing dynamic metadata in real time. Its specific workflow is as follows: The execution and verification module receives the minimum set of execution sequences output by the test generation module. After receiving the data, the execution and verification module establishes a network connection with the KNX device under test through the network communication interface of the test terminal. After the connection is established, the execution and verification module builds a communication tunnel between the test terminal and the KNX device under test.
[0082] After the communication tunnel is constructed, the execution and verification module reads the minimized execution sequence set. The execution and verification module then injects test messages into the KNX device under test one by one according to the timing requirements specified in the message sending list. During the injection of test messages, the execution and verification module listens to the communication tunnel and receives response messages returned by the KNX device under test. For the KNX data security protocol environment, the execution and verification module treats the response messages as encrypted messages. In order to maintain the boundary of black-box testing, the execution and verification module does not perform content decryption operations on the encrypted messages.
[0083] Without parsing the encrypted message payload, the execution and verification module performs link-layer feature extraction on the encrypted message. Specifically, the execution and verification module records the timestamp of the encrypted message arriving at the network interface of the test terminal. At the same time, the execution and verification module reads the plaintext header field of the encrypted message according to the additional authentication data structure of the KNX data security protocol to obtain the total message length data and plaintext sequence number data.
[0084] After data extraction is completed, the execution and verification module combines the total message length data, the received timestamp, and the plaintext sequence number data. Through data combination operations, the execution and verification module generates a corresponding multi-dimensional dynamic feature vector for each message interaction action. As the test progresses, the execution and verification module aggregates the multi-dimensional dynamic feature vectors generated by continuous interactions into a multi-dimensional dynamic feature vector set.
[0085]
[0086] In the eigenvector set formula, Characterizing a multidimensional dynamic feature vector set, Characterizing the first The multidimensional dynamic feature vector corresponding to each interactive message Characterizing the first The length of each message Characterizing the first The timestamp of the message Characterizing the first The sequence number of the message. The total number of encrypted messages captured. This is the index number of the interactive message, and It is a positive integer.
[0087] After data aggregation is complete, the execution and verification module will process the multi-dimensional dynamic feature vector set. Multidimensional dynamic feature vector set stored in memory space This provides a data foundation for the subsequent execution of dynamic fact injection and closed-loop constraint solving in the system.
[0088] After obtaining the metadata, the execution and verification module then performs dynamic fact injection and closed-loop constraint solving, which mainly includes the following processes: The execution and verification module extracts the multi-dimensional dynamic feature vector set temporarily stored in memory space. Multidimensional dynamic feature vector set This includes parameters such as the length of the encrypted message, the timestamp, and the sequence number. After extracting these parameters, the execution and verification module will use a multi-dimensional dynamic feature vector set. The data is converted into dynamic logical facts. According to the data format requirements of the logic deduction engine, the execution and verification module maps the dynamic logical facts into dynamic fact predicate expressions.
[0089] After completing the predicate mapping, the execution and verification module injects the dynamic fact predicate expression into the basic fact base built by the formal inference module. Through the injection operation, the execution and verification module establishes a logical relationship between static domain knowledge and dynamic execution data in the basic fact base. The execution and verification module then constructs a closed-loop inference fact base from the fact data set after injecting dynamic logical facts.
[0090] Based on the closed-loop deduction fact library, the execution and verification module loads the preset shadow state transition rule formula. Subsequently, the execution and verification module calls the logic deduction engine to perform closed-loop constraint solving operations. When performing closed-loop constraint solving operations, the execution and verification module substitutes the length parameter, timestamp parameter, and sequence number parameter in the dynamic fact predicate expression into the metadata variables of the shadow state transition rule formula.
[0091] During the constraint solving phase, the execution and verification module calculates the length change of adjacent interactive messages and the transmission and reception time interval based on the substituted parameters. The execution and verification module verifies whether the length change is between the lower and upper bounds of the legal length change. During synchronous execution, the execution and verification module verifies whether the transmission and reception time interval meets the preset time threshold requirements and checks the continuity of the sequence numbers of adjacent interactive messages. Based on this, the execution and verification module infers whether the internal encryption state of the tested KNX device has undergone a legal transition based on the multi-dimensional verification results, and compares and verifies the inferred internal encryption state transition path with the Kripke structure model state transition path output by the test generation module.
[0092] When all dynamic parameters meet the boundary conditions of the shadow state transition rule formula and the comparison verification passes, the execution and verification module determines that the tested KNX device has passed the protocol consistency verification. When there are dynamic parameters that violate the boundary conditions of the shadow state transition rule formula or the comparison verification fails, the execution and verification module determines that the tested KNX device has failed the protocol consistency verification and records the feature vector data that caused the logical conflict as a diagnostic basis. Finally, the execution and verification module outputs a consistency verification report, completing the closed-loop process of automatic protocol consistency verification.
[0093] Finally, the report generation and traceability phase begins. The main operations of the execution and verification module include: After completing the dynamic fact injection and closed-loop constraint solving operations, the execution and verification module collects the state determination results and feature vector data that cause logical conflicts during the closed-loop deduction process. Simultaneously, the execution and verification module acquires the full interaction message logs and underlying physical execution records of the KNX device under test during the test period.
[0094] Based on the collected data and logs, the execution and verification module establishes an audit tracing chain. Specifically, during tracing, the execution and verification module extracts the test case numbers corresponding to the state judgment results. To achieve precise binding between the underlying data and the logical model, the execution and verification module uses the timestamp and sequence number parameters from the feature vector data to index and match the full set of interactive message logs. Subsequently, the execution and verification module maps the underlying physical execution records to the state transition path of the Kripke structural model constructed by the test generation module.
[0095] After completing the model path mapping, the execution and verification module traces the state transition path of the Kripke structural model upwards, associating it with the abstract syntax tree node generated by the parsing and compilation module. Next, the execution and verification module extracts the protocol field data carried by the abstract syntax tree node and further maps this data to the atomic specification text output by the document preprocessing module. Through these hierarchical data association operations, the execution and verification module constructs a complete audit and traceability chain from the underlying physical communication messages to the top-level natural language specification text.
[0096] After the traceability chain is constructed, the execution and verification module will structure and encapsulate the audit traceability chain, status determination results, and feature vector data that cause logical conflicts to generate a formal verification report. The formal verification report includes the protocol consistency conclusion of the tested KNX device, the timestamp of the abnormal state occurrence, and the specific terms of the agreement violated by the device. After the data encapsulation is completed, the execution and verification module will output the formal verification report to an external storage device or display terminal to provide structured evidence support data for the network communication protocol consistency review.
[0097] Figure 4 A flowchart illustrating an automatic KNX protocol consistency verification method based on neural symbolic reasoning provided by this invention is shown below. Figure 4 As shown, the method may include the following steps: Step S1: Receive the KNX protocol specification document, extract the text data from it and degrade it to generate atomic specification text; Step S2: Parse the atomic reduction text to generate an abstract syntax tree, extract the constraint nodes in the abstract syntax tree and compile them into temporal logic formulas; Step S3: Transform the abstract syntax tree into deduction rules, construct the basic fact set and state transition rules, and perform formal deduction according to the deduction rules to output the consistency verification results and the list of conflict-free specifications. Step S4: When the consistency verification result passes, construct a protocol state transition structure representing the KNX device under test based on the list of conflict-free protocols, and perform state space search in the protocol state transition structure using the timing logic formula to generate a test set. Step S5: Send message interaction sequence to the KNX device under test according to the test set and receive response data, extract dynamic features and inject them into the basic fact set to perform closed-loop constraint solution, and generate a formal verification report based on the solution results.
[0098] In one embodiment of the present invention, a detailed description of steps S1 to S5 can be found in the detailed description in the above embodiment, and will not be repeated here.
[0099] Combined with appendix Figure 1 With appendix Figure 4In reviewing the overall architecture, this KNX protocol conformance automatic verification system consists of various modules working together, and its complete automated verification closed loop can be summarized as follows: When the system receives a verification task, the document preprocessing module receives the input data, performs text extraction and noise reduction operations on the input data, degrades the standardized document, and outputs an atomic reduction text set.
[0100] After obtaining the atomic reduction text set, the parsing and compilation module constructs the corresponding grammar rule base. The parsing and compilation module generates a multi-branch abstract syntax tree based on the grammar rule base and outputs the protocol logic mapping as a set of linear time-series logic formulas.
[0101] Next, the formal deduction module receives the multi-branch abstract syntax tree output by the parsing and compilation module. The formal deduction module transforms the domain knowledge data of the protocol into logical fact data, performs consistency deduction operations in the basic fact base, and feeds back the verification results of the tree branches to the parsing and compilation module.
[0102] After the simulation and verification are completed, the test generation module extracts the consistency verification results. The test generation module uses the protocol state data to construct a Kripke structure model. Based on the attribute conditions of the linear time-series logic formula set, the test generation module performs a space search in the Kripke structure model and outputs the set of minimal execution sequences.
[0103] After the minimal execution sequence set is generated, the execution and verification module extracts the set and injects test messages into the KNX device under test according to the timing requirements. After the interaction is completed, the execution and verification module collects the physical execution records of the device and traces back to generate a formal verification report containing protocol consistency conclusions.
[0104] See attached document Figure 5 To support the physical operation of the aforementioned verification system, this embodiment also relates to an electronic device, whose hardware architecture mainly includes: a processor, a memory, a communication interface, and a communication bus. The processor, memory, and communication interface establish a communication connection through the communication bus. The memory stores computer program instructions. The processor reads the computer program instructions from the memory and, in conjunction with the external data transmission and reception capabilities of the communication interface, executes the various data calculation and logical judgment steps of the KNX protocol conformance automatic verification method in the aforementioned embodiment.
[0105] Furthermore, this embodiment also provides a non-volatile computer-readable storage medium as a carrier for instructions and data storage. This medium is pre-written with computer-executable code; when the processor loads and runs the computer-executable code, the entire information processing flow, from low-level data preprocessing to the generation of the top-level verification report, can be completed.
[0106] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. An automatic KNX protocol consistency verification method based on neural symbolic reasoning, characterized in that, Includes the following steps: Step S1: Receive the KNX protocol specification document, extract the text data from it and degrade it to generate atomic specification text; Step S2: Parse the atomic reduction text to generate an abstract syntax tree, and extract the constraint nodes in the abstract syntax tree to compile them into temporal logic formulas; Step S3: Transform the abstract syntax tree into deduction rules, construct a set of basic facts and state transition rules, and perform formal deduction according to the deduction rules to output consistency verification results and a list of conflict-free specifications; Step S4: When the consistency verification result passes, construct a protocol state transition structure representing the KNX device under test based on the conflict-free protocol list, and perform a state space search in the protocol state transition structure using the timing logic formula to generate a test set. Step S5: Send message interaction sequence to the KNX device under test according to the test set and receive response data, extract dynamic features and inject them into the basic fact set to perform closed-loop constraint solution, and generate a formal verification report based on the solution results.
2. The automatic KNX protocol consistency verification method based on neural symbolic reasoning according to claim 1, characterized in that, Step S1 specifically includes: Obtain the full text of the KNX protocol specification document, and perform noise reduction and special character normalization replacement operations on the full text to generate plain text; According to the protocol specification numbering rules, the paragraph start positions in the plain text are matched, the plain text is divided into independent complex contract entries, and all the complex contract entries are aggregated to generate a complex contract set; A preset syntactic degradation algorithm is invoked to segment the complex contract entries containing multiple constraints in the complex contract set, thereby degrading the complex sentence with multiple temporal and data constraints into independent atomic contract texts containing only a single-dimensional protocol constraint.
3. The automatic KNX protocol consistency verification method based on neural symbolic reasoning according to claim 1, characterized in that, In step S2, the step of parsing the atomic reduction text to generate an abstract syntax tree specifically includes: A context-free grammar is constructed and expressed using Backus normal form to generate a set of BNF grammar rules containing four types of reduction patterns: temporal constraints, state constraints, data constraints, and action constraints. The recursive descent parsing algorithm is invoked to traverse the character sequence of the atomic reduction text to match the grammatical expressions in the BNF grammar rule set, generating a basic abstract syntax tree; An array-type data structure is introduced at the ambiguous nodes where there is semantic ambiguity in the basic abstract syntax tree to generate a multi-branch abstract syntax tree containing a set of candidate syntax subtrees. Logical pre-inference operations are performed on the set of candidate syntax subtrees to eliminate conflicting subtree branches, and the verified candidate abstract syntax subtrees are retained to generate the abstract syntax tree.
4. The automatic KNX protocol consistency verification method based on neural symbolic reasoning according to claim 1, characterized in that, In step S2, extracting the constraint nodes from the abstract syntax tree and compiling them into temporal logic formulas specifically includes: Extract the timing constraint nodes from the abstract syntax tree. The timing constraint nodes include prerequisite triggering event nodes, time threshold nodes, and target response event nodes. The logical relationships in the time-series constraint nodes are mapped to linear time-series logic operators, the root logical attributes of the time-series constraint nodes are extracted and matched as global operators, and the constraint values in the time threshold nodes are read and matched as future operators with time window constraints. According to the dependency logic of the protocol specification, a linear timing logic formula with time window constraints is generated as the timing logic formula. The timing logic formula indicates that the target response event node will necessarily occur after the occurrence of the premise triggering event node and within the time parameter limited by the time threshold node.
5. The automatic KNX protocol consistency verification method based on neural symbolic reasoning according to claim 1, characterized in that, Step S3 specifically includes: Establish a logical association between the internal encryption state of the KNX device under test and the external side channel metadata, and extract the length change, transmission and reception time interval, and message sequence number of the continuous interaction messages as the external side channel metadata; Combining the extracted external side channel metadata with the internal encryption state, a shadow state transition rule formula is constructed. The shadow state transition rule formula represents that the KNX device under test transitions to the next internal security state if and only if the KNX device under test is in the current internal security state and the length change, the transmission and reception time interval, and the increment of the message sequence number of the subsequently captured physical messages all meet the preset boundary conditions.
6. The automatic KNX protocol consistency verification method based on neural symbolic reasoning according to claim 1, characterized in that, In step S4, constructing the protocol state transition structure representing the KNX device under test based on the conflict-free protocol list specifically includes: Extract the protocol state data of the KNX device under test, and convert the protocol state data into a Kripke structure as the protocol state transition structure. The Kripke structure is defined as a quintuple structure, which includes a finite set of states, an initial set of states, a state transition relation matrix, a set of atomic propositions, and a state labeling function. The finite state set contains all the legal working states of the KNX device under test. The initial state set is a subset of the finite state set and represents the basic connection state. The state transition relation matrix records the jump paths between the states within the finite state set. The atomic proposition set contains the basic Boolean expressions describing the attributes of the KNX device under test. The state labeling function establishes the mapping between the finite state set and the atomic proposition set.
7. The automatic KNX protocol consistency verification method based on neural symbolic reasoning according to claim 6, characterized in that, In step S4, the step of performing a state space search in the protocol state transition structure using the timing logic formula to generate a test set specifically includes: The time-series logic formula is used as the attribute condition to be verified. The nested depth-first search algorithm is called to match the protocol state transition path that satisfies the attribute condition to be verified in the state space of the Kripke structure. The successfully matched search path is converted into a positive test case, and the counterexample path that violates the attribute condition to be verified is converted into a negative test case. The two paths are then aggregated to generate an initial test set. The differential debugging algorithm is invoked to perform state equivalence class pruning on the initial test set, eliminating duplicate test cases that cover the same protocol state transition path, and outputting a set of minimal execution sequences consisting of the deduplicated minimal execution sequences as the test set.
8. The automatic KNX protocol consistency verification method based on neural symbolic reasoning according to claim 1, characterized in that, In step S5, the process of sending message interaction sequences to the KNX device under test based on the test set and receiving response data, extracting dynamic features and injecting them into the basic fact set to perform closed-loop constraint solving, and generating a formal verification report based on the solution results, specifically includes: Test messages are injected into the KNX device under test, and the encrypted message is subjected to link layer feature extraction without parsing the encrypted message data payload. The receiving timestamp is recorded and the plaintext header field is read to obtain the total message length data and plaintext sequence number data. The data is aggregated to generate a multi-dimensional dynamic feature vector set as the dynamic feature. The multidimensional dynamic feature vector set is converted into a dynamic fact predicate expression and injected into the basic fact set to construct a closed-loop inference fact set; The logical deduction algorithm is invoked to substitute the parameters in the dynamic fact predicate expression into the metadata variables of the state transition rule to perform closed-loop constraint solving operations, deducing the internal encrypted state transition path of the tested KNX device and comparing it with the state transition path of the protocol state transition structure. Based on the comparison verification results and the collected multidimensional dynamic feature vector set, the formal verification report is generated.
9. The automatic KNX protocol consistency verification method based on neural symbolic reasoning according to claim 8, characterized in that, Before generating the formal verification report in step S5, the process of constructing the audit traceability chain also includes: Extract the test case number corresponding to the state determination result, use the timestamp parameter and sequence number parameter in the multi-dimensional dynamic feature vector set to index and match the full number of interactive message records, and map the underlying physical execution record to the state transition path of the protocol state transition structure; The state transition path of the protocol state transition structure is traced upwards to the abstract syntax tree node, and the protocol field data carried by the abstract syntax tree node is extracted and mapped to the corresponding atomic specification text, thereby constructing a full-link audit traceability chain from the underlying physical communication message to the top-level natural language specification text and encapsulating it into the formal verification report.
10. An automatic KNX protocol consistency verification system based on neural symbolic reasoning, characterized in that, include: The system includes a processor, a memory, a communication interface, and a communication bus. The memory is pre-written with computer program instructions. The processor reads these computer program instructions from the memory and, in conjunction with the external data transmission and reception capabilities of the communication interface, executes the following: The document preprocessing module is used to receive the KNX protocol specification document, extract the text data from it, degrade it, and generate atomic specification text. The parsing and compilation module is used to parse the atomic reduction text to generate an abstract syntax tree, extract the constraint nodes in the abstract syntax tree, and compile them into temporal logic formulas. The formal deduction module is used to transform the abstract syntax tree into deduction rules, construct a set of basic facts and state transition rules, perform formal deduction according to the deduction rules, and output consistency verification results and a list of conflict-free specifications. The test generation module is used to construct a protocol state transition structure representing the KNX device under test based on the conflict-free protocol list when the consistency verification result passes, and to perform a state space search in the protocol state transition structure using the timing logic formula to generate a test set. The execution and verification module is used to send message interaction sequences to the KNX device under test according to the test set and receive response data, extract dynamic features and inject them into the basic fact set to perform closed-loop constraint solving, and generate a formal verification report based on the solution results.
