A knowledge graph updating method and system based on a semantic large model

By training a semantic large model using triples from the power marketing knowledge graph, and combining coarse-grained and fine-grained entity processing, the problem of inaccurate knowledge graph updates in the power marketing field is solved, achieving highly accurate knowledge graph updates.

CN122334446APending Publication Date: 2026-07-03GUANGDONG POWER GRID CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGDONG POWER GRID CO LTD
Filing Date
2026-04-13
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing knowledge graph update methods suffer from large errors and inaccurate updates in the field of power marketing. In particular, solutions based on machine learning and language models are unable to support reasoning on professional terminology and complex business logic, and the neglect of node relationships leads to frequent errors.

Method used

By training the triples of the power marketing knowledge graph, a large semantic model is generated. Combining coarse-grained entity segmentation and fine-grained entity extraction, the large semantic model of power marketing is used for incremental verification and updating, and semantic input text is constructed to improve accuracy.

Benefits of technology

It enables accurate updates to the power marketing knowledge graph, avoids errors caused by manual annotation, improves the stability and accuracy of the knowledge graph, and ensures logical consistency and error-free updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122334446A_ABST
    Figure CN122334446A_ABST
Patent Text Reader

Abstract

The application discloses a knowledge graph updating method and system based on a semantic large model, and belongs to the technical field of data processing. The application trains a power marketing semantic large model by using a plurality of knowledge graph triples of a power marketing knowledge graph. Then, a plurality of business entity texts of to-be-processed business data are obtained by performing coarse-grained entity segmentation processing on the to-be-processed business data. Then, a plurality of prompt word texts of the power marketing knowledge graph are generated by using the knowledge graph triples, and the power marketing semantic large model is guided to perform fine-grained entity extraction by using a plurality of semantic input texts constructed by the business entity texts and the prompt word texts. The power marketing knowledge graph is verified incrementally by using business triples, an incremental verification result is obtained, and the power marketing knowledge graph is updated based on the incremental verification result and the business triples, so that the technical problem that the power marketing knowledge graph is not accurately updated in the prior art can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of data processing technology, and in particular relates to a knowledge graph update method and system based on a semantic large model. Background Technology

[0002] In the field of electricity marketing, business data is scattered across unstructured text such as work order records and reports. Furthermore, this business data and its rules are constantly evolving over time, exhibiting characteristics such as multi-source heterogeneity, predominantly unstructured data, complex business relationships, and frequent dynamic changes. To handle this complex and ever-changing data, knowledge graphs are commonly used as a data structure to store relevant business data. Through structured semantic associations, knowledge graphs can transform scattered and heterogeneous data into a unified data format of entities, relationships, and attributes. Currently, they are widely used for business data storage in the electricity marketing field, and by updating the knowledge graph, relevant business data in electricity marketing can be continuously updated and preserved.

[0003] Traditional knowledge graph update schemes are mostly based on machine learning or language models. Rule-based schemes segment business data and update the knowledge graph using regular expressions or pattern matching rules. Machine learning-based schemes manually annotate business data and then use machine learning models to predict structured triples. This method requires a large amount of manually annotated data as the training set for the machine learning model. However, business data in the power marketing field has complex relationships, and this manual annotation method leads to large errors in the structured triples predicted by the machine learning model, affecting the accuracy of knowledge graph updates. Language model-based schemes use semantic models pre-trained on large-scale corpora to semantically encode and model the context of business data, thus obtaining structured triples. However, this approach uses a general-purpose large model, and even direct fine-tuning of the large model is insufficient to support the semantic model's reasoning about the professional terminology and complex business logic in the power marketing field, resulting in inaccurate knowledge graph updates. In addition, most current updates to knowledge graphs involve directly storing structured triples into the knowledge graph, ignoring the relationships between different nodes in the knowledge graph. This leads to errors in the knowledge graph after storing the structured triples, which further exacerbates the frequent occurrence of knowledge graph update errors. Summary of the Invention

[0004] This invention aims to provide a knowledge graph update method and system based on a semantic large model to solve the aforementioned technical problems. It trains the semantic large model using knowledge graph triples to obtain a power marketing semantic large model. Then, it obtains business entity text through coarse-grained entity segmentation, constructs semantic input text by combining it with prompt words, and extracts business triples from the fine-grained entity extraction of the power marketing semantic large model. This achieves power marketing knowledge graph update using incremental verification, improving the accuracy of power marketing knowledge graph updates.

[0005] To address the aforementioned technical problems, embodiments of the present invention provide a knowledge graph update method based on a large semantic model, comprising: Obtain several knowledge graph triples from the power marketing knowledge graph; train a preset semantic large model based on the knowledge graph triples to generate a power marketing semantic large model; Obtain the business data to be processed, and perform coarse-grained entity segmentation on the business data to be processed to obtain several business entity texts of the business data to be processed. Based on the knowledge graph triples, several prompt word texts of the power marketing knowledge graph are generated, and several semantic input texts of the business entity texts and the prompt word texts are constructed based on the business entity texts and the prompt word texts; Based on the aforementioned large-scale semantic model for electricity marketing, fine-grained entity extraction is performed on the semantic input text to generate several business triples of the business data to be processed. Incremental verification is performed on the power marketing knowledge graph based on the business triples to obtain incremental verification results; and the power marketing knowledge graph is updated based on the incremental verification results and the business triples.

[0006] Understandably, this invention trains a semantic big model using several knowledge graph triples from the power marketing knowledge graph, enabling the power marketing semantic big model to deeply integrate knowledge from the power marketing domain and possess the reasoning ability for professional terminology and complex business logic in the power marketing field. Next, by performing coarse-grained entity segmentation on the business data to be processed, several business entity texts are obtained. Then, several prompt word texts from the power marketing knowledge graph are generated using knowledge graph triples. This transforms the ontology structure of the power marketing knowledge graph into guiding prompts for the power marketing semantic big model, allowing the semantic input texts constructed based on the business entity texts and prompt word texts to guide the power marketing semantic big model in accurate fine-grained entity extraction. This improves the accuracy of the business triples and avoids the large triple errors caused by manual annotation. Finally, incremental verification of the power marketing knowledge graph is performed using business triples to obtain the incremental verification results. Based on the incremental verification results and business triples, the power marketing knowledge graph is updated. This effectively avoids knowledge conflicts and errors caused by directly updating the power marketing knowledge graph, and achieves accurate updates to the power marketing knowledge graph.

[0007] As a preferred embodiment, the step of obtaining several knowledge graph triples of the power marketing knowledge graph; training a preset semantic large model based on the knowledge graph triples to generate a power marketing semantic large model includes: Obtain several knowledge graph triples from the power marketing knowledge graph; Based on a preset mapping template, each knowledge graph triplet is processed into text to generate triplet text data corresponding to each knowledge graph triplet. Clustering is performed on the triplet text data and the pre-acquired historical text data of electricity marketing to generate a semantic model training set; Based on the semantic model training set, the preset semantic large model is fine-tuned using LoRA to generate a large semantic model for electricity marketing.

[0008] In the above scheme, the structured knowledge graph triples are textualized using mapping templates. This automatically transforms the existing high-quality and accurate structured knowledge in the power marketing knowledge graph into natural language descriptions that the semantic big data model can learn. This avoids inaccuracies in subsequent model training caused by manual annotation, and thus avoids the problem of excessive triple errors. Next, a semantic model training set is constructed through clustering. LoRA fine-tuning of the semantic big data model using this training set not only enables the power marketing semantic big data model to deeply integrate knowledge from the power marketing domain and possess the reasoning ability for professional terminology and complex business logic in the power marketing field, but also effectively controls training costs and mitigates the risk of overfitting. This improves the robustness and stability of the power marketing semantic big data model, thereby increasing the accuracy of subsequent business triple updates and power marketing knowledge graph updates.

