Interlocking change influence analysis method based on machine learning and knowledge graph
By constructing an interlocking knowledge graph and utilizing machine learning for version differentiation and multi-hop expansion, the impact of interlocking changes is automatically identified, and verification test cases are generated. This solves the problem of difficulty in defining the scope of impact in interlocking logic changes, reduces the risk of accidental shutdowns and missed interlocks, and improves the coverage and efficiency of verification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHANGZHOU QIJIAXIN TECHNOLOGY DEVELOPMENT CO LTD
- Filing Date
- 2026-05-11
- Publication Date
- 2026-07-21
AI Technical Summary
Existing technologies struggle to accurately define the scope of impact in scenarios with frequent changes in interlocking logic. Signal sharing makes it difficult to identify chain reactions, and pre-launch verification based on human experience lacks sufficient coverage, leading to a high risk of accidental shutdowns or missed interlocks.
Construct an interlocking knowledge graph, combine machine learning with knowledge graphs to perform version differentiation and multi-hop expansion, generate change closure subgraphs, obtain anomaly scores through self-supervised graph comparative learning, extract the minimum anomaly explanation subgraph, output the affected interlocking set and propagation path, and generate suggested verification test cases.
It enables automated analysis of the impact of interlock changes, reduces the risk of accidental shutdowns and missed interlocks, improves verification coverage and efficiency, and provides interpretable and traceable results.
Smart Images

