Construction method and device of power database, electronic equipment and storage medium

By building a power database based on knowledge graph, the efficiency and consistency of the power database when processing multi-source power data is solved, effective support for power grid security audits is achieved, and security risk and vulnerability detection capabilities are improved.

CN119003489APending Publication Date: 2024-11-22GUANGDONG POWER GRID CO LTD +1
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411118934.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

The existing power database has problems such as data update difficulties, low data consistency, low processing efficiency and limited dynamic data processing capabilities when processing multi-source power data, which makes it difficult to carry out the power grid security audit work accurately and quickly, and cannot be discovered and eliminated in a timely manner. Potential security risks and vulnerabilities.

Method used

By obtaining multi-source power data, extracting power keywords, generating initial knowledge graphs, and inputting them into preset knowledge inference models for adjustments, generating target knowledge graphs, and finally building a power database. This method uses the knowledge inference model to optimize the knowledge graph, improving the comprehensiveness and accuracy of the database.

Benefits of technology

It improves the comprehensiveness and accuracy of the power database, provides effective data support for grid security audits, and enhances the ability to detect and eliminate grid security risks and vulnerabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119003489A_ABST
    Figure CN119003489A_ABST
Patent Text Reader

Abstract

The invention discloses a construction method and device of a power database, electronic equipment and a storage medium. The method comprises the following steps: acquiring multi-source power data, and extracting power keywords from the multi-source power data; according to the power keywords, an initial knowledge graph is generated, the initial knowledge graph comprises a plurality of pieces of triple information, and one piece of triple information is used for describing features and relations and / or attributes of one knowledge subject in the initial knowledge graph; inputting the initial knowledge graph into a preset knowledge reasoning model to obtain an evaluation parameter of each piece of triple information; according to the evaluation parameter of each piece of triple information, adjusting the initial knowledge graph to obtain a target knowledge graph; and constructing a power database according to the target knowledge graph. According to the scheme provided by the invention, a comprehensive and accurate power database can be established for the multi-source power data, and effective data support is provided for subsequent power grid safety audit work.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of power grid technology, and in particular to a method, device, electronic equipment and storage medium for constructing a power database. Background Art

[0002] With the rapid development of the power system, the amount of data has become more numerous and complex, bringing greater challenges to the security audit of the power grid.

[0003] At present, the security audit of power grids often relies on power databases. Existing power databases are mainly built based on rules or manual definitions. However, such power databases have problems such as difficulty in data update, low data consistency, and low processing efficiency. In particular, the processing capacity of dynamic data is limited, which makes it difficult to accurately and quickly carry out security audits and cannot timely discover and eliminate potential security risks and vulnerabilities. Summary of the invention

[0004] The present invention provides a method, device, electronic device and storage medium for constructing an electric power database, which can establish a comprehensive and accurate electric power database for multi-source electric power data and provide effective data support for subsequent power grid security audit work.

[0005] According to one aspect of the present invention, a method for constructing a power database is provided, comprising:

[0006] Acquire multi-source power data and extract power keywords from the multi-source power data;

[0007] Generate an initial knowledge graph according to the power keywords, wherein the initial knowledge graph includes a plurality of triple information, and a triple information is used to describe the characteristics of a knowledge subject in the initial knowledge graph and its relationship and / or attribute;

[0008] Input the initial knowledge graph into the preset knowledge reasoning model to obtain the evaluation parameters of each triple information;

[0009] According to the evaluation parameters of each triple information, the initial knowledge graph is adjusted to obtain the target knowledge graph;

[0010] Construct a power database based on the target knowledge graph.

[0011] Optionally, the multi-source power data includes dynamic data and static data, and the power keywords include dynamic keywords and static keywords;

[0012] Extract power keywords from multi-source power data, including:

[0013] Sampling the dynamic data to obtain sampled data, and extracting dynamic keywords matching the preset features from the sampled data;

[0014] After preprocessing the static data, static keywords are extracted from the static data, wherein the preprocessing includes at least one of data standardization, data cleaning, and data smoothing.