[0009] As a preferred embodiment, the step of clustering the triplet text data and the pre-acquired historical text data of electricity marketing to generate a semantic model training set includes: The triplet text data and the pre-acquired historical text data of electricity marketing are vectorized according to the preset semantic vector construction algorithm to obtain several semantic vectors. The semantic vectors are clustered according to a preset clustering algorithm to generate several initial clusters, and the average number of samples in all initial clusters is obtained. Based on the average number of samples and the number of samples in each initial cluster, samples within each initial cluster are sampled to obtain several first clusters; A semantic model training set is generated based on the first cluster.

[0010] In the above scheme, several initial clusters are obtained through vectorization and clustering. Then, by calculating the average number of samples in all initial clusters and performing sampling based on the average number of samples and the number of samples in each cluster, overly dense clusters can be effectively processed to prevent model overfitting, while also preserving information from sparse clusters to some extent. This sampling method based on sample size ensures that the semantic model training set covers a wide range of semantic diversity within the domain, while avoiding model bias caused by data imbalance. This improves the robustness and stability of the large-scale semantic model for electricity marketing, enabling it to maintain stable and accurate semantic understanding and extraction performance when processing various complex and changing electricity marketing business data. This, in turn, improves the accuracy of subsequent updates to business triples and the electricity marketing knowledge graph.

[0011] As a preferred embodiment, the step of acquiring the business data to be processed and performing coarse-grained entity segmentation processing on the business data to be processed to obtain several business entity texts of the business data to be processed includes: Obtain pending business data; The business data to be processed is input into a pre-trained Hidden Markov Model, and the label sequence of the business data to be processed is identified by a preset Viterbi algorithm. Based on the tag sequence, the business data to be processed is segmented into words to obtain several business entity words of the business data to be processed. Centered on each of the business entity words, the characters of the business data to be processed are extracted based on a preset context text window to obtain several business entity texts of the business data to be processed.

[0012] In the above scheme, a pre-trained Hidden Markov Model and Viterbi algorithm are used to identify the label sequence of the business data to be processed. The label sequence is then used for word segmentation, which accurately excludes irrelevant text, allowing business entity words to better adapt to the syntax and terminology of the power marketing field. Next, using the business entity words as the center, a contextual text window is used to extract characters from the business data to be processed, obtaining several business entity texts. This ensures that the business entity texts retain rich semantic clues, thereby improving the accuracy and reliability of the subsequent power marketing semantic big data model in determining entity types and resolving complex relationships between entities, and enhancing the accuracy of updating the power marketing knowledge graph.

[0013] As a preferred embodiment, the step of generating several prompt word texts for the power marketing knowledge graph based on the knowledge graph triples, and constructing several semantic input texts for the business data to be processed based on the business entity texts and the prompt word texts, includes: Extract several entity type data and relation type data from the knowledge graph triples; Based on each entity type data, the relation type data is traversed to determine the domain data and value range data of each entity type data. Based on a preset regular expression matching algorithm, the domain data and value domain data of each entity type data are filled into a preset prompt word template to generate several prompt word texts for the power marketing knowledge graph; Based on the business entity words in each of the business entity texts, the prompt word texts are filtered to determine several guiding prompt word texts corresponding to each of the business entity texts; Each business entity text is concatenated with its corresponding guiding prompt text to construct several semantic input texts for the business data to be processed.

[0014] In the above scheme, several entity type data and relation type data are extracted from the knowledge graph triples. Then, the domain and value range data of each entity type data are determined by traversal and filled into a preset prompt word template to generate several prompt word texts for the power marketing knowledge graph. This transforms the ontology structure of the power marketing knowledge graph into guiding prompts for the power marketing semantic big model. Next, semantic input text is obtained through filtering and splicing operations. This semantic input text not only contains the original business text fragments of the business data to be processed, but also includes highly relevant structured guidance information from the power marketing knowledge graph. This allows the semantic input text to guide the power marketing semantic big model to perform accurate fine-grained entity extraction, improving the accuracy of business triples and avoiding large triple errors caused by manual annotation, thereby improving the accuracy of subsequent updates to the power marketing knowledge graph.

[0015] As a preferred embodiment, the step of performing fine-grained entity extraction on the semantic input text based on the large semantic model of electricity marketing to generate several business triples of the business data to be processed, including: Each semantic input text is input into the power marketing semantic big model, which calculates the semantic association weight between the guiding prompt text and the business entity text in each semantic input text based on a preset multi-head self-attention mechanism. The semantic input text is then filtered based on the semantic association weight to obtain several semantic input texts to be extracted. The power marketing semantic big model then performs semantic decoding on the semantic input texts to be extracted to generate several business triples to be confirmed for the business data to be processed. Obtain the triple constraints of the power marketing knowledge graph, and perform semantic disambiguation on the triples of the business to be confirmed based on the triple constraints of the power marketing knowledge graph to obtain several business triples of the business data to be processed.

[0016] In the above scheme, each semantic input text is input into the power marketing semantic big data model. The power marketing semantic big data model uses a multi-head self-attention mechanism to calculate the semantic association weight between the guiding prompt text and the business entity text in each semantic input text. This allows for dynamic and accurate focus on the most relevant content in the semantic input text related to the power marketing domain, filtering out irrelevant or interfering information, thereby selecting more accurate and relevant semantic input text to be extracted. Next, semantic disambiguation processing is performed on the business triples to be confirmed using power marketing knowledge graph triples. This ensures that the obtained business triples avoid resolving common ambiguities in knowledge graphs, such as polysemy and ambiguous relationships, thus ensuring the accuracy of the business triples and improving the accuracy of subsequent updates to the power marketing knowledge graph.

[0017] As a preferred embodiment, the step of obtaining the triple constraints of the power marketing knowledge graph, and performing semantic disambiguation processing on the triples of the business data to be confirmed based on the triple constraints of the power marketing knowledge graph, yields several business triples of the business data to be processed, including: Obtain triple type constraints from the power marketing knowledge graph; If the triplet of the business to be confirmed satisfies the triplet type constraint of the power marketing knowledge graph, then the triplet of the business to be confirmed is used as the business triplet of the business data to be processed. If the triplet of the business to be confirmed does not meet the triplet type constraint of the power marketing knowledge graph, then several candidate triplets of the triplet of the business to be confirmed are obtained based on the power marketing knowledge graph; semantic disambiguation prompts are constructed based on the business data to be processed, the business entity words corresponding to the triplet of the business to be confirmed, and the candidate triplets; the semantic disambiguation prompts are input into the power marketing semantic big model so that the power marketing semantic big model can filter the candidate triplets to obtain the business triplet of the business data to be processed.

[0018] In the above scheme, the triplet to be confirmed is validated by the triplet type constraint of the power marketing knowledge graph. If the triplet to be confirmed meets the triplet type constraint of the power marketing knowledge graph, there is no ambiguity such as polysemy or unclear relationship, and it is directly used as the business triplet of the business data to be processed; otherwise, the semantic disambiguation prompt is reconstructed and input into the power marketing semantic big model. Semantic disambiguation is constructed as a selection task based on rich context. By utilizing the powerful context understanding and reasoning ability of the power marketing semantic big model, the optimal selection is made among the candidate triplets of the power marketing knowledge graph. This enables the business triplet to achieve logical consistency with the power marketing knowledge graph and avoids update contradictions caused by ambiguity.

[0019] As a preferred embodiment, the incremental verification of the power marketing knowledge graph based on the business triples to obtain the incremental verification result; and the updating of the power marketing knowledge graph based on the incremental verification result and the business triples, including: The power marketing knowledge graph is pre-updated based on a preset mounting algorithm and each of the business triples to generate a pre-updated power marketing knowledge graph. Based on the power marketing knowledge graph and the pre-updated power marketing knowledge graph, several entity nodes to be updated are identified. Obtain the first-order neighbor node set and the second-order neighbor node set of each entity node to be updated in the power marketing knowledge graph; Calculate the similarity score between the first set of first-order neighbor nodes and the second set of first-order neighbor nodes for each entity node to be updated, and obtain the incremental verification result; Based on the incremental verification results and the preset similarity threshold, the entity nodes to be updated are filtered to obtain a number of confirmed entity nodes to be updated. The electricity marketing knowledge graph is updated based on the confirmed update entity nodes.

