A fault injection diagnostic method and system for bus communication
Patent Information
- Application Number
- CN202611398722.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-10
- Publication Date
- 2026-10-13
AI Technical Summary
[0004]本发明提供一种用于总线通信的故障注入诊断方法及系统,解决相关技术中多段总线通信网络中仲裁竞争态下跨段故障传播路径难以被有效检测和诊断的技术问题
本发明通过实时检测并发竞争深度和标识符分歧位生成仲裁关键位加权图,将故障注入精确指向对仲裁决策具有决定性作用的比特位,从而覆盖了现有方法无法覆盖的仲裁竞争态下特有故障模式。通过在注入前依据网关转换规则预计算变异后仲裁胜出标识符的跨段路由结果,使仲裁边界变异注入计划集合携带跨段路由偏差预测标签,实现了仲裁竞争态故障注入与跨网关传播追踪的联动。通过四层比对逐层区分仲裁段本地偏移、网关路由偏差、下游级联异常和跨域误导路由四类故障层次,能够揭示仲裁身份篡改经网关路由逻辑传播为跨域级联故障的完整传播路径。上述处理方式克服了现有方法中跨网关故障注入忽略竞争态工况与竞争态故障注入忽略跨网关传播效应两个独立缺陷叠加所产生的诊断盲区。
Smart Images