[0015] Optionally, generate an initial knowledge graph based on power keywords, including:

[0016] According to the power keywords, determine the candidate entities and candidate features;

[0017] Construct candidate triples based on candidate entities and candidate features;

[0018] The screening function is used to determine the triple information from the candidate triples, and the initial knowledge graph is generated based on the triple information.

[0019] Optionally, based on the power keyword, candidate entities and candidate features are determined, including:

[0020] Determine candidate entities according to power keywords and joint distribution functions, where the joint distribution function is used to characterize the similarity between two entities on different features;

[0021] According to the power keywords and the mutual information function, candidate features are determined, wherein the mutual information function is used to characterize the correlation between features.

[0022] Optionally, for any evaluation parameter of triple information, the initial knowledge graph is adjusted according to the evaluation parameter of the triple information, including:

[0023] If the evaluation parameter of the triple information is greater than the first preset threshold, the triple information is retained in the initial knowledge graph;

[0024] If the evaluation parameter of the triple information is less than the second preset threshold, the triple information is deleted from the initial knowledge graph.

[0025] Optionally, after retaining the triple information in the initial knowledge graph, it also includes:

[0026] Determine associated triples of the triple information, wherein the associated triples are triples that are not included in the initial knowledge graph and have an associated relationship with the triple information;

[0027] Add the associated triples to the initial knowledge graph.

[0028] Optionally, the training method of the knowledge reasoning model includes:

[0029] Obtain training samples and test samples;

[0030] According to the training samples, the graph neural network GNN model is trained to obtain the initial model;

[0031] Input the test sample into the initial model and determine the global loss function of the initial model, wherein the global loss function includes at least a local loss function and a correction function. The local loss function is used to measure the difference between the probability distribution predicted by the model and the actual distribution, and the correction function is used to prevent the model from overfitting.

[0032] If the global loss function meets the training end condition, the initial model is used as the knowledge reasoning model;

[0033] If the global loss function does not meet the training end condition, the initial model is used as the GNN model, and the process returns to execute the step of training the GNN model according to the training samples to obtain the initial model.

[0034] According to another aspect of the present invention, there is provided a device for constructing a power database, comprising: a keyword extraction module, a graph generation module, a graph adjustment module and a database construction module;

[0035] A keyword extraction module, used to obtain multi-source power data and extract power keywords from the multi-source power data;

[0036] A graph generation module, used to generate an initial knowledge graph based on power keywords, wherein the initial knowledge graph includes a plurality of triple information, and a triple information is used to describe the characteristics of a knowledge subject in the initial knowledge graph and its relationship and / or attribute;

[0037] A graph adjustment module is used to input the initial knowledge graph into a preset knowledge reasoning model to obtain evaluation parameters for each triple information; and to adjust the initial knowledge graph according to the evaluation parameters for each triple information to obtain a target knowledge graph;

[0038] The database construction module is used to construct the power database based on the target knowledge graph.

[0039] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0040] at least one processor; and a memory in communication with the at least one processor; wherein,

[0041] The memory stores a computer program that can be executed by at least one processor. The computer program is executed by at least one processor so that the at least one processor can execute the method for constructing a power database according to any embodiment of the present invention.

[0042] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to implement the method for constructing a power database according to any embodiment of the present invention when executed by a processor.

[0043] The technical solution of the embodiment of the present invention obtains multi-source power data and extracts power keywords from the multi-source power data, thereby generating an initial knowledge graph based on the power keywords, further inputting the initial knowledge graph into a preset knowledge reasoning model, adjusting the initial knowledge graph according to the output of the knowledge reasoning model, obtaining a target knowledge graph, and finally constructing a power database based on the target knowledge graph. In the method for constructing the power database, on the one hand, since the initial knowledge graph is generated based on the power keywords extracted from the multi-source power data, the initial knowledge graph fully considers the influence of different power data (such as dynamic data, static data, etc.) on the graph, laying the foundation for the subsequent construction of the power database. On the other hand, by optimizing the initial knowledge graph using the knowledge reasoning model to obtain the target knowledge graph, the stability of the knowledge graph can be guaranteed while improving the quality of the knowledge graph, thereby further improving the comprehensiveness and accuracy of the power database, and providing effective data support for subsequent power grid security audits.