[0020] In the above scheme, a mounting algorithm is used to pre-update the power marketing knowledge graph, generating a temporary pre-updated version. Next, by locating the entity nodes affected by the pre-update, the similarity score between the first-order neighbor set and the second-order neighbor set of each entity node is used as the incremental verification result. This quantifies the degree of change the update makes to the entity nodes, reflecting whether the update maintains the stability of the node associations or causes drastic and abnormal association changes. Finally, the confirmed update entity nodes are selected based on the similarity threshold and the incremental verification result, thus updating the power marketing knowledge graph. This ensures that no errors occur after updating the power marketing knowledge graph, improving the accuracy of the update.

[0021] As a preferred embodiment, after updating the electricity marketing knowledge graph based on the confirmed update entity node, the method further includes: Based on the incremental verification results and the similarity threshold, the entity nodes to be updated are filtered to obtain several entity nodes to be judged. The entity nodes to be identified are corrected based on a preset expert model to obtain a fine-tuned training set; The large semantic model for electricity marketing is updated based on the fine-tuned training set.

[0022] In the above scheme, the entity nodes to be updated are filtered by incremental verification results and similarity thresholds to obtain a number of entity nodes to be judged; and the entity nodes to be judged are corrected by an expert model to obtain a fine-tuned training set; finally, the semantic model training set is updated with the fine-tuned training set, realizing a closed-loop process of continuous optimization, enabling the power marketing semantic big model to continuously adapt to business changes in the power marketing field and improving the accuracy of long-term updates of the power marketing knowledge graph.

[0023] Accordingly, this invention provides a knowledge graph update system based on a semantic large model, including: a power marketing semantic large model generation module, a coarse-grained entity segmentation processing module, a semantic input text construction module, a fine-grained entity extraction module, and a power marketing knowledge graph update module; The electricity marketing semantic big model generation module is used to obtain several knowledge graph triples of the electricity marketing knowledge graph; and to train the preset semantic big model based on the knowledge graph triples to generate the electricity marketing semantic big model. The coarse-grained entity segmentation processing module is used to acquire the business data to be processed, perform coarse-grained entity segmentation processing on the business data to be processed, and obtain several business entity texts of the business data to be processed. The semantic input text construction module is used to generate several prompt word texts of the power marketing knowledge graph based on the knowledge graph triples, and to construct several semantic input texts of the business data to be processed based on the business entity text and the prompt word texts. The fine-grained entity extraction module is used to perform fine-grained entity extraction on the semantic input text based on the power marketing semantic big model, and generate several business triples of the business data to be processed. The power marketing knowledge graph update module is used to perform incremental verification on the power marketing knowledge graph based on the business triples to obtain the incremental verification result; and to update the power marketing knowledge graph based on the incremental verification result and the business triples.

[0024] Understandably, this invention trains a semantic big model using several knowledge graph triples from the power marketing knowledge graph, enabling the power marketing semantic big model to deeply integrate knowledge from the power marketing domain and possess the reasoning ability for professional terminology and complex business logic in the power marketing field. Next, by performing coarse-grained entity segmentation on the business data to be processed, several business entity texts are obtained. Then, several prompt word texts from the power marketing knowledge graph are generated using knowledge graph triples. This transforms the ontology structure of the power marketing knowledge graph into guiding prompts for the power marketing semantic big model, allowing the semantic input texts constructed based on the business entity texts and prompt word texts to guide the power marketing semantic big model in accurate fine-grained entity extraction. This improves the accuracy of the business triples and avoids the large triple errors caused by manual annotation. Finally, incremental verification of the power marketing knowledge graph is performed using business triples to obtain the incremental verification results. Based on the incremental verification results and business triples, the power marketing knowledge graph is updated. This effectively avoids knowledge conflicts and errors caused by directly updating the power marketing knowledge graph, and achieves accurate updates to the power marketing knowledge graph. Attached Figure Description

[0025] Figure 1 A flowchart illustrating the steps of a knowledge graph update method based on a large semantic model, as provided in this embodiment of the invention. Figure 2This is a schematic diagram of the structure of a knowledge graph update system based on a semantic large model, provided in an embodiment of the present invention. Detailed Implementation

[0026] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0027] Example 1 Please refer to Figure 1 , Figure 1 The flowchart of a knowledge graph update method based on a semantic large model provided in this embodiment of the invention includes steps S101 to S105.

[0028] Step S101: Obtain several knowledge graph triples of the power marketing knowledge graph; train the preset semantic big model based on the knowledge graph triples to generate the power marketing semantic big model.

[0029] Step S102: Obtain the business data to be processed, and perform coarse-grained entity segmentation on the business data to be processed to obtain several business entity texts of the business data to be processed.

[0030] Step S103: Generate several prompt word texts of the power marketing knowledge graph based on the knowledge graph triples, and construct several semantic input texts of the business data to be processed based on the business entity texts and the prompt word texts.

[0031] Step S104: Based on the large semantic model of electricity marketing, perform fine-grained entity extraction on the semantic input text to generate several business triples of the business data to be processed.

[0032] Step S105: Perform incremental verification on the power marketing knowledge graph based on the business triples to obtain the incremental verification result; and update the power marketing knowledge graph based on the incremental verification result and the business triples.

[0033] In this embodiment, the acquisition of several knowledge graph triples of the power marketing knowledge graph; training a preset semantic large model based on the knowledge graph triples to generate a power marketing semantic large model includes: Obtain several knowledge graph triples from the power marketing knowledge graph; Based on a preset mapping template, each knowledge graph triplet is processed into text to generate triplet text data corresponding to each knowledge graph triplet. Clustering is performed on the triplet text data and the pre-acquired historical text data of electricity marketing to generate a semantic model training set; Based on the semantic model training set, the preset semantic large model is fine-tuned using LoRA to generate a large semantic model for electricity marketing.

[0034] In one optional embodiment, several knowledge graph triples are read from the power marketing knowledge graph. The knowledge graph triples are in the form of <head entity, relation, tail entity>. Since the power marketing knowledge graph typically contains three types of triples, namely attribute description type, business rule type, and hierarchical affiliation type, the mapping template in this embodiment is set as follows: if it is an attribute description type, the mapping template is "{head entity}'s {relation} is {tail entity}"; if it is a business rule type, the mapping template is "execution of {head entity} business must satisfy the {tail entity} {relation}"; if it is a hierarchical affiliation type, the mapping template is "the specific situation of {head entity} includes {tail entity}". Each knowledge graph triple is converted into a text statement through the mapping target, that is, text processing is performed to obtain the triple text data corresponding to the knowledge graph triple.

[0035] For example, a knowledge graph triple of attribute description type, such as <transformer, rated voltage, 10kV>, after textualization using a mapping template, yields the text data "The rated voltage of the transformer is 10kV". A knowledge graph triple of business rule type, such as <restoring power supply, prerequisite, settling electricity bills>, after textualization using a mapping template, yields the text data "The prerequisite for restoring power supply is settling electricity bills". A knowledge graph triple of hierarchical affiliation type, such as <violation of electricity use, includes, unauthorized wiring>, after textualization using a mapping template, yields the text data "Specific circumstances of violation of electricity use include unauthorized wiring".

[0036] In one optional embodiment, the preset semantic large model is an existing general semantic large model, including but not limited to BERT, T5, and GPT models. Then, LoRA (Low-Rank Adaptation) technology is used to fine-tune the semantic large model during training. During this fine-tuning process, LoRA freezes the core parameters of the semantic large model and only updates the gradients of newly added low-rank matrix parameters. Simultaneously, during fine-tuning, a causal language modeling (CLM) algorithm is used as the training objective to process the semantic model training set, thereby minimizing the difference between the predicted distribution output by the electricity marketing semantic large model and the true distribution in the electricity marketing domain.