Figure CN122909165A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of bus communication fault diagnosis technology, and specifically to a fault injection diagnosis method and system for bus communication. Background Technology
[0002] In a multi-segment bus communication system, multiple bus segments are interconnected through gateway nodes. The gateway node performs routing decisions based on message identifiers, forwarding source bus segment messages to the target bus segment after protocol conversion. When multiple nodes are simultaneously in arbitration transmission mode, the level of each bit in the arbitration segment is determined by the bit-by-bit superposition of the node identifiers. If a boundary flip occurs in the critical bit of the arbitration decision, it may change the identity of the arbitration winner, causing messages from lower-priority nodes to reach the gateway and triggering unexpected routing paths.
[0003] Existing fault injection diagnostic methods have the following drawbacks: First, cross-gateway fault injection does not distinguish between single-node transmission and multi-node contention scenarios, failing to cover the high-risk fault modes unique to arbitration contention states. Second, fault injection for arbitration contention states only observes the arbitration result and error counter changes within the source bus segment, neglecting to track the cross-segment cascading propagation effect caused by tampering with the arbitration identity via gateway routing. These two shortcomings combined result in the inability to diagnose cross-domain cascading fault modes amplified by gateway routing under arbitration contention states. Summary of the Invention
[0004] This invention provides a fault injection diagnosis method and system for bus communication, which solves the technical problem in related technologies that it is difficult to effectively detect and diagnose cross-segment fault propagation paths under arbitration competition conditions in multi-segment bus communication networks.
[0005] This invention discloses a fault injection diagnosis method for bus communication, comprising the following steps: Parse the topology configuration data of the multi-segment bus communication network, extract the message routing table and protocol field mapping rules of the gateway node, and generate a multi-segment protocol constraint model; Real-time acquisition of physical layer bit streams from source bus segments. When multiple nodes are detected to be in the transmitting state simultaneously, the concurrent contention depth is calculated. Bitwise XOR operation is performed on the identifiers of each competing node to identify the divergence bits in the arbitration segment. The arbitration influence weights are assigned in decreasing order according to the order in which the divergence bits appear, and an arbitration key bit weighted map is generated. Based on the value domain boundary of each divergence bit in the weighted graph of arbitration key bits, perform boundary value analysis to generate a set of arbitration segment boundary variations. Substitute the arbitration winner identifier corresponding to each variation into the gateway conversion rule to pre-calculate the cross-segment routing result, label the cross-segment routing deviation prediction label, and form a set of arbitration boundary variation injection plans. Within the target arbitration window, bus level forced overwrite is performed in order of weight priority, and response data from the source bus segment, gateway, and downstream bus segment are collected simultaneously to form a cross-segment mutation propagation record set of arbitration competition state; A four-layer comparison analysis is performed on the record set to mark arbitration offset anomalies, gateway routing deviations, downstream cascading anomalies, and cross-domain misdirection events, and a fault injection diagnostic report is generated.
[0006] Furthermore, the step of performing a bitwise XOR operation on each competing node identifier to identify the divergence bit in the arbitration segment includes: assuming that there are divergence bits in the current arbitration window. There are 1 competing node, and the message identifiers of each competing node are as follows: For all Perform a bitwise XOR operation on each node pair, the first node... The node and the first The XOR result of the nodes is ,in For bitwise XOR operation; it will select all... Perform a bitwise OR operation to obtain the divergence bitmask. ,in For bitwise OR operation, The bits with a median value of 1 are the bits in the arbitration segment where there is disagreement.
[0007] Furthermore, assigning decreasing arbitration influence weights according to the order in which the divergence bits appear includes: masking the divergence bits. The bits with a median value of 1 are arranged in order from the most significant bit to the least significant bit. ,in For the total number of divergent positions; for the th Disagreement position Assign weight values ,in The value range is 1 to The arbitration key weighted diagram consists of the position of each divergence point and its corresponding weight value.
[0008] Furthermore, the boundary value analysis includes: for each divergence bit in the weighted graph of arbitration key bits, determining the original level value of the bit in the current correct arbitration winner identifier, and generating a variant identifier after flipping the bit; determining whether the flipped variant identifier has a matching item among all competing node identifiers, and when a matching item exists, changing the arbitration winner corresponding to the variant to the matching node, and when no matching item exists, the variant identifier is an illegal identifier; for cases containing multiple divergence bits, generating a multi-bit joint flip variant according to the combination of divergence bits; the arbitration segment boundary variant set includes all unit flip variants and multi-bit joint flip variants.
[0009] Furthermore, the cross-segment routing deviation prediction label includes three types: a routing consistency label, indicating that the routing target of the mutated arbitration winner identifier after gateway conversion is the same as the routing target of the correct arbitration result; a routing bias label, indicating that the mutated arbitration winner identifier is routed to a downstream bus segment different from the correct arbitration result after gateway conversion; and a routing drop label, indicating that the mutated arbitration winner identifier does not have a matching entry in the gateway routing table.
[0010] Further, the four-layer comparison analysis includes: performing a first-layer comparison, comparing the actual arbitration winner node with the expected winner node without faults, and marking it as an arbitration offset anomaly when the two are inconsistent; performing a second-layer comparison, comparing the actual forwarded packet content of the gateway with the theoretical forwarding value pre-calculated based on the correct arbitration result, and marking it as a gateway routing deviation when they are inconsistent; performing a third-layer comparison, comparing the actual processing behavior of the downstream node with the expected behavior of the target end protocol for the actual forwarded packet of the gateway, and marking it as a downstream cascading anomaly when they are inconsistent; and performing a fourth-layer comparison, among the records that simultaneously have arbitration offset anomaly and gateway routing deviation markings, identifying records where the gateway's actual forwarding target segment identifier and the forwarding target segment identifier pre-calculated based on the correct arbitration result point to different downstream bus segments, and marking them as cross-domain misdirection events.
[0011] Furthermore, the generation of the fault injection diagnostic report includes: performing two-dimensional grouping and aggregation of all records marked as abnormal based on the concurrency contention depth and arbitration key position; and calculating the arbitration offset rate for each group. Gateway routing deviation rate Downstream cascade anomaly rate Cross-domain misdirection rate ,in This represents the total number of records within the group. This represents the number of arbitration offset anomaly records. The number of gateway routing deviation records. This represents the number of downstream cascading anomaly records. The system records the number of cross-domain misdirection events and outputs a fault injection diagnostic report. The diagnostic report includes a risk degree matrix of cascaded propagation of arbitration key bits with row indexing based on concurrency contention depth and column indexing based on arbitration key bit position, a list of cross-gateway misdirection paths, and the range of downstream affected nodes.
[0012] Furthermore, it also includes: the cross-domain misdirection rate in the risk degree matrix of cascading propagation of arbitration key bits. For groups exceeding a preset threshold, backtrack the injection item in the corresponding arbitration boundary variation injection plan set, extract the cross-segment routing deviation prediction label of the injection item, and verify the consistency of the cross-segment routing deviation prediction label with the actual observed four-layer comparison results; when the two are consistent, it is confirmed that the propagation path of the failure mode has been accurately predicted; when the two are inconsistent, the group is marked as an unexpected failure mode.
[0013] Furthermore, when it is detected that only one node is in the transmitting state, the generation process of the arbitration key bit weighted graph is skipped; each injection item in the arbitration boundary mutation injection plan set is arranged in descending order according to the arbitration influence weight value; the acquisition clocks of the source bus segment, the gateway end and the downstream bus segment are calibrated through the network time synchronization protocol, and the timestamp deviation of each acquisition point is controlled within the duration of a single bit.
[0014] This invention discloses a fault injection diagnostic system for bus communication, used to perform the aforementioned fault injection diagnostic method for bus communication, comprising: The protocol constraint parsing module is used to obtain the topology configuration data of the multi-segment bus communication network, parse the protocol frame format specifications of each bus segment, extract the message routing table and protocol field mapping rules of the gateway node, obtain the message identifier allocation list of each node, and generate a multi-segment protocol constraint model. The arbitration contention detection module is used to collect the physical layer bit stream of the source bus segment in real time, monitor the status of the send request signal line of each node, detect the concurrent contention state, count the concurrent contention depth, perform bitwise XOR operation on the identifier of each competing node, and generate a weighted map of arbitration key bits. The mutation injection plan generation module is used to perform boundary value analysis based on the weighted graph of arbitration key bits, generate a set of arbitration segment boundary mutations, substitute the arbitration winner identifier corresponding to each mutation into the gateway conversion rule to pre-calculate the cross-segment routing result, and form a set of arbitration boundary mutation injection plans with cross-segment routing deviation prediction labels. The multi-segment synchronous acquisition and injection execution module is used to perform bus level forced overwrite within the target arbitration window, synchronously acquire response data from the source bus segment, gateway end, and downstream bus segment, and uniformly associate each acquired data according to the contention depth, injection key bit position, and gateway forwarding path to form an arbitration contention state cross-segment mutation propagation record set; The four-layer comparison and analysis module is used to perform arbitration offset comparison, gateway routing deviation comparison, downstream cascade anomaly comparison, and cross-domain misleading routing identification on the arbitration competition state cross-segment mutation propagation record set, and to mark anomalies at each layer. The diagnostic report generation module is used to perform two-dimensional grouping and aggregation of marked abnormal records according to the concurrency competition depth and arbitration key position, calculate the abnormality ratio of each group, identify high-risk areas, and output a fault injection diagnostic report containing an arbitration key cascade propagation risk degree matrix, a list of cross-gateway misleading routing paths, and the range of affected nodes.
[0015] The beneficial effects of this invention are as follows: This invention generates a weighted map of key arbitration bits by real-time detection of concurrent contention depth and identifier divergence, precisely targeting the bits that are decisive for arbitration decisions through fault injection. This covers fault modes unique to arbitration contention states that cannot be covered by existing methods. By pre-calculating the cross-segment routing results of the mutated arbitration winner identifier according to gateway conversion rules before injection, the arbitration boundary mutation injection plan set carries a cross-segment routing deviation prediction label, realizing the linkage between arbitration contention state fault injection and cross-gateway propagation tracing. By comparing four layers to distinguish four types of fault levels—arbitration segment local offset, gateway routing deviation, downstream cascading anomaly, and cross-domain misleading routing—it can reveal the complete propagation path of arbitration identity tampering propagating into cross-domain cascading faults via gateway routing logic. The above processing method overcomes the diagnostic blind spot caused by the superposition of two independent defects in existing methods: cross-gateway fault injection ignoring contention state conditions and contention state fault injection ignoring cross-gateway propagation effects. Attached Figure Description
[0016] Figure 1 This is a flowchart of a fault injection diagnosis method for bus communication provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the arbitration key bit weight distribution (divergence bit weighting diagram) provided in an embodiment of the present invention; Figure 3 This is a schematic diagram showing the comparison between injection plan weights and routing deviation prediction labels provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the multi-segment synchronous acquisition response status of injection item 1 provided in an embodiment of the present invention; Figure 5 This is a schematic diagram illustrating the number of abnormal markers for each injection item in a four-layer comparison analysis provided in this embodiment of the invention; Figure 6 This is a heatmap of the cross-domain misdirection rate matrix provided in an embodiment of the present invention. A schematic diagram of ( ); Figure 7 This is a schematic diagram comparing the cross-domain misdirection rates of each injected bit under contention depths N=2 and N=3, provided in an embodiment of the present invention. Figure 8 This is a schematic diagram of the scatter distribution of the weight values of each injected bit and the cross-domain misdirection rate provided in the embodiments of the present invention; Figure 9 This is a schematic diagram of the routing status distribution of each source node in the gateway routing table provided in an embodiment of the present invention. Detailed Implementation
[0017] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and implement the subject matter described herein, and changes may be made to the function and arrangement of the elements discussed without departing from the scope of this specification. Various processes or components may be omitted, substituted, or added as needed in the examples. Furthermore, some features described in the examples may be combined in other examples.
[0018] At least one embodiment of the present invention discloses a fault injection diagnosis method for bus communication, see [link to relevant documentation]. Figure 1 This includes the following steps: Step 1: Parse the multi-segment bus communication network configuration and generate a multi-segment protocol constraint model: The topology configuration data of the multi-segment bus communication network is obtained, the protocol frame format specifications of each bus segment are parsed, and the message routing table and protocol field mapping rules of the gateway node are extracted. Simultaneously, the message identifier allocation list of each node on each bus segment is obtained. Based on the above data, a multi-segment protocol constraint model is generated. The multi-segment protocol constraint model includes field constraint rules for each segment, gateway translation rules, and node identifier routing relationships.
[0019] It should be noted that the field constraint rules for each segment refer to the constraint definitions of the bit width, value range, and encoding method of each field in the protocol frame format adopted by each bus segment. For example, when the source bus segment uses the CAN protocol, its arbitration segment identifier field is 11 bits or 29 bits, and the data length code field is 4 bits with a value range of 0 to 8. Gateway conversion rules refer to the mapping definition by which the gateway node re-encodes and rearranges the identifier and data fields of the source bus segment message according to the protocol format of the target bus segment. Node identifier routing relationships refer to the correspondence between the message identifiers of each node and the entries in the gateway routing table. Node identifier routing relationships define which target bus segment each identifier is forwarded to after passing through the gateway.
[0020] Step 2: Detect concurrent competition and generate a weighted graph of arbitration key bits: The system acquires the physical layer bitstream of the source bus segment in real time and monitors the status of the transmit request signal lines of each node in parallel. When multiple nodes are detected to be in transmit mode simultaneously, the concurrent contention depth is calculated, and the message identifier of each competing node is extracted. A bitwise XOR operation is performed on the identifiers of each competing node to identify the positions of the divergent bits in the arbitration segment. The arbitration influence weights are assigned in decreasing order of appearance of the divergent bits to generate a weighted map of arbitration key bits.
[0021] It should be noted that concurrency contention depth refers to the number of nodes simultaneously in the sending state within the same arbitration window. For example, when three nodes simultaneously initiate sending requests, the concurrency contention depth is 3.
[0022] It should be noted that the specific process of the bitwise XOR operation described above is as follows: Assume that there are currently two XOR operations within the arbitration window. There are 1 competing nodes, among which To determine the concurrency contention depth, the message identifiers for each competing node are as follows: ,in For the first The message identifier of each competing node. The value range is 1 to For all Each node performs a bitwise XOR operation, where From The number of combinations of selecting 2 nodes from nodes. For the th node... The node and the first The XOR result of the nodes is: ,in For the first The node and the first The result of XORing the identifiers of each node. This is the bitwise XOR operator. It selects all... Perform a bitwise OR operation to obtain the divergence bitmask. ,in For the divergence mask, This is the bitwise OR operator. The bits with a median value of 1 are the bits in the arbitration segment where there is disagreement.
[0023] It should be noted that the above-mentioned arbitration influence weighting is assigned as follows: in the arbitration segment, the bits are sent in order from the most significant bit to the least significant bit, and the earlier the divergence bit appears, the greater its decisive influence on the arbitration result. Let's define a divergence bit mask. The bits with a median value of 1 are arranged in order from the most significant bit to the least significant bit. ,in The total number of divergent positions. The first point of contention to be arbitrated. For the first The first divergence point. For the first... Disagreement position Assign weight values ,in For the first The arbitration impact weight value for each divergence position This is the sequence number of the divergence position in the above arrangement. The value range is 1 to The arbitration key bit weighted diagram consists of the bit position of each divergence bit and its corresponding weight value.
[0024] In this embodiment, to avoid performing unnecessary arbitration competition analysis in a single-node transmitting state, step 2 skips the generation process of the arbitration key bit weighted graph and directly enters the conventional single-node fault injection process when it is detected that only one node is in the transmitting state. This approach uses arbitration competition state detection as a prerequisite for subsequent steps, reducing computational overhead in non-competitive conditions.
[0025] Step 3: Generate a set of arbitration boundary mutation injection plans with cross-segment route deviation prediction labels: Based on the value range boundaries of each arbitration decision key bit in the weighted graph of arbitration key bits, boundary value analysis is performed to generate a set of arbitration segment boundary variations. The arbitration winner identifier corresponding to each variation is substituted into the gateway transformation rule to pre-calculate the message identifier and routing decision result in the target bus segment after gateway transformation. It is then labeled whether the pre-calculated routing target is consistent with the routing target of the correct arbitration result, whether it leads to routing to an unexpected downstream segment, or whether it triggers a routing table mismatch anomaly. This results in a set of arbitration boundary variation injection plans with cross-segment routing deviation prediction labels.
[0026] It should be noted that the specific process of the boundary value analysis described above is as follows: for each divergence point in the weighted graph of the arbitration key points... The original level value of the bit in the current correct arbitration winner identifier is determined. A variant identifier with the bit flipped is generated, and it is determined whether the flipped variant identifier has a match among all competing node identifiers. If a match exists, the arbitration winner corresponding to the variant is changed to the matching node. If no match exists, the variant identifier is an illegal identifier that does not belong to any node. For cases involving multiple divergent bits, a multi-bit joint flip variant is generated based on the combination of divergent bits. The arbitration segment boundary variant set contains all the above-mentioned single-bit flip variants and multi-bit joint flip variants.
[0027] It should be noted that the aforementioned cross-segment route deviation prediction labels include three types: route consistency label, indicating that the route destination of the mutated arbitration winner identifier after gateway translation is the same as the route destination of the correct arbitration result; route bias label, indicating that the mutated arbitration winner identifier is routed to a different downstream bus segment than the correct arbitration result after gateway translation; and route discard label, indicating that the mutated arbitration winner identifier does not have a matching entry in the gateway routing table, and the gateway will perform discard processing or default exception processing.
[0028] In this embodiment of the application, in order to improve the efficiency of injection execution, each injection item in the set of arbitration boundary variation injection plans is weighted according to the arbitration impact value. Sort the injections in descending order. Injections with higher weight values are placed first, ensuring that within the limited arbitration window, the mutation injections that have the greatest impact on the arbitration result are executed first.
[0029] Step 4: Perform mutation injection and collect multiple response data segments within the arbitration window: Within the arbitration window where the target concurrent contention depth is detected, injection items are selected from the arbitration boundary mutation injection plan set according to the weight priority order of the arbitration key bit weighted graph, and a forced bus level overwrite is performed. Simultaneously, the following three sets of data are collected: At the source bus segment, the actual arbitration winner node identifier and the error counter changes of each competing node are collected; at the gateway, the actual forwarded message identifier, forwarding target segment identifier, and forwarding decision status are collected; and at all downstream bus segments, the receiving and processing behavior data of each node at the target end are collected. All collected data are uniformly correlated according to contention depth, injection key bit position, and gateway forwarding path to form a cross-segment mutation propagation record set for arbitration contention state.
[0030] It should be noted that the aforementioned forced bus level overwrite refers to the fault injection diagnostic device forcibly driving the bus level to a logic value opposite to the current actual superimposed level through the physical layer interface at a specific bit transmission moment in the arbitration segment. For the CAN bus, the dominant level is logic 0, and the recessive level is logic 1. When it is necessary to flip a bit from recessive to dominant, the fault injection diagnostic device outputs a dominant drive signal; when it is necessary to flip from dominant to recessive, the fault injection diagnostic device releases the bus and injects a recessive bias current at that bit moment.
[0031] It should be noted that the above-mentioned receiving and processing behavior data includes the reception confirmation status of each node at the target end for the gateway forwarding the message, the message identifier filtering result, the data payload parsing status, and the application layer response action.
[0032] In this embodiment, to ensure the time alignment accuracy of the acquired data, the acquisition clocks of the source bus segment, gateway, and downstream bus segment are calibrated using a network time synchronization protocol in step 4, and the timestamp deviation of each acquisition point is controlled within the duration of a single bit. This processing method ensures the accuracy of determining the causal order of events when associating cross-segment data.
[0033] Step 5: Perform a four-level comparison analysis and mark anomalies at each level: A four-level comparison analysis was performed on the record set of cross-segment variation propagation in the arbitration competition state.
[0034] Step 5 may specifically include: Step 501: Perform the first-level comparison: Compare the actual arbitration winner node with the expected winner node without faults. If the two are inconsistent, mark the record as having an arbitration offset anomaly. The expected winner node without faults is determined based on the arbitration priority rules of the identifiers of each competing node, that is, the node with the smallest identifier value is the expected winner node.
[0035] Step 502: Perform the second-layer comparison: Compare the actual forwarded packet content of the gateway with the theoretical forwarding value pre-calculated based on the correct arbitration result. The theoretical forwarding value is calculated by substituting the identifier of the expected winner node without faults into the gateway's conversion rules. When the packet identifier or forwarding target segment identifier actually forwarded by the gateway is inconsistent with the theoretical forwarding value, the record is marked as a gateway routing deviation.
[0036] Step 503: Perform the third-layer comparison: Compare the actual processing behavior of the downstream node with the expected behavior of the target protocol for the gateway's actual forwarding of packets. The expected behavior is obtained by querying the node identifier filtering configuration of the target bus segment based on the identifier of the actual forwarded packet by the gateway. When the actual reception acknowledgment status, data payload parsing status, or application layer response action of the downstream node is inconsistent with the expected behavior, the record is marked as a downstream cascading anomaly.
[0037] Step 504: Perform the fourth-layer comparison: Among the records marked with arbitration offset anomalies, identify records where the arbitration offset causes the gateway to route packets to a downstream segment different from the correct arbitration result, and mark them as cross-domain misrouting events. The specific judgment criteria are: the record has both an arbitration offset anomaly mark and a gateway routing deviation mark, and the actual forwarding target segment identifier of the gateway and the forwarding target segment identifier pre-calculated based on the correct arbitration result point to different downstream bus segments.
[0038] Step 6, Generate a fault injection diagnostic report: All records marked as abnormal are aggregated into two-dimensional groups based on concurrency contention depth and arbitration key position. The arbitration offset rate, gateway routing deviation rate, downstream cascading anomaly rate, and cross-domain misrouting rate are calculated for each group.
[0039] It should be noted that the above four ratios are calculated as follows: Let the total number of records in a certain group be... The number of arbitration offset anomaly records is The number of gateway routing deviation records is The number of downstream cascaded anomaly records is The number of cross-domain misdirection event records is .in This represents the total number of records within the group. The number of records marked as arbitration offset anomalies within this group. The number of records within this group marked as gateway routing deviations. This represents the number of records within this group that are marked as downstream cascading anomalies. The number of records within this group marked as cross-domain misrouting events. The arbitration offset rate is... Gateway routing deviation rate The downstream cascade anomaly rate Cross-domain misdirection rate .in For arbitration offset rate, Gateway routing deviation rate, For downstream cascade anomaly rate, This refers to the cross-domain misrouting rate. All four ratios mentioned above are dimensionless ratios, ranging from 0 to 1.
[0040] Identify risk areas where the cross-domain misdirection rate is significantly higher than other groups under high contention depth and specific key bit combinations. Output a fault injection diagnostic report, which includes: a risk degree matrix of cascaded propagation of arbitration key bits at each contention depth, a list of cross-gateway misdirection paths caused by arbitration identity tampering, and the range of downstream affected nodes.
[0041] It should be noted that the aforementioned arbitration key position cascading propagation risk matrix is a two-dimensional matrix with concurrent contention depth as the row index and arbitration key position as the column index. The value of each element in the arbitration key position cascading propagation risk matrix is the cross-domain misdirection rate of the corresponding group. The risk matrix of cascading arbitration key positions visually presents the distribution characteristics of cross-domain misdirection risk under different competition depths and different combinations of arbitration key position locations.
[0042] In this embodiment of the application, in order to assist in locating high-risk failure modes, step 6 also includes propagating the cross-domain misdirection rate in the risk degree matrix of the arbitration key bit concatenation. For groups exceeding a preset threshold, the injection items in their corresponding arbitration boundary variation injection plan set are traced back. The cross-segment route deviation prediction label of the injection item is extracted, and its consistency is verified with the actual observed four-layer alignment results. When the cross-segment route deviation prediction label matches the actual observation results, the propagation path of the failure mode is confirmed to have been accurately predicted. When the cross-segment route deviation prediction label does not match the actual observation results, the group is marked as an unexpected failure mode requiring further analysis.
[0043] On the other hand, the present invention also proposes a fault injection diagnostic system for bus communication, comprising: The protocol constraint parsing module is used to obtain the topology configuration data of the multi-segment bus communication network, parse the protocol frame format specifications of each bus segment, extract the message routing table and protocol field mapping rules of the gateway node, obtain the message identifier allocation list of each node, and generate a multi-segment protocol constraint model.
[0044] The arbitration contention detection module is used to collect the physical layer bit stream of the source bus segment in real time, monitor the status of the send request signal line of each node, detect concurrent contention state, count the concurrent contention depth, perform bitwise XOR operation on the identifier of each competing node, and generate a weighted map of arbitration key bits.
[0045] The mutation injection plan generation module is used to perform boundary value analysis based on the weighted graph of arbitration key bits, generate a set of arbitration segment boundary mutations, substitute the arbitration winner identifier corresponding to each mutation into the gateway conversion rules to pre-calculate the cross-segment routing results, and form a set of arbitration boundary mutation injection plans with cross-segment routing deviation prediction labels.
[0046] The multi-segment synchronous acquisition and injection execution module is used to perform bus level forced overwrite within the target arbitration window, synchronously acquire response data from the source bus segment, gateway end, and downstream bus segment, and uniformly associate each acquired data according to the contention depth, injection key bit position, and gateway forwarding path to form an arbitration contention state cross-segment mutation propagation record set.
[0047] The four-layer comparison and analysis module is used to perform arbitration offset comparison, gateway routing deviation comparison, downstream cascade anomaly comparison, and cross-domain misleading routing identification on the arbitration competition state cross-segment mutation propagation record set, and to mark anomalies at each level.
[0048] The diagnostic report generation module is used to perform two-dimensional grouping and aggregation of marked abnormal records according to the concurrency competition depth and arbitration key position, calculate the abnormality ratio of each group, identify high-risk areas, and output a fault injection diagnostic report containing an arbitration key cascade propagation risk degree matrix, a list of cross-gateway misleading routing paths, and the range of affected nodes.
[0049] By way of example, the system proposed in this invention may also include various features and combinations thereof in the method embodiments, which will not be elaborated here.
[0050] This invention generates a weighted map of key arbitration bits by real-time detection of concurrent contention depth and identifier divergence. This allows for precise fault injection targeting of bits crucial to arbitration decisions, rather than uniform injection within the arbitration segment, thus covering high-risk fault modes unique to arbitration contention states. Before injection, gateway conversion rules pre-calculate the cross-segment routing results of the mutated winning arbitration identifier, ensuring the arbitration boundary mutation injection plan set carries cross-segment routing deviation prediction labels. This links arbitration contention state fault injection with cross-gateway propagation tracing. A four-layer comparison distinguishes four fault levels: local offset in the arbitration segment, gateway routing deviation, downstream cascading anomalies, and cross-domain misleading routing. This reveals the complete propagation path of arbitration identity tampering amplified into cross-domain cascading faults via gateway routing logic. This approach overcomes the diagnostic blind spots created by the superposition of two independent defects in existing methods: cross-gateway fault injection ignoring contention state conditions and contention state fault injection ignoring cross-gateway propagation effects.
[0051] See Figures 2-9 The following application examples are proposed: A certain automotive electronic vehicle network adopts a multi-segment CAN bus architecture, with the power domain bus segment (segment P) and the chassis domain bus segment (segment C) interconnected through a central gateway node. Segment P hosts three nodes: the engine control unit, the transmission control unit, and the battery management unit; segment C hosts three nodes: the brake control unit, the suspension control unit, and the vehicle stability control unit. A fault injection diagnostic device connects to both segment P and segment C simultaneously via a physical layer interface and establishes a data connection with the monitoring port of the central gateway. The objective of this diagnostic task is to verify the cross-domain cascading fault mode caused by a message with altered arbitration identity, routed through the central gateway to segment C under a multi-node arbitration contention state on segment P.
[0052] The execution process of step 1: The fault injection diagnostic device reads the vehicle network configuration file, parses the protocol frame format specifications of segments P and C, extracts the central gateway routing table and field mapping rules, obtains the message identifier allocation list of each node, and generates a multi-segment protocol constraint model.
[0053] Table 1 Gateway Routing Table and Node Identifier Allocation
[0054] The multi-segment protocol constraint model records that the arbitration segment identifier field of segment P is 11 bits, the data length code field has a value range of 0 to 8, and the mapping rule that the central gateway replaces the high 4 bits of the source segment identifier with the target domain prefix.
[0055] The execution process of step 2: The fault injection diagnostic device acquires the segment P physical layer bitstream in real time and simultaneously listens to the transmit request signal lines of each node. It detects that three nodes—the engine control unit (identifier 0x1A0), the transmission control unit (identifier 0x1C0), and the battery management unit (identifier 0x1E0)—are simultaneously in transmit mode, indicating a high degree of concurrent contention. .
[0056] Perform a bitwise XOR operation on the three competing node identifiers to calculate the divergence mask. The divergence bits are arranged in order from the most significant bit to the least significant bit, and then weighted according to the formula. Assigning decreasing weight values generates a weighted graph of arbitration key bits. Among them, The total number of divergent positions. This is the sequence number of the current divergence position (starting from 1, arranged from high to low according to the position). For the first The weight value corresponding to each divergence point.
[0057] Table 2 Weighted Chart of Arbitration Key Positions
[0058] The three competing node identifiers differ at bits 8, 7, and 5, with a total of [number] differing bits. Bit 8 has the highest weight and is the most crucial bit in determining the winner of this arbitration.
[0059] The execution process of step 3: Based on the weighted graph of arbitration key bits, the boundary level of each divergence bit is flipped. The flipped variant identifier is substituted into the gateway conversion rule to pre-calculate the cross-segment routing result, and the cross-segment routing deviation prediction label is marked. This is done according to the weight value. Arrange them in descending order to form a set of arbitration boundary variation injection plans.
[0060] Table 3. Arbitration Boundary Variation Injection Plan Set (in descending order of weight)
[0061] Injection item 1 has the highest weight. After bit 8 is flipped, the winner of the arbitration changes from the engine control unit to the transmission control unit. The gateway expects the message to be routed to segment C at 0x2D0 instead of the correct route target 0x2B0, and it is pre-labeled as a route bias label. The flip result of injection item 3, 0x1B0, has no matching entry in the routing table, and it is pre-labeled as a route drop label.
[0062] The execution process of step 4: Fault injection diagnostic equipment detects the depth of concurrent contention. During the arbitration window, the bus level forced overwrite of injection items 1 to 3 is performed sequentially according to weight priority. Taking injection item 1 as an example, at the bit 8 transmission moment, the device forces the bus level from recessive to dominant through the physical layer interface, so that the superimposed level on segment P bus presents the bit 8 value of the gearbox control unit identifier 0x1C0, and the arbitration winner is offset to the gearbox control unit. Response data from the source bus segment, gateway, and segment C are synchronously collected and associated according to contention depth, injection bit position, and gateway forwarding path to form a cross-segment mutation propagation record set of arbitration contention state.
[0063] Table 4. Multi-segment synchronous acquisition data of injection item 1
[0064] The execution process of step 5: A four-level alignment analysis was performed on the record set of cross-segment mutation propagation in the arbitration competition state. The labeling results of each level are illustrated using the record corresponding to injection item 1 as an example.
[0065] First-level comparison: The actual arbitration winner identifier 0x1C0 is inconsistent with the expected winner identifier 0x1A0 (0x1A0 has the smallest value and is the correct winner node), and is marked as an arbitration offset anomaly.
[0066] The second layer comparison: The actual forwarding identifier 0x2D0 of the gateway is inconsistent with the theoretical forwarding value 0x2B0, which is marked as gateway routing deviation.
[0067] Third-layer comparison: The brake control unit did not receive the expected 0x2B0 message, and its application layer response action was missing, which was marked as a downstream cascade anomaly.
[0068] Fourth-level comparison: The record has both an arbitration offset anomaly flag and a gateway route deviation flag, and the gateway actually forwards to the 0x2D0 receiving path of segment C, which is different from the correct arbitration result that should be forwarded to the 0x2B0 receiving path, pointing to different downstream nodes. It is marked as a cross-domain misdirection event.
[0069] Table 5 Summary of Four-Layer Comparison Analysis Results
[0070] Injection item 3 triggered route dropping. The central gateway did not forward the packet to any downstream segment, so it did not constitute a cross-domain misdirection event. However, the downstream braking control unit triggered a timeout exception due to not receiving the expected packet for a long time, and was marked as a downstream cascading exception.
[0071] The execution process of step 6: All records marked as abnormal are grouped and aggregated in two dimensions according to the concurrency competition depth and arbitration key position. The four abnormality ratios of each group are calculated to generate an arbitration key cascade propagation risk matrix, identify high-risk areas, and output a fault injection diagnosis report.
[0072] Table 6. Arbitration Key Bit Cascade Propagation Risk Matrix (Cross-Domain Misleading Routing Rate) )
[0073] Competition Depth Furthermore, the injection bit 8 indicates a high rate of cross-domain misrouting in packets. The data exceeded a preset threshold and was identified as a high-risk area. Tracing back to injection item 1 corresponding to this group, its cross-segment routing deviation prediction label was a routing bias label, consistent with the actually observed gateway routing deviation label and cross-domain misleading routing label, confirming that the propagation path of this fault mode had been accurately predicted. The diagnostic report output a list of cross-gateway misleading routing paths: In segment P, the engine control unit message, due to bit 8 arbitration boundary flipping at the three-node contention depth, caused the central gateway to mislead the message to the suspension control unit in segment C. The brake control unit, not receiving the expected message, triggered an application layer timeout response deficiency. Downstream affected nodes covered both the brake control unit and the suspension control unit.
[0074] Throughout the implementation process, data starts from the gateway routing table and node identifier allocation in step 1, generates weighted divergence information through arbitration competition detection in step 2, combines the divergence weights with route pre-calculation in step 3 to form an injection plan with predicted labels in step 4, the actual injected data is collected and corresponds one-to-one with the predicted labels in step 4, the four-layer comparison in step 5 correlates the local arbitration offset with cross-gateway routing deviation and downstream cascading effects layer by layer, and finally aggregates all the labeling results into a risk degree matrix and backtracks to verify the accuracy of the predicted labels in step 6. The data maintains a complete causal chain transmission relationship between each step.
[0075] The embodiments of the present invention have been described above. However, the embodiments are not limited to the specific implementation methods described above. The specific implementation methods described above are merely illustrative and not restrictive. Those skilled in the art can make more equivalent embodiments under the guidance of the present embodiments, and all of them are within the protection scope of the present embodiments.
Claims
1. A fault injection diagnosis method for bus communication, characterized in that, Includes the following steps: Parse the topology configuration data of the multi-segment bus communication network, extract the message routing table and protocol field mapping rules of the gateway node, and generate a multi-segment protocol constraint model; Real-time acquisition of physical layer bit streams from source bus segments. When multiple nodes are detected to be in the transmitting state simultaneously, the concurrent contention depth is calculated. Bitwise XOR operation is performed on the identifiers of each competing node to identify the divergence bits in the arbitration segment. The arbitration influence weights are assigned in decreasing order according to the order in which the divergence bits appear, and an arbitration key bit weighted map is generated. Based on the value domain boundary of each divergence bit in the weighted graph of arbitration key bits, perform boundary value analysis to generate a set of arbitration segment boundary variations. Substitute the arbitration winner identifier corresponding to each variation into the gateway conversion rule to pre-calculate the cross-segment routing result, label the cross-segment routing deviation prediction label, and form a set of arbitration boundary variation injection plans. Within the target arbitration window, bus level forced overwrite is performed in order of weight priority, and response data from the source bus segment, gateway, and downstream bus segment are collected simultaneously to form a cross-segment mutation propagation record set of arbitration competition state; A four-layer comparison analysis is performed on the record set to mark arbitration offset anomalies, gateway routing deviations, downstream cascading anomalies, and cross-domain misdirection events, and a fault injection diagnostic report is generated.
2. The fault injection diagnosis method for bus communication according to claim 1, characterized in that, The step of performing a bitwise XOR operation on the identifiers of each competing node to identify the divergence bits in the arbitration segment includes: Suppose there are currently arbitration windows containing There are 1 competing node, and the message identifiers of each competing node are as follows: For all Perform a bitwise XOR operation on each node pair, the first node... The node and the first The XOR result of the nodes is ,in For bitwise XOR operation; it will select all... Perform a bitwise OR operation to obtain the divergence bitmask. ,in For bitwise OR operation, The bits with a median value of 1 are the bits in the arbitration segment where there is disagreement.
3. The fault injection diagnosis method for bus communication according to claim 2, characterized in that, The method of assigning decreasing arbitration influence weights according to the order in which the divergence points appear includes: Disagreement mask The bits with a median value of 1 are arranged in order from the most significant bit to the least significant bit. ,in For the total number of divergent positions; for the th Disagreement position Assign weight values ,in The value range is 1 to The arbitration key weighted diagram consists of the position of each divergence point and its corresponding weight value.
4. The fault injection diagnosis method for bus communication according to claim 2, characterized in that, The boundary value analysis includes: For each divergence bit in the weighted graph of arbitration key bits, determine the original level value of the bit in the current correct arbitration winner identifier, and generate a variant identifier after flipping the bit; determine whether the flipped variant identifier has a matching item among all competing node identifiers. If a matching item exists, the arbitration winner corresponding to the variant is changed to the matching node. If no matching item exists, the variant identifier is an illegal identifier; for cases containing multiple divergence bits, generate a multi-bit joint flip variant according to the combination of divergence bits; the arbitration segment boundary variant set contains all unit flip variants and multi-bit joint flip variants.
5. The fault injection diagnosis method for bus communication according to claim 1, characterized in that, The cross-segment routing deviation prediction label includes three types: The route consistency label indicates that the route destination of the mutated arbitration winner identifier after gateway translation is the same as the route destination of the correct arbitration result; the route bias label indicates that the mutated arbitration winner identifier is routed to a different downstream bus segment than the correct arbitration result after gateway translation. The route drop label indicates that the mutated arbitration winner identifier does not have a matching entry in the gateway routing table.
6. The fault injection diagnosis method for bus communication according to claim 1, characterized in that, The four-layer alignment analysis includes: The first layer comparison is performed, comparing the actual arbitral winner node with the expected arbitral winner node without faults. If they are inconsistent, it is marked as an arbitration offset anomaly. The second layer comparison is performed, comparing the actual forwarded packet content of the gateway with the theoretical forwarding value pre-calculated based on the correct arbitration result. If they are inconsistent, it is marked as a gateway routing deviation. The third layer comparison is performed, comparing the actual processing behavior of the downstream node with the expected behavior of the target end protocol for the actual forwarded packet of the gateway. If they are inconsistent, it is marked as a downstream cascading anomaly. The fourth layer comparison is performed, and among the records that have both arbitration offset anomaly and gateway routing deviation markings, records where the actual forwarded target segment identifier of the gateway and the forwarded target segment identifier pre-calculated based on the correct arbitration result point to different downstream bus segments are identified and marked as cross-domain misrouting events.
7. The fault injection diagnosis method for bus communication according to claim 1, characterized in that, The generated fault injection diagnostic report includes: All records marked as abnormal are aggregated into two-dimensional groups based on concurrency contention depth and arbitration key position; the arbitration offset rate of each group is calculated. Gateway routing deviation rate Downstream cascade anomaly rate Cross-domain misdirection rate ,in The total number of records within the group. This represents the number of arbitration offset anomaly records. The number of gateway routing deviation records. This represents the number of downstream cascading anomaly records. The system records the number of cross-domain misdirection events and outputs a fault injection diagnostic report. The diagnostic report includes a risk degree matrix of cascaded propagation of arbitration key bits with row indexing based on concurrency contention depth and column indexing based on arbitration key bit position, a list of cross-gateway misdirection paths, and the range of downstream affected nodes.
8. The fault injection diagnosis method for bus communication according to claim 7, characterized in that, Also includes: Cross-domain misdirection rate in the risk degree matrix of arbitration key bit cascade propagation For groups exceeding a preset threshold, backtrack the injection items in the corresponding arbitration boundary variation injection plan set, extract the cross-segment route deviation prediction label of the injection item, and verify the consistency of the cross-segment route deviation prediction label with the actual observed four-layer comparison results. When both are consistent, it confirms that the propagation path of the failure mode has been accurately predicted; when they are inconsistent, the group is marked as an unexpected failure mode.
9. The fault injection diagnosis method for bus communication according to claim 1, characterized in that, If only one node is detected to be in the transmitting state, skip the process of generating the arbitration key bit weighted graph; The injection items in the arbitration boundary variation injection plan set are arranged in descending order according to the arbitration impact weight value; The acquisition clocks of the source bus segment, gateway, and downstream bus segment are calibrated using a network time synchronization protocol, and the timestamp deviation of each acquisition point is controlled within the duration of a single bit.
10. A fault injection diagnostic system for bus communication, used to execute the fault injection diagnostic method for bus communication according to any one of claims 1 to 9, characterized in that, include: The protocol constraint parsing module is used to obtain the topology configuration data of the multi-segment bus communication network, parse the protocol frame format specifications of each bus segment, extract the message routing table and protocol field mapping rules of the gateway node, obtain the message identifier allocation list of each node, and generate a multi-segment protocol constraint model. The arbitration contention detection module is used to collect the physical layer bit stream of the source bus segment in real time, monitor the status of the send request signal line of each node, detect the concurrent contention state, count the concurrent contention depth, perform bitwise XOR operation on the identifier of each competing node, and generate a weighted map of arbitration key bits. The mutation injection plan generation module is used to perform boundary value analysis based on the weighted graph of arbitration key bits, generate a set of arbitration segment boundary mutations, substitute the arbitration winner identifier corresponding to each mutation into the gateway conversion rule to pre-calculate the cross-segment routing result, and form a set of arbitration boundary mutation injection plans with cross-segment routing deviation prediction labels. The multi-segment synchronous acquisition and injection execution module is used to perform bus level forced overwrite within the target arbitration window, synchronously acquire response data from the source bus segment, gateway end, and downstream bus segment, and uniformly associate each acquired data according to the contention depth, injection key bit position, and gateway forwarding path to form an arbitration contention state cross-segment mutation propagation record set; The four-layer comparison and analysis module is used to perform arbitration offset comparison, gateway routing deviation comparison, downstream cascade anomaly comparison, and cross-domain misleading routing identification on the arbitration competition state cross-segment mutation propagation record set, and to mark anomalies at each layer. The diagnostic report generation module is used to perform two-dimensional grouping and aggregation of marked abnormal records according to the concurrency competition depth and arbitration key position, calculate the abnormality ratio of each group, identify high-risk areas, and output a fault injection diagnostic report containing an arbitration key cascade propagation risk degree matrix, a list of cross-gateway misleading routing paths, and the range of affected nodes.