An elevator abnormality description text analysis method constrained by a knowledge graph

CN123031731APending Publication Date: 2026-11-03GUANGDONG SPECIAL EQUIP TESTING INST FOSHAN TESTING INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611533442.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-30
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

Existing methods for parsing elevator anomaly descriptions suffer from issues such as colloquial language, unstructured format, missing fields, inconsistent terminology, and incomplete context. Furthermore, these methods struggle to effectively utilize elevator expertise and component relationships, resulting in insufficient accuracy and reliability of the parsing results.

Method used

The method of knowledge graph constraint is adopted. By constructing a multi-dimensional heterogeneous knowledge graph of elevators, semantic matching of entity nodes and search of associated paths are performed. The reasoning process of the large language model is constrained by the topological penalty mask matrix, and the parsing results are verified and iteratively corrected by combining relation rules.

Benefits of technology

This improves the accuracy, reliability, and interpretability of elevator anomaly description text parsing, providing reliable structured data support for intelligent elevator detection, risk assessment, and fault diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123031731A_ABST
    Figure CN123031731A_ABST
Patent Text Reader

Abstract

The application relates to the elevator technical field, and in particular to an elevator abnormality description text analysis method constrained by a knowledge graph. The method comprises the following steps: constructing an elevator multi-element heterogeneous knowledge graph, establishing entity nodes, relationship rules and directed relationship edges, and generating node semantic vectors; obtaining elevator abnormality description text and performing pretreatment to generate abnormality semantic vectors; constructing a local knowledge subgraph through semantic matching and associated path searching, and extracting candidate relationship triplets; generating a topological penalty mask matrix according to the topological path distance between the entity nodes; inputting the elevator abnormality description text and the candidate relationship triplets into a large language model, and constraining model reasoning by using the topological penalty mask matrix; extracting relationship triplets to be checked from the candidate analysis results, and calculating a graph consistency score; when the score meets the condition, outputting the analysis result, otherwise, performing error correction feedback and iterative reasoning. The application can improve the accuracy, reliability and explainability of elevator abnormality description text analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of elevator technology, and in particular to a method for parsing elevator anomaly description text constrained by knowledge graph. Background Technology

[0002] In recent years, elevator inspection and testing services have gradually moved towards digital recording, intelligent analysis, and structured assessment. During supervisory inspections, periodic inspections, and safety assessments, inspection personnel need to record elevator malfunctions, component abnormalities, and safety device anomalies. Because inspection sites may be located in complex environments such as machine rooms, shafts, car tops, or pits, on-site recording often relies on mobile terminal voice transcription or rapid manual input. The resulting anomaly descriptions typically suffer from issues such as colloquialism, unstructured format, missing fields, inconsistent terminology, and incomplete context. Therefore, it is necessary to accurately parse elevator anomaly descriptions into structured information that can be processed by computers to support inspection report generation, hazard archiving, and safety assessments.

[0003] Existing methods for parsing abnormal text often employ keyword matching, rule templates, text classification models, or general-purpose large language models. Keyword matching and rule templates are highly sensitive to speech recognition errors, industry abbreviations, dialectal slang, and misspellings, easily leading to missed or incorrect field extraction due to different expressions such as "brake," "holding brake," and "brake." Furthermore, elevators involve multiple systems, including mechanical transmission, electrical control, safety circuits, door interlocking, and braking protection. The relationships between components, states, and faults are complex, making it difficult for fixed rules to comprehensively cover all aspects and resulting in high maintenance costs. While general-purpose large language models possess strong semantic understanding capabilities, they primarily rely on textual context for reasoning, lacking effective constraints from elevator expertise and component relationships, potentially producing semantically reasonable but inconsistent parsing results.

[0004] Existing knowledge graph-assisted text parsing methods can improve entity recognition and knowledge retrieval capabilities by leveraging domain entity and relation information. However, most methods primarily use knowledge graphs for entity recall, relation querying, or auxiliary prompts, failing to fully utilize the topological connections between entities to constrain the model's reasoning process. For anomaly descriptions involving multiple components, multi-level abnormal states, or risk transmission relationships, relying solely on semantic similarity may still lead to association errors. Furthermore, existing methods typically lack further verification of the entity relationships generated by the model, combining graph relation rules and the degree of topological association. When relation conflicts occur in the generated results, it is difficult to make targeted corrections based on the conflict information.

[0005] Therefore, it is necessary to propose a knowledge graph-constrained method for parsing elevator anomaly description text. This method incorporates elevator domain knowledge, entity relationships, and graph topology information into the text parsing process, constrains and verifies the reasoning results of the large language model, and corrects conflicting parsing results to improve the accuracy, reliability, and interpretability of elevator anomaly description text parsing. Summary of the Invention

[0006] The purpose of this invention is to propose a knowledge graph-constrained method for parsing elevator anomaly description text. This method performs semantic matching and association path search between the elevator anomaly description text and entity nodes in the knowledge graph. A topological penalty mask matrix is ​​constructed based on the topological relationships of the knowledge graph to constrain the reasoning process of the large language model. Furthermore, the parsing results are validated for consistency and conflict correction by combining relational rules and topological penalties. This improves the accuracy, reliability, and interpretability of the anomaly description text parsing, providing structured text data support for intelligent elevator detection, risk assessment, and fault diagnosis.

[0007] To achieve this objective, the present invention adopts the following technical solution:

[0008] A knowledge graph-constrained method for parsing elevator anomaly description text includes the following steps:

[0009] S1: Construct a multi-dimensional heterogeneous knowledge graph of elevators that includes entity nodes and entity node attributes, and generate node semantic vectors based on the information encoded by entity node attributes;

[0010] S2: Obtain the elevator anomaly description text and preprocess it to encode and generate an anomaly semantic vector;

[0011] S3: Determine the initial entity nodes based on the semantic matching relationship between the anomaly semantic vector and the node semantic vector, construct a local knowledge subgraph through associated path search and extract candidate relation triples;

[0012] S4: Calculate the topological path distance between entity nodes in the local knowledge subgraph and generate a topological penalty mask matrix according to the preset distance-penalty mapping function;

[0013] S5: Input the elevator anomaly description text and candidate relation triples into the large language model, use the topological penalty mask matrix to constrain the model reasoning, and generate structured candidate parsing results;

[0014] S6: Extract the triplet of the relation to be verified from the structured candidate parsing results, and calculate the graph consistency score based on the relation rule matching results and the topology penalty value;

[0015] S7: If the map consistency scores all reach the preset threshold, output the parsing results; otherwise, generate error correction prompts and update the topology penalty mask matrix to S5 for iterative reasoning.

[0016] Furthermore, step S1 includes:

[0017] S11: Constructing a diverse and heterogeneous knowledge graph for elevators ,in, For a set of entity nodes, For entity node attribute collection, For a set of relation types, For a set of relational rules, It is a set of directed edges;

[0018] The method for configuring relationship rules is as follows: based on the allowed relationship types and connection directions between entity nodes, determine the head entity type at the beginning of the relationship and the tail entity type at the end of the relationship, and configure the set of relationship rules;

[0019] Establish a set of directed relation edges based on relation rules. Each directed relation edge corresponds to a relation triple consisting of a head entity, a relation type, and a tail entity.

[0020] S12: Extract the semantic attribute fields from the attributes of each entity node in the elevator multivariate heterogeneous knowledge graph, concatenate the semantic attribute fields from the entity node attributes, and generate node semantic vectors through a semantic encoding model.

[0021] Furthermore, step S3 includes:

[0022] S31: Read the abnormal semantic vector and the node semantic vector of the entity node, and use cosine similarity to calculate the semantic matching degree between the two;

[0023] S32: Filter entity nodes that meet the preset matching conditions based on semantic matching degree, and generate an initial set of entity nodes;

[0024] S33: Starting with each entity node in the initial entity node set, perform forward and reverse searches along the directed relation edges in the elevator multi-dimensional heterogeneous knowledge graph to obtain candidate associated paths whose path hop count does not exceed a preset threshold.

[0025] S34: Deduplicate and merge the directed relation edges in the candidate association paths, and construct a local knowledge subgraph based on the deduplicated and merged directed relation edges; extract the relation triples of the directed relation edges in the local knowledge subgraph and determine them as candidate relation triples.

[0026] Furthermore, step S4 includes:

[0027] S41: Form a node pair from any two entity nodes in the local knowledge subgraph, perform a path search along the directed relation edge between the two entity nodes in the node pair, and calculate the topological path distance between the two entity nodes based on the path search results.

[0028] S42: Calculate the node-level topology penalty value by mapping the topology path to the preset distance-penalty function;

[0029] S43: According to the index order of entity nodes in the local knowledge subgraph, write the topology penalty value into the corresponding position of the matrix to construct the topology penalty mask matrix.

[0030] Furthermore, step S5 includes:

[0031] S51: Combine the elevator anomaly description text and candidate relation triples according to the preset input format, and perform lexicalization to obtain the input lexical sequence; perform lexicalization on the node names of entity nodes in the node pair to generate a node lexical sequence, and match the node lexical sequence with the input lexical sequence to determine the set of lexical positions of entity nodes in the input lexical sequence;

[0032] S52: Based on the set of lexical positions of node pairs, map the node-level topological penalty values ​​in the topological penalty mask matrix to the corresponding lexical positions to construct a lexical-level topological penalty mask matrix;

[0033] S53: Input the input word sequence into the large language model for inference to generate structured candidate parsing results. In the attention calculation of at least one self-attention layer of the large language model, a word-level topological penalty mask matrix is ​​introduced to correct the topological penalty of the attention scores between words. The attention output is calculated based on the corrected attention weights.

[0034] Furthermore, in step S53, the attention calculation formula for topological penalty correction of attention scores between word units is as follows:

[0035] ,

[0036] ,

[0037] in, This is the attention weight matrix after topological penalty correction. , and These are the query matrix, key matrix, and value matrix of the self-attention layer, respectively. To query the feature dimensions of the vector and key vector, This is the original attention mask matrix of the large language model. This is the topological penalty adjustment coefficient. This represents the matrix transpose operation. Key matrix The transpose of the matrix, For normalized exponential functions, This is the attention output after topological penalty constraints.

