Railway four-power operation and maintenance knowledge intelligent question answering method and system based on large language model
By introducing syntactic analysis of equipment identification and location data and interlocking relationship graphs into the operation and maintenance of railway electrical systems, and combining the procedural constraints of a large language model, intelligent question-and-answer results that conform to interlocking logic are generated. This solves the problem of mismatch between question-and-answer results and field equipment logic in existing technologies, and improves the accuracy and applicability of operation and maintenance questions and answers.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CREC RAILWAY ELECTRIFICATION RAILWAY OPERATIONS MANAGEMENT
- Filing Date
- 2026-04-10
- Publication Date
- 2026-05-08
AI Technical Summary
Existing railway electrical, electronic, and electronic control system (Electrical, Electrical, and Electronic) operation and maintenance question-answering methods based on large language models have difficulty effectively capturing the logical constraints between devices when dealing with the status or operational impact of multiple related devices, resulting in deviations between the answers and the actual operation and maintenance procedures.
By acquiring equipment identification information and spatial location data, performing syntactic analysis using a constraint alignment algorithm, and combining this with a knowledge graph of railway four-electric interlocking relationships for graph traversal, we obtain related equipment entities and interlocking logic information. Then, we apply a set of procedural constraint conditions to a large language model to generate intelligent question-and-answer results that conform to the interlocking logic.
Ensuring that the Q&A results are consistent with the logical rules between the equipment on site improves the accuracy and on-site applicability of the operation and maintenance Q&A. Real-time verification and backtracking mechanisms ensure the logical accuracy of the answers.
Smart Images

