Electric energy meter operation abnormity knowledge graph construction method and related device
By constructing a knowledge graph of electricity meter operation anomalies, the problems of scattered and unstructured data storage in traditional electricity meter anomaly diagnosis are solved, achieving efficient and accurate anomaly diagnosis and cross-source data integration, thereby improving operation and maintenance efficiency and user experience.
Patent Information
- Application Number
- CN202511746454.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-25
- Publication Date
- 2026-02-27
AI Technical Summary
Traditional electricity meter anomaly diagnosis relies on manual experience and decentralized data querying, which has problems such as scattered data storage, unstructured historical experience, low diagnostic efficiency, and difficulty in cross-database querying, resulting in high operation and maintenance costs and low diagnostic efficiency.
A knowledge graph of abnormal operation of electricity meters is constructed. Multi-source heterogeneous data is preprocessed, and a pre-trained entity relation extraction model is used to determine relation triples, generate descriptive text and encode it into embedding vectors, and store it in an efficient indexed vector database to form a complete relation network.
It has achieved more precise and efficient diagnosis of electricity meter anomalies, improved diagnostic accuracy, semantic retrieval efficiency, and cross-source data integration efficiency, and enhanced user experience.
Smart Images

Figure CN121579700A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power operation and maintenance technology, and in particular to a method and related apparatus for constructing a knowledge graph of abnormal operation of electricity meters. Background Technology
[0002] With the comprehensive advancement of smart grid construction, electricity meters, as the core terminal equipment for power metering and operation and maintenance, directly affect the fairness of power trading, the efficiency of grid operation and maintenance, and the user's electricity experience. Currently, my country has a huge number of electricity meters of various types, which are susceptible to environmental interference, equipment aging, wiring errors, and other factors during operation, resulting in various typical faults such as voltage loss, phase loss, current loss, and abnormal power factor. Traditional electricity meter anomaly diagnosis relies on manual experience and decentralized data queries, which has the following pain points: operation and maintenance data is scattered across multiple heterogeneous platforms such as archive systems, rule bases, and work order systems, lacking unified correlation; historical operation and maintenance experience is mostly stored in unstructured text form, making it difficult to structure and reuse, resulting in high training costs for new operation and maintenance personnel; anomaly diagnosis requires cross-database queries, making it impossible to quickly locate the cause and provide handling suggestions, leading to low diagnostic efficiency. Summary of the Invention
[0003] This application provides a method and related apparatus for constructing a knowledge graph of abnormal operation of electricity meters, which can construct a complete relationship network of the knowledge graph of abnormal operation of electricity meters, and realize the accuracy and efficiency of electricity meter abnormality diagnosis.
[0004] In a first aspect, embodiments of this application provide a method for constructing a knowledge graph of electricity meter malfunctions, including: Acquire multi-source heterogeneous data and perform data preprocessing based on the multi-source heterogeneous data to obtain standard data. The multi-source heterogeneous data is used to characterize the data associated with the electricity meter and comes from at least one platform. Determine relation triples based on a pre-trained entity relation extraction model and the standard data; Construct multiple node statements based on the entity device information and corresponding relationship information, determine the association relationship based on the relationship triples, and determine the knowledge graph network based on the multiple node statements and the association relationship; Descriptive text is generated for the knowledge graph network, and the descriptive text is encoded into embedding vectors using a pre-trained vector model and stored in a vector database with efficient indexing to obtain the knowledge graph of the energy meter's abnormal operation.
[0005] In one possible embodiment, the construction of multiple node statements based on the entity device information and corresponding relationship information includes: The constructed ontology graph structure; Based on the ontology graph structure and the entity device information and corresponding relationship information, entity device nodes and situation nodes are mapped; The query statement is determined based on the entity device node and the situation node and a standardized query statement template, wherein the query statement template includes node labels and attribute fields; Based on the query statement and the first constraint condition, determine the first verification result of the constraint verification; The node statement is determined based on the verification result.
[0006] In one possible embodiment, the first constraint includes a uniqueness constraint and / or a range constraint and / or a logical association constraint. The determination of the constraint validation result based on the query statement and constraints includes: The uniqueness verification result is determined based on the query statement and the uniqueness constraint; and / or, Determine the value range verification result based on the query statement and the value range constraints; and / or, The logical verification result is determined based on the query statement and the logical association constraints; and / or, The first verification result is determined based on the uniqueness verification result and / or the value range verification result and / or the logical verification result.
[0007] In one possible embodiment, determining the association relationship based on the relation triplet includes: By matching the unique identifiers of the nodes in memory or in the database, the node objects of the relationship are parsed out. Based on the parsed node objects and the relation types in the triples; Determine the second verification result of the constraint verification based on the relationship type and the second constraint condition; The association is determined based on the verification results.
[0008] In one possible embodiment, the second constraint includes relational logic constraints and / or relational attribute constraints; The determination of the second verification result of the constraint verification based on the relationship type and the second constraint condition includes: The relation logic verification result is determined based on the relation type and the relation attribute constraints; and / or, The relation attribute validation result is determined based on the relation type and the relation attribute constraints. The second verification result is determined based on the relational logic verification result and / or the relational attribute verification result.
[0009] In one possible embodiment, generating descriptive text for the knowledge graph network, encoding the descriptive text into embedding vectors using a pre-trained vector model, and storing it in a vector database with efficient indexing to obtain the knowledge graph of the electricity meter's operational anomaly includes: A first description text is generated based on the entity device information, and the first description text includes the core attribute keys and attribute values of the entity type. A second descriptive text is generated based on the relationship information. The second descriptive text includes a head entity identifier, a relationship type, a tail entity identifier, and relationship attributes. The embedding vectors are obtained by batch encoding the first and second descriptive texts using a pre-trained vector model. The embedded vectors are stored in the vector database with efficient indexes; Construct an IVF_FLAT index for the vector database with the high efficiency index; By establishing a mapping relationship between vector IDs and unique attributes of entities in the knowledge graph, the knowledge graph of the abnormal operation of the energy meter is obtained, so as to realize the linkage between vector retrieval and graph query.
[0010] In one possible embodiment, the relation triple includes an association path of at least one of the following: manufacturer, production batch, electricity meter, anomaly type, anomaly rule, possible cause, handling suggestion, and historical operation and maintenance record.
[0011] Secondly, embodiments of this application provide a device for constructing a knowledge graph of electricity meter malfunctions, comprising: The acquisition module is used to acquire multi-source heterogeneous data and perform data preprocessing based on the multi-source heterogeneous data to obtain standard data. The multi-source heterogeneous data is used to characterize the data associated with the electricity meter and the multi-source heterogeneous data comes from at least one platform. The first determining module is used to determine relation triples based on a pre-trained entity relation extraction model and the standard data. The second determining module is used to construct multiple node statements based on the entity device information and the corresponding relationship information, and to determine the association relationship based on the relationship triples, and to determine the knowledge graph network based on the multiple node statements and the association relationship; The knowledge graph construction module is used to generate descriptive text for the knowledge graph network, encode the descriptive text into embedding vectors using a pre-trained vector model, and store them in a vector database with efficient indexing to obtain the knowledge graph of the electricity meter's abnormal operation.
[0012] Thirdly, embodiments of this application provide a computer-readable storage medium storing a knowledge graph construction program for abnormal operation of an electricity meter. The knowledge graph construction program for abnormal operation of an electricity meter includes execution instructions. When a processor executes the execution instructions stored in the memory, the processor performs some or all of the steps described in the first aspect.
[0013] Fourthly, embodiments of this application provide an electronic device, including a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and when the processor executes the one or more programs, the processor executes some or all of the instructions of the steps described in the first aspect of the embodiments of this application.
[0014] Fifthly, embodiments of this application provide a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps described in the first aspect of embodiments of this application. The computer program product may be a software installation package.
[0015] By implementing the embodiments of this application, multi-source heterogeneous data is acquired, and data preprocessing is performed based on the multi-source heterogeneous data to obtain standard data. The multi-source heterogeneous data is used to characterize data associated with the electricity meter, and the multi-source heterogeneous data originates from at least one platform. Relationship triples are determined based on a pre-trained entity relationship extraction model and the standard data. Multiple node statements are constructed based on the entity device information and corresponding relationship information. Relationships are determined based on the relationship triples, and a knowledge graph network is determined based on the multiple node statements and the relationships. Descriptive text is generated for the knowledge graph network, and the descriptive text is encoded into embedding vectors using a pre-trained vector model and stored in a vector database with efficient indexing to obtain the electricity meter operation anomaly knowledge graph. In this way, a complete relationship chain network can be formed, improving diagnostic accuracy, semantic retrieval efficiency, cross-source data integration operation and maintenance efficiency, and user experience. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the background art, the accompanying drawings used in the embodiments of the present invention or the background art will be described below.
[0017] Figure 1 This is a schematic diagram of the architecture of a knowledge graph construction system for abnormal operation of electricity meters provided in an embodiment of this application; Figure 2 This is a flowchart illustrating the first method for constructing a knowledge graph of abnormal operation of an energy meter provided in this application embodiment; Figure 3 This is a flowchart illustrating the second method for constructing a knowledge graph of abnormal electricity meter operation provided in this application embodiment; Figure 4 This is a flowchart illustrating the third method for constructing a knowledge graph of abnormal electricity meter operation provided in this application embodiment; Figure 5 This is a flowchart illustrating the fourth method for constructing a knowledge graph of abnormal electricity meter operation proposed in this application embodiment; Figure 6 This is a flowchart illustrating the fifth method for constructing a knowledge graph of abnormal electricity meter operation provided in this application embodiment; Figure 7 This is a schematic diagram of the structure of a knowledge graph construction device for abnormal operation of an electricity meter provided in an embodiment of this application; Figure 8 This is a schematic diagram of another device for constructing a knowledge graph of an abnormal operation of an electricity meter provided in an embodiment of this application; Figure 9 This is a schematic diagram of the structure of an electronic device proposed in an embodiment of this application. Detailed Implementation
[0018] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0019] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or electronic device that includes a series of steps or units is not limited to the listed steps or units, but in an alternative example also includes steps or units not listed, or in an alternative example also includes other steps or units inherent to these processes, methods, products, or electronic devices.
[0020] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0021] With the comprehensive advancement of smart grid construction, electricity meters, as core terminal equipment for power metering and operation and maintenance, directly affect the fairness of power trading, the efficiency of grid operation and maintenance, and the user's electricity experience. Currently, my country has a huge number of electricity meters of various types, such as three-phase four-wire, three-phase three-wire, and single-phase. During operation, they are susceptible to environmental interference, equipment aging, wiring errors, and other factors, resulting in various typical faults such as voltage loss, phase loss, current loss, and abnormal power factor. Traditional electricity meter anomaly diagnosis relies on manual experience and decentralized data queries, which has the following pain points: operation and maintenance data is scattered across multiple heterogeneous platforms such as archive systems, rule bases, and work order systems, lacking unified correlation; historical operation and maintenance experience is mostly stored in unstructured text form, making it difficult to structure and reuse, leading to high training costs for new operation and maintenance personnel; anomaly diagnosis requires cross-database queries, making it difficult to quickly locate the cause and provide handling suggestions, resulting in low diagnostic efficiency. Therefore, by leveraging knowledge graph technology and the semantic understanding capabilities of large-scale models, a complete relational network of a knowledge graph for electricity meter operation anomalies can be constructed by integrating multi-source heterogeneous data, thereby achieving more accurate and efficient diagnosis of electricity meter anomalies. Currently, relevant technologies in the field of electricity meter operation anomaly management include: anomaly judgment through preset threshold rules, with the rules stored in a relational database. This method only supports simple conditional queries, and the rules need to be manually written one by one, resulting in high maintenance costs and poor flexibility; relying on maintenance experts to manually compile anomaly causes and handling suggestions into structured documents. This process is time-consuming and influenced by subjective experience; using keyword matching to query anomaly information cannot handle complex scenarios such as synonyms and semantic associations, and cannot accurately locate relevant key information; some studies have constructed binary relational graphs, with entity types only including electricity meters and anomaly types, making it impossible to trace deep relationships such as the concentrated occurrence of a certain type of fault in meters of the same batch. This leads to the following technical problems: incomplete relationship chains, making it impossible to trace the quality of meters of the same specifications and analyze similar faults in batches; insufficient knowledge extraction accuracy, relying on manual or simple algorithms to extract abnormal rules and handling suggestions, making it difficult to handle fuzzy expressions in unstructured work orders, resulting in the inability to correctly match abnormal rules; weak cross-source data integration: due to the large differences in the formats of multi-source data information such as meter file information, abnormal operation rule library, and historical operation and maintenance work order records, cross-database operation queries are involved in abnormal diagnosis, resulting in low data retrieval efficiency.
[0022] To address the aforementioned issues, this application provides a method and related apparatus for constructing a knowledge graph of abnormal electricity meter operation, which can form a complete relationship chain network, improving diagnostic accuracy, semantic retrieval efficiency, cross-source data integration operation and maintenance efficiency, and user experience.
[0023] The method and related apparatus for constructing a knowledge graph of electricity meter operation anomalies provided in this application can be applied to, for example... Figure 1 Please refer to the knowledge graph construction system for electricity meter malfunctions shown below. Figure 1 , Figure 1 This is a schematic diagram of the architecture of a knowledge graph construction system for abnormal operation of electricity meters provided in an embodiment of this application. The knowledge graph construction system 100 for abnormal operation of electricity meters includes multiple platforms 110 and a server 120. The multiple platforms 110 can communicate with the server 120 through a network. The multiple platforms 110 refer to terminals, platforms or systems used to acquire various types of data and send multi-source heterogeneous data to the server 120. Specifically, the multi-source heterogeneous data may include, for example, an electricity meter archive database, an electricity meter abnormal operation rule database, and an electricity meter historical maintenance work order database.
[0024] In this solution, server 120 refers to a remote computer used for handling large amounts of computational tasks and storing data. Server 120 is equipped with an entity relation extraction model, a pre-trained vector model, and a large language model. Storage space is also deployed on server 120 to store the constructed knowledge graph of electricity meter malfunctions for user access.
[0025] Based on this, this application provides a method for constructing a knowledge graph of abnormal operation of electricity meters. The following is a detailed description of this application with reference to the accompanying drawings.
[0026] Please see Figure 2 , Figure 2 This is a flowchart illustrating the first method for constructing a knowledge graph of abnormal electricity meter operation provided in this application embodiment, as shown below. Figure 2 As shown, the method includes the following steps: S210, acquire multi-source heterogeneous data, and perform data preprocessing based on the multi-source heterogeneous data to obtain standard data. The multi-source heterogeneous data is used to characterize the data associated with the electricity meter, and the multi-source heterogeneous data comes from at least one platform.
[0027] This involves acquiring multi-source heterogeneous data related to the operating status of electricity meters. The data originates from various business platforms or information systems, such as electricity meter asset management systems, electricity consumption information collection systems, marketing business systems, historical work order processing systems, and external environmental monitoring platforms. The acquired data has different structures. For example, relational database tables from the asset management system may contain structured data, including static profile information of the electricity meters, such as asset number, model, specifications, manufacturer, installation date, and location. Data from the collection system may contain real-time / frozen time-series operational data in JSON or XML format, such as electricity consumption, voltage, current, and power factor; this is semi-structured data. Finally, there are text records from the work order system, which may be unstructured data, describing abnormal phenomena, on-site handling processes, and the final feedback of the processing results.
[0028] For example, data sources and characteristics may include the following: structured data stored in the electricity meter archive database, including the electricity meter's unique identifier, specifications, manufacturer information, batch number, installation date, etc.; semi-structured data stored in the electricity meter operation anomaly rules database, including anomaly type, anomaly judgment rules, possible causes, and handling suggestions; and unstructured data stored in the electricity meter historical maintenance work order database, including work order ID, anomaly description, handling process, result feedback, and associated electricity meter asset number, etc. The aforementioned electricity meter unique identifier includes the asset number, and specifications include voltage and current specifications, such as voltage specifications (e.g., 3). 100V, 3 220 / 380V, current specifications such as 1(10)A, 5(10)A, specification types including three-phase four-wire, three-phase three-wire, etc.; manufacturer information includes manufacturer name, unified social credit code; batch number includes such as 20230501-01, installation date, etc.; abnormality types include such as voltage loss, voltage phase loss, current loss, power factor abnormality; abnormality judgment rules include such as for 3 For a 100V voltage meter, the voltage loss judgment rule is that either phase A or phase C voltage is less than or equal to 98V; regarding "3 For 220 / 380V voltage specifications, the current loss judgment rule needs to be combined with the current specification. For example, when the current specification is "5(10)A", if the current of a certain phase is less than the starting current of 0.025A, then the current of the remaining two phases must be greater than 0.25A. Possible reasons include, for example, the voltage transformer accuracy decreases, line faults, current transformer faults, etc. The handling suggestions include, for example, checking the voltage transformer accuracy, checking the line fault point, checking the current transformer, etc. The above abnormal phenomenon can be described in the format of 2023-06-15 10:00, the user reported that the meter was not measuring, and the on-site inspection found that the voltage of phase A was 0V. The handling process can be, for example, checking the wiring and finding that the phase A terminal was loose, and after tightening it again, the voltage returned to 220V. The result feedback can be, for example, restoring normal metering, associating the electricity meter asset number, etc.
[0029] The data preprocessing based on the multi-source heterogeneous data includes at least one of unstructured data standardization, entity recognition and standardization, and data cleaning. After the multi-source heterogeneous data undergoes at least one of the above processes, standard data is obtained.
[0030] Specifically, the aforementioned unstructured data standardization process includes structuring text using regular expressions. For example, when extracting specification parameters, regular expressions are used to transform text from "three-phase four-wire 3..." Extract the following from the "100V electricity meter": "Type: Three-phase four-wire, Voltage specification: 3". "100V", the above regular expression can be When extracting the time of anomalies, the timestamp "2023-06-15 10:00" is extracted from "2023-06-15 10:00 Low Voltage" using a regular expression. The regular expression can be... When extracting numerical thresholds, regular expressions are used to extract "parameter: voltage, threshold: 98V, relation: ≤" from "voltage ≤ 98V", and "parameter: current, threshold: 0.25A, relation: >" from "current greater than 0.25A". These regular expressions can be: .
[0031] Specifically, the aforementioned entity recognition and normalization includes pre-trained named entity recognition models based on the Transformer architecture, such as BERT-NER or its variants, such as RoBERTa-wwm-ext. The normalization process then pre-builds a domain-specific normalization dictionary for each entity class. This dictionary defines all allowed standard entity values and their common synonyms, abbreviations, and variants.
[0032] For example, identify the entity "Manufacturer: A, Batch: 20230501-01, Type: Three-phase three-wire energy meter" from "Production of three-phase three-wire energy meter of manufacturer A, batch 20230501-01"; establish a standardized entity mapping table to unify entity descriptions, such as mapping "A Technology Co., Ltd." and "Company A" to "A"; mapping "3-phase four-wire" and "3-phase four-wire" to "three-phase four-wire"; mapping "current specification 5(10)A" and "5(10)A current" to "current specification: 5(10)A".
[0033] The data cleaning process includes removing duplicate data, supplementing missing key information data, and eliminating abnormal data collection samples. For example, duplicate data is removed from multiple entries of the same work order; missing key information data is supplemented for maintenance records without asset numbers or electricity meter files without specifications; and abnormal data collection samples with negative voltage or current values are eliminated.
[0034] S220, determine relation triples based on the pre-trained entity relation extraction model and the standard data.
[0035] Specifically, based on standard data and a pre-trained entity relation extraction model, semantic relationships between entities are automatically extracted from the text of the standard data, forming structured triples of (head entity, relation, tail entity). The aforementioned pre-trained entity relation extraction model can be, for example, a sequence labeling and relation classification integrated model based on a pre-trained language model, such as BERT or ERNIE, which can simultaneously complete entity recognition and relation classification within a unified framework.
[0036] If the pre-trained entity relation extraction model is a large model that supports understanding of Chinese professional fields, the entity relation extraction model is designed and constructed based on "role definition + core principles + context + CoT reasoning + output specification + Few-Shot example". Preferably, the prompt word template of the entity relation extraction model can be the role and core principle content as shown in Table 1 below. Entity keywords and relational phrases are extracted through the entity relation extraction model.
[0037] Table 1
[0038] The entity relationship extraction model, built based on the content in Table 1 above, takes contextual content as input and outputs accurate knowledge extraction content. For example, the contextual input might be: Work order content: [Work order 2023-07-20] Asset number 10087, type three-phase four-wire, voltage specification 3. 220 / 380V, current specification 5(10)A. The user reported that the meter reading was large. On-site testing showed that the B-phase current was 0.02A (starting current 0.025A), the A and C-phase currents were 0.3A, and the three-phase power factor was 0.85. After replacing the B-phase current transformer, the meter reading returned to normal. Known specifications: Type = three-phase four-wire, voltage specification = 3 220 / 380V, current specification = 5(10)A; known manufacturer: State Grid Information & Communication, batch: 20230601-02. The reasoning steps of the entity relationship extraction model are as follows: extract abnormal phenomena from the work order: B phase current 0.02A (less than the starting current 0.025A), A and C phase current 0.3A (greater than 0.25A), three-phase power factor 0.85 (less than 1), large metering deviation; match the abnormal type corresponding to the specification: combined with the judgment standard of current specification 5(10)A, it is determined to be "current loss"; extract abnormal rules: based on the energy meter operation abnormal rule database, extract the rules corresponding to the meter specification and abnormal type, such as type three-phase four-wire, voltage specification 3 220 / 380V, current specification 5(10)A, the corresponding current loss abnormality rule is: the B phase current is less than the starting current 0.025A, the remaining A and C phase currents are greater than 0.25A, and the three phase power factors are all less than 1; the possible cause is: the B phase current transformer is faulty (the work order clearly states that it will be restored after replacement); the proposed solution is to replace the B phase current transformer.
[0039] Among them, based on the extracted entity keywords and relational phrases, the keywords are assigned the relational phrases with the highest probability. If the probability exceeds the preset confidence threshold, a valid relational triple is generated.
[0040] Optionally, based on the extracted entity keywords and relational phrases, the keywords are assigned the highest probability relational phrases. If this probability exceeds a preset confidence threshold, generating a valid relational triple can be achieved through the following steps: Generate a semantic feature vector encoding containing contextual semantic information for the sentence containing the entity keywords; for each pair of co-occurring entities in the sentence containing the entity keywords, input their context vector representation into a relational classifier. The co-occurring entities include the head entity H and the tail entity T; then, the relational classifier outputs a probability distribution vector P=[p1,p2,...,p...]. n ], where p i Representation Relation R i The probability of something existing between (H, T) is used to find the probability p with the highest probability. max The relationship R between the maximum probability and max Based on pre-setting baseline confidence thresholds p0 and p for all relation types. max Compare, if p max If the value is greater than p0, then a relation triple (H,R) corresponding to the entity pair (H,T) is generated. max ,T).
[0041] Optionally, based on the extracted entity keywords and relational phrases, the keywords are assigned the highest probability relational phrases. If this probability exceeds a preset confidence threshold, generating a valid relational triple can be achieved through the following steps: Generate a semantic feature vector encoding containing contextual semantic information for the sentence containing the entity keywords; for each pair of co-occurring entities in the sentence containing the entity keywords, input their context vector representation into a relational classifier. The co-occurring entities include the head entity H and the tail entity T; then, the relational classifier outputs a probability distribution vector P=[p1,p2,...,p...]. n ], where p i Representation Relation R i The probability of something existing between (H, T) is used to find the probability p with the highest probability. max The relationship R between the maximum probability and maxDetermine a pre-set baseline confidence threshold P corresponding to the entity type. x Different types of confidence thresholds may differ, based on this P x and p max Compare, if p max Greater than P x Then, a relation triple (H,R) corresponding to the entity pair (H,T) is generated. max The confidence levels corresponding to the different types mentioned above can be set differently based on the importance and ambiguity of different relation types. For example, a higher threshold can be set for relations with higher importance or ambiguity.
[0042] Optionally, before writing the new triple (H, R_max, T) into the knowledge graph, the system performs a consistency query on the existing graph. Assume the newly extracted triple is (Possible Cause: C, Corresponding Element, Action Recommendation: S). The system will check if (C, Corresponding Element, S') already exists in the graph, where S' ≠ S. If it exists, and the business rules stipulate that "Possible Cause" and "Action Recommendation" should have a one-to-one or one-to-two relationship, then this new triple conflicts with existing knowledge. Once a conflict is detected, the system will not directly write the new triple but will automatically trigger an arbitration process. The system packages the conflicting parties (i.e., the old and new triples) and their respective confidence levels, source texts, etc., and submits them to the knowledge base administrator or domain expert for final adjudication. Based on the adjudication result, the system will perform operations such as updating, ignoring, or overwriting.
[0043] In one possible embodiment, the relation triple includes an association path of at least one of the following: manufacturer, production batch, electricity meter, anomaly type, anomaly rule, possible cause, handling suggestion, and historical operation and maintenance record.
[0044] For example, construct the following triples, see Table 2.
[0045] Table 2
[0046] S230, construct multiple node statements based on the entity device information and corresponding relationship information, determine the association relationship based on the relationship triples, and determine the knowledge graph network based on the multiple node statements and the association relationship.
[0047] This step transforms the relation triples output from the previous steps into an interconnected knowledge network that can be stored and queried in a graph database. A parameterized statement template is predefined for each entity type. The triple list output after entity identification and standardization is matched against the corresponding template, generating a large number of specific node creation statements. A parameterized matching statement template is predefined for each relation type, mapping the obtained triples and relation attributes to the corresponding matching statements. These discrete node creation and matching statements are then integrated to obtain the knowledge graph network.
[0048] In one possible embodiment, please refer to Figure 3 , Figure 3 This is a flowchart illustrating the second method for constructing a knowledge graph of abnormal electricity meter operation provided in this application embodiment, as shown below. Figure 3 As shown, the construction of multiple node statements is based on the entity device information and the corresponding relationship information, including: S231, the constructed ontology graph structure; S232, based on the ontology graph structure and the entity device information and corresponding relationship information, mapping is performed as entity device nodes and situation nodes; S233, determine the query statement based on the entity device node and the situation node and the standardized query statement template, wherein the query statement template includes node labels and attribute fields; S234, Determine the first verification result of the constraint verification based on the query statement and the first constraint condition; S235, determine the node statement based on the verification result.
[0049] Before constructing specific node statements, a structured ontology model needs to be established. This ontology model adopts the seven-step method of domain ontology construction to clarify the scope of the electricity meter anomaly diagnosis domain, define the core entity types, class hierarchy, attributes, and relationships. The seven-step method includes: determining the domain and scope, listing important terms, defining classes and hierarchy, defining attributes, defining attribute constraints, creating instances, and verification, to ensure that the entities and relationships required for the entire electricity meter anomaly diagnosis process are covered.
[0050] The entity types of the ontology graph structure include at least one of the following: electricity meter, manufacturer, batch, anomaly type, anomaly rule, possible cause, handling suggestion, and historical operation and maintenance records. The historical operation and maintenance records include two subtypes: pre-processing records and post-processing records. Pre-processing records are used to store abnormal phenomena and monitoring data, while post-processing records are used to store the processing process and result feedback. Possible causes include three subtypes: equipment failure, line problem, and environmental interference. The equipment failure category can be, for example, a transformer failure, the line problem category can be, for example, a broken line, and the environmental interference category can be, for example, electromagnetic interference.
[0051] The relationship types of the ontology graph structure include at least one of the following, as shown in Table 3: Table 3
[0052] The entity attributes of the ontology graph structure include at least one of the following, as shown in Table 4: Table 4
[0053] For example, the asset number mentioned above is a unique identifier and cannot be repeated. Types include three-phase four-wire, three-phase three-wire, single-phase, etc., and voltage specifications include 3. 100V, 3 220 / 380V, current specifications such as 1(10)A, 5(10)A, and the location of the transformer area such as Chengdong Transformer Area 001. Names such as voltage loss, current loss, etc., and categories such as voltage, current, power, etc. The hazard level can be, for example, level 1-5, with level 1 being the lowest and level 5 being the highest. For example, voltage phase loss is level 4, and the scope of impact includes single meter, transformer area, region, etc. Threshold conditions can be, for example, “A phase voltage ≤ 98V” and “B phase current < 0.025A”. The duration can be, for example, “≥ 10 minutes”. Some rules do not have this attribute, so they are marked “none”. Triggering scenarios such as “normal operation” and “load change”, etc. Applicable specifications such as “three-phase three-wire 3 "100V". The result status can be indicated by success, failure, pending follow-up, etc., and user feedback can be indicated by satisfaction, neutral, dissatisfaction, etc.
[0054] The input includes cleaned entity equipment information (such as electricity meter files) and relationship information (such as work order records of implicit entities) from the data preprocessing stage. Based on the entity types defined in S231, each data record is categorized and its attributes are extracted, mapping it to a logical node object. For example, an electricity meter file record is mapped to an electricity meter node object, with its asset number attribute assigned the value "10087" and its type assigned the value "three-phase four-wire". Then, a parameterized Cypher CREATE statement template is predefined for each entity type. The template embeds individual labels and attribute fields. The Cypher CREATE statement template can be: CREATE (n: node label { attribute field 1: ...} ... Value 1, Attribute Field 2: Value 2, ...}). Then, the attribute values of the node object obtained in S232 are filled into the corresponding template parameters to generate a complete node creation query statement. Then, according to the first constraint condition predefined in S231, the generated query statement is parsed and validated. Then, based on the validation result, the final node statement is determined. If the validation result passes, the node statement is marked as "valid" and added to the final statement set to be executed; if the validation result fails, the node statement will be marked as "invalid", the system will record an error log and prevent the statement from being executed. At the same time, the error information can be fed back to the upstream system for data correction.
[0055] For example, a Cypher statement includes: creating a node representing an electricity meter (with a unique identifier and complete specification attributes). This node contains the following attribute information: asset number "10087"; type "three-phase four-wire"; voltage specification "3". 220 / 380V"; current specification is "5 (10) A"; installation date is "2023-06-10"; the transformer area is "Chengxi Transformer Area 002"; batch is "batch: 20230601-02". Create an abnormal type node (including hazard level and category): name is "current loss"; category is "current"; hazard level is 3; scope of impact is "single meter". Create an abnormal rule node (including threshold conditions and applicable specifications): threshold condition is "phase B current < 0.025A and phase A and C current > 0.25A and three-phase power factor < 1"; duration is "none"; trigger scenario is "normal operation"; applicable specification is "three-phase four-wire 3 220 / 380V (current specification 5(10)A)".
[0056] As can be seen, in this embodiment, through a standardized process, entity device information and relationship information are transformed into node creation statements that can be executed in the graph database, ensuring that the final set of node statements used to build the knowledge graph is not only syntactically correct, but also meets the requirements of business logic and data quality.
[0057] In one possible embodiment, please refer to Figure 4 , Figure 4 This is a flowchart illustrating the third method for constructing a knowledge graph of abnormal electricity meter operation provided in this application embodiment, as follows: Figure 4 As shown, the first constraint includes uniqueness constraints and / or range constraints and / or logical association constraints; determining the constraint verification result based on the query statement and the constraints includes: S2341, Determine the uniqueness verification result based on the query statement and the uniqueness constraint; S2342, Determine the value range verification result based on the query statement and the value range constraint conditions; S2343, Determine the logical verification result based on the query statement and the logical association constraints; S2344, determine the first verification result based on the uniqueness verification result and / or the value range verification result and / or the logic verification result.
[0058] Of these, at least one of the three steps S2341, S2342, and S2343 must be executed.
[0059] By implementing a multi-layered, automated data verification mechanism, the uniqueness, standardization, and logical consistency of all node data in the knowledge graph are ensured, guaranteeing the data quality of the knowledge graph from the source. The first constraint is a set of rules that must be satisfied before data is written into the knowledge graph. Specifically, it includes one or more of the following constraint types: uniqueness constraint, value range constraint, and logical association constraint. The uniqueness constraint ensures that the value of one or more attribute combinations of a specific entity type must remain unique throughout the entire knowledge graph and cannot be repeated. The value range constraint ensures that the value of an entity attribute must be within a predefined set of legal value ranges. The logical association constraint ensures the business logic relationships that must be satisfied between different attributes within the same entity or between attributes of different entities.
[0060] The process of determining the uniqueness verification result based on the query statement and the uniqueness constraint includes: parsing the CREATE statement to extract the node label and the values of the uniqueness constraint attributes. Then, a parameterized MATCH query statement is executed in the graph database. If the query returns an empty result, it indicates that the unique identifier does not exist, and the verification passes; if the query returns an existing node, it indicates a violation of the uniqueness constraint, and the verification fails. The system will generate and record the uniqueness verification result.
[0061] The process of determining the value range verification result based on the query statement and the value range constraints includes: parsing the key-value pairs of all attributes in the query statement and comparing them with a preset attribute and value range mapping table; if the values of all attributes in the statement exist in their corresponding legal value range list, the verification passes; if the value of any attribute is not in the legal value range, the verification fails, and the system will generate and record the value range verification result.
[0062] The process of determining the logical verification result based on the query statement and the logical association constraints includes: parsing the query statement, identifying the logical rules that need to be verified, and for cases involving cross-entity constraints, it may be necessary to query the relevant entities in advance; if all the relevant logical association constraints are met, the verification passes; if any logical rule is violated, the verification fails, and the system will generate and record the logical verification result.
[0063] The determination of the first verification result based on the uniqueness verification result and / or the value range verification result and / or the logic verification result includes: the final verification result is determined to be "pass" only if all the specific verifications performed (uniqueness, value range, logic) return a "pass" result. If any specific verification returns a "fail" result, the final verification result is determined to be "fail".
[0064] For example, a Cypher statement includes: finding two specific nodes in the graph database simultaneously: a node labeled "Energy Meter" with an "Asset Number" attribute value of "10087"; and a node labeled "Anomaly Type" with a "Name" attribute value of "Current Loss". Creating a relationship between the two nodes from "Energy Meter" to "Anomaly Type". The relationship's type is "Has", and it has two attributes: "First Occurrence Time" and "Occurrence Frequency". The "First Occurrence Time" is set to "2023-07-20", and the "Occurrence Frequency" is set to 1. Find two other specific nodes in the graph database: one is a node labeled "Abnormal Type" with a "Name" attribute value of "Current Loss"; the other is a node labeled "Abnormal Rule" with a "Threshold Condition" attribute value of "Phase B current < 0.025A and Phase A and C current > 0.25A and three-phase power factor < 1". Create a relationship between the two nodes from "Abnormal Type" to "Abnormal Rule", with the relationship type being "Has" and the relationship having a "Rule Source" attribute set to "Abnormal Rule Library V2.0". Find two other specific nodes in the graph database: one labeled "Possible Cause" with a "Name" attribute value of "Phase B Current Transformer Failure" and the other labeled "Remedial Recommendation" with a "Name" attribute value of "Replace Phase B Current Transformer". Create a relationship between the two nodes from "Possible Cause" to "Remedial Recommendation", with the relationship type being "Correspondence". This relationship has attributes for success rate and average repair time, with "Success Rate" set to "98%" and "Average Repair Time" set to "1.5 hours".
[0065] As can be seen, in this embodiment, the multi-level constraint verification process can proactively and automatically identify and intercept three typical data quality problems before data is written, which greatly improves the reliability of the knowledge graph construction process and the quality of the output results, avoids the heavy data cleaning and correction work in the later stage, and improves the user experience.
[0066] In one possible embodiment, please refer to Figure 5 , Figure 5 This is a flowchart illustrating the fourth method for constructing a knowledge graph of abnormal electricity meter operation provided in this application embodiment, as follows: Figure 5 As shown, determining the association relationship based on the relation triple includes: S236: Match nodes in memory or database using their unique identifiers to parse out the node objects that represent the relationship; S237, based on the parsed node objects and the relation types in the triples; S238, determine the second verification result of the constraint verification based on the relationship type and the second constraint condition; S239, Determine the association relationship based on the verification result.
[0067] This process maps abstract relation triples to concrete node objects in a knowledge graph. The input is a standardized relation triple from the relation extraction module, formatted as (head entity identifier, relation type, tail entity identifier), which may include relation attributes. The extracted head and tail entity identifiers are then used for matching queries. If both the head and tail entity nodes are successfully found, they are output as parsed node objects to the next step. If neither node is found, the relation establishment process terminates. After successfully parsing the node objects, a pre-defined relation is selected based on the node object and the relation type specified in the triple to create a Cypher statement template. Then, the system performs a verification based on the second constraint. A second verification result and its specific reason are generated based on the verification results. If node S236 is successfully parsed and the second verification result in S238 is passed, the system approves the execution of the relationship creation statement built in S237, and this relationship can be written into the knowledge graph. If node S236 fails to be parsed or the second verification result in S238 is not passed, the system will abandon the execution of the relationship creation statement, and the relationship establishment will be marked as failed. Optionally, the above error information will be recorded for administrator review and tracing.
[0068] As can be seen, in this embodiment, the second constraint condition verification ensures that all relationships must conform to predefined business logic and domain rules, thereby achieving automation and intelligence in the construction of association relationships, improving the accuracy and rigor of knowledge graph construction, and enhancing the user experience.
[0069] In one possible embodiment, please refer to Figure 6 , Figure 6 This is a flowchart illustrating the fifth method for constructing a knowledge graph of abnormal electricity meter operation provided in this application embodiment, as follows: Figure 6 As shown, the second constraint includes relational logical constraints and / or relational attribute constraints; the determination of the second verification result based on the relation type and the second constraint includes: S2381, Determine the relation logic verification result based on the relation type and the relation attribute constraints; S2382, Determine the relation attribute verification result based on the relation type and the relation attribute constraints; S2383, determine the second verification result based on the relational logic verification result and / or the relational attribute verification result.
[0070] Of these, at least one of S2381 and S2382 shall be executed.
[0071] The second constraint is a set of rules that must be satisfied when creating relation edges in a knowledge graph, including at least one of relation logic constraints and relation attribute constraints. Relation logic constraints specify what kind of relationships are allowed or prohibited between specific types of entities, and the rules that such relationships should follow in terms of quantity (multiplicity), preventing the creation of invalid or erroneous relationships that violate business logic and maintaining the correctness of the knowledge graph's network structure. Relation attribute constraints are used to specify the data format, type, and value range requirements that the attributes attached to relation edges (relation attributes) must meet, ensuring the quality of relation attribute data.
[0072] The process of determining the relation logic verification result based on the relation type and relation attribute constraints includes: triggering corresponding logical rule checks based on the relation type to be created; initiating a query to the graph database based on the relation to be created; and counting the number of existing relations of type R between nodes. If the current number of relations does not exceed the multiplicity limit and the relation type is allowed among entity types, the verification passes; if the number of relations is full or the relation type is not allowed, the verification fails, and the relation logic verification result is generated and recorded.
[0073] The determination of the relation attribute verification result based on the relation type and relation attribute constraints includes: parsing the key-value pairs of all relation attributes in the relation statement to be created, comparing them with a predefined "relation attribute-specification" mapping table, verifying whether the attribute values conform to the expected data type, such as integer, floating-point, string, or date, and verifying whether the attribute values are within a legal range or conform to a specific format; if the values and formats of all relation attributes conform to their predefined specifications, the verification passes; if all relation attributes violate the specifications, the verification fails, and the relation attribute verification result is generated and recorded. The second verification result is determined to be passed only if both the relation logic verification and the relation attribute verification are passed. If either the relation logic verification or the relation attribute verification fails, the final second verification result is failed.
[0074] As can be seen, in this embodiment, the relation logic and relation attribute verification process described in this implementation can effectively intercept two typical association errors before relation creation, thereby improving the accuracy of the knowledge graph and enhancing the user experience.
[0075] In one possible embodiment, the electricity meter data is imported in batches. Preferably, the Neo4j-Import tool can be used for batch import. Nodes and relationships are defined through CSV files (e.g., the electricity meter entity node CSV file contains fields such as "asset number, type, voltage specification, current specification", and the relationship CSV file contains fields such as "starting node ID, target node ID, and relationship attribute"). The import efficiency reaches 100,000 nodes / minute, which can quickly build a knowledge graph network of electricity meter operation anomalies.
[0076] S240, generate descriptive text for the knowledge graph network, encode the descriptive text into embedding vectors using a pre-trained vector model, and store them in a vector database with efficient indexing to obtain the knowledge graph of the electricity meter's abnormal operation.
[0077] The process involves inputting entity device information from the knowledge graph (i.e., each entity node and its attribute key-value pairs) and relation information (i.e., relation triples and their attributes). For each entity node, a natural language description is generated by concatenating its core attribute keys and attribute values. For each relation, a coherent natural language description is generated by concatenating its head entity identifier, relation type, tail entity identifier, and relation attributes. The generated description text is then converted into machine-understandable and computationally comprehensible embedding vectors. Specifically, a dedicated vector model pre-trained on a Chinese corpus can be used, preferably M3E-Base or BGE-Large. The generated embedding vectors are then stored in a vector database. In the vector database, each embedding vector can be assigned a vector ID for one-to-one lookup. For example, when a user inputs a query, vector retrieval and entity matching can be performed based on the vector ID to accurately search the knowledge graph and return relevant query results.
[0078] In one possible embodiment, generating descriptive text for the knowledge graph network, encoding the descriptive text into embedding vectors using a pre-trained vector model, and storing it in a vector database with efficient indexing to obtain the knowledge graph of the electricity meter's malfunction includes: generating a first descriptive text based on the entity device information, the first descriptive text including the core attribute keys and attribute values of the entity type; generating a second descriptive text based on the relationship information, the second descriptive text including the head entity identifier, relationship type, tail entity identifier, and relationship attributes; using a pre-trained vector model to encode the first descriptive text and the second descriptive text in batches to obtain the embedding vectors; storing the embedding vectors in the vector database with efficient indexing; constructing an IVF_FLAT index for the vector database with efficient indexing; and establishing a mapping relationship between vector IDs and unique attributes of entities in the knowledge graph to obtain the knowledge graph of the electricity meter's malfunction, thereby realizing the linkage between vector retrieval and graph query.
[0079] Among them, the entity device information in the knowledge graph, namely each entity node and its attribute key-value pairs, generates a coherent natural language description and the first description text for each entity node by concatenating the core attribute keys and attribute values of its entity type.
[0080] For example, the input attributes are: {Asset Number: "10087", Type: "Three-phase Four-wire", Voltage Specification: "3 220 / 380V", Current specification: "5(10)A", Location: "Chengxi Substation 002"; The first description text generated is: "Asset number 10087, type three-phase four-wire, voltage specification 3 220 / 380V, current specification 5(10)A, the electricity meter located in Chengxi Substation 002. Input attributes: {threshold condition: "B phase current < 0.025A", applicable specification: "three-phase four-wire 3 220 / 380V"}; The generated first description text: "Threshold condition B-phase current < 0.025A, applicable specification three-phase four-wire 3 "Abnormal rules for 220 / 380V".
[0081] The input consists of relation information from the knowledge graph, namely relation triples and their attributes. Then, by concatenating the head entity identifier, relation type, tail entity identifier, and relation attributes, a coherent natural language description, namely the second description text, is generated.
[0082] For example, the input relationship is: (Electricity meter: 10087) - [with {first occurrence time: "2023-07-20", occurrence frequency: 1}] -> (anomaly type: current loss); the generated second description text is: "Electricity meter 10087 has a current loss anomaly type, first occurrence time 2023-07-20, occurrence frequency 1 time".
[0083] The generated first and second descriptive texts are batch-input into a pre-trained vector model. The vector model trained by fishing line includes a dedicated vector model pre-trained on Chinese corpus, preferably M3E-Base or BGE-Large. The model encodes each descriptive text and outputs a floating-point vector. Optionally, batch processing is used during the encoding process, or GPU acceleration is used during the encoding process to improve vector generation efficiency.
[0084] All the aforementioned embedded vectors are stored in a dedicated vector database, such as FAISS, Milvus, or Chroma. For the stored set of embedded vectors, an IVF_FLAT index is constructed. The IVF_FLAT index uses an inverted file mechanism to cluster all vectors into multiple "clusters." During retrieval, the index performs precise distance calculations (FLAT) within the few clusters to which the query vector most likely belongs. In the vector database, each embedded vector is assigned a unique vector ID, establishing a mapping between this vector ID and the unique attributes of the corresponding entity in the knowledge graph. Examples include the asset number of an electricity meter, the name of the anomaly type, and the work order ID.
[0085] As can be seen, in this embodiment, an embedded vector containing the core attributes of the entity is generated by a Chinese-specific vector model, and the linkage of "semantic retrieval - entity matching - knowledge query" is realized by combining the FAISS index and Neo4j graph.
[0086] Thus, through the above steps, a complete knowledge graph of electricity meter malfunctions is obtained.
[0087] As can be seen, in this embodiment, multi-source heterogeneous data is acquired, and data preprocessing is performed based on the multi-source heterogeneous data to obtain standard data. The multi-source heterogeneous data is used to characterize data associated with the electricity meter, and the multi-source heterogeneous data comes from at least one platform. Relationship triples are determined based on a pre-trained entity relationship extraction model and the standard data. Multiple node statements are constructed based on the entity device information and corresponding relationship information. Relationships are determined based on the relationship triples, and a knowledge graph network is determined based on the multiple node statements and the relationships. Descriptive text is generated for the knowledge graph network, and the descriptive text is encoded into embedding vectors using a pre-trained vector model and stored in a vector database with efficient indexing to obtain the electricity meter operation anomaly knowledge graph. In this way, a complete relationship chain network can be formed, improving diagnostic accuracy, semantic retrieval efficiency, cross-source data integration operation and maintenance efficiency, and user experience.
[0088] Please see Figure 7 , Figure 7 This is a schematic diagram of a knowledge graph construction device for abnormal operation of electricity meters proposed in an embodiment of this application. The knowledge graph construction device 700 for abnormal operation of electricity meters includes: an acquisition module 710, a first determination module 720, a second determination module 730, and a graph construction module 740, wherein... The acquisition module 710 is used to acquire multi-source heterogeneous data and perform data preprocessing based on the multi-source heterogeneous data to obtain standard data. The multi-source heterogeneous data is used to characterize the data associated with the electricity meter. The multi-source heterogeneous data comes from at least one platform. The first determining module 720 is used to determine relation triples based on a pre-trained entity relation extraction model and the standard data. The second determining module 730 is used to construct multiple node statements based on the entity device information and the corresponding relationship information, and to determine the association relationship based on the relationship triples, and to determine the knowledge graph network based on the multiple node statements and the association relationship; The graph construction module 740 is used to generate descriptive text for the knowledge graph network, encode the descriptive text into embedding vectors using a pre-trained vector model, and store them in a vector database with efficient indexing to obtain the knowledge graph of the electricity meter's abnormal operation.
[0089] In one possible embodiment, the second determining module 730, in constructing multiple node statements based on the entity device information and corresponding relationship information, is specifically used for: The constructed ontology graph structure; Based on the ontology graph structure and the entity device information and corresponding relationship information, entity device nodes and situation nodes are mapped; The query statement is determined based on the entity device node and the situation node and a standardized query statement template, wherein the query statement template includes node labels and attribute fields; Based on the query statement and the first constraint condition, determine the first verification result of the constraint verification; The node statement is determined based on the verification result.
[0090] In one possible embodiment, the first constraint includes a uniqueness constraint and / or a range constraint and / or a logical association constraint; the second determining module 730, in determining the validation result of the constraint validation based on the query statement and the constraint, is specifically used for: The uniqueness verification result is determined based on the query statement and the uniqueness constraint; and / or, Determine the value range verification result based on the query statement and the value range constraints; and / or, The logical verification result is determined based on the query statement and the logical association constraints; and / or, The first verification result is determined based on the uniqueness verification result and / or the value range verification result and / or the logical verification result.
[0091] In one possible embodiment, the second determining module 730, in determining the association relationship based on the relation triplet, is specifically configured to: By matching the unique identifiers of the nodes in memory or in the database, the node objects of the relationship are parsed out. Based on the parsed node objects and the relation types in the triples; Determine the second verification result of the constraint verification based on the relationship type and the second constraint condition; The association is determined based on the verification results.
[0092] In one possible embodiment, the second constraint condition includes relational logic constraints and / or relational attribute constraints; the second determining module 730, in determining the second verification result of the constraint verification based on the relation type and the second constraint condition, is specifically used for: The relation logic verification result is determined based on the relation type and the relation attribute constraints; and / or, The relation attribute validation result is determined based on the relation type and the relation attribute constraints. The second verification result is determined based on the relational logic verification result and / or the relational attribute verification result.
[0093] In one possible embodiment, the graph construction module 740, in generating descriptive text for the knowledge graph network, encoding the descriptive text into embedding vectors using a pre-trained vector model, and storing it in a vector database with efficient indexing, specifically serves to obtain the knowledge graph of the electricity meter's operational anomalies, for the following purposes: A first description text is generated based on the entity device information, and the first description text includes the core attribute keys and attribute values of the entity type. A second descriptive text is generated based on the relationship information. The second descriptive text includes a head entity identifier, a relationship type, a tail entity identifier, and relationship attributes. The embedding vectors are obtained by batch encoding the first and second descriptive texts using a pre-trained vector model. The embedded vectors are stored in the vector database with efficient indexes; Construct an IVF_FLAT index for the vector database with the high efficiency index; By establishing a mapping relationship between vector IDs and unique attributes of entities in the knowledge graph, the knowledge graph of the abnormal operation of the energy meter is obtained, so as to realize the linkage between vector retrieval and graph query.
[0094] In one possible embodiment, the relation triple includes an association path of at least one of the following: manufacturer, production batch, electricity meter, anomaly type, anomaly rule, possible cause, handling suggestion, and historical operation and maintenance record.
[0095] It is worth noting that the specific functional implementation of the electricity meter operation anomaly knowledge graph construction device 700 is described above. Figure 2The description of the method for constructing a knowledge graph of an abnormal operation of an electricity meter illustrates that, for example, the acquisition module 710 is used to implement the relevant content of execution S210, the first determination module 720 is used to implement the relevant content of execution S220, the second determination module 730 is used to implement the relevant content of execution S230, and the graph construction module 740 is used to implement the relevant content of execution S240. Each unit or module in the electricity meter abnormal operation knowledge graph construction device 700 can be individually or entirely merged into one or more other units or modules, or some of the units or modules can be further divided into multiple functionally smaller units or modules. This achieves the same operation without affecting the technical effect of the embodiments of the present invention. The above-mentioned units or modules are based on logical function division. In practical applications, the function of one unit (or module) is implemented by multiple units (or modules), or the function of multiple units (or modules) is implemented by one unit (or module).
[0096] As can be seen, the electricity meter operation anomaly knowledge graph construction device described in this application embodiment acquires multi-source heterogeneous data and performs data preprocessing based on the multi-source heterogeneous data to obtain standard data. The multi-source heterogeneous data is used to characterize data associated with the electricity meter, and the multi-source heterogeneous data comes from at least one platform. It determines relation triples based on a pre-trained entity relation extraction model and the standard data; constructs multiple node statements based on the entity device information and corresponding relation information; determines association relationships based on the relation triples; determines a knowledge graph network based on the multiple node statements and the association relationships; generates descriptive text for the knowledge graph network; encodes the descriptive text into embedding vectors using a pre-trained vector model; and stores it in a vector database with efficient indexing to obtain the electricity meter operation anomaly knowledge graph. In this way, a complete relation chain network can be formed, improving diagnostic accuracy, semantic retrieval efficiency, cross-source data integration operation and maintenance efficiency, and user experience.
[0097] In the case of using integrated units, please refer to Figure 8 , Figure 8 This is a schematic diagram of another knowledge graph construction device for abnormal operation of electricity meters provided in an embodiment of this application, such as... Figure 8 As shown, the electricity meter operation anomaly knowledge graph construction device 700 includes a processing module 702 and a communication module 701. The processing module 702 controls and manages the actions of the electricity meter operation anomaly knowledge graph construction device 700, for example, executing the steps of the acquisition module 710, the first determination module 720, the second determination module 730, and the graph construction module 740, and / or performing other processes of the technology described herein. The communication module 701 is used for interaction between the electricity meter operation anomaly knowledge graph construction device 700 and other devices. For example... Figure 8 As shown, the knowledge graph construction device 700 for electricity meter operation anomalies may further include a storage module 703, which is used to store the program code and data of the knowledge graph construction device 700 for electricity meter operation anomalies.
[0098] The processing module 702 can be a processor or controller, such as a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc. The communication module 701 can be a transceiver, RF circuitry, or a communication interface, etc. The storage module 703 can be a memory.
[0099] All relevant content in each scenario involved in the above method embodiments can be referenced from the functional descriptions of the corresponding functional modules, and will not be repeated here. The above-mentioned electricity meter operation anomaly knowledge graph construction device 700 can execute part or all of the above-mentioned electricity meter operation anomaly knowledge graph construction method.
[0100] Please see Figure 9 , Figure 9 This is a schematic diagram of the structure of an electronic device proposed in an embodiment of this application. As shown in the figure, the electronic device 900 includes a processor 910, a memory 920, a communication interface 930, and one or more programs 921. The one or more programs 921 are stored in the memory 920 and are configured to be executed by the processor 910.
[0101] The processor 910, memory 920, and communication interface 930 are interconnected and perform communication with each other. The memory 920 can be a volatile memory such as dynamic random access memory (DRAM) or a non-volatile memory such as a hard disk drive (HDD). The memory 920 stores a set of executable program code, and the processor 910 calls one or more programs 921 stored in the memory 920 to execute any part or all of the steps described in the above embodiment of the method for constructing a knowledge graph of abnormal electricity meter operation.
[0102] Among them, electronic devices 900 may include smartphones (such as Android phones, iOS phones, Windows Phones, etc.), tablet computers, PDAs, dashcams, in-vehicle electronic devices, servers, laptops, mobile internet electronic devices (MIDs) or wearable electronic devices (such as smartwatches, Bluetooth headsets), etc. The above are just examples and not an exhaustive list, including but not limited to the above electronic devices.
[0103] This application also provides a computer storage medium storing a computer program for electronic data interchange, which causes a computer to perform some or all of the steps of any of the methods described in the above method embodiments, wherein the computer includes an electronic device.
[0104] This application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods described in the above method embodiments. The computer program product may be a software installation package, and the computer may include an electronic device.
[0105] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0106] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0107] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical or other forms.
[0108] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0109] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0110] If the integrated units described above are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer electronic device (which may be a personal computer, electronic device, or network electronic device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0111] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage device, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0112] The embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for constructing an electricity meter operation anomaly knowledge graph, characterized in that, The method comprises the following steps: acquiring multi-source heterogeneous data, and performing data preprocessing based on the multi-source heterogeneous data to obtain standard data, wherein the multi-source heterogeneous data is used to represent data associated with an electric energy meter, and the multi-source heterogeneous data is derived from at least one platform; determining a relationship triple based on a pre-trained entity relationship extraction model and the standard data; constructing a plurality of node statements based on the entity device information and corresponding relationship condition information, and determining an association relationship based on the relationship triple, determining a knowledge graph network based on the plurality of node statements and the association relationship; generating a description text for the knowledge graph network, encoding the description text into an embedding vector by using a pre-trained vector model, and storing the embedding vector into a vector database with efficient indexing to obtain an electric energy meter operation abnormality knowledge graph.
2. The method of claim 1, wherein, The method of constructing the plurality of node statements based on the entity device information and corresponding relationship condition information comprises: constructing an ontology graph structure; mapping the ontology graph structure, the entity device information and the corresponding relationship condition information into entity device nodes and condition nodes; determining a query statement based on the entity device nodes and condition nodes and a standardized query statement template, wherein the query statement template comprises node labels and attribute fields; determining a first check result of constraint checking based on the query statement and a first constraint condition; determining the node statement based on the check result.
3. The method of claim 2, wherein, The first constraint condition comprises a uniqueness constraint condition and / or a value range constraint condition and / or a logical association constraint condition. The method of determining a check result of constraint checking based on the query statement and a constraint condition comprises: determining a uniqueness check result based on the query statement and the uniqueness constraint condition; and / or, determining a value range check result based on the query statement and the value range constraint condition; and / or, determining a logical check result based on the query statement and the logical association constraint condition; and / or, determining the first check result based on the uniqueness check result and / or the value range check result and / or the logical check result.
4. The method of claim 1, wherein, The method of determining an association relationship based on the relationship triple comprises: matching the node objects of the relationship in the memory or the database through the unique identifier of the node, and analyzing the node objects of the relationship; determining a second check result of constraint checking based on the relationship type and a second constraint condition; determining the association relationship based on the check result. The second constraint condition comprises a relationship logical constraint condition and / or a relationship attribute constraint condition.
5. The method of claim 4, wherein, The method of determining a second check result of constraint checking based on the relationship type and a second constraint condition comprises: determining a relationship logical check result based on the relationship type and the relationship attribute constraint condition; and / or, determining a relationship attribute check result based on the relationship type and the relationship attribute constraint condition; determining the second check result based on the relationship logical check result and / or the relationship attribute check result. 6. The method of claim 1, wherein, The step involves generating descriptive text for the knowledge graph network, encoding the descriptive text into embedding vectors using a pre-trained vector model, and storing the embedding vectors in a vector database with efficient indexing, thereby obtaining the knowledge graph of the electricity meter's operational anomalies, including: A first description text is generated based on the entity device information, and the first description text includes the core attribute keys and attribute values of the entity type. A second descriptive text is generated based on the relationship information. The second descriptive text includes a head entity identifier, a relationship type, a tail entity identifier, and relationship attributes. The embedding vectors are obtained by batch encoding the first and second descriptive texts using a pre-trained vector model. The embedded vectors are stored in the vector database with efficient indexes; Construct an IVF_FLAT index for the vector database with the high efficiency index; By establishing a mapping relationship between vector IDs and unique attributes of entities in the knowledge graph, the knowledge graph of the abnormal operation of the energy meter is obtained, so as to realize the linkage between vector retrieval and graph query.
7. The method of claim 1, wherein, The relationship triple includes at least one of the following association paths: manufacturer, production batch, electricity meter, anomaly type, anomaly rule, possible cause, handling suggestion, and historical operation and maintenance record.
8. An abnormal operation knowledge graph construction device for an electric energy meter, characterized by comprising: include: The acquisition module is used to acquire multi-source heterogeneous data and perform data preprocessing based on the multi-source heterogeneous data to obtain standard data. The multi-source heterogeneous data is used to characterize the data associated with the electricity meter and the multi-source heterogeneous data comes from at least one platform. The first determining module is used to determine relation triples based on a pre-trained entity relation extraction model and the standard data. The second determining module is used to construct multiple node statements based on the entity device information and the corresponding relationship information, and to determine the association relationship based on the relationship triples, and to determine the knowledge graph network based on the multiple node statements and the association relationship; The knowledge graph construction module is used to generate descriptive text for the knowledge graph network, encode the descriptive text into embedding vectors using a pre-trained vector model, and store them in a vector database with efficient indexing to obtain the knowledge graph of the electricity meter's abnormal operation.
9. A computer-readable storage medium, characterized in that, The device stores a knowledge graph construction program for abnormal operation of electricity meters, including execution instructions, which, when executed by the processor of an electronic device, perform the method as described in any one of claims 1 to 7.
10. An electronic device, comprising: It includes a processor, memory, a communication interface, and one or more programs, which are stored in the memory and configured to be executed by the processor; When the processor executes the one or more programs stored in the memory, the processor performs the method as described in any one of claims 1 to 7.