[0044] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0046] Figure 1 It is a flowchart of a method for constructing a power database provided by an embodiment of the present invention;

[0047] Figure 2 It is a flowchart of a method for training a knowledge reasoning model provided by an embodiment of the present invention;

[0048] Figure 3 It is a structural schematic diagram of a device for constructing a power database provided by an embodiment of the present invention;

[0049] Figure 4 is a structural schematic diagram of another device for constructing a power database provided by an embodiment of the present invention;

[0050] Figure 5 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0051] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0052] It should be noted that the terms "first", "second", "initial", "target", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0053] Figure 1 This is a flow chart of a method for constructing a power database provided by an embodiment of the present invention. This embodiment is applicable to the case of constructing a database of a power system. The method can be executed by a power database construction device. The power database construction device can be implemented in the form of hardware and / or software. The power database construction device can be configured in an electronic device (such as a computer device, a server, etc.). Figure 1 As shown, the method includes:

[0054] S110 , acquiring multi-source power data, and extracting power keywords from the multi-source power data.

[0055] The electronic device can obtain multi-source power data through the acquisition unit. Multi-source power data refers to a collection of power data from different sources, different types, and different formats.

[0056] Multi-source power data can be divided according to the source, which may include distribution network data, substation data, transmission line data, user data, etc.; multi-source power data can be divided according to the type, which may include dynamic data and static data; multi-source power data can be divided according to the format, which may include tabular data, time series data, text data, multimedia data, log data, etc.

[0057] Power keywords are words that can reflect important information about the power system. Extracting power keywords from multi-source power data can greatly reduce the amount of data processing, improve data processing efficiency, and save computing power.

[0058] In a possible implementation, the method for extracting power keywords from multi-source power data can adopt any of the following methods: 1) counting the frequency of occurrence of each word in the multi-source power data, and selecting words with higher frequency of occurrence as keywords; 2) using a professional power dictionary to match the multi-source power data, and extracting words that match the power dictionary as keywords; 3) using classification algorithms, decision trees, random forests and other machine learning methods to train the model, and using the model to extract power keywords from multi-source power data; 4) clustering the multi-source power data, and then extracting keywords from the center or representative document of each cluster.

[0059] In another possible implementation, the multi-source power data includes dynamic data and static data according to the type, and the electronic device can extract power keywords from the dynamic data and the static data respectively to obtain dynamic keywords and static keywords. In other words, the power keywords include dynamic keywords and static keywords.

[0060] Exemplarily, the method for an electronic device to extract power keywords from dynamic data includes: sampling the dynamic data to obtain sampled data, and extracting dynamic keywords matching preset features from the sampled data.

[0061] Dynamic data is data that changes based on the operation of the power grid. For example, power grid operation status data, routing status data, and network topology indication data (indicating whether the network topology is a ring). Due to the large amount of dynamic data, it is necessary to first sample and select a representative part of the data (i.e., sampled data) to reduce the data size, ensure data processing efficiency and analysis feasibility, and then extract dynamic keywords that match the preset features from the sampled data.

[0062] The preset features may be features that are manually selected in advance and are related to network security and configuration.

[0063] In another exemplary embodiment, a method for an electronic device to extract power keywords from static data includes: extracting static keywords from the static data after preprocessing the static data, wherein the preprocessing includes at least one of data standardization, data cleaning, and data smoothing.

[0064] Static data refers to data related to the power grid that is not changeable. For example, the power grid acceptance specifications, safety protection specifications, power grid management specifications, etc. are data with fixed requirements. Static data is usually collected from manuals, instructions, and specifications, and is preprocessed to reduce data noise, and then keyword extraction is performed to obtain static keywords.