Figure CN121996769A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of railway electrical, electronic, and electronic control system maintenance technology, and in particular to an intelligent question-and-answer method and system for railway electrical, electronic, and electronic control system maintenance knowledge based on a large language model. Background Technology
[0002] The railway's four electrical systems encompass communication, signaling, power, and electrification, and their operation and maintenance management involves numerous equipment condition monitoring and repair operations. Intelligent question-answering methods based on large language models are increasingly being applied in railway operation and maintenance, providing on-site personnel with equipment information queries and maintenance guidance, demonstrating promising prospects for improving operation and maintenance efficiency.
[0003] Current question-answering methods for railway electrical, electronic, and mechanical systems (Electrical, Power, and Communication) maintenance based on large language models typically employ a retrieval-enhanced generative architecture. First, they parse and vectorize maintenance procedures, equipment manuals, and other relevant documents to build a knowledge base. Then, upon receiving a user's question, they retrieve relevant document fragments using vector similarity calculations. Finally, the retrieved fragments are input along with the question into a large language model to generate the answer. Some improved solutions also incorporate equipment ledger data as supplementary information during the question-answering process to enhance the accuracy of the responses.
[0004] However, in the railway electrical, electronic, and telecommunications (Electrical, Electrical, and Computer) maintenance scenario, there are complex electrical connections and strict interlocking logic constraints among the equipment. These logical rules, implicit in the maintenance procedures, are difficult to effectively capture and utilize through conventional text retrieval methods. When on-site personnel inquire about the status or operational impact involving multiple related devices, answers generated simply by piecing together document fragments often ignore the logical constraints between the devices, leading to discrepancies between the answers and the actual maintenance procedure requirements. Therefore, existing technologies suffer from a technical problem where the results of maintenance Q&A do not match the interlocking logic rules of the on-site equipment. Summary of the Invention
[0005] This application provides a method and system for intelligent question answering of railway electrical, electronic, and communication (Electrical, Electrical, and Communication) maintenance knowledge based on a large language model, in order to solve the problems of low logical accuracy and poor field applicability of maintenance question answering results in the prior art.
[0006] To address the aforementioned technical problems, firstly, this application provides an intelligent question-answering method for railway electrical, electronic, and electronic control system maintenance knowledge based on a large language model, including: The system acquires a question-and-answer request sent by the inspection terminal, the question-and-answer request containing device identification information, device spatial location data, and natural language question text; The natural language question text is syntactically analyzed using a constraint alignment algorithm to obtain the target equipment entity and the operation intention. Based on the equipment identification information, the graph node that matches the target equipment entity is located in the pre-constructed railway four-electric interlocking relationship knowledge graph. Starting from the graph node, a graph traversal is performed to obtain associated device entities, electrical connection relationship information, and interlocking logic information. The operation intention, the associated device entities, the electrical connection relationship information, and the interlocking logic information are combined into a set of procedure constraint conditions. Based on the equipment identification information and the equipment spatial location data, a vector retrieval is performed in the pre-built railway electrical, electronic, and electronic control system maintenance knowledge base to obtain maintenance knowledge fragments; The set of procedural constraints and the fragments of operation and maintenance knowledge are input into a large language model. The large language model then applies logical constraints to the generation process based on the set of procedural constraints, generating intelligent question-and-answer result text that conforms to the logic of railway four-electric interlocking.
[0007] Secondly, this application provides a railway electrical, electronic, and electronic control system based on a large language model, comprising: The acquisition module is used to acquire the question and answer request sent by the inspection terminal. The question and answer request includes equipment identification information, equipment spatial location data and natural language question text. The analysis module is used to perform syntactic analysis on the natural language question text using a constraint alignment algorithm to obtain the target equipment entity and operation intention, and to locate the graph node that matches the target equipment entity in the pre-constructed railway four-electric interlocking relationship knowledge graph based on the equipment identification information. The traversal module is used to perform graph traversal starting from the graph node to obtain associated device entities, electrical connection relationship information and interlocking logic information, and to combine the operation intention, the associated device entities, the electrical connection relationship information and the interlocking logic information into a set of procedure constraints. The retrieval module is used to perform vector retrieval in a pre-built railway electrical, electronic, and electronic control system maintenance knowledge base based on the equipment identification information and the equipment spatial location data to obtain maintenance knowledge fragments. The input module is used to input the set of procedural constraints and the fragments of operation and maintenance knowledge into the large language model. The large language model performs logical constraints on the generation process based on the set of procedural constraints to generate intelligent question-and-answer result text that conforms to the logic of railway four-electric interlocking.
[0008] Thirdly, this application provides an electronic device, comprising: Memory, used to store computer programs; A processor is configured to implement the steps of the intelligent question-and-answer method for railway electrical, electronic, and communication maintenance knowledge based on a large language model as described in the first aspect above when executing the computer program.
[0009] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the steps of the intelligent question-and-answer method for railway electrical, electronic, and communication maintenance knowledge based on a large language model as described in the first aspect above.
[0010] The technical solution provided in this application has the following beneficial effects: This application first obtains a question-and-answer request containing equipment identification information, equipment spatial location data, and natural language question text, providing a basis for accurately locating on-site equipment. Then, it performs syntactic analysis on the question text to obtain the target equipment entity and operational intent, and locates the graph node in the interlocking relationship knowledge graph based on the equipment identification information, realizing an accurate correspondence between the question intent and the equipment object. Next, it performs graph traversal starting from the graph node to obtain the associated equipment entity, electrical connection relationship information, and interlocking logic information, and combines them into a set of procedural constraint conditions, transforming the scattered equipment association rules into structured constraint information. Simultaneously, based on equipment identification information and equipment spatial location data, vector retrieval is performed in the operation and maintenance knowledge base to obtain operation and maintenance knowledge fragments, realizing the rapid acquisition of operation and maintenance knowledge that matches the field scenario; finally, the set of procedure constraints and operation and maintenance knowledge fragments are input into the large language model, and the model performs logical constraints on the generation process according to the set of procedure constraints to generate intelligent question and answer result text that conforms to the logic of railway four-electric interlocking, ensuring that the answer content is consistent with the logical rules between field equipment.
[0011] Furthermore, this application also inputs the set of procedural constraints into a large language model and converts it into an interlocking inference rule chain. Then, it inputs operation and maintenance knowledge fragments into the model and generates text units step by step in an autoregressive manner. After each time step, all the generated text units are combined into an intermediate conclusion and logically verified according to the interlocking inference rule chain. When the intermediate conclusion violates the rules, it backtracks to the previous time step and regenerates the text unit of the current time step. The above process is repeated until the intelligent question-and-answer result text is generated. This process, through real-time verification and backtracking mechanisms, ensures that the answer text strictly follows the interlocking relationship rules between devices in every local conclusion and the overall logic.
[0012] These or other aspects of this application will become more apparent in the following description of the embodiments. Attached Figure Description
[0013] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0014] Figure 1 A flowchart illustrating an intelligent question-and-answer method for railway electrical, electronic, and electronic control systems based on a large language model, provided as an embodiment of this application; Figure 2 A schematic diagram illustrating a specific implementation of an intelligent question-and-answer method for railway electrical, electronic, and electronic control systems based on a large language model, provided in this application embodiment; Figure 3 This is a schematic diagram of the structure of a railway electrical, electronic, and electronic control system based on a large language model, which is provided as an embodiment of this application. Detailed Implementation
[0015] To address the problems existing in the prior art, this application proposes an intelligent question-and-answer method for railway electrical, electronic, and communication (Electrical, Electrical, and Communication) maintenance based on a large language model. This method introduces interlocking logic rules between equipment as constraints through a knowledge graph, ensuring that each conclusion conforms to the logical relationship between the equipment on site during the answer generation process. This fundamentally solves the problem of mismatch between question-and-answer results and interlocking logic rules in the prior art, and improves the accuracy and on-site applicability of maintenance question-and-answer.
[0016] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some embodiments of the present application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0017] The core of this application is to provide an intelligent question-answering method for railway electrical, signaling, and communication system maintenance knowledge based on a large language model. A flowchart of one specific implementation is shown below. Figure 1 As shown, the method includes: Step 101: Obtain the question and answer request sent by the inspection terminal. The question and answer request includes equipment identification information, equipment spatial location data, and natural language question text.
[0018] In step 101, the inspection terminal refers to a handheld device with scanning and positioning functions carried by on-site maintenance personnel; the device identification information is unique coded data read from the QR code label or RFID label set on the four electrical devices, used to distinguish different devices; the device spatial location data is the latitude and longitude coordinate information collected by the positioning module built into the inspection terminal, used to determine the specific location of the device; the natural language question text is the text form of the question asked by the maintenance personnel through the inspection terminal, such as asking about the status or operation requirements of a certain device.
[0019] In this embodiment, when maintenance personnel need to inspect or obtain relevant information about a piece of equipment on-site, they first use an inspection terminal to scan the QR code or RFID tag on the equipment. The inspection terminal automatically reads the unique code of the equipment as its identification information and simultaneously collects the latitude and longitude coordinates of the current location as the equipment's spatial location data through its built-in positioning module. The maintenance personnel then input the questions they wish to ask on the inspection terminal, such as inquiring about the equipment's maintenance cycle or troubleshooting methods, forming a natural language question text. The inspection terminal combines the aforementioned equipment identification information, equipment spatial location data, and natural language question text and sends it to the backend processing system for subsequent processing and analysis.
[0020] In this embodiment, prior to step 101, the method further includes constructing a railway electrical, signaling, and communication maintenance knowledge base and a railway electrical, signaling, and interlocking relationship knowledge graph: Among them, the railway electrical system operation and maintenance knowledge base refers to a database collection that stores textual data and feature vectors related to the operation and maintenance of the railway electrical system, which is used to quickly match operation and maintenance knowledge content related to on-site needs during subsequent retrieval; the railway electrical system interlocking relationship knowledge graph refers to a data collection that stores the names of equipment entities in the railway electrical system, as well as the connection relationships and logical constraints between equipment in the form of a graph structure, which is used to locate equipment entities and obtain the association rules between equipment during subsequent processing.
[0021] A1: Collect emergency repair plans, work instructions, equipment manuals, equipment ledgers, equipment history records, and historical fault case data from multiple subordinate organizations within the railway's electrical and electronic systems.
[0022] In step A1, the railway electrical system refers to the general term for the four specialties of railway communication, signaling, power and electrification. Subordinate organizations refer to local branches or maintenance workshops and other grassroots units within the management scope of the railway electrical system. Emergency repair plan documents refer to emergency repair procedures when equipment fails. Work instruction documents refer to standard operating procedures for daily equipment inspection and maintenance.
[0023] Equipment instruction manuals refer to the technical parameters and usage instructions of the equipment. Equipment ledger data refers to tabular data that records basic information, model specifications, installation location, etc. of the equipment. Equipment history data refers to tabular data that records the maintenance history, fault records, component replacements, etc. of the equipment since it was put into operation. Historical fault case data refers to the documented records of past equipment fault phenomena, cause analysis, and handling processes.
[0024] In this embodiment of the application, various operation and maintenance data are first collected from multiple institutions under the railway electrical system. These collected data specifically include emergency repair plan documents, work instruction documents, equipment manual documents, equipment ledger data, equipment history data, and historical fault case data, providing original data sources for the subsequent construction of the knowledge base.
[0025] A2: Perform optical character recognition processing on the emergency repair plan document, the work instruction document, the equipment instruction manual document, and the historical fault case data to obtain the corresponding text data.
[0026] In step A2, optical character recognition processing refers to the technology of converting text content in image or scanned document formats into computer-editable and searchable text data. The text data refers to the set of text content converted from document images by optical character recognition processing.
[0027] In this embodiment of the application, the emergency repair plan documents, work instruction documents, equipment manual documents, and historical fault case data collected in step A1, which are in image or scanned format, are subjected to optical character recognition (OCR) processing. This OCR processing converts the text content in the images into computer-editable and searchable text data, so that these document contents can be further analyzed and processed in the future.
[0028] A3: Perform structured parsing on the equipment ledger data and the equipment history table data to obtain the corresponding structured record data.
[0029] In step A3, structured parsing refers to parsing tabular data by rows and columns to extract each row of records and its corresponding field names and values. Structured record data refers to the collection of each row of records and its field information obtained after structured parsing of equipment ledger data and equipment history data.
[0030] In this embodiment of the application, the tabular data such as equipment ledger data and equipment history data collected in step A1 are subjected to structured parsing. Through this parsing process, each row of records in the table and its corresponding field names and field values are extracted, and finally, structured record data that can be processed by a computer is formed so that these tabular data and other text data can be processed in a unified manner in the future.
[0031] A4: The text data and the structured record data are segmented to obtain multiple text paragraphs and multiple structured entries.
[0032] In step A4, a text paragraph refers to each independent text paragraph obtained by segmenting the text data according to natural paragraphs, and a structured entry refers to each independent record entry obtained by segmenting the structured record data according to each record.
[0033] In this embodiment of the application, the text data obtained in step A2 is segmented according to natural paragraphs to obtain multiple independent text paragraphs; similarly, the structured record data obtained in step A3 is segmented according to each record to obtain multiple independent structured entries, thus preparing suitable data units for subsequent vectorization processing.
[0034] A5: Vectorize each text paragraph and each structured entry to obtain a text paragraph vector corresponding to each text paragraph and a structured entry vector corresponding to each structured entry.
[0035] In step A5, vectorization refers to the process of converting text content into numerical feature vectors through an embedding model. Text paragraph vectors are numerical feature vectors obtained after vectorization of text paragraphs, and structured entry vectors are numerical feature vectors obtained after vectorization of structured entries.
[0036] In this embodiment of the application, each text paragraph and each structured entry obtained in step A4 are input into a pre-trained embedding model. The embedding model converts the text paragraphs and structured entries into numerical feature vectors. The text paragraphs are converted into text paragraph vectors, and the structured entries are converted into structured entry vectors. These feature vectors are used for subsequent similarity retrieval operations in the vector database.
[0037] A6: The text paragraph, the text paragraph vector, the structured entry, and the structured entry vector are stored in a vector database, and the stored content in the vector database constitutes the railway electrical, electronic, and electronic maintenance knowledge base.
[0038] In step A6, the vector database refers to a database system specifically used for storing and retrieving feature vectors. The vector database is used to store the feature vectors corresponding to text paragraphs and structured entries in the railway electrical, electronic, and power supply maintenance knowledge base. The railway electrical, electronic, and power supply interlocking relationship knowledge graph is used to store the connection relationships and logical constraints between equipment entities. Together, they constitute the retrieval basis of the railway electrical, electronic, and power supply maintenance knowledge base.
[0039] In this embodiment of the application, the text paragraphs and structured entries obtained in step A4, as well as the text paragraph vectors and structured entry vectors obtained in step A5, are stored in a vector database. Specifically, each text paragraph is stored in association with its corresponding text paragraph vector, and each structured entry is stored in association with its corresponding structured entry vector. These stored contents in the vector database together constitute a railway electrical and electronic maintenance knowledge base. This knowledge base is used for vector retrieval operations in subsequent steps to obtain maintenance knowledge fragments that match the on-site requirements.
[0040] A7: Extract the equipment entity names, the connection relationships between equipment entities, and the logical constraints between equipment entities from the text data and the structured record data. Construct a knowledge graph of railway four-electric interlocking relationships using the equipment entity names as nodes, the connection relationships as edges, and the logical constraints as edge attributes.
[0041] In step A7, the equipment entity name refers to the unique identifier of each piece of equipment in the railway electrical system, such as the specific name of a signal or a circuit breaker; the connection relationship between equipment entities refers to the electrical or logical association between equipment, such as the control relationship between a signal and a track section, or the power supply relationship between a circuit breaker and a transformer; the logical constraint information between equipment entities refers to the condition rules that the equipment must meet during operation, such as the prerequisite for a signal to be open is that the relevant track section must be in an idle state.
[0042] In this embodiment, the text data obtained in step A2 and the structured record data obtained in step A3 are processed by named entity recognition and relation extraction. Named entity recognition identifies the names of equipment entities, and relation extraction identifies the connections between equipment entities. At the same time, logical constraint information that the equipment entities need to satisfy is extracted from the text description. Then, the identified equipment entity names are used as nodes in the graph structure, the connections between equipment entities are used as edges between nodes, and the logical constraint information between equipment entities is used as the attribute information of each edge. The graph is organized and stored according to the data structure of the graph database. Through the above processing, a knowledge graph of railway four-electric interlocking relationship is finally constructed. This graph is used to locate equipment entities and obtain the association relationship between equipment in subsequent steps.
[0043] This application constructs a railway electrical, electronic, and communication (Electrical, Electrical, and Control) maintenance knowledge base and a railway Electrification, Electronic, and Control Interlocking relationship knowledge graph through the above steps. It integrates maintenance data scattered across different institutions and in different formats into a unified knowledge storage structure, providing a data foundation for subsequent intelligent question answering.
[0044] Step 102: Perform syntactic analysis on the natural language question text using the constraint alignment algorithm to obtain the target equipment entity and operation intention, and locate the graph node that matches the target equipment entity in the pre-constructed railway four-electric interlocking relationship knowledge graph based on the equipment identification information.
[0045] Among them, the constraint alignment algorithm refers to a set of processing rules used to identify device entities and operational intentions from natural language text and associate them with knowledge graph nodes. The constraint alignment algorithm adopts dependency parsing technology. First, it performs word segmentation and dependency relation parsing on the natural language question text. By identifying the subject-verb, verb-object and other dependency relations between words, it determines the target device entity and operational intention. For example, for the question "Please check the interlocking status of signal machine XH002", the algorithm identifies "check" as the operational intention and "signal machine XH002" as the target device entity through dependency parsing.
[0046] The target equipment entity refers to the equipment name directly related to the question identified from the natural language question text. The operation intent refers to the type of query or operation that the operation and maintenance personnel want to perform, identified from the natural language question text. The graph node refers to the unit representing a specific equipment in the railway four-electric interlocking relationship knowledge graph. Each node corresponds to a equipment entity and stores the name attribute of the equipment.
[0047] In this embodiment, step 102 includes the following process: Step 1021: Perform word segmentation on the natural language problem text to obtain a word sequence.
[0048] In step 1021, word segmentation refers to the process of dividing a continuous natural language question text into independent words according to Chinese grammar rules, and word sequence refers to a list formed by arranging multiple words obtained after segmentation in the order they appear in the question text.
[0049] In this embodiment of the application, the natural language question text obtained in step 101 is first processed by word segmentation. This segmentation process divides the continuous question text into independent words according to Chinese grammar rules. These words are arranged in the original order in the question text to form a word sequence, which prepares the basic data units for subsequent grammatical analysis.
[0050] Step 1022: Perform grammatical role labeling on each word in the word sequence to obtain the grammatical role information of each word.
[0051] In step 1022, grammatical role labeling refers to the process of assigning a label to each word in the word sequence to represent its grammatical function in the sentence. The grammatical role information includes labels such as subject, predicate, object, attributive, and adverbial.
[0052] In this embodiment, each word in the word sequence obtained in step 1021 is subjected to grammatical role labeling. This labeling process assigns a grammatical function label to each word in the sentence, ultimately obtaining the grammatical role information corresponding to each word. This grammatical role information is used for subsequent identification of target device entities and operational intentions. For example, step 1022 adopts a general dependency parsing system. For instance, for the sentence "Please check the oil temperature of the main transformer", dependency parsing identifies "check" as the core predicate and labels its dependency relationship as ROOT, identifies "main transformer" as the object of "check" and labels its dependency relationship as dobj, and identifies "oil temperature" as the modifier of "main transformer" and labels its dependency relationship as nmod. Finally, based on dependency relationship rules, the operational intention is identified from the core predicate "check", and the target device entity is identified from the object "main transformer".
[0053] Step 1023: Based on the grammatical role information, identify words representing device names as target device entities and words representing query or operation types as operation intentions from the word sequence.
[0054] In this embodiment of the application, based on the grammatical role information of each word obtained in step 1022, words with a grammatical role of noun and whose content conforms to the characteristics of device name are identified from the word sequence as target device entities, and words with a grammatical role of verb and whose content indicates query or operation meaning are identified as operation intentions; through the above identification process, device objects and operation purposes related to the core of the problem are extracted from the natural language problem text.
[0055] Step 1024: Extract the unique code of the equipment from the equipment identification information, search for the node corresponding to the unique code of the equipment in the railway four-electric interlocking relationship knowledge graph, and take the node as a candidate node.
[0056] In step 1024, the unique equipment code refers to the coded data stored in the QR code label or RFID tag set on the four electrical equipment to uniquely identify the equipment, and the candidate node refers to the graph node that may correspond to the field equipment and is found in the railway four electrical interlocking relationship knowledge graph through the unique equipment code.
[0057] In this embodiment of the application, a unique device code is extracted from the device identification information obtained in step 101. The unique device code is then used to search in a pre-built knowledge graph of railway four-electric interlocking relationships to find a graph node corresponding to the unique device code. This node is then used as a candidate node for subsequent comparison and verification.
[0058] Step 1025: Compare the target equipment entity with the equipment name attribute of the candidate node. If the comparison result is consistent, the candidate node is determined as a graph node. If the comparison result is inconsistent, search for nodes in the railway four-electric interlocking relationship knowledge graph whose equipment name attribute matches that of the target equipment entity, and take the corresponding nodes as graph nodes.
[0059] In this embodiment, the target device entity obtained in step 1023 is compared with the device name attribute of the candidate node obtained in step 1024. If the target device entity and the candidate node have the same device name attribute, it means that the scanned device is the same device as the device mentioned in the question, and the candidate node is determined as a graph node. If the target device entity and the candidate node have different device name attributes, it means that the device scanned by the maintenance personnel is not the same device as the device asked in the question. In this case, a node whose device name attribute matches the target device entity is searched in the railway four-electric interlocking relationship knowledge graph, and the searched node is taken as a graph node. Through the above comparison and search processing, the accurate location of the device related to the question in the knowledge graph is finally determined.
[0060] This application accurately identifies the target device entity and operational intent from the natural language question text through the above steps, and locates the corresponding graph node in the interlocking relationship knowledge graph by combining the device identification information, providing an accurate starting point for subsequently obtaining the relationship between devices.
[0061] Step 103: Perform graph traversal starting from the graph node to obtain associated device entities, electrical connection relationship information, and interlocking logic information. Combine the operation intention, the associated device entities, the electrical connection relationship information, and the interlocking logic information into a set of procedure constraints.
[0062] Graph traversal refers to the process of visiting other nodes in a knowledge graph by starting from one node according to specific rules. Associated device entities refer to other device entities that have direct or indirect connections with the devices represented by the graph nodes determined in step 102. Electrical connection information refers to the description of the connection method between devices in the circuit, such as series connection, parallel connection, or power supply relationship. Interlocking logic information refers to the description of the condition rules that devices must meet during operation, such as confirming that another device is in a specific state before operating a certain device. The procedural constraint set refers to the data set formed by combining the operation intention, associated device entities, electrical connection information, and interlocking logic information according to a specific structure, which is used as a logical constraint when the large language model generates answers.
[0063] For the scenario where the operational intent is "to disconnect circuit breaker QF101", the set of procedure constraints obtained through graph traversal can be organized in the following table format to facilitate reading and application of each constraint during large language model parsing, as shown in Table 1: Table 1. Example format of the specification constraint set
[0064] In the table above, each row represents a device entity that is associated with the target device entity. The first column records the name of the associated device entity, the second column describes the type of electrical connection between the associated device entity and the target device entity, and the third column records the logical constraints that must be satisfied between the associated device entity and the target device entity. When generating the answer, the large language model needs to make a comprehensive judgment based on the operation intent and the information in each row of the table to ensure that the generated answer content simultaneously meets the constraints of all interlocking logical information.
[0065] The above example is only one example of this application. In practical applications, it can also be set according to the specific equipment and interlocking rules of the railway's electrical system. This application does not limit this.
[0066] In this embodiment, step 103, which involves performing graph traversal starting from the graph node to obtain associated device entities, electrical connection relationship information, and interlocking logic information, includes the following process: Step 1031: Analyze the operation intent and determine the traversal depth.
[0067] In step 1031, the traversal depth refers to the maximum number of connecting edges traversed in the knowledge graph starting from a graph node, and is used to control the range of graph traversal.
[0068] In this embodiment of the application, the operation intent obtained in step 1023 is first parsed. By analyzing the query or operation type expressed by the operation intent, it is determined how far to traverse the associated devices from the graph node. For example, for operation intents such as "querying device status" which only require understanding the device's own information, the traversal depth is set to level one, that is, only directly connected devices are obtained. For operation intents such as "disconnecting circuit breakers" which require analyzing the impact of the operation, the traversal depth is set to level three, that is, obtaining directly connected and indirectly affected devices. For operation intents such as "fault impact range analysis" which require a comprehensive understanding of the associated impact, the traversal depth is set to level five. Through the above parsing process, the traversal depth of this graph traversal is finally determined.
[0069] Specifically, the scope of graph traversal is determined by the mapping rules between operation intent and traversal depth: if the operation intent is a "query intent," such as querying device status or querying device parameters, the traversal depth is determined to be level one, indicating that only associated device entities directly connected to the graph node need to be obtained; if the operation intent is an "operation intent," such as disconnecting a circuit breaker or closing a disconnector, the traversal depth is determined to be level two, indicating that associated device entities directly connected to the graph node and indirectly affected through level one connections need to be obtained; if the operation intent is an "analysis intent," such as analyzing the scope of fault impact, the traversal depth is determined to be level three, indicating that associated device entities with a connection relationship of level three or less with the graph node need to be obtained. If the operational intent is a "comprehensive assessment intent," such as the preparation of a construction coordination plan or a safety assessment of a large-scale operation, then the traversal depth is determined to be level five, meaning that all associated equipment entities with a connection relationship of level five or less with the graph nodes need to be acquired. Through the above mapping rules between intent and traversal depth, the parsing result of the operational intent is transformed into a specific traversal depth value.
[0070] Step 1032: Using the graph node as the starting node, perform a breadth-first traversal in the railway four-electric interlocking relationship knowledge graph according to the preset connection relationship to obtain nodes whose path length is less than or equal to the traversal depth, and record the obtained nodes as associated equipment entities.
[0071] In step 1032, breadth-first traversal refers to a graph traversal method that starts from the starting node, visits all directly connected nodes first, and then visits the adjacent nodes of these nodes in turn, expanding outward layer by layer; the preset connection relationship refers to the equipment association type predefined and stored in the connection edge attribute field of the railway four-electric interlocking relationship knowledge graph. This connection relationship includes electrical connection relationship, control relationship, power supply relationship and interlocking logic relationship; during the breadth-first traversal, only the connection edges that have the above-mentioned preset connection relationship with the current node are expanded and visited, and the connection edges that do not have the preset connection relationship are ignored, thereby ensuring that the traversal result only includes the associated equipment entities that have a valid business relationship with the target equipment entity; the path length refers to the number of connection edges traversed from the starting node to the target node.
[0072] In this embodiment, the graph node determined in step 1025 is used as the starting node. A breadth-first traversal is performed in the railway four-electric interlocking relationship knowledge graph according to the preset connection relationship. Starting from the graph node, all nodes directly connected by one connecting edge are visited first, then nodes connected by two connecting edges are visited, and so on, expanding outward layer by layer. During the traversal, only nodes with a path length less than or equal to the traversal depth determined in step 1031 are retained, and these nodes are recorded as associated equipment entities. All equipment entities that have an association relationship with the original equipment are obtained through the above traversal process.
[0073] Step 1033: For the connection edges between the graph node and each associated device entity, extract electrical connection relationship information and interlocking logic information from the attribute fields of the connection edges.
[0074] In step 1033, the connecting edge refers to the directed or undirected line segment in the railway four-electric interlocking relationship knowledge graph that connects two nodes, representing the association relationship between the equipment; the attribute field refers to the additional information area stored on the connecting edge, which is used to record the specific description of the relationship between the equipment.
[0075] In this embodiment, for the connection edges between the graph nodes determined in step 1025 and each associated device entity obtained in step 1032, electrical connection information and logical constraints are extracted from the attribute fields of each connection edge. The electrical connection information extracted from the attribute fields is used as electrical connection relationship information, and the logical constraints extracted from the attribute fields are used as interlocking logic information. Through the above extraction process, a specific relationship description between the graph nodes and each associated device entity is obtained. This information, together with the operation intention and the associated device entity, forms the set of procedural constraints required for subsequent steps.
[0076] This application uses the above steps to perform graph traversal starting from the graph nodes, obtains the device entities that are related to the original device, as well as their electrical connection relationships and interlocking logic information, and combines the operation intention with this information to form a structured set of procedural constraints, providing a complete rule basis for the subsequent generation of logical constraints for the large language model.
[0077] Step 104: Based on the equipment identification information and the equipment spatial location data, perform vector retrieval in the pre-built railway electrical, electronic, and electronic control system maintenance knowledge base to obtain maintenance knowledge fragments.
[0078] Among them, the operation and maintenance knowledge fragments refer to specific paragraphs or entries of knowledge content such as emergency repair plans, work instructions, and equipment manuals related to the current equipment and its location, which are retrieved from the railway electrical operation and maintenance knowledge base.
[0079] In this embodiment, step 104 includes the following process: Step 1041: The device identification information and the device spatial location data are vectorized using a pre-trained embedding model to obtain a first feature vector and a second feature vector. The first feature vector and the second feature vector are combined to obtain a composite query vector.
[0080] In step 1041, the embedding model refers to a neural network model that can convert text or numerical information into numerical feature vectors after being trained on a large amount of text data. The first feature vector refers to the numerical feature vector obtained after the device identification information is converted by the embedding model. The second feature vector refers to the numerical feature vector obtained after the device spatial location data is converted by the embedding model. The composite query vector refers to the final query vector for retrieval formed by concatenating and combining the first feature vector and the second feature vector.
[0081] This application does not impose specific limitations on the model type, internal structure design, parameter design, training process, etc. of the embedded model, and corresponding settings can be made according to the actual situation.
[0082] In this embodiment, the device identification information obtained in step 101 is first input into a pre-trained embedding model. The embedding model vectorizes the device identification information to obtain a first feature vector of dimension m. Simultaneously, the device spatial location data is converted into a spatial coordinate range code and input into the embedding model. The embedding model vectorizes the spatial coordinate range code to obtain a second feature vector of dimension n. Then, the first feature vector of dimension m and the second feature vector of dimension n are concatenated according to a preset dimensional order to form a composite query vector of dimension m+n. In the subsequent step 1042, the vector database first selects candidate vectors with spatial location matching through a spatial indexing mechanism, and then performs semantic similarity calculation on the selected candidate vectors, thereby realizing the fusion retrieval of spatial location information and device identification information.
[0083] Step 1042: Calculate the similarity between the composite query vector and multiple candidate vectors in a pre-constructed vector database, wherein the vector database stores the feature vector corresponding to each knowledge segment in the railway electrical and electronic maintenance knowledge base.
[0084] In step 1042, the candidate vector refers to the feature vector stored in the vector database that corresponds one-to-one with each knowledge segment in the railway electrical and electronic maintenance knowledge base, and the similarity refers to the quantitative value of the degree of similarity between two vectors obtained by calculation methods such as cosine similarity or Euclidean distance.
[0085] In this embodiment of the application, the composite query vector obtained in step 1041 is input into a pre-built vector database, which stores the feature vectors corresponding to each knowledge segment when constructing the railway electrical and electronic maintenance knowledge base in step A6; the similarity calculation algorithm built into the vector database is used to calculate the similarity value between the composite query vector and each candidate vector stored in the database one by one, so as to obtain the degree of matching between the composite query vector and each knowledge segment.
[0086] Step 1043: Select the top K knowledge fragments with the highest similarity values as operation and maintenance knowledge fragments, where K is a preset positive integer.
[0087] In step 1043, K refers to the preset number of knowledge fragments to be selected, which can be adjusted according to actual application needs.
[0088] In this embodiment of the application, based on the similarity value calculated in step 1042, all candidate vectors are sorted from high to low similarity; the top K candidate vectors with the highest similarity values are selected from the sorting results, and the knowledge fragments corresponding to these candidate vectors are searched in the vector database; the K knowledge fragments found are used as the operation and maintenance knowledge fragments obtained in this retrieval, and these knowledge fragments contain operation and maintenance knowledge content most relevant to the current device identification information and device spatial location data.
[0089] This application converts equipment identification information and equipment spatial location data into a composite query vector through the above steps, and retrieves the most matching operation and maintenance knowledge fragment from the vector database, thereby achieving accurate acquisition of relevant operation and maintenance knowledge based on the specific equipment and location on site.
[0090] Step 105: Input the set of procedural constraints and the operation and maintenance knowledge fragments into the large language model. The large language model performs logical constraints on the generation process based on the set of procedural constraints to generate intelligent question-and-answer result text that conforms to the logic of railway four-electric interlocking.
[0091] Among them, the intelligent question-answering result text refers to the answer content generated by the large language model for the questions entered by operation and maintenance personnel.
[0092] The following are specific examples of the structural design of each module of the large language model: The large language model used in this application is based on the Transformer architecture. Its encoder consists of 12 stacked Transformer blocks. Each Transformer block contains a multi-head self-attention sub-layer and a feedforward neural network sub-layer. The multi-head self-attention sub-layer uses 8 attention heads to calculate the correlation between semantic feature vectors in parallel. The feedforward neural network sub-layer contains two fully connected networks and uses the ReLU activation function. The decoder also consists of 12 Transformer blocks. When generating text units at each time step, the decoder ensures that it only depends on the generated text units through a masked self-attention mechanism and fuses the semantic feature vectors output by the encoder through a cross-attention mechanism. The model is trained on massive railway operation and maintenance text data using a self-supervised pre-training method. During the training process, some words in the input text are randomly masked, and the model parameters are optimized by predicting the true content of the masked words. After pre-training, the model is fine-tuned in a supervised manner using professional Q&A in the field of railway electrical engineering, further enhancing the model's understanding and generation capabilities of railway interlocking logic rules.
[0093] It should be noted that the above structure is exemplary. This application does not impose specific limitations on the internal structure design of the large language model, and corresponding settings can be made according to the actual situation.
[0094] In this embodiment, step 105 includes the following process, such as... Figure 2 As shown: Step 1051: Input the set of procedural constraints into the large language model, and convert the set of procedural constraints into a chain of interlocking reasoning rules for railway electrical, electronic, and communication systems through the large language model.
[0095] Among them, the interlocking reasoning rule chain is an internal representation of the procedure constraint set, which is generated by the large language model encoder and attention mechanism and organized in the form of a sequence of formal logical statements. For example, the interlocking logic information "before disconnecting the circuit breaker, it must be confirmed that the disconnecting switches on both sides are open" in the procedure constraint set is transformed into the logical statement "IF operation intention is to disconnect circuit breaker QF101 THEN check disconnecting switch QS101 state must be open AND check disconnecting switch QS102 state must be open" in the interlocking reasoning rule chain. This transformation converts the unstructured natural language description into a rule-based expression that is convenient for subsequent time-step logic verification.
[0096] Step 1051 may specifically include the following steps: B1: The encoder of the large language model extracts features from the set of procedural constraints to obtain the semantic feature vector of each element in the set of procedural constraints. The elements in the set of procedural constraints include the operation intention, the associated equipment entity, the electrical connection relationship information, and the interlocking logic information.
[0097] In step B1, the encoder refers to the neural network module in the large language model that is responsible for converting the input text into numerical feature vectors; the semantic feature vector refers to the numerical vector representation output by the encoder after extracting features from the input elements, and each vector corresponds to an element in the set of procedural constraints; the elements in the set of procedural constraints include the operation intention, associated equipment entities, electrical connection relationship information and interlocking logic information obtained in step 103.
[0098] In this embodiment of the application, the set of procedure constraints obtained in step 103 is first input into the encoder of the large language model. The encoder performs feature extraction processing on each element in the set of procedure constraints, converting each element into a corresponding semantic feature vector. After feature extraction, the semantic feature vectors corresponding to the operation intention, the semantic feature vectors corresponding to each associated device entity, the semantic feature vectors corresponding to the electrical connection relationship information, and the semantic feature vectors corresponding to the interlocking logic information are obtained. These semantic feature vectors are used for subsequent correlation calculation.
[0099] In practical applications, assuming the set of constraint conditions includes the operational intent "disconnect the circuit breaker", associated equipment entities "disconnector A" and "disconnector B", electrical connection relationship information "series connection", and interlocking logic information "disconnector A must be in the open state" and "disconnector B must be in the open state", the encoder converts the above elements into corresponding semantic feature vectors. For example, the semantic feature vector corresponding to the operational intent is [0.25, 0.60, 0.15, 0.80], and the semantic feature vector corresponding to the associated equipment entity "disconnector A" is [0.30, 0.55, 0.20, 0.75], etc. The above example is only one example of this application. In practical applications, it can be set according to requirements, and this application does not limit it.
[0100] B2: Calculate the correlation degree between the semantic feature vector of the operation intention and the semantic feature vector of the associated device entity, the semantic feature vector of the electrical connection relationship information, and the semantic feature vector of the interlocking logic information through the attention mechanism of the large language model. Determine the device action object corresponding to the operation intention, the connection relationship type corresponding to the device action object, and the logical constraint type corresponding to the device action object based on the correlation degree.
[0101] In step B2, the attention mechanism refers to the neural network module in the large language model used to calculate the degree of correlation between different elements; the correlation degree refers to the correlation value between two semantic feature vectors calculated by the attention mechanism, which is used to represent the strength of the correlation between elements; the device action object refers to the device entity directly related to the operation intention selected from the associated device entities; the connection relationship type refers to the category of electrical connection relationship between the device action object and the graph node; and the logical constraint type refers to the category of logical rules that the device action object needs to satisfy.
[0102] In this embodiment, the attention mechanism of the large language model is used to calculate the correlation degree between the semantic feature vector of the operation intention obtained in step B1 and the semantic feature vector of each associated device entity. The associated device entity with the highest correlation degree is selected as the device action object corresponding to the operation intention. At the same time, the attention mechanism is used to calculate the correlation degree between the semantic feature vector of the device action object and the semantic feature vector of the electrical connection relationship information. The connection relationship type corresponding to the device action object is determined based on the correlation degree. Then, the attention mechanism is used to calculate the correlation degree between the semantic feature vector of the device action object and the semantic feature vector of the interlocking logic information. The logical constraint type corresponding to the device action object is determined based on the correlation degree.
[0103] In practical applications, assuming the semantic feature vector of the operation intention is [0.25, 0.60, 0.15, 0.80], and the semantic feature vectors corresponding to the two associated device entities are [0.30, 0.55, 0.20, 0.75] and [0.10, 0.20, 0.70, 0.30] respectively, the correlation degree between the operation intention and the first associated device entity is calculated to be 0.92, and the correlation degree with the second associated device entity is 0.45, therefore, "Isolating Switch A" corresponding to the correlation degree of 0.92 is selected. The device is used as the target of action; then the correlation between the target of action and the electrical connection relationship information "series connection" is calculated to be 0.88, and the connection relationship type is determined to be "series connection"; then the correlation between the target of action and the interlocking logic information "isolating switch A must be in the open state" is calculated to be 0.91, and the logic constraint type is determined to be "open state requirement". The above example is only one example of this application. In actual application, it can be set according to the requirements. This application does not limit it.
[0104] B3: The logic processing unit of the large language model combines the device target, the connection relationship type, and the logical constraint type according to a preset rule template to generate multiple logical statements.
[0105] In step B3, the logic processing unit refers to the neural network module in the large language model that is responsible for combining the identified elements into a standardized logical expression. The rule template refers to the predefined sentence structure used to generate logical statements. The logical statement refers to a complete sentence in natural language that describes the logical relationship between devices.
[0106] In this embodiment, the device action object, connection relationship type, and logical constraint type determined in step B2 are input into the logic processing unit of the large language model. The logic processing unit combines these elements according to a preset rule template. For example, the combination of device action object and connection relationship type adopts the template "there is a connection relationship type connection between device action object and graph node", and the combination of device action object and logical constraint type adopts the template "the device action object must satisfy the logical constraint type". Through the above combination processing, multiple logical statements describing the logical relationship between devices are generated.
[0107] In practical applications, assuming the device target determined in step B2 is "disconnector A", the connection type is "series connection", and the logical constraint type is "open state requirement", the logical statements "disconnector A and circuit breaker QF101 are connected in series" and "disconnector A must be in the open state" are generated after combining according to the rule template; similarly, corresponding logical statements are generated for other related device entities. The above example is only one example of this application, and in practical applications, it can be set according to requirements, which is not limited in this application.
[0108] B4: The output layer of the large language model arranges multiple logical statements in logical order to form an interlocking inference rule chain.
[0109] In step B4, the output layer refers to the neural network module in the large language model that is responsible for converting the internal processing results into the final output text, and the logical order refers to the sequential arrangement of logical statements based on causal or dependency relationships.
[0110] In this embodiment of the application, multiple logical statements generated in step B3 are input into the output layer of the large language model. The output layer analyzes these logical statements, identifies the causal and dependency relationships between the statements, and sorts the logical statements according to the logical order of cause and effect and dependency. The sequence of logical statements formed after sorting is the interlocking reasoning rule chain, which is used to perform logical verification of the generated intermediate conclusions in subsequent steps.
[0111] In practical applications, assuming the logical statements generated in step B3 include "There is a series connection between disconnector A and circuit breaker QF101", "Disconnector A must be in the open state", "There is a series connection between disconnector B and circuit breaker QF101", and "Disconnector B must be in the open state", the output layer arranges them in logical order to form an interlocking reasoning rule chain. First, the statements describing the connection relationship are arranged, and then the corresponding logical constraint statements are arranged. The final interlocking reasoning rule chain is as follows: Statement 1 "There is a series connection between disconnector A and circuit breaker QF101", Statement 2 "Disconnector A must be in the open state", Statement 3 "There is a series connection between disconnector B and circuit breaker QF101", Statement 4 "Disconnector B must be in the open state". The above example is only one example of this application. In practical applications, it can be set according to requirements, and this application does not limit it.
[0112] Step 1052: Input the operation and maintenance knowledge fragment into the large language model, and generate text units step by step in an autoregressive manner through the large language model.
[0113] In step 1052, the autoregressive approach refers to the way in which the text unit generated by the large language model at each time step depends on the generation method of the content generated at all previous time steps; the text unit refers to the smallest text unit generated by the large language model at each time step, which can be a single word or phrase.
[0114] In this embodiment of the application, the operation and maintenance knowledge fragment obtained in step 104 is first input into the large language model, and the large language model starts to generate the answer text in an autoregressive manner; at each time step, the model predicts the next most likely text unit based on all the generated text units and the content of the operation and maintenance knowledge fragment, and repeats the above process step by step until the complete answer text is generated.
[0115] In practical applications, assuming the maintenance knowledge fragment includes content such as "before disconnecting circuit breaker QF101, it must be confirmed that isolating switch QS101 is in the open state," the large language model generates text units step-by-step in an autoregressive manner. The first time step generates "disconnect," the second time step generates "open," and the third time step generates "operation," progressively combining to form the complete answer text. The above example is only one example of this application; in practical applications, it can be set according to requirements, and this application does not limit it in this way.
[0116] Step 1053: After generating text units at each time step, the large language model is used to combine all currently generated text units into intermediate conclusions, and the intermediate conclusions are logically verified according to the interlocking inference rule chain.
[0117] In step 1053, the intermediate conclusion refers to the partial answer content formed by the combination of all text units generated from the start of generation to the current time step; the logical verification refers to the process of comparing the intermediate conclusion with the logical statements in the chain of interlocking inference rules to determine whether the intermediate conclusion violates any logical constraint in the chain of rules.
[0118] In this embodiment, after a text unit is generated at each time step, the large language model combines the text units generated at the current time step and all previous time steps to form an intermediate conclusion; then, it calls the interlocking inference rule chain formed in step B4, compares the intermediate conclusion with each logical statement in the rule chain, and checks whether there is any content in the intermediate conclusion that contradicts the requirements of the logical statement; through the above logical verification, it is ensured that the intermediate conclusion generated at each time step conforms to the interlocking logical rules.
[0119] In practical applications, assuming the text units generated in the first three time steps combine to form the intermediate conclusion "Disconnect circuit breaker QF101", the large language model compares it with the logical statements in the interlocking inference rule chain. It finds that the rule chain requires "disconnector A must be in the open state," but the intermediate conclusion does not mention the state of disconnector A. Therefore, the intermediate conclusion does not yet violate the rule. However, if the subsequent generation is "No need to check the state of disconnector A," it directly contradicts the logical statements in the rule chain. The above example is merely one example of this application; in practical applications, it can be configured according to requirements, and this application does not limit this.
[0120] Step 1054: When the intermediate conclusion violates the logical constraints in the interlocking inference rule chain, backtrack to the previous time step through the large language model, and regenerate the text unit of the current time step based on the operation and maintenance knowledge fragment, until the regenerated intermediate conclusion satisfies all the logical constraints in the interlocking inference rule chain.
[0121] In step 1054, backtracking refers to the process by which the large language model abandons the generation result of the current time step and restores the generation state to the previous time step when the intermediate conclusion violates the logical constraints.
[0122] In this embodiment, when the logical verification in step 1053 finds that the intermediate conclusion violates any logical constraint in the interlocking inference rule chain, the large language model immediately stops the generation process of the current time step and rolls back the generation state to the previous time step through a backtracking mechanism; then, based on the content of the operation and maintenance knowledge fragment, it recalculates the generation probability distribution of the current time step and generates a new text unit to replace the original text unit; the regenerated text unit is logically verified again, and the above backtracking and regeneration process is repeated until the regenerated intermediate conclusion satisfies all logical constraints in the interlocking inference rule chain.
[0123] In practical applications, suppose the text unit generated at a certain time step is "No need to check the state of disconnector A," causing the intermediate conclusion to violate the logical statement "disconnector A must be in the open state" in the rule chain. The large language model backtracks to the previous time step and regenerates the text unit for the current time step as "The state of disconnector A must be checked." After logical verification, this intermediate conclusion satisfies all logical constraints in the rule chain. The above example is only one example of this application. In practical applications, it can be set according to requirements, and this application does not limit it.
[0124] Step 1055: Repeat the above time-step generation, logic verification and backtracking process through the large language model until the intelligent question answering result text is generated.
[0125] In this embodiment, the large language model repeatedly executes the time-step generation, logic verification, and backtracking process of steps 1052 to 1054, ensuring that the generated intermediate conclusions satisfy all logical constraints in the interlocking inference rule chain at each time step; when the generation process reaches a preset termination condition, such as generating an end symbol or reaching the maximum length, the finally generated text is output as the complete intelligent question-answering result text.
[0126] In practical applications, the large language model undergoes multiple time steps of generation and verification, ultimately generating the complete intelligent question-and-answer result text: "Before disconnecting circuit breaker QF101, it must be confirmed that disconnector A is in the open state, disconnector B is in the open state, and transformer T201 has no fault alarm signal." The above example is merely one example of this application; in practical applications, it can be configured according to requirements, and this application does not limit this.
[0127] This application transforms the set of procedural constraints into a chain of interlocking reasoning rules through the above steps. During the answer generation process, the intermediate conclusions at each time step are logically verified in real time, and the generated results that violate the rules are corrected through a backtracking mechanism, ensuring that the final generated intelligent question-and-answer result text strictly conforms to the interlocking logic rules between the four electrical equipment of the railway.
[0128] Figure 3 A schematic diagram of the structure of a railway electrical, signaling, and communication (Electrical, Electrical, and Computer) maintenance knowledge-based intelligent question-and-answer system based on a large language model is provided in this application embodiment. Figure 3 As shown, the system includes: The acquisition module 31 is used to acquire the question and answer request sent by the inspection terminal. The question and answer request includes equipment identification information, equipment spatial location data and natural language question text.
[0129] Analysis module 32 is used to perform syntactic analysis on the natural language question text using a constraint alignment algorithm to obtain the target equipment entity and operation intention, and to locate the graph node that matches the target equipment entity in the pre-constructed railway four-electric interlocking relationship knowledge graph based on the equipment identification information.
[0130] The traversal module 33 is used to perform graph traversal starting from the graph node to obtain associated device entities, electrical connection relationship information and interlocking logic information, and to combine the operation intention, the associated device entities, the electrical connection relationship information and the interlocking logic information into a set of procedure constraints.
[0131] The retrieval module 34 is used to perform vector retrieval in a pre-built railway electrical, electronic, and electronic control system maintenance knowledge base based on the equipment identification information and the equipment spatial location data to obtain maintenance knowledge fragments.
[0132] The input module 35 is used to input the set of procedural constraints and the operation and maintenance knowledge fragments into the large language model. The large language model performs logical constraints on the generation process based on the set of procedural constraints to generate intelligent question-and-answer result text that conforms to the logic of railway four-electric interlocking.
[0133] The intelligent question-and-answer system for railway electrical, electronic, and power systems based on a large language model in this application is used to implement the aforementioned intelligent question-and-answer method for railway electrical, electronic, and power systems based on a large language model. Therefore, the specific implementation of the intelligent question-and-answer system for railway electrical, electronic, and power systems based on a large language model can be found in the embodiment section of the intelligent question-and-answer method for railway electrical, electronic, and power systems based on a large language model. The specific implementation can be referred to the description of the corresponding embodiments, and will not be repeated here.
[0134] This application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of the above-described intelligent question-and-answer method for railway electrical, electronic, and electronic maintenance knowledge based on a large language model.
[0135] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described intelligent question-and-answer method for railway electrical, electronic, and communication system maintenance based on a large language model.
[0136] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, read-only memory, random access memory, portable hard drives, magnetic disks, or optical disks.
[0137] The embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the embodiments of the intelligent question-and-answer method for railway electrical, electronic, and communication maintenance knowledge based on a large language model.
[0138] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0139] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with relevant laws, regulations and standards, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0140] The above provides a detailed description of the intelligent question-answering method and system for railway electrical, signaling, and communication systems based on a large language model, as provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and its core ideas. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of this application.
Claims
1. A method for intelligent question-and-answering of railway electrical, signaling, and electronic control system maintenance knowledge based on a large language model, characterized in that: include: The system acquires a question-and-answer request sent by the inspection terminal, the question-and-answer request containing device identification information, device spatial location data, and natural language question text; The natural language question text is syntactically analyzed using a constraint alignment algorithm to obtain the target equipment entity and the operation intention. Based on the equipment identification information, the graph node that matches the target equipment entity is located in the pre-constructed railway four-electric interlocking relationship knowledge graph. Starting from the graph node, a graph traversal is performed to obtain associated device entities, electrical connection relationship information, and interlocking logic information. The operation intention, the associated device entities, the electrical connection relationship information, and the interlocking logic information are combined into a set of procedure constraint conditions. Based on the equipment identification information and the equipment spatial location data, a vector retrieval is performed in the pre-built railway electrical, electronic, and electronic control system maintenance knowledge base to obtain maintenance knowledge fragments; The set of procedural constraints and the fragments of operation and maintenance knowledge are input into a large language model. The large language model then applies logical constraints to the generation process based on the set of procedural constraints, generating intelligent question-and-answer result text that conforms to the logic of railway four-electric interlocking.
2. The intelligent question-and-answer method for railway electrical, electronic, and electronic control systems based on a large language model as described in claim 1, characterized in that, The process involves inputting the set of procedural constraints and the fragments of operation and maintenance knowledge into a large language model. The large language model then applies logical constraints to the generation process based on the set of procedural constraints, generating intelligent question-and-answer result text that conforms to the logic of railway four-electric interlocking, including: The set of procedural constraints is input into the large language model, and the large language model is used to convert the set of procedural constraints into a chain of interlocking reasoning rules for the four electrical systems of the railway. The operation and maintenance knowledge fragments are input into the large language model, and text units are generated step by step in an autoregressive manner through the large language model. After generating a text unit at each time step, the large language model combines all the currently generated text units into an intermediate conclusion, and performs logical verification on the intermediate conclusion based on the interlocking inference rule chain. When the intermediate conclusion violates the logical constraints in the interlocking inference rule chain, the large language model is used to backtrack to the previous time step, and the text unit of the current time step is regenerated based on the operation and maintenance knowledge fragment until the regenerated intermediate conclusion satisfies all the logical constraints in the interlocking inference rule chain. The above-described time-step generation, logical verification, and backtracking process is repeated using the large language model until the intelligent question-answering result text is generated.
3. The intelligent question-and-answer method for railway electrical, electronic, and electronic control systems based on a large language model as described in claim 2, is characterized in that... The process of converting the set of procedural constraints into a chain of interlocking reasoning rules for railway electrical, electronic, and electronic systems using the large language model includes: The encoder of the large language model extracts features from the set of procedural constraints to obtain the semantic feature vector of each element in the set of procedural constraints. The elements in the set of procedural constraints include the operation intention, the associated equipment entity, the electrical connection relationship information, and the interlocking logic information. The attention mechanism of the large language model is used to calculate the correlation between the semantic feature vector of the operation intention and the semantic feature vector of the associated device entity, the semantic feature vector of the electrical connection information, and the semantic feature vector of the interlocking logic information. Based on the correlation, the device action object corresponding to the operation intention, the connection relationship type corresponding to the device action object, and the logical constraint type corresponding to the device action object are determined. The logic processing unit of the large language model combines the device target, the connection relationship type, and the logical constraint type according to a preset rule template to generate multiple logical statements. The output layer of the large language model arranges multiple logical statements in logical order to form an interlocking inference rule chain.
4. The intelligent question-and-answer method for railway electrical, electronic, and electronic control systems based on a large language model according to claim 1, characterized in that, Before obtaining the question-and-answer request sent by the inspection terminal, the process also includes the steps of constructing a railway electrical, electronic, and communication system maintenance knowledge base and a railway electrical, electronic, and interlocking relationship knowledge graph: Collect emergency repair plans, work instructions, equipment manuals, equipment ledgers, equipment history records, and historical fault case data from multiple subordinate organizations within the railway's electrical, electronic, and communication systems. Optical character recognition (OCR) is performed on the emergency repair plan document, the work instruction document, the equipment manual document, and the historical fault case data to obtain the corresponding text data. The equipment ledger data and the equipment history data are parsed in a structured manner to obtain the corresponding structured record data; The text data and the structured record data are segmented to obtain multiple text paragraphs and multiple structured entries; Each text paragraph and each structured entry are vectorized to obtain a text paragraph vector corresponding to each text paragraph and a structured entry vector corresponding to each structured entry; The text paragraphs, text paragraph vectors, structured entries, and structured entry vectors are stored in a vector database, and the stored content in the vector database constitutes the railway electrical, electronic, and electronic maintenance knowledge base. The equipment entity names, connections between equipment entities, and logical constraints between equipment entities are extracted from the text data and the structured record data. Using the equipment entity names as nodes, the connections as edges, and the logical constraints as edges, a knowledge graph of railway four-electric interlocking relationships is constructed.
5. The intelligent question-and-answer method for railway electrical, electronic, and electronic control systems based on a large language model according to claim 1, characterized in that, The step of performing syntactic analysis on the natural language question text using a constraint alignment algorithm to obtain the target equipment entity and operation intention, and locating the graph node matching the target equipment entity in the pre-constructed railway four-electric interlocking relationship knowledge graph based on the equipment identification information, includes: The natural language problem text is segmented into words to obtain a word sequence; Each word in the word sequence is labeled with its grammatical role to obtain the grammatical role information of each word; Based on the grammatical role information, words representing device names are identified from the word sequence as target device entities, and words representing query or operation types are identified as operation intentions. Extract the unique code of the equipment from the equipment identification information, search for the node corresponding to the unique code of the equipment in the knowledge graph of the railway four-electric interlocking relationship, and take the node as a candidate node. The target device entity is compared with the device name attribute of the candidate node. If the comparison result is consistent, the candidate node is determined as a graph node. If the comparison result is inconsistent, a node whose device name attribute matches the target device entity is searched in the railway four-electric interlocking relationship knowledge graph, and the corresponding node is taken as a graph node.
6. The intelligent question-and-answer method for railway electrical, electronic, and electronic control systems based on a large language model according to claim 1, characterized in that, The graph traversal starting from the graph node to obtain associated device entities, electrical connection relationship information, and interlocking logic information includes: The operation intent is parsed to determine the traversal depth; Using the graph node as the starting node, perform a breadth-first traversal in the railway four-electric interlocking relationship knowledge graph according to the preset connection relationship to obtain nodes whose path length is less than or equal to the traversal depth, and record the obtained nodes as associated equipment entities. For the connection edges between the graph node and each associated device entity, electrical connection relationship information and interlocking logic information are extracted from the attribute fields of the connection edges.
7. The intelligent question-and-answer method for railway electrical, electronic, and electronic control systems based on a large language model according to claim 1, characterized in that, Based on the equipment identification information and the equipment spatial location data, a vector retrieval is performed in a pre-built railway electrical, electronic, and electronic control (Electrical, Electrical, and Electronic Systems) maintenance knowledge base to obtain maintenance knowledge fragments, including: The device identification information and the device spatial location data are vectorized using a pre-trained embedding model to obtain a first feature vector and a second feature vector. The first feature vector and the second feature vector are then combined to obtain a composite query vector. In a pre-built vector database, the similarity between the composite query vector and multiple candidate vectors is calculated. The vector database stores the feature vectors corresponding to each knowledge segment in the railway electrical, electronic, and power maintenance knowledge base. The top K knowledge fragments with the highest similarity scores are selected as operation and maintenance knowledge fragments, where K is a preset positive integer.
8. A railway electrical, signaling, and electronic control system based on a large language model, characterized in that: include: The acquisition module is used to acquire the question and answer request sent by the inspection terminal. The question and answer request includes equipment identification information, equipment spatial location data and natural language question text. The analysis module is used to perform syntactic analysis on the natural language question text using a constraint alignment algorithm to obtain the target equipment entity and operation intention, and to locate the graph node that matches the target equipment entity in the pre-constructed railway four-electric interlocking relationship knowledge graph based on the equipment identification information. The traversal module is used to perform graph traversal starting from the graph node to obtain associated device entities, electrical connection relationship information and interlocking logic information, and to combine the operation intention, the associated device entities, the electrical connection relationship information and the interlocking logic information into a set of procedure constraints. The retrieval module is used to perform vector retrieval in a pre-built railway electrical, electronic, and electronic control system maintenance knowledge base based on the equipment identification information and the equipment spatial location data to obtain maintenance knowledge fragments. The input module is used to input the set of procedural constraints and the fragments of operation and maintenance knowledge into the large language model. The large language model performs logical constraints on the generation process based on the set of procedural constraints to generate intelligent question-and-answer result text that conforms to the logic of railway four-electric interlocking.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the intelligent question-and-answer method for railway electrical, electronic, and communication maintenance knowledge based on a large language model as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, enables the implementation of the intelligent question-and-answer method for railway electrical, electronic, and electronic maintenance knowledge based on a large language model as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Knowledge graph-based customer service robot response method and system
CN121478922A
Intelligent system conflict point review system based on knowledge graph and large language model
CN121501985A
Equipment operation and maintenance data enhancement retrieval method based on knowledge graph and large language model
CN121743468A
Generating answers to multi-hop constraint-based questions from knowledge graphs
US20230169361A1
Cited By
Striped tube simulation macro script generation method based on knowledge graph and related products
CN122308805A
Striped tube simulation macro script generation method based on knowledge graph and related products
CN122308805B