Maintenance conflict processing method and system based on large language model
By adopting a method based on a large language model in the field of power grid maintenance, the field vocabulary list and optimization prompt word template are constructed, document segmentation and vector database are constructed, and the problems of insufficient entity recognition accuracy and adaptability, low document processing efficiency and limited conflict processing capabilities in the existing technology are solved, and efficient power grid maintenance conflict handling is achieved.
Patent Information
- Application Number
- CN202411868552.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-04-22
Smart Images

Figure CN119862270A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of power maintenance and large language model application, and more specifically, to a maintenance conflict handling method and system based on a large language model. Background Art
[0002] Document processing and named entity recognition in power grid maintenance tasks is a complex and challenging task. With the continuous expansion of the scale of power grid operation and maintenance, the number of power grid maintenance documents is also increasing. How to effectively extract key information from them, especially to accurately identify entities in maintenance tasks, has become the key to improving the efficiency of power grid operation and maintenance. At present, traditional text processing methods mainly rely on manually constructed dictionaries and rules, but this method often lacks flexibility in practical applications and cannot adapt to the professional terminology and complex contextual environments in the field of power grid maintenance. Therefore, a more efficient and adaptable method is urgently needed to meet these challenges.
[0003] In recent years, the development of large language models (such as the GPT series, Claude, etc.) has provided new solutions for text processing tasks. With their powerful language understanding and generation capabilities, these models have achieved remarkable results in the fields of named entity recognition and semantic matching. By optimizing the prompt word template and building a domain-specific semantic model, the accuracy of named entity recognition can be greatly improved, especially in professional fields such as power grid maintenance.
[0004] Although current research results provide effective solutions for text processing in the field of power grid maintenance, how to further improve the accuracy and efficiency of processing, especially in the context of multi-field and multi-source data fusion, is still a difficult problem that needs to be overcome by current technology. Therefore, how to take advantage of the large language model and combine it with the actual needs of power grid maintenance has become an important direction of technical research in this field.
[0005] Prior art, such as the Chinese patent application with publication number "CN113157860A", discloses a method for constructing a knowledge graph for power equipment maintenance based on small-scale data, which includes the following steps: crawling a knowledge encyclopedia website to construct a basic power corpus data set, wherein the basic power corpus data set includes at least a maintenance manual and encyclopedia knowledge crawled based on the basic vocabulary in the maintenance manual; based on the basic power corpus data set and the general dictionary, statistically analyzing the word frequency to construct a subject dictionary in the power field; based on the basic power corpus document data set, generating a power semantic word vector conversion model, and calculating the semantic similarity between the basic vocabulary in the maintenance manual and the encyclopedia knowledge based on the conversion model; judging whether the semantic similarity is greater than a threshold, if so, establishing a semantic association relationship between the maintenance manual and the encyclopedia knowledge, and constructing a knowledge graph. The method of the invention can meet the scenarios of fault cause query, treatment measure retrieval, and related knowledge reference.
[0006] The problems with the above existing technologies are that they are insufficient in terms of entity recognition accuracy and adaptability, document processing efficiency, conflict handling capabilities, etc. Specifically, they lack optimized prompt word templates and multi-model mechanisms, which limits entity recognition accuracy; lack semantic consistency segmentation methods and vector databases, which leads to low document processing efficiency; and are unable to automatically identify and mediate conflicts and effectively integrate cross-document information, resulting in limited conflict handling capabilities. Summary of the invention
[0007] In order to solve the above technical problems, the present invention proposes a maintenance conflict handling method and system based on a large language model.
[0008] The technical solution of the present invention is as follows:
[0009] The present invention proposes a maintenance conflict processing method based on a large language model, comprising the following steps:
[0010] Step S1, collecting power grid maintenance documents to construct a power grid maintenance field vocabulary; setting prompt word templates according to task scenarios in the power grid maintenance documents;
[0011] Step S2, segmenting the power grid maintenance documents according to the vocabulary in the field of power grid maintenance and the principle of semantic consistency, converting the segmented documents into high-dimensional semantic vectors to form a vector database in the field of power grid maintenance;
[0012] Step S3, matching the relevant content of the input power grid maintenance document in the vector database and adding the prompt word template, and generating the named entity extraction result with the help of multiple large language models;
[0013] Step S4, generating named entity extraction results based on the large language model, replacing different power grid maintenance document entities with corresponding entity types, constructing a predicate proximity graph, and using the large language model to compare relational semantic types to align predicates;
[0014] Step S5, using the knowledge graph embedding TransE method to generate a vector representation of the entity, aligning the embeddings of different graph entities into the same space and determining the corresponding relationship, and unifying each embedding into the optimization framework through a joint learning strategy;
[0015] Step S6, based on the prompt word template and domain vocabulary, the entities of the power grid maintenance document are identified and conflict information is extracted. The conflict information is integrated by combining the multi-model mechanism, and the alignment and semantic understanding of related entities in different maintenance tasks are performed to realize the conflict identification and mediation between maintenance tasks.
[0016] As a preferred implementation, the power grid maintenance documents are collected to construct a power grid maintenance domain vocabulary, wherein the power grid maintenance documents include: maintenance plans, maintenance plans and fault analysis records; the power grid maintenance domain vocabulary contains multiple entity categories, specifically including: equipment name, maintenance date, fault location, fault type and maintenance person in charge.
[0017] As a preferred implementation, in the process of setting the prompt word template according to the task scenario in the power grid maintenance document, a general prompt word template is preliminarily designed according to the power grid maintenance task scenario, and the prompt word template is optimized using a policy gradient algorithm. The reward function formula of the policy gradient algorithm is as follows:
[0018]
[0019] Where: R represents the reward function; π represents the decision function; T represents the total number of time steps; t represents the current time step; γ represents the discount factor; r represents the immediate reward, which is obtained according to the accuracy score of the prompt word template extraction result.
[0020] As a preferred implementation, the power grid maintenance document is segmented according to the power grid maintenance field vocabulary and the principle of semantic consistency. Specifically, the title and key sentences in the power grid maintenance document are extracted using the term frequency-inverse document frequency TF-IDF rule in combination with the power grid maintenance field vocabulary, and the power grid maintenance document paragraphs are semantically vectorized using the BERT model. If the similarity between two adjacent paragraphs is less than a preset value, segmentation is performed; wherein, the similarity calculation formula for the similarity between two adjacent paragraphs is as follows:
[0021]
[0022] Where: P i , P j Respectively represent the high-dimensional vectors corresponding to two adjacent paragraphs.
[0023] As a preferred implementation, the vector database is matched with the input power grid maintenance document related content and a prompt word template is added, a named entity extraction result is generated by means of multiple large language models, and the named entity extraction results generated by the multiple large language models are screened by the voting principle. The specific calculation formula of the voting principle is as follows:
[0024]
[0025] Where: R final represents the optimal extraction result finally selected; δ(R n ,A b ) represents the extraction result of the nth large language model and the bth candidate result A b Are they consistent? N is the total number of large language models. argmax is the maximum value operation.
[0026] As a preferred implementation, the use of a large language model to compare relational semantic types and align predicates comprises the following steps:
[0027] Compute the predicate vector:
[0028]
[0029] Where: u is the predicate vector; w m represents the predicate weight of the m-th entity type; z m represents the embedding of the mth entity type; M is the total number of entity types;
[0030] The predicate vector similarity is calculated using cosine similarity, and the calculation formula is as follows:
[0031]
[0032] Where: u1, u2 represent two predicate vectors in different power grid maintenance documents.
[0033] As a preferred implementation, the TransE method of embedding knowledge graphs is used to generate vector representations of entities, align different graph entity embeddings into the same space and determine the corresponding relationships, and unify each embedding into an optimization framework through a joint learning strategy, specifically including the following steps:
[0034] The knowledge graph embedding TransE method is used to generate vector representations for entities in power grid maintenance documents. For each entity triple<h,p,q> , calculate the embedding of its entity, the calculation formula is as follows:
[0035] f(<h,p,t> ) = ∥h + pt ∥2;
[0036] Where: h represents the head entity; p represents the relation predicate; q represents the tail entity; ∥·∥2 represents the L2 norm;
[0037] LSTM embedding technology is used to model entity attributes. The specific formula is as follows:
[0038] f a (V)=LSTM(c1,c2,...,c v );
[0039] Where: f a (V) represents the modeling result of entity attribute V; LSTM represents long short-term memory network operation; c1, c2, ..., c v A character sequence representing an entity attribute V;
[0040] The entities in different graphs are embedded and aligned to the same space. The cosine similarity of entity pairs is calculated to determine whether they correspond to the same entity. The specific calculation formula is as follows:
[0041]
[0042] Where: k map represents the entity in graph G2 that is most similar to entity k1 from another graph; represents the maximum value operation; cos(k1,k2) represents the cosine similarity between entity k1 and entity k2;
[0043] A joint learning strategy is adopted to unify predicate embedding, entity embedding and attribute embedding into a common optimization framework. The optimization objective function is as follows:
[0044] J=J PE +J SE +J CE +J SIM ;
[0045] Where: J PE , J SE , J CE and J SIM They represent the loss functions for predicate embedding, structure embedding, attribute embedding and similarity alignment respectively.
[0046] On the other hand, the present invention also provides a maintenance conflict handling system based on a large language model, comprising:
[0047] The domain vocabulary and template construction module collects power grid maintenance documents to construct a domain vocabulary for power grid maintenance; sets prompt word templates according to the task scenarios in the power grid maintenance documents;
[0048] The document segmentation and vector library construction module segments the power grid maintenance documents according to the vocabulary and semantic consistency principle in the field of power grid maintenance, converts the segmented documents into high-dimensional semantic vectors, and constructs a vector database in the field of power grid maintenance.
[0049] The entity extraction module matches the relevant content of the input power grid maintenance document in the vector database and adds the prompt word template, and generates the named entity extraction result with the help of multiple large language models;
[0050] The predicate graph construction and alignment module generates named entity extraction results based on the large language model, replaces entities in different power grid maintenance documents with corresponding entity types, constructs a predicate proximity graph, and uses the large language model to compare relational semantic types to align predicates;
[0051] The entity embedding and alignment module uses the knowledge graph embedding TransE method to generate a vector representation of the entity, aligns the embeddings of different graph entities into the same space and determines the corresponding relationship, and unifies each embedding into the optimization framework through a joint learning strategy;
[0052] The conflict handling module identifies the entities of power grid maintenance documents and extracts conflict information based on prompt word templates and domain vocabulary. It integrates the conflict information by combining the multi-model mechanism, aligns and semantically understands the relevant entities in different maintenance tasks, and realizes conflict identification and mediation between tasks.
[0053] On the other hand, the present invention further provides an electronic device having a computer program stored thereon, wherein when the computer program is executed by a processor, the maintenance conflict handling method based on a large language model as described in any embodiment of the present invention is implemented.
[0054] On the other hand, the present invention also provides a computer-readable medium for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement a maintenance conflict handling method based on a large language model as described in any embodiment of the present invention.
[0055] The present invention has the following beneficial effects:
[0056] 1. By constructing a domain vocabulary and optimizing the prompt word template, the accuracy and adaptability of named entity recognition in power grid maintenance documents can be significantly improved, especially in power grid maintenance conflict handling tasks, providing more accurate entity recognition and semantic understanding.
[0057] 2. The designed semantic consistency segmenter and embedded vector database can efficiently segment power grid maintenance documents and perform semantic retrieval, ensuring that conflicting information in the documents can be quickly extracted and associated, effectively reducing manual intervention and improving processing efficiency.
[0058] 3. Combining the voting mechanism of multiple language models with entity alignment technology, accurate entity recognition and cross-document information integration are achieved in the field of power grid maintenance, providing strong technical support for the automated processing of power grid maintenance conflicts and decision-making optimization. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0060] Figure 1It is a schematic diagram of the process of the present invention;
[0061] Figure 2 It is a technical framework diagram of the present invention. DETAILED DESCRIPTION
[0062] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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.
[0063] It should be understood that the step numbers used in this document are only for convenience of description and are not intended to limit the order in which the steps are executed.
[0064] It should be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0065] The terms “include” and “comprising” indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0066] The term "and / or" means and includes any and all possible combinations of one or more of the associated listed items.
[0067] Embodiment 1:
[0068] In order to make the purpose, technical solutions and advantages of the present invention more clear, the following will be combined with the specific embodiments of the present application and refer to the attached Figure 1 , clearly and completely describe the technical solution of the present invention.
[0069] To solve the problems in the prior art, the present invention provides a maintenance conflict handling method based on a large language model, comprising the following steps:
[0070] Step S1, collecting power grid maintenance documents to construct a power grid maintenance field vocabulary; setting prompt word templates according to task scenarios in the power grid maintenance documents;
[0071] Step S101, collect power grid maintenance documents to construct a power grid maintenance domain vocabulary, the power grid maintenance documents include: maintenance plan, maintenance scheme and fault analysis record; the power grid maintenance domain vocabulary contains multiple entity categories, specifically including: equipment name, maintenance date, fault location, fault type and maintenance person in charge.
[0072] Step S102, preliminarily designing a general prompt word template according to the power grid maintenance task scenario.
[0073] Step S103, using the policy gradient algorithm to optimize the prompt word template, using the model feedback results (such as F1 value) to adjust the expression form and semantic structure of the template. The specific optimization goal is to improve the model recognition accuracy and generalization performance. The reward function formula of the policy gradient algorithm is as follows:
[0074]
[0075] In the formula: R represents the reward function; π represents the decision function; T represents the total number of time steps; t represents the current time step; γ represents the discount factor; r represents the immediate reward, which is obtained by scoring the accuracy of the prompt word template extraction result. Finally, a set of efficient prompt word templates suitable for tasks in the field of power grid maintenance are optimized.
[0076] Step S2, segmenting the power grid maintenance documents according to the vocabulary in the field of power grid maintenance and the principle of semantic consistency, converting the segmented documents into high-dimensional semantic vectors to form a vector database in the field of power grid maintenance;
[0077] Step S201, power grid maintenance documents usually have a fixed hierarchy and structure. Direct segmentation based on character length or paragraph position may lead to semantic fragmentation, so it is necessary to design a segmentation method based on semantic consistency. First, combined with the constructed power grid maintenance field vocabulary, the TF-IDF rule is used to extract the title and key clauses in the document, such as "equipment status", "maintenance plan", "fault analysis", etc.; secondly, the BERT model is used to semantically vectorize the document paragraphs, and the similarity between two adjacent paragraphs is less than the preset value, and the segmentation is performed; among them, the similarity calculation formula between two adjacent paragraphs is as follows:
[0078]
[0079] Where: P i , P j Represent the high-dimensional vectors corresponding to two adjacent paragraphs. In order to avoid too short paragraphs after segmentation (such as the number of characters is less than a certain threshold, such as 20 words), these segmentation points are merged or adjusted. For discontinuous logical content after segmentation, recheck the rationality of key segmentation points. The final generated document paragraphs meet the semantic coherence and are suitable for subsequent processing steps.
[0080] Step S202: The segmented document paragraphs are embedded into a high-dimensional semantic vector using the Ada Embedding model. The semantics of each paragraph is represented as a 1024-dimensional vector v i ∈R d These vectors are stored in a vector database together with paragraph content and metadata information (such as title, paragraph number, file name, etc.) to build a vector database specific to the maintenance field. This database is used for subsequent text similarity matching and dynamic information retrieval to improve the processing capabilities of lengthy documents.
[0081] Step S3, matching the relevant content of the input power grid maintenance document in the vector database and adding the prompt word template, and generating the named entity extraction result with the help of multiple large language models;
[0082] Step S301, the input power grid maintenance document is matched with relevant text in the vector database, and finally the matched relevant text is added to the prompt word template as known information to obtain the final prompt word template. By introducing multiple large language models, named entity extraction results are generated for the same input text. The voting principle of "the minority obeys the majority" is used to select the best extraction result from the output of all large languages. The specific calculation formula of the voting principle is as follows:
[0083]
[0084] Where: R final represents the optimal extraction result finally selected; δ(R n ,A b ) represents the extraction result of the nth large language model and the bth candidate result A b Are they consistent? N is the total number of large language models. argmax is the maximum value operation.
[0085] Step S302, regularize the voting results to ensure the format consistency and content accuracy of the output results. Specifically, by defining entity type standardization, format constraints and content filtering rules, noise information is eliminated, and regular expressions are used to extract expected entities from the voting results.
[0086] Step S4, generating named entity extraction results based on the large language model, replacing different power grid maintenance document entities with corresponding entity types, constructing a predicate proximity graph, and using the large language model to compare relational semantic types to align predicates;
[0087] Step S401: construct a predicate proximity graph by replacing entities in different power grid maintenance documents with their corresponding entity types. For example, "digital intelligence safety platform" is replaced by "platform". In this way, the similarity of predicates no longer depends on the specific entity name, but on the matching of entity types.
[0088] Step S402, by comparing the semantic types of relations (for example, the relationship between equipment and maintenance personnel), use a large language model (such as Claude) to achieve automatic predicate alignment. The role of the large language model is to determine which predicates (relations) have similar meanings in different maintenance documents based on context and semantics, and complete the alignment of predicates;
[0089] Step S403, capturing the similarity between predicates (relations) in different documents and calculating the predicate vector, the calculation formula is as follows:
[0090]
[0091] in:
[0092]
[0093] Where: u is the predicate vector; w m represents the predicate weight of the m-th entity type; z m represents the embedding of the mth entity type; M is the total number of entity types; l m is the type level, a m is the number of attributes of this type, r m is the frequency of occurrence of this type, k m is the frequency of occurrence of the type across different documents;
[0094] For two predicates u1 and u2 in different maintenance documents, the predicates are aligned by calculating the similarity between their context vectors. The predicate vector similarity is calculated using cosine similarity, and the calculation formula is as follows:
[0095]
[0096] Where: u1, u2 represent two predicate vectors in different power grid maintenance documents.
[0097] Step S5, using the knowledge graph embedding TransE method to generate a vector representation of the entity, aligning the embeddings of different graph entities into the same space and determining the corresponding relationship, and unifying each embedding into the optimization framework through a joint learning strategy;
[0098] Step S501, using the knowledge graph embedding TransE method to generate vector representations for entities in the power grid maintenance document, for each entity triple<h,p,q> , calculate the embedding of its entity, the calculation formula is as follows:
[0099] f(<h,p,t> ) = ∥h + pt ∥2;
[0100] Where: h represents the head entity; p represents the relation predicate; q represents the tail entity; ∥·∥2 represents the L2 norm;
[0101] Step S502, using attribute embedding technology, by modeling entity attributes (such as "device name", "conflict time", etc.) to further improve the accuracy of entity alignment; using LSTM embedding technology to model entity attributes, the specific formula is as follows:
[0102] f a (V)=LSTM(c1,c2,...,c v );
[0103] Where: f a (V) represents the modeling result of entity attribute V; LSTM represents long short-term memory network operation; c1, c2, ..., c v A character sequence representing an entity attribute V;
[0104] Step S503: align the entity embeddings in different graphs into the same space. The cosine similarity of entity pairs can be calculated to determine whether they correspond to the same entity. The specific calculation formula is as follows:
[0105]
[0106] Where: k map represents the entity in graph G2 that is most similar to entity k1 from another graph; represents the maximum value operation; cos(k1,k2) represents the cosine similarity between entity k1 and entity k2;
[0107] Step S504, adopting a joint learning strategy, unifies predicate embedding, entity embedding and attribute embedding into a common optimization framework. Through this joint learning method, the final generated aligned entity has higher accuracy and consistency. The optimization objective function is as follows:
[0108] J=J PE +J SE +J CE +J SIM ;
[0109] Where: J PE , J SE , J CE and J SIM They represent the loss functions for predicate embedding, structure embedding, attribute embedding and similarity alignment respectively.
[0110] Step S6, based on the prompt word template and domain vocabulary, the entities of the power grid maintenance document are identified and conflict information is extracted. The conflict information is integrated by combining the multi-model mechanism, and the alignment and semantic understanding of related entities in different maintenance tasks are performed to realize the conflict identification and mediation between maintenance tasks.
[0111] Step S601, through the optimized prompt word template and domain vocabulary, entity recognition in the power grid maintenance document is performed to accurately extract conflict information in the maintenance task, such as equipment conflict, task conflict, etc., to provide basic data for subsequent conflict processing.
[0112] Step S602, using entity alignment technology, aligning entities representing the same maintenance conflict in different maintenance documents into a unified vector space to ensure that conflict information across documents can be correctly matched and associated.
[0113] Step S603 combines the voting mechanism and regularization processing of multiple large language models to automatically identify and integrate relevant information of maintenance conflicts, analyze the patterns and relationships of conflicts, assist in decision-making and formulate optimization plans, and ultimately achieve efficient power grid maintenance conflict processing.
[0114] Embodiment 2:
[0115] This embodiment provides a maintenance conflict handling system based on a large language model, including:
[0116] The domain vocabulary and template construction module collects power grid maintenance documents to construct a domain vocabulary for power grid maintenance; sets prompt word templates according to the task scenarios in the power grid maintenance documents;
[0117] The document segmentation and vector library construction module segments the power grid maintenance documents according to the vocabulary and semantic consistency principle in the field of power grid maintenance, converts the segmented documents into high-dimensional semantic vectors, and constructs a vector database in the field of power grid maintenance.
[0118] The entity extraction module matches the relevant content of the input power grid maintenance document in the vector database and adds the prompt word template, and generates the named entity extraction result with the help of multiple large language models;
[0119] The predicate graph construction and alignment module generates named entity extraction results based on the large language model, replaces entities in different power grid maintenance documents with corresponding entity types, constructs a predicate proximity graph, and uses the large language model to compare relational semantic types to align predicates;
[0120] The entity embedding and alignment module uses the knowledge graph embedding TransE method to generate a vector representation of the entity, aligns the embeddings of different graph entities into the same space and determines the corresponding relationship, and unifies each embedding into the optimization framework through a joint learning strategy;
[0121] The conflict handling module identifies the entities of power grid maintenance documents and extracts conflict information based on prompt word templates and domain vocabulary. It integrates the conflict information by combining the multi-model mechanism, aligns and semantically understands the relevant entities in different maintenance tasks, and realizes conflict identification and mediation between tasks.
[0122] Embodiment three:
[0123] This embodiment provides an electronic device having a computer program stored thereon. When the computer program is executed by a processor, a maintenance conflict handling method based on a large language model as described in any embodiment of the present invention is implemented.
[0124] Embodiment 4:
[0125] This embodiment provides a computer-readable medium for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement a maintenance conflict handling method based on a large language model as described in any embodiment of the present invention.
[0126] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.
[0127] Those of ordinary skill in the art will appreciate that the various units and algorithm steps described in the embodiments disclosed herein can be implemented in a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0128] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0129] In several embodiments provided in the present application, if any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for 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 method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory; hereinafter referred to as: ROM), random access memory (Random Access Memory; hereinafter referred to as: RAM), disk or optical disk, and other media that can store program codes.
[0130] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A maintenance conflict handling method based on a large language model, characterized in that: The following steps are involved: Step S1, collecting power grid maintenance documents to construct a power grid maintenance field vocabulary; setting prompt word templates according to task scenarios in the power grid maintenance documents; Step S2, segmenting the power grid maintenance documents according to the vocabulary in the field of power grid maintenance and the principle of semantic consistency, converting the segmented documents into high-dimensional semantic vectors to form a vector database in the field of power grid maintenance; Step S3, matching the relevant content of the input power grid maintenance document in the vector database and adding the prompt word template, and generating the named entity extraction result with the help of multiple large language models; Step S4, generating named entity extraction results based on the large language model, replacing different power grid maintenance document entities with corresponding entity types, constructing a predicate proximity graph, and using the large language model to compare relational semantic types to align predicates; Step S5, using the knowledge graph embedding TransE method to generate a vector representation of the entity, aligning the embeddings of different graph entities into the same space and determining the corresponding relationship, and unifying each embedding into the optimization framework through a joint learning strategy; Step S6, based on the prompt word template and domain vocabulary, the entities of the power grid maintenance document are identified and conflict information is extracted. The conflict information is integrated by combining the multi-model mechanism, and the alignment and semantic understanding of related entities in different maintenance tasks are performed to realize the conflict identification and mediation between maintenance tasks.
2. The maintenance conflict handling method based on a large language model according to claim 1, characterized in that: The power grid maintenance documents are collected to construct a power grid maintenance domain vocabulary, wherein the power grid maintenance documents include: maintenance plans, maintenance plans and fault analysis records; the power grid maintenance domain vocabulary contains multiple entity categories, specifically including: equipment name, maintenance date, fault location, fault type and maintenance person in charge.
3. The maintenance conflict handling method based on a large language model according to claim 1, characterized in that: In the process of setting the prompt word template according to the task scenario in the power grid maintenance document, a general prompt word template is preliminarily designed according to the power grid maintenance task scenario, and the prompt word template is optimized by using the policy gradient algorithm. The reward function formula of the policy gradient algorithm is as follows: Where: R represents the reward function; π represents the decision function; T represents the total number of time steps; t represents the current time step; γ represents the discount factor; r represents the immediate reward, which is obtained according to the accuracy score of the prompt word template extraction result.
4. The maintenance conflict handling method based on a large language model according to claim 1 is characterized in that: The power grid maintenance document is segmented according to the power grid maintenance field vocabulary and the principle of semantic consistency. Specifically, the title and key sentences in the power grid maintenance document are extracted by using the term frequency-inverse document frequency TF-IDF rule in combination with the power grid maintenance field vocabulary, and the power grid maintenance document paragraphs are semantically vectorized using the BERT model. If the similarity between two adjacent paragraphs is less than a preset value, segmentation is performed; wherein, the similarity calculation formula between two adjacent paragraphs is as follows: Where: P i , P j Respectively represent the high-dimensional vectors corresponding to two adjacent paragraphs.
5. The maintenance conflict handling method based on a large language model according to claim 1 is characterized in that: The vector database is matched with the input power grid maintenance document related content and a prompt word template is added, and named entity extraction results are generated by using multiple large language models. The named entity extraction results generated by the multiple large language models are screened by the voting principle. The specific calculation formula of the voting principle is as follows: Where: R final represents the optimal extraction result finally selected; δ(R n ,A b ) represents the extraction result of the nth large language model and the bth candidate result A b Are they consistent? N is the total number of large language models. argmax is the maximum value operation.
6. The maintenance conflict handling method based on a large language model according to claim 1 is characterized in that: The method of using a large language model to compare relational semantic types and align predicates includes the following steps: Compute the predicate vector: Where: u is the predicate vector; w m represents the predicate weight of the m-th entity type; z m represents the embedding of the mth entity type; M is the total number of entity types; The predicate vector similarity is calculated using cosine similarity, and the calculation formula is as follows: Where: u1, u2 represent two predicate vectors in different power grid maintenance documents.
7. The maintenance conflict handling method based on a large language model according to claim 1 is characterized in that: The TransE method of embedding knowledge graphs is used to generate vector representations of entities, align embeddings of different graph entities into the same space and determine the corresponding relationships, and unify the embeddings into the optimization framework through a joint learning strategy. Specifically, the following steps are included: The knowledge graph embedding TransE method is used to generate vector representations for entities in power grid maintenance documents. For each entity triple<h,p,q> , calculate the embedding of its entity, the calculation formula is as follows: f(<h,p,t> ) = ∥h + pt ∥2; Where: h represents the head entity; p represents the relation predicate; q represents the tail entity; ∥·∥2 represents the L2 norm; LSTM embedding technology is used to model entity attributes. The specific formula is as follows: f A (V)=LSTM(c1,c2,...,c v ); Where: f a (V) represents the modeling result of entity attribute V; LSTM represents long short-term memory network operation; c1, c2, ..., c v A character sequence representing an entity attribute V; The entities in different graphs are embedded and aligned to the same space. The cosine similarity of entity pairs is calculated to determine whether they correspond to the same entity. The specific calculation formula is as follows: Where: k map represents the entity in graph G2 that is most similar to entity k1 from another graph; represents the maximum value operation; cos(k1,k2) represents the cosine similarity between entity k1 and entity k2; A joint learning strategy is adopted to unify predicate embedding, entity embedding and attribute embedding into a common optimization framework. The optimization objective function is as follows: J=J PE +J SE +J CE +J SIM ; Where: J PE , J SE , J CE and J SIM They represent the loss functions for predicate embedding, structure embedding, attribute embedding and similarity alignment respectively.
8. A maintenance conflict handling system based on a large language model, characterized in that: include: The domain vocabulary and template construction module collects power grid maintenance documents to build a domain vocabulary for power grid maintenance; Set prompt word templates according to the task scenarios in the power grid maintenance documents; The document segmentation and vector library construction module segments the power grid maintenance documents according to the vocabulary and semantic consistency principle in the field of power grid maintenance, converts the segmented documents into high-dimensional semantic vectors, and forms a vector database in the field of power grid maintenance. The entity extraction module matches the relevant content of the input power grid maintenance document in the vector database and adds the prompt word template, and generates the named entity extraction result with the help of multiple large language models; The predicate graph construction and alignment module generates named entity extraction results based on the large language model, replaces entities in different power grid maintenance documents with corresponding entity types, constructs a predicate proximity graph, and uses the large language model to compare relational semantic types to align predicates; The entity embedding and alignment module uses the knowledge graph embedding TransE method to generate a vector representation of the entity, aligns the embeddings of different graph entities into the same space and determines the corresponding relationship, and unifies each embedding into the optimization framework through a joint learning strategy; The conflict handling module identifies the entities of power grid maintenance documents and extracts conflict information based on prompt word templates and domain vocabulary. It integrates the conflict information by combining the multi-model mechanism, aligns and semantically understands the relevant entities in different maintenance tasks, and realizes conflict identification and mediation between tasks.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, it implements a maintenance conflict handling method based on a large language model as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, a maintenance conflict handling method based on a large language model as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Power equipment maintenance knowledge graph construction method based on small-scale data
CN113157860A
Cited By
Large model scheduling multi-agent power grid fault coping strategy knowledge graph extension method and system
CN120543154A
A knowledge graph expansion method and system for large-scale model scheduling multi-agent power grid fault response strategy
CN120543154B