[0065] Among them, data standardization may include but is not limited to word form restoration and stem separation; data cleaning may include but is not limited to removing special characters, punctuation marks, and stop words; data smoothing processing may include but is not limited to deduplication processing and text annotation operations.

[0066] S120. Generate an initial knowledge graph based on power keywords, wherein the initial knowledge graph includes multiple triples of information, and one triple is used to describe the characteristics of a knowledge subject in the initial knowledge graph and its relationships and / or attributes.

[0067] The initial knowledge graph is a power knowledge graph, which is a structured knowledge representation method that organizes and stores entities (such as equipment, concepts, events, etc.), attributes (such as equipment parameters, time, location, etc.) related to the power system and their relationships (such as component relationships, control relationships, influence relationships, etc.) in the form of a graph. That is, the initial knowledge graph includes multiple triples of information, and a triple is used to describe the characteristics of a knowledge subject in the initial knowledge graph and its relationships and / or attributes.

[0068] Specifically, the method of "generating an initial knowledge graph according to power keywords" in step S120 may include the following three steps:

[0069] Step A1: Determine candidate entities and candidate features based on power keywords.

[0070] Candidate entities are entities that may become knowledge subjects in the initial knowledge graph, and candidate features are features that may exist in the initial knowledge graph.

[0071] In one embodiment, the candidate entity can be determined based on the power keyword and the joint distribution function, wherein the joint distribution function is used to characterize the similarity between two entities in different features. The candidate features can be determined based on the power keyword and the mutual information function, wherein the mutual information function is used to characterize the correlation between the features.

[0072] Exemplarily, the joint distribution function can be expressed as: The mutual information function can be expressed as:

[0073] Wherein, r and f both represent specific features, which are used to measure and describe the relationship or feature difference between different entities (such as distribution transformer configuration data entities); e i and e j They represent two entities with the same electrical knowledge; M(r) represents the difference parameter of feature r; v r (e i ,e j ) means e i and e j The difference function on feature r; P(r,f) represents the joint distribution function of features r and f, which is used to measure the differences between different entities on features r and f. Similarly, P(r) represents the joint distribution function of feature r, which is used to measure the differences between different entities on feature r, and P(f) represents the joint distribution function of feature f, which is used to measure the differences between different entities on feature f; MI(r,f) represents the interdependence or correlation between features r and f.

[0074] The electronic device can first use a joint distribution function to analyze entities (including at least one power keyword) and cluster entities with similar or related features; then use a mutual information function to analyze features (related to at least one power keyword), identify feature pairs with high mutual information values, and determine which features are closely related logically or functionally; thereby determining candidate entities and candidate features.

[0075] Step A2: Construct candidate triples based on candidate entities and candidate features.

[0076] When constructing candidate triples, the candidate entities can be used as a benchmark to put the associated candidate entities and candidate features into a candidate triple.

[0077] Step A3: Use the screening function to determine the triple information from the candidate triples, and generate the initial knowledge graph based on the triple information.

[0078] After constructing the candidate triples, the electronic device can further screen the candidate triples to improve the accuracy of the initial knowledge graph.

[0079] Exemplarily, the screening function can be expressed as:

[0080] Among them, p(y|x) represents the probability of occurrence of feature y given feature x; f i (x, y) is the characteristic function, which describes the association between the feature and the relationship; i is the characteristic function f iThe weight parameter of (x, y) indicates the importance of the feature function; Z(X) is the normalization factor used to ensure that the sum of the probabilities of all possible relationships is 1; k is the number of candidate triples.

[0081] By calculating the occurrence probability of each candidate triple through the screening function, the rationality of the candidate triple as triple information can be determined.

[0082] After the triple information is determined, the entities in the triple information can be used as knowledge subjects, and the relationships in the triple information can be used as connections between knowledge subjects to form an initial knowledge graph, and the features and attributes in the triple information can be annotated in the initial knowledge graph.

[0083] Optionally, the initial knowledge graph can be stored in a Neo4j graph database. Neo4j can be seen as a high-performance graph engine that has all the features of a mature database.