[0037] It's important to note that LoRA (Low-Rank Adaptation) is a technique for efficiently fine-tuning large pre-trained models. This technique adds a set of trainable low-rank matrices alongside the model's original, frozen (pre-trained weights) parameters to simulate parameter updates, rather than directly updating the entire massive original weights. LoRA fine-tuning can capture knowledge of new tasks with a minimal number of parameters, achieving performance comparable to or even better than full-scale fine-tuning while significantly reducing computational overhead and storage requirements. Causal Language Modeling is an autoregressive language model training task. This technique enables the model to predict the next most likely word (token) based on the given context (or historical word sequence), modeling unidirectional causal relationships in text.

[0038] In the above embodiments, textualizing the structured knowledge graph triples using mapping templates automatically transforms the existing high-quality and accurate structured knowledge in the power marketing knowledge graph into natural language descriptions that the semantic big model can learn. This avoids inaccuracies in subsequent model training caused by manual annotation, and thus avoids the problem of excessive triple errors. Next, a semantic model training set is constructed through clustering, and the semantic big model is fine-tuned using LoRA with this training set. This not only enables the power marketing semantic big model to deeply integrate knowledge from the power marketing domain and possess the reasoning ability for professional terminology and complex business logic in the power marketing field, but also effectively controls training costs and mitigates the risk of overfitting, improving the robustness and stability of the power marketing semantic big model, thereby improving the accuracy of subsequent business triple updates and power marketing knowledge graph updates.

[0039] In this embodiment, the step of clustering the triplet text data and the pre-acquired historical text data of electricity marketing to generate a semantic model training set includes: The triplet text data and the pre-acquired historical text data of electricity marketing are vectorized according to the preset semantic vector construction algorithm to obtain several semantic vectors. The semantic vectors are clustered according to a preset clustering algorithm to generate several initial clusters, and the average number of samples in all initial clusters is obtained. Based on the average number of samples and the number of samples in each initial cluster, samples within each initial cluster are sampled to obtain several first clusters; A semantic model training set is generated based on the first cluster.

[0040] In an optional embodiment, the semantic vector construction algorithm described in this embodiment refers to a pre-trained language model (such as Sentence-BERT). The pre-acquired historical text data of electricity marketing refers to unstructured business documents, reports, and other historical text corpora within the electricity marketing field. The pre-trained language model vectorizes the triplet text data and the pre-acquired historical text data of electricity marketing to obtain several semantic vectors. Next, the clustering algorithm is defined as the Mini-Batch K-Means clustering algorithm, and the initial number of clusters is determined using the Elbow Method. Then, the batch size of the Mini-Batch K-Means clustering algorithm is set to 256. The semantic vectors are clustered to generate several initial clusters, and the average number of samples in all initial clusters is obtained. ; If the initial cluster size is greater than 3 times the average cluster size The initial cluster represents the leading high-frequency business in the electricity marketing field. Therefore, undersampling (a sampling method) is applied to the samples within this initial cluster, randomly discarding a portion of the initial cluster's contents to bring the sample size to three times the average sample size. Alternatively, an upper limit threshold can be set, which can be limited according to the actual situation. This embodiment does not impose too many restrictions.

[0041] If the initial cluster size is less than 0.2 times the average cluster size The initial cluster represents low-frequency tail-end business in the electricity marketing field. Therefore, oversampling (a sampling process) is performed on the samples within this initial cluster, either by duplicating samples or by combining them with synonym replacements to enhance the sample size, thus expanding the initial cluster to the average sample size. The value can be three times the standard value or a lower limit threshold can be set. This lower limit threshold can be limited according to the actual situation, and this embodiment does not impose too many restrictions.

[0042] Furthermore, through oversampling or undersampling, several first clusters are obtained; the samples in the first clusters constitute the semantic model training set.

[0043] It's important to note that the Mini-Batch K-Means clustering algorithm is an efficient variant of the standard K-Means algorithm, designed specifically for handling large-scale datasets. It borrows the batch size training idea from deep learning, where, in each iteration updating cluster centers, instead of calculating the affiliation of all data points, a small subset of data samples (i.e., one batch size) is randomly selected to approximate the gradient and update the center points. The elbow method, or Elbow Method, is a heuristic method used in unsupervised learning (especially in K-Means clustering analysis) to determine the optimal number of clusters (K value).

[0044] In the above embodiments, several initial clusters are obtained through vectorization and clustering. Then, by calculating the average number of samples in all initial clusters and performing sampling based on the average number of samples and the number of samples in each cluster, overly dense clusters can be effectively processed to prevent model overfitting, while also preserving information from sparse clusters to some extent. This sampling method based on sample size ensures that the semantic model training set covers a wide range of semantic diversity within the domain, while avoiding model bias caused by data imbalance. This improves the robustness and stability of the large-scale semantic model for power marketing, enabling it to maintain stable and accurate semantic understanding and extraction performance when processing various complex and changing power marketing business data. This, in turn, improves the accuracy of subsequent updates to business triples and the power marketing knowledge graph.

[0045] In this embodiment, the step of acquiring the business data to be processed and performing coarse-grained entity segmentation on the business data to be processed to obtain several business entity texts of the business data to be processed includes: Obtain pending business data; The business data to be processed is input into a pre-trained Hidden Markov Model, and the label sequence of the business data to be processed is identified by a preset Viterbi algorithm. Based on the tag sequence, the business data to be processed is segmented into words to obtain several business entity words of the business data to be processed. Centered on each of the business entity words, the characters of the business data to be processed are extracted based on a preset context text window to obtain several business entity texts of the business data to be processed.

[0046] In one optional embodiment, the business data to be processed is acquired, and then input into a pre-trained Hidden Markov Model (HMM) (since the training process of this model is already well-established, it will not be elaborated upon in this embodiment). The Viterbi Algorithm is used in the HMM to identify an optimal state sequence with the highest global probability; each value in this state sequence is a label sequence. Next, each label in the label sequence is used to perform word segmentation on the business data to be processed. The label sequence obtained by the Viterbi Algorithm includes multiple sets of business entity word start positions and internal word segmentation index ranges. The starting positions of the business entity words are located using their start positions, and the business entity words are divided using their internal word segmentation index ranges, thus obtaining several business entity words.

[0047] Next, set the context text window size to 100 characters; expand forward and backward by 100 characters, centering on each business entity word, to form the business entity text of each business entity word; the business entity texts of all business entity words constitute several business entity texts of the business data to be processed.

[0048] It's important to note that Hidden Markov Models (HMMs) are statistical models used to describe observation sequences randomly generated from hidden Markov chains, and are one of the fundamental models of dynamic Bayesian networks. Their core characteristics lie in the system's dual randomness: first, the hidden state sequence itself is a Markov process (satisfying the no-aftereffect property); second, each hidden state randomly generates an observable symbol, but the state itself is not directly observable. The Viterbi Algorithm is a dynamic programming algorithm used in sequence models such as HMMs to solve for the optimal hidden state sequence, specifically addressing the decoding problem. Its core idea is to iteratively calculate and retain the probability of the optimal path to each state, ultimately finding the globally optimal path through backtracking, thus avoiding the exponential computational complexity of exhaustive search.

[0049] In the above embodiments, the label sequence of the business data to be processed is identified by a pre-trained Hidden Markov Model and the Viterbi algorithm. Word segmentation based on the label sequence accurately excludes irrelevant text, allowing business entity words to better adapt to the grammar and terminology of the power marketing field. Next, using the business entity words as the center, a contextual text window is used to extract characters from the business data to be processed, obtaining several business entity texts. This ensures that the business entity texts retain rich semantic clues, thereby improving the accuracy and reliability of the subsequent power marketing semantic big data model in determining entity types and resolving complex relationships between entities, and enhancing the accuracy of updating the power marketing knowledge graph.

[0050] In this embodiment, the step of generating several prompt word texts for the power marketing knowledge graph based on the knowledge graph triples, and constructing several semantic input texts for the business data to be processed based on the business entity texts and the prompt word texts, includes: Extract several entity type data and relation type data from the knowledge graph triples; Based on each entity type data, the relation type data is traversed to determine the domain data and value range data of each entity type data. Based on a preset regular expression matching algorithm, the domain data and value domain data of each entity type data are filled into a preset prompt word template to generate several prompt word texts for the power marketing knowledge graph; Based on the business entity words in each of the business entity texts, the prompt word texts are filtered to determine several guiding prompt word texts corresponding to each of the business entity texts; Each business entity text is concatenated with its corresponding guiding prompt text to construct several semantic input texts for the business data to be processed.

