Railway motor train unit fault rule learning method and system
Through the EMU association rules learning method based on the knowledge graph, the problem that the extraction of entity and relationship chains in the EMU fault text requires a large amount of manual labeling data, and efficient and low-cost fault entity recognition and relationship extraction are achieved, improving the extraction quality and model generalization ability.
Patent Information
- Application Number
- CN202510019094.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-04-15
AI Technical Summary
The prior art requires a large amount of manual labeling of sample data when extracting entities and relationship chains in EMU fault text, resulting in high efficiency and cost, and poor generalization capabilities of the model, affecting the quality of the extracted association rules.
The EMU association rule learning method based on knowledge graph is adopted, and a named entity recognition and relationship extraction prompt template is constructed by defining the faulty entity type and relationship type, and the context learning ability of the big model is used to perform multiple rounds of question-and-answer entity recognition and relationship extraction, reducing dependence on manual labeled data.
There is no need for a large amount of manual annotation data and model training, and only a small amount of annotated data examples are required. It can adapt to the characteristics of different fault texts, improve the efficiency and quality of EMU fault entity identification and relationship extraction, and reduce costs.
Smart Images

Figure CN119829776A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of fault analysis, and in particular to a method and system for learning fault rules of railway EMUs. Background Art
[0002] At present, with the continuous development of high-speed railways, high-speed trains have become one of the important ways for people to travel. During the operation of the train, fault text data will be generated. These data record relevant fault information such as fault overview, fault cause, and treatment measures. Processing and analyzing these data can help the railway operation department understand the occurrence and cause of the fault, and provide relevant knowledge in the future operation process to ensure the safe operation of the railway.
[0003] A major challenge currently faced is how to identify and extract fault information in a timely and accurate manner. EMU fault information is usually contained in unstructured text data such as investigation reports and maintenance logs, which makes the extraction of relevant EMU fault information difficult and time-consuming.
[0004] At present, there is still a lack of methods for extracting entities and relationship chains from EMU fault texts. Existing methods manually annotate existing EMU fault data and build deep learning models for entity recognition and relationship extraction. However, this method requires a large amount of annotated sample data for training, and the cost of collecting and annotating data is high. For entities and relationship chains specific to the EMU fault field, sufficient sample data is required for training, otherwise the model may have poor generalization ability. This affects the quality of the extracted association rules. Summary of the invention
[0005] In order to solve the defects of the above-mentioned prior art, an embodiment of the present application provides a method for learning fault rules of railway EMUs to solve the efficiency and cost technical problems caused by the need for a large amount of manually labeled sample data.
[0006] In a first aspect, an embodiment of the present application provides a method for learning fault rules of a railway EMU, comprising:
[0007] Fault type and template pre-definition steps: Based on the collected railway EMU fault text, define the fault entity type and relationship type, and build an EMU fault named entity recognition prompt template based on the fault entity type; build an EMU fault relationship extraction prompt template based on the fault relationship type;
[0008] Fault relationship chain extraction step: Based on the fault text, entity type, fault named entity recognition prompt template, fault relationship type and fault relationship extraction prompt template, the pre-built fault rule learning model is guided to extract the EMU fault relationship chain to obtain the EMU fault triplet;
[0009] Fault rule learning steps: Based on the fault triples, the fault rule learning model is continuously iterated and trained. The railway EMU fault text to be learned is input into the fault rule learning model to generate the railway EMU fault rule learning results to guide the handling of EMU faults.
[0010] As an optional implementation manner, in the first aspect of the present invention, the above-mentioned railway EMU fault rule learning method further comprises:
[0011] Fault rule mining steps: construct a knowledge graph based on the extracted EMU fault triples, extract path information, use the prompt engineering to use the fault rule learning model to perform rule mining, and generate a candidate rule set;
[0012] Fault rule sorting step: Based on the candidate rule set and knowledge graph, the quality of the generated rules is evaluated by the logical rule sorter to filter out pseudo rules with high confidence but low frequency.
[0013] As an optional implementation manner, in the first aspect of the present invention, the above-mentioned fault type and template predefinition step includes:
[0014] Fault type definition step: define the EMU fault entity type and relationship type according to the EMU fault text and the existing EMU fault knowledge graph;
[0015] Entity template pre-definition step: constructing a named entity recognition prompt template for EMU fault according to the fault text and the pre-defined EMU fault entity type;
[0016] Relationship template pre-definition step: According to the fault text and the pre-defined EMU fault relationship type, a EMU fault relationship extraction prompt template chain is constructed.
[0017] As an optional embodiment, in the first aspect of the present invention, the above-mentioned prompt template chain includes: a first-stage template and a second-stage template, wherein the first-stage template includes a relationship list, the second-stage template includes a triple corresponding to the relationship list, and the fault triple is defined as: (first entity, relationship, second entity).
[0018] As an optional implementation manner, in the first aspect of the present invention, the above-mentioned fault relationship chain extraction step includes:
[0019] Candidate example generation step: Based on the fault text to be extracted and the pre-generated named entity candidate examples, a similarity algorithm is used to select the entity recognition demonstration example set with the highest similarity; Based on the fault text to be extracted and the pre-generated entity relationship candidate examples, a similarity algorithm is used to select the relationship extraction demonstration example set with the highest similarity;
[0020] Fault entity extraction step: fill the fault text to be extracted, entity type and entity recognition demonstration example into the entity recognition prompt template, and input them into the fault rule learning model to obtain the fault entity in the fault text to be extracted;
[0021] Fault relationship extraction steps: fill the fault text and relationship type to be extracted into the prompt template chain to obtain the relationship type contained in the fault text; the extracted entities and relationship types are input into the large model for multiple rounds of question and answer to complete the EMU fault relationship extraction.
[0022] As an optional implementation manner, in the first aspect of the present invention, the above-mentioned fault rule mining step includes:
[0023] A knowledge graph is constructed based on the extracted EMU fault triplets, a prompt template is constructed, and a fault rule learning model is used to link the triplets to each other to generate a candidate rule set, wherein, in the mutually linked triplets, the second entity of the triplet arranged first is the same as the first entity of the triplet arranged later.
[0024] As an optional implementation manner, in the first aspect of the present invention, the above-mentioned fault rule sorting step includes:
[0025] According to the candidate rule set and knowledge graph, the candidate rules are sorted, the rule frequency and confidence are calculated, and high-quality rules are screened through the set threshold.
[0026] In a second aspect, an embodiment of the present application provides a railway EMU fault rule learning system, which adopts a railway EMU fault rule learning method, and the system includes:
[0027] Fault type and template pre-definition module: Based on the collected railway EMU fault text, define the fault entity type and relationship type, and build the EMU fault named entity recognition prompt template based on the fault entity type; build the EMU fault relationship extraction prompt template based on the fault relationship type;
[0028] Fault relationship chain extraction module: Based on fault text, entity type, fault named entity recognition prompt template, fault relationship type and fault relationship extraction prompt template, the pre-built fault rule learning model is guided to extract the EMU fault relationship chain and obtain the EMU fault triplet;
[0029] Fault rule learning module: Based on the fault triples, the fault rule learning model is continuously iterated and trained. The railway EMU fault text to be learned is input into the fault rule learning model to generate the railway EMU fault rule learning results;
[0030] Fault rule mining module: builds a knowledge graph based on the extracted EMU fault triples, extracts path information, uses the prompt engineering to perform rule mining using the fault rule learning model, and generates a candidate rule set;
[0031] Fault rule sorting module: Based on the candidate rule set and knowledge graph, the quality of generated rules is evaluated through the logical rule sorter to filter out pseudo rules with high confidence but low frequency.
[0032] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory storing executable program code; a processor coupled to the memory; the processor calls the executable program code stored in the memory to execute the railway EMU fault rule learning method as described above.
[0033] In a fourth aspect, an embodiment of the present application provides a computer storage medium, wherein the computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the railway EMU fault rule learning method as described above.
[0034] Compared with the related prior art, it has the following outstanding beneficial effects:
[0035] 1. The method of the present invention is based on the knowledge graph-based EMU association rule learning method, which does not require a large amount of manually labeled data and model training, but only requires a small amount of annotated data examples. It retrieves similar examples and adds them to prompts, uses the context learning ability of the large model, and performs EMU fault entity recognition and relationship extraction in the form of multiple rounds of dialogue. It can adapt to different fault text characteristics and extract EMU fault relationships according to actual conditions;
[0036] 2. The method of the present invention extracts association rules from fault triples formed by the extracted EMU fault relationship chain, further improves the knowledge graph and guides the handling of EMU faults. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0038] Figure 1 Schematic diagram of a method for learning fault rules of a railway EMU according to an embodiment of the present invention Figure 1 ;
[0039] Figure 2 Schematic diagram of a method for learning fault rules of a railway EMU according to an embodiment of the present invention Figure 2 ;
[0040] Figure 3Schematic diagram of a method for learning fault rules of a railway EMU according to an embodiment of the present invention Figure 3 ;
[0041] Figure 4 This is a schematic diagram of a railway EMU fault rule learning system according to an embodiment of the present invention;
[0042] Figure 5 Schematic diagram of computer hardware of the present invention. DETAILED DESCRIPTION
[0043] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0044] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects rather than to describe a specific order. In addition, the term "and / or" in this article is only a description of the association relationship between related objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the previous and next related objects are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the previous and next context for specific understanding.
[0045] In the present invention, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0046] It should also be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0047] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0048] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0049] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0050] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0051] In order to make the above features and effects of the present invention more clearly and understandably described, embodiments are given below and described in detail with reference to the accompanying drawings. This specification discloses one or more embodiments that include the features of the present invention. The disclosed embodiments are only for illustration. The scope of protection of the present invention is not limited to the disclosed embodiments, and the present invention is defined by the attached claims.
[0052] The following is a system embodiment corresponding to the above method embodiment. This embodiment can be implemented in conjunction with the above embodiment. The relevant technical details mentioned in the above embodiment are still valid in this embodiment. In order to reduce repetition, they are not repeated here. Accordingly, the relevant technical details mentioned in this embodiment can also be applied in the above embodiment.
[0053] The present invention aims to provide a method for learning railway EMU fault rules, which specifically includes S1. defining EMU fault entity types and relationship types according to EMU fault texts; S2. manually labeling a small amount of EMU fault texts, and using the obtained data as candidate examples in the construction of large model prompts; S3. constructing named entity recognition prompts and relationship extraction prompt templates according to predefined fault entities and relationship types respectively: S4. retrieving relevant examples from candidate examples and constructing prompts, and guiding the large model to extract EMU fault relationships in the form of multiple rounds of questions and answers; S5. adding the obtained EMU fault entities, relationships and corresponding EMU fault texts to the candidate examples. S6. extracting paths from the extracted EMU fault triples to express structural information, and using the large model for rule mining using the prompt project. S7. evaluating the quality of generated rules through a logical rule sorter, and filtering rules with high confidence but low frequency. The following is a detailed description in conjunction with specific embodiments.
[0054] Embodiment 1
[0055] See also Figure 1 , Figure 1 This is a flow chart of a method for learning fault rules of a railway EMU according to an embodiment of the present invention. Figure 1 The railway EMU fault rule learning method can be applied to a railway EMU fault rule learning system provided in the embodiment of the present application, and can also be applied to electronic devices, which is not limited in the embodiment of the present invention. The railway EMU fault rule learning method includes:
[0056] Fault type and template pre-definition step 101: define fault entity type and relationship type according to the collected railway EMU fault text, build an EMU fault named entity recognition prompt template according to the fault entity type; build an EMU fault relationship extraction prompt template according to the fault relationship type;
[0057] In the embodiment of the present invention, the acquired railway EMU fault text data may be acquired in real time or at a fixed time, and the embodiment of the present invention does not specifically limit this;
[0058] In a specific embodiment of the present invention, the EMU fault entity type and relationship type are defined according to the EMU fault text; according to the EMU fault text and the existing EMU fault knowledge graph, the EMU fault entity type and relationship type are defined, such as one or more of "train number", "road bureau", "handling measures", "operation in", "cause", and "fault cause", which are not specifically limited in the embodiment of the present invention;
[0059] Fault relationship chain extraction step 102: Based on the fault text, entity type, fault named entity recognition prompt template, fault relationship type and fault relationship extraction prompt template, guide the pre-built fault rule learning model to extract the EMU fault relationship chain to obtain the EMU fault triplet;
[0060] In a specific embodiment of the present invention, named entity recognition prompts and relationship extraction prompt templates are respectively constructed according to predefined fault entities and relationship types:
[0061] Step 1, according to the predefined EMU fault entity type, construct an EMU fault named entity recognition prompt template, the constructed prompt template is such as: "Given the EMU fault text: 'text 1', given the entity type list [entity type 1, entity type 2...], identify the entities and their types existing in the given text, and output them in the form of (entity, entity type). The following is an example of EMU fault entity recognition: 'Example 1'";
[0062] Step 2. According to the predefined EMU fault relationship type, construct an EMU fault relationship extraction prompt template chain. The constructed prompt template chain includes two stages. The first stage is such as: "Given the EMU fault text: 'text 1', given the relationship list: [relationship 1, relationship 2...] What relationships may be included in this text? Please give the relationships in the relationship list. Output in the form of (relationship 1, relationship 2,...)". The second stage is such as: "Given the EMU fault text: 'text 1', given the entity list [entity 1, entity 2...], output the triple whose relationship is (relationship type), and output it in the form of (entity 1, relationship, entity 2). The following is an example of EMU fault relationship extraction: 'Example 2'".
[0063] Fault rule learning step 103: Based on the fault triples, the fault rule learning model is continuously iterated and trained, the railway EMU fault text to be learned is input into the fault rule learning model, and the railway EMU fault rule learning result is generated to guide the handling of the EMU fault.
[0064] Embodiment 2
[0065] See also Figure 2 and Figure 3 , Figure 2 and Figure 3This is another flow chart of a method for learning fault rules of a railway EMU according to an embodiment of the present invention. Figure 2 and Figure 3 The another railway EMU fault rule learning method can be applied to a railway EMU fault rule learning system provided in the embodiment of the present application, and can also be applied to electronic devices, which is not limited in the embodiment of the present invention. The railway EMU fault rule learning method includes:
[0066] Fault type and template pre-definition step 201: define fault entity type and relationship type according to the collected railway EMU fault text, build a EMU fault named entity recognition prompt template according to the fault entity type; build an EMU fault relationship extraction prompt template according to the fault relationship type;
[0067] The above fault types and template pre-defined steps include:
[0068] Fault type definition step 2011: define the EMU fault entity type and relationship type according to the EMU fault text and the existing EMU fault knowledge graph;
[0069] In a specific embodiment of the present invention, according to the EMU fault data set, the entity type is defined as one or more of "model", "train number", "train number", "operating range", "fault overview", "occurrence location", "fault manifestation", "accident classification", "fault cause", "responsibility category", "accident responsibility", "part name", etc., which is not specifically limited in the embodiment of the present invention;
[0070] The relationship type is defined as one or more of "running on", "causing", "influencing", "handling method", "assignment", "faulty part", "belonging system", etc., and the embodiment of the present invention does not make specific limitations.
[0071] Entity template pre-definition step 2012: constructing a train group fault named entity recognition prompt template according to the fault text and the pre-defined train group fault entity type;
[0072] In a specific embodiment of the present invention, a named entity recognition prompt template for EMU fault is constructed according to a predefined EMU fault entity type. The constructed prompt template is as follows: "Given an EMU fault text: 'text 1', given an entity type list [entity type 1, entity type 2...], identify the entities and their types existing in the given text, and output them in the form of (entity, entity type). The following is an example of EMU fault entity recognition: 'Example 1'";
[0073] Relationship template pre-definition step 2013: According to the fault text and the pre-defined EMU fault relationship type, a EMU fault relationship extraction prompt template chain is constructed.
[0074] The above prompt template chain includes: a first-stage template and a second-stage template, wherein the first-stage template includes a relationship list, the second-stage template includes a triple corresponding to the relationship list, and the fault triple is defined as: (first entity, relationship, second entity).
[0075] In a specific embodiment of the present invention, a prompt template chain for extracting EMU fault relations is constructed according to predefined EMU fault relation types. The constructed prompt template chain includes two stages. The first stage is such as: "Given EMU fault text: 'text 1', given relation list: [relation 1, relation 2...] What relations may be included in this text? Please give the relations in the relation list. Output in the form of (relation 1, relation 2,...)". The second stage is such as: "Given EMU fault text: 'text 1', given entity list [entity 1, entity 2...], output triples with relation (relation type), output in the form of (entity 1, relation, entity 2). The following is an example of EMU fault relation extraction: 'Example 2'".
[0076] Fault relationship chain extraction step 202: Based on the fault text, entity type, fault named entity recognition prompt template, fault relationship type and fault relationship extraction prompt template, guide the pre-built fault rule learning model to extract the EMU fault relationship chain to obtain the EMU fault triplet;
[0077] The above-mentioned fault relationship chain extraction step 202 includes:
[0078] Candidate example generation step 221: Based on the fault text to be extracted from the relationship and the pre-generated named entity candidate examples, a similarity algorithm is used to select the entity recognition demonstration example set with the highest similarity; Based on the fault text to be extracted from the relationship and the pre-generated entity relationship candidate examples, a similarity algorithm is used to select the relationship extraction demonstration example set with the highest similarity;
[0079] A small amount of EMU fault texts are manually annotated, and the obtained data are used as candidate examples in the construction of large model prompts.
[0080] For the EMU fault text, we manually annotated the entities and relationships in it and obtained a small number of candidate examples. Taking "At 18:16 on January 1, 2021, GXX (XXXX-XX South, CR400AF-B-2210 of XX EMU depot, driver of Nanjing Locomotive Depot) ran to XX North Station-XX South Station. Car 15 reported a traction inverter communication failure (code: 6207), and at the same time, the main breaker of car 11 was tripped. After the on-board mechanic handled it, the driver manually closed the main breaker. Normal operation was resumed at 18:29, and the operation was delayed for 5 minutes." as an example, the entity annotations can be obtained as follows: (CR400AF-B, vehicle model), (2210, train set Number), (GXX, train number), (XXXX-XX South, operating range), (GXX No. 15 car traction inverter communication failure, fault overview), (between XX North Station and XX South Station, location of occurrence), etc., and the triples obtained are (GXX, running at, XXXX-XX South), (GXX No. 15 car traction inverter failure, resulting in the main breaker unable to be closed), (GXX No. 15 car traction inverter communication failure, affecting, operation slowdown for 5 minutes), (GXX No. 15 car traction inverter failure, handling method, manual closing of the main breaker), etc.
[0081] Fault entity extraction step 222: Fill the fault text to be extracted, the entity type and the entity recognition demonstration example into the entity recognition prompt template, and input them into the fault rule learning model to obtain the fault entity in the fault text to be extracted;
[0082] Fault relationship extraction step 2023: fill the fault text and relationship type to be extracted into the relationship template chain to obtain the relationship type contained in the fault text; the extracted entities and relationship types are input into the large model for multiple rounds of question and answer to complete the EMU fault relationship extraction.
[0083] In a specific embodiment of the present invention, relevant examples are retrieved from candidate examples and prompts are constructed, and a large model is guided to extract EMU fault relations in the form of multiple rounds of questions and answers;
[0084] Step 1: Given the fault text x that needs to be extracted and the named entity recognition candidate examples Encode h through BERT respectively x and Then calculate the cosine similarity cos(h x ,h i ), select the k candidate examples with the highest similarity as entity recognition demonstration examples, and use the same method to obtain the relationship extraction demonstration example;
[0085] Step 2: according to the EMU fault entity recognition prompt template described in step 1, the given EMU fault text, entity type and entity recognition demonstration example are filled into the template and input into the large model to obtain the fault entity in the given text;
[0086] Step 3: According to the EMU fault relation extraction prompt template chain described in step 2, firstly fill the given text and relation type into the first stage template to obtain the relation type contained in the given text; then, according to the entity output by S42 and the relation type obtained in the first stage, interact with the big model in the form of multiple rounds of question and answer, so as to extract the EMU fault relation. Specifically, in each round of dialogue, only one relation type is involved, and the big model is specified to extract only triples related to the relation type.
[0087] The EMU fault entities, relations and corresponding EMU fault texts obtained by extracting EMU fault relations are added to the candidate examples.
[0088] Specific implementation examples include:
[0089] According to the given fault text: "At 7:49 on January 1, 2021, GXXX (XX West-XX South, XX EMU CRH380B-5667+5658, driver of XX Locomotive Depot) reported that the door 2-1 of car 566707 on the left side of the running direction was faulty before departure from XX West Station. After inspection, it was found that the compensator was not retracted normally when the centralized control closed the door due to foreign matter stuck in the platform compensator shaft. The vehicle detected that the platform compensator was abnormally retracted and reported the fault code: 1CE7 (the platform compensator of door 2-1 could not be retracted in time). After clearing the foreign matter, the test door status was normal." and candidate examples ["At 18:16 on January 1, 2021, GXX...", "At 12:33 on January 5, 2021, DXXX...", ...], they are encoded and cosine similarity is calculated respectively through the Bert algorithm (used for merging substantially similar entities), and the example with the highest similarity is selected as the demonstration example. Here, the first one is selected as the demonstration example.
[0090] According to the constructed EMU fault entity recognition prompt template, the given EMU fault text, entity type and entity recognition demonstration example are filled into the template, such as: "Given text: 'At 7:49 on January 1, 2021, GXXX (XX West-XX South, XX EMU CRH380B-5667+5658, XX Locomotive Depot driver) XX West Station reported that the driver reported that the 2-1 door of the 566707 car on the left side of the running direction was faulty before departure. After inspection, it was found that the compensator was not retracted normally when the centralized control closed the door due to foreign objects stuck in the platform compensator shaft. The vehicle detected that the platform compensator was abnormally retracted and reported the fault code: 1CE7 (the platform compensator of door 2-1 could not be retracted in time). After cleaning the foreign objects, the test door status was normal.', given entity type list ["vehicle model", "train number", "train number", "operating range", "fault overview", "location of occurrence", "fault manifestation", "accident classification", "fault cause", "responsibility category", "accident determination", "parts Name”], identify the entities and their types in the given text, and output them in the form of (entity, entity type). The following is an example of EMU fault entity recognition: '[At 18:16 on January 1, 2021, GXX (XXXX-XX South, XX EMU CR400AF-B-2210, Nanjing Locomotive Depot driver) ran to XX North Station-XX South Station. Car 15 reported a traction converter communication failure (code: 6207), and at the same time, the 11th car owner tripped. After the on-board mechanic handled the situation, the driver manually closed the main circuit breaker, and normal operation resumed at 18:29, with a delay of 5 minutes. ], the entities include: (CR400AF-B, model), (2210, train number), (GXX, train number), (XXXX-XX South, operating range), (GXX No. 15 traction converter communication failure, fault overview), (XX North Station-XX South Station, location), (main circuit breaker cannot be closed, fault manifestation), (delay of 5 minutes, impact)'". Input it into the large model to obtain the fault entities in the given text; (GXXX, train number), (XX West-XX South, operating range), (CRH380B, model), (5667, 5658, train number), (GXXX No. 07 car 2-1 door failure, fault overview), (XX West Station, location), (platform compensator shaft stuck with foreign matter, fault cause).
[0091] According to the constructed EMU fault relationship extraction prompt template chain, the given text and relationship type are first filled into the first-stage template, such as "Given text: 'At 7:49 on January 1, 2021, GXXX (XX West-XX South, XX EMU CRH380B-5667+5658, XX Locomotive Depot driver) XX West Station driver reported that the 2-1 door of car 566707 on the left side of the running direction was faulty. After inspection, it was found that the compensator was not retracted normally when the centralized control closed the door due to foreign objects stuck in the platform compensator shaft. The vehicle detected that the platform compensator was retracted. Abnormal, reporting fault code: 1CE7 (door 2-1 platform compensator cannot be retracted in time). After cleaning the foreign matter, the test door is in normal condition. 'Given the relationship list: ["operating on", "leading to", "influence", "handling method", "assignment", "faulty parts", "belonging system"] In this text, what relationships may be included? Please give the relationship in the relationship list. Output in the form of (relationship 1, relationship 2, ...)", and input the prompt into the large model to obtain the relationships contained in this paragraph: operating on, leading to, handling method, faulty parts, and belonging system.
[0092] Then, a fault relationship extraction template for the EMU is constructed, such as: "Given the EMU fault text: 'At 7:49 on January 1, 2021, GXXX (XX West-XX South, XX EMU CRH380B-5667+5658, XX Locomotive Depot driver) reported a fault in the 2-1 door of car 566707 on the left side of the running direction before departure from XX West Station. After inspection, it was found that the compensator was not retracted normally when the centralized control closed the door due to foreign objects stuck in the platform compensator shaft. The vehicle detected that the platform compensator was abnormally retracted and reported the fault code: 1CE7 (the platform compensator of door 2-1 could not be retracted in time). After cleaning the foreign objects, the test door status was normal.', given the entity list [(GXXX, train number), (XX West-XX South, operating range), (CRH380B, vehicle model), (5667, 5658, train number), (GXXX train number 07 car 2-1 door failure, fault overview), (XX West Station, location of occurrence), (foreign matter stuck in the platform compensator shaft, cause of failure)], the output relationship is the triplet of (running on), which is output in the form of (entity 1, relationship, entity 2). The following is an example of fault relationship extraction for EMUs: '[At 18:16 on January 1, 2021, GXX (XXXX-XX South, XX EMU CR400AF-B-2210, Nanjing Locomotive Depot driver) ran to XX North Station-XX South Station. Car 15 reported a traction inverter communication failure (code: 6207), and at the same time, the main breaker of car 11 was tripped. After being handled by the on-board mechanic, the driver manually closed the main breaker. Normal driving was restored at 18:29, and the operation was slowed for 5 minutes. ], the triplet with the relationship of running on is: (GXX, running on, XXXX-XX South)'". Similarly, the relationship types obtained in the first stage are filled into the template respectively, and the final EMU fault triplet is obtained as follows: (GXXX, running from XX West to XX South), (foreign objects are stuck in the platform compensator shaft, resulting in the failure of the 2-1 door of GXXX train 07), and (the failure of the 2-1 door of GXXX train 07, the handling method is to clean up the foreign objects).
[0093] The EMU fault entity, relationship and EMU fault text obtained in the fault relationship chain extraction step 202 are added to the candidate examples.
[0094] Fault rule learning step 203: Based on the fault triples, the fault rule learning model is continuously iterated and trained, the railway EMU fault text to be learned is input into the fault rule learning model, and the railway EMU fault rule learning result is generated to guide the handling of the EMU fault.
[0095] Fault rule mining step 204: constructing a knowledge graph based on the extracted EMU fault triples, extracting path information, using the prompt engineering to perform rule mining using the fault rule learning model, and generating a candidate rule set;
[0096] The above-mentioned fault rule mining step includes: constructing a knowledge graph based on the extracted EMU fault triples, constructing a prompt template, and using a fault rule learning model to link the triples to each other to generate a candidate rule set, wherein, in the mutually linked triples, the second entity of the triple arranged first is the same as the first entity of the triple arranged later.
[0097] 1. Build a knowledge graph based on the extracted EMU fault triples, and generate a knowledge graph for each relationship such as r1∧r2∧r4→r head Candidate rules and extract paths from the knowledge graph to represent the structural information of the knowledge graph;
[0098] The following is a candidate rule set for extracting related faulty components: (traction help to open the main circuit breaker, fault cause, CPU board fault of the traction converter control unit TCU) ∧ (CPU board fault of the traction converter control unit TCU, tending to be a faulty component, TCU) → (traction help to open the main circuit breaker, faulty component, TCU), (automatic pantograph lowering and parking, fault cause, pantograph raising valve plate fault) ∧ (pantograph raising valve plate fault, tending to be a faulty component, pressure switch) → (automatic pantograph lowering and parking, faulty component, pressure switch)…
[0099] 2. Build a prompt template: "Based on the sampled candidate rule set, please generate corresponding logical rules for relation r", and use a large language model to generate logical rules.
[0100] The following is an example of using a large model to generate a candidate rule set: "Candidate rule set based on sampling: (traction help to open the main circuit breaker, fault cause, CPU board fault of the traction converter control unit TCU) ∧ (CPU board fault of the traction converter control unit TCU, prone to faulty components, TCU) → (traction help to open the main circuit breaker, faulty components, TCU), (automatic pantograph lowering and parking, fault cause, pantograph raising valve plate fault) ∧ (pantograph raising valve plate fault, prone to faulty components, pressure switch) → (automatic pantograph lowering and parking, faulty components, pressure switch)... Please generate corresponding logical rules for the related faulty components."
[0101] Fault rule sorting step 205: Based on the candidate rule set and the knowledge graph, the quality of the generated rules is evaluated by the logical rule sorter, and pseudo rules with high confidence but low frequency are filtered out.
[0102] According to the candidate rule set and knowledge graph generated in the fault rule mining step, the candidate rules are sorted and the rule frequency f, i.e. the number of times the rule pattern appears in the graph and the confidence level, is calculated. where r bodyThat is, the rule body shown by the candidate rules generated in the fault rule mining step, C() represents the number of times it appears, and high-quality rules are selected by setting a threshold.
[0103] The following is a specific embodiment of the present invention for performing rule screening:
[0104] The candidate rule set generated in step 204 is as follows: (traction help to open the main circuit breaker, fault cause, CPU board fault of the traction converter control unit TCU) ∧ (CPU board fault of the traction converter control unit TCU, tending to be a faulty component, TCU) → (traction help to open the main circuit breaker, faulty component, TCU), (automatic pantograph lowering and parking, fault cause, pantograph raising valve plate fault) ∧ (pantograph raising valve plate fault, tending to be a faulty component, pressure switch) → (automatic pantograph lowering and parking, faulty component, pressure switch). By calculating its frequency and confidence, the confidence of the first rule is 0.9 and the frequency is 5, the confidence of the second rule is 0.6 and the frequency is 3, and the threshold is set to confidence 0.8 and frequency 4, so the rule for the related faulty parts is (traction help to open the main circuit breaker, fault cause, CPU board failure of traction converter control unit TCU) ∧ (CPU board failure of traction converter control unit TCU, prone to faulty parts, TCU) → (traction help to open the main circuit breaker, faulty parts, TCU).
[0105] Embodiment 3
[0106] See also Figure 4 , Figure 4 The present invention provides a railway EMU fault rule learning system, which adopts a railway EMU fault rule learning method, and the system includes:
[0107] Fault type and template pre-definition module 301: define fault entity type and relationship type according to the collected railway EMU fault text, build EMU fault named entity recognition prompt template according to the fault entity type; build EMU fault relationship extraction prompt template according to the fault relationship type;
[0108] Fault relationship chain extraction module 302: Based on the fault text, entity type, fault named entity recognition prompt template, fault relationship type and fault relationship extraction prompt template, guide the pre-built fault rule learning model to extract the EMU fault relationship chain and obtain the EMU fault triple;
[0109] Fault rule learning module 303: Based on the fault triples, the fault rule learning model is continuously iterated and trained, and the railway EMU fault text to be learned is input into the fault rule learning model to generate the railway EMU fault rule learning result;
[0110] Fault rule mining module 304: constructing a knowledge graph based on the extracted EMU fault triples, extracting path information, performing rule mining using a fault rule learning model using prompt engineering, and generating a candidate rule set;
[0111] Fault rule sorting module 305: Based on the candidate rule set and the knowledge graph, the quality of the generated rules is evaluated by the logical rule sorter, and pseudo rules with high confidence but low frequency are filtered out.
[0112] Embodiment 4
[0113] The present application embodiment provides an electronic device, such as Figure 5 As shown, the device includes: a memory storing executable program code; a processor coupled to the memory; the processor calls the executable program code stored in the memory to execute the steps of the railway EMU fault rule learning method as described above.
[0114] Embodiment 5
[0115] An embodiment of the present application provides a computer storage medium, which stores computer instructions. When the computer instructions are called, they are used to execute the steps of the railway EMU fault rule learning method as described above.
[0116] In addition, combined Figure 1 The railway EMU fault rule learning method described in the embodiment of the present application can be implemented by a computer device. Figure 5 Schematic diagram of the hardware structure of a computer device according to an embodiment of the present application.
[0117] In some of these embodiments, the computer device may further include a communication interface 83 and a bus 80. Figure 5 As shown, the processor 81, the memory 82, and the communication interface 83 are connected via a bus 80 and communicate with each other.
[0118] Specifically, the processor 81 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0119] The memory 82 may be used to store or cache various data files required for processing and / or communication, as well as possible computer program instructions executed by the processor 81 .
[0120] The processor 81 implements any one of the railway EMU fault rule learning methods in the above embodiments by reading and executing computer program instructions stored in the memory 82 .
[0121] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0122] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for learning fault rules of railway EMUs, characterized in that: The method comprises: Fault type and template pre-definition step: define fault entity type and relationship type according to the collected railway EMU fault text, and construct an EMU fault named entity recognition prompt template according to the fault entity type; construct an EMU fault relationship extraction prompt template according to the fault relationship type; Fault relationship chain extraction step: based on the fault text, entity type, fault named entity recognition prompt template, fault relationship type and fault relationship extraction prompt template, guide the pre-built fault rule learning model to extract the EMU fault relationship chain to obtain the EMU fault triplet; Fault rule learning step: Based on the fault triplet, the fault rule learning model is continuously iterated and trained, the railway EMU fault text to be learned is input into the fault rule learning model, and the railway EMU fault rule learning result is generated to guide the handling of EMU faults.
2. The method for learning railway EMU fault rules according to claim 1, characterized in that: The method further comprises: Fault rule mining step: constructing a knowledge graph based on the extracted EMU fault triples, extracting path information, using the prompt engineering to perform rule mining using the fault rule learning model, and generating a candidate rule set; Fault rule sorting step: Based on the candidate rule set and the knowledge graph, the quality of the generated rules is evaluated by a logical rule sorter, and pseudo rules with high confidence but low frequency are filtered out.
3. The method for learning railway EMU fault rules according to claim 1 or 2, characterized in that: The fault type and template pre-definition steps include: Fault type definition step: define the EMU fault entity type and relationship type according to the EMU fault text and the existing EMU fault knowledge graph; Entity template predefinition step: constructing a named entity recognition prompt template for EMU fault according to the fault text and the predefined EMU fault entity type; Relationship template predefinition step: constructing a train group fault relationship extraction prompt template chain according to the fault text and the predefined train group fault relationship type.
4. The method for learning railway EMU fault rules according to claim 3 is characterized in that: The prompt template chain includes: a first-stage template and a second-stage template, wherein the first-stage template includes a relationship list, the second-stage template includes a triple corresponding to the relationship list, and the fault triple is defined as: (first entity, relationship, second entity).
5. The method for learning railway EMU fault rules according to claim 1 or 2, characterized in that: The fault relationship chain extraction step comprises: Candidate example generation step: based on the fault text to be extracted and the pre-generated named entity candidate examples, a similarity algorithm is used to select a set of entity recognition demonstration examples with the highest similarity; based on the fault text to be extracted and the pre-generated entity relationship candidate examples, a similarity algorithm is used to select a set of relationship extraction demonstration examples with the highest similarity; Fault entity extraction step: fill the fault text to be extracted, entity type and entity recognition demonstration example into the entity recognition prompt template, and input them into the fault rule learning model to obtain the fault entity in the fault text to be extracted; Fault relationship extraction step: fill the fault text and relationship type to be extracted into the prompt template chain to obtain the relationship type contained in the fault text; the extracted entities and relationship types are input into the large model for multiple rounds of question and answer to complete the EMU fault relationship extraction.
6. The method for learning railway EMU fault rules according to claim 4, characterized in that: The fault rule mining step comprises: A knowledge graph is constructed based on the extracted EMU fault triples, a prompt template chain is constructed, and the fault rule learning model is used to link the triples to generate a candidate rule set, wherein, in the mutually linked triples, the second entity of the triple arranged first is the same as the first entity of the triple arranged later.
7. The method for learning railway EMU fault rules according to claim 2, characterized in that: The fault rule sorting step comprises: According to the candidate rule set and knowledge graph, the candidate rules are sorted, the rule frequency and confidence are calculated, and high-quality rules are screened through the set threshold.
8. A railway EMU fault rule learning system, using the railway EMU fault rule learning method as described in claims 1-7, characterized in that: The system comprises: Fault type and template pre-definition module: define fault entity type and relationship type according to the collected railway EMU fault text, build EMU fault named entity recognition prompt template according to the fault entity type; build EMU fault relationship extraction prompt template according to the fault relationship type; Fault relationship chain extraction module: Based on the fault text, entity type, fault named entity recognition prompt template, fault relationship type and fault relationship extraction prompt template, guide the pre-built fault rule learning model to extract the EMU fault relationship chain and obtain the EMU fault triplet; Fault rule learning module: based on the fault triplet, continuously iteratively train the fault rule learning model, input the railway EMU fault text to be learned into the fault rule learning model, and generate the railway EMU fault rule learning result; Fault rule mining module: constructs a knowledge graph based on the extracted EMU fault triples, extracts path information, uses the fault rule learning model to perform rule mining using prompt engineering, and generates a candidate rule set; Fault rule sorting module: Based on the candidate rule set and the knowledge graph, the quality of generated rules is evaluated by a logical rule sorter, and pseudo rules with high confidence but low frequency are filtered out.
9. An electronic device, characterized in that: The device comprises: a memory storing executable program code; a processor coupled to the memory; the processor calls the executable program code stored in the memory to execute the railway EMU fault rule learning method as described in any one of claims 1-7.
10. A computer storage medium, characterized in that: The computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the railway EMU fault rule learning method as described in any one of claims 1-7.
Citation Information
Cited By
Rule base dynamic construction method and device based on large language model and medium
CN120179811A
Method, device and medium for dynamically constructing a rule base based on a large language model
CN120179811B