[0084] S130. Input the initial knowledge graph into a preset knowledge reasoning model to obtain evaluation parameters for each triple information.

[0085] The knowledge reasoning model is a pre-trained model used to optimize the initial knowledge graph. The knowledge reasoning model can be trained based on Graph Neural Networks (GNN), such as RED-GNN.

[0086] In one embodiment, Figure 2 FIG. 1 is a flow chart of a method for training a knowledge reasoning model provided by an embodiment of the present invention. Figure 2 As shown, the method for training a knowledge reasoning model includes steps B1-B6.

[0087] Step B1: Obtain training samples and test samples.

[0088] Among them, both training samples and test samples are knowledge graphs.

[0089] Step B2: Train the GNN model based on the training samples to obtain the initial model.

[0090] Exemplarily, the GNN model includes an input layer, a graph convolution layer (GCN Layer), an attention mechanism (AttentionMechanism) and a multi-layer perceptron (MLP). The graph convolution layer is used to extract high-order features of the nodes (i.e., knowledge entities) and edges (i.e., connections between knowledge entities) of the knowledge graph, and to update the feature representation of each node by aggregating the features of neighboring nodes. Specifically, the new features of each node are updated by the feature representations of its neighboring nodes and the edge features between neighboring nodes. Furthermore, different weights are assigned to different neighboring nodes through the attention mechanism to highlight important relationships and nodes. After the graph convolution layer outputs the features, these features are input into the multi-layer perceptron (MLP) for further nonlinear transformation. The architecture of the MLP includes an input layer, several hidden layers, and an output layer. The hidden layer consists of fully connected layers, each of which is followed by a ReLU activation function, and the output layer is a fully connected layer that outputs the predicted relationship probability.

[0091] Step B3: Input the test sample into the initial model and determine the global loss function of the initial model, where the global loss function includes at least a local loss function and a correction function. The local loss function is used to measure the difference between the probability distribution predicted by the model and the actual distribution, and the correction function is used to prevent the model from overfitting.

[0092] During the model training phase, the feature representations of nodes and edges are calculated through forward propagation, and the scoring function value of each node for each relationship is calculated. Then the global loss function is calculated and the model parameters are updated through back propagation. In this way, the model gradually improves its performance on the training data while maintaining good generalization ability to ensure the accuracy of predictions on unseen data.

[0093] Exemplarily, the global loss function can be expressed as:

[0094] in, It is a local loss function, usually a cross entropy loss function, which is used to measure the difference between the probability distribution predicted by the model and the actual distribution; is the correction function, ε is a weighted hyperparameter used to control the influence of the regularization term, is the regularization term, It is used to prevent the model from overfitting, so that the model does not perform too well on the training data but performs poorly on unseen data.

[0095] Step B4: Determine whether the global loss function meets the training end condition. If yes, execute step B5; if no, execute step B6.

[0096] Among them, the training end condition includes at least one of the following: the value of the global loss function is less than or equal to the second preset threshold; the global loss function converges.

[0097] Step B5: Use the initial model as a knowledge reasoning model.

[0098] Step B6: Use the initial model as the GNN model and return to execute step B2.

[0099] In one embodiment, the knowledge reasoning model may determine the evaluation parameter of each triple information according to the scoring function.

[0100] Exemplarily, the scoring function can be expressed as:

[0101] Among them, φ() represents the semantic feature function, Represents semantic features, represents the transpose of the target entity feature vector, e h ,e r ,e t Represents triple information.

[0102] The relationship strength of entity features is measured by calculating the dot product between semantic features and relationship features and target entity features. The higher the score, the greater the possibility that the entity feature has the relationship; the lower the score, the smaller the possibility that the entity feature has the relationship.

[0103] S140. Adjust the initial knowledge graph according to the evaluation parameters of each triple information to obtain the target knowledge graph.

[0104] Since there may be multiple triples, the initial knowledge graph can be adjusted multiple times. The initial knowledge graph is adjusted once according to the evaluation parameter of a triple.