[0051] In one optional embodiment, the knowledge graph triples are traversed to extract several entity type data and relation type data, and the domain data and range data of each relation type data are obtained simultaneously. Then, using each entity type data as an index, the relation type data are traversed to determine the domain data and range data of each entity type data. Afterwards, regular expression matching is used to fill the domain data and range data of each entity type data into a preset prompt word template, generating several prompt word texts for the power marketing knowledge graph. For example, in this embodiment, the prompt word template is set to "From the following text, identify entities belonging to type '{Domain}' and extract their corresponding '{Range}'." Assuming an entity type data is "risk", its corresponding domain data is "risk" and its range data is "prevention rule". Therefore, the generated prompt word text is "From the following text, identify entities belonging to 'risk' and extract their corresponding 'prevention rule'". Next, the business entity words (e.g., "risk") in each business entity text are matched with the domain data in the prompt word text to obtain the guiding prompt word text. Then, the business entity texts are concatenated with their corresponding guiding prompt word texts to construct several semantic input texts of the business data to be processed. Furthermore, in actual power marketing knowledge graphs, relevant task instructions are usually generated for the semantic input texts. Therefore, the final semantic input text can be represented as "[task instruction] + [guiding prompt word text] + [business entity text]".

[0052] In the above embodiments, several entity type data and relation type data are extracted from the knowledge graph triples. Then, the domain and value range data of each entity type data are determined by traversal and filled into a preset prompt word template to generate several prompt word texts for the power marketing knowledge graph. This transforms the ontology structure of the power marketing knowledge graph into guiding prompts for the power marketing semantic big model. Next, semantic input text is obtained through filtering and splicing operations. This semantic input text not only contains the original business text fragments of the business data to be processed, but also includes highly relevant structured guidance information from the power marketing knowledge graph. This allows the semantic input text to guide the power marketing semantic big model to perform accurate fine-grained entity extraction, improving the accuracy of business triples and avoiding large triple errors caused by manual annotation, thereby improving the accuracy of subsequent updates to the power marketing knowledge graph.

[0053] In this embodiment, the step of performing fine-grained entity extraction on the semantic input text based on the large semantic model of electricity marketing to generate several business triples of the business data to be processed includes: Each semantic input text is input into the power marketing semantic big model, which calculates the semantic association weight between the guiding prompt text and the business entity text in each semantic input text based on a preset multi-head self-attention mechanism. The semantic input text is then filtered based on the semantic association weight to obtain several semantic input texts to be extracted. The power marketing semantic big model then performs semantic decoding on the semantic input texts to be extracted to generate several business triples to be confirmed for the business data to be processed. Obtain the triple constraints of the power marketing knowledge graph, and perform semantic disambiguation on the triples of the business to be confirmed based on the triple constraints of the power marketing knowledge graph to obtain several business triples of the business data to be processed.

[0054] In an optional embodiment, each semantic input text is input into the power marketing semantic big data model. The model then uses the domain and value domain data of the guiding prompt text in the semantic input text as semantic anchors (i.e., query vectors in the multi-head attention mechanism). Next, it scans the business entity text using the multi-head attention mechanism to calculate the semantic association weight between each word (Token) in the business entity text and the anchor, which is considered as calculating the semantic association weight between the guiding prompt text in the semantic input text and the business entity text. After obtaining the semantic association weight, semantic input texts with a weight greater than the semantic association weight threshold are considered as semantic input texts to be extracted. The semantic association weight threshold can be set during the fine-tuning of the power marketing semantic big data model, and the specific value is limited according to actual needs. After filtering and obtaining the semantic input texts to be extracted, the power marketing semantic big data model performs semantic decoding on the semantic input texts to obtain entity or attribute values, generating several pending confirmation business triples of the business data to be processed.

[0055] It's important to note that the multi-head self-attention mechanism is a computational model that breaks down a single self-attention computation into multiple parallel heads, enabling the model to simultaneously focus on information from different positions in the input sequence from different subspaces. Its core idea is as follows: First, the representation of the input sequence (query vector, key vector, value vector) is mapped to multiple subspaces through multiple independent linear projections. Then, standard self-attention operations are performed in parallel within each subspace (i.e., calculating the association weights between each position in the sequence and all other positions, and aggregating the value vectors based on these weights). Finally, the outputs of all heads are concatenated and linearly transformed again to fuse them into the final representation.

[0056] In the above embodiments, each semantic input text is input into the power marketing semantic big data model. The power marketing semantic big data model uses a multi-head self-attention mechanism to calculate the semantic association weight between the guiding prompt text and the business entity text in each semantic input text. This allows for dynamic and accurate focus on the most relevant content in the semantic input text related to the power marketing domain, filtering out irrelevant or interfering information, thereby selecting more accurate and relevant semantic input text to be extracted. Next, semantic disambiguation processing is performed on the business triples to be confirmed using power marketing knowledge graph triples. This ensures that the obtained business triples avoid resolving common ambiguities in knowledge graphs, such as polysemy and ambiguous relationships, thus ensuring the accuracy of the business triples and improving the accuracy of subsequent updates to the power marketing knowledge graph.

[0057] In this embodiment, the step of obtaining the triple constraints of the power marketing knowledge graph, and performing semantic disambiguation processing on the triples of the business data to be confirmed based on the triple constraints of the power marketing knowledge graph, yields several business triples of the business data to be processed, including: Obtain triple type constraints from the power marketing knowledge graph; If the triplet of the business to be confirmed satisfies the triplet type constraint of the power marketing knowledge graph, then the triplet of the business to be confirmed is used as the business triplet of the business data to be processed. If the triplet of the business to be confirmed does not meet the triplet type constraint of the power marketing knowledge graph, then several candidate triplets of the triplet of the business to be confirmed are obtained based on the power marketing knowledge graph; semantic disambiguation prompts are constructed based on the business data to be processed, the business entity words corresponding to the triplet of the business to be confirmed, and the candidate triplets; the semantic disambiguation prompts are input into the power marketing semantic big model so that the power marketing semantic big model can filter the candidate triplets to obtain the business triplet of the business data to be processed.

[0058] In an optional embodiment, the triplet to be confirmed is denoted as (E1, R, E2). The type constraint of the triplet in the power marketing knowledge graph is obtained from the power marketing knowledge graph, which refers to checking whether R conforms to the type constraints of E1 and E2. If the triplet to be confirmed satisfies the type constraints of the power marketing knowledge graph triplet, it indicates that the triplet to be confirmed is not ambiguous and can be directly used as the triplet of the business data to be processed. If the triplet to be confirmed does not satisfy the type constraints of the power marketing knowledge graph triplet, it indicates that the triplet to be confirmed is ambiguous. In this case, using E1 and E2 as indices, the knowledge graph triplets of the power marketing knowledge graph are traversed to obtain several candidate triplets of the triplet to be confirmed. Next, the format of the semantic disambiguation prompt template in this embodiment is: "Based on context: '{Context}', please analyze the specific reference of entity '{Entity}' in the text. Optional meanings include: '{Option_List}'. Please select the correct option according to the context logic." The business data to be processed is filled into the "Context" field of the semantic disambiguation prompt template, the business entity words corresponding to the business triples to be confirmed are filled into the "Entity" field, and several candidate triples of the business triples to be confirmed are filled into the "Option_List" field, thus forming the semantic disambiguation prompt. Finally, the semantic disambiguation prompt is input into the power marketing semantic big data model so that the power marketing semantic big data model can filter the candidate triples to obtain the business triples of the business data to be processed.

