A city microgrid operation and maintenance risk prediction method, device, equipment and medium
By constructing a knowledge graph of the smart microgrid power system and fault documents, and combining it with the random forest algorithm, the problem of low fault handling efficiency in traditional operation and maintenance methods is solved, and real-time fault monitoring and rapid response of urban microgrids are realized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- STATE GRID BEIJING ELECTRIC POWER CO
- Filing Date
- 2023-01-06
- Publication Date
- 2026-07-21
AI Technical Summary
Traditional manual operation and maintenance methods are difficult to meet the requirements of high real-time performance, complex operation coordination, and efficient use of multi-source power data in urban smart microgrids. They are unable to quickly locate, analyze, and resolve faults, leading to the spread and expansion of faults.
Knowledge graph technology is used to construct a knowledge graph of the smart microgrid power system and fault documents. The risk value of the equipment node is calculated through knowledge fusion and random forest algorithm to achieve automated fault early warning and rapid fault location.
It enables real-time fault monitoring and rapid response for urban microgrids, reducing reliance on expert experience and improving the efficiency and accuracy of fault handling.
Smart Images

Figure CN116205346B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of urban smart microgrid technology, specifically relating to a method, device, equipment, and medium for predicting urban microgrid operation and maintenance risks. Background Technology
[0002] With the construction and development of smart grids in recent years, smart microgrids have become well-known for their flexibility, efficiency, and intelligence. A smart microgrid is composed of distributed power sources, energy storage devices, energy conversion devices, related loads, and monitoring and protection devices. It is an autonomous system capable of self-control and management, mitigating the impact of the intermittency and volatility of distributed renewable energy sources on grid operation and improving the grid's integration capacity. Urban smart microgrids integrate renewable distributed energy sources, provide high-quality and diverse reliable power supply services, and achieve integrated utilization of cooling, heating, and power, while coordinating operation and control with the main power grid.
[0003] The development of urban smart microgrid power systems, while increasing access capabilities and power supply flexibility, has also led to a more complex network topology, posing new challenges to dispatch management and system operation and maintenance. Currently, the operation and maintenance of urban smart microgrid power systems primarily relies on manual inspection and monitoring of system operation, followed by assessment of various indicators to determine high-risk scenarios. This traditional approach to operation and maintenance leads to the following problems:
[0004] (1) The smart microgrid system contains a large amount of power information and fault information, such as multi-source heterogeneous power data such as microgrid power equipment, network topology, operation monitoring, fault contingency plans and records of distributed renewable energy. Traditional operation and maintenance methods make it difficult to integrate and manage these multi-source heterogeneous information in a unified manner.
[0005] (2) The manual analysis of various power system indicators to determine system risks largely depends on the experience and responsiveness of professionals. A large amount of knowledge in text form, such as various operating procedures, fault plans, and monitoring and handling methods, needs to be repeatedly memorized and consulted by operation and maintenance personnel. This method of risk assessment and fault handling is not only prone to negligence and low execution efficiency, but also makes it difficult to share control experience and capabilities, and relies too much on expert information.
[0006] (3) Urban smart microgrid power systems need to face various potential problems, such as severe weather, human error, and equipment aging, all of which can affect the normal operation of the microgrid. At the same time, the devices in the microgrid are interconnected, and the failure of one local device may affect the overall operation of the power grid. Therefore, when a fault occurs, it takes time for manual assessment of system risks and fault handling, making real-time monitoring and early warning impossible and failing to provide rapid and accurate response measures, which can lead to the spread and expansion of the fault.
[0007] (4) During the normal operation of the urban smart microgrid power system, a large number of fault records are maintained. These fault records contain complete information about each fault, including the sub-equipment involved in the fault, the analysis of the cause of the fault, the solution to the fault, the lessons learned from the fault, etc. Fault records are essentially a valuable form of expert experience. However, most of the fault record documents are idle, wasting a lot of fault information.
[0008] In summary, traditional manual operation and maintenance is difficult to meet the requirements of high real-time performance, complex operation coordination, and efficient utilization of multi-source power data in urban smart microgrids. Furthermore, it is difficult to draw on extensive expert experience when formulating fault response measures, and it is impossible to quickly locate, analyze, and resolve faults, thereby affecting nearby equipment along the power grid structure. Summary of the Invention
[0009] The purpose of this invention is to provide a method, device, equipment and medium for predicting the operation and maintenance risks of urban microgrids, so as to solve the technical problem that existing urban microgrids are unable to quickly detect faults that lead to equipment damage.
[0010] To achieve the above objectives, the present invention employs the following technical solution:
[0011] Firstly, a method for predicting operational and maintenance risks in urban microgrids includes the following steps:
[0012] Acquire data from the smart microgrid power system, and construct a knowledge graph of the smart microgrid power system based on the data.
[0013] Obtain fault documents and construct an operation and maintenance knowledge graph based on the fault documents;
[0014] The operation and maintenance knowledge graph and the smart microgrid power system knowledge graph are fused to obtain a fused knowledge graph.
[0015] For each device node in the fused knowledge graph that deviates, the random forest method is used to calculate the initial risk value corresponding to each device node;
[0016] The neighboring device nodes of each device node are obtained based on the fused knowledge graph. The preliminary risk value of the device node and the preliminary risk values of the neighboring device nodes are weighted and calculated. The weights are iterated to obtain the final risk value.
[0017] Early warnings are issued regarding the operational risks of device nodes based on the final risk value.
[0018] A further improvement of the present invention is that: when acquiring smart microgrid power system data and constructing a smart microgrid power system knowledge graph based on the smart microgrid power system data, the specific steps include:
[0019] Acquire data from smart microgrid power systems;
[0020] The ontology is obtained by using a seven-step method from top to bottom and through several iterations based on data from the smart microgrid power system.
[0021] Entities and triples are obtained by extracting knowledge from several data sources based on mapping rules.
[0022] Extract device attribute values, node attribute values, inter-device grid topology relationships, and inter-node grid topology relationships from semi-structured data in existing power grid knowledge bases, and construct entities and relationships using these data.
[0023] Entities and triples are matched according to node names, and then the union of all value attributes is taken to obtain the knowledge graph of the smart microgrid power system.
[0024] A further improvement of the present invention is that the step of extracting entities and triples from several data sources based on mapping rules specifically includes the following steps:
[0025] Entity extraction is performed on several data sources;
[0026] Write SQL statements for all concepts and relationships in the ontology and configure them in Mybatis-plus;
[0027] Entities are obtained by extracting from several data sources;
[0028] Based on the SQL statements generated from the value attributes in the ontology, the entity data is extracted into key-value pairs in key-value format, and then imported into the neo4j graph database through dynamically generated Cypher statements to complete the entity extraction.
[0029] Extract relations from several data sources;
[0030] The relationships between any two different entities can be extracted from several data sources.
[0031] After obtaining the IDs of the two entities based on their relationship, the IDs are then imported into the Neo4j graph database using dynamically generated Cypher statements to complete the relationship extraction.
[0032] A further improvement of this invention is that the knowledge extraction is performed using Spring-Boot and Mybatis-Plus.
[0033] A further improvement of the present invention is that: when acquiring fault documents and constructing an operation and maintenance knowledge graph based on the fault documents, the specific steps include:
[0034] Obtain fault documents and construct a fault knowledge graph;
[0035] Annotate the faulty documents with data, including the entities and relationships that appear in the fault.
[0036] The TPLinker model was used to extract knowledge from the annotated fault documents to obtain entity models and relation models.
[0037] A loss function is established based on the entity model and the relation model, and triples are obtained based on the loss function.
[0038] An operations and maintenance knowledge graph is constructed based on triples.
[0039] A further improvement of the present invention is that: when fusing the operation and maintenance knowledge graph and the smart microgrid power system knowledge graph to obtain a fused knowledge graph, the specific steps include:
[0040] Obtain the attribute values of each entity in the operation and maintenance knowledge graph and the smart microgrid power system knowledge graph;
[0041] The attribute values of each entity in the operation and maintenance knowledge graph and the smart microgrid power system knowledge graph are concatenated together to form a string composed of multiple attributes;
[0042] Each string is encoded using TF-IDF to obtain a vector representation of all strings;
[0043] The similarity between entities in the operation and maintenance knowledge graph and entities in the smart microgrid power system knowledge graph is calculated based on the vector representations of all strings. Then, the similarity between vectors of other entities is calculated based on the vector representations of other connected entities. Finally, the similarity is obtained by multiplying each vector by its respective weight. Entity alignment is then completed based on the final similarity.
[0044] A further improvement of the present invention is that: the weight includes the weight w of device node A. A The weight w of the device node adjacent to device node A i w A +∑ i∈M w i =1, w i The value is 0.1 when w A When ≤0.6, w i Instead of taking the value 0.1, the remaining weights are evenly distributed.
[0045] Secondly, a city microgrid operation and maintenance risk prediction device includes:
[0046] The module for constructing a knowledge graph of a smart microgrid power system is used to acquire data on a smart microgrid power system and construct a knowledge graph of the smart microgrid power system based on the data.
[0047] Operations and maintenance knowledge graph construction module: used to obtain fault documents and construct an operations and maintenance knowledge graph based on the fault documents;
[0048] Fusion module: Used to fuse the operation and maintenance knowledge graph and the smart microgrid power system knowledge graph to obtain a fused knowledge graph;
[0049] Preliminary risk value calculation module: This module is used to calculate the preliminary risk value for each device node that has deviated in the fused knowledge graph using the random forest method.
[0050] Final risk value calculation module: It is used to obtain the neighboring device nodes of each device node based on the fused knowledge graph, calculate the weighted initial risk value of the device node and the initial risk values of the neighboring device nodes, and iterate the weights to obtain the final risk value;
[0051] Early warning module: Used to provide early warnings about the operational risks of device nodes based on the final risk value.
[0052] Thirdly, a computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the aforementioned method for predicting urban microgrid operation and maintenance risks.
[0053] DiSifang, a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for predicting urban microgrid operation and maintenance risks.
[0054] Compared with the prior art, the present invention has at least the following beneficial effects:
[0055] (1) This invention uses knowledge graphs to model fault documents and smart microgrid power system data. When a fault occurs, it can push key fault information in real time and automatically, and provide recommended solutions based on fault knowledge obtained from contingency plans and historical fault records, so as to quickly locate and analyze faults.
[0056] (2) A large number of idle fault record documents are utilized to become fault knowledge that can be retrieved and matched, reducing the dependence on real-time data.
[0057] (3) The risk of each node can be predicted based on the attribute information of the nodes in the graph, thereby reducing the reliance on expert experience and enabling maintenance personnel to target high-risk nodes and prevent them in advance. Attached Figure Description
[0058] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0059] In the attached diagram:
[0060] Figure 1 This is a flowchart of a method for predicting urban microgrid operation and maintenance risks according to the present invention;
[0061] Figure 2 This is a diagram illustrating the Handshaking Tagging Scheme annotation method in the urban microgrid operation and maintenance risk prediction method of this invention;
[0062] Figure 3 This is a compressed schematic diagram of the sparse matrix extracted in the urban microgrid operation and maintenance risk prediction method of the present invention;
[0063] Figure 4 This is a structural diagram of the entity and relation extraction model in the urban microgrid operation and maintenance risk prediction method of the present invention;
[0064] Figure 5 This invention provides a method for predicting the operation and maintenance risks of urban microgrids, which considers four interconnected nodes in the operation and maintenance risk prediction stage.
[0065] Figure 6 This is a structural block diagram of a city microgrid operation and maintenance risk prediction device according to the present invention. Detailed Implementation
[0066] The present invention will now be described in detail with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0067] The following detailed description is exemplary and intended to provide further detailed explanation of the invention. Unless otherwise specified, all technical terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this invention is for describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention.
[0068] Example 1
[0069] A method for predicting the operation and maintenance risks of urban microgrids, such as Figure 1 As shown, it includes the following steps:
[0070] S1. Acquire data from the smart microgrid power system and construct a knowledge graph of the smart microgrid power system;
[0071] S1 specifically includes the following steps:
[0072] S11. Obtain data from the smart microgrid power system;
[0073] S12. Based on the data of the smart microgrid power system, a seven-step method is used from top to bottom, and several iterations are performed to obtain the main body;
[0074] S13. Entities and triples are obtained by extracting knowledge from several data sources using mapping rules.
[0075] The data source is an existing power system database;
[0076] The knowledge extraction process specifically uses Spring-Boot and Mybatis-Plus.
[0077] S14. Extract device attribute values, node attribute values, power grid topology relationships between devices, and power grid topology relationships between nodes from the semi-structured data of the existing power grid domain knowledge base;
[0078] S15. Match the device attribute values, node attribute values, power grid topology relationships between devices, power grid topology relationships between nodes, entities, and triples according to the node names, and then take the union of all attribute values to obtain the knowledge graph of the smart microgrid power system. The above steps use semi-structured data to enrich the node information in the knowledge graph and improve the accuracy of risk prediction.
[0079] S13 specifically includes the following steps:
[0080] S131. Extract entities from several data sources;
[0081] S132. Extract relations from several data sources;
[0082] S131 specifically includes the following steps:
[0083] S1311. Write SQL statements for all concepts and relationships in the ontology and configure them in Mybatis-plus;
[0084] S1312. Extract entities from several data sources;
[0085] S1313. Based on the SQL statement generated from the value attributes in the ontology, extract the entity data into key-value pairs, and then import them into the neo4j graph database through the dynamically generated Cypher statement to complete the entity extraction.
[0086] S132 specifically includes the following steps:
[0087] S1321. Extract the association relationship between any two different entities from several data sources;
[0088] Relationships are usually represented by foreign keys. For example, the relationship between a substation and an energy storage device can be represented by TRANSFORMER_ID and ACCUMULATOR_ID in the substation table.
[0089] S1322. After obtaining the IDs of the two entities based on their relationship, import them into the Neo4j graph database using dynamically generated Cypher statements to complete the relationship extraction.
[0090] S2. Obtain fault documents and build an operation and maintenance knowledge graph;
[0091] S2 specifically includes the following steps:
[0092] S21. Obtain fault documents and construct a fault knowledge graph;
[0093] By analyzing a large number of fault documents, a tree structure was created, categorizing them layer by level, equipment, and number. For example, the local control layer includes wind power generation equipment and energy storage equipment, which can be further divided into energy storage equipment 322, energy storage equipment 201, etc., according to their specific numbers. Each piece of equipment should have corresponding documentation. The advantage of this approach is that when a fault occurs, the approximate scope of the fault information can be quickly located based on the tree structure.
[0094] In this embodiment, fault information is stored in a hierarchical manner. The fault knowledge graph is split into a fault protection principle graph and a fault equipment graph, which are then associated with the original power system knowledge graph to form a three-layer graph structure.
[0095] The fault assurance event graph stores fault-related information. A document may contain multiple faults, and all different faults are stored in the fault assurance event graph for unified management. Fault information itself is graph data. Fault nodes have value attributes, such as characteristics and fault names, and are also connected to handling nodes. The information of the handling nodes is extracted from the fault solution section of the document. After parsing all handling entries, a graph data consisting of handling steps can be obtained.
[0096] The fault device graph connects upwards to the fault protection event graph and downwards to the large-scale microgrid knowledge graph. It connects to the fault protection event graph via triples and to the microgrid knowledge graph via entity alignment. The fault device graph stores device information related to fault documents, including basic device information, normal status, and device architecture diagrams. Sub-devices within the devices mentioned in the documents, such as switches, buttons, indicator lights, and connectors, are also stored at this level. All devices at this level are associated with faults in the fault protection event graph through "fault association" relationships. Therefore, we need to extract triples like "<Energy Storage 211, Fault Association, Loss of Incoming Power>" to establish the relationship between devices and faults. Faulty devices need to be connected to the entire power grid knowledge to play a greater role. For example, when a fault occurs, the faulty device can be immediately located in the microgrid knowledge graph, allowing a large amount of relevant data to be pushed to users. Simultaneously, the graph data in the microgrid knowledge graph can be utilized. For example, relationships between devices can be used to calculate potentially affected devices, locate equipment maintenance personnel and quickly find responsible parties, and collect and push all relevant real-time data. Therefore, the three-layer graph structure can provide fault information and rich power knowledge, thereby supporting more comprehensive functions.
[0097] S22. Annotate the fault documents with data, including the entities and relationships that appear in the fault.
[0098] Data annotation was performed using the open-source BART tool, and the annotations included entities and relationships that appeared in the fault.
[0099] S23. Use the TPLinker model to extract knowledge from the annotated fault documents to obtain entity models and relation models;
[0100] The TPLinker model is a joint extraction method that can solve the problem of overlapping relations. Given two entities p1 and p2, and a specific relation type r, the model attempts to answer the following three questions:
[0101] a) Are p1 and p2 the start and end positions of two identical entities?
[0102] b) Are p1 and p2 the starting positions of the two entities involved in relation r?
[0103] c) Are p1 and p2 the ending positions of the two entities involved in relation r?
[0104] TPLinker uses a handshaking tagging method to answer these three questions. This method requires labeling each relationship with three token link matrices to represent different tagging results. From these three matrices, all entities and overlapping relationships can be extracted.
[0105] like Figure 2 As shown, based on a given sentence, generate a matrix to represent the relationships between all entities. The relationships that need to be reflected in the annotation mainly include the following:
[0106] 1) Entity Head to Entity Tail (EH-to-ET). The horizontal dashed labels in the diagram indicate that these two positions are the head and tail of an entity, respectively. For example, for the entity "Power Supply Electromechanical Department", the positions corresponding to "supply" and "department" will be marked with vertical dashed labels.
[0107] 2) Subject Head to Object Head (SH-to-OH). The vertical dashed labels in the diagram represent the starting positions of the two entities involved in a relationship. For example, in the triple <"xyz", "employed in", "power supply and electromechanical department">, the starting positions of the two entities are "x" and "supply", so the position ("x", "supply") is marked with a vertical dashed label.
[0108] 3) Subject-to-Object (ST-to-OT). The dashed label in the diagram, similar to the vertical dash, indicates the ending position of each of the two entities involved in a relationship. For example, in the triple <"xyz", "employed in", "power supply and electromechanical department">, the ending positions of the two entities are "z" and "department", so the position ("z", "department") is marked with a dashed label.
[0109] Figure 2 While the displayed matrix can represent various relationships between entities, it is too sparse, resulting in a significant waste of memory. To avoid excessive memory consumption by the sparse matrix, the 1s in the lower triangular region are converted to their corresponding upper triangular regions, and the marker is set to 2. This allows the lower triangular region to be discarded, and all the information can be represented solely by the upper triangular region.
[0110] This annotation method naturally solves the SingleEntityOverlap problem and the Nested Entity problem, but it cannot solve the EntityPairOverlap problem because different relationships cannot be annotated in the same matrix. Therefore, we perform the same annotation work for each type of relationship. However, EH-to-ET represents the position of the entity, so it can be shared across all relationships and only needs to be annotated once. Figure 3 As shown, with N relations, the relation extraction task is decomposed into 2N+1 sequence labeling subtasks. With a sentence length of n, each subtask receives a sequence labeling subtask of length (n...). 2 The sequence is given as input: (+n) / 2.
[0111] Therefore, the decoding process of the tags can be summarized as follows: For each relation, first, find all entities according to EH-to-ET and build a dictionary D. D contains the starting position of each entity and its corresponding entity. Next, decode ST-to-OT to build a set E to store the tail positions of the subject and object. Then, decode SH-to-OH to obtain the starting positions of the subject and object, and search for candidate entities in dictionary D based on these starting positions. Finally, traverse these candidate entities. If the tail index of these entities exists in dictionary E, then they are saved as new relations in set T.
[0112] like Figure 4 As shown, the model uses BERT as the Encoder for a sentence of length n [w1,…,w n After being encoded by the Encoder, the vector representation h of each word can be obtained. i We can concatenate the vectors of any two words and pass them through a fully connected layer to obtain a vector representation of an entity pair:
[0113] h i,j =tanh(W h ·[h i h j ]), j≥j
[0114] Among them W h It is a parameter matrix, b h These are bias vectors, which are learned during training. The HandshakingKernel takes the output of the last layer of the Encoder as input to compute all h... i,j For a sentence of length n, we can obtain n(n+1) / 2 h's. i,j A vector represents the vector representation between each pair of entities.
[0115] S24. Establish a loss function based on the entity model and the relation model, and obtain triples based on the loss function;
[0116] The loss function is the average of the errors from all entity models and relational models, where N is the length of the input sentence. These are the actual labels; E, H, and T represent EH-to-ET, SH-to-OH, and ST-to-OT labels, respectively.
[0117]
[0118] S25. Construct an operation and maintenance knowledge graph based on the triples.
[0119] S3. Perform knowledge fusion on the operation and maintenance knowledge graph and the intelligent microgrid power system knowledge graph to obtain a fused knowledge graph;
[0120] Specifically, S3 includes the following steps:
[0121] S31. Obtain the attribute values of each entity in the operation and maintenance knowledge graph and the intelligent microgrid power system knowledge graph;
[0122] S32. Concatenate the attribute values of each entity in the operation and maintenance knowledge graph and the intelligent microgrid power system knowledge graph together to form a string composed of multiple attributes;
[0123] S33. Encode each string by TF-IDF (Term Frequency-Inverse Document Frequency) to obtain the vector representation of all strings;
[0124] TF-IDF consists of two parts: TF and IDF. TF is also the frequency of each word appearing in a text. First, calculate the tf value of each word in each document, that is, tf i,j :
[0125]
[0126] tf i,j represents the tf value of the word i in the j-th document. n i,j represents the number of times the word i appears in the document j, and n i,j represents the sum of the number of times all words appear in the document j. For relatively long texts, the number of times each word appears may be very high, which will have a relatively large impact on other shorter texts. Therefore, the number of times the word appears is not directly used for calculation. IDF, that is, the inverse document frequency, indicates that if a word appears frequently, but it appears in all documents, then its IDF value should be 0, that is, these words cannot help distinguish these documents. For example, words such as "de" and "shi" appear in each document and have a relatively high frequency, but they are almost useless for judging the content of the document. The calculation formula of IDF is as follows:
[0127]
[0128] N is the total number of documents, x represents any word, and N(x) represents the number of documents containing the word x. The addition of 1 to N(x) in the denominator is a smoothing operation to avoid the denominator being zero. The final value of TF-IDF is determined by the product of TF and IDF.
[0129] sim TF-IDF =tf i,j *idf;
[0130] For an entity, the matcher first needs to represent it as a string, then encode it using TF-IDF to convert the text into a vector representation, and finally use cosine similarity to calculate the similarity, obtaining the similarity cos(θ).
[0131]
[0132] S34. Calculate the similarity between entities in the operation and maintenance knowledge graph and entities in the smart microgrid power system knowledge graph based on the vector representations of all strings. Then, calculate the similarity between vectors of other entities based on the vector representations of other connected entities. Multiply each vector by its respective weight to obtain the final similarity. Complete entity alignment based on the final similarity.
[0133] The similarity calculated solely through step S33 does not take into account adjacent nodes. Therefore, it is necessary to average the vector representations of all adjacent nodes. For two entities to be matched, the similarity is calculated by averaging the vectors of their adjacent nodes, yielding another similarity score, sim. B Ultimately, the similarity between two nodes is determined by both similarity scores: sim = sim A w A +sim B w B In this embodiment, w A and w B The values are 0.7 and 0.3 respectively, w A and w B The value can be modified according to the actual situation.
[0134] S4. For each device node in the fused knowledge graph that has deviated, the random forest method is used to calculate the preliminary risk value corresponding to each device node;
[0135] For each piece of equipment, its current health status is assessed using a series of indicators, such as the equipment's service life, current value, voltage value, current weather conditions, number of work orders scheduled for the next week, and number of past failures. For fluctuating signals like current values, fluctuations within a small range are generally normal. Deviations from this range often indicate potential problems. In S4, the criterion for judging deviations is the degree of deviation of signal x.
[0136]
[0137] Each feature φ i The weights are calculated by the model, where M represents the set of nodes pointing to node A, and w A w represents the weight of node A itself. i This indicates the weight of each of the other nodes.
[0138] For the i-th device, if a total of n attributes are considered, then a vector can be used as the feature representation of the device, and the risk of the node is scored on 11 levels from 0 to 10. In this way, the prediction of the risk value becomes a classification problem.
[0139] S5. Obtain the neighboring device nodes of each device node based on the fused knowledge graph, calculate the weighted average of the initial risk value of the device node and the initial risk values of the neighboring device nodes, and iterate the weights to obtain the final risk value.
[0140] Current algorithms can only obtain the risk value of a device node itself and cannot integrate the risk values of other device nodes in the knowledge graph. Integrating the device node connection relationships stored in the knowledge graph is crucial for assessing the spread of risk; therefore, this embodiment considers including the risk values of connected device nodes as well. Figure 5 Device node A, after receiving the initial risk value from the previous step, still needs to accept risk values contributed by C and D. The final risk score for device node A is... A :
[0141] score A =score A ·w A +∑ i∈M score i ·w i ;
[0142] w A +∑ i∈M w i =1;
[0143] In the calculation w i The value is always 0.1, so for device node A, w A This needs to be determined based on the size of set M. However, when A is connected to multiple device nodes, it may result in device node A having too small a remaining weight, i.e., w. A If w is too small, the risk value of device node A itself will not contribute to the total risk value. To avoid this, it is artificially stipulated that when w... AWhen ≤0.6, w i Instead of using a value of 0.1, the remaining 0.4 weight is evenly distributed. This method is used to calculate the risk value for all device nodes, and after multiple iterations, the final risk value can be obtained.
[0144] Due to the human definition of w A +∑ i∈M w i =1 ensures that during the iteration process, the score A The risk will not increase indefinitely; therefore, this method is a convergent algorithm. Furthermore, since adjacent device nodes also contribute a certain risk value according to their weights, the risk value of adjacent device nodes is also taken into account.
[0145] S6. Provide early warnings on the operation and maintenance risks of device nodes based on the final risk value.
[0146] Risk prediction is used to assess the risk value of critical equipment nodes, mainly considering two factors: the condition of the equipment itself and the impact of failure. A quantitative score is given by combining these two factors. The higher the risk value, the greater the risk.
[0147] Example 2
[0148] A city microgrid operation and maintenance risk prediction device, based on the aforementioned city microgrid operation and maintenance risk prediction method, such as... Figure 6 As shown, it includes:
[0149] The Smart Microgrid Power System Knowledge Graph Construction Module is used to acquire smart microgrid power system data and construct a knowledge graph for the smart microgrid power system.
[0150] Operations and Maintenance Knowledge Graph Construction Module: Used to acquire fault documents and construct an operations and maintenance knowledge graph;
[0151] Fusion module: Used to fuse the operation and maintenance knowledge graph and the smart microgrid power system knowledge graph to obtain a fused knowledge graph;
[0152] Preliminary risk value calculation module: This module is used to calculate the preliminary risk value for each device node that has deviated in the fused knowledge graph using the random forest method.
[0153] Final risk value calculation module: It is used to obtain the neighboring device nodes of each device node based on the fused knowledge graph, calculate the weighted initial risk value of the device node and the initial risk values of the neighboring device nodes, and iterate the weights to obtain the final risk value;
[0154] Early warning module: Used to provide early warnings about the operational risks of device nodes based on the final risk value.
[0155] Example 3
[0156] The present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement a method for predicting urban microgrid operation and maintenance risks as described in Embodiment 1.
[0157] Example 4
[0158] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements a method for predicting urban microgrid operation and maintenance risks as described in Embodiment 1.
[0159] As is known from common technical knowledge, this invention can be implemented through other embodiments that do not depart from its spirit or essential characteristics. Therefore, the disclosed embodiments described above are merely illustrative in all respects and are not the only ones. All modifications within the scope of this invention or its equivalents are included in this invention.
[0160] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0161] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0162] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1The function specified in one or more boxes.
[0163] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0164] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the claims of the present invention.
Claims
1. A method for predicting operation and maintenance risks of urban microgrids, characterized in that, Includes the following steps: Acquire data from the smart microgrid power system, and construct a knowledge graph of the smart microgrid power system based on the data. Obtain fault documents and construct an operation and maintenance knowledge graph based on the fault documents; The operation and maintenance knowledge graph and the smart microgrid power system knowledge graph are fused to obtain a fused knowledge graph. For the signals of each device node in the fused knowledge graph Compared with the preset normal range Compare, when the signal Exceeding the preset normal range When this occurs, the device node is identified as the one that has deviated from its intended path. The random forest method is then used to calculate the initial risk value for each device node. The signals include one or more of the following: the device's service life, current value, voltage value, weather conditions, number of work orders, and number of faults. Based on the fused knowledge graph, the neighboring device nodes of each device node are obtained. The initial risk value of the device node itself is multiplied by its own weight. The initial risk value of each neighboring device node is multiplied by its corresponding neighboring node weight. All products are summed to obtain the updated risk value of the device node. The sum of the weight of the device node itself and the weights of all neighboring nodes is equal to 1. The above calculation is repeated until the risk values of all device nodes converge to obtain the final risk value of each device node. Early warnings are issued regarding the operational risks of device nodes based on the final risk value.
2. The method for predicting urban microgrid operation and maintenance risks according to claim 1, characterized in that, The process of acquiring smart microgrid power system data and constructing a smart microgrid power system knowledge graph based on the smart microgrid power system data specifically includes the following steps: Acquire data from smart microgrid power systems; The ontology is obtained by using a seven-step method from top to bottom and through several iterations based on data from the smart microgrid power system. Entities and triples are obtained by extracting knowledge from several data sources based on mapping rules. Extract device attribute values, node attribute values, inter-device grid topology relationships, and inter-node grid topology relationships from semi-structured data in existing power grid knowledge bases, and construct entities and relationships using these data. Entities and triples are matched according to node names, and then the union of all value attributes is taken to obtain the knowledge graph of the smart microgrid power system.
3. The method for predicting urban microgrid operation and maintenance risks according to claim 2, characterized in that, The process of extracting entities and triples from several data sources based on mapping rules specifically includes the following steps: Entity extraction is performed on several data sources; Write SQL statements for all concepts and relationships in the ontology and configure them in Mybatis-plus; Entities are obtained by extracting from several data sources; Based on the SQL statements generated from the value attributes in the ontology, the entity data is extracted into key-value pairs in key-value format, and then imported into the neo4j graph database through dynamically generated Cypher statements to complete the entity extraction. Extract relations from several data sources; The relationships between any two different entities can be extracted from several data sources. After obtaining the IDs of the two entities based on their relationship, the IDs are then imported into the Neo4j graph database using dynamically generated Cypher statements to complete the relationship extraction.
4. The method for predicting urban microgrid operation and maintenance risks according to claim 2, characterized in that, The knowledge extraction is performed using Spring-Boot and Mybatis-Plus.
5. The method for predicting urban microgrid operation and maintenance risks according to claim 1, characterized in that, When acquiring fault documents and constructing an operations and maintenance knowledge graph based on those documents, the specific steps include: Obtain fault documents and construct a fault knowledge graph; Annotate the faulty documents with data, including the entities and relationships that appear in the fault. The TPLinker model was used to extract knowledge from the annotated fault documents to obtain entity models and relation models. A loss function is established based on the entity model and the relation model, and triples are obtained based on the loss function. An operations and maintenance knowledge graph is constructed based on triples.
6. The method for predicting urban microgrid operation and maintenance risks according to claim 1, characterized in that, The process of fusing the operation and maintenance knowledge graph and the smart microgrid power system knowledge graph to obtain a fused knowledge graph specifically includes the following steps: Obtain the attribute values of each entity in the operation and maintenance knowledge graph and the smart microgrid power system knowledge graph; The attribute values of each entity in the operation and maintenance knowledge graph and the smart microgrid power system knowledge graph are concatenated together to form a string composed of multiple attributes; Each string is encoded using TF-IDF to obtain a vector representation of all strings; The similarity between entities in the operation and maintenance knowledge graph and entities in the smart microgrid power system knowledge graph is calculated based on the vector representations of all strings. Then, the similarity between vectors of other entities is calculated based on the vector representations of other connected entities. Finally, the similarity is obtained by multiplying each vector by its respective weight. Entity alignment is then completed based on the final similarity.
7. The method for predicting urban microgrid operation and maintenance risks according to claim 1, characterized in that, The sum of the weight of the device node itself and the weights of all its neighboring nodes is equal to 1, as detailed below: ; in, For the weight of the device node itself, The weights of adjacent nodes, Represents the set of adjacent device nodes. The value is 0.1, when hour, Instead of taking the value 0.1, the remaining weights are evenly distributed.
8. A device for predicting operational risks in urban microgrids, characterized in that, include: The module for constructing a knowledge graph of a smart microgrid power system is used to acquire data on a smart microgrid power system and construct a knowledge graph of the smart microgrid power system based on the data. Operations and maintenance knowledge graph construction module: used to obtain fault documents and construct an operations and maintenance knowledge graph based on the fault documents; Fusion module: Used to fuse the operation and maintenance knowledge graph and the smart microgrid power system knowledge graph to obtain a fused knowledge graph; Preliminary risk value calculation module: used to calculate the signal of each device node in the fused knowledge graph. Compared with the preset normal range Compare, when the signal Exceeding the preset normal range When this occurs, the device node is identified as the one causing the deviation. A random forest algorithm is then used to calculate the initial risk value for each device node. The signals include one or more of the following: the device's service life, current value, voltage value, weather conditions, number of work orders, and number of faults. The final risk value calculation module is used to obtain the neighboring device nodes of each device node based on the fused knowledge graph, multiply the device node's own initial risk value by its own weight, multiply the initial risk value of each neighboring device node by its corresponding neighboring node weight, and sum all the products to obtain the updated risk value of the device node; wherein, the sum of the device node's own weight and the weights of all neighboring nodes equals 1; repeat the above calculation until the risk values of all device nodes converge to obtain the final risk value of each device node; Early warning module: Used to provide early warnings about the operational risks of device nodes based on the final risk value.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the urban microgrid operation and maintenance risk prediction method according to any one of claims 1-7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements a method for predicting the operation and maintenance risks of an urban microgrid as described in any one of claims 1-7.