[0105] For any evaluation parameter of triple information, the adjustment rules of the initial knowledge graph may include:

[0106] Rule 1) If the evaluation parameter of the triple information is greater than the first preset threshold, the triple information is retained in the initial knowledge graph.

[0107] When the evaluation parameter of the triple information is greater than the first preset threshold, it indicates that the strength of the relationship between the entities is strong. In this case, the initial knowledge graph will retain or complete the relationship to ensure that the graph contains strongly associated entity relationships. For example, if the scoring function calculates that the score of the voltage relationship between the transformer and 500V is higher than the first preset threshold, this means that the relationship has a high degree of credibility in practical applications and should therefore be retained in the initial knowledge graph.

[0108] Optionally, after retaining the triple information in the initial knowledge graph, the associated triples of the triple information can also be determined, wherein the associated triples are triples that are not included in the initial knowledge graph and have an associated relationship with the triple information; the associated triples are added to the initial knowledge graph, thereby completing the completion of the knowledge graph.

[0109] Rule 2) If the evaluation parameter of the triple information is less than the second preset threshold, the triple information is deleted from the initial knowledge graph.

[0110] When the evaluation parameter of the triple information is less than the second preset threshold, it indicates that the strength of the relationship between the entities is weak. In this case, the initial knowledge graph can delete the triple information to improve the accuracy and simplicity of the graph. For example, if the scoring function calculates that the relationship score between a transformer and a voltage value is lower than the second preset threshold, this indicates that the relationship is unlikely to exist and can be deleted from the initial knowledge graph.

[0111] S150. Construct a power database based on the target knowledge graph.

[0112] In one embodiment, the power database may include a dynamic database and a static database.

[0113] Dynamic databases can contain real-time system logs, user activity records, etc., and their fields include ID (primary key), timestamp, event type, event details, etc. Static databases can store static configuration data, such as standard and specification configurations, and their fields include ID, configuration name, configuration value, etc.

[0114] Optionally, the power database can have a query interface and an update interface to implement the retrieval, display, and update functions of these data. The query interface will support parameter input, such as time range and keywords, and return the query results in JSON format. The update interface will allow update operations on the content, accept the configuration item name and new value as parameters, and return status information on the success or failure of the update. Use the front-end framework to build a friendly user interface, and interact with the back-end through AJAX requests. The entire system will adopt a front-end and back-end separation architecture. The back-end uses a Web framework to build API services to implement database interaction and business logic processing, and the front-end is responsible for the display of the user interface and user interaction.

[0115] The technical solution of the embodiment of the present invention obtains multi-source power data and extracts power keywords from the multi-source power data, thereby generating an initial knowledge graph based on the power keywords, further inputting the initial knowledge graph into a preset knowledge reasoning model, adjusting the initial knowledge graph according to the output of the knowledge reasoning model, obtaining a target knowledge graph, and finally constructing a power database based on the target knowledge graph. In the method for constructing the power database, on the one hand, since the initial knowledge graph is generated based on the power keywords extracted from the multi-source power data, the initial knowledge graph fully considers the influence of different power data (such as dynamic data, static data, etc.) on the graph, laying the foundation for the subsequent construction of the power database. On the other hand, by optimizing the initial knowledge graph using the knowledge reasoning model to obtain the target knowledge graph, the stability of the knowledge graph can be guaranteed while improving the quality of the knowledge graph, thereby further improving the comprehensiveness and accuracy of the power database, and providing effective data support for subsequent power grid security audits.

[0116] Figure 3 Schematic diagram of a device for constructing a power database provided by an embodiment of the present invention. Figure 3 As shown, the device includes: a keyword extraction module 301, a graph generation module 302, a graph adjustment module 303 and a database construction module 304.

[0117] A keyword extraction module 301 is used to obtain multi-source power data and extract power keywords from the multi-source power data;

[0118] A graph generation module 302 is used to generate an initial knowledge graph based on power keywords, wherein the initial knowledge graph includes a plurality of triples of information, and a triple is used to describe the characteristics of a knowledge subject in the initial knowledge graph and its relationship and / or attributes;