[0059] In the above embodiments, the business triplets to be confirmed are verified by the triple type constraint of the power marketing knowledge graph. If the business triplets to be confirmed meet the triple type constraint of the power marketing knowledge graph, there are no ambiguities such as polysemy or unclear relationships, and they are directly used as the business triplets of the business data to be processed. Otherwise, the semantic disambiguation prompt words are reconstructed and input into the power marketing semantic big model. Semantic disambiguation is constructed as a selection task based on rich context. By utilizing the powerful context understanding and reasoning capabilities of the power marketing semantic big model, the optimal selection is made among the candidate triplets of the power marketing knowledge graph. This enables the business triplets to achieve logical consistency with the power marketing knowledge graph and avoids update contradictions caused by ambiguity.

[0060] In this embodiment, the incremental verification of the power marketing knowledge graph based on the business triples to obtain the incremental verification result, and the updating of the power marketing knowledge graph based on the incremental verification result and the business triples, includes: The power marketing knowledge graph is pre-updated based on a preset mounting algorithm and each of the business triples to generate a pre-updated power marketing knowledge graph. Based on the power marketing knowledge graph and the pre-updated power marketing knowledge graph, several entity nodes to be updated are identified. Obtain the first-order neighbor node set and the second-order neighbor node set of each entity node to be updated in the power marketing knowledge graph; Calculate the similarity score between the first set of first-order neighbor nodes and the second set of first-order neighbor nodes for each entity node to be updated, and obtain the incremental verification result; Based on the incremental verification results and the preset similarity threshold, the entity nodes to be updated are filtered to obtain a number of confirmed entity nodes to be updated. The electricity marketing knowledge graph is updated based on the confirmed update entity nodes.

[0061] In an optional embodiment, this embodiment sets the mounting algorithm to an Upsert mechanism. Specifically, a temporary graph buffer is generated, and a copy of the power marketing knowledge graph is made in the temporary graph buffer. For the power marketing knowledge graph in the temporary graph buffer, the entity in the business triple is used as the identifier to perform node retrieval. If the node already exists, a time-order appending strategy is used to write the business triple as the new version into the node, while retaining the old version as a backup. If the node does not exist, a new node is created and marked as "pending verification," and the business triple is also written into the node. After all nodes are updated or created, relationship edges are established or updated between nodes. Data such as the source document ID of the business data to be processed and the output time of the power marketing semantic big model are written as attributes of the edges into the power marketing knowledge graph, thereby forming a pre-updated power marketing knowledge graph in the temporary graph buffer. At this time, the power marketing knowledge graph has not been updated at all.

[0062] Next, by comparing the electricity marketing knowledge graph and the pre-updated electricity marketing knowledge graph, several entity nodes to be updated can be identified. For example, changes in edge attributes or node attributes both constitute entity nodes to be updated. Then, the first-order neighbor set of each entity node to be updated in the electricity marketing knowledge graph and the second-order neighbor set in the pre-updated electricity marketing knowledge graph are obtained. The Jaccard similarity coefficient algorithm is used to calculate the similarity score between the first-order neighbor set and the second-order neighbor set of each entity node to be updated. All similarity scores are used as incremental verification results.

[0063] Furthermore, in this embodiment, a preset similarity threshold is set as the result obtained through historical incremental verification of the electricity marketing knowledge graph; specifically, the average of all similarity scores in the historical incremental verification results is defined. with standard deviation Similarity threshold ;in This is a leniency factor, and its value can be set according to actual needs.

[0064] If the similarity score is greater than the similarity threshold, the entity node to be updated is confirmed as an entity node to be updated. Then, these updated entity nodes are updated in the power marketing knowledge graph, thereby completing the update of the power marketing knowledge graph.

[0065] It's important to note that the Upsert mechanism is a crucial operation in the field of databases and data processing; its name is a combination of "update" and "insert." It describes an atomic business logic: when writing a record to a database table, if the target data (usually determined by a primary key or unique constraint) already exists, an update operation is performed; otherwise, an insert operation is performed. The Jaccard Similarity Coefficient is a classic metric for measuring the similarity between two finite sets of samples. Its core definition is the ratio of the size of the intersection of two sets A and B to the size of their union.

[0066] In the above embodiments, a mounting algorithm is used to pre-update the power marketing knowledge graph, thereby generating a temporary pre-updated version of the power marketing knowledge graph. Next, by locating the entity nodes to be updated that are affected by the pre-update, the similarity score between the first-order neighbor set and the second-order neighbor set of the entity nodes to be updated is used as the incremental verification result. This quantifies the degree of change the update makes to the entity nodes to be updated, reflecting whether the update can maintain the stability of the entity node associations or will cause drastic and abnormal association changes. Finally, the entity nodes to be confirmed for updating are selected using a similarity threshold and the incremental verification result, thereby updating the power marketing knowledge graph. This ensures that no errors occur after updating the power marketing knowledge graph, improving the accuracy of the power marketing knowledge graph update.

[0067] In this embodiment, after updating the electricity marketing knowledge graph based on the confirmed update entity node, the method further includes: Based on the incremental verification results and the similarity threshold, the entity nodes to be updated are filtered to obtain several entity nodes to be judged. The entity nodes to be identified are corrected based on a preset expert model to obtain a fine-tuned training set; The large semantic model for electricity marketing is updated based on the fine-tuned training set.

[0068] In one optional embodiment, if the similarity score is less than or equal to the similarity threshold, the entity node to be updated is considered an entity node to be identified. Then, an expert model is used for correction. Specifically, the business triples corresponding to the entity node to be identified are input into the expert model (e.g., Mixtral 8x7B, GPT-4, etc.), and the expert model outputs the correction results, which constitute the fine-tuning training set. The correction results are stored in the form of JSON logs, with the format "{"source_text":"original text","mode_output":"model error output","expert_correction":"expert-corrected triples","error_type":"error type"}". Finally, "source_text" is used as the input to the power marketing semantic big data model, and "expert_correction" is used as the standard output label of the power marketing semantic big data model. LoRA fine-tuning technology is used to incrementally fine-tune the power marketing semantic big data model.

[0069] In the above embodiments, the entity nodes to be updated are filtered by incremental verification results and similarity thresholds to obtain several entity nodes to be judged; and the entity nodes to be judged are corrected by an expert model to obtain a fine-tuned training set; finally, the semantic model training set is updated with the fine-tuned training set, realizing a closed-loop process of continuous optimization, enabling the power marketing semantic big model to continuously adapt to business changes in the power marketing field and improving the accuracy of long-term updates of the power marketing knowledge graph.

[0070] This embodiment trains a semantic big model using several knowledge graph triples from the power marketing knowledge graph. This allows the power marketing semantic big model to deeply integrate knowledge from the power marketing domain and possess the reasoning ability for professional terminology and complex business logic in the power marketing field. Next, coarse-grained entity segmentation is performed on the business data to be processed, resulting in several business entity texts. Then, several prompt word texts for the power marketing knowledge graph are generated using knowledge graph triples. This transforms the ontology structure of the power marketing knowledge graph into guiding prompts for the power marketing semantic big model. Consequently, the semantic input texts constructed based on the business entity texts and prompt word texts can guide the power marketing semantic big model to perform accurate fine-grained entity extraction, improving the accuracy of the business triples and avoiding large triple errors caused by manual annotation. Finally, incremental verification of the power marketing knowledge graph is performed using the business triples, obtaining incremental verification results. The power marketing knowledge graph is then updated based on these incremental verification results and the business triples. This effectively avoids knowledge conflicts and errors caused by directly updating the power marketing knowledge graph, achieving accurate updates.

[0071] Example 2 Please refer to Figure 2 , Figure 2 The present invention provides a schematic diagram of the structure of a knowledge graph update system based on a semantic large model, comprising: a power marketing semantic large model generation module 201, a coarse-grained entity segmentation processing module 202, a semantic input text construction module 203, a fine-grained entity extraction module 204, and a power marketing knowledge graph update module 205. The power marketing semantic big model generation module 201 is used to obtain several knowledge graph triples of the power marketing knowledge graph; and to train the preset semantic big model based on the knowledge graph triples to generate the power marketing semantic big model. The coarse-grained entity segmentation processing module 202 is used to acquire business data to be processed, perform coarse-grained entity segmentation processing on the business data to be processed, and obtain several business entity texts of the business data to be processed. The semantic input text construction module 203 is used to generate several prompt word texts of the power marketing knowledge graph based on the knowledge graph triples, and to construct several semantic input texts of the business data to be processed based on the business entity text and the prompt word texts; The fine-grained entity extraction module 204 is used to perform fine-grained entity extraction on the semantic input text based on the power marketing semantic big model, and generate several business triples of the business data to be processed. The power marketing knowledge graph update module 205 is used to perform incremental verification on the power marketing knowledge graph based on the business triples to obtain the incremental verification result; and update the power marketing knowledge graph based on the incremental verification result and the business triples.