[0038] Furthermore, the structured candidate parsing result of step S53 includes at least entity node fields, relation triplet fields, and anomaly semantic parsing description fields;

[0039] The entity node field records the name and type of the entity node identified from the anomaly description text and involved in the parsing; the relation triple field records the association between entity nodes; and the anomaly semantic parsing description field records the meaning of the anomaly.

[0040] Furthermore, step S6 includes:

[0041] S61: Extract the head entity, relation type, and tail entity from the relation triplet fields of the structured candidate parsing results to form the relation triplet to be verified;

[0042] S62: Retrieve the entity types of the head and tail entities in the elevator multi-dimensional heterogeneous knowledge graph, form relation rules with the relation types and the obtained head and tail entity types, and match them with the relation rule set in the elevator multi-dimensional heterogeneous knowledge graph to obtain relation rule matching results;

[0043] S63: Entity nodes retrieved in the local knowledge subgraph based on the entity node names of the head and tail entities, and topology penalty values ​​read from the topology penalty mask matrix based on the entity node index;

[0044] S64: Calculate the graph consistency score for each triplet of the relation to be verified based on the relation rule matching results and the topology penalty value.

[0045] Furthermore, step S7 includes:

[0046] S71: Score the graph consistency of each triplet to be verified. Each with a preset threshold Compare; if all the triples of the relation to be verified satisfy... If the current candidate parsing result is correct, then the final parsing result is determined and output; otherwise, extract... The triplet pairs of relations to be verified form a set of conflicting triplet pairs;

[0047] S72: Based on the entity node names of the head and tail entities of each conflicting triplet in the set of conflicting triplets, retrieve entity nodes in the local knowledge subgraph; when entity nodes are retrieved for both the head and tail entities and the relation rules are successfully matched, update the topology penalty value of the topology penalty mask matrix.

[0048] S73: Write the updated topology penalty value into the corresponding row and column positions of the topology penalty mask matrix to generate the updated topology penalty mask matrix; at the same time, convert the set of conflict triples into conflict feedback information according to a preset format;

[0049] S74: Feed back the conflict feedback information and the updated topology penalty mask matrix to step S5. In step S5, combine the conflict feedback information, elevator anomaly description text and candidate relation triples according to the preset input format, use the updated topology penalty mask matrix to constrain the model reasoning, and generate new structured candidate parsing results; then execute steps S6 and S7.

[0050] Iterate until the map consistency score reaches the preset threshold; when there are still conflicting triples after the number of iterations reaches the maximum value, stop iterating and mark the current candidate parsing result as a parsing result to be manually reviewed.

[0051] Furthermore, in step S73, the head entity, relation type, tail entity, relation rule matching result and corresponding graph consistency score in the set of conflict relation triples are read and organized into conflict feedback information according to preset feedback fields;

[0052] The fields in the conflict feedback information include at least the conflict relationship triple, the cause of the conflict, and the re-parsing requirement.

[0053] The technical solution provided by this invention may include the following beneficial effects:

[0054] This invention effectively associates elevator anomaly description text with a multi-dimensional heterogeneous knowledge graph, and uses the graph topological relationships to constrain the reasoning process of the large language model. At the same time, it combines relational rules and graph consistency scores to verify and iteratively correct the parsing results, thereby improving the accuracy, reliability and interpretability of anomaly description text parsing. It provides a reliable structured data foundation for elevator intelligent detection, risk assessment and fault diagnosis, and has great engineering application value and promotion prospects. Attached Figure Description

[0055] Figure 1 This is a flowchart illustrating a knowledge graph-constrained elevator anomaly description text parsing method according to an embodiment of the present invention.

[0056] Figure 2This is a schematic diagram of the elevator multi-heterogeneous knowledge graph construction and node semantic vector generation process in step S1 of one embodiment of the present invention;

[0057] Figure 3 This is a flowchart illustrating the elevator anomaly description text preprocessing and anomaly semantic vector generation in step S2 of one embodiment of the present invention.

[0058] Figure 4 This is a flowchart illustrating the construction of a local knowledge subgraph and extraction of candidate relation triples in step S3 of one embodiment of the present invention.

[0059] Figure 5 This is a flowchart illustrating step S4 of an embodiment of the present invention, which generates a topological penalty mask matrix according to a preset distance-penalty mapping function.

[0060] Figure 6 This is a flowchart illustrating step S5 of an embodiment of the present invention, which involves using a topological penalty mask matrix constraint model to generate structured candidate parsing results.

[0061] Figure 7 This is a flowchart illustrating step S6 of the present invention, which calculates the graph consistency score based on the relational rule matching result and the topological penalty value.

[0062] Figure 8 This is a schematic diagram of the conflict feedback iteration process in step S7 of one embodiment of the present invention. Detailed Implementation

[0063] This invention introduces a knowledge graph topological constraint and a reverse verification mechanism for parsing results. It semantically matches the elevator anomaly description text with entity nodes in a multi-dimensional heterogeneous elevator knowledge graph, using the semantic matching results to determine initial entity nodes. Then, it searches for associated paths along directed relation edges, thereby separating local knowledge related to the current anomaly from the full knowledge graph. Furthermore, it generates a topological penalty mask matrix based on the directed topological path distance between entity nodes in the local knowledge subgraph, and maps the node-level topological penalty to the word-level attention calculation of the large language model, ensuring that entity words with large topological distances or those that are unreachable receive lower association weights. After the model generates structured candidate parsing results, it uses relational rules and topological penalty values ​​in the knowledge graph to calculate the graph consistency score of the relation triples to be verified. For conflicting relation triples that do not reach the threshold, it generates error correction information and updates the topological penalty mask matrix, feeding it back to the large language model for iterative reasoning. This forms a closed-loop parsing process of "semantic matching - local graph retrieval - topological constraint reasoning - graph consistency verification - conflict feedback correction", reducing entity mismatch, relation mismatch and cross-system erroneous association caused by relying solely on text semantics.

[0064] The present invention will be further illustrated below with reference to specific embodiments. It should be understood that the specific embodiments described herein are for illustrative and explanatory purposes only and are not intended to limit the present invention.

[0065] Reference Figure 1 An embodiment of the present invention provides a method for parsing elevator anomaly description text constrained by knowledge graphs, comprising the following steps:

[0066] S1: Construct a multi-dimensional heterogeneous knowledge graph of elevators that includes entity nodes and entity node attributes, and generate node semantic vectors based on the information encoded by entity node attributes;

[0067] S2: Obtain the elevator anomaly description text and preprocess it to encode and generate an anomaly semantic vector;

[0068] S3: Determine the initial entity nodes based on the semantic matching relationship between the anomaly semantic vector and the node semantic vector, construct a local knowledge subgraph through associated path search and extract candidate relation triples;

[0069] S4: Calculate the topological path distance between entity nodes in the local knowledge subgraph and generate a topological penalty mask matrix according to the preset distance-penalty mapping function;

[0070] S5: Input the elevator anomaly description text and candidate relation triples into the large language model, use the topological penalty mask matrix to constrain the model reasoning, and generate structured candidate parsing results;

[0071] S6: Extract the triplet of the relation to be verified from the structured candidate parsing results, and calculate the graph consistency score based on the relation rule matching results and the topology penalty value;

[0072] S7: If the map consistency scores all reach the preset threshold, output the parsing results; otherwise, generate error correction prompts and update the topology penalty mask matrix to S5 for iterative reasoning.

[0073] Step S1 of this invention is used to convert multi-source heterogeneous knowledge in the elevator field into a knowledge graph with clear entity relationships and unified semantic representation. Through entity node classification, relationship rule configuration, and directed relation edge establishment, knowledge in areas such as elevator equipment, abnormal states, fault phenomena, and risk management is structurally associated. Simultaneously, the attribute information of entity nodes is semantically encoded to generate node semantic vectors that can participate in computation, thereby solving the problems of difficulty in uniformly expressing heterogeneous knowledge relationships and difficulty in directly semantically matching graph entities with abnormal description text. Therefore, subsequent steps can perform entity recall based on node semantic vectors and utilize the graph relationship structure to implement association path search, topological constraints, and parsing result verification. (Refer to...) Figure 2 In one embodiment of the present invention, step S1 includes:

[0074] S11: Constructing a diverse and heterogeneous knowledge graph for elevators , For a set of entity nodes, For entity node attribute collection, For a set of relation types, For a set of relational rules, It is a set of directed edges;

[0075] The method for configuring relationship rules is as follows: based on the allowed relationship types and connection directions between entity nodes, determine the head entity type at the beginning of the relationship and the tail entity type at the end of the relationship, and configure the set of relationship rules;

[0076] Establish a set of directed relation edges based on relation rules. Each directed relation edge corresponds to a relation triple consisting of a head entity, a relation type, and a tail entity.

[0077] S12: Extract the semantic attribute fields from the attributes of each entity node in the elevator multivariate heterogeneous knowledge graph, concatenate the semantic attribute fields from the entity node attributes, and generate node semantic vectors through a semantic encoding model.

[0078] As an example, a heterogeneous knowledge graph of elevators is constructed using the Neo4j graph database. First, entity objects are classified according to elevator domain knowledge, and corresponding node labels are created in the Neo4j graph database. Then, node attributes are configured for different categories of entity nodes, and directed edges between nodes are established according to preset relationship rules. Finally, node description text is generated based on the semantic fields in the node attributes, node semantic vectors are generated through a preset semantic encoding model, and the node semantic vectors are stored in the graph database as node extended attributes.

[0079] This invention constructs a multi-dimensional heterogeneous knowledge graph of elevators, which includes various entities such as elevator systems, equipment components, abnormal states, fault phenomena, risk events, standard clauses, inspection items, handling measures, and sources of evidence. It configures the relationship rules between entity types and establishes specific directed relationship edges. At the same time, it generates node semantic vectors based on entity node attributes. This transforms the scattered and heterogeneous elevator domain knowledge into a unified knowledge space with both structural association and semantic representation capabilities, providing a reliable knowledge foundation for semantic matching and relationship verification of abnormal texts.