[0119] The graph adjustment module 303 is used to input the initial knowledge graph into a preset knowledge reasoning model to obtain the evaluation parameters of each triple information; and adjust the initial knowledge graph according to the evaluation parameters of each triple information to obtain the target knowledge graph;

[0120] The database construction module 304 is used to construct a power database according to the target knowledge graph.

[0121] Optionally, the multi-source power data includes dynamic data and static data, and the power keywords include dynamic keywords and static keywords;

[0122] The keyword extraction module 301 is specifically used to sample dynamic data to obtain sampled data, and extract dynamic keywords matching preset features from the sampled data; after preprocessing the static data, static keywords are extracted from the static data, wherein the preprocessing includes at least one of data standardization, data cleaning, and data smoothing.

[0123] Optionally, the graph generation module 302 is specifically used to determine candidate entities and candidate features based on power keywords; construct candidate triples based on the candidate entities and candidate features; determine triple information from the candidate triples using a screening function, and generate an initial knowledge graph based on the triple information.

[0124] Optionally, the graph generation module 302 is specifically used to determine candidate entities based on power keywords and a joint distribution function, wherein the joint distribution function is used to characterize the similarity between two entities in different features; and to determine candidate features based on power keywords and a mutual information function, wherein the mutual information function is used to characterize the correlation between features.

[0125] Optionally, the graph adjustment module 303 is specifically used to retain the triple information in the initial knowledge graph if the evaluation parameter of the triple information is greater than a first preset threshold; if the evaluation parameter of the triple information is less than a second preset threshold, then delete the triple information in the initial knowledge graph.

[0126] Optionally, the graph adjustment module 303 is also used to determine the associated triples of the triple information after retaining the triple information in the initial knowledge graph, wherein the associated triples are triples that are not included in the initial knowledge graph and have an associated relationship with the triple information; and add the associated triples to the initial knowledge graph.

[0127] Optional, combined Figure 3 , Figure 4 FIG. 1 is a schematic diagram of another structure of a power database construction device provided by an embodiment of the present invention. Figure 4 As shown, the device also includes: a model training module 305;

[0128] The model training module 305 is used to obtain training samples and test samples; according to the training samples, the graph neural network GNN model is trained to obtain an initial model; the test samples are input into the initial model to determine the global loss function of the initial model, wherein the global loss function includes at least a local loss function and a correction function, the local loss function is used to measure the difference between the probability distribution predicted by the model and the actual distribution, and the correction function is used to prevent the model from overfitting; if the global loss function meets the training end condition, the initial model is used as a knowledge reasoning model; if the global loss function does not meet the training end condition, the initial model is used as a GNN model, and the step of training the GNN model according to the training samples to obtain the initial model is returned to be executed.

[0129] The apparatus for constructing a power database provided in the embodiment of the present invention can execute the method for constructing a power database provided in any embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method.

[0130] Figure 5 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0131] like Figure 5 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0132] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0133] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a method for constructing a power database.

[0134] In some embodiments, the method for constructing a power database may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method for constructing a power database described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the method for constructing a power database in any other appropriate manner (e.g., by means of firmware).

[0135] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0136] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0137] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0138] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0139] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0140] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0141] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the behavior operation determination method provided by any embodiment of the present invention.

[0142] In the process of implementation, the computer program product can be written in one or more programming languages ​​or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0143] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0144] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for constructing a power database, characterized in that: include: Acquire multi-source power data, and extract power keywords from the multi-source power data; Generate an initial knowledge graph according to the power keyword, wherein the initial knowledge graph includes a plurality of triple information, and one of the triple information is used to describe the characteristics of a knowledge subject in the initial knowledge graph and its relationship and / or attribute; Inputting the initial knowledge graph into a preset knowledge reasoning model to obtain evaluation parameters for each triplet of information; According to the evaluation parameters of each triple information, the initial knowledge graph is adjusted to obtain a target knowledge graph; According to the target knowledge graph, a power database is constructed.