[0072] In this embodiment, the electricity marketing semantic big model generation module 201 includes: an electricity marketing semantic big model generation unit; The electricity marketing semantic big model generation unit is used to obtain several knowledge graph triples of the electricity marketing knowledge graph. Based on a preset mapping template, each knowledge graph triplet is processed into text to generate triplet text data corresponding to each knowledge graph triplet. Clustering is performed on the triplet text data and the pre-acquired historical text data of electricity marketing to generate a semantic model training set; Based on the semantic model training set, the preset semantic large model is fine-tuned using LoRA to generate a large semantic model for electricity marketing.

[0073] In this embodiment, the electricity marketing semantic big model generation unit includes: a clustering processing subunit; The clustering processing subunit is used to vectorize the triplet text data and the pre-acquired historical text data of electricity marketing according to a preset semantic vector construction algorithm to obtain several semantic vectors. The semantic vectors are clustered according to a preset clustering algorithm to generate several initial clusters, and the average number of samples in all initial clusters is obtained. Based on the average number of samples and the number of samples in each initial cluster, samples within each initial cluster are sampled to obtain several first clusters; A semantic model training set is generated based on the first cluster.

[0074] In this embodiment, the coarse-grained entity segmentation processing module 202 includes: a coarse-grained entity segmentation processing unit; The coarse-grained entity segmentation processing unit is used to acquire the business data to be processed. The business data to be processed is input into a pre-trained Hidden Markov Model, and the label sequence of the business data to be processed is identified by a preset Viterbi algorithm. Based on the tag sequence, the business data to be processed is segmented into words to obtain several business entity words of the business data to be processed. Centered on each of the business entity words, the characters of the business data to be processed are extracted based on a preset context text window to obtain several business entity texts of the business data to be processed.

[0075] In this embodiment, the semantic input text construction module 203 includes: a semantic input text construction unit; The semantic input text construction unit is used to extract several entity type data and relation type data from the knowledge graph triples; Based on each entity type data, the relation type data is traversed to determine the domain data and value range data of each entity type data. Based on a preset regular expression matching algorithm, the domain data and value domain data of each entity type data are filled into a preset prompt word template to generate several prompt word texts for the power marketing knowledge graph; Based on the business entity words in each of the business entity texts, the prompt word texts are filtered to determine several guiding prompt word texts corresponding to each of the business entity texts; Each business entity text is concatenated with its corresponding guiding prompt text to construct several semantic input texts for the business data to be processed.

[0076] In this embodiment, the fine-grained entity extraction module 204 includes: a fine-grained entity extraction unit; The fine-grained entity extraction unit is used to input each semantic input text into the power marketing semantic big model, so that the power marketing semantic big model calculates the semantic association weight between the guiding prompt text and the business entity text in each semantic input text based on a preset multi-head self-attention mechanism, thereby filtering the semantic input text based on the semantic association weight to obtain several semantic input texts to be extracted; then the power marketing semantic big model performs semantic decoding on the semantic input texts to be extracted to generate several business triples to be confirmed for the business data to be processed; Obtain the triple constraints of the power marketing knowledge graph, and perform semantic disambiguation on the triples of the business to be confirmed based on the triple constraints of the power marketing knowledge graph to obtain several business triples of the business data to be processed.

[0077] In this embodiment, the fine-grained entity extraction unit includes: a semantic disambiguation processing subunit; The semantic disambiguation processing subunit is used to obtain the triple type constraints of the power marketing knowledge graph. If the triplet of the business to be confirmed satisfies the triplet type constraint of the power marketing knowledge graph, then the triplet of the business to be confirmed is used as the business triplet of the business data to be processed. If the triplet of the business to be confirmed does not meet the triplet type constraint of the power marketing knowledge graph, then several candidate triplets of the triplet of the business to be confirmed are obtained based on the power marketing knowledge graph; semantic disambiguation prompts are constructed based on the business data to be processed, the business entity words corresponding to the triplet of the business to be confirmed, and the candidate triplets; the semantic disambiguation prompts are input into the power marketing semantic big model so that the power marketing semantic big model can filter the candidate triplets to obtain the business triplet of the business data to be processed.

[0078] In this embodiment, the power marketing knowledge graph update module 205 includes: a power marketing knowledge graph update unit; The power marketing knowledge graph update unit is used to pre-update the power marketing knowledge graph based on a preset mounting algorithm and each of the business triples, and generate a pre-updated power marketing knowledge graph. Based on the power marketing knowledge graph and the pre-updated power marketing knowledge graph, several entity nodes to be updated are identified. Obtain the first-order neighbor node set and the second-order neighbor node set of each entity node to be updated in the power marketing knowledge graph; Calculate the similarity score between the first set of first-order neighbor nodes and the second set of first-order neighbor nodes for each entity node to be updated, and obtain the incremental verification result; Based on the incremental verification results and the preset similarity threshold, the entity nodes to be updated are filtered to obtain a number of confirmed entity nodes to be updated. The electricity marketing knowledge graph is updated based on the confirmed update entity nodes.

[0079] In this embodiment, the power marketing knowledge graph update unit further includes: a semantic model training set update subunit; The semantic model training set update subunit is used to filter the entity nodes to be updated based on the incremental verification result and the similarity threshold, and obtain a number of entity nodes to be judged. The entity nodes to be identified are corrected based on a preset expert model to obtain a fine-tuned training set; The large semantic model for electricity marketing is updated based on the fine-tuned training set.

[0080] This invention trains a semantic big data model using knowledge graph triples from a power marketing knowledge graph. This allows the model to deeply integrate knowledge from the power marketing domain, enabling it to reason about professional terminology and complex business logic within the power marketing field. Next, coarse-grained entity segmentation is performed on the business data to be processed, yielding several business entity texts. Then, knowledge graph triples are used to generate several prompt words for the power marketing knowledge graph. This transforms the ontology structure of the power marketing knowledge graph into guiding prompts for the semantic big data model, allowing the semantic input texts constructed based on business entity texts and prompt words to guide the model in accurate fine-grained entity extraction. This improves the accuracy of the business triples and avoids the large errors caused by manual annotation. Finally, incremental validation of the power marketing knowledge graph is performed using the business triples. The incremental validation results are then used to update the power marketing knowledge graph, effectively avoiding knowledge conflicts and errors caused by directly updating the knowledge graph, thus achieving accurate updates.

[0081] This invention trains a semantic big data model using several knowledge graph triples from a power marketing knowledge graph. This allows the model to deeply integrate knowledge from the power marketing domain and develop reasoning capabilities for professional terminology and complex business logic within the power marketing field. Next, coarse-grained entity segmentation is performed on the business data to be processed, yielding several business entity texts. Then, several prompt words are generated from the knowledge graph triples to transform the ontology structure of the power marketing knowledge graph into guiding prompts for the semantic big data model. This enables the semantic input texts, constructed based on the business entity texts and prompt words, to guide the model in accurate fine-grained entity extraction, improving the accuracy of the business triples and avoiding large errors caused by manual annotation. Finally, incremental validation of the power marketing knowledge graph is performed using the business triples, yielding the validation results. The power marketing knowledge graph is then updated based on these results and the business triples, effectively avoiding knowledge conflicts and errors caused by directly updating the knowledge graph and achieving accurate updates.

[0082] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.

Claims