[0080] In step S11, multi-source heterogeneous knowledge, including elevator systems, equipment components, abnormal states, fault phenomena, risk events, standard clauses, inspection items, handling measures, and evidence sources, is transformed into a structured knowledge representation with entity relationships and semantic attribute information. This provides a knowledge foundation for subsequent entity matching, association path search, and consistency verification of parsing results in the anomaly description text. The multi-source heterogeneous knowledge graph of the elevator is represented as follows: ;in, For a set of entity nodes, For entity node attribute collection, For a set of relation types, For a set of relational rules, Let be the set of directed edges.

[0081] The methods for constructing entity nodes, configuring entity node attributes, configuring relationship types, configuring relationship rules, and establishing directed relationship edges in this embodiment of the invention are as follows.

[0082] (1) Entity node construction

[0083] This invention collects textual data from fields such as elevator product technical documents, inspection and testing reports, risk assessment reports, accident cases, fault handling records, and relevant standards and specifications. It then performs entity recognition on objects with independent semantics that can be identified, associated, or output during the anomaly description parsing process, forming a set of entity nodes V in a knowledge graph. The entity recognition method can employ rule-based matching, machine learning models, or deep learning models; this invention does not limit this approach. For example, from a risk assessment report, the anomaly description "the brake did not reach a fully open state during release, causing the elevator to vibrate during operation" is extracted. Here, "brake" is entityized as a component node, "brake not fully open" is entityized as an abnormal state node, and "vibration" is entityized as a fault phenomenon node.

[0084] As an example, create the following node labels in the Neo4j graph database based on entity type:

[0085] 1. The ElevatorSystem tag is used to store elevator system nodes, including "Traction System", "Door System", "Car System" and "Control System", etc.

[0086] 2. The Component tag is used to store device component nodes, including "brake", "traction machine", "leveling sensor" and "door lock device", etc.

[0087] 3. The AbnormalState tag is used to store abnormal state nodes, including "brake not fully open", "leveling signal abnormal" and "door lock circuit disconnected", etc.

[0088] 4. The FaultPhenomenon tag is used to store fault phenomenon nodes, including "operational jitter", "elevator stop offset", "repeated return to base station" and "abnormal door opening and closing", etc.

[0089] 5. The RiskEvent tag is used to store risk event nodes, including "risk of unexpected movement of the car", "risk of people being trapped", "risk of overshooting", and "risk of bottoming out".

[0090] 6. The StandardClause tag is used to store standard clause nodes, including "Brake Action Performance Requirements", "Door Lock Electrical Safety Requirements", and "Leveling Accuracy Requirements", etc.

[0091] 7. The InspectionItem tag is used to store inspection item nodes, including "Brake Inspection", "Leveling Accuracy Inspection" and "Door Lock Circuit Test", etc.

[0092] 8. The DisposalMeasure tag is used to store disposal measure nodes, including "stop the elevator and check the brake", "adjust the leveling sensor" and "replace the door lock device", etc.

[0093] 9. The EvidenceSource tag is used to store evidence source nodes, including "periodic inspection reports", "accident case records", "maintenance records" and "risk assessment reports", etc.

[0094] (2) Entity node attribute configuration

[0095] After constructing the entity nodes, configure a set of node attributes A for each entity node to describe its basic information, system, applicable environment, and status characteristics. Each entity node is configured with a unique node identifier, node name, and entity type, and at least one of the following attributes is selected based on the entity type: synonym name, system, applicable operating conditions, status description, threshold information, clause number, and source information.

[0096] As an example, for the abnormal state node "Brake not fully open", it is set as an AbnormalState tag node in the Neo4j graph database, and the node attribute fields are configured in key-value pairs. Specifically, the node identifier `node_id` is set to "V-AS-001", the node name `name` is set to "Brake not fully open", the entity type `entity_type` is set to "Abnormal State", the synonyms are set to an array of strings containing "Brake not fully open" and "Brake has dragging condition", the system is set to "Traction System", the applicable conditions are set to an array of strings containing "Start" and "Run", the description is set to "Brake not fully open during opening process", and the source information is set to "Risk Assessment Report". Specifically, the attributes of this entity node can be stored in the Neo4j graph database in the following format:

[0097] (:AbnormalState {

[0098] node_id: "V-AS-001",

[0099] Name: "Brake not fully open"

[0100] entity_type: "Abnormal state",

[0101] Synonyms: ["Brake not fully released", "Brake is dragging"],

[0102] system: "Traction System"

[0103] conditions: ["Startup", "Running"],

[0104] Description: "The brake did not reach a fully open state during the opening process".

[0105] Source: "Risk Assessment Report"

[0106] }).

[0107] (3) Relationship type configuration

[0108] After completing the construction and attribute configuration of entity nodes, a set of relationship types R is configured for the entity nodes based on the structural relationships of the elevator system, the evolution of abnormal states, the fault manifestation process, and the risk transmission path. The set of relationship types R includes 10 relationship types: system composition relationship, component state relationship, state evolution relationship, functional impact relationship, fault manifestation relationship, risk transmission relationship, standard constraint relationship, inspection and identification relationship, risk handling relationship, and evidence support relationship.

[0109] Among them, the system composition relationship describes the hierarchical relationship between elevator system nodes and equipment component nodes, such as the composition relationship between "traction system" and "brake"; the component state relationship describes the state association relationship between equipment component nodes and abnormal state nodes, such as the association between "brake" and "incomplete brake release"; the state evolution relationship describes the evolution relationship between different abnormal state nodes during operation, such as the evolution from "slow brake response" to "incomplete brake release"; the functional impact relationship describes the relationship between abnormal state nodes and the elevator's functional state, such as the impact of "incomplete brake release" on "abnormal braking function"; the fault manifestation relationship describes the manifestation association relationship between equipment components or abnormal state nodes and external fault phenomenon nodes, such as the fault manifestation relationship between "abnormal brake" and "operating vibration"; risk. The transmission relationship describes the evolutionary relationship from the fault phenomenon node to the risk event node, such as the risk transmission relationship from "operational jitter" to "risk of unexpected car movement"; the standard constraint relationship describes the constraint relationship between the standard clause node and the equipment status, inspection requirements, or safety requirements, such as the constraint relationship between "brake action performance requirements" and "brake inspection items"; the inspection identification relationship describes the identification relationship between the inspection item node and the abnormal state node, such as the identification relationship between "brake action inspection" and "incomplete brake release"; the risk handling relationship describes the correspondence between the risk event node and the handling measure node, such as the handling relationship between "risk of unexpected car movement" and "stopping the elevator to check the brake"; the evidence support relationship describes the support relationship between the evidence source node and the entity node, such as the evidence support relationship between "inspection report" and "incomplete brake release".

[0110] As an example, in the Neo4j graph database, corresponding relation type identifiers are pre-set for the above relation types. When establishing directed relation edges between entity nodes, the corresponding relation type identifier is used as the relation type of the relation edge. For example, the system composition relation can be set as the SYSTEM_COMPONENT identifier. In this way, the relation types defined in the relation type set R are mapped to the relation type identifiers in the Neo4j graph database, so that the association semantics between different entity nodes can be stored as directed relation edges with clear types and directions, and provide a foundation for subsequent relation rule configuration and relation triple construction.

[0111] (4) Configuration of relation rules

[0112] In determining the set of relation types Then, based on the allowed relationship types and connection directions between entity nodes, determine the head entity type corresponding to the start end of the relationship and the tail entity type corresponding to the end of the relationship, and configure the relationship rule set: ;in, For indexing relational rules, For the number of relation rules, For the first The header entity type corresponding to each relation rule. For the first The relation type corresponding to each relation rule. For the first The tail entity type corresponding to each relation rule;

[0113] As an example, in the Neo4j graph database, a `RelationRule` rule tag is set up to store relationship rules, and attributes such as rule_id, head_type, relation_name, relation_type, and tail_type are configured in key-value pairs. For the association relationship of abnormal component states, the relationship rule is configured as: [device component node, component state relationship, abnormal state node]; where the rule_id is set to "QR-001", the head_type to "Component", the relation_name to "Component State Relationship", the relation_type to "PART_STATE", and the tail_type to "AbnormalState". This restricts the `Component` tag entity node to be connected to the `AbnormalState` tag entity node through a directed relation of type `PART_STATE`. Specifically, this relationship rule can be stored in the Neo4j graph database in the following form:

[0114] (:RelationRule {

[0115] rule_id: "QR-001",

[0116] head_type: "Component",

[0117] relation_name: "Component Status Relationship",

[0118] relation_type: "PART_STATE",

[0119] tail_type: "AbnormalState"

[0120] }).

[0121] When establishing directed relation edges between entity nodes, the corresponding relation rules can be retrieved based on the head entity type identifier, relation type identifier, and tail entity type identifier. After a successful match, a directed relation edge of the corresponding type and direction is established.

[0122] (5) Establishing directed relation edges

[0123] After configuring the relationship rules, a set of directed relationship edges is established between entity nodes that satisfy the relationship rules, based on the actual relationships between them. Set of directed edges satisfy Any directed relation edge consists of a head entity, a relation type, and a tail entity forming a relation triple. ;in, Indicates the head entity. Indicates the relation type, Indicates the tail entity. This is the index for directed edges.

[0124] As an example, for the "Brake" node and the "Brake Not Fully Opened" node, firstly, the corresponding entity nodes are retrieved from the Neo4j graph database based on the node identifier, and their entity types are read as "Equipment Component Node" and "Abnormal State Node," respectively. Matching is then performed according to pre-configured relationship rules to determine if the two satisfy the relationship rule [Equipment Component Node, Component State Relationship, Abnormal State Node]. After successful matching, a directed relationship edge of type "Component State" is established between "Brake" as the head entity and "Brake Not Fully Opened" as the tail entity, thus forming a relationship triple:

[0125] .

[0126] Similarly, for the nodes "brake not fully open" and "operational jitter", relation triples can be generated according to the pre-configured relation rules:

[0127] .

[0128] This ultimately forms an abnormal association path:

[0129] .

[0130] Using the above method, entity information and related information in elevator domain text are transformed into a multi-dimensional heterogeneous knowledge graph containing entity nodes, node attributes, relationship types, relationship rules, and directed relationship edges.

[0131] After the knowledge graph is constructed, step S12 extracts the semantic attribute fields from the attribute information of each entity node, concatenates them, and encodes them into node semantic vectors. The node semantic vectors are then stored in the vector attributes or independent vector indexes of the corresponding entity nodes.