2. The method for constructing a power database according to claim 1, characterized in that: The multi-source power data includes dynamic data and static data, and the power keywords include dynamic keywords and static keywords; The extracting power keywords from the multi-source power data comprises: Sampling the dynamic data to obtain sampled data, and extracting the dynamic keywords matching the preset features from the sampled data; After preprocessing the static data, the static keywords are extracted from the static data, wherein the preprocessing includes at least one of data standardization, data cleaning, and data smoothing.

3. The method for constructing a power database according to claim 1, characterized in that: The generating of an initial knowledge graph according to the power keywords includes: Determine candidate entities and candidate features according to the power keywords; Constructing a candidate triple according to the candidate entity and the candidate feature; The triple information is determined from the candidate triples using a screening function, and the initial knowledge graph is generated based on the triple information.

4. The method for constructing a power database according to claim 3, characterized in that: The determining of candidate entities and candidate features according to the power keyword includes: Determining the candidate entity according to the power keyword and the joint distribution function, wherein the joint distribution function is used to characterize the similarity between two entities in different features; The candidate features are determined according to the power keywords and the mutual information function, wherein the mutual information function is used to characterize the correlation between features.

5. The method for constructing a power database according to claim 1, characterized in that: For any evaluation parameter of the triple information, adjusting the initial knowledge graph according to the evaluation parameter of the triple information includes: If the evaluation parameter of the triple information is greater than a first preset threshold, retaining the triple information in the initial knowledge graph; If the evaluation parameter of the triple information is less than a second preset threshold, the triple information is deleted from the initial knowledge graph.

6. The method for constructing a power database according to claim 5, characterized in that: After retaining the triple information in the initial knowledge graph, the method further includes: Determine an associated triple of the triple information, wherein the associated triple is a triple that is not included in the initial knowledge graph and has an associated relationship with the triple information; Add the associated triples to the initial knowledge graph.

7. The method for constructing a power database according to claim 1, characterized in that: The training method of the knowledge reasoning model includes: Obtain training samples and test samples; According to the training samples, the graph neural network GNN model is trained to obtain an initial model; Inputting the test sample into the initial model, determining a global loss function of the initial model, wherein the global loss function at least includes a local loss function and a correction function, the local loss function is used to measure the difference between the probability distribution predicted by the model and the actual distribution, and the correction function is used to prevent the model from overfitting; If the global loss function satisfies the training end condition, the initial model is used as the knowledge reasoning model; If the global loss function does not meet the training end condition, the initial model is used as the GNN model, and the step of training the GNN model according to the training samples to obtain the initial model is returned.

8. A device for constructing a power database, characterized in that: include: Keyword extraction module, graph generation module, graph adjustment module and database construction module; The keyword extraction module is used to obtain multi-source power data and extract power keywords from the multi-source power data; The graph generation module is used to generate an initial knowledge graph according to the power keyword, wherein the initial knowledge graph includes a plurality of triple information, and one of the triple information is used to describe the characteristics of a knowledge subject in the initial knowledge graph and its relationship and / or attribute; The graph adjustment module is used to input the initial knowledge graph into a preset knowledge reasoning model to obtain an evaluation parameter for each triple information; and adjust the initial knowledge graph according to the evaluation parameter for each triple information to obtain a target knowledge graph; The database construction module is used to construct an electric power database according to the target knowledge graph.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory in communication with the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method for constructing a power database according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for constructing a power database according to any one of claims 1 to 7 when executed.

Citation Information

Patent Citations

  • Automatic knowledge graph construction method based on multi-source heterogeneous power equipment data

    CN112860908A

  • Knowledge graph construction method and device, electronic equipment and storage medium

    CN115510249A

  • Multi-source data precious metal performance evaluation method and device based on ensemble learning

    CN115952286A

  • Entity information atlas generation method and device, electronic equipment and storage medium

    CN116737946A

  • Power grid knowledge reasoning method and device, electronic equipment and storage medium

    CN116757285A