1. A knowledge graph updating method based on a semantic large model, characterized in that, include: Obtain several knowledge graph triples from the power marketing knowledge graph; The preset semantic model is trained based on the knowledge graph triples to generate a large semantic model for electricity marketing. Obtain the business data to be processed, and perform coarse-grained entity segmentation on the business data to be processed to obtain several business entity texts of the business data to be processed. Based on the knowledge graph triples, several prompt word texts of the power marketing knowledge graph are generated, and several semantic input texts of the business entity texts and the prompt word texts are constructed based on the business entity texts and the prompt word texts; Based on the aforementioned large-scale semantic model for electricity marketing, fine-grained entity extraction is performed on the semantic input text to generate several business triples of the business data to be processed. Based on the business triples, the power marketing knowledge graph is incrementally validated to obtain the incremental validation results. The electricity marketing knowledge graph is then updated based on the incremental verification results and the business triples. 2.The knowledge graph updating method based on a semantic large model according to claim 1, wherein, The acquisition of several knowledge graph triples of the power marketing knowledge graph; Based on the knowledge graph triples, a pre-defined semantic model is trained to generate a large semantic model for electricity marketing, including: Obtain several knowledge graph triples from the power marketing knowledge graph; Based on a preset mapping template, each knowledge graph triplet is processed into text to generate triplet text data corresponding to each knowledge graph triplet. Clustering is performed on the triplet text data and the pre-acquired historical text data of electricity marketing to generate a semantic model training set; Based on the semantic model training set, the preset semantic large model is fine-tuned using LoRA to generate a large semantic model for electricity marketing. 3.The knowledge graph updating method based on a semantic large model according to claim 2, wherein, The process of clustering the triplet text data and the pre-acquired historical text data of electricity marketing to generate a semantic model training set includes: The triplet text data and the pre-acquired historical text data of electricity marketing are vectorized according to the preset semantic vector construction algorithm to obtain several semantic vectors. The semantic vectors are clustered according to a preset clustering algorithm to generate several initial clusters, and the average number of samples in all initial clusters is obtained. Based on the average number of samples and the number of samples in each initial cluster, samples within each initial cluster are sampled to obtain several first clusters; A semantic model training set is generated based on the first cluster. 4.The knowledge graph updating method based on a semantic large model according to claim 1, wherein, The process involves acquiring the business data to be processed, performing coarse-grained entity segmentation on the business data to obtain several business entity texts, including: Obtain pending business data; The business data to be processed is input into a pre-trained Hidden Markov Model, and the label sequence of the business data to be processed is identified by a preset Viterbi algorithm. Based on the tag sequence, the business data to be processed is segmented into words to obtain several business entity words of the business data to be processed. Centered on each of the business entity words, the characters of the business data to be processed are extracted based on a preset context text window to obtain several business entity texts of the business data to be processed. 5.The knowledge graph updating method based on a semantic large model according to claim 4, wherein, The process of generating several prompt word texts for the power marketing knowledge graph based on the knowledge graph triples, and constructing several semantic input texts for the business data to be processed based on the business entity texts and the prompt word texts, includes: Extract several entity type data and relation type data from the knowledge graph triples; Based on each entity type data, the relation type data is traversed to determine the domain data and value range data of each entity type data. Based on a preset regular expression matching algorithm, the domain data and value domain data of each entity type data are filled into a preset prompt word template to generate several prompt word texts for the power marketing knowledge graph; Based on the business entity words in each of the business entity texts, the prompt word texts are filtered to determine several guiding prompt word texts corresponding to each of the business entity texts; Each business entity text is concatenated with its corresponding guiding prompt text to construct several semantic input texts for the business data to be processed. 6.The knowledge graph updating method based on a semantic large model according to claim 5, wherein, The process involves fine-grained entity extraction from the semantic input text based on the aforementioned large-scale semantic model for electricity marketing, generating several business triples for the business data to be processed, including: Each semantic input text is input into the power marketing semantic big model, which calculates the semantic association weight between the guiding prompt text and the business entity text in each semantic input text based on a preset multi-head self-attention mechanism. The semantic input text is then filtered based on the semantic association weight to obtain several semantic input texts to be extracted. The power marketing semantic big model then performs semantic decoding on the semantic input texts to be extracted to generate several business triples to be confirmed for the business data to be processed. Obtain the triple constraints of the power marketing knowledge graph, and perform semantic disambiguation on the triples of the business to be confirmed based on the triple constraints of the power marketing knowledge graph to obtain several business triples of the business data to be processed.

7. The knowledge graph update method based on a semantic large model as described in claim 6, characterized in that, The process involves obtaining triple constraints from the power marketing knowledge graph, and then performing semantic disambiguation on the triples of the business data to be confirmed based on these constraints. This yields several business triples of the business data to be processed, including: Obtain triple type constraints from the power marketing knowledge graph; If the triplet of the business to be confirmed satisfies the triplet type constraint of the power marketing knowledge graph, then the triplet of the business to be confirmed is used as the business triplet of the business data to be processed. If the triplet of the business to be confirmed does not meet the triplet type constraint of the power marketing knowledge graph, then several candidate triplets of the triplet of the business to be confirmed are obtained based on the power marketing knowledge graph; semantic disambiguation prompts are constructed based on the business data to be processed, the business entity words corresponding to the triplet of the business to be confirmed, and the candidate triplets; the semantic disambiguation prompts are input into the power marketing semantic big model so that the power marketing semantic big model can filter the candidate triplets to obtain the business triplet of the business data to be processed.

8. A knowledge graph update method based on a semantic large model as described in any one of claims 1 to 7, characterized in that, The incremental verification of the power marketing knowledge graph is performed based on the business triples to obtain the incremental verification result. The electricity marketing knowledge graph is updated based on the incremental verification results and the business triples, including: The power marketing knowledge graph is pre-updated based on a preset mounting algorithm and each of the business triples to generate a pre-updated power marketing knowledge graph. Based on the power marketing knowledge graph and the pre-updated power marketing knowledge graph, several entity nodes to be updated are identified. Obtain the first-order neighbor node set and the second-order neighbor node set of each entity node to be updated in the power marketing knowledge graph; Calculate the similarity score between the first set of first-order neighbor nodes and the second set of first-order neighbor nodes for each entity node to be updated, and obtain the incremental verification result; Based on the incremental verification results and the preset similarity threshold, the entity nodes to be updated are filtered to obtain a number of confirmed entity nodes to be updated. The electricity marketing knowledge graph is updated based on the confirmed update entity nodes.

9. The knowledge graph update method based on a semantic large model as described in claim 8, characterized in that, After updating the electricity marketing knowledge graph based on the confirmed update entity node, the following is also included: Based on the incremental verification results and the similarity threshold, the entity nodes to be updated are filtered to obtain several entity nodes to be judged. The entity nodes to be identified are corrected based on a preset expert model to obtain a fine-tuned training set; The large semantic model for electricity marketing is updated based on the fine-tuned training set.

10. A knowledge graph update system based on a semantic large model, characterized in that, include: The module includes a large semantic model generation module for electricity marketing, a coarse-grained entity segmentation processing module, a semantic input text construction module, a fine-grained entity extraction module, and an electricity marketing knowledge graph update module. The electricity marketing semantic big model generation module is used to obtain several knowledge graph triples of the electricity marketing knowledge graph; and to train the preset semantic big model based on the knowledge graph triples to generate the electricity marketing semantic big model. The coarse-grained entity segmentation processing module is used to acquire the business data to be processed, perform coarse-grained entity segmentation processing on the business data to be processed, and obtain several business entity texts of the business data to be processed. The semantic input text construction module is used to generate several prompt word texts of the power marketing knowledge graph based on the knowledge graph triples, and to construct several semantic input texts of the business data to be processed based on the business entity text and the prompt word texts. The fine-grained entity extraction module is used to perform fine-grained entity extraction on the semantic input text based on the power marketing semantic big model, and generate several business triples of the business data to be processed. The power marketing knowledge graph update module is used to perform incremental verification on the power marketing knowledge graph based on the business triples to obtain the incremental verification result; and to update the power marketing knowledge graph based on the incremental verification result and the business triples.