[0132] To avoid unstable descriptive texts caused by different field orders among different entity nodes, this embodiment of the invention concatenates semantic attribute fields in the order of "node name → entity type → synonym name → system → applicable working condition → status description". For unconfigured fields, null values ​​are skipped without writing meaningless placeholder characters, generating the node description text for the q-th entity node. For example, the node description text for the "Brake" node can be represented as: "Node Name: Brake; Entity Type: Equipment Component; Synonyms: Holding Brake, Brake; System: Traction System; Applicable Operating Conditions: Starting, Braking, Leveling; Status Description: The car stops and remains stationary by generating braking force through friction pairs."

[0133] Node description text Perform semantic encoding to generate node semantic vectors. :

[0134] ,

[0135] in, This indicates that the vector contains 768 real dimensions; The semantic encoding model is represented by BGE-base-zh-v1.5, with the semantic encoding vector dimension set to 768. Before encoding, the input text is subjected to the same word segmentation and length truncation rules as in step S2.

[0136] The above operations are performed on all entity nodes in the knowledge graph to form a mapping table between node identifiers and node semantic vectors. The node semantic vectors are then stored in the vector attributes or independent vector indexes of the corresponding entity nodes. When node attributes change, only the entity nodes that have changed are re-encoded to ensure that the node semantic vectors are consistent with the latest attribute information.

[0137] Step S2 of this invention converts the colloquial, unstructured anomaly descriptions generated on-site into standardized anomaly text with relatively unified terminology and units, and generates anomaly semantic vectors using the same semantic encoding model as in step S1. Using the same semantic encoding model and the same vector dimension ensures that the anomaly semantic vectors and node semantic vectors reside in the same semantic space, providing a prerequisite for calculating the semantic matching degree in step S3. (Refer to...) Figure 3 In one embodiment of the present invention, step S2 includes the following steps:

[0138] S21: Obtain elevator anomaly description text Describing elevator malfunctions in text The process involves character cleaning, misspelling correction, terminology normalization, and filtering of invalid information to generate standardized abnormal text. ;

[0139] S22: Standardize anomalous text Perform semantic encoding to generate anomaly semantic vectors. ;in, This indicates a predefined semantic encoding model.

[0140] The elevator anomaly description text in step S21 can be sourced from on-site inspectors' keyboard input, mobile terminal voice transcription, inspection record import, or maintenance work order import. Character cleaning in preprocessing unifies full-width and half-width characters, Chinese and Arabic numerals, spaces, line breaks, and punctuation, and removes duplicate symbols; word correction corrects near-homophones, similar-looking words, and missing characters caused by voice transcription or rapid input based on elevator-related dictionaries and context; terminology normalization converts industry abbreviations, colloquial terms, and unit expressions into preset standard terms, such as unifying "brake" and "brake" as "brake device," "downward slip" as "downward offset," and "centimeter" as "cm"; invalid information filtering removes greetings, interjections, repetitive descriptions, and noise characters that cannot form effective semantics, but retains information that may affect anomaly judgment, such as floor, direction of travel, operating condition, measured values, retest status, and handling suggestions.

[0141] As an example, when the elevator malfunction description text... The error message reads: "The elevator descended to the sixth floor level, the brakes screamed, and after stopping, the car slid down approximately 12 centimeters. This has been retested; immediate inspection is recommended." This preprocessing resulted in the standardized error text. The message reads: "When the elevator descended to the 6th floor level, the brake made a sharp abnormal noise; after stopping, the car deviated downwards by about 12cm; a retest has been conducted, and it is recommended to stop using the elevator and check the brake." This preprocessing only standardizes the expression form and does not delete contextual information such as "descending," "6th floor level," "about 12cm," and "retested," thus avoiding incorrect matching in subsequent semantic encoding due to the lack of key information.

[0142] Step S22 generates anomaly semantic vectors , This indicates that the vector contains 768 real-valued dimensions. For example, the semantic coding model uses BGE-base-zh-v1.5, the semantic coding vector dimension is set to 768, and the same word segmentation and length truncation rules as in step S1 are performed on the input text before encoding.

[0143] Step S3 of this invention involves first determining initial entity nodes directly related to the anomaly description from the full knowledge graph based on semantic matching relationships, and then searching upstream and downstream related paths starting from the initial entity nodes to construct a local knowledge subgraph that simultaneously contains directly hit nodes and related reasoning nodes. This step avoids directly inputting the full knowledge graph into a large language model, reducing the interference of irrelevant nodes and irrelevant relationships on model reasoning; simultaneously, it supplements knowledge such as abnormal states, risk events, inspection items, and handling measures that may not appear directly in the original text but have graph associations with the hit entities through forward and reverse path searches. (See also...) Figure 4 In one embodiment of the present invention, S3 specifically includes the following steps:

[0144] S31: Read the abnormal semantic vector and the node semantic vector of the entity node, and use cosine similarity to calculate the semantic matching degree between the two;

[0145] S32: Filter entity nodes that meet the preset matching conditions based on semantic matching degree, and generate an initial set of entity nodes;

[0146] S33: Starting with each entity node in the initial entity node set, perform forward and reverse searches along the directed relation edges in the elevator multi-dimensional heterogeneous knowledge graph to obtain candidate associated paths whose path hop count does not exceed a preset threshold.

[0147] S34: Deduplicate and merge the directed relation edges in the candidate association paths, and construct a local knowledge subgraph based on the deduplicated and merged directed relation edges; extract the relation triples of the directed relation edges in the local knowledge subgraph and determine them as candidate relation triples.

[0148] This invention determines the initial entity node based on the semantic matching relationship between the anomaly semantic vector and the node semantic vector, and performs forward and reverse association path search with a limited number of hops starting from the initial entity node. It constructs a local knowledge subgraph and extracts candidate relationship triples. While retaining the key upstream and downstream association information of the anomaly object, it narrows the knowledge retrieval scope, reduces irrelevant relationships and redundant calculations generated by full graph search, and improves the targeting and processing efficiency of candidate knowledge recall.

[0149] Specifically, S31: Read the abnormal semantic vectors sequentially. and the Node semantic vectors of each entity node The semantic matching degree between the two is calculated using cosine similarity:

[0150] ,

[0151] in, Representing the anomaly semantic vector and the first The semantic matching degree between the semantic vectors of individual entity nodes; the closer the directions of the two vectors are, the better. The larger the value, the higher the semantic correlation between the anomaly description text and the corresponding entity node.

[0152] As an example, the abnormal elevator description text "The elevator descended to the sixth floor level, the brake emitted a scream, and after stopping, the car slid down about 12 cm. It has been retested, and it is recommended to stop the elevator immediately for inspection" was semantically encoded to obtain an abnormal semantic vector. Then, the semantic vector was calculated with the semantic vectors of related nodes using cosine similarity. The semantic matching degree of the "brake" node was 0.91, the semantic matching degree of the "brake noise" node was 0.88, the semantic matching degree of the "stop offset ≥10cm" node was 0.86, the semantic matching degree of the "insufficient braking force" node was 0.73, the semantic matching degree of the "unexpected car movement" node was 0.64, and the semantic matching degree of the "door lock circuit abnormality" node was 0.29.

[0153] S32: Based on semantic matching degree Filter entity nodes that meet the preset matching conditions to generate an initial set of entity nodes. ;in, Indicates the first One entity node, This indicates a preset semantic matching threshold;

[0154] As an example, setting a semantic matching threshold The "brake" nodes with semantic matching degrees of 0.91, 0.88, and 0.86 in step S31 are then... "Brake noise" node and the node "Station offset ≥10cm" Recalling the initial entity node yields:

[0155] .

[0156] S33: Using the initial set of entity nodes Each entity node in the knowledge graph serves as the starting node. Forward and reverse searches are performed along the directed edges in the elevator multi-dimensional heterogeneous knowledge graph to obtain candidate associated paths with a path hop count not exceeding a preset threshold. The path hop count refers to the number of consecutive directed edges traversed from the starting node to the ending node. Forward search is used to obtain downstream nodes and edges reachable from the starting node, while reverse search is used to obtain upstream nodes and edges reachable from the starting node. The path hop count increases by 1 for each directed edge traversed; expansion stops when the current path hop count reaches the preset threshold.

[0157] The directed relation edges in the candidate association paths are deduplicated and merged, and a local knowledge subgraph is constructed based on the deduplicated and merged directed relation edges; the relation triples corresponding to the directed relation edges are extracted from the local knowledge subgraph, and the relation triples are determined as candidate relation triples.

[0158] As an example, set the path hop count threshold to 2, with the initial set of entity nodes. The "Brake Noise" node Starting from the node, perform forward and reverse searches along the directed relation edges in the elevator multivariate heterogeneous knowledge graph.

[0159] During the forward search, the path from the "Brake Noise" node to the "Brake Performance Degradation Risk" node via the "Risk Transmission Relationship" has a hop count of 1; continuing from the "Brake Performance Degradation Risk" node to the "Stop Elevator and Check Brake" node via the "Risk Handling Relationship" has a hop count of 2. At this point, the search stops after reaching a preset threshold. This yields the following forward candidate association paths:

[0160] ,

[0161] .

[0162] During the reverse search, the search proceeds upstream along the directed relation edges pointing to the "Brake Noise" node. The path from the "Brake" node to the "Brake Noise" node via the "Fault Manifestation Relationship" has a hop count of 1. Similarly, the path from the "Brake Not Fully Open" node to the "Brake Noise" node via the "Functional Influence Relationship" has a hop count of 1. Continuing from the "Brake" node to the "Brake Not Fully Open" node via the "Component Status Relationship," and then back to the "Brake Noise" node via the "Functional Influence Relationship," the path count is 2. This yields the following reverse candidate association paths:

[0163] ,

[0164] ,

[0165] .

[0166] For the above candidate association paths , , , and By deduplicating and merging the directed edges in the data, we can obtain the data from the "brake noise" node. A local knowledge subgraph constructed through forward and reverse associative path searches.

[0167] Candidate association paths , , , and From the constructed local knowledge subgraph, the following relation triples can be extracted based on the directed relation edges:

[0168] ,

[0169] ,

[0170] ,

[0171] ,

[0172] .

