Power standard digitization method and system based on dynamic knowledge graph
By constructing a knowledge graph of power standards using dynamic knowledge graph technology, the problem of machine parsing of power low-carbon standards was solved, enabling efficient and adaptive data processing of power low-carbon standards and improving computational efficiency and system consistency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- STATE GRID SHANDONG ELECTRIC POWER CO
- Filing Date
- 2026-02-25
- Publication Date
- 2026-06-05
AI Technical Summary
Existing low-carbon power standards exist in the form of natural language text, which cannot be directly parsed by computers, resulting in low efficiency and subjective errors. There is a lack of machine-understandable correlation networks between standards, and the separation of data and business leads to cumbersome calculations, poor traceability, and the need for a large amount of human intervention to update parameters, making it difficult to ensure global consistency.
By employing dynamic knowledge graph technology, a power standard knowledge graph is constructed through text recognition, entity relationship recognition, and computational logic encapsulation. This enables the joint extraction of entities and relationships, automatically establishes a mapping relationship between data sources and the knowledge graph, forms a computational dependency tree, and automatically responds to business queries and external changes.
It improves the accuracy of entity and relationship recognition in power standard documents, significantly enhances computational efficiency, realizes intelligent querying and automatic calculation of power low-carbon standard data, reduces manual intervention, and ensures the system's adaptability and consistency.
Smart Images

