Power knowledge graph construction method and device, computer device, and storage medium
By acquiring and integrating information from multiple data sources on the power trading platform, and combining it with a pre-trained entity association model, the problems of difficult determination of entity boundaries and difficult data annotation in the construction of knowledge graphs in the power trading field are solved, and efficient and accurate construction of power knowledge graphs is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU ELECTRIC POWER TRADING CENT CO LTD
- Filing Date
- 2023-08-22
- Publication Date
- 2026-05-19
AI Technical Summary
In the field of power trading, the construction of knowledge graphs faces challenges such as difficulty in determining volume boundaries and data labeling, resulting in low accuracy of the constructed knowledge graphs.
By acquiring power information data from multiple data sources of the power trading knowledge service platform, information fusion is performed to obtain attribute and association information of power entities, and a pre-trained entity association model is used to improve the accuracy of entity association information, ultimately constructing a power knowledge graph.
This improves the accuracy and efficiency of the power knowledge graph, ensuring the accurate representation of entities and relationships on the power trading knowledge service platform.
Smart Images

Figure CN116881477B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a method, apparatus, system, computer equipment, storage medium, and computer program product for constructing an electric power knowledge graph. Background Technology
[0002] Knowledge graphs in the power trading domain fall under the category of industry-specific or vertical knowledge graphs. Their construction relies on industry data, which is mostly unstructured or semi-structured, existing in text, tables, or web pages. The knowledge structures are also more complex, typically exhibiting strict and rich data patterns. This places higher demands on the depth and accuracy of knowledge within this domain, making knowledge extraction and application more challenging. Current research on domain knowledge graphs primarily focuses on fields such as e-commerce, healthcare, and finance. Typically, the entity and relational knowledge within a domain knowledge graph has industry significance; therefore, constructing accurate and authoritative domain knowledge graphs presents a greater challenge.
[0003] In the current construction of knowledge graphs in the field of power trading, there are problems such as difficulty in determining volume boundaries and difficulty in labeling data, which leads to low accuracy of the constructed knowledge graphs. Summary of the Invention
[0004] Therefore, it is necessary to provide a method, apparatus, system, computer equipment, storage medium, and computer program product for constructing an electric power knowledge graph to address the aforementioned technical problems.
[0005] Firstly, this application provides a method for constructing a power knowledge graph. The method includes:
[0006] Obtain multiple power information data associated with the power trading knowledge service platform from multiple power data sources associated with the power trading knowledge service platform;
[0007] Based on the multiple power information data, multiple power entities of the power trading knowledge service platform are obtained, and the multiple power information data are fused to obtain the entity attribute information corresponding to each power entity;
[0008] Based on the entity attribute information corresponding to each of the power entities, obtain the entity association information between the power entities;
[0009] Based on the entity attribute information and entity association information corresponding to each of the power entities, a power knowledge graph for the power trading knowledge service platform is obtained.
[0010] In one embodiment, obtaining entity association information between the power entities based on the entity attribute information corresponding to each power entity includes: inputting the entity attribute information corresponding to each power entity into a pre-trained entity association model to obtain the correlation between the power entities; and obtaining the entity association information between the power entities based on the correlation.
[0011] In one embodiment, the step of inputting the entity attribute information corresponding to each of the power entities into a pre-trained entity association model to obtain the correlation between the power entities includes: obtaining the entity feature information corresponding to each of the power entities based on the entity attribute information corresponding to each of the power entities; and performing pairwise correlation calculation on the entity feature information of the plurality of power entities to obtain the correlation between the power entities.
[0012] In one embodiment, before inputting the entity attribute information corresponding to each of the power entities into a pre-trained entity association model to obtain the correlation between the power entities, the method further includes: obtaining a first sample power entity and a second sample power entity, the first sample entity attribute information and the second sample entity attribute information of the first sample power entity, and the actual relationship label of the first sample power entity and the second sample power entity; inputting the first sample entity attribute information into a first feature extraction module of the entity association model to be trained to obtain the first power entity feature information of the first sample power entity; inputting the second sample entity attribute information into a second feature extraction module of the entity association model to be trained to obtain the second power entity feature information of the second sample power entity; inputting the first power entity feature information and the second power entity feature information into a correlation calculation module of the entity association model to be trained to obtain the predicted correlation between the first sample power entity and the second sample power entity; obtaining the predicted relationship label of the first sample power entity and the second sample power entity based on the predicted correlation; and training the entity association model to be trained based on the difference between the predicted relationship label and the actual relationship label to obtain the pre-trained entity association model.
[0013] In one embodiment, the plurality of power information data includes power text data; the step of fusing the plurality of power information data to obtain entity attribute information corresponding to each power entity includes: obtaining a plurality of target power text data of a target power entity from the plurality of power information data; the target power entity is any one of the plurality of power entities; performing word segmentation on each of the target power text data to obtain target word vectors corresponding to each of the target power text data; and fusing the word vectors of the plurality of target power text data to obtain target entity attribute information corresponding to the target power entity.
[0014] In one embodiment, obtaining the power knowledge graph for the power trading knowledge service platform based on the entity attribute information and entity association information corresponding to each of the power entities includes: linking each power entity to a corresponding node of the power knowledge graph to be constructed based on the entity attribute information and entity association information corresponding to each of the power entities, thereby obtaining multiple nodes of the power knowledge graph to be constructed; obtaining multiple edges of the power knowledge graph to be constructed based on the entity association information; and obtaining the power knowledge graph for the power trading knowledge service platform based on the multiple nodes and the multiple edges.
[0015] Secondly, this application provides an apparatus for constructing a power knowledge graph. The apparatus includes:
[0016] The acquisition module is used to acquire multiple power information data associated with the power trading knowledge service platform from multiple power data sources associated with the power trading knowledge service platform;
[0017] The fusion module is used to obtain multiple power entities of the power trading knowledge service platform based on the multiple power information data, and to fuse the multiple power information data to obtain the entity attribute information corresponding to each power entity;
[0018] The calculation module is used to obtain entity association information between the power entities based on the entity attribute information corresponding to each power entity;
[0019] The graph construction module is used to obtain a power knowledge graph for the power trading knowledge service platform based on the entity attribute information and entity association information corresponding to each power entity.
[0020] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0021] Obtain multiple power information data associated with the power trading knowledge service platform from multiple power data sources associated with the power trading knowledge service platform;
[0022] Based on the multiple power information data, multiple power entities of the power trading knowledge service platform are obtained, and the multiple power information data are fused to obtain the entity attribute information corresponding to each power entity;
[0023] Based on the entity attribute information corresponding to each of the power entities, obtain the entity association information between the power entities;
[0024] Based on the entity attribute information and entity association information corresponding to each of the power entities, a power knowledge graph for the power trading knowledge service platform is obtained.
[0025] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:
[0026] Obtain multiple power information data associated with the power trading knowledge service platform from multiple power data sources associated with the power trading knowledge service platform;
[0027] Based on the multiple power information data, multiple power entities of the power trading knowledge service platform are obtained, and the multiple power information data are fused to obtain the entity attribute information corresponding to each power entity;
[0028] Based on the entity attribute information corresponding to each of the power entities, obtain the entity association information between the power entities;
[0029] Based on the entity attribute information and entity association information corresponding to each of the power entities, a power knowledge graph for the power trading knowledge service platform is obtained.
[0030] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:
[0031] Obtain multiple power information data associated with the power trading knowledge service platform from multiple power data sources associated with the power trading knowledge service platform;
[0032] Based on the multiple power information data, multiple power entities of the power trading knowledge service platform are obtained, and the multiple power information data are fused to obtain the entity attribute information corresponding to each power entity;
[0033] Based on the entity attribute information corresponding to each of the power entities, obtain the entity association information between the power entities;
[0034] Based on the entity attribute information and entity association information corresponding to each of the power entities, a power knowledge graph for the power trading knowledge service platform is obtained.
[0035] The aforementioned methods, apparatus, systems, computer equipment, storage media, and computer program products for constructing a power knowledge graph can obtain multiple power information data associated with the power trading knowledge service platform from multiple power data sources associated with the platform. Furthermore, multiple power entities of the power trading knowledge service platform can be obtained based on these multiple power information data. These multiple power information data contain power information data of multiple power entities, and multiple power entity information data corresponding to each power entity can be obtained from these multiple power information data. Thus, the multiple power entity information data corresponding to each power entity can be fused to obtain entity attribute information corresponding to each power entity. Next, entity association information between power entities can be obtained based on the entity attribute information corresponding to each power entity. Furthermore, a power knowledge graph for the power trading knowledge service platform can be obtained based on the entity attribute information and entity association information corresponding to each power entity. In the method provided in this application embodiment, entity association information between power entities can be obtained based on the entity attribute information corresponding to each power entity and combined with a pre-trained high-precision entity association model. This improves the accuracy and efficiency of the obtained entity association information between power entities, and further improves the accuracy and efficiency of the constructed power knowledge graph. Attached Figure Description
[0036] Figure 1 A flowchart illustrating a method for constructing an electrical knowledge graph, provided in an embodiment of this application;
[0037] Figure 2 This is a schematic diagram of the process for obtaining entity attribute information corresponding to each power entity, provided in an embodiment of this application.
[0038] Figure 3 A structural block diagram of a power knowledge graph construction device provided in an embodiment of this application;
[0039] Figure 4 This is an internal structural diagram of a computer device provided in an embodiment of this application. Detailed Implementation
[0040] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit the scope of this application. In one embodiment, such as... Figure 1 As shown, a method for constructing a power knowledge graph is provided. This embodiment illustrates the method by applying it to a server. It is understood that this method can also be applied to a terminal, or to a system including both a terminal and a server, and is implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0041] Step S101: Obtain multiple power information data associated with the power trading knowledge service platform from multiple power data sources associated with the power trading knowledge service platform.
[0042] The power trading knowledge service platform can be a platform for power-related affairs and / or power service transactions. Multiple power data sources associated with the platform can be various power business systems and / or databases that interact with it, such as power databases, local resources, and various publicly available online information resources. This multiple power information data can include various forms of data, such as text, images, and video. Furthermore, in some possible implementations, this multiple power information data can include power trading-related policies and information, power trading standard and specification documents, existing trading knowledge Q&As and training materials from power trading institutions, and various online knowledge resources. Based on the data presentation format, this multiple power information data can be divided into three types: structured data, semi-structured data, and unstructured data. These data directly affect the quality of the power trading service knowledge graph.
[0043] (1) The structured data mainly includes a dictionary for the field of power trading, which contains commonly used terms in the field and is highly specialized;
[0044] (2) Semi-structured data mainly refers to policies, information and encyclopedia entries related to electricity trading from various websites, online forums, etc., as well as massive amounts of real-time user communication content in forums;
[0045] (3) Unstructured data mainly includes various types of data such as power trading standard and specification documents, training materials, PDF, Word, text, and images.
[0046] Step S102: Based on multiple power information data, obtain multiple power entities from the power trading knowledge service platform, and fuse the multiple power information data to obtain the entity attribute information corresponding to each power entity.
[0047] The acquisition of multiple power entities based on multiple power information data for a power trading knowledge service platform can be achieved by extracting entities from multiple power information data sets. These multiple power information data sets can contain multiple power entity information data corresponding to each power entity. Therefore, multiple power entity information data corresponding to each power entity can be obtained from these multiple power information data sets. This multiple power entity information data may originate from different power data sources, so information fusion can be performed on these multiple power entity information data from different power data sources to eliminate redundancy and contradictions, obtaining the entity attribute information corresponding to each power entity. This entity attribute information can represent the attributes and characteristics of each power entity, such as the entity identifier, entity content information, entity feature information, and relationships with other entities.
[0048] Step S103: Based on the entity attribute information corresponding to each power entity, obtain the entity association information between each power entity.
[0049] In some possible implementations, a pre-trained entity association model can be used to obtain entity association information between power entities based on their corresponding entity attribute information. This pre-trained entity association model can be trained on a sample power entity set of the power trading knowledge service platform. This sample power entity set can contain multiple sample power entity pairs, each pair containing a first sample power entity and a second sample power entity. The sample entity attribute information and actual relationship labels of the first and second sample power entities can be obtained respectively, and the entity association model can be trained based on these sample entity attribute information and actual relationship labels. Obtaining the entity association information between each power entity can be achieved by calculating pairwise correlations between them. Correlation calculation is a method to measure the strength of the correlation between two variables. In machine learning and data analysis, commonly used correlation calculation methods include the Pearson Correlation Coefficient, which measures the linear correlation between two continuous variables. The value range is [-1, 1], where 1 represents perfect positive correlation, -1 represents perfect negative correlation, and 0 represents no correlation. Spearman's Rank Correlation Coefficient: Used to measure the monotonic relationship between two variables, not requiring a linear relationship. First, the observed values of the variables are converted into ranks, then the Pearson correlation coefficient between the ranks is calculated. Chebyshev Distance: Used to measure the maximum difference between two vectors. It is calculated by taking the maximum absolute value of the difference between corresponding positions in the two vectors. Manhattan Distance: Also known as city block distance, it measures the distance between two vectors. It is calculated by summing the absolute values of the differences between corresponding positions in the two vectors. Euclidean Distance: Used to measure the straight-line distance between two vectors. It is calculated by taking the square root of the sum of the squares of the differences between corresponding positions in the two vectors. Cosine Similarity: Used to measure the cosine of the angle between two vectors. The calculation method involves standardizing two vectors and then calculating their dot product. The entity association information between these power entities can be used to represent the relationships between them, forming the edges of the power knowledge graph to be constructed. This power knowledge graph is a structured knowledge representation used to describe the entities, concepts, and relationships between them in a real-world power trading knowledge service platform.
[0050] Typically, the entity association information between various power entities can include, but is not limited to, three types: identity association, membership association, and correlation association. Among them, (1) identity association describes the opposite or the same degree of association between entities, such as a likeness relationship. (2) membership association indicates the logical relationship that an entity belongs to a certain concept or category, such as causal relationship and subordinate relationship. (3) correlation association
[0051] Step S104: Obtain the power knowledge graph for the power trading knowledge service platform based on the entity attribute information and entity association information corresponding to each power entity.
[0052] The power knowledge graph is a structured knowledge representation used to describe the entities, concepts, and relationships between them in a real-world power trading knowledge service platform. This embodiment uses power entities and their relationships as an example. The power knowledge graph can consist of a set of nodes and edges. Nodes represent power entities, and edges represent relationships between them. In constructing the power knowledge graph for the power trading knowledge service platform, each power entity can be linked to a node in the power knowledge graph based on its corresponding entity attribute information. Then, the edges of the power knowledge graph are determined using the entity association information of each power entity, thus completing the construction of the power knowledge graph.
[0053] In this embodiment, the method can obtain multiple power information data associated with the power trading knowledge service platform from multiple power data sources associated with the platform. Then, multiple power entities of the platform can be obtained based on these multiple power information data. These multiple power information data contain power information data of multiple power entities, and multiple power entity information data corresponding to each power entity can be obtained from these multiple power information data. Therefore, the multiple power entity information data corresponding to each power entity can be fused to obtain entity attribute information corresponding to each power entity. Next, entity association information between power entities can be obtained based on the entity attribute information corresponding to each power entity. Furthermore, a power knowledge graph for the power trading knowledge service platform can be obtained based on the entity attribute information and entity association information corresponding to each power entity. The method provided in this application embodiment can obtain entity association information between power entities based on the entity attribute information corresponding to each power entity and combined with a pre-trained high-precision entity association model, which can improve the accuracy and efficiency of the obtained entity association information between power entities, and further improve the accuracy and efficiency of the constructed power knowledge graph.
[0054] In one embodiment, step S103 may include the following steps:
[0055] The entity attribute information corresponding to each power entity is input into a pre-trained entity association model to obtain the correlation between the power entities; based on the correlation, the association relationship information between the power entities is obtained. Specifically, in one embodiment, obtaining the correlation between the power entities may include: obtaining the entity feature information corresponding to each power entity based on the entity attribute information corresponding to each power entity; and performing pairwise correlation calculations on the entity feature information of multiple power entities to obtain the correlation between the power entities.
[0056] The pre-trained entity association model may include a first feature extraction module, a second feature extraction module, and a correlation calculation module. This pre-trained entity association model can be used to obtain the correlation between various power entities. Taking the first and second power entities among the multiple power entities as examples, the first entity attribute information of the first power entity is input into the first feature extraction module of the entity association model to obtain the first entity feature information of the first power entity; the second entity attribute information of the second power entity is input into the second feature extraction module of the entity association model to obtain the second entity feature information of the second power entity; the correlation calculation module can be used to calculate the correlation between the first and second entity feature information to obtain the correlation between the first and second power entities. Furthermore, based on this correlation, a predicted relationship label can be applied to the first and second power entities, thus obtaining the entity association information between the first and second power entities from the predicted relationship label.
[0057] The entity association model may include at least one convolutional layer and at least one pooling layer. The convolutional layer is used to extract features from the input data; the pooling layer is used to sample the input data. Both the convolutional and pooling layers include activation functions. In this embodiment, entity attribute information may include multiple textual information.
[0058] Specifically, convolutional layers can be used to extract initial features from multiple textual information. The first step involves vectorizing the multiple textual information entries to obtain multiple textual information vectors, which can be combined into a textual information vector matrix. The second step involves inputting this textual information vector matrix into the convolutional layer, performing a convolution operation between the kernel and the textual information vector matrix (i.e., performing an inner product operation) to obtain the convolution result corresponding to the textual information vector matrix. Next, a nonlinear transformation is applied to the convolution result based on an activation function, and a bias vector is added to obtain the initial feature vector. The third step involves inputting the initial feature vector into a pooling layer for feature sampling. Then, a nonlinear transformation is applied to the feature sampling result based on an activation function, and a bias vector is added to obtain the various power entities.
[0059] Furthermore, in some possible implementations, the entity association model may also include a classification module. This classification module can obtain predicted relationship labels between various power entities based on their correlations. This classification module may include at least one fully connected layer, which can classify the relationships between the various power entities to obtain the predicted relationship labels.
[0060] Specifically, the server can input the correlation between various power entities into the fully connected layer, perform a nonlinear transformation on the correlation between various power entities based on the weight matrix and bias vector of the activation function, and then obtain the predicted relationship label between various power entities through normalization.
[0061] In one embodiment, the training method for the entity association model may include:
[0062] The process involves acquiring a first sample power entity and a second sample power entity, along with the first sample power entity's attribute information and the actual relationship label between them. The first sample power entity's attribute information is input into the first feature extraction module of the entity association model to be trained, yielding the first power entity's feature information. The second sample power entity's attribute information is input into the second feature extraction module of the entity association model to be trained, yielding the second power entity's feature information. The first and second power entity's feature information are then input into the relevance calculation module of the entity association model to be trained, yielding the predicted relevance between the first and second sample power entities. Based on the predicted relevance, the predicted relationship label between the first and second sample power entities is obtained. Finally, based on the difference between the predicted relationship label and the actual relationship label, the entity association model to be trained is trained, resulting in a pre-trained entity association model.
[0063] In the method of this embodiment, entity association information between power entities can be obtained based on the entity attribute information corresponding to each power entity and combined with a pre-trained high-precision entity association model. This can improve the accuracy and efficiency of the obtained entity association information between power entities, and further improve the accuracy and efficiency of the constructed power knowledge graph.
[0064] In one embodiment, such as Figure 2 As shown, step S102, which involves fusing multiple power information data to obtain entity attribute information corresponding to each power entity, may include:
[0065] Step S201: Obtain multiple target power text data of the target power entity from multiple power information data.
[0066] The multiple power information data include power text data, and the target power entity is any one of the multiple power entities. The target power text data can be information data displayed in text form from the multiple target power information data of the target power entity.
[0067] Step S202: Perform word segmentation on each target power text data to obtain the target word vector corresponding to each target power text data.
[0068] In some possible implementations, the target power text data can be segmented using a data segmentation algorithm. Each target power text data can be segmented into individual characters. Then, based on the maximum matching principle, the target word vector corresponding to each target power text data can be obtained.
[0069] Step S203: The word vectors of multiple target power text data are fused to obtain the target entity attribute information corresponding to the target power entity.
[0070] The multiple target power text data can originate from different power data sources. The target power text data from each power data source is vectorized into word vectors, resulting in word vectors for each power data source. These word vectors from multiple power data sources are then fused to obtain the target entity attribute information corresponding to the target power entity. This target entity attribute information can represent the attributes and characteristics of the target power entity, such as the entity identifier, entity content information, entity feature information, and relationships with other entities.
[0071] In the method of this embodiment, for target power text data, information fusion can be performed on target power text data from different power data sources, which can improve the accuracy of target entity attribute information corresponding to the target power entity, thereby improving the accuracy and efficiency of the entity association information between the acquired power entities, and further improving the accuracy and efficiency of the constructed power knowledge graph.
[0072] In one embodiment, step S104 may include:
[0073] Based on the entity attribute information and entity association information of each power entity, each power entity is linked to the corresponding node of the power knowledge graph to be constructed, resulting in multiple nodes of the power knowledge graph to be constructed; based on the entity association information, multiple edges of the power knowledge graph to be constructed are obtained; based on the multiple nodes and multiple edges, the power knowledge graph for the power trading knowledge service platform is obtained.
[0074] The power knowledge graph is a structured knowledge representation used to describe the entities, concepts, and relationships between them in a real-world power trading knowledge service platform. This embodiment uses power entities and their relationships as an example. The power knowledge graph can consist of a set of nodes and edges. Nodes represent power entities, and edges represent relationships between them. In constructing the power knowledge graph for the power trading knowledge service platform, each power entity can be linked to a node in the power knowledge graph based on its corresponding entity attribute information. Then, the edges of the power knowledge graph are determined using the entity association information of each power entity, thus completing the construction of the power knowledge graph.
[0075] In the method of this embodiment, entity association information between power entities can be obtained based on the entity attribute information corresponding to each power entity and combined with a pre-trained high-precision entity association model. This can improve the accuracy and efficiency of the obtained entity association information between power entities, and further improve the accuracy and efficiency of the constructed power knowledge graph.
[0076] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0077] Based on the same inventive concept, this application also provides a power knowledge graph construction apparatus for implementing the power knowledge graph construction method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more power knowledge graph construction apparatus embodiments provided below can be found in the limitations of the power knowledge graph construction method described above, and will not be repeated here.
[0078] In one embodiment, such as Figure 3 As shown, a power knowledge graph construction device is provided, including: an acquisition module 301, a fusion module 302, a calculation module 303, and a graph construction module 304, wherein:
[0079] The acquisition module 301 is used to acquire multiple power information data associated with the power trading knowledge service platform from multiple power data sources associated with the power trading knowledge service platform;
[0080] The fusion module 302 is used to obtain multiple power entities of the power trading knowledge service platform based on the multiple power information data, and to fuse the multiple power information data to obtain entity attribute information corresponding to each power entity;
[0081] The calculation module 303 is used to obtain entity association information between the power entities based on the entity attribute information corresponding to each power entity;
[0082] The graph construction module 304 is used to obtain a power knowledge graph for the power trading knowledge service platform based on the entity attribute information and entity association information corresponding to each power entity.
[0083] In addition, the calculation module 303 is also used to: input the entity attribute information corresponding to each of the power entities into a pre-trained entity association model to obtain the correlation between each of the power entities; and obtain the entity association information between each of the power entities based on the correlation.
[0084] The calculation module 303 is further configured to: obtain entity feature information corresponding to each power entity based on the entity attribute information corresponding to each power entity; and perform pairwise correlation calculation on the entity feature information of the plurality of power entities to obtain the correlation between each power entity.
[0085] Furthermore, the calculation module 303 is also configured to: acquire a first sample power entity and a second sample power entity, first sample entity attribute information and second sample entity attribute information of the first sample power entity, and actual relationship labels of the first sample power entity and the second sample power entity; input the first sample entity attribute information into a first feature extraction module of the entity association model to be trained to obtain first power entity feature information of the first sample power entity; input the second sample entity attribute information into a second feature extraction module of the entity association model to be trained to obtain second power entity feature information of the second sample power entity; input the first power entity feature information and the second power entity feature information into a relevance calculation module of the entity association model to be trained to obtain predicted relevance of the first sample power entity and the second sample power entity; acquire predicted relationship labels of the first sample power entity and the second sample power entity based on the predicted relevance; and train the entity association model to be trained based on the difference between the predicted relationship labels and the actual relationship labels to obtain the pre-trained entity association model.
[0086] Furthermore, in one embodiment, the plurality of power information data includes power text data, and the fusion module 302 is further configured to: obtain a plurality of target power text data of a target power entity from the plurality of power information data; the target power entity is any one of the plurality of power entities; perform word segmentation processing on each of the target power text data to obtain the target word vector corresponding to each of the target power text data; and fuse the word vectors of the plurality of target power text data to obtain the target entity attribute information corresponding to the target power entity.
[0087] The graph construction module 304 is further configured to: link each of the power entities to the corresponding nodes of the power knowledge graph to be constructed according to the entity attribute information and the entity association information corresponding to each of the power entities, thereby obtaining multiple nodes of the power knowledge graph to be constructed; obtain multiple edges of the power knowledge graph to be constructed according to the entity association information; and obtain the power knowledge graph for the power trading knowledge service platform according to the multiple nodes and the multiple edges.
[0088] Each module in the aforementioned power knowledge graph construction device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0089] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 4 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores relevant data for constructing a power knowledge graph. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements a method for constructing a power knowledge graph.
[0090] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0091] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0092] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0093] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0094] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0095] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0096] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0097] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for constructing an electricity knowledge graph, characterized in that, The method includes: Multiple power information data associated with the power trading knowledge service platform are obtained from multiple power data sources associated with the power trading knowledge service platform; the multiple power information data are presented in the form of structured data, semi-structured data and unstructured data; Based on the multiple power information data, multiple power entities of the power trading knowledge service platform are obtained, and the multiple power information data are fused to obtain the entity attribute information corresponding to each power entity; Using a pre-trained entity association model, entity association information between the power entities is obtained based on the entity attribute information corresponding to each power entity; wherein, obtaining the entity association information between the power entities using the pre-trained entity association model, based on the entity attribute information corresponding to each power entity, includes: The first entity attribute information of the first power entity among the plurality of power entities is input into the first feature extraction module of the entity association model to obtain the first entity feature information of the first power entity; The second entity attribute information of the second power entity among the plurality of power entities is input into the second feature extraction module of the entity association model to obtain the second entity feature information of the second power entity; The correlation calculation module of the entity association model performs correlation calculation on the first entity feature information and the second entity feature information to obtain the correlation between the first power entity and the second power entity. The correlation between the first power entity and the second power entity is input into at least one fully connected layer of the entity association model. The correlation is then nonlinearly transformed and normalized through the fully connected layer to obtain the predicted relationship label between the first power entity and the second power entity. Based on the predicted relationship labels, determine the entity association information between each of the power entities; Based on the entity attribute information and entity association information corresponding to each of the power entities, a power knowledge graph for the power trading knowledge service platform is obtained.
2. The method according to claim 1, characterized in that, The step of obtaining entity association information between the power entities based on the entity attribute information corresponding to each power entity includes: The entity attribute information corresponding to each of the power entities is input into a pre-trained entity association model to obtain the correlation between the power entities. Based on the correlation, obtain entity association information between each of the power entities.
3. The method according to claim 2, characterized in that, The step of inputting the entity attribute information corresponding to each of the power entities into a pre-trained entity association model to obtain the correlation between the power entities includes: Based on the entity attribute information corresponding to each of the power entities, obtain the entity feature information corresponding to each of the power entities; The correlation between each power entity is obtained by performing pairwise correlation calculations on the entity feature information of the multiple power entities.
4. The method according to claim 2, characterized in that, Before inputting the entity attribute information corresponding to each of the power entities into a pre-trained entity association model to obtain the correlation between the power entities, the method further includes: Obtain the first sample power entity and the second sample power entity, the first sample entity attribute information and the second sample entity attribute information of the first sample power entity, and the actual relationship label of the first sample power entity and the second sample power entity; The first sample entity attribute information is input into the first feature extraction module of the entity association model to be trained to obtain the first power entity feature information of the first sample power entity; The second sample entity attribute information is input into the second feature extraction module of the entity association model to be trained to obtain the second power entity feature information of the second sample power entity; The first power entity feature information and the second power entity feature information are input into the correlation calculation module of the entity association model to be trained to obtain the predicted correlation between the first sample power entity and the second sample power entity. Based on the predicted correlation, obtain the predicted relationship labels of the first sample power entity and the second sample power entity; Based on the difference between the predicted relationship label and the actual relationship label, the entity association model to be trained is trained to obtain the pre-trained entity association model.
5. The method according to claim 1, characterized in that, The plurality of power information data includes power text data; the process of fusing the plurality of power information data to obtain entity attribute information corresponding to each power entity includes: Obtain multiple target power text data of the target power entity from the plurality of power information data; the target power entity is any one of the plurality of power entities; The target power text data is segmented into words to obtain the target word vectors corresponding to each target power text data. The word vectors of the multiple target power text data are fused to obtain the target entity attribute information corresponding to the target power entity.
6. The method according to claim 1, characterized in that, The step of obtaining a power knowledge graph for the power trading knowledge service platform based on the entity attribute information and entity association information corresponding to each power entity includes: Based on the entity attribute information and entity association information corresponding to each of the power entities, each of the power entities is linked to the corresponding node of the power knowledge graph to be constructed, thereby obtaining multiple nodes of the power knowledge graph to be constructed. Based on the entity association information, multiple edges of the power knowledge graph to be constructed are obtained; Based on the multiple nodes and multiple edges, obtain the power knowledge graph for the power trading knowledge service platform.
7. A device for constructing an electrical knowledge graph, characterized in that, The device includes: The acquisition module is used to acquire multiple power information data associated with the power trading knowledge service platform from multiple power data sources associated with the power trading knowledge service platform; the multiple power information data are presented in the form of structured data, semi-structured data and unstructured data; The fusion module is used to obtain multiple power entities of the power trading knowledge service platform based on the multiple power information data through a pre-trained entity association model, and to fuse the multiple power information data to obtain the entity attribute information corresponding to each power entity. A calculation module is used to obtain entity association information between the power entities based on the entity attribute information corresponding to each power entity. The step of obtaining the entity association information between the power entities using a pre-trained entity association model, based on the entity attribute information corresponding to each power entity, includes: inputting the first entity attribute information of a first power entity among the plurality of power entities into the first feature extraction module of the entity association model to obtain the first entity feature information of the first power entity; inputting the second entity attribute information of a second power entity among the plurality of power entities into the second feature extraction module of the entity association model to obtain the second entity feature information of the second power entity; performing correlation calculation on the first entity feature information and the second entity feature information through the correlation calculation module of the entity association model to obtain the correlation between the first power entity and the second power entity; inputting the correlation between the first power entity and the second power entity into at least one fully connected layer of the entity association model, and performing nonlinear transformation and normalization on the correlation through the fully connected layer to obtain the predicted relationship label between the first power entity and the second power entity. Based on the predicted relationship labels, determine the entity association information between each of the power entities. The graph construction module is used to obtain a power knowledge graph for the power trading knowledge service platform based on the entity attribute information and entity association information corresponding to each power entity.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-6.