Figure CN122431141A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of industrial automation control and interlocking safety assessment, and in particular to a method for analyzing the impact of interlocking changes based on machine learning and knowledge graphs. Background Technology
[0002] Interlocking and interlocking logic are widely used in industrial scenarios such as petrochemicals, metallurgy, power, and discrete manufacturing to achieve equipment protection and process safety under abnormal operating conditions. With continuous upgrades to production lines and equipment, optimization of process parameters, and equipment replacement, interlocking logic in programmable logic controller (PLC) programs and distributed control system (DCS) interlocking configurations exhibits characteristics such as frequent version iterations, complex logic structures, a large number of signal points, and cross-system reuse. In current engineering practice, interlocking changes are typically reviewed and verified through change management processes. Common methods include document-based causal matrix comparisons, logic diagram and point table verification, experience-driven manual inspections, and executing manually compiled test cases in simulation environments or testing platforms. Some tools can provide program difference comparisons, point table consistency checks, or partial static analysis to help identify obvious configuration errors.
[0003] However, existing technologies still have the following shortcomings: First, change impact analysis relies heavily on manual experience and static rules, lacking unified modeling of interlocking causal relationships, dependencies, and signal sharing relationships. This makes it difficult to accurately define the scope of impact after interlocking changes and lacks traceable evidence. Second, signal point sharing across interlocks and coupling across devices are common, and existing comparison and review methods struggle to systematically identify change propagation paths, easily leading to cascading effects and the risk of accidental shutdowns or missed interlocks. Third, pre-deployment verification mainly relies on manually compiled test cases, making it difficult to guarantee coverage and completeness. Furthermore, it lacks automatic identification and interpretation of high-risk changes, hindering targeted verification and efficiency improvements.
[0004] Therefore, there is a need for an interlocking change impact analysis method that can address the shortcomings of the existing technology. Summary of the Invention
[0005] One objective of this invention is to propose a method for analyzing the impact of interlocking changes based on machine learning and knowledge graphs. Addressing the problems of existing technologies, such as difficulty in defining the scope of impact in scenarios with frequent changes to interlocking logic, difficulty in identifying chain reactions due to signal sharing, reliance on manual experience for pre-deployment verification, and insufficient test case coverage, the following technical solution is proposed: Knowledge extraction and fusion are performed on the interlocking configuration, signal point table, and historical trigger records of the programmable logic controller (PLC) program or distributed control system to construct an interlocking knowledge graph; under unified identifier alignment constraints, version graphs before and after the change are generated and version difference is performed to construct a change operation graph containing the changed operation nodes; starting from the changed operation nodes, a change closure subgraph is formed by multi-hop expansion according to preset relationship types; operation-level and subgraph-level representations are obtained based on self-supervised graph comparative learning, and anomaly scoring is performed; when anomaly conditions are met, the minimum anomaly explanation subgraph is extracted as the analysis subgraph; based on this, the affected interlocking set, impact propagation path, and suggested verification test cases are output, and verification execution is supported. This invention has the technical effects of automated impact analysis, interpretable risks, traceable results, and improved verification coverage, thereby reducing the risk of accidental shutdowns and missed interlocks.
[0006] This invention provides a method for analyzing the impact of interlocking changes based on machine learning and knowledge graphs, including:
[0007] S1. Obtain interlocking data from the target production line or device, extract knowledge to obtain entities and relationships, and perform knowledge fusion on the entities to form a set of entities with unified identifiers, constructing an interlocking knowledge graph to obtain an initial knowledge graph; S2. Under the alignment constraint of unified identifiers, generate a version one knowledge graph based on the interlocking data before the interlocking change, and generate a version two knowledge graph based on the interlocking data after the interlocking change; S3. Perform version difference calculation on the version one knowledge graph and the version two knowledge graph to obtain the version difference result, construct a version difference graph based on the version difference result, generate change operation nodes for the version difference result, and establish association between the change operation nodes and the corresponding change objects, forming a change operation graph on the version difference graph; S4. Using the change operation nodes as the starting point for expansion, in the change... S5. The change closure subgraph is expanded along a preset relationship type on the operation graph to obtain a change closure subgraph containing the scope of change propagation; S6. The change closure subgraph is input into the graph representation learning model for encoding to obtain the operation-level representation vector corresponding to the change operation node and the subgraph-level representation vector corresponding to the change closure subgraph; S7. The anomaly score of the change closure subgraph is calculated based on the operation-level representation vector and the subgraph-level representation vector to determine the analysis subgraph used for impact analysis. When the anomaly score meets the preset anomaly conditions, the minimum anomaly explanation subgraph is extracted from the change closure subgraph as the analysis subgraph; S8. The affected interlock set is determined based on the analysis subgraph and the impact propagation path is generated. The suggested verification test cases corresponding to the affected interlock set are generated, and the affected interlock set, the impact propagation path, and the suggested verification test cases are output.
[0008] Optionally, S1 includes:
[0009] The interlocking data is acquired and its format is converted and its fields are normalized. For the interlocking configuration of the programmable logic controller program and the distributed control system, signal point identifiers, interlocking identifiers, device identifiers and logical condition expressions are extracted. For the signal point table, the correspondence between signal point identifiers and signal point aliases, signal point addresses and their respective device identifiers is extracted. For the historical interlocking trigger records, the trigger time, triggering interlocking identifier, associated signal point identifier and trigger result are extracted.
[0010] After completing the format conversion and field normalization processing, knowledge extraction is performed. Based on the programmable logic controller program and the interlocking configuration of the distributed control system, entities are identified and entity attributes are generated. The entities include signal points, interlocks, devices, and logic blocks. Relationships are extracted based on the logical condition expression and relationship attributes are generated. The relationships include logical reference relationships, control dependency relationships, and data dependency relationships. Signal sharing relationships are extracted based on the case where multiple interlocks reference the same signal point. Trigger causal relationships are extracted based on the order of trigger times in the historical interlock trigger records and the correlation statistics within a preset time window. The preset time window is determined by the time interval distribution of adjacent trigger events in the historical interlock trigger records. The preset time window is the time length corresponding to a preset quantile of the time interval distribution or the time length corresponding to a linear combination of the mean and standard deviation of the time interval distribution.
[0011] After the knowledge extraction is completed, the entities are fused based on the signal point table. Signal points with the same signal point address or alias correspondence are merged into signal points with unified identifiers. Devices with the same device identifier or name correspondence are merged into devices with unified identifiers. The fusion result is written back to the logical reference relationship, signal sharing relationship, control dependency relationship, data dependency relationship, and trigger causal relationship to obtain a set of entities with unified identifiers and a set of relationships corresponding to the set of entities with unified identifiers.
[0012] The interlocking knowledge graph is constructed based on the set of entities with the unified identifier and the set of relationships corresponding to the set of entities with the unified identifier, thus obtaining the initial knowledge graph.
[0013] Optionally, S2 includes:
[0014] Based on the interlocking data before the interlocking change, the version one knowledge graph is generated on the initial knowledge graph. Specifically, under the unified identifier alignment constraint of the initial knowledge graph, while retaining the unified identifier entity set and its corresponding relation set in the initial knowledge graph, the entity attributes and relation attributes involved in the interlocking data before the interlocking change are updated to the corresponding entities and relations in the initial knowledge graph, and a version one tag is recorded for the updated entities and relations.
[0015] When the interlocking data before the interlocking change contains entities that do not exist in the initial knowledge graph, a new unified identifier is assigned to the entity and written into the version one knowledge graph;
[0016] When an entity or relation in the initial knowledge graph no longer appears in the interlocking data before the interlocking change, the entity or relation is marked as invalid in version one.
[0017] Based on the interlocking data after the interlocking changes, a version two knowledge graph is generated on the initial knowledge graph. Specifically, under the unified identifier alignment constraint of the initial knowledge graph, the entity attributes and relation attributes corresponding to the interlocking data after the interlocking changes are updated and version two tags are recorded in the initial knowledge graph. At the same time, new entities are processed according to the same unified identifier allocation rules as those used to generate the version one knowledge graph. Entities or relations that no longer appear in the interlocking data after the interlocking changes are marked as invalid in version two, thus obtaining the version one knowledge graph and the version two knowledge graph.
[0018] Optionally, S3 includes:
[0019] Entities are matched based on the unified identifiers of entities in the knowledge graph of version one and version two. Based on the matching results, entity attributes and relationships between entities are compared to generate version difference results. The version difference results record the difference type, the object to be changed, and the parameters before and after the change. The difference types include: entity addition, entity deletion, entity attribute parameter change, threshold parameter change, logical condition expression change, relationship addition, relationship deletion, relationship parameter change, and relationship direction change.
[0020] A version difference graph is constructed based on the version difference results. The version difference graph includes entities and their relationships that appear in at least one of the version one knowledge graph and the version two knowledge graph. The entities and their relationships are labeled with difference tags corresponding to the difference type.
[0021] For each difference in the version difference result, a change operation node is generated. The change operation node includes the difference type, the change object, the parameters before the change, and the parameters after the change.
[0022] When the object to be changed is an entity, the change operation node is connected to the entity corresponding to the object to be changed through an associated edge;
[0023] When the object to be changed is a relationship, the change operation node is connected to the starting entity and the ending entity of the relationship through associated edges, and the relationship type, the parameters before the change and the parameters after the change are recorded in the change operation node.
[0024] A change operation diagram is formed on the version difference diagram.
[0025] Optionally, S4 includes:
[0026] The change operation node in the change operation diagram is determined as the expansion starting point, and the change object connected to the change operation node through the associated edge is determined as the first-level expansion object;
[0027] According to the preset expansion rules, a multi-hop expansion is performed on the change operation graph. The expansion priority and expansion hop limit are set for control dependency, data dependency, signal sharing relationship and trigger causation relationship respectively. The expansion priority is control dependency higher than data dependency, higher than signal sharing relationship and higher than trigger causation relationship. In each layer of expansion, the relationship type to be expanded is determined according to the expansion priority from high to low. At the same time, only when the expansion hop limit of the corresponding relationship type is not reached, the adjacent nodes directly connected to the current expansion object through the relationship type are added to the next layer of expansion object.
[0028] During multi-hop expansion, duplicate nodes that have already been added are deduplicated to avoid repeated expansion;
[0029] The expansion is terminated when the multi-hop expansion reaches the upper limit of the expansion hop count or when there are no adjacent nodes that meet the expansion conditions.
[0030] The nodes and edges involved in the expansion process are aggregated to form the modified closed subgraph.
[0031] Optionally, S5 includes:
[0032] The node attributes, edge attributes, and topology of the changed closure subgraph are organized into model input features. The node attributes include signal point attributes, interlocking attributes, equipment attributes, and the change type, parameters before and after the change of the change operation node. The edge attributes include logical reference relationships, signal sharing relationships, control dependency relationships, data dependency relationships, trigger causal relationships, relationship type identifiers, and associated edge identifiers.
[0033] Based on the input features of the model, the self-supervised graph contrastive learning model is invoked to encode the changed closure subgraph, generating an operation-level representation vector corresponding to each change operation node and a subgraph-level representation vector corresponding to the changed closure subgraph. The operation-level representation vector represents the structure and attribute information of the change operation node and its local neighborhood, and the subgraph-level representation vector represents the overall structure and attribute information of the changed closure subgraph.
[0034] Optionally, S6 includes:
[0035] Based on a pre-established normal change baseline distribution, the operation-level representation vector and the subgraph-level representation vector are converted into anomaly metrics, wherein the normal change baseline distribution is obtained by statistically analyzing the operation-level representation vector and the subgraph-level representation vector corresponding to historical changes;
[0036] The anomaly score of the changed closure subgraph is calculated based on the anomaly metric, and the anomaly score is compared with the preset threshold, wherein the preset threshold is determined according to the normal change baseline distribution, and the preset threshold is the anomaly score threshold corresponding to the preset quantile of the normal change baseline distribution, or is a linear combination of the mean and standard deviation of the normal change baseline distribution;
[0037] When the abnormal score is not lower than the preset threshold, the contribution of each node and each edge in the changed closure subgraph is calculated. The contribution calculation includes masking the node or the edge and recalculating the abnormal score. The contribution of the node or the edge is determined based on the difference between the abnormal scores before and after masking.
[0038] Iterative pruning is performed based on the contribution degree. In each pruning, nodes or edges with a contribution degree lower than a preset contribution threshold are removed. The preset contribution threshold is determined based on the normalization result of the contribution degree of each node and edge, or based on the nodes or edges whose contribution degree ranking is after a preset proportion. After pruning, the anomaly score is recalculated. If the recalculated anomaly score is still not lower than the preset threshold, pruning continues until there are no nodes or edges that meet the pruning conditions, thus obtaining the minimum anomaly explanation subgraph.
[0039] The minimum anomaly interpretation subgraph is determined as the analysis subgraph.
[0040] Optionally, the S7 includes:
[0041] Nodes whose entity type is interlocked are selected from the analysis subgraph and aggregated into an affected interlock set;
[0042] In the analysis subgraph, starting from the change operation node and ending at the interlocking node in the affected interlocking set, a path search is performed based on the control dependency, the data dependency, the signal sharing relationship, and the triggering causal relationship to obtain at least one impact propagation path. The node sequence and edge sequence in each impact propagation path are recorded as the impact propagation path.
[0043] For each interlocking node in the affected interlocking set, extract the signal point nodes that are directly or indirectly connected to the interlocking node in the analysis subgraph, and read the parameters before and after the change recorded in the change operation node, as well as the value range information and logical condition expression of the signal point nodes. Generate a combination of signal point values that satisfies the interlocking triggering condition and the interlocking non-triggering condition based on the logical condition expression, and combine the combination of signal point values with the corresponding expected interlocking state to form the suggested verification test case.
[0044] The suggested verification test cases are converted into test tasks that can be executed by the interlocking simulation system or the interlocking test platform and then sent out for execution to verify the interlocking configuration of the programmable logic controller program or the distributed control system, collect the interlocking output and compare it with the expected interlocking state to generate verification results;
[0045] Output the set of affected interlocks, the suggested verification test cases, the impact propagation path, and the verification results;
[0046] Furthermore, generating the suggested verification test cases includes: generating boundary value combinations based on the threshold for cases where the threshold parameter changes or the logical condition expression contains threshold comparisons, and generating coverage combinations by using a pairwise combination strategy for multiple signal points associated with the same interlocking node;
[0047] After generation, the test case set is reduced based on the coverage constraint, which is used to ensure that at least one critical edge in each influence propagation path and at least one logical conditional clause corresponding to each difference are covered by at least one suggested verification test case.
[0048] Optionally, the training of the self-supervised graphical contrastive learning model includes the following steps:
[0049] Acquire interlocking data corresponding to multiple historical interlocking change samples, and generate corresponding change closure subgraphs for each historical interlocking change sample according to S1 to S4, obtaining a training set of change closure subgraphs; using the training set of change closure subgraphs as input, perform semantic-preserving data augmentation on each training change closure subgraph to generate a first augmented subgraph and a second augmented subgraph, wherein the semantic-preserving data augmentation includes: synonymous signal mapping replacement based on signal point table, overall preservation of shared signal correlation structure, preservation of dependency direction, and bounded perturbation of parameters before and after the change, wherein the bounded perturbation... The perturbation amplitude does not exceed a preset perturbation threshold; positive sample pairs are constructed using the first and second enhanced subgraphs of the same training modified closure subgraph, and negative sample pairs are constructed using different training modified closure subgraphs, establishing operational-level and subgraph-level contrast targets; the self-supervised graph contrast learning model is obtained by training with the positive sample pairs, the negative sample pairs, the operational-level contrast targets, and the subgraph-level contrast targets as inputs and optimizing the contrast loss function, wherein the contrast loss function is a weighted sum of operational-level contrast loss and subgraph-level contrast loss, and the weights of the weighted sum are preset weights or determined through validation set optimization.
[0050] The beneficial effects of this invention are:
[0051] 1. It can perform version difference before and after the change on the interlocking knowledge graph with unified identifier alignment, and describe the scope of change propagation through change operation graph and change closure subgraph. It automatically outputs the set of affected interlocks and the path of impact propagation, thereby significantly improving the completeness and traceability of interlocking change impact scope identification and reducing the risk of omissions in manual review.
[0052] 2. By obtaining operation-level representation vectors and subgraph-level representation vectors through self-supervised graph comparative learning, and performing anomaly scoring based on the normal change baseline distribution, the system can automatically identify high-risk changes and abnormal propagation structures, thereby reducing the probability of false shutdowns or missed interlocks caused by signal sharing and dependency coupling.
[0053] 3. Extract the smallest anomaly explanation subgraph in abnormal scenarios and generate suggested verification cases accordingly. Transform the change analysis results directly into executable verification tasks, improve the coverage and relevance of test cases, reduce the uncertainty caused by verification relying on human experience, and improve the efficiency of online verification. Attached Figure Description
[0054] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0055] Figure 1 This is a flowchart of the interlocking change impact analysis method based on machine learning and knowledge graph proposed in this invention;
[0056] Figure 2 This is a flowchart for determining the analysis sub-graph of step S6 of the present invention;
[0057] Figure 3 This is a flowchart for constructing the change operation diagram in step S3 of the present invention. Detailed Implementation
[0058] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0059] refer to Figure 1-3 Methods for analyzing the impact of interlocking changes based on machine learning and knowledge graphs include:
[0060] S1. Obtain interlocking data from the target production line or device, extract knowledge to obtain entities and relationships, and perform knowledge fusion on the entities to form a set of entities with unified identifiers, constructing an interlocking knowledge graph to obtain an initial knowledge graph; S2. Under the alignment constraint of unified identifiers, generate a version one knowledge graph based on the interlocking data before the interlocking change, and generate a version two knowledge graph based on the interlocking data after the interlocking change; S3. Perform version difference calculation on the version one knowledge graph and the version two knowledge graph to obtain the version difference result, construct a version difference graph based on the version difference result, generate change operation nodes for the version difference result, and establish association between the change operation nodes and the corresponding change objects, forming a change operation graph on the version difference graph; S4. Using the change operation nodes as the starting point for expansion, in the change... S5. The change closure subgraph is expanded along a preset relationship type on the operation graph to obtain a change closure subgraph containing the scope of change propagation; S6. The change closure subgraph is input into the graph representation learning model for encoding to obtain the operation-level representation vector corresponding to the change operation node and the subgraph-level representation vector corresponding to the change closure subgraph; S7. The anomaly score of the change closure subgraph is calculated based on the operation-level representation vector and the subgraph-level representation vector to determine the analysis subgraph used for impact analysis. When the anomaly score meets the preset anomaly conditions, the minimum anomaly explanation subgraph is extracted from the change closure subgraph as the analysis subgraph; S8. The affected interlock set is determined based on the analysis subgraph and the impact propagation path is generated. The suggested verification test cases corresponding to the affected interlock set are generated, and the affected interlock set, the impact propagation path, and the suggested verification test cases are output.
[0061] In this specific embodiment, S1 includes:
[0062] The process is executed in the following order: data acquisition, field normalization, knowledge extraction, and knowledge fusion.
[0063] Interlock data exported from the same target production line or device within the same acquisition cycle is acquired and written to a unified data temporary storage area. The interlock data consists of a programmable logic controller (PLC) program file, a distributed control system (DCS) interlock configuration file, a signal point table file, and a historical interlock trigger record file. The PLC program file is in structured text format and contains logic block definitions and variable references. The DCS interlock configuration file is in structured configuration table format and contains interlock identifiers, device identifiers, and logical condition expressions. The signal point table file is in structured point table format and contains signal point identifiers, signal point aliases, signal point addresses, and the device identifier to which they belong. The historical interlock trigger record file is in time-sorted event log format and contains trigger time, trigger interlock identifier, associated signal point identifier, and trigger result.
[0064] Subsequently, the above files are subjected to format conversion and field normalization to form a unified field set. The unified field set includes signal point identifier, signal point alias, signal point address, device identifier, interlock identifier, logical condition expression, trigger time and trigger result. The trigger time is uniformly converted to a millisecond-level timestamp and expressed in Coordinated Universal Time. All identifier fields are uniformly processed to remove spaces, unify capitalization and remove illegal characters, and retain the original field values as traceability attributes. The logical condition expression is uniformly converted to a standardized expression consisting only of logical operators, comparison operators, parentheses, signal point identifiers and constants, and retains the original expression as traceability attributes.
[0065] After completing the field normalization process, knowledge extraction is performed. Based on the signal point table, signal point entities are generated line by line and written into the attribute set. The attribute set of the signal point entity includes signal point identifier, signal point alias set, signal point address, device identifier, and value range information. Based on the interlock configuration file of the distributed control system, interlock entities are generated line by line and written into the attribute set. The attribute set of the interlock entity includes interlock identifier, device identifier, interlock action type, and logical condition expression. Based on the programmable logic controller program file, logic block entities are parsed and written into the attribute set. The attribute set of the logic block entity includes logic block identifier, logic block type, and input / output variable set.
[0066] In the parsing of logical condition expressions, an abstract syntax tree parser is used to perform lexical and syntactic analysis on the standard expression to generate an abstract syntax tree. The abstract syntax tree is then traversed to extract the referenced signal point identifiers and constant thresholds to form relationships and parameters. When the type of the abstract syntax tree node is a signal point identifier, a logical reference relationship is established between the interlocking entity and the signal point entity, and the comparison operator and threshold constant of the signal point in the expression are recorded in the relationship attribute. When the type of the abstract syntax tree node is a comparison operator and its right child node is a constant, the constant is recorded as a threshold parameter and bound to the corresponding logical reference relationship to support the recognition of subsequent threshold parameter changes.
[0067] In the parsing of the programmable logic controller program file, data dependencies are established based on the set of input and output variables of the logic block. The data dependencies are determined by the fact that the output variable of the first logic block is referenced by the input variable of the second logic block and are represented by a directed edge from the first logic block to the second logic block. At the same time, control dependencies are established based on the execution conditions of the logic block. The control dependencies are determined by the fact that the execution enable condition of the second logic block references the output variable of the first logic block or the output state of the interlocking entity and are represented by a directed edge from the first logic block or the interlocking entity to the second logic block.
[0068] In the extraction of signal sharing relationships, all logical reference relationships are grouped according to signal point identifiers. If the same signal point identifier is referenced by multiple interlocking entities, a signal sharing relationship is established between each pair of corresponding interlocking entities, and the set of shared signal point identifiers is recorded in the relationship attribute.
[0069] In the extraction of trigger causal relationships, historical interlocking trigger records are sorted in ascending order of trigger time to obtain an event sequence, and the set of time intervals between adjacent events is calculated. ,in Indicates the first The event and the first The triggering interval of each event and Indicates the first The trigger timestamp of each event. Indicates the sequence number in the event sequence;
[0070] A preset time window is determined based on the set of time intervals. And used for causal statistics, the preset time window Determined by the quantile function:
[0071] ;
[0072] in Indicates the duration of the preset time window. This indicates taking from the input set Quantile function A value of 0.95 is used to ensure the window covers the vast majority of adjacent trigger intervals. Represents the set of time intervals between adjacent events. and The meaning is as described above;
[0073] In obtaining Then, for any two interlocking trigger events, the order of execution within the execution window is counted. If the interlocking entity After being triggered Intralock Entity If the probability of triggering the condition is not less than 0.6 and the number of such occurrences is not less than 5, then an interlocking entity is established. Pointing to the interlocking entity The triggering causal relationship is recorded in the relationship attributes, including the conditional probability, statistical frequency, and time window. ;
[0074] After knowledge extraction is completed, knowledge fusion is performed to form a set of entities with a unified identifier. The unified identifier of signal point entities is generated with the signal point address as the primary key, and signal point entities with the same address are merged into signal point entities with the same unified identifier. At the same time, a mapping from aliases to signal point addresses is established based on the signal point alias set in the signal point table, and signal point entities with alias correspondence and mapped to the same address are merged into signal point entities with the same unified identifier. The unified identifier of device entities is generated with the device identifier as the primary key, and device entities with the same device identifier are merged into device entities with the same unified identifier.
[0075] After fusion, endpoint write-back is performed on logical reference relationships, signal sharing relationships, control dependency relationships, data dependency relationships and triggering causal relationships. Each relationship endpoint is replaced with the unified identifier after fusion and the list of identifiers before fusion is retained as traceability attributes.
[0076] Finally, an interlocking knowledge graph is constructed based on the unified identifier set of entities and the written-back relation set. The interlocking knowledge graph adopts an attribute graph structure, with nodes representing entities and edges representing relations. Node attributes include unified identifier, entity type, and traceability attribute, while edge attributes include relation type, parameter attribute, and traceability attribute, thus obtaining the initial knowledge graph.
[0077] In this specific embodiment, S2 includes:
[0078] Based on the initial knowledge graph, version one knowledge graph and version two knowledge graph are generated, and the same entity can be stably matched between different versions by a unified identifier alignment constraint.
[0079] In the graph storage layer, a version 1 attribute area and a version 2 attribute area are established for each node and each edge in the initial knowledge graph. The version 1 attribute area contains a version 1 tag, a version 1 valid tag, and entity attributes and relation attributes corresponding to version 1. The version 2 attribute area contains a version 2 tag, a version 2 valid tag, and entity attributes and relation attributes corresponding to version 2. The unified identifier of the nodes and edges in the initial knowledge graph is set as the primary key and a primary key index is established to support constant-time lookup based on the unified identifier.
[0080] Subsequently, the interlocking data before the interlocking change is read, and the field normalization and knowledge extraction rules are reused to obtain a version 1 candidate entity set and a version 1 candidate relation set. A unified identifier resolution is then performed on each candidate entity to satisfy the unified identifier alignment constraint. Specifically, signal point entities use the signal point address as the unified identifier resolution key, equipment entities use the equipment identifier as the unified identifier resolution key, interlocking entities use the interlocking identifier as the unified identifier resolution key, and logic block entities use the logic block identifier as the unified identifier resolution key. If the resolution key matches the primary key index of the initial knowledge graph, the unified identifier corresponding to the candidate entity is determined, and the candidate entity's attributes are written into the version 1 attribute area of the node corresponding to the unified identifier. Simultaneously, the... The version 1 flag of the node is set to 1, and the version 1 valid flag is set to 1. If the parsing key does not match the primary key index of the initial knowledge graph, a new unified flag is generated according to the unified flag allocation rule consistent with S1, and a new node is added and written to the version 1 knowledge graph. At the same time, the candidate entity attributes are written, and the version 1 flag is set to 1 and the version 1 valid flag is set to 1. The unified flag allocation rule takes the signal point address as the unified flag for signal point entities, the device flag as the unified flag for device entities, the interlocking flag as the unified flag for interlocking entities, and the logic block flag as the unified flag for logic block entities. All of the above flags are normalized flags after the S1 field normalization to ensure determinism.
[0081] When processing candidate relations, the starting entity and ending entity of each candidate relation are first parsed according to the aforementioned unified identifier to obtain the unified identifier of the starting entity and the unified identifier of the ending entity. Then, the ordered triple of relation type, unified identifier of starting entity and unified identifier of ending entity is used as the relation key to search for the corresponding edge in the initial knowledge graph. If the corresponding edge is found, the relation attribute of the candidate relation is written into the version 1 attribute area of the edge, and the version 1 mark of the edge is set to 1 and the version 1 valid mark is set to 1. If the corresponding edge is not found, the edge is added and the relation type and relation attribute are written into it, and the version 1 mark is set to 1 and the version 1 valid mark is set to 1.
[0082] After writing the version 1 candidate entity set and the version 1 candidate relation set, the version 1 invalid mark completion is performed on all nodes and edges in the initial knowledge graph. The completion is achieved by setting the version 1 valid mark of the nodes and edges that have not been reached by the version 1 writing process to 0, so that the version 1 knowledge graph can fully express the state before the change under the unified identifier alignment constraint.
[0083] Subsequently, the same processing flow is used to read the interlocking data after the interlocking change to generate a version 2 candidate entity set and a version 2 candidate relationship set. Under the same primary key index and the same unified identifier allocation rule, the version 2 attribute area is written and the version 2 tag and version 2 valid tag are set. At the same time, the version 2 valid tag is set to 0 for nodes and edges that are not reached by the version 2 writing process to form a version 2 knowledge graph.
[0084] In this embodiment, version Whether a node or edge is valid is determined by the valid flag function as follows:
[0085] ;
[0086] in Indicates a valid tagging function. Indicates version number and This represents the node or edge to be determined. This indicates an indicator function that takes the value 1 when the condition inside the parentheses is true, and otherwise takes the value 0. Version The set of nodes or edges that are touched and whose attributes are written during the writing process;
[0087] Through the above alignment parsing, attribute partitioning writing, new unified identifier allocation and invalid tag completion operations, version one knowledge graph and version two knowledge graph are obtained, which are consistent with the unified identifier of the initial knowledge graph and can be directly used for subsequent version difference calculation.
[0088] In this specific embodiment, S3 includes:
[0089] Based on the version 1 knowledge graph and the version 2 knowledge graph, perform version difference calculation and construct a change operation graph;
[0090] First, a matching key system for version difference calculation is established. The entity matching key takes a unified identifier and completes one-to-one entity matching through the primary key index of the knowledge graph of version one and the knowledge graph of version two. The relation matching key takes an ordered triple consisting of relation type, unified identifier of starting entity and unified identifier of ending entity and completes one-to-one relation matching through edge primary key index. At the same time, a reverse matching key is established for relation direction change detection and is used to determine whether the starting point and ending point of the same relation type are interchanged in the two versions.
[0091] Subsequently, a difference traversal is performed on the entity set and the relation set respectively. The traversal object takes all entities and relations within the range of the union of the two versions and generates version difference result records item by item. The data structure of the version difference result record is fixed as a set of four-tuple fields and is written into the difference list in ascending order of record number. The set of four-tuple fields includes difference type, changed object, parameters before change and parameters after change. The difference type is taken from entity addition, entity deletion, entity attribute parameter change, threshold parameter change, logical condition expression change, relation addition, relation deletion, relation parameter change and relation direction change.
[0092] In the differential type determination, for any object to be determined First, read its version 1 valid flag. With version 2 valid marker And read its version one parameter vector With version two parameter vector To form a comparable representation, the object Represents entities or relationships. Representation Object In the version 1 knowledge graph, a valid tag is defined as a value of 1, which indicates validity, and a value of 0 indicates invalidity. Representation Object In the version 2 knowledge graph, a valid marker is defined as a value of 1, which indicates validity, and a value of 0 indicates invalidity. Representation Object The parameter vector in the version 1 knowledge graph is obtained by concatenating entity attributes or relation attributes after field normalization in a fixed field order. Representation Object The parameter vectors in the version 2 knowledge graph and their construction method are the same as those in the version 2 knowledge graph. Consistent;
[0093] The basic criteria for determining the difference type are given by the following formula, which is used to determine the three basic results: addition, deletion, and parameter change:
[0094] ;
[0095] in Representation Object The basic difference type, This represents the logical AND operator. Indicates a unequal relationship;
[0096] In entity difference refinement, when For adding or deleting and When dealing with entities, the difference type is refined into entity addition or entity deletion, and the changed object field is written into the unified identifier of the entity. At the same time, the parameter field before or after the change is written into a null placeholder, and the other side is written into the parameter vector of the entity in the corresponding version.
[0097] when For parameter changes and When it is an entity, further determine whether it is a change in logical condition expression or a change in threshold parameter, specifically when When dealing with interlocked entities, the logical condition expression field is read and a canonical abstract syntax tree is generated by the abstract syntax tree parser of S1. Then, all constant thresholds in the canonical abstract syntax tree are replaced with placeholders to obtain the structural skeleton expression, which is written as the structural skeleton field into the parameter vector. Thus, when the structural skeleton fields of the two versions are different, the difference type is determined to be a change in the logical condition expression, and the parameters before and after the change are written into the canonical expression and structural skeleton expression of the two versions respectively. When the structural skeleton fields of the two versions are the same and the threshold parameter set fields of the two versions are different, the difference type is determined to be a change in the threshold parameter, and the parameters before and after the change are written into the threshold parameter set and its positioning path in the canonical expression respectively. For entity parameters other than the above two types, the difference type is determined to be a change in the entity attribute parameter, and the parameters before and after the change are written into the difference field name list and the corresponding field value respectively.
[0098] In relational difference refinement, when For adding or deleting and When dealing with a relation, the difference type is refined into relation addition or relation deletion, and the changed object field is written into the primary key of the relation. At the same time, the parameter field before or after the change is written into null placeholders, and the other side is written into the parameter vector of the corresponding version of the relation.
[0099] when For parameter changes and When establishing a relationship, a direction change detection is first performed. This direction change detection is achieved by constructing a relationship matching key in the version 1 knowledge graph using the relationship type, the unified identifier of the start point, and the unified identifier of the end point, and constructing a reverse matching key in the version 1 knowledge graph using the same relationship type and the interchanged unified identifier of the start point and the unified identifier of the end point. When the reverse matching key is matched and the forward matching key is not matched, the difference type is determined to be a relationship direction change, and the start point and end point of version 1 and the start point and end point of version 2 are written into the parameters before and after the change, respectively. At the same time, when the direction remains unchanged and there are inconsistencies in the relationship attribute fields, the difference type is determined to be a relationship parameter change, and the parameters before and after the change are written into the list of difference field names and the corresponding field values, respectively.
[0100] After generating the version difference results, a version difference graph is constructed based on the version difference results. The version difference graph contains all entities and all relations that are valid in at least one of the version one knowledge graph and the version two knowledge graph, and retains their unified identifier and relation primary key. At the same time, a difference tag set is written into the graph attributes of each entity and each relation. The difference tag set is obtained by collecting all difference types associated with the entity or relation in the version difference results and is used for subsequent visualization and calculation.
[0101] Subsequently, a change operation node is generated for each difference in the version difference result and written into the change operation node attribute set. The change operation node attribute set fixedly includes difference type, change object, parameters before change and parameters after change, and for relational difference, it additionally includes relation type field and relation start point unified identifier and relation end point unified identifier field.
[0102] When the object to be changed is an entity, the change operation node is connected to the entity node corresponding to the object to be changed through an associated edge, and the edge type of the associated edge is fixed as an associated edge. The differential record number is written in the edge attribute for tracing and positioning. When the object to be changed is a relation, the change operation node is connected to the starting entity and the ending entity of the relation through two associated edges respectively. The relation type of the relation, the parameters before the change and the parameters after the change are recorded in the attribute of the change operation node. The starting end and the ending end are marked in the attribute of the two associated edges respectively to maintain the consistency of directional semantics.
[0103] Through the above differential calculation, differential graph construction, change operation node generation and associated edge connection operations, a change operation graph that can be used for subsequent multi-hop expansion is formed on the version differential graph.
[0104] In this specific embodiment, S4 includes:
[0105] Generate a change closure subgraph containing the scope of change propagation based on the change operation graph;
[0106] Let the set of all change operation nodes in the change operation diagram be denoted as And gather the change object nodes that are directly connected to any change operation node through an associated edge into a first-level extended object set. ,in This represents the set of extended starting nodes, and the associated edges represent the edge types used to connect the change operation node and the changed object. This represents a first-level extended object collection whose elements are entity nodes.
[0107] Then, a set of extended relation types is established. And solidify the expansion priority. ,in This represents the set of relation types participating in multi-hop expansion. This indicates control dependencies. Indicates data dependencies. Indicates signal sharing relationship, Indicates the triggering of a causal relationship, symbol This indicates higher priority;
[0108] Simultaneously, the maximum number of expansion hops for each relation type is fixed. , ,in Representing relation type The corresponding upper limit for the number of extended hops is used to limit the farthest propagation layer along this relationship type;
[0109] In terms of extended state maintenance, for each node included in the extended process... Maintain the shortest hop number mapping based on relation type. ,in This indicates a node in the operation diagram whose value is an entity node. Represents the extension from any first-level object to a node. Along relation type The shortest number of hops reached and initialized to and for all set up The first-level extended object is used as the propagation source;
[0110] Set the current layer's expansion object collection in a multi-hop expansion layer. and initialize ,in The layer number is represented and increments from 0. For each layer, the expansion is performed according to... The nodes are processed sequentially, and each node in the current layer is processed in that order. Retrieve its relation type Corresponding adjacent nodes And determine whether to add it to the next level of extended object collection. ,in Indicates the current extended object node. Indicates and By relation type Directly connected adjacent nodes;
[0111] The decision-making process incorporates a hop count upper limit constraint, and updates the shortest hop count mapping when the constraint is satisfied. The update rule is as follows: And only in The join operation is performed at that time, where This represents a function that takes the smaller value. and The meaning is as described above. Representing relation type The corresponding maximum number of extended jumps;
[0112] In the adjacency retrieval direction, control dependencies, data dependencies, and triggering causal relationships are extended from the starting point to the ending point according to their directed edge directions to maintain semantic consistency of influence propagation. Signal sharing relationships are treated as undirected relationships and adjacent nodes at both ends are included during retrieval to ensure that the entanglement propagation caused by shared signals is covered.
[0113] To remove duplicates and avoid redundant expansion, maintain the set of already added nodes. With the set of edges already added Deduplication is performed using the node's unified identifier and the edge's primary key as hash keys, respectively. Represents the set of nodes in a closed subgraph and initially contains and Represents the set of edges of a closed subgraph, initially containing all associated edges and The connection edges between internal nodes and change operation nodes have edge primary keys consisting of ordered triples of edge type, start point identifier, and end point identifier;
[0114] When a certain adjacent node satisfy and When join in And join in At the same time, it will reach The edge addition used ,when Only add the corresponding edge if it does not appear. And no longer join in To avoid redundant expansion;
[0115] Regarding the termination condition, when Empty or for all None of them satisfy the condition. The expansion is terminated and output is made by the scalable edge. and The jointly determined change closure subgraph includes all change operation nodes, all level-1 extension objects, and propagation nodes and propagation edges that are included layer by layer according to extension priority and upper limit constraints of extension hop count.
[0116] In this specific embodiment, S5 includes:
[0117] The modified closure subgraph is organized into features that can be input into the self-supervised graph contrastive learning model and encoded to output the operation-level representation vector and the subgraph-level representation vector;
[0118] First, let's denote the changed closure subgraph as... ,in This represents a set of nodes, and the node types include signal point nodes, interlocking nodes, device nodes, logic block nodes, and change operation nodes. This represents a set of edges, and the edge types include logical reference relationships, signal sharing relationships, control dependencies, data dependencies, triggering causal relationships, and associated edges;
[0119] Then for each node Construction dimension is node input vector The field slot order is fixed to ensure alignment of different node types in the same dimension space. Dimensions 1 to 5 are one-hot encoded node types and set in the order of signal point, interlock, device, logic block, and change operation. Dimensions 6 to 21 are the node main identifier embedding vector. Furthermore, the bucket index is obtained by hashing the node's primary identifier string using CRC32 and then embedded in the matrix. Get and retrieve from table The primary identifier of a signal point node is the signal point address after field normalization; the primary identifier of an interlocking node is the interlocking identifier after field normalization; the primary identifier of a device node is the device identifier after field normalization; the primary identifier of a logic block node is the logic block identifier after field normalization; and the primary identifier of a change operation node is the differential record sequence number string. Dimensions 22 to 37 are the embedded vectors of the device identifier. And the device identifier string is embedded in the matrix The lookup table is used to obtain and set zeros on nodes that do not have a corresponding device identifier. Dimensions 38 to 44 are numerical attribute vectors. Furthermore, the values are written in a fixed order and missing fields are set to zero. Specifically, for signal point nodes, the lower bound of the value range, the upper bound of the value range, and other fields are written and set to zero. For interlocking nodes, the interlocking action type code value and other fields are written and set to zero. For triggering causal relationships, the probability is not stored on the node but the weight is stored on the edge and the corresponding field on the node side is set to zero. For change operation nodes, the threshold before change, the threshold after change, the threshold difference, the logical condition expression length before change, the logical condition expression length after change, the expression length difference, and the relationship direction change flag are written and set to zero on the difference type that is unrelated to this field. Dimensions 45 to 53 are one-hot encodings of the difference type and are only set for change operation nodes and are set in the order of entity addition, entity deletion, entity attribute parameter change, threshold parameter change, logical condition expression change, relationship addition, relationship deletion, relationship parameter change, and relationship direction change. Dimensions 54 to 64 are reserved slots and are all set to zero in this embodiment.
[0120] Then each edge Construction edge type identifier The edge weight that triggers the causal relationship is set to the conditional probability in its relation attribute, and the edge weights of the remaining edges are set to 1. Represents a set of edge types. Indicates logical reference relationships, Indicates signal sharing relationship, This indicates control dependencies. Indicates data dependencies. This indicates the triggering of a causal relationship. Indicates associated edges;
[0121] After constructing the node and edge features, the pre-trained, parameter-fixed self-supervised graph contrastive learning model is invoked. Encoding is performed, and the encoder of the self-supervised graphical contrastive learning model adopts... Layer relation graph convolutional network and extract hidden dimensions , its first Layer to node The update is performed as follows:
[0122] ;
[0123] in Represents a node In the The layer's representation vector and Indicates layer index and Represents the linear rectification activation function. Indicates the first Layer self-loop transformation matrix and its dimension is At that time And in At that time Indicates the first Hierarchical Relationship Type The corresponding transformation matrix and its dimension is Consistent, Indicates that in edge type And pointing to The edge of the entrance and The set of adjacent neighbor nodes, Indicates neighboring nodes, Indicates from Meridian type arrive The edge weights are determined by the edge weight rules. Denotes the normalization coefficient and takes Represents the cardinality of a set;
[0124] Finish After layer propagation, each change operation node will be... The nodes in the last layer represent vectors. This is directly used as the operation-level representation vector corresponding to the change operation node and forms the operation-level representation vector set. The last-level node representation vector of all nodes in the graph is subjected to mean pooling to obtain the subgraph-level representation vector, which is then combined with the changed closure. Figure 1 This creates a one-to-one correspondence, thus outputting the operation-level representation vector corresponding to the change operation node and the subgraph-level representation vector corresponding to the change closure subgraph.
[0125] In this specific embodiment, S6 includes:
[0126] Anomaly scoring is performed on the changed closure subgraph based on the operation-level representation vector and the subgraph-level representation vector, and the minimum anomaly interpretation subgraph is extracted as the analysis subgraph when the anomaly condition is met.
[0127] The change in the closure subgraph is denoted as... And its corresponding subgraph-level representation vector is denoted as ,in The result is obtained from the mean pooling of S5, and the dimension is 128, which is the same as the encoder's hidden dimension. Consistent, and simultaneously denote the set of all change operation nodes in the changed closure subgraph as and each change operation node The corresponding operation-level representation vector is denoted as ,in Depend on The last layer of node representation vectors is obtained directly;
[0128] Subsequently, a normal change baseline distribution is established and solidified as offline baseline parameters. The offline baseline parameters consist of historical change samples that have completed project acceptance and have not caused accidental shutdowns or missed interlocking events. In this embodiment, the sample size is taken as [number]. For each historical change sample, generate its change closure subgraph according to S1 to S5 and obtain the corresponding... And all And collect the subgraph-level representation vectors of all historical samples into a set. Furthermore, the operation-level representation vectors of all historical samples are aggregated into a set. Based on this, calculate the subgraph-level baseline mean vector. With subgraph-level benchmark covariance matrix And calculate the operational-level baseline mean vector. Covariance matrix of operational level benchmark ,in and From set The statistically obtained subgraph-level representation distribution used to characterize normal changes. and From set The statistically obtained and used distribution of the operational level representation for normal changes;
[0129] When calculating anomaly scores, the covariance matrix is made invertible and the regularization coefficient is fixed. Anomaly scoring of modified closure subgraphs is constructed based on Mahalanobis distances at the operation and subgraph levels. And fixed weighting coefficients The calculation formula is as follows:
[0130] ;
[0131] in Indicates changes to the closed subgraph Abnormal scores, This represents the weighting coefficient between the operation-level term and the subgraph-level term, and takes... This represents the set of nodes to be changed. This indicates a change in the operation node. Indicates the change operation node The operation-level representation vector, Represents the operational-level baseline mean vector. Represents the operational-level baseline covariance matrix. Indicates changes to the closed subgraph Subgraph-level representation vector, Represents the subplot-level baseline mean vector. Represents the subgraph-level baseline covariance matrix. Denotes the covariance regularization coefficient and takes express The identity matrix, This indicates the transpose operation. This represents the matrix inversion operation. This indicates the operation of finding the maximum value. Represents the square root operation;
[0132] Subsequently, the anomaly threshold was determined based on offline benchmark parameters. And solidify it into system parameters, the abnormal threshold Through the Anomaly scores are calculated for each historical change sample and the 0.99 quantile is used to obtain the threshold, thereby ensuring that the historical normal change distribution of the target production line or device is consistent.
[0133] when The closed subgraph will be changed at that time. Directly identify it as an analysis subgraph and end step S6;
[0134] when When the minimum anomaly interpretation subgraph extraction process is entered, the current subgraph is initialized to... And initialize the current anomaly score to At the same time, establish a non-removable protection set. Include all change operation nodes and the first-level change object nodes connected by associated edges. This ensures that the explanation structure always includes the starting point and the object of the change;
[0135] In the contribution calculation, the current subgraph For each candidate node or candidate edge in the algorithm, masking is performed and anomaly scores are recalculated, where candidate nodes are selected from... China does not belong to All nodes and the masking operation is performed from The candidate node and its associated edges are deleted to achieve this; the candidate edges are selected. All non-associated edges are preserved when both ends of the middle node are retained, and the masking operation is performed by... The candidate edge is deleted, and after masking, the resulting masked subgraph is re-encoded using the same encoder parameters from S5 to obtain a new... and And calculate the new anomaly score according to the aforementioned formula. ,in This indicates a candidate node or candidate edge that has been hidden. Indicates the first In the next iteration, masking Subsequent abnormal ratings;
[0136] Candidate nodes or candidate edges The contribution is defined as The contribution of all candidates was normalized to obtain... ,in Indicates the candidate Contribution to abnormal scoring This represents the normalized contribution. This represents the maximum contribution of all candidates in the current iteration, and Indicates any candidate option;
[0137] Fixed contribution threshold in iterative pruning In each iteration, all satisfying conditions are simultaneously removed. Candidate nodes and candidate edges are used to form a pruned subgraph. During the pruning process, maintain Internal nodes are not pruned, and if pruning results in an isolated node, that isolated node is also deleted to ensure a compact subgraph structure. After pruning, S5 is reused. Re-encode and calculate new anomaly scores ;
[0138] when And there are still satisfactions When the candidate is selected, continue pruning in the next iteration. Revert to the previous sub-graph And stop pruning, when Pruning will terminate when there are no candidates that meet the pruning criteria;
[0139] The subgraph obtained at termination is identified as the minimum anomaly interpretation subgraph and is also identified as the analysis subgraph.
[0140] In this specific embodiment, S7 includes:
[0141] Based on analysis subgraph Generate the set of affected interlocks, the impact propagation path, and suggested verification test cases, and drive verification execution;
[0142] First, in the analysis subgraph, nodes with the entity type "interlocked" are filtered by the node type field, and then duplicated and aggregated according to their interlocking identifiers to obtain the affected interlocking set. ,in This represents the set of nodes in the analytic subgraph. Describes the set of edges in the analytic subgraph. Indicates the set of affected interlocks;
[0143] Then, each interlocking node in the analysis subgraph... Perform an impact propagation path search and form an impact propagation path set. Path search uses the set of all change operation nodes. The starting set and the interlocking nodes As the endpoint, the allowed path edge types are limited to control dependency, data dependency, signal sharing, and trigger causation, while excluding associated edges and logical references to avoid misjudging entity attachment edges as propagation edges. The path search algorithm adopts breadth-first search and fixes the maximum path length to 6 and fixes each interlocking node to retain a maximum of 20 shortest paths. The edge type priority order is control dependency > data dependency > signal sharing > trigger causation as the deterministic sorting rule for paths of the same length, so as to record the node sequence and edge sequence for each influence propagation path and output it as the influence propagation path.
[0144] When generating suggested verification test cases, for each interlocking node Extract the set of signal point nodes that are directly or indirectly connected to the interlocking node from the analysis subgraph. The inclusion rule for signal point nodes is fixed as starting from interlocking nodes. Starting from a signal node reachable within one hop along logical references, and reaching within two hops along data and control dependencies, the final signal node can be traced back to an interlocking node via logical references. The interlocking node is then read. The logical condition expression is decomposed into a set of atomic condition clauses using the same abstract syntax tree parser as in step S1. Each atomic conditional clause contains a signal point identifier, a comparison operator, and a threshold constant or Boolean constant, and retains its location path in the abstract syntax tree for use in coverage statistics;
[0145] When the interlocking node The corresponding change operation node attributes include threshold parameter changes or when When a threshold comparison clause exists, a set of boundary values is generated for each threshold comparison clause and used to construct candidate test cases, where the threshold is... And the range of signal point values is Analog signal point generation boundary value set Clip each boundary value to Within the interval, Indicates threshold The corresponding set of boundary values, This represents the threshold constant and the parameters before and after the change, which are derived from atomic conditional clauses or from change operation node records. Indicates the boundary perturbation step size and takes And it is used to generate distinguishable values near a threshold. This indicates that the value range of the signal point is the lower bound and comes from the signal point node attribute. This indicates that the value range of the signal point is the upper bound and comes from the signal point node attribute;
[0146] Generate a set of values for Boolean signal points And use 0 to represent false and 1 to represent true; then use lexicographical pairs with unified identifiers for the signal points. A deterministic sorting process is performed, and a pairwise combination strategy is used to generate covering combinations, wherein the pairwise combination strategy employs strength... The IPOG generation algorithm generates a candidate assignment set using the value set of each signal point as the parameter level set, and then substitutes the candidate assignments into the interlocking nodes. The logical condition expression is evaluated to filter and obtain the set of assignments that meet the interlock triggering condition and the set of assignments that meet the interlock non-triggering condition. Each assignment and the expected interlocking state are combined to form a suggested verification test case. The expected interlocking state is 1 in the triggering test case and 0 in the non-triggering test case. Each suggested verification test case records the test case number, interlocking identifier, signal point assignment list and expected interlocking state.
[0147] In the use case set reduction, first select key edges from the edge sequence of each influence propagation path and establish a key edge set. The key edge selection rule is fixed as follows: within the same path, the first propagation edge is selected according to the edge type priority from high to low, and when there are multiple edges with the same priority, the one closer to the change operation node in the path is selected, so as to ensure that each path corresponds to at least one key edge.
[0148] Simultaneously, the version difference results will be compared with the interlocking nodes. The associated difference terms are mapped to the set of clauses that must be covered and are associated with the set of clauses that must be covered. The location paths are associated to form a set of covered targets;
[0149] Subsequently, use case coverage relationships are constructed and a greedy set coverage algorithm is used to perform reduction. The greedy set coverage algorithm uses the number of uncovered targets as the reward function and selects suggested verification use cases that can add the most key edges and the most atomic condition clauses to the reduced use case set in each round until the coverage constraint is satisfied. The coverage constraint is fixed as follows: the key edge corresponding to each influence propagation path is covered by at least one suggested verification use case and at least one logical condition clause corresponding to each difference is covered by at least one suggested verification use case.
[0150] During the verification process, the reduced suggested verification cases are converted into test tasks and executed through the interface of the interlocking simulation system or interlocking test platform. The test task content is fixed and includes a sequence of signal point writing instructions, a sampling and holding time, and an interlocking output acquisition instruction. The sampling and holding time is fixed at 200ms to ensure the stability of the PLC or DCS scan cycle. During the execution, each signal point is written into the simulation or test environment according to the signal point assignment list, and the interlocking output status is acquired after the holding time ends. Then, the acquired interlocking output status is compared with the expected interlocking status and a verification result record is generated. The verification result record is fixed and includes the test case number, interlocking identifier, expected interlocking status, actual interlocking status, and consistency flag.
[0151] Finally, output the set of affected interlocks. The set of impact propagation paths for each interlocking node The reduced set of recommended verification test cases and the corresponding verification results.
[0152] In this specific implementation, the training of the self-supervised graph contrastive learning model is performed in the following order: sample construction, semantically preserved data augmentation, construction of positive and negative sample pairs, establishment of dual-granularity contrastive targets, and parameter optimization.
[0153] Obtain the interlocking data corresponding to multiple historical interlocking change samples, and store the pre-change interlocking data and post-change interlocking data of each historical interlocking change sample in pairs. The number of historical interlocking change samples is fixed. Each sample contains a programmable logic controller program or distributed control system interlock configuration, a signal point table, and historical interlock trigger records. Subsequently, S1 to S4 are executed sequentially for each historical interlock change sample to generate the corresponding change closure subgraph, and these are aggregated to obtain a training set of change closure subgraphs. ,in This represents the set of changed closed subgraphs used in training. Indicates the first Change closure subgraph corresponding to each historical interlocking change sample Indicates the sample sequence number and and will The sample sets were divided into training sets based on their sample numbers. With the validation set and Includes the first 7200 samples Includes the last 800 samples;
[0154] Then for each Perform semantically preserved data augmentation to generate the first augmented subgraph With the second enhanced subgraph The semantically preserved data enhancement consists of four parts in a deterministic order: synonymous signal mapping replacement, overall preservation of shared signal-related structures, preservation of dependency direction, and bounded perturbation of parameters before and after the change. Synonymous signal mapping replacement establishes a mapping table based on the signal point alias set in the signal point table of S1, replacing the primary identifier of the signal point node with its alias while maintaining its unified identifier, and synchronously updating the signal point identifier field in the logical reference relationship edge attributes connected to the signal point node to ensure reference consistency. Overall preservation of shared signal-related structures is achieved by freezing all signal-shared relationship edges and the inbound and outbound edge sets of their two endpoints, without performing edge or node discarding operations during the freezing period. Preservation of dependency direction is achieved by prohibiting edge direction reversal for control dependencies, data dependencies, and trigger causal relationships. Bounded perturbation only applies to the parameters before and after the change in the node attributes of the change operation, and applies to numerical parameters according to... The disturbance amplitude is subjected to an additive disturbance, and the disturbance result is clipped back to the legal range of the parameter, where This indicates the actual disturbance magnitude. Indicates the proportion of disturbance and takes This indicates the length of the valid range of the parameter, obtained by subtracting the lower bound from the upper bound of the parameter, and remains unchanged for non-numerical parameters;
[0155] Subsequently with the same generated and Construct positive sample pairs and use different The generated enhanced subgraphs are combined pairwise to construct negative sample pairs, and in the operation-level comparison, the difference record number of the changed operation node is used as the consistency key across the enhanced view to align the same changed operation node, thereby establishing the operation-level comparison target and the subgraph-level comparison target.
[0156] Subsequently, a self-supervised graph contrastive learning model is constructed and trained. The model consists of a graph encoder and a projection head, and the graph encoder uses the same method as in step S5. Layer relation graph convolutional network and extract hidden dimensions Furthermore, the relation type set and normalization rules are consistent with those in step S5 to ensure that the trained data can be directly used for encoding in step S5. The projection head uses a two-layer fully connected network and is fixed as follows: The dimensionality transformation is performed, and the intermediate layer activation function is ReLU, and the output is then processed. Normalization is performed to obtain a representation vector for contrastive learning;
[0157] In the construction of the loss function, the operational-level contrastive loss is used. Using cosine similarity and temperature parameters The normalized temperature cross-entropy loss is used, and the average of the change operation node representation vectors for all positive sample pairs in the same batch is calculated, along with the subgraph-level contrast loss. Using the same format and averaging the subgraph-level representation vectors of all positive sample pairs in the same batch, the final contrastive loss function is defined as:
[0158] ;
[0159] in Indicates the total comparative loss. Denotes the loss weighting coefficient and takes Indicates operational-level comparison loss. This represents the subgraph-level contrast loss;
[0160] The Adam optimizer was used during training with a fixed learning rate. And the weight decays to The batch size is fixed at 64 and the number of training rounds is fixed at 200, with the validation set as the basis. On The training is stopped early if the gradient norm does not decrease for 10 consecutive rounds, and a pruning upper limit of 1.0 is applied to stabilize the training. After training, the parameters of the graph encoder and the projector are fixed, and the graph encoder is used as the self-supervised graph contrastive learning model called in step S5 to output the operation-level representation vector and the subgraph-level representation vector.
[0161] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
[0162] This invention forms a closed loop between version management and graph intelligent analysis of interlocking engineering data: First, by extracting and fusing knowledge from the interlocking configuration, signal point table, and historical trigger records of programmable logic controller programs or distributed control systems, an interlocking knowledge graph with unified identifiers is constructed. This allows cross-document and cross-module relationships such as signal sharing, control dependence, data dependence, and trigger causality to be uniformly expressed and traceable. Under unified identifier alignment constraints, version graphs before and after changes are generated and version difference is performed. Furthermore, change operation nodes are generated at the granularity of the difference and associated with the changed objects to form a computable change operation graph. Subsequently, starting from the change operation nodes, multi-hop expansion is performed according to relational priority to form a change closure subgraph, which explicitly describes the scope of change propagation from a structural perspective. Then, through graph representation learning and anomaly detection, the propagation path and risk level are quantitatively evaluated, and the affected interlocking set, the impact propagation path, and suggested verification test cases are automatically output. This solves the problems of unclear impact scope after interlocking changes, difficulty in identifying chain reactions caused by signal sharing, and reliance on manual experience for pre-deployment verification, reducing the risk of accidental shutdowns and missed interlocks, and improving verification coverage and efficiency.
[0163] To address the aforementioned technical issues, this invention improves the algorithm structure for interlocking change scenarios in the following ways: First, it "operates" the traditional version difference results by introducing change operation nodes to construct an EditDeltaGraph. This allows the difference not only to describe object changes but also to serve as the starting point for propagation analysis, carrying parameters before and after the change to support subsequent interpretation and use case generation. Second, it proposes a ChangeClosure subgraph, which sets extension priorities and hop count limits for control dependencies, data dependencies, signal sharing, and trigger causality to suppress irrelevant extensions and highlight high-risk propagation links. Third, it introduces interlocking semantic fidelity enhancement and sets dual-granularity comparison targets at the operation level and subgraph level, enabling the model to maintain its ability to identify the overall propagation structure while learning local change patterns, thereby improving the accuracy of identifying abnormal changes. Fourth, it proposes a Minimum Anomaly Explanation Subgraph (MES), which obtains an explanation structure that cannot be further simplified under anomaly constraints through contribution calculation and iterative pruning. This makes the risk location and impact analysis results interpretable and verifiable, and more conducive to generating verification use cases covering key differences and key propagation edges, achieving better technical results.
Claims
1. A method for analyzing the impact of interlocking changes based on machine learning and knowledge graphs, characterized in that, include: S1. Obtain the interlocking data of the target production line or device, extract knowledge to obtain entities and relationships, and perform knowledge fusion on the entities to form a set of entities with unified identification, construct an interlocking knowledge graph, and obtain an initial knowledge graph; S2. Under the alignment constraint of the unified identifier, generate a version 1 knowledge graph based on the interlocking data before the interlocking change, and generate a version 2 knowledge graph based on the interlocking data after the interlocking change; S3. Perform version difference calculation on the version 1 knowledge graph and the version 2 knowledge graph to obtain the version difference result, construct a version difference graph based on the version difference result, generate change operation nodes for the version difference result, and establish association between the change operation nodes and the corresponding change objects to form a change operation graph on the version difference graph; S4. Using the change operation nodes as the expansion starting point, perform multi-hop expansion along the preset relationship type on the change operation graph to obtain a change closure subgraph containing the change propagation range; S5 S6. Input the changed closure subgraph into the graph representation learning model for encoding to obtain the operation-level representation vector corresponding to the changed operation node and the subgraph-level representation vector corresponding to the changed closure subgraph; S7. Calculate the anomaly score of the changed closure subgraph based on the operation-level representation vector and the subgraph-level representation vector, and determine the analysis subgraph used for impact analysis. When the anomaly score meets the preset anomaly conditions, extract the minimum anomaly explanation subgraph from the changed closure subgraph as the analysis subgraph; S8. Determine the affected interlock set based on the analysis subgraph and generate the impact propagation path, and generate the suggested verification test cases corresponding to the affected interlock set, outputting the affected interlock set, the impact propagation path, and the suggested verification test cases.
2. The method for analyzing the impact of interlocking changes based on machine learning and knowledge graphs according to claim 1, characterized in that, S1 includes: The interlocking data is acquired and its format is converted and its fields are normalized. For the interlocking configuration of the programmable logic controller program and the distributed control system, signal point identifiers, interlocking identifiers, device identifiers and logical condition expressions are extracted. For the signal point table, the correspondence between signal point identifiers and signal point aliases, signal point addresses and their respective device identifiers is extracted. For the historical interlocking trigger records, the trigger time, triggering interlocking identifier, associated signal point identifier and trigger result are extracted. After completing the format conversion and field normalization processing, knowledge extraction is performed. Based on the programmable logic controller program and the interlocking configuration of the distributed control system, entities are identified and entity attributes are generated. The entities include signal points, interlocks, devices, and logic blocks. Relationships are extracted based on the logical condition expression and relationship attributes are generated. The relationships include logical reference relationships, control dependency relationships, and data dependency relationships. Signal sharing relationships are extracted based on the case where multiple interlocks reference the same signal point. Trigger causal relationships are extracted based on the order of trigger times in the historical interlock trigger records and the correlation statistics within a preset time window. The preset time window is determined by the time interval distribution of adjacent trigger events in the historical interlock trigger records. The preset time window is the time length corresponding to a preset quantile of the time interval distribution or the time length corresponding to a linear combination of the mean and standard deviation of the time interval distribution. After the knowledge extraction is completed, the entities are fused based on the signal point table. Signal points with the same signal point address or alias correspondence are merged into signal points with unified identifiers. Devices with the same device identifier or name correspondence are merged into devices with unified identifiers. The fusion result is written back to the logical reference relationship, signal sharing relationship, control dependency relationship, data dependency relationship, and trigger causal relationship to obtain a set of entities with unified identifiers and a set of relationships corresponding to the set of entities with unified identifiers. The interlocking knowledge graph is constructed based on the set of entities with the unified identifier and the set of relationships corresponding to the set of entities with the unified identifier, thus obtaining the initial knowledge graph.
3. The method for analyzing the impact of interlocking changes based on machine learning and knowledge graphs according to claim 1, characterized in that, S2 include: Based on the interlocking data before the interlocking change, the version one knowledge graph is generated on the initial knowledge graph. Specifically, under the unified identifier alignment constraint of the initial knowledge graph, while retaining the unified identifier entity set and its corresponding relation set in the initial knowledge graph, the entity attributes and relation attributes involved in the interlocking data before the interlocking change are updated to the corresponding entities and relations in the initial knowledge graph, and a version one tag is recorded for the updated entities and relations. When the interlocking data before the interlocking change contains entities that do not exist in the initial knowledge graph, a new unified identifier is assigned to the entity and written into the version one knowledge graph; When an entity or relation in the initial knowledge graph no longer appears in the interlocking data before the interlocking change, the entity or relation is marked as invalid in version one. Based on the interlocking data after the interlocking changes, a version two knowledge graph is generated on the initial knowledge graph. Specifically, under the unified identifier alignment constraint of the initial knowledge graph, the entity attributes and relation attributes corresponding to the interlocking data after the interlocking changes are updated and version two tags are recorded in the initial knowledge graph. At the same time, new entities are processed according to the same unified identifier allocation rules as those used to generate the version one knowledge graph. Entities or relations that no longer appear in the interlocking data after the interlocking changes are marked as invalid in version two, thus obtaining the version one knowledge graph and the version two knowledge graph.
4. The method for analyzing the impact of interlocking changes based on machine learning and knowledge graphs according to claim 1, characterized in that, S3 includes: Entities are matched based on the unified identifiers of entities in the knowledge graph of version one and version two. Based on the matching results, entity attributes and relationships between entities are compared to generate version difference results. The version difference results record the difference type, the object to be changed, and the parameters before and after the change. The difference types include: entity addition, entity deletion, entity attribute parameter change, threshold parameter change, logical condition expression change, relationship addition, relationship deletion, relationship parameter change, and relationship direction change. A version difference graph is constructed based on the version difference results. The version difference graph includes entities and their relationships that appear in at least one of the version one knowledge graph and the version two knowledge graph. The entities and their relationships are labeled with difference tags corresponding to the difference type. For each difference in the version difference result, a change operation node is generated. The change operation node includes the difference type, the change object, the parameters before the change, and the parameters after the change. When the object to be changed is an entity, the change operation node is connected to the entity corresponding to the object to be changed through an associated edge; When the object to be changed is a relationship, the change operation node is connected to the starting entity and the ending entity of the relationship through associated edges, and the relationship type, the parameters before the change and the parameters after the change are recorded in the change operation node. A change operation diagram is formed on the version difference diagram.
5. The method for analyzing the impact of interlocking changes based on machine learning and knowledge graphs according to claim 1, characterized in that, S4 includes: The change operation node in the change operation diagram is determined as the expansion starting point, and the change object connected to the change operation node through the associated edge is determined as the first-level expansion object; According to the preset expansion rules, a multi-hop expansion is performed on the change operation graph. The expansion priority and expansion hop limit are set for control dependency, data dependency, signal sharing relationship and trigger causation relationship respectively. The expansion priority is control dependency higher than data dependency, higher than signal sharing relationship and higher than trigger causation relationship. In each layer of expansion, the relationship type to be expanded is determined according to the expansion priority from high to low. At the same time, only when the expansion hop limit of the corresponding relationship type is not reached, the adjacent nodes directly connected to the current expansion object through the relationship type are added to the next layer of expansion object. During multi-hop expansion, duplicate nodes that have already been added are deduplicated to avoid repeated expansion; The expansion is terminated when the multi-hop expansion reaches the upper limit of the expansion hop count or when there are no adjacent nodes that meet the expansion conditions. The nodes and edges involved in the expansion process are aggregated to form the modified closed subgraph.
6. The method for analyzing the impact of interlocking changes based on machine learning and knowledge graphs according to claim 1, characterized in that, S5 include: The node attributes, edge attributes, and topology of the changed closure subgraph are organized into model input features. The node attributes include signal point attributes, interlocking attributes, equipment attributes, and the change type, parameters before and after the change of the change operation node. The edge attributes include logical reference relationships, signal sharing relationships, control dependency relationships, data dependency relationships, trigger causal relationships, relationship type identifiers, and associated edge identifiers. Based on the input features of the model, the self-supervised graph contrastive learning model is invoked to encode the changed closure subgraph, generating an operation-level representation vector corresponding to each change operation node and a subgraph-level representation vector corresponding to the changed closure subgraph. The operation-level representation vector represents the structure and attribute information of the change operation node and its local neighborhood, and the subgraph-level representation vector represents the overall structure and attribute information of the changed closure subgraph.
7. The method for analyzing the impact of interlocking changes based on machine learning and knowledge graphs according to claim 1, characterized in that, S6 include: Based on a pre-established normal change baseline distribution, the operation-level representation vector and the subgraph-level representation vector are converted into anomaly metrics, wherein the normal change baseline distribution is obtained by statistically analyzing the operation-level representation vector and the subgraph-level representation vector corresponding to historical changes; The anomaly score of the changed closure subgraph is calculated based on the anomaly metric, and the anomaly score is compared with the preset threshold, wherein the preset threshold is determined according to the normal change baseline distribution, and the preset threshold is the anomaly score threshold corresponding to the preset quantile of the normal change baseline distribution, or is a linear combination of the mean and standard deviation of the normal change baseline distribution; When the abnormal score is not lower than the preset threshold, the contribution of each node and each edge in the changed closure subgraph is calculated. The contribution calculation includes masking the node or the edge and recalculating the abnormal score. The contribution of the node or the edge is determined based on the difference between the abnormal scores before and after masking. Iterative pruning is performed based on the contribution degree. In each pruning, nodes or edges with a contribution degree lower than a preset contribution threshold are removed. The preset contribution threshold is determined based on the normalization result of the contribution degree of each node and edge, or based on the nodes or edges whose contribution degree ranking is after a preset proportion. After pruning, the anomaly score is recalculated. If the recalculated anomaly score is still not lower than the preset threshold, pruning continues until there are no nodes or edges that meet the pruning conditions, thus obtaining the minimum anomaly explanation subgraph. The minimum anomaly interpretation subgraph is determined as the analysis subgraph.
8. The method for analyzing the impact of interlocking changes based on machine learning and knowledge graphs according to claim 1, characterized in that, S7 includes: Nodes whose entity type is interlocked are selected from the analysis subgraph and aggregated into an affected interlock set; In the analysis subgraph, starting from the change operation node and ending at the interlocking node in the affected interlocking set, a path search is performed based on the control dependency, the data dependency, the signal sharing relationship, and the triggering causal relationship to obtain at least one impact propagation path. The node sequence and edge sequence in each impact propagation path are recorded as the impact propagation path. For each interlocking node in the affected interlocking set, extract the signal point nodes that are directly or indirectly connected to the interlocking node in the analysis subgraph, and read the parameters before and after the change recorded in the change operation node, as well as the value range information and logical condition expression of the signal point nodes. Generate a combination of signal point values that satisfies the interlocking triggering condition and the interlocking non-triggering condition based on the logical condition expression, and combine the combination of signal point values with the corresponding expected interlocking state to form the suggested verification test case. The suggested verification test cases are converted into test tasks that can be executed by the interlocking simulation system or the interlocking test platform and then sent out for execution to verify the interlocking configuration of the programmable logic controller program or the distributed control system, collect the interlocking output and compare it with the expected interlocking state to generate verification results; Output the set of affected interlocks, the suggested verification test cases, the impact propagation path, and the verification results.
9. The method for analyzing the impact of interlocking changes based on machine learning and knowledge graphs according to claim 1, characterized in that, The training of the self-supervised graphical contrastive learning model includes the following steps: Acquire interlocking data corresponding to multiple historical interlocking change samples, and generate corresponding change closure subgraphs for each historical interlocking change sample according to S1 to S4, obtaining a training set of change closure subgraphs; using the training set of change closure subgraphs as input, perform semantic-preserving data augmentation on each training change closure subgraph to generate a first augmented subgraph and a second augmented subgraph, wherein the semantic-preserving data augmentation includes: synonymous signal mapping replacement based on signal point table, overall preservation of shared signal correlation structure, preservation of dependency direction, and bounded perturbation of parameters before and after the change, wherein the bounded perturbation... The perturbation amplitude does not exceed a preset perturbation threshold; positive sample pairs are constructed using the first and second enhanced subgraphs of the same training modified closure subgraph, and negative sample pairs are constructed using different training modified closure subgraphs, establishing operational-level and subgraph-level contrast targets; the self-supervised graph contrast learning model is obtained by training with the positive sample pairs, the negative sample pairs, the operational-level contrast targets, and the subgraph-level contrast targets as inputs and optimizing the contrast loss function, wherein the contrast loss function is a weighted sum of operational-level contrast loss and subgraph-level contrast loss, and the weights of the weighted sum are preset weights or determined through validation set optimization.
10. The method for analyzing the impact of interlocking changes based on machine learning and knowledge graphs according to claim 8, characterized in that, The generation of the suggested verification test cases includes: generating boundary value combinations based on the threshold for cases where the threshold parameter changes or the logical condition expression contains threshold comparisons, and generating coverage combinations by using a pairwise combination strategy for multiple signal points associated with the same interlocking node; After generation, the test case set is reduced based on the coverage constraint, which is used to ensure that at least one critical edge in each influence propagation path and at least one logical conditional clause corresponding to each difference are covered by at least one suggested verification test case.