Figure CN122153073A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent technology for low-carbon power management, and in particular to a method and system for digitizing power standards based on dynamic knowledge graphs. Background Technology
[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.
[0003] Low-carbon standards for electricity refer to a series of technical specifications, measurement methods, management requirements and evaluation criteria formulated and implemented to reduce carbon emissions throughout the entire life cycle of the power system (from power generation, transmission and distribution to power consumption).
[0004] Existing standards are mostly in the form of natural language text (PDF, DOC, etc.), which cannot be directly parsed, understood, and executed by computer programs. They rely heavily on human interpretation, introducing subjective errors and resulting in low efficiency. Furthermore, the terminology definitions, calculation methods, monitoring procedures, etc., in the standards are scattered across hundreds of national, industry, and local standards, lacking an explicit, machine-understandable network of connections between the standards, forming "information silos."
[0005] Meanwhile, business data such as economic, energy, and electricity are separated from standard terms, requiring manual searching and matching of data sources for each calculation, resulting in cumbersome processes and poor traceability. When key parameters such as carbon emission accounting methods and emission factors are updated, all downstream application systems (such as carbon accounting platforms and monitoring systems) require significant manpower for code-level modifications, which is time-consuming, costly, and makes it difficult to ensure global consistency. Summary of the Invention
[0006] To address the aforementioned issues, this invention proposes a method and system for digitizing power standards based on dynamic knowledge graphs. By integrating standards, data, and computational logic through knowledge graph technology, it enables the system to adaptively and automatically respond to business queries and external changes, thereby achieving the digitization of power standards.
[0007] In some implementations, the following technical solutions are adopted: A method for digitizing power standards based on dynamic knowledge graphs, comprising: Obtain relevant standard documents on low-carbon electricity from different sources, and perform text recognition on the standard documents; For the identified text, entities and entity relationships are automatically identified, and all entity pairs and their relationships are formalized into knowledge triples; Identify the complete computational logic from the triples and encapsulate it into an executable rule quadruple; place the rule quadruple under a predetermined calling relationship to form a computational dependency tree; Using entities as nodes and entity relationships as edges, combined with attribute information, a knowledge graph of power standards is constructed; based on semantic similarity, a mapping relationship between data fields in different data sources and concepts in the knowledge graph is automatically established. Based on the knowledge graph, computational dependency tree, and mapping relationships, in response to the computational goals proposed by the user, the computational path is automatically found, data is acquired, computation is performed, and results are returned.
[0008] As a further solution, for the identified text, entities are automatically identified, specifically: The sentences in the identified text are input into the pre-trained ELECTRA model to obtain the context representation vector of each word in the sentence; The context representation vector is labeled with conceptual and non-conceptual words through a fully connected layer and a CRF layer to identify the boundaries and types of all standard concepts; key concepts are selected as entities through conditional probability; the entities include target variables, activity data, emission factors, operational relationships, and units.
[0009] As a further solution, for the identified text, entity relationships are automatically identified, specifically: Record any two identified entities and From the encoded vector sequence Extract the vector representations corresponding to these two entities, and concatenate them by taking the first and last tags of their corresponding encoded vectors; The concatenated vector is input into a pre-trained relation classifier to obtain the entity. and The relationship between them.
[0010] As a further approach, the tasks of identifying entities and entity relationships are trained simultaneously within a unified joint loss function model; The joint loss function model is specifically as follows: ; in, The loss function for entity recognition represents the difference between the predicted entity label and the true label; For the relationship classification task, the loss function represents the difference between the predicted relationship category and the true category; and These are hyperparameters used to balance the importance of the two tasks; By common minimization In terms of total loss, when identifying an entity, the model subconsciously considers the relationships it may be involved in; when classifying relationships, it can also utilize more accurate entity boundary information.
[0011] As a further solution, the knowledge triple is specifically: ; in, Represents the entity as the subject. Let r represent the subjects as objects, and r be the classification of the relationships between them; The specific rule quadruple is as follows: ; in, For a set of concepts, For a set of relations, This is a set of axioms, that is, constraints that define concepts. This is a collection of instances, representing the processing results of previous power data.
[0012] As a further approach, the complete computational logic is identified from the triples and encapsulated into executable rule quadruples. The specific process is as follows: Identify computational expressions for the target variable from a set of related triples, including all dependencies, metadata, and units of computation results in the computational expressions; Based on the identified parameters, rules are assembled, and the rules include the calculation objective, the calculation expression, the dependent variables required for the calculation, the data source, and the unit of the calculation result.
[0013] As a further solution, a mapping relationship between data fields from different data sources and knowledge graph concepts is automatically established based on semantic similarity, specifically as follows: A virtual unified data view is created, through which data queries can be performed, while the actual data remains in their respective source systems; Map text descriptions and concept tags to vectors respectively. and Calculate their semantic similarity; If the semantic similarity is greater than a set threshold, a mapping relationship suggestion will be automatically provided.
[0014] In other embodiments, the following technical solutions are adopted: A digital system for power standards based on dynamic knowledge graphs, comprising: The data acquisition module is configured to acquire power low-carbon related standard documents from different sources and perform text recognition on the standard documents; The triplet construction module is configured to automatically identify entities and entity relationships in the identified text, and formalize all entity pairs and their relationships into knowledge triples. The quadruple construction module is configured to identify complete computational logic from triples and encapsulate it into executable rule quadruples; the rule quadruples are then placed under predetermined calling relationships to form a computational dependency tree; The knowledge graph construction module is configured to build a power standard knowledge graph using entities as nodes, entity relationships as edges, and attribute information; and to automatically establish mapping relationships between data fields in different data sources and knowledge graph concepts based on semantic similarity. The computation execution module is configured to automatically find the computation path, acquire data, perform computation, and return the result in response to the computation goal proposed by the user, based on the knowledge graph, computation dependency tree, and mapping relationship.
[0015] In other embodiments, the following technical solutions are adopted: A terminal device includes a processor and a memory, the processor being used to implement instructions; the memory being used to store multiple instructions adapted to be loaded and executed by the processor to implement the above-described method for digitizing power standards based on dynamic knowledge graphs.
[0016] In other embodiments, the following technical solutions are adopted: A computer-readable storage medium storing a plurality of instructions adapted for loading and execution by a processor of a terminal device of the above-described method for digitizing power standards based on dynamic knowledge graphs.
[0017] Compared with the prior art, the beneficial effects of the present invention are: (1) Compared with the traditional approach of first identifying entities and then identifying relationships, which cannot share the learned information and leads to error accumulation and poor recognition effect, this invention proposes a joint entity and relationship extraction model, that is, identifying entities and judging relationships at the same time, so that the two tasks help each other and learn together; when identifying entities, the model will "subconsciously" consider the relationships that they may participate in; when classifying relationships, it can also use more accurate entity boundary information; this information sharing greatly improves the overall recognition accuracy of entities and relationships in power standard documents.
[0018] (2) Since the extracted knowledge triples are flat and isolated, lacking hierarchical structure and unified semantic specifications, this invention aggregates and abstracts the basic triples into quadruples for rule execution. The construction process from knowledge triples to executable rule quadruples is essentially an elevation from declarative knowledge of "what" to procedural knowledge of "how". By placing the encapsulated quadruples under certain calling relationships, a computational dependency tree for the target variables in the low-carbon power standards can be formed. This enables the system to automatically deduce the complete computational path from basic data to target variables without manual coding, significantly improving computational efficiency.
[0019] (3) Based on the semantic similarity-based automatic mapping algorithm, this invention establishes a dynamic association between actual business data stored in various heterogeneous data sources and standard knowledge graphs, so that these data can be called according to the entities and relationships defined in the standard knowledge graph. When a new data source is accessed, there is no need to re-encode it. Only the mapping needs to be configured so that it can be recognized and used by the system. When the data source structure changes, only the mapping configuration needs to be updated, and all dependent calculations will automatically adapt, thereby realizing intelligent query and automatic calculation of power low-carbon related standard data.
[0020] Other features and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0021] Figure 1 This is a flowchart of the power standard digitization method based on dynamic knowledge graph in an embodiment of the present invention; Figure 2 This is a schematic diagram of the digital system architecture for power standards based on dynamic knowledge graphs in an embodiment of the present invention. Detailed Implementation
[0022] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of the invention. Unless otherwise specified, all technical and scientific terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0023] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0024] Example 1 In one or more embodiments, a method for digitizing power standards based on dynamic knowledge graphs is disclosed, combined with... Figure 1 Specifically, it includes the following processes: S101: Obtain power low-carbon related standard documents from different sources and perform text recognition on the standard documents.
[0025] In this embodiment, the text recognition process of the low-carbon power-related standard documents is implemented using existing technologies, such as OCR (Optical Character Recognition) technology.
[0026] S102: For the identified text, the entities and entity relationships are automatically identified, and all entity pairs and their relationships are formalized into knowledge triples.
[0027] Generally, low-carbon standards for electricity (such as national standards and industry standards) are text files in formats such as PDF and Word, which machines cannot directly understand. Therefore, it is necessary to automatically convert human-readable natural language text into structured knowledge that machines can understand and process.
[0028] Previous methods for this task typically employ a pipeline model, which involves first identifying all key entities in the text and then determining the relationships between these entities. Because the two steps are separate, errors from the first step are directly passed to the second, and the two models cannot share learned information, leading to error accumulation and poor performance.
[0029] Based on this, this embodiment proposes a joint entity and relation extraction model, which simultaneously identifies entities and determines relations, allowing the two tasks to help each other and learn together. The specific steps include: Sentences are segmented from the identified text. The ELECTRA model, which is pre-trained on large-scale text, is used to input sentences into the model. It generates a high-dimensional vector for each word (word or character) in the sentence. This vector is not independent; it contains information about the surrounding words. For example, the vectors of the words "emission" and "factor" in "emission factor" will influence each other.
[0030] ELECTRA is a pre-trained model based on a generator-discriminator structure. This model is computationally efficient and performs well in training Chinese.
[0031] Let the standard text sequence for inputting ELECTRA be: (1) in, This represents the i-th term (word or sub-word) in the standard text sequence; n is the total number of words or sub-words. A sub-word refers to a text representation unit between a word and a character, for example: original text: "electric grid emission factor", sub-words ["electric", "##grid", "emission", "##release", "cause", "##sub"].
[0032] Using ELECTRA as the encoder, the following context representation vector is obtained: (2) in, Let represent the vector of the i-th word, which is a vector composed of several numerical codes.
[0033] After encoding the standard text and obtaining the context vector, it is necessary to accurately identify the boundaries and types of all standard concepts. In this embodiment, the standard concepts refer to terms or objects with clear business meanings in the power low-carbon standard text.
[0034] Therefore, this embodiment uses the following BIOES annotation: B-XXX: The beginning of a concept, such as B-target variable; I-XXX: The middle part of a concept, such as I-target variable; E-XXX: The end of a concept, such as E-target variable; S-XXX: Concepts composed of single words; O: Non-conceptual term.
[0035] The specific implementation method is as follows: Sequence labeling is performed using a fully connected layer and a CRF (Conditional Random Field) layer to predict the entity type label for each word.
[0036] (3) in, It represents the entity label predicted for the i-th word (referring to the type of data or text, such as B-target variable or I-activity data, etc.). This represents the conditional probability, that is, given the entire sentence S, the entity label of the i-th word is... What is the probability of it? Arrange them according to the conditional probabilities and output the result with the highest probability. The CRF layer (Conditional Random Field) is a neural network layer used for sequence labeling tasks. The context represents a linear combination of vectors H.
[0037] Based on the above formula, it can be identified using conditional probability. In standard text, an entity is a key concept or object that has specific meaning and cannot be further divided. In the problem discussed in this embodiment, entities mainly include: (1) Target variable: The object we ultimately want to calculate or evaluate; for example: “total carbon emissions”, “carbon intensity”, “carbon efficiency level”.
[0038] (2) Activity data: Measurements of activities that generate carbon emissions, usually basic input data; for example: “net purchased electricity”, “natural gas consumption”, “output value”, “production output”.
[0039] (3) Emission factor: A coefficient that converts activity data into carbon emissions; for example: “grid average emission factor”, “natural gas emission factor”.
[0040] (4) Calculation method: verbs or nouns that represent operational relationships; for example: "multiply", "add", "sum".
[0041] (5) Unit: The unit of measurement for physical quantities; for example: "ton of carbon dioxide", "megawatt-hour", "ten thousand yuan".
[0042] For all identified entity pairs in the sentence, it is necessary to determine whether a predefined relationship exists between them (such as "calculated as", "component", "unit is"), etc.; denote any two identified entities and From the encoded vector sequence Extract the vector representations corresponding to these two entities, and concatenate them using the first and last tags of their corresponding encoded vectors to obtain: (4) in, and They represent and The encoded vector begins to be marked; and Then it is the end marker corresponding to the two entities.
[0043] Inputting the concatenated vector obtained from the above formula into a relation classifier (fully connected layer) yields: (5) in, Representing entities and The relationship between them, expressed in terms of conditional probability Given in the form of; For activation functions; These are the weight parameters for the fully connected layer; These are the drift parameters for the fully connected layer.
[0044] The entity recognition and entity relationship recognition processes described above can be trained to be executed automatically by an agent, but previous methods generally learned entity recognition and relationship classification separately. This embodiment does not execute them in the order of "entities first, then relationships," but instead trains these two tasks simultaneously within a unified joint loss function model.
[0045] Therefore, the following joint loss function model is constructed: (6) In the above formula, The loss function for entity recognition represents the difference between the predicted entity label and the true label; For the relationship classification task, the loss function represents the difference between the predicted relationship category and the true category; and It is a hyperparameter used to balance the importance of the two tasks.
[0046] By common minimization In terms of overall loss, when identifying an entity, the model subconsciously considers the relationships it might be involved in; when classifying relationships, it can also utilize more accurate entity boundary information. This information sharing greatly improves overall accuracy.
[0047] After the above steps, entities and their relationships are identified from the text. All entity pairs and their relationships are formalized into knowledge triples, denoted as: (7) in, Indicates the entity that acts as the "subject"; 'r' represents entities as "objects"; 'r' categorizes the relationships between them.
[0048] To facilitate understanding of the above process, an example is given below: Input text: "The enterprise's emissions are equal to net purchased electricity multiplied by the grid emission factor." Output triples: (Emissions in Scope 2 are calculated as net purchased electricity). (Emissions in Scope 2 are calculated as the power grid emission factor); (Net purchased electricity volume, calculation relationship, multiplied by grid emission factor); These triples can be directly stored in a graph database, forming the cornerstone of the knowledge graph for low-carbon electricity standards. All subsequent calculations, reasoning, and applications are built upon this structured knowledge network.
[0049] S103: Identify the complete computation logic from the triples and encapsulate it into an executable rule quadruple; place the rule quadruple under a predetermined calling relationship to form a computation dependency tree.
[0050] In the aforementioned steps, a large number of knowledge triples were extracted and stored. However, these triples are flat, isolated, and lack hierarchical structure and unified semantic specifications. The same concept may have different names in different standards (such as "purchased electricity" vs. "net purchased electricity"), and the same name may refer to different concepts.
[0051] Therefore, this embodiment aggregates and abstracts the basic triples into a quadruple representation for rule execution. In the knowledge graph, this quadruple is called an "ontology".
[0052] First, we construct the following formal definition for the ontology: (8) in, This is a collection of concepts (such as activity data, emission factors, and calculation formulas). For sets of relations (such as is_a("is a" or "belongs to"), part_of("is a part of..."), calculated_from("calculated from...")); It is a set of axioms, that is, the constraints that define the concepts; This is a set of instances, which consists of previous power data processing results, and can be used for training.
[0053] The process of building from knowledge triples to executable rule quadruples is essentially a sublimation from declarative knowledge of "what" to procedural knowledge of "how".
[0054] The following is a complete example to demonstrate this conversion: (1) Suppose the following set of relevant triples is extracted from the standard text: ①(Emissions in Scope 2, calculated as net purchased electricity × grid emission factor); ②(Net purchased electricity, in megawatt-hours); ③ (Grid emission factor, unit is tons of carbon dioxide / megawatt-hour); ④ (Grid emission factor, 2023 value, 0.5810); ⑤ (Grid emission factor, 2024 value, 0.5703); ⑥ (Total carbon emissions of enterprises are calculated as: emissions from Scope 1 + emissions from Scope 2 + emissions from Scope 3); ⑦ (Corporate carbon intensity, calculated as total corporate carbon emissions / total corporate output value); ⑧ (Total output value of the enterprise, in ten thousand yuan).
[0055] At this point, this knowledge is still a flat, loosely connected collection of fragments; the computer knows these facts, but does not yet know how to use them systematically for computation.
[0056] (2) Based on domain knowledge, construct an ontology to classify and organize these entities. The following is a pseudocode example: #Ontology Class Definition Class: Target variable SubClass: Emissions SubClass: Range Two Emissions SubClass: Total corporate carbon emissions SubClass: Strength Index SubClass: Corporate Carbon Intensity Class: Activity Data SubClass: Net Purchased Electricity SubClass: Total Enterprise Output Class: Emission Factor SubClass: Grid Emission Factor Class: Calculation Rules Property: hasInput (Property: Has Input) Property: hasOutput (Property: produces output) Property: hasExpression (Property: has an expression) Through the entity itself, we can know that: In Scope 2, emissions, total corporate carbon emissions, and corporate carbon intensity are all target variables; net purchased electricity and total corporate output are activity data; and grid emission factor is an emission factor.
[0057] (3) Rule recognition and quadruple generation: The complete computational logic is identified from loose triples and encapsulated into executable rule quadruples. Taking the target variable "range-two emission" as an example, the specific process is as follows: (3-1) Calculation expression for identifying the target variable: From the ternary set ① (range two emissions, calculated as net purchased electricity × grid emission factor), the expression can be extracted as: net purchased electricity × grid emission factor.
[0058] (3-2) Identify all dependencies: By traversing the graph, it was found that calculating "range two emissions" requires net purchased electricity (activity data) and grid emission factor (emission factor).
[0059] (3-3) Identify metadata: Unit: From the ternary set ② and ③, we know that the unit of the calculation result should be tons of carbon dioxide (derived through unit derivation: megawatt-hour × (tons of carbon dioxide / megawatt-hour) = tons of carbon dioxide). Data source: Recorded from the original standard; Version information: From triples ④ and ⑤, we know that there are multiple versions of the emission factor.
[0060] (3-4) Rule assembly: After the above steps, "Range Two Emissions" can be constructed in the following code form (Python): Rule_Scope2 = { Target (Calculation Objective): "Range Two Emissions" Expression: "lambda: Net purchased electricity" Grid emission factor", # Executable lambda function Dependencies: ["Net external purchases", "Grid emission factor"], Metadata: { Source: "GB / T 32150-2015, Clause X", Unit: "tons of carbon dioxide" Description: "Calculate indirect emissions for enterprise scope two", version_sensitive: True # Marks this rule as sensitive to emission factor versions. }}.
[0061] Following the steps above, similar four-tuple rules can be constructed for other target variables such as "corporate total carbon emission rules" and "corporate carbon intensity rules," as shown in the following example: Corporate carbon emission control rules: Rule_TotalEmission = { Target: "Total corporate carbon emissions", Expression: "lambda: Range 1 emissions + Range 2 emissions + Range 3 emissions", Dependencies: ["Emissions in Scope 1", "Emissions in Scope 2", "Emissions in Scope 3"], Metadata: {...}} Corporate carbon intensity rules: Rule_CarbonIntensity = { Target: "Corporate Carbon Intensity", Expression: "lambda: Total carbon emissions of the enterprise / Total output value of the enterprise", Dependencies: ["Total carbon emissions of the enterprise", "Total output value of the enterprise"], Metadata: { unit: "tons of carbon dioxide / 10,000 yuan" ... }} (3-5) Establish the calling relationship: The encapsulated four-in-one rules are placed under a certain calling relationship to form the following computation chain: Rule_CarbonIntensity depends on the company's total carbon emissions and total output value; The total carbon emissions of an enterprise are calculated using Rule_TotalEmission; Rule_TotalEmission also depends on range two emissions; The emissions in Scope 2 are calculated using Rule_Scope2; This results in the following computational dependency tree: Corporate carbon intensity ├── Total Carbon Emissions of Enterprises (Rule_TotalEmission) │├── Range 1 (likely basic data) │├── Scope 2 (Rule_Scope2) ││├── Net Purchased Electricity (Basic Data) ││└── Power Grid Emission Factors (Basic Data, with Version) │└── Range 3 emissions (possibly basic data) └── Total Enterprise Output (Basic Data) Through the above systematic steps, we successfully transformed the messy triple "data" into a well-structured ontology "pattern", laying a solid foundation for subsequent knowledge reasoning and application.
[0062] The completed quadruple takes the following form: O=(C,R,A,I) # Concepts, relations, axioms, and examples; in: C = {Target variable, Activity data, Emission factor, Unit, Industry classification, ...} R={ 'isCalculatedFrom': (Target variable → Activity data | Emission factor) 'hasUnit': (Activity Data | Emission Factor → Unit) 'hasValue': (emission factor → numerical value) 'isSubclassOf': (Concept → Concept) 'belongsToIndustry': (Company → Industry Classification) A = { 'Target variable isCalculatedFrom.(Activity Data) Emission factor)', 'Activity Data' =1 hasUnit.unit, 'emission factor' =1 hasUnit.unit, 'isSubclassOf isSubclassOf isSubclassOf'# transitivity} I = {} # The collection of instances will be populated at runtime.
[0063] This embodiment constructs an executable rule quadruple and places the rule quadruple under a predetermined calling relationship to form a computation dependency tree. The system automatically derives the complete computation chain based on the dependency tree. Business personnel can define computation rules through the configuration interface, which is convenient for operation and maintenance, and at the same time enables the system to have complete traceability capabilities.
[0064] S104: Construct a power standard knowledge graph by using entities as nodes, entity relationships as edges, and attribute information; automatically establish the mapping relationship between data fields in different data sources and knowledge graph concepts based on semantic similarity.
[0065] Traverse all triples and store the constructed ontology in the Neo4j graph database, using the following storage method: Nodes: Represent entities (such as net purchased electricity, grid emission factor).
[0066] Edge: Represents a relationship (such as isCalculatedFrom, hasUnit).
[0067] Attributes: Key-value pairs attached to nodes and edges (e.g., unit="MWh", version="2023").
[0068] At this point, a complete digital knowledge graph of low-carbon electricity standards has been built, which can be used for further model training and the construction of specialized modules.
[0069] Based on the constructed standard knowledge graph, a unified semantic framework is built. However, actual business data is stored in various heterogeneous data sources. How to enable this data to be used according to the concepts and relationships defined in the standard knowledge graph is the problem that this step solves.
[0070] First, a virtual unified data view is created using Apache (a web server software), which users or application systems can query as if it were a single database, while the actual data behind it remains in their respective source systems.
[0071] We introduce declarative semantic mapping, which allows us to declare the relationship between data fields and knowledge graph concepts through configuration. Below is an example of configuring a mapping (YAML format): # Data source definition: data_sources - id: "power_system_db" Type: "MySQL" connection: "jdbc:mysql: / / ..." Description: "Power Data Acquisition System Database" # Field mappings to ontology: - data_source: "power_system_db" table: "t_enterprise_power field: "purchase_elec" # The field name in the database concept: "Net externally purchased electricity" # Standard concept in knowledge graph transformation: "value / 1000" # Conversion rule: Convert kilowatt-hours to megawatt-hours unit: "MWh"# Target unit confidence: 0.92# Confidence level of auto-mapping.
[0072] To make the process of configuring mapping relationships intelligent, this embodiment uses an automatic mapping algorithm based on semantic similarity to automatically establish mapping relationships, as follows: Models such as Sentence-BERT (a model specifically designed to generate high-quality, semantic "sentence vectors" for sentences and short texts) are used to map text descriptions (such as the field annotation "enterprise annual natural gas consumption (cubic meters)" and the concept label "natural gas consumption") into vectors. and Their semantic similarity is calculated using the following formula: (9) in, Represent the modulus of a vector; set a threshold. (e.g., 0.8), when: (10) AI automatically provides mapping suggestions, and administrators only need to click "Confirm" or "Adjust" on the graphical interface.
[0073] The mapping process can be formally represented as: Map: (DataSource, Table, Field) → (OntologyConcept, Transformation, Metadata)(11) This formula defines a mapping rule that automatically converts the fields of the original data table into standardized concepts in the knowledge graph, along with the necessary computational transformations and metadata descriptions.
[0074] (DataSource, Table, Field) indicates which database, table, and field the data comes from; (OntologyConcept, Transformation, Metadata) indicates which standard concept in the knowledge graph corresponds to and what kind of computational transformation (such as unit conversion) is required.
[0075] Here, DataSource represents the data source identifier; Table and Field are the table name and field name, respectively; OntologyConcept is the concept URI in the knowledge graph; Transformation represents the data transformation function; and Metadata represents metadata such as quality, unit, and update frequency.
[0076] To make the processes, methods, and practical applications in this section easier to understand, a practical application example is provided below: Scenario: Calculate the carbon intensity of a steel company.
[0077] The following is the implementation process: (1) Receiving requests: The rules engine needs to calculate the carbon intensity of company A.
[0078] (2) Dependency analysis: The knowledge graph shows that carbon intensity depends on the total carbon emissions of enterprises and the total output value of enterprises.
[0079] (3) Data mapping: The total carbon emissions of enterprises are mapped to the calculation result of (scope1_emission + scope2_emission); The company's total output value is mapped to economic_db.t_company_output.output_value.
[0080] (4) Data acquisition: Automatically acquire the required data from the corresponding data source through a unified data view.
[0081] (5) Calculation execution: The rule engine uses the acquired data to perform calculations.
[0082] S105: Based on the knowledge graph, computation dependency tree, and mapping relationship, in response to the computation goal proposed by the user, automatically find the computation path, obtain data, perform computation, and return the result.
[0083] Based on the constructed knowledge graph and mapped data, we need the system to automatically find the computation path, acquire data, perform computation, and return the results, realizing "query is computation"—users only need to propose the computation goal.
[0084] Therefore, this embodiment proposes a depth-first dependency resolution algorithm. To make the logic and process of this algorithm easy to understand, the knowledge graph is first defined as a directed graph: (12) Where V is the set of vertices, representing all conceptual entities; It is a set of edges, representing the relationships between entities.
[0085] The computation rules in a directed graph can be defined as a quadruple, specifically: (13) in, It is the target variable; Represents a computational function; It is a set of dependency variables of length n; This represents a collection of metadata, such as the source, unit, and version of the data.
[0086] A computational chain is a finite sequence, denoted as: (14) The elements This represents one of the following operations: ① Data acquisition operation: (15) in, This indicates that the data is being called to a function; It is a leaf node; Indicates the context identifier.
[0087] ② Calculation operations: (16) Given target node And context ctx, generate computation chain The process is defined as:
[0088]
[0089]
[0090]
[0091]
[0092]
[0093] (17) This code describes a recursive algorithm that starts from the target node and resolves the dependencies layer by layer until all the underlying data sources are found, thereby automatically generating a complete sequence of computational steps (computation chain) executed in the correct order.
[0094] in, This indicates a sequence concatenation operation; Indicates judgment Is it a leaf node? Indicates obtaining The calculation rules; This indicates that the computation chain is being optimized.
[0095] The core rules of the above computational chain include: Rule 1: The rules for calculating emissions in Scope 2 are as follows: (18) in, Indicates carbon dioxide emissions; Indicates the range of two emission calculation functions; This represents net external purchases of electricity. This represents the power grid emission factor.
[0096] Rule 2: Total carbon emissions of enterprises: (19) in, A function to calculate the total carbon emissions of a company; This represents the calculated emissions for range i.
[0097] Rule 3: Corporate Carbon Intensity: (20) in, Indicates carbon emission intensity; The function representing the calculation of carbon emission intensity; It represents the company's total output value.
[0098] After setting the core rules, the semantics of the execution context are defined as follows: (twenty one) The above expression means assigning values to variables, that is, mapping numerical values to vertices, where Represents the real number field; This indicates that the value is undefined.
[0099] Simultaneously, operational semantics are defined, with the execution effect of each operation in the computation chain defined as a state transition, where the data acquisition operation is defined as... (twenty two) In the above formula, This represents the program state, that is, a mapping from variables to values, within the computation context. It contains the current values of all variables; Indicates a binding relationship. Indicates the variable Mapping to value ,in This indicates that the value of variable v is retrieved from the data source.
[0100] The definition of a computational operation is: (twenty three) in, A function that assigns program state values to a sequence of dependent variables.
[0101] According to the above definition, given and initial context The computation chain performs the following operations:
[0102]
[0103]
[0104]
[0105]
[0106]
[0107]
[0108] ; This code executes each step in the computation chain sequentially: first, it retrieves the data, then performs the computation, gradually updates the context environment, and finally returns the environment variable ctx containing all the computation results.
[0109] For ease of understanding, the following is an example of algorithm execution: For example, to query "Calculate the carbon intensity of Company A": 1. Start: Target node = Enterprise carbon intensity.
[0110] 2. Resolve dependencies: Corporate carbon intensity depends on both total corporate carbon emissions and total corporate output. Recursively analyze the total carbon emissions of enterprises: The total carbon emissions of enterprises depend on emissions from Scope I, Scope II, and Scope III. Recursive analysis range two: Scope 2 emissions depend on net purchased electricity and grid emission factor; Net purchased electricity is a leaf node; add a data acquisition operation. The power grid emission factor is a leaf node; add a data acquisition operation. Add range two emission calculation operation; Add an operation to calculate total corporate carbon emissions; The company's total output value is the leaf node; add a data retrieval operation.
[0111] 3. Add target calculation: Add enterprise carbon intensity calculation operation.
[0112] The computational chain sequence generated by the above process is as follows: DataFetch (Net Purchased Electricity, Company A, 2023); DataFetch (Grid Emission Factor, 2023 Version); Calculation (Range 2 Emissions = Net Purchased Electricity × Grid Emission Factor); DataFetch (Scope 1, Company A, 2023); DataFetch (Scope 3 Emissions, Company A, 2023); Calculation (Total carbon emissions of an enterprise = Range 1 + Range 2 + Range 3); DataFetch(Company Total Output, Company A, 2023); Calculation (Corporate carbon intensity = Total corporate carbon emissions / Total corporate output).
[0113] Through the above steps, this embodiment constructs a complete digital method and system for low-carbon standards in the power industry, including knowledge graph generation, knowledge fusion, data and relationship mapping, intelligent query and calculation. The method in this embodiment not only has significant technological innovation, but also shows outstanding advantages in terms of practicality, economy and social benefits, providing strong technical support for the power industry and even the whole society to achieve the goal of carbon peaking and carbon neutrality.
[0114] Example 2 In one or more embodiments, a power standard digitization system based on dynamic knowledge graphs is disclosed, combined with... Figure 2 Specifically, it includes: The data acquisition module is configured to acquire power low-carbon related standard documents from different sources and perform text recognition on the standard documents; The triplet construction module is configured to automatically identify entities and entity relationships in the identified text, and formalize all entity pairs and their relationships into knowledge triples. The quadruple construction module is configured to identify complete computational logic from triples and encapsulate it into executable rule quadruples; the rule quadruples are then placed under predetermined calling relationships to form a computational dependency tree; The knowledge graph construction module is configured to build a power standard knowledge graph using entities as nodes, entity relationships as edges, and attribute information; and to automatically establish mapping relationships between data fields in different data sources and knowledge graph concepts based on semantic similarity. The computation execution module is configured to automatically find the computation path, acquire data, perform computation, and return the result in response to the computation goal proposed by the user, based on the knowledge graph, computation dependency tree, and mapping relationship.
[0115] It should be noted that the specific implementation methods of the above modules are exactly the same as those in Example 1, and will not be described in detail again.
[0116] Example 3 In one or more embodiments, a terminal device is disclosed, comprising a processor and a memory, the processor being used to implement instructions; the memory being used to store multiple instructions adapted to be loaded by the processor and executed by the processor for the power standard digitization method based on dynamic knowledge graph in Embodiment 1.
[0117] It should be understood that in this embodiment, the processor can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.
[0118] Memory may include read-only memory and random access memory, and provides instructions and data to the processor. A portion of memory may also include non-volatile random access memory. For example, memory may also store information about the device type.
[0119] In the implementation process, each step of the above method can be completed by the integrated logic circuits in the processor hardware or by software instructions.
[0120] Example 4 In one or more embodiments, a computer-readable storage medium is disclosed, wherein a plurality of instructions are stored, the instructions being adapted to be loaded and executed by a processor of a terminal device for the power standard digitization method based on dynamic knowledge graphs in Embodiment 1.
[0121] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.
Claims
1. A method for digitizing power standards based on dynamic knowledge graphs, characterized in that, include: Obtain relevant standard documents on low-carbon electricity from different sources, and perform text recognition on the standard documents; For the identified text, entities and entity relationships are automatically identified, and all entity pairs and their relationships are formalized into knowledge triples; Identify the complete computational logic from the triples and encapsulate it into an executable rule quadruple; place the rule quadruple under a predetermined calling relationship to form a computational dependency tree; Using entities as nodes and entity relationships as edges, combined with attribute information, a knowledge graph of power standards is constructed. Automatically establish mapping relationships between data fields in different data sources and knowledge graph concepts based on semantic similarity; Based on the knowledge graph, computational dependency tree, and mapping relationships, in response to the computational goals proposed by the user, the computational path is automatically found, data is acquired, computation is performed, and results are returned.
2. The method for digitizing power standards based on dynamic knowledge graphs as described in claim 1, characterized in that, For the identified text, entities are automatically identified, specifically: The sentences in the identified text are input into the pre-trained ELECTRA model to obtain the context representation vector of each word in the sentence; The context representation vector is labeled with conceptual and non-conceptual words through a fully connected layer and a CRF layer to identify the boundaries and types of all standard concepts; key concepts are selected as entities through conditional probability; the entities include target variables, activity data, emission factors, operational relationships, and units.
3. The method for digitizing power standards based on dynamic knowledge graphs as described in claim 1, characterized in that, For the identified text, entity relationships are automatically determined, specifically: Record any two identified entities and From the encoded vector sequence Extract the vector representations corresponding to these two entities, and concatenate them by taking the first and last tags of their corresponding encoded vectors; The concatenated vector is input into a pre-trained relation classifier to obtain the entity. and The relationship between them.
4. The method for digitizing power standards based on dynamic knowledge graphs as described in claim 1, characterized in that, The task of identifying entities and entity relationships is trained simultaneously within a unified joint loss function model; The joint loss function model is specifically as follows: ; in, The loss function for entity recognition represents the difference between the predicted entity label and the true label; For the relationship classification task, the loss function represents the difference between the predicted relationship category and the true category; and These are hyperparameters used to balance the importance of the two tasks; By common minimization In terms of total loss, when identifying an entity, the model subconsciously considers the relationships it may be involved in; when classifying relationships, it can also utilize more accurate entity boundary information.
5. The method for digitizing power standards based on dynamic knowledge graphs as described in claim 1, characterized in that, The knowledge triple is specifically: ; in, Represents the entity as the subject. Let r represent the subjects as objects, and r be the classification of the relationships between them; The specific rule quadruple is as follows: ; in, For a set of concepts, For a set of relations, This is a set of axioms, that is, constraints that define concepts. This is a collection of instances, representing the processing results of previous power data.
6. The method for digitizing power standards based on dynamic knowledge graphs as described in claim 1, characterized in that, The complete computational logic is identified from the triples and encapsulated into executable rule quadruples. The specific process is as follows: Identify computational expressions for the target variable from a set of related triples, including all dependencies, metadata, and units of computation results in the computational expressions; Based on the identified parameters, rules are assembled, and the rules include the calculation objective, the calculation expression, the dependent variables required for the calculation, the data source, and the unit of the calculation result.
7. The method for digitizing power standards based on dynamic knowledge graphs as described in claim 1, characterized in that, Automatically establish mapping relationships between data fields from different data sources and knowledge graph concepts based on semantic similarity, specifically: A virtual unified data view is created, through which data queries can be performed, while the actual data remains in their respective source systems; Map text descriptions and concept tags to vectors respectively. and Calculate their semantic similarity; If the semantic similarity is greater than a set threshold, a mapping relationship suggestion will be automatically provided.
8. A digital system for power standards based on dynamic knowledge graphs, characterized in that, include: The data acquisition module is configured to acquire power low-carbon related standard documents from different sources and perform text recognition on the standard documents; The triplet construction module is configured to automatically identify entities and entity relationships in the identified text, and formalize all entity pairs and their relationships into knowledge triples. The quadruple construction module is configured to identify complete computational logic from triples and encapsulate it into executable rule quadruples; the rule quadruples are then placed under predetermined calling relationships to form a computational dependency tree; The knowledge graph construction module is configured to construct a power standard knowledge graph using entities as nodes, entity relationships as edges, and attribute information. Automatically establish mapping relationships between data fields in different data sources and knowledge graph concepts based on semantic similarity; The computation execution module is configured to automatically find the computation path, acquire data, perform computation, and return the result in response to the computation goal proposed by the user, based on the knowledge graph, computation dependency tree, and mapping relationship.
9. A terminal device comprising a processor and a memory, the processor for implementing instructions; the memory for storing multiple instructions, characterized in that, The instructions are adapted to be loaded by a processor and executed as described in any one of claims 1-7, the method for digitizing power standards based on dynamic knowledge graphs.
10. A computer-readable storage medium storing a plurality of instructions, characterized in that, The instructions are adapted to be loaded and executed by the processor of a terminal device using the power standard digitization method based on any one of claims 1-7.