[0173] The final set of candidate relation triples is formed:

[0174] .

[0175] Similarly, the initial set of entity nodes can be processed according to the above method. All entity nodes in the graph construct a local knowledge subgraph through associated path search, and extract candidate relation triples from it.

[0176] Step S4 of this invention is used to convert the directed connectivity between entity nodes in the local knowledge subgraph into numerical constraints that can participate in model calculations. No topological penalty is applied to the same node or nodes directly connected by a directed relation edge; for nodes that require multiple relation edges to reach, the penalty is increased according to the path distance; for nodes that are unreachable along directed relation edges, the maximum topological penalty is assigned. Thus, the topological penalty mask matrix preserves the directionality of graph relations and can distinguish between direct relations, indirect relations, and unreachable relations. (Refer to...) Figure 5 In one embodiment of the present invention, step S4 includes:

[0177] S41: Form a node pair from any two entity nodes in the local knowledge subgraph, perform a path search along the directed relation edge between the two entity nodes in the node pair, and calculate the topological path distance between the two entity nodes based on the path search results.

[0178] S42: Calculate the node-level topology penalty value by mapping the topology path to the preset distance-penalty function;

[0179] S43: According to the index order of entity nodes in the local knowledge subgraph, write the topology penalty value between each entity node into the corresponding position of the matrix to construct the topology penalty mask matrix.

[0180] Specifically, S41: Perform path search based on the directed relation edges between entity nodes in the local knowledge subgraph, and calculate the entity node... With entity nodes Topological path distance between :

[0181] ,

[0182] in, For entity nodes in a local knowledge subgraph With entity nodes The set of reachable paths formed by connecting the directed edges of the given relationships in the forward direction; Set of reachable paths One of the paths in; For path The number of relation edges included; The preset maximum distance value is used to indicate that there is no directed reachable path between two entity nodes. Its value is greater than the maximum reachable path distance between entity nodes in the local knowledge subgraph that contains the most relation edges. Index of entity nodes in a local knowledge subgraph; Indicates at entity node With entity nodes The set of all reachable paths between In the process, find the path with the fewest relational edges.

[0183] As an example, the maximum reachable path distance in the local knowledge subgraph is 6, therefore... Set to 7. When the entity node When not making forward connections with other entity nodes When entity node With entity nodes The shortest path connecting the directed edges in the forward direction is → At this time, there exists one directly directed relation edge. When entity node With entity nodes The shortest path connecting the directed edges in the forward direction is → → → There are 3 directly directed edges. When entity node With entity nodes When there is no positive connection along the directed relation edge, .

[0184] S42: Based on topological path distance Calculate node-level topology penalty values ​​using a preset distance-penalty mapping function. :

[0185] ,

[0186] in, Represents entity nodes With entity nodes Topological penalty value between; This is the topological distance penalty coefficient; The preset maximum topology penalty value is greater than the maximum topology penalty value among all entity nodes with directed reachable paths. It represents a larger penalty between two entity nodes that do not have a directed reachable path. Specifically, it satisfies... .

[0187] As an example, set , , Therefore, when When the values ​​are 0, 1, 2, 3, and 7 respectively, the corresponding values ​​are... The values ​​are 0, 0, 0.5, 1.0, and 3.0, respectively. This mapping ensures that individual entity nodes or directly connected entity nodes are not penalized, two-hop and three-hop associated entity nodes are subject to increasing penalties, and entity nodes without a directed reachable path are subject to the maximum penalty.

[0188] S43: According to the index order of entity nodes in the local knowledge subgraph, the topology penalty values ​​between entity nodes are... Write the corresponding matrix positions to construct the topological penalty mask matrix. :

[0189] ,

[0190] in, The topology penalty mask matrix represents the number of entity nodes in the local knowledge subgraph. row and number The columns correspond to the entity nodes respectively. and entity nodes Topology penalty value between .

[0191] As an example, the number of entity nodes in a local knowledge subgraph The entity nodes are arranged in the following order: =Traction system =Brake, =Brake response hysteresis =Brake not fully open =Brake noise =Decreased brake performance, =Stop the elevator and check the brake. =Risk assessment report. The local knowledge subgraph contains two candidate association paths: → → → → → → as well as → → → ,set up , , The following topology penalty mask matrix can be constructed by calculating the topology penalty values ​​between each entity node:

[0192] .

[0193] Step S5 of this invention converts the elevator anomaly description text and candidate relation triples in the local knowledge subgraph into a unified input that can be processed by the large language model, and maps the node-level topological penalty mask matrix to the input word positions, correcting the association strength between different entity words in the self-attention calculation of the large language model. Through this processing, the large language model can still generate structured results using the contextual understanding capability of the anomaly text, but its combination of relationships between candidate knowledge is constrained by the topological distance of the knowledge graph, thereby reducing the probability of incorrect combination of cross-system nodes, unreachable nodes, or nodes with only weak indirect relationships. (Refer to...) Figure 6 In one embodiment of the present invention, step S5 includes:

[0194] S51: Combine the elevator anomaly description text and candidate relation triples according to the preset input format, and perform lexical processing to input the lexical sequence; perform lexical processing on the node names of entity nodes in the node pair to generate a node lexical sequence, match the node lexical sequence with the input lexical sequence to determine the set of lexical positions of entity nodes in the input lexical sequence;

[0195] S52: Based on the set of lexical positions of node pairs, map the node-level topological penalty values ​​in the topological penalty mask matrix to the corresponding lexical positions to construct a lexical-level topological penalty mask matrix;

[0196] S53: Input the input word sequence into the large language model for inference to generate structured candidate parsing results. In the attention calculation of at least one self-attention layer of the large language model, a word-level topological penalty mask matrix is ​​introduced to correct the topological penalty of the attention scores between words. The attention output is calculated based on the corrected attention weights.

[0197] This invention generates a topological penalty mask matrix based on the topological path distance between entity nodes in a local knowledge subgraph, and maps the node-level topological penalty values ​​to the corresponding lexical positions in a large language model. In the self-attention calculation, differential penalties are applied to entity associations with large topological distances or no reachable paths, thereby suppressing erroneous relationships caused solely by text co-occurrence, reducing the probability of the large language model generating relationships lacking graph support, and improving the graph consistency and interpretability of abnormal parsing results.

[0198] Specifically, S51: Set the exception description field, candidate relation field, and parsing task field according to the preset field template. Write the elevator exception description text into the exception description field; convert the candidate relation triples into triple text according to the format "<head entity, relation type, tail entity>", and write them into the candidate relation field in index order, separating adjacent triple texts with semicolons; write the preset parsing instructions to limit the model output content in the parsing task field. Concatenate them in the order of "exception description field - candidate relation field - parsing task field" to form the model input text. .

[0199] This invention employs Qwen3-4B as a large language model and its corresponding lexer to process the input text. Lexicalization is performed to obtain the input lexical sequence:

[0200] ,

[0201] in, The length of the input lexical sequence represents the number of lexical units actually output by the lexer.

[0202] Read the entity nodes of node pairs in the local knowledge subgraph and The node names are generated using the same lexer to form a node lexicographic sequence. and and in the input word sequence Perform continuous lexical matching; merge the lexical indices covered by each complete match to obtain separate sets of lexical positions. and When a node name appears multiple times, all matching positions are retained; when the matching positions of multiple node names overlap, the matching result of the complete node name with the longer word length is retained first.

[0203] As an example, when the elevator anomaly description text "The brake did not fully open when the elevator started, and there was obvious shaking during operation" is input, the following candidate relation triplet can be extracted through step S3:

[0204] ,

[0205] .

[0206] Set the exception description field, candidate relation field, and parsing task field according to the preset field template, and obtain the model input text based on the elevator exception description text and candidate relation triplet:

[0207] [Abnormal Description] The brake did not fully open when the elevator started, and there was obvious shaking during operation.

[0208] [Candidate Relationship] <Brake, component status, brake not fully open>; <Brake not fully open, function affected, operation jitter>.

[0209]

Analysis Task

[0210] The input text to the above model is processed using the Qwen3-4B lexicographicalizer to generate an input lexical sequence. To illustrate the positional mapping process, the main lexical units can be represented in a readable format as follows:

[0211] = ("Abnormal description", ":", "elevator", "start", "when", "brake", "not", "fully", "open", ..., "functional impact", "run", "shaking", ...).

[0212] In actual implementation, the length of the input word sequence Each lexical index is determined directly by the input_ids returned by the Qwen3-4B lexer, rather than by manual partitioning.

[0213] When entity nodes in a local knowledge subgraph =“Brake not fully open” is processed by the Qwen3-4B lexicalizer to obtain the node lexical sequence. = ("brake", "not", "fully", "open"), which is in the input word sequence If the complete entity node appears at positions 6–9, 22–25, and 28–31, then the entity node can be identified. Input word sequence The set of lexical positions in ={6, 7, 8, 9, 22, 23, 24, 25, 28, 29, 30, 31}. Similarly, when the entity nodes in the local knowledge subgraph... =“Running jitter” in the input word sequence If the entire entity node appears at positions 34-35, then the entity node can be identified. Input word sequence The set of lexical positions in ={34, 35}.

[0214] S52: Based on entity nodes and entity nodes Input word sequence The word position mapping relationship in the topological penalty mask matrix Node-level topology penalty value Mapped to the corresponding lexical position Construct a word-level topological penalty mask matrix Matrix elements are determined by the following formula:

[0215] ,

[0216] in, The input word sequence Position index in; Indicates the first The input word and the first The topological penalty value between each input term.

[0217] S51 and S52 can be used to convert the node-level topological penalty mask matrix generated in step S4 into a word-level topological penalty mask matrix that can directly participate in the attention calculation of large language models.

[0218] As an example, the candidate association paths in the local knowledge subgraph are:

[0219] ,

[0220] The shortest topological path distance between the "brake" node and the "running jitter" node is 2. Let the topological distance penalty coefficient be... At this point, the node-level topology penalty value of 0.5 can be calculated according to the preset distance-penalty mapping function in step S4.

[0221] When the "brake" node is in the input word sequence The matched word position set is {6, 22, 28}, and the "Run Jitter" node is in the input word sequence. If the set of matched word positions is {34, 35}, then the corresponding word positions can be determined:

[0222] .

[0223] When input word sequence Lexical positions in and When two entity nodes in the local knowledge subgraph cannot be simultaneously mapped, a word-level topological penalty value will be applied. Setting it to 0 retains only the original attention calculations of the large language model, without introducing additional topology penalties.

[0224] The above method can be used to construct a lexical-level topological penalty mask matrix. .

[0225] S53: The input word sequence obtained in step S51 Input Qwen3-4B, and in at least one self-attention layer, apply a word-level topological penalty mask matrix. Attention score calculation is introduced as an additional attention bias for the query matrix and key matrix:

[0226] ,

[0227] ,

[0228] in, This is the attention weight matrix after topological penalty correction. , and These are the query matrix, key matrix, and value matrix of the self-attention layer, respectively. To query the feature dimensions of the vector and key vector, This is the original attention mask matrix of the large language model. This is the topological penalty adjustment coefficient. This represents the matrix transpose operation. Key matrix The transpose of the matrix, For normalized exponential functions, This is the attention output after topological penalty constraints. In actual implementation, while retaining the original attention mask of Qwen3-4B, the following is applied: The attention score superimposed on the corresponding self-attention layer makes the corresponding words of entities that are topologically distant or have no reachable path more strongly suppressed.

[0229] Attention output after topological penalty constraint Continue to perform subsequent network layer calculations of the large language model to obtain contextual features that represent the semantics of the current input and the association information of candidate relationships; calculate the probability distribution of the word to be generated based on the contextual features, and generate parsed content word by word according to the preset decoding method until the end marker is generated or the preset maximum output length is reached.

[0230] To ensure the generated results can be directly read by subsequent graph consistency verification steps, a structured output template is pre-set. This template includes at least three fields: entity node field, relation triplet field, and anomaly semantic description field. The entity node field records the names and types of the entity nodes identified and parsed from the anomaly description text. The relation triplet field records the relationships between entities in the form of "<head entity, relation type, tail entity>". The anomaly semantic description field uses natural language to describe the anomaly meaning reflected by the entity nodes and relation triplets.

[0231] The model generates the content of each field sequentially according to the output template, and combines the generated entity node information, relation triple information, and anomaly semantic parsing descriptions to form a structured candidate parsing result. The candidate parsing result serves as the input for subsequent graph consistency verification, where the relation triple information is used for matching and verification with relation rules and topological relationships in the knowledge graph.

[0232] As an example, the elevator anomaly description text "The elevator brake was not fully open when it started, and there was obvious shaking during operation" and the candidate relation triples "<brake, component status, brake not fully open> and <brake not fully open, functional impact, shaking during operation>" are input into the Qwen3-4B large language model. After introducing a word-level topological penalty mask matrix in the self-attention layer, a topologically constrained attention output is obtained. The attention output is then input into subsequent Transformer layers of Qwen3-4B for feature transformation, and the output layer calculates the probability of the next word, generating parsing results word by word according to a preset decoding method.

[0233] This embodiment pre-defines the output format, which includes three fields: "entity node information," "relation triplet information," and "anomaly semantic parsing description." The structured candidate parsing result generated by the model can be represented as follows:

[0234] Entity node information: "Brake - Equipment component"; "Brake not fully open - Abnormal state"; "Operational vibration - Fault phenomenon".

[0235] Relationship triple information: <Brake, component status, brake not fully open>; <Brake not fully open, function affected, operation jitter>; <Brake, fault manifestation, operation jitter>.

[0236] Anomaly semantic analysis description: "During elevator startup, the brake failed to fully open, indicating an abnormality in the brake's lifting state; after entering the running phase, the elevator exhibited significant shaking. Considering the abnormal state and fault manifestations, it can be seen that the incomplete opening of the brake is clearly related to the running shaking, and the running shaking also reflects an abnormal brake working state. The current anomaly is mainly manifested as the brake not fully lifting and accompanied by a decrease in running stability."

[0237] The above three fields are combined to form the structured candidate parsing result corresponding to the current elevator anomaly description text. Among them, the relation triple field can be directly extracted by the subsequent consistency verification step to determine whether it conforms to the preset relation rules and topological association constraints in the elevator multi-dimensional heterogeneous knowledge graph.

[0238] The structured candidate parsing results can be represented in JSON format as follows:

[0239] {

[0240] "entities": [

[0241] {"name": "Brake", "type": "Equipment Component"},

[0242] {"name": "Brake not fully open", "type": "Abnormal status"},

[0243] {"name": "Operational jitter", "type": "Fault phenomenon"}

[0244] ],

[0245] "triples": [

[0246] ["Brake", "Component Status", "Brake Not Fully Opened"],

[0247] ["Brake not fully open", "Functional impact", "Operating vibration"]

[0248] ["Brake", "Fault Symptoms", "Operating Vibration"],

[0249] ],

[0250] "description": "During elevator startup, the brake failed to fully disengage, indicating an abnormality in the brake's engagement state; after entering the running phase, the elevator exhibited noticeable shaking. Considering both the abnormal state and the fault symptoms, it is clear that the incomplete brake disengagement and the shaking are significantly related. The shaking also reflects an abnormal brake operation, currently manifested primarily as incomplete brake engagement accompanied by decreased operational stability."

[0251] }

[0252] Step S6 of this invention is used to extract verifiable triples of relations from the structured candidate parsing results output by the large language model, and to calculate the graph consistency score from two dimensions: the legality of the relation type and the degree of topological association between nodes. Relation rule matching is used to determine whether the relation triples output by the model conform to a preset combination of entity types; topological penalty is used to determine whether the head entity node and the tail entity node have a sufficiently close directed association in the current local knowledge subgraph. After multiplying the two, the score of any triple with an invalid relation rule is directly 0, and the score of triples with valid relation rules but large topological distance decreases as the topological penalty value increases. (Refer to...) Figure 7 In one embodiment of the present invention, step S6 includes:

[0253] S61: Extract the head entity, relation type, and tail entity from the relation triplet fields of the structured candidate parsing results to form the relation triplet to be verified;

[0254] S62: Retrieve the entity types of the head and tail entities in the elevator multi-dimensional heterogeneous knowledge graph, form relation rules with the relation types and the obtained head and tail entity types, and match them with the relation rule set in the elevator multi-dimensional heterogeneous knowledge graph to obtain relation rule matching results;

[0255] S63: Entity nodes retrieved in the local knowledge subgraph based on the entity node names of the head and tail entities, and topology penalty values ​​read from the topology penalty mask matrix based on the entity node index;

[0256] S64: Calculate the graph consistency score for each triplet of the relation to be verified based on the relation rule matching results and the topology penalty value.

[0257] Specifically, S61: Read the relation triplet fields from the structured candidate parsing results, extract each relation triplet in the order of "<head entity, relation type, tail entity>", and represent it as follows:

[0258] ,

[0259] in, Indicates the first A set of three pairs of relationships to be verified. For the head entity, For relational types, For tail entities, The number of triplet pairs to be verified.

[0260] As an example, the structured candidate parsing results generated by Qwen3-4B contain the following relation triples:

[0261] <Brake, component status, brake not fully open>; <Brake not fully open, function affected, running vibration>; <Brake, fault symptoms, running vibration>.

[0262] Available now =“Brake” =“Component Status” =“Brake not fully open”; =“Brake not fully open” =“Functional impact” ="Running jitter"; =“Brake” =“Fault symptoms” ="Running jitter".

[0263] The above relation triples are identified as relation triples to be verified and sent to step S62 for relation rule matching.

[0264] S62: Based on the head entity Tail-end entity The node name is used to retrieve the corresponding entity node in the Neo4j graph database, and the entity type is read from the node attributes to obtain the header entity type. Ending entity type Header entity type Ending entity type With relation type according to The rules to be matched are formed and compared with the preset set of rules. Perform the matching to obtain the relation rule matching results:

[0265] ,

[0266] in, For the first The relation rule matching results for the relation triples to be verified. This is a set of preset relationship rules in the multi-dimensional heterogeneous knowledge graph of elevators.

[0267] As an example, for the relation triples to be validated (in, =“Brake” =“Component Status” =“Brake not fully open”, read the head entity type from the Neo4j graph database. =“Equipment Components”, Tail Entity Type =“Abnormal state”, resulting in the relationship rule to be matched: [device component, component status, abnormal state]. This rule exists in the preset relationship rule set. Therefore .

[0268] Similarly, when the relation rules of the triplet to be verified match the preset set of relation rules... If there is no match, the relationship rule matching result is set to 0.

[0269] S63: Based on the head entity Tail-end entity The node name is used to retrieve the corresponding entity node in the local knowledge subgraph. If the head entity... Tail-end entity Each can be mapped to an entity node. and entity nodes Then, based on the entity node indexes of the two... and The topology penalty mask matrix generated in step S4 Read the corresponding topology penalty value:

[0270] ,

[0271] in, Indicates the first The topological penalty value corresponding to each triplet of the relation to be verified. Represents entity nodes With entity nodes Topological penalty value between and Representing the head entity respectively Tail-end entity Able to map to the corresponding entity node in the local knowledge subgraph and entity nodes , The preset maximum topology penalty value; the leading entity or tail entity When an entity node cannot be mapped to a local knowledge subgraph, a reliable local topological association cannot be obtained; therefore, a preset maximum topological penalty value is directly assigned. .

[0272] As an example, when candidate association paths exist in the local knowledge subgraph, the following is an example:

[0273] .

[0274] For the triplet to be verified <brake, component state, brake not fully open>, its head entity "brake" and tail entity "brake not fully open" can be mapped to the "brake" node and "brake not fully open" node in the local knowledge subgraph. Since the "brake" node and the "brake not fully open" node are directly connected, the topological penalty value of the triplet to be verified can be calculated to be 0 according to the preset distance-penalty mapping function in step S4.

[0275] For the triplet to be verified Brake, Component State, Door Lock Not Closed Properly>, if the tail entity "Door Lock Not Closed Properly" cannot be found in the local knowledge subgraph, then this embodiment directly takes the preset maximum topology penalty value. .

[0276] S64: Matching results based on relational rules and topology penalty value Calculate the graph consistency score for each triplet of the relation to be verified. :

[0277] ,

[0278] in, Indicates the first The graph consistency score of the three pairs of relations to be verified is due to... , ,therefore .

[0279] As an example, when a relation rule matches successfully... At this point, the smaller the topology penalty value, the higher the graph consistency score. The closer the result is to 1, the more consistent the triplet of the relation to be verified is with the relation rules and topological structure of the knowledge graph; when the relation rule matching fails, ... At this point, regardless of the topological distance, the graph consistency score is... If all values ​​are 0, it means that the triplet of the relationship to be verified does not meet the constraints of the preset relationship rules. Even if there is a certain topological association between the corresponding entity nodes, it is not considered to have effective graph consistency.

[0280] Step S7 of this invention is used to determine output or error correction based on the graph consistency score. When all the triplet pairs to be verified reach a preset threshold, the current structured candidate parsing result is determined as the final parsing result; when at least one triplet pair to be verified does not reach the preset threshold, conflicting triplet pairs are extracted, and relationship rule error correction prompts and updated topology penalty mask matrices are generated according to the conflict reasons. The updated constraint information is then fed back to step S5 for iterative reasoning. (Refer to...) Figure 8 In one embodiment of the present invention, step S7 includes:

[0281] S71: Score the graph consistency of each triplet to be verified. Each with a preset threshold Compare; if all the triples of the relation to be verified satisfy... If the current candidate parsing result is correct, then the final parsing result is determined and output; otherwise, extract... The triplet pairs of relations to be verified form a set of conflicting triplet pairs;

[0282] S72: Based on the entity node names corresponding to the head and tail entities of each conflicting triplet in the conflicting triplet set, retrieve the corresponding entity nodes in the local knowledge subgraph; if the corresponding entity node is found, update the topological penalty value of the topological penalty mask matrix.

[0283] S73: Write the updated topology penalty value into the corresponding row and column positions of the topology penalty mask matrix to generate the updated topology penalty mask matrix; at the same time, convert the set of conflict triples into conflict feedback information according to a preset format;

[0284] S74: Feed back the conflict feedback information and the updated topology penalty mask matrix to step S5. In step S5, combine the conflict feedback information, elevator anomaly description text and candidate relation triples according to the preset input format, use the updated topology penalty mask matrix to constrain the model reasoning, and generate new structured candidate parsing results; then execute steps S6 and S7.

[0285] Iterate until the map consistency score reaches the preset threshold; when there are still conflicting triples after the number of iterations reaches the maximum value, stop iterating and mark the current candidate parsing result as a parsing result to be manually reviewed.

[0286] This invention extracts triplet relations to be verified from candidate parsing results generated by a large language model, performs consistency evaluation by combining preset relation rules and topological penalty values ​​between corresponding entity nodes, and identifies conflicting triplet relations with unreasonable relation types, connection directions, or entity associations. Furthermore, the conflict feedback information and the updated topological penalty mask matrix are fed back to the large language model for iterative reasoning, forming a closed-loop parsing mechanism of "forward topological constraint - backward graph verification - conflict feedback error correction", thereby improving the accuracy, stability, and robustness of parsing complex, colloquial, and mixed anomaly texts.

[0287] Specifically, S71: Scoring the graph consistency of each triplet to be verified. Each with a preset threshold Compare; if all the triples of the relation to be verified satisfy... If the current candidate parsing result is correct, then the final parsing result is determined and output; otherwise, extract... The triples of the relations to be verified form a set of conflicting triples. :

[0288] ,

[0289] in, For the first A set of three pairs of relationships to be verified. For the first A graph consistency score for each pair of relational triples to be verified. This is a preset threshold.

[0290] As an example, when the structured candidate parsing result generated by Qwen3-4B contains the following relation triples to be verified:

[0291] =〈Brake, component status, brake not fully open〉;

[0292] =〈Brake not fully open, affecting function and causing vibration during operation〉;

[0293] =〈Brake, fault symptoms, running vibration〉;

[0294] =〈Brake not fully open, component status, door lock not properly closed〉.

[0295] threshold Set to 0.60, calculated according to step S6. , , and .at this time, , Conflict relationship triple set .

[0296] S72: Based on the set of conflicting triples For each conflicting triple, the entity node names corresponding to the head and tail entities are retrieved from the local knowledge subgraph. This is done when both the head and tail entities of the conflicting triple have corresponding entity nodes. and entity nodes And the relationship rule matching results This indicates that the conflict mainly stems from the lack of sufficient topological structure support between specific entity nodes, and the topological penalty mask matrix. The topology penalty value for points from the head entity node to the tail entity node is updated according to the following formula:

[0297] ,

[0298] in, This is the updated topology penalty value. To preset the penalty update coefficient, This indicates taking the minimum value.

[0299] As an example, when the triplet to be validated is " =If the head and tail entities of the clause "<brake not fully open, component status, door lock not fully closed>" have corresponding entity nodes "brake not fully open" and "door lock not fully closed", then the relation rule matching result is... At this point, if the topological distance penalty coefficient... Maximum topology penalty value threshold The topological path distance between entity nodes "brake not fully open" and "door lock not fully closed" is 4. The topological penalty value corresponding to the triplet of the relationship to be verified can be calculated according to step S4. Spectrum consistency score Set the penalty update coefficient. The updated topology penalty value is:

[0300] .

[0301] Therefore, in the next round of reasoning, the entity association between the entity node "brake not fully open" and "door lock not properly closed" will be subject to stronger topological suppression. Since the elevator multi-dimensional heterogeneous knowledge graph is a directed graph, in this embodiment, the current iteration process only updates the matrix position. Corresponding to the reverse position It remains unchanged.

[0302] When the head and tail entities of a conflict triple both have corresponding entity nodes. and entity nodes But the relationship rule matching results When this is the case, it indicates that the error lies in the relation type, and the topological penalty mask matrix is ​​preserved. The topological penalty value at the corresponding matrix position remains unchanged.

[0303] When the head or tail entity of a conflict triple does not have a corresponding entity node, the corresponding node index cannot be obtained and the matrix position in the topology penalty mask matrix cannot be determined. Therefore, the topology penalty mask matrix is ​​not maintained. The topological penalty value at the corresponding matrix position remains unchanged.

[0304] S73: When both the head and tail entities of the conflicting triple can be mapped to entity nodes in the local knowledge subgraph, the updated topology penalty value has been calculated according to step S72. At that time, the updated value is written into the topological penalty mask matrix. The corresponding row and column positions are used to generate the updated topological penalty mask matrix, while keeping other matrix elements unchanged. If the conflict triples do not satisfy the topological penalty update condition, then the topological penalty mask matrix is ​​maintained. The topological penalty value at the corresponding matrix position remains unchanged.

[0305] At the same time, read the set of conflicting triples sequentially. The head entity, relation type, tail entity, relation rule matching results, and graph consistency score are organized into conflict feedback information according to preset feedback fields. The feedback fields must include at least the conflicting relation triples, the reason for the conflict, and the re-parsing requirement. Among them:

[0306] When a relationship rule fails to match, the reason for the conflict is recorded as the entity type, relationship type, or relationship direction not conforming to the preset relationship rule.

[0307] When a relational rule is successfully matched but the graph consistency score is lower than the preset threshold, the cause of the conflict is recorded as a lack of sufficient graph topological support between the head entity and the tail entity.

[0308] When a head entity or tail entity cannot be mapped to a local knowledge subgraph, the conflict reason is recorded as the corresponding entity not belonging to the current local knowledge scope.

[0309] The re-parsing requirement instructs the large language model to avoid repeatedly generating corresponding complete conflicting relation triples, and to redetermine entity relations by combining the elevator anomaly description text, candidate relation triples, and updated topological penalty constraints. The constraint here is the complete combination of "head entity—relation type—tail entity," without deleting or masking the head and tail entities themselves, allowing the large language model to generate correct relation triples containing the same entities but with different relation types or directions in the next round.

[0310] The updated topological penalty mask matrix serves only as dynamic constraint data during the iterative parsing of the current anomaly description text and does not change the original entity nodes, directed relation edges, and relation rules in the Neo4j graph database.

[0311] As an example, when step S71 generates the following two conflicting relation triples:

[0312] =〈Brake, functional impact, operational vibration〉;

[0313] =〈Brake not fully open, affecting function, causing abnormal door opening and closing〉;

[0314] Among them, the conflict relationship triplet The error lies in the improper selection of the relationship type, which does not conform to the preset relationship rules. Therefore, the topology penalty value between "brake" and "running jitter" will not be updated, and the triple will only be used as conflict feedback information.

[0315] For conflict relationship triples The relationship rule match was successful, but the graph topological association between the head entity and the tail entity is weak. Therefore, the corresponding topological penalty value is:

[0316] ,

[0317] Updated to:

[0318] .

[0319] Write the topology penalty value 1.69 into the 3rd row and 6th column of the topology penalty mask matrix, leaving the other matrix elements unchanged, to form the updated topology penalty mask matrix.

[0320] The following conflict feedback information is generated simultaneously:

[0321] The previous analysis result for "Brake, Functional Influence, Operational Jitter" does not conform to the preset relationship rules. Please redetermine the relationship type between "Brake" and "Operational Jitter". The relationship for "Brake Not Fully Opened, Functional Influence, Door Opening / Closing Abnormality" lacks sufficient topological support. Please avoid generating this relationship repeatedly and re-analyze it based on the abnormality description and candidate relationships.

[0322] S74: According to the input format specified in step S5, add a conflict feedback field to the original anomaly description field, candidate relationship field, and parsing task field. Write the conflict relationship triples that failed the verification in the previous round and their conflict reasons into the conflict feedback field to form the input content of the model in the next round.

[0323] As an example, when the generated conflict feedback information is:

[0324] The previous analysis result for "Brake, Functional Influence, Operational Jitter" does not conform to the preset relationship rules. Please redetermine the relationship type between "Brake" and "Operational Jitter". The relationship for "Brake Not Fully Opened, Functional Influence, Door Opening / Closing Abnormality" lacks sufficient topological support. Please avoid generating this relationship repeatedly and re-analyze it based on the abnormality description and candidate relationships.

[0325] At this point, the model input can be reorganized as follows:

[0326] [Abnormal Description] The brake did not fully open when the elevator started, and there was obvious shaking during operation.

[0327] [Candidate Relationship] <Brake, component status, brake not fully open>; <Brake not fully open, function affected, running vibration>; <Brake, fault manifestation, running vibration>.

[0328] [Conflict Feedback] The previously generated <Brake, Functional Impact, Operational Jitter> does not conform to the relation rules; <Brake Not Fully Opened, Functional Impact, Door Opening / Closing Abnormal> lacks graph topology support. Please avoid generating the above relations repeatedly.

[0329] [Analysis Task] Regenerate structured candidate analysis results by combining anomaly descriptions, candidate relationships, and conflict feedback.

[0330] Since the input text and its lexical positions change after adding conflict feedback information, the new input text is re-lexicalized, and the set of lexical positions corresponding to each entity node in the local knowledge subgraph is redefined; subsequently, the updated topological penalty mask matrix is ​​applied. The node-level topology penalty values ​​are mapped to new lexical positions, generating the lexical-level topology penalty mask matrix for this round of inference. When there are no topology penalty values ​​to be updated in the previous round, the node-level topology penalty mask matrix remains unchanged, and the lexical-level mapping is only re-completed based on the new lexical positions.

[0331] The regenerated input lexical sequence and lexical-level topological penalty mask matrix are input into Qwen3-4B, allowing the large language model to re-infer under the combined effect of conflict feedback and updated topological constraints, generating new structured candidate parsing results. Subsequently, step S6 is executed again on the new structured candidate parsing results to extract the triples of the relations to be verified and recalculate the consistency scores of each graph. Then, step S7 determines whether the output conditions are met.

[0332] If the graph consistency scores of all the triplet pairs to be verified reach the preset threshold, the iteration stops, the current structured candidate parsing result is determined as the final parsing result and output; if there are still conflicting triplet pairs after the preset maximum number of iterations, the iteration stops and the current structured candidate parsing result is marked as a parsing result to be manually reviewed.

[0333] The method of this invention is executed by a computer device. The computer device includes a processor, a memory, and a data interface. The memory houses a graph database, a semantic encoding module, a large language model inference module, and a graph consistency verification module. The graph database stores entity nodes, entity node attributes, directed relation edges, and relation rules. The semantic encoding module generates node semantic vectors and anomalous semantic vectors. The large language model inference module generates structured candidate parsing results under the constraints of a topological penalty mask matrix. The graph consistency verification module calculates the graph consistency score, identifies conflicting relation triples, and generates error correction feedback. These modules can be deployed on the same computer device, or separately on a verification terminal, an edge computing device, or a server, and intermediate results are transmitted via the data interface.

[0334] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0335] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0336] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory / random access memory, magnetic disk, optical disk) and includes several instructions to cause a multimedia terminal device (which may be a mobile phone, computer, television receiver, or network device, etc.) to execute the methods of the various embodiments of this application.

[0337] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A method for parsing elevator anomaly description text constrained by knowledge graph, characterized in that, Includes the following steps: S1: Construct a multi-dimensional heterogeneous knowledge graph of elevators that includes entity nodes and entity node attributes, and generate node semantic vectors based on the information encoded by entity node attributes; S2: Obtain the elevator anomaly description text and preprocess it to encode and generate an anomaly semantic vector; S3: Determine the initial entity nodes based on the semantic matching relationship between the anomaly semantic vector and the node semantic vector, construct a local knowledge subgraph through associated path search and extract candidate relation triples; S4: Calculate the topological path distance between entity nodes in the local knowledge subgraph and generate a topological penalty mask matrix according to the preset distance-penalty mapping function; S5: Input the elevator anomaly description text and candidate relation triples into the large language model, use the topological penalty mask matrix to constrain the model reasoning, and generate structured candidate parsing results; S6: Extract the triplet of the relation to be verified from the structured candidate parsing results, and calculate the graph consistency score based on the relation rule matching results and the topology penalty value; S7: If the map consistency scores all reach the preset threshold, output the parsing results; otherwise, generate error correction prompts and update the topology penalty mask matrix to S5 for iterative reasoning.

2. The method according to claim 1, characterized in that, Step S1 includes: S11: Constructing a diverse and heterogeneous knowledge graph for elevators ,in, For a set of entity nodes, For entity node attribute collection, For a set of relation types, For a set of relational rules, It is a set of directed edges; The method for configuring relationship rules is as follows: based on the allowed relationship types and connection directions between entity nodes, determine the head entity type at the beginning of the relationship and the tail entity type at the end of the relationship, and configure the set of relationship rules; Establish a set of directed relation edges based on relation rules. Each directed relation edge corresponds to a relation triple consisting of a head entity, a relation type, and a tail entity. S12: Extract the semantic attribute fields from the attributes of each entity node in the elevator multivariate heterogeneous knowledge graph, concatenate the semantic attribute fields from the entity node attributes, and generate node semantic vectors through a semantic encoding model.

3. The method according to claim 2, characterized in that, Step S3 includes: S31: Read the abnormal semantic vector and the node semantic vector of the entity node, and use cosine similarity to calculate the semantic matching degree between them; S32: Filter entity nodes that meet the preset matching conditions based on semantic matching degree, and generate an initial set of entity nodes; S33: Starting with each entity node in the initial entity node set, perform forward and reverse searches along the directed relation edges in the elevator multi-dimensional heterogeneous knowledge graph to obtain candidate associated paths whose path hop count does not exceed a preset threshold. S34: Deduplicate and merge the directed relation edges in the candidate association paths, and construct a local knowledge subgraph based on the deduplicated and merged directed relation edges; extract the relation triples of the directed relation edges in the local knowledge subgraph and determine them as candidate relation triples.

4. The method according to claim 2, characterized in that, Step S4 includes: S41: Form a node pair from any two entity nodes in the local knowledge subgraph, perform a path search along the directed relation edge between the two entity nodes in the node pair, and calculate the topological path distance between the two entity nodes based on the path search results. S42: Calculate the node-level topology penalty value by mapping the topology path to the preset distance-penalty function; S43: According to the index order of entity nodes in the local knowledge subgraph, write the topology penalty value into the corresponding position of the matrix to construct the topology penalty mask matrix.

5. The method according to claim 4, characterized in that, Step S5 includes: S51: Combine the elevator anomaly description text and candidate relation triples according to the preset input format, and perform lexicalization to obtain the input lexical sequence; perform lexicalization on the node names of entity nodes in the node pair to generate a node lexical sequence, and match the node lexical sequence with the input lexical sequence to determine the set of lexical positions of entity nodes in the input lexical sequence; S52: Based on the set of lexical positions of node pairs, map the node-level topological penalty values ​​in the topological penalty mask matrix to the corresponding lexical positions to construct a lexical-level topological penalty mask matrix; S53: Input the input word sequence into the large language model for inference to generate structured candidate parsing results. In the attention calculation of at least one self-attention layer of the large language model, a word-level topological penalty mask matrix is ​​introduced to correct the topological penalty of the attention scores between words. The attention output is calculated based on the corrected attention weights.

6. The method according to claim 5, characterized in that, In step S53, the attention calculation formula for topological penalty correction of attention scores between word units is as follows: , , in, This is the attention weight matrix after topological penalty correction. , and These are the query matrix, key matrix, and value matrix of the self-attention layer, respectively. To query the feature dimensions of the vector and key vector, This is the original attention mask matrix of the large language model. This is the topological penalty adjustment coefficient. This represents the matrix transpose operation. Key matrix The transpose of the matrix, For normalized exponential functions, This is the attention output after topological penalty constraints.

7. The method according to claim 5, characterized in that, The structured candidate parsing result of step S53 includes at least entity node field, relation triplet field, and anomaly semantic parsing description field; The entity node field records the name and type of the entity node identified from the anomaly description text and involved in the parsing; the relation triple field records the association between entity nodes; and the anomaly semantic parsing description field records the meaning of the anomaly.

8. The method according to claim 7, characterized in that, Step S6 includes: S61: Extract the head entity, relation type, and tail entity from the relation triplet fields of the structured candidate parsing results to form the relation triplet to be verified; S62: Retrieve the entity types of the head and tail entities in the elevator multi-dimensional heterogeneous knowledge graph, form a relation rule with the relation type and the obtained head and tail entity types, and match it with the relation rule set in the elevator multi-dimensional heterogeneous knowledge graph to obtain the relation rule matching result; S63: Based on the entity node names of the head and tail entities, retrieve entity nodes in the local knowledge subgraph, and read the topology penalty value from the topology penalty mask matrix based on the entity node index; S64: Calculate the graph consistency score for each triplet of the relation to be verified based on the relation rule matching results and the topology penalty value.

9. The method according to claim 8, characterized in that, Step S7 includes: S71: Score the graph consistency of each triplet to be verified. Each with a preset threshold Compare; if all the triples of the relation to be verified satisfy... If the current candidate parsing result is correct, then the final parsing result is determined and output; otherwise, extract... The triplet pairs of relations to be verified form a set of conflicting triplet pairs; S72: Based on the entity node names of the head and tail entities of each conflicting triplet in the set of conflicting triplets, retrieve entity nodes in the local knowledge subgraph; when entity nodes are retrieved for both the head and tail entities and the relation rules are successfully matched, update the topology penalty value of the topology penalty mask matrix. S73: Write the updated topology penalty value into the corresponding row and column positions of the topology penalty mask matrix to generate the updated topology penalty mask matrix; at the same time, convert the set of conflict triples into conflict feedback information according to a preset format. S74: Feed back the conflict feedback information and the updated topology penalty mask matrix to step S5. In step S5, combine the conflict feedback information, elevator anomaly description text and candidate relation triples according to the preset input format, use the updated topology penalty mask matrix to constrain the model reasoning, and generate new structured candidate parsing results; then execute steps S6 and S7. Iterate until the map consistency score reaches the preset threshold; when there are still conflicting triples after the number of iterations reaches the maximum value, stop iterating and mark the current candidate parsing result as a parsing result to be manually reviewed.

10. The method according to claim 9, characterized in that, In step S73, the head entity, relation type, tail entity, relation rule matching result, and graph consistency score in the set of conflict relation triples are read and organized into conflict feedback information according to preset feedback fields. The fields in the conflict feedback information include at least the conflict relationship triple, the cause of the conflict, and the re-parsing requirement.