Power grid energy storage question and answer method and system based on knowledge graph

By constructing a knowledge graph of multi-source data and using the qwen2.5 model for data annotation and search, the problem of a single source of data of the existing grid energy storage knowledge graph is solved, which significantly improves the accuracy and adaptability of the grid energy storage Q&A system.

CN120067271AActive Publication Date: 2025-05-30GUANGDONG POWER GRID CO LTD DONGGUAN POWER SUPPLY BUREAU +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510250103.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-04
Publication Date
2025-05-30
Estimated Expiration
2045-03-04

AI Technical Summary

Technical Problem

The existing grid energy storage knowledge graph data source is single, resulting in a lack of diversity and comprehensiveness of the knowledge graph content, which cannot effectively cover the complexity and dynamic changes in the power grid energy storage field, resulting in incomplete information, inaccurate answers or even incorrect answers when answering user questions.

Method used

By combining locally uploaded grid energy storage corpus data and public information obtained in the network, the data is annotated using the qwen2.5 model, entity recognition, relationship extraction and sentiment analysis, structured data is generated, and searched through Elastic Search to provide accurate response results.

Benefits of technology

It significantly improves the accuracy of the reply of the grid energy storage Q&A system, helps users to quickly and accurately obtain relevant information in the grid energy storage field, enhances the adaptability and flexibility of the system, and can effectively respond to diversified and complex user needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120067271A_ABST
    Figure CN120067271A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a power grid energy storage question and answer method and system based on a knowledge graph, is applied to a server, and relates to the technical field of energy storage. The method comprises the steps of receiving a problem statement sent by a terminal device, obtaining a reply result corresponding to the problem statement through a knowledge graph constructed based on first power grid energy storage prediction data locally uploaded in a power grid field and second power grid energy storage prediction data obtained in a network, and returning the reply result to the terminal device. Through the method, the answering accuracy of the question and answer system is remarkably improved, and the user is helped to quickly and accurately obtain related information in the field of power grid energy storage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of energy storage technology, and in particular to a knowledge graph-based power grid energy storage question-answering method and system. Background Art

[0002] As the global energy transition accelerates, grid energy storage, as a key infrastructure for the development of new energy, is becoming increasingly important. However, grid energy storage involves many aspects of professional knowledge, which are diverse and difficult to integrate, making it difficult for practitioners to quickly and accurately obtain information. Therefore, developing a grid energy storage question-and-answer method and system based on knowledge graphs can provide fast and accurate answers to questions in the field of grid energy storage, which is of great significance for promoting the development and application of grid energy storage technology.

[0003] The existing knowledge graph for energy storage in the power grid field has a relatively single data source, which is only obtained through web crawlers or imported policy documents. As a result, the content of the knowledge graph lacks diversity and comprehensiveness, and cannot cover professional knowledge in multiple fields such as electrochemical energy storage, physical energy storage, battery management, and power grid dispatching. At the same time, it is also difficult to integrate the latest developments in emerging fields such as power market reform and the application of artificial intelligence technology, which limits the coverage of the knowledge graph and cannot fully reflect the complexity and dynamic changes in the field of power grid energy storage. As a result, the question-and-answer system based on the knowledge graph may have incomplete information, inaccurate answers, or even errors when answering user questions.

[0004] In summary, providing a technical solution that can provide accurate answers to problems in the field of power grid energy storage is a technical problem that needs to be solved urgently. Summary of the invention

[0005] The embodiments of the present application provide a knowledge graph-based power grid energy storage question and answer method and system to improve the accuracy of the answers given by the power grid energy storage question and answer system.

[0006] In a first aspect, an embodiment of the present application provides a knowledge graph-based power grid energy storage question-answering method, comprising:

[0007] Receiving a question statement sent by a terminal device;

[0008] According to the question statement and the pre-constructed knowledge graph, an answer result corresponding to the question statement is obtained, wherein the knowledge graph is constructed based on first power grid energy storage corpus data uploaded locally in the power grid field and second power grid energy storage corpus data obtained from the network;

[0009] The reply result is returned to the terminal device.

[0010] In a possible implementation, obtaining a response result corresponding to the question statement according to the question statement and a pre-constructed knowledge graph includes:

[0011] Extract information from the problem statement according to the qwen2.5 model to obtain multiple keywords;

[0012] According to the multiple keywords, use the Elastic Search method to search from the knowledge graph to obtain the reply result.

[0013] In a possible implementation manner, the step of using the Elastic Search method to search from the knowledge graph according to the multiple keywords to obtain the reply result includes:

[0014] Perform intent recognition on the problem statement using the qwen2.5 model to obtain the user's question intent;

[0015] According to the question intent and the keywords, use the Elastic Search method to search from the knowledge graph to obtain the reply result.

[0016] In a possible implementation manner, before returning the reply result to the terminal device, the method further includes:

[0017] Polish the reply result through a large language model to obtain a reply result that conforms to the user's language habit.

[0018] In a possible implementation manner, before obtaining the reply result corresponding to the problem statement according to the problem statement and the pre-constructed knowledge graph, the method further includes:

[0019] Obtain a set of data to be processed, where the set of data to be processed includes the first power grid energy storage corpus data and the second power grid energy storage corpus data;

[0020] Annotate the set of data to be processed through the decoder of the qwen2.5 model to obtain entity annotation data, relationship annotation data, and sentiment annotation data, where the decoder includes an entity recognition decoder, a relationship extraction decoder, and a sentiment analysis decoder;

[0021] Construct the knowledge graph based on the entity annotation data, the relationship annotation data, and the sentiment annotation data.

[0022] In a possible implementation manner, the method further includes:

[0023] Split the entity annotation data, the relationship annotation data, and the sentiment annotation data into multiple sub-word units;

[0024] Map each sub-word unit and add positional encoding to obtain multiple encoded sub-word units;

[0025] Calculate the correlation weights between each encoded sub-word unit and other encoded sub-word units;

[0026] Based on the multiple encoded sub-word units and the multiple correlation weights corresponding to each sub-word unit, train the initial Qwen2.5 model to obtain the Qwen2.5 model.

[0027] In a possible implementation, the ratio of the data volume of the first power grid energy storage corpus data to the data volume of the second power grid energy storage corpus data in the data set to be processed is a preset ratio.

[0028] In a possible implementation, the method further includes:

[0029] During the model training process, in response to a parameter adjustment request sent by the training terminal, adjust the model parameters of the Qwen2.5 model;

[0030] Wherein, the model parameters include learning rate, batch size, training epochs, and weight decay.

[0031] In a second aspect, an embodiment of the present application provides a power grid energy storage question-answering device based on a knowledge graph, including:

[0032] A first processing module, configured to receive a question statement sent by a terminal device;

[0033] A second processing module, configured to obtain a reply result corresponding to the question statement according to the question statement and a pre-constructed knowledge graph, wherein the knowledge graph is constructed based on the first power grid energy storage corpus data uploaded locally in the power grid field and the second power grid energy storage corpus data obtained from the network;

[0034] A third processing module, configured to return the reply result to the terminal device.

[0035] In a third aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor;

[0036] The memory stores computer execution instructions;

[0037] The processor executes the computer execution instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementation manners of the first aspect.

[0038] Fourthly, an embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the first aspect and / or various possible implementation manners of the first aspect when executed by a processor.

[0039] Fifthly, an embodiment of the present application provides a power grid energy storage Q&A system based on a knowledge graph, including:

[0040] a terminal device and a server;

[0041] wherein, the terminal device is used to obtain a question statement input by a user and transmit the question statement to the server; the server is used to execute the first aspect and / or various possible implementation manners of the first aspect.

[0042] The power grid energy storage Q&A method and system provided by the embodiment of the present application receive a question statement sent by a terminal device, obtain a reply result corresponding to the question statement through a knowledge graph constructed based on first power grid energy storage prediction data uploaded locally in the power grid field and second power grid energy storage prediction data obtained from the network, and return the reply result to the terminal device. Through the above method, the accuracy of the reply of the Q&A system is significantly improved, helping users quickly and accurately obtain relevant information in the field of power grid energy storage. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The accompanying drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present application and used together with the specification to explain the principles of the present application.

[0044] Figure 1 It is a schematic diagram of the scenario of a power grid energy storage Q&A method provided by the present application;

[0045] Figure 2 It is a schematic flow chart of a power grid energy storage Q&A method provided by the present application Figure 1 ;

[0046] Figure 3 It is a schematic flow chart of a power grid energy storage Q&A method provided by the present application Figure 2 ;

[0047] Figure 4 It is a schematic flow chart of a power grid energy storage Q&A method provided by the present application Figure 3 ;

[0048] Figure 5 It is a schematic flow chart of a power grid energy storage Q&A method provided by the present application Figure 4 ;

[0049] Figure 6 Structural schematic diagram of a power grid energy storage Q&A device provided by this application;

[0050] Figure 7 Structural schematic diagram of an electronic device provided by this application.

[0051] Through the above-mentioned drawings, specific embodiments of this application have been shown, and there will be more detailed descriptions hereinafter. These drawings and textual descriptions are not intended to limit the scope of the concept of this application in any way, but to illustrate the concept of this application to those skilled in the art by referring to specific embodiments. Specific Embodiments

[0052] Here, exemplary embodiments will be described in detail, and examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numerals in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. On the contrary, they are merely examples of devices and methods consistent with some aspects of this application as detailed in the appended claims.

[0053] First, the application background of this application is explained as follows:

[0054] With the accelerating advancement of the global energy transition, power grid energy storage, as a key infrastructure for the development of new energy, can not only balance the power grid supply and demand but also provide backup power in emergencies, which is a key means to maintain the safe and stable operation of the power grid. In addition, energy storage technology plays an important role in improving energy utilization efficiency, enhancing power grid stability, supporting emergency backup and disaster recovery, and promoting energy transition. Through energy storage technology, renewable energy can be better utilized, dependence on fossil fuels can be reduced, and thus greenhouse gas emissions can be decreased. Therefore, power grid energy storage has become a research hotspot and key development direction in the global energy field.

[0055] However, the power grid energy storage field involves professional knowledge in multiple fields such as electrochemical energy storage, physical energy storage, battery management, and power grid dispatching. At the same time, with the development of the power market reform and artificial intelligence technology, the professional barriers have been further increased. Since the relevant knowledge is scattered in different literatures, standards, and experiences, with diverse forms and difficult to integrate, it is difficult for non-professionals to quickly and accurately obtain information. Therefore, developing a power grid energy storage Q&A method and system based on a knowledge graph, which can provide quick and accurate answers, is of great significance for promoting the development and application of power grid energy storage technology.

[0056] In the energy storage knowledge question-and-answer method and system in the power grid field, the knowledge graph can help the system understand the user's questions and needs more accurately and provide more accurate and personalized answers and solutions. The existing energy storage knowledge graph in the power grid field has a relatively single data source, which is only through web crawlers or imported policy documents, resulting in the lack of diversity and comprehensiveness of the content of the knowledge graph, which limits the coverage of the knowledge graph and cannot fully reflect the complexity and dynamic changes in the field of power grid energy storage. When users ask questions involving cross-domain or multi-dimensional questions, the system may not be able to provide comprehensive and accurate answers, or when faced with emerging technologies or policy changes, the system may give outdated or irrelevant answers due to lagging data updates, which not only reduces the user's trust in the system, but also limits the actual application value of the question-and-answer system in the field of power grid energy storage, and it is difficult to meet the needs of practitioners for efficient and accurate knowledge acquisition, thereby affecting the promotion and development of power grid energy storage technology.

[0057] In addition, the existing knowledge graph-based grid energy storage question-and-answer system processes data source corpus and question statements through natural language processing (NLP) technology, long short-term memory network (LSTM) or non-Chinese large language model, resulting in the system being unable to fully and accurately capture the semantics and intentions in the Chinese context. At the same time, the existing question-and-answer system relies on template matching or simple semantic parsing, which is not effective in handling complex and changeable user questions.

[0058] In summary, it is a technical problem to be solved urgently to provide a technical solution that can significantly improve the accuracy of the answers of the power grid energy storage question and answer system, and then promote the promotion and development of power grid energy storage technology.

[0059] Figure 1 A scenario diagram of a knowledge graph-based power grid energy storage question-answering method provided in this application, such as Figure 1 As shown, the specific application scenario of the present application includes at least: a terminal device and a server. The power grid energy storage question and answer method based on the knowledge graph is applied to the server, which receives the question statement sent by the terminal device, obtains the answer result corresponding to the question statement through the knowledge graph constructed based on the first power grid energy storage expected data uploaded locally in the power grid field and the second power grid energy storage expected data obtained from the network, and returns the answer result to the terminal device.

[0060] The terminal device can be various electronic devices with functions such as a display screen and data transmission, such as a local personal computer (PC), a laptop computer, a tablet computer, etc. The terminal device can also be implemented as software or a software module. The server can be a server, a cloud computing platform, or other computing devices with data processing and storage capabilities. For the physical devices involved in the above descriptions, they are all exemplary in the figure and do not represent the only ones. The present application does not specifically limit the specific form and type of the physical devices involved. It should be noted that the method for answering questions about power grid energy storage based on a knowledge graph provided by the present application can be used in the field of energy storage technology, and can also be used in fields other than energy storage technology. The present application does not specifically limit its application field.

[0061] Combined with the above scenarios, it can be seen that the data sources of the existing knowledge graph of energy storage in the power grid field are relatively single, only through web crawlers or only importing policy documents, resulting in the lack of diversity and comprehensiveness of the content of the knowledge graph, and further resulting in the situation that the question answering system based on this knowledge graph may have incomplete information, inaccurate or even wrong answers when answering user questions. A method and system for answering questions about power grid energy storage based on a knowledge graph provided by the present application constructs a knowledge graph by using the first power grid energy storage prediction data uploaded locally in the power grid field and the second power grid energy storage prediction data obtained from the network, obtains the reply result corresponding to the question statement sent by the terminal device, and returns the reply result to the terminal device. It improves the accuracy of the reply of the question answering system and helps users quickly and accurately obtain relevant information in the field of power grid energy storage.

[0062] The following uses specific embodiments to elaborate in detail on the technical solution of the present application and how the technical solution of the present application solves the above technical problems. These several specific embodiments below can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The following will describe the embodiments of the present application in conjunction with the drawings.

[0063] Figure 2 Flow schematic of a method for answering questions about power grid energy storage based on a knowledge graph provided by the present application Figure 1 , such as Figure 2 shown, this method for answering questions about power grid energy storage based on a knowledge graph is applied to the server side and includes:

[0064] S201: Receive the question statement sent by the terminal device.

[0065] For the terminal device side, it sends the question statement to the server.

[0066] In this step, the terminal device provides a visual interface for obtaining the question statement input by the user. The user can input text through the keyboard or convert the input voice command into text through voice recognition technology. The terminal device sends the question statement input by the user to the server through a network connection, and the server performs parsing and processing. The visual interface provided by the terminal device includes elements such as a text input box, a voice input button, a submit button, etc., so as to enable the user to interact with the server, improving the user's operation efficiency and user experience.

[0067] S202: According to the question statement and the pre-constructed knowledge graph, obtain the reply result corresponding to the question statement, where the knowledge graph is constructed based on the first power grid energy storage corpus data uploaded locally in the power grid field and the second power grid energy storage corpus data obtained from the network.

[0068] In this step, the first power grid energy storage corpus data uploaded locally in the power grid field refers to some materials focusing on the power grid energy storage technology field collected and sorted out by relevant organizations or enterprises within the power grid industry, including but not limited to technical documents, research reports, operation manuals, fault records, maintenance logs, etc., and its form can be text, audio, video, graph, chart, etc. The second power grid energy storage corpus data obtained from the network refers to the public information and materials related to the power grid energy storage technology collected from the Internet, including but not limited to academic papers, industry news, technical blogs, online forum discussions, publicly available standards and specifications, reports released by governments and industry organizations, etc. Its form can also be diverse, including text, audio, video, charts, etc. The second power grid energy storage corpus data is usually obtained from the public network through web crawlers, application programming interfaces (Application Programming Interface, API) or other data collection technologies. Different from the locally uploaded corpus data, network data may contain a wider perspective and the latest industry dynamics, but its accuracy and relevance need to be further screened and verified. By combining local and network data, the server can construct a more comprehensive and dynamic knowledge graph to support more accurate and diverse question-and-answer functions.

[0069] Specifically, after obtaining the question statement sent by the terminal device, the server uses the knowledge graph constructed based on the first power grid energy storage prediction data uploaded locally in the power grid field and the second power grid energy storage prediction data obtained from the network to identify the knowledge nodes and relationship paths related to the question, generate one or more possible replies, and sort them according to relevance and accuracy to obtain the reply result corresponding to the question statement. Through the above method, a more comprehensive and dynamic knowledge management and question-and-answer function in the power grid energy storage field is realized, which not only improves the accuracy and relevance of the reply, but also enhances the adaptability and flexibility of the system, enabling it to handle diverse and complex user needs.

[0070] S203: Return the reply result to the terminal device.

[0071] For the terminal device side, it receives the reply result sent by the server. The user obtains the reply result corresponding to the question statement through the terminal device.

[0072] A method for answering questions about power grid energy storage based on a knowledge graph provided by an embodiment of the present application is applied to the server side. By receiving the question statement sent by the terminal device, it generates a corresponding reply result using the pre-constructed knowledge graph and returns the result to the terminal device. The knowledge graph is constructed by the server by integrating the power grid energy storage corpus data uploaded locally and the public information obtained from the network. It not only covers the professional materials within the power grid industry but also includes the latest industry trends and a wide perspective. Through the above method, the accuracy and relevance of the question-answering system are improved, the adaptability and flexibility of the system are enhanced, it can effectively handle diverse and complex user needs, and the user experience and satisfaction are improved.

[0073] Figure 3 Flow schematic of a method for answering questions about power grid energy storage based on a knowledge graph provided by the present application Figure 2 , on the basis of the Figure 2 embodiment, before obtaining the reply result corresponding to the question statement according to the question statement and the pre-constructed knowledge graph, the method includes:

[0074] S301: Obtain a set of data to be processed, where the set of data to be processed includes first power grid energy storage corpus data and second power grid energy storage corpus data.

[0075] In this step, as described in the Figure 2 embodiment, the first power grid energy storage corpus data is obtained based on the local upload in the power grid field, and the second power grid energy storage corpus data is obtained from the public network through web crawlers, API interfaces or other data collection technologies. The set of data to be processed not only covers the professional materials within the power grid industry but also includes the latest industry trends and a wide perspective, ensuring that the data set always remains up-to-date and most relevant.

[0076] Specifically, in a specific implementation manner, in a web crawler task, the terminal device is pre-configured with multiple crawler Uniform Resource Locators (URLs), and these URLs are usually high-quality data sources that have been screened. At the same time, the user is allowed to view, edit, add, or delete these URLs, and the user can manually start the crawler task or set a scheduled task to perform web crawling regularly. When uploading the first power grid energy storage corpus data locally, the terminal device supports multiple common file formats, such as PDF, Word, Excel, CSV, PNG, etc., and automatically parses the uploaded files to extract information such as text, images, and tables in the files.

[0077] In a specific implementation manner, the ratio of the data volume of the first power grid energy storage corpus data to the data volume of the second power grid energy storage corpus data in the data set to be processed is a preset ratio.

[0078] Specifically, the user can set the preset ratio of the data volume of the first power grid energy storage corpus data to the data volume of the second power grid energy storage corpus data in the data set to be processed through the terminal device to meet the requirements of specific application scenarios. For example, in occasions that require high specialization and accuracy, the user can increase the ratio of the first power grid energy storage corpus data because this data comes from within the power grid industry and has high authority and reliability. In occasions that require obtaining the latest industry trends and a wide perspective, the user can increase the ratio of the second power grid energy storage corpus data because this data comes from the public network and can reflect the current technological trends and diverse viewpoints. Through the adjusted ratio setting, the system can dynamically adapt to different user needs and application scenarios, ensuring that the construction of the knowledge graph is both accurate and forward-looking, thereby improving the overall effect of the question-answering function and user satisfaction.

[0079] For example, the ratio of the data volume of the first power grid energy storage corpus data to the data volume of the second power grid energy storage corpus data can be set to 7:3, that is, the data volume of the first power grid energy storage corpus data accounts for 70% of the total data volume of the data set to be processed, and the data volume of the second power grid energy storage corpus data accounts for 30% of the total data volume of the data set to be processed. Of course, the preset ratio can also be set to 8:2, 6:4, etc. The user can adjust the ratio of the data sources at any time according to the actual situation to adapt to different application scenarios and needs, and this application does not make specific limitations.

[0080] S302: Annotate the data set to be processed through the decoder of the qwen2.5 model to obtain entity annotation data, relationship annotation data, and sentiment annotation data, where the decoder includes an entity recognition decoder, a relationship extraction decoder, and a sentiment analysis decoder.

[0081] In this step, the Qwen 2.5 model is a new generation of large-scale language model launched by Alibaba's Tongyi Qianwen team. As an important upgraded version of this series, it has shown significant improvements in natural language understanding, generation capabilities, and multi-modal interaction. This model continues the core design based on the Transformer architecture, with a particular focus on the in-depth optimization of the decoder part to support more complex context reasoning and long sequence generation tasks. Its decoder adopts a multi-layer stacked self-attention mechanism and a feed-forward neural network module. By improving the dynamic allocation strategy of attention heads and sparse computing optimization, the efficiency and accuracy of the model in processing long texts have been significantly improved.

[0082] First, preprocessing operations such as cleaning, removing noise, duplicates, and invalid information are performed on the data set to be processed to ensure the quality of the data. Then, the server annotates the data set to be processed through the Qwen 2.5 model. The entity recognition decoder performs sequence annotation through the Conditional Random Field (CRF) layer to annotate the energy storage-related entities in the data and obtain entity annotation data; the relation extraction decoder performs relation classification through Bi-LSTM or Transformer layers to annotate the relations between entities and obtain relation annotation data; the sentiment analysis decoder performs sentiment classification on the data through a fully connected layer to annotate the sentiment tendency of the data and obtain sentiment annotation data.

[0083] For example, the server annotates a piece of data in the data set to be processed through the Qwen 2.5 model: "As of the end of 2023, the cumulative installed capacity of the commissioned power energy storage projects was 86.5 GW, accounting for 30% of the total global market scale, with a year-on-year increase of 45%. The cumulative installed capacity of pumped storage accounted for less than 60% for the first time, while the cumulative installed capacity of new energy storage exceeded 30 GW for the first time, and both the power scale and energy scale increased by more than 150% year-on-year." In entity annotation, "2023" is annotated as "time", "86.5 GW" is annotated as "cumulative installed capacity", and "pumped storage" and "new energy storage" are annotated as "technology types". In relation annotation, "pumped storage" as a technology type and "less than 60% for the first time" are annotated as "installed capacity ratio"; "new energy storage" and "year-on-year increase of more than 150%" are annotated as "growth rate association". The sentiment annotation result is positive sentiment.

[0084] By using multiple decoders of the Qwen 2.5 model, efficient and accurate annotation of the data set to be processed has been achieved, enabling the significant improvement of the Qwen 2.5 model in natural language understanding, generation capabilities, and multi-modal interaction, and better handling of complex context reasoning and long sequence generation tasks.

[0085] S303: Construct a knowledge graph based on entity annotation data, relationship annotation data, and sentiment annotation data.

[0086] In this step, based on the multiple structured, semi-structured, and unstructured entity annotation data, relationship annotation data, and sentiment annotation data obtained in S302, all entity nodes are identified. Using the relationship annotation data, edges representing the relationships between the entity nodes are established. For example, the "installed capacity ratio" relationship between "pumped storage" and "first below 60%" will be represented as an edge connecting these two nodes. In addition, during the construction process, to ensure data normalization and consistency, the server performs entity disambiguation and reference resolution on the entity names involved, avoiding the repeated creation of the same entity due to different naming methods. Finally, the constructed knowledge graph is stored on the server through neo4j technology. Through the above method, the construction of the energy storage knowledge graph in the power grid field is realized, providing a solid foundation for the further research and application of energy storage intelligent question answering in the power grid field.

[0087] A power grid energy storage question answering method based on a knowledge graph provided by an embodiment of the present application has completed the construction of the energy storage knowledge graph in the power grid field. Data sets are obtained through two methods: local upload and web crawling, and the data sets are annotated through the qwen2.5 model. Through entity recognition, relationship extraction, and sentiment analysis, accurate annotation of energy storage-related data is achieved. Finally, the knowledge graph is constructed based on the annotation data. Through the above method, it lays a foundation for the system to better support data-driven decision-making and intelligent applications, and improve the overall effect of the question answering function and user satisfaction.

[0088] Figure 4 Flow schematic of a power grid energy storage question answering method provided by the present application Figure 3 In this embodiment, on the basis of Figure 2 the embodiment, before obtaining the reply result corresponding to the question statement according to the question statement and the pre-constructed knowledge graph, the method further includes:

[0089] S401: Split the entity annotation data, relationship annotation data, and sentiment annotation data into multiple sub-word units; and map each sub-word unit and add position encoding to obtain multiple encoded sub-word units.

[0090] In this step, the Transformer encoder of the Qwen 2.5 model is one of the core components of the model, focusing on representing learning and context understanding of the input data. Its main function is feature extraction, that is, mapping the input text data into a high-dimensional vector representation. The Transformer encoder realizes feature extraction through multiple layers of stacked self-attention mechanisms and feed-forward neural networks. In addition, by improving the dynamic allocation strategy of attention heads and sparse computing optimization, this encoder has improved the efficiency and accuracy of the Qwen 2.5 model in processing long texts, making the model more efficient in processing large-scale datasets and complex tasks, and generating more professional and accurate response results.

[0091] Specifically, taking the data "New energy storage is a type of energy storage technology that mainly outputs electricity, excluding pumped storage, and has the characteristics of short construction period, simple and flexible site selection, and strong regulation ability." which has completed entity annotation, relation annotation, and sentiment annotation as an example, the Transformer encoder performs feature extraction on this data, splitting the data into multiple sub-word units Tokens, such as ["New", "energy", "storage", "is", "excluding", "pumped", "storage", ",", "mainly", "outputs", "electricity", "as", "the", "main", "form", "of", "energy", "storage", "technology", ",", "has", "the", "characteristics", "of", "short", "construction", "period", ",", "simple", "and", "flexible", "site", "selection", ",", "strong", "regulation", "ability", "of", "the", "characteristics", "."]. Each Token is mapped to a high-dimensional vector (such as 768 dimensions) to capture the semantic features of each sub-word unit, enabling the model to use these features for complex semantic analysis and reasoning in subsequent calculations. At the same time, in order to enable the Qwen 2.5 model to understand the order information of the input data, position encoding is added to the vector representation of each Token to provide information about the position of the Token in the sequence, thereby better capturing context relationships and semantic structures. In this way, the model can process and generate natural language text more accurately.

[0092] S402: Calculate the correlation weights between each encoded sub-word unit and other encoded sub-word units.

[0093] In this step, the Transformer encoder dynamically focuses on the importance of different parts of the input sequence through the attention mechanism, thus better understanding the context relationship. The attention mechanism determines which parts are most important for the semantic understanding of the current sub-word unit by calculating the correlation weights between each encoded sub-word unit and other encoded sub-word units. Each sub-word unit is regarded as a "query", and interacts with all sub-word units (including itself) as "keys" and "values". In this way, the Transformer encoder can dynamically focus on different parts of the input sequence and further understand the context relationship of the data.

[0094] Specifically, calculate the correlation weights between each encoded sub-word unit and other encoded sub-word units. Taking the sub-word unit "energy storage" as an example, "energy storage" is used as a query, and its corresponding vector is , and all other sub-word units in the sequence are used as keys. For example, the key vector of "new type" is , then the attention score between the two is . Similar calculations are performed on the key vectors of "energy storage" and all other sub-word units in the sequence, and an attention score is obtained for each. To avoid the score value from being too large, the attention score is scaled by dividing the score by the square root of the key vector dimension. Then the scaled attention scores are normalized through the softmax function, so that the sum of all scores is 1, and each score is converted into a probability value between 0 and 1, that is, the attention weight. These weights indicate the degree to which "energy storage" should focus on other sub-word units in the current context. For example, assume that after calculation and normalization, the attention weight between "energy storage" and "new type" is 0.3, the weight with "energy accumulation" is 0.6, and the weight with "electricity" is 0.7, etc. This weight vector indicates that when understanding the current sentence, "energy storage" should pay more attention to sub-word units such as "energy accumulation" and "electricity". Through the above method, the model can dynamically adjust its attention to different sub-word units, thus better understanding the semantic structure of the sentence.

[0095] S403: Train the initial qwen2.5 model based on multiple encoded sub-word units and the multiple correlation weights corresponding to each sub-word unit to obtain the qwen2.5 model.

[0096] In this step, based on multiple encoded sub-word units and the multiple correlation weights corresponding to each sub-word unit, the initial qwen2.5 model is trained to optimize the model parameters so that it can more accurately understand and generate natural language text. In this process, the model adjusts its internal parameters through the backpropagation algorithm to minimize the error between the predicted output and the true label.

[0097] Specifically, during the training process, model parameters (such as attention weights, linear transformation matrices, etc.) are updated through the backpropagation algorithm. The backpropagation algorithm calculates the gradient based on the error between the predicted output of the model and the true labels, and uses optimization algorithms such as gradient descent to adjust the parameters to gradually reduce the error. This process is iterated continuously until the performance of the model reaches the expected level. In this way, the qwen2.5 model gradually learns how to effectively process and generate natural language text during the training process. Finally, the fully trained qwen2.5 model can perform well in complex natural language processing tasks and generate more professional and accurate response results.

[0098] A method for answering questions about power grid energy storage based on a knowledge graph provided by an embodiment of the present application uses the Transformer encoder of the qwen2.5 model to achieve efficient text representation learning and context understanding. First, entity, relationship, and sentiment annotation data are segmented into sub-word units, and high-dimensional vector representations are obtained through mapping and positional encoding to capture the semantic features and sequential information of the text. Subsequently, the self-attention mechanism is used to calculate the correlation weights between sub-word units, enabling the model to dynamically focus on important parts and enhancing context understanding. During the training phase, the model optimizes the parameters through backpropagation and gradually improves its ability to process natural language text. Through the above method, the fully trained qwen2.5 model can generate more professional and accurate response results in complex natural language processing tasks, further improving the performance and user experience of the power grid energy storage question-answering system.

[0099] Figure 5 Flow diagram of a method for answering questions about power grid energy storage based on a knowledge graph provided by the present application Figure 4 , this embodiment is based on Figure 2 On the basis of the embodiment, according to the question statement and the pre-constructed knowledge graph, the response result corresponding to the question statement is obtained, including:

[0100] S501: Extract information from the question statement according to the qwen2.5 model to obtain multiple keywords.

[0101] In this step, the qwen2.5 model is the model obtained through the above-mentioned sufficient training. Specifically, if the question statement input by the user through the terminal device is: What are leasing, sharing, and self-built energy storage in the power industry, and what are their differences? When the server receives this original question statement, it first extracts information from the question statement through the qwen2.5 model to obtain multiple keywords: "power industry", "leasing", "sharing", "self-built", "energy storage", "difference", etc. By breaking down the question statement into multiple keywords, the system can retrieve information in the knowledge base more efficiently and quickly find content related to the user's question. Especially in complex or long sentences, it can capture the core concepts and themes. Keyword extraction is an important step in improving the performance of the question-and-answer system and the user experience, ensuring that the model can process and respond to the user's questions quickly and accurately.

[0102] S502: Use the qwen2.5 model to perform intention recognition based on the question statement to obtain the user's question intention.

[0103] In this step, the qwen2.5 model is used to perform intention recognition on the question statement to clarify the user's question intention. This process is a key link in natural language understanding, aiming to extract the real problem that the user wants to understand or solve from the text input by the user. Intention recognition involves in-depth analysis of sentence structure, semantic relationships, and context.

[0104] Specifically, combining the multiple keywords extracted above, the qwen2.5 model further analyzes the user's semantic needs. For the question statement "What are leasing, sharing, and self-built energy storage in the power industry, and what are their differences?", it is recognized that the user's intention is to inquire about the concepts and differences of different energy storage modes in the power industry. In this way, the model can convert the user's natural language input into a structured intention representation. The accuracy of intention recognition directly affects the direction of subsequent information retrieval and answer generation. Accurate intention recognition ensures that the system can provide targeted answers that meet the user's needs, thereby improving the user experience and the overall efficiency of the system.

[0105] In a specific implementation manner, qwen2.5 is also used to disassemble the original question statement, converting the question statement into more specific sub-questions for subsequent query. For example, the model disassembles the question statement "What are leasing, sharing, and self-built energy storage in the power industry, and what are their differences?" into multiple sub-questions, including "What is the definition of leased energy storage?", "What are the applicable scenarios?", "What is the definition of shared energy storage?", "How to achieve resource sharing?", "What is the definition of self-built energy storage?", "What are the advantages and disadvantages?", "What are the main differences between leased, shared, and self-built energy storage?".

[0106] By decomposing complex problems into multiple sub-problems, the system can more precisely understand the user's query intent and conduct more targeted retrieval in the knowledge base. Each sub-problem focuses on specific aspects, such as definitions, applicable scenarios, implementation methods, advantages and disadvantages, etc., enabling the system to provide more detailed and comprehensive answers. This not only improves the efficiency of information retrieval but also enhances the system's semantic understanding ability, ensuring that the generated response results are more in line with the actual needs of users.

[0107] S503: According to the question intent and keywords, use the Elastic Search method to search in the knowledge graph to obtain the response result.

[0108] In this step, Elastic Search is a powerful distributed search and analysis engine that can quickly process and retrieve large-scale data. Its distributed architecture allows it to store and process data on multiple nodes, thereby achieving efficient data access and query performance.

[0109] According to the question intent and keywords, Elastic Search traverses and compares the data in the knowledge graph through its full-text search and structured search capabilities, quickly determining the specific content and scope that the user wants to find, and finding the nodes and edges in the knowledge graph that match the query. Since Elastic Search supports distributed search, it can execute search operations in parallel on multiple nodes, thereby accelerating the search speed and improving search efficiency. In addition, Elastic Search also uses indexes and inverted indexes to speed up the retrieval speed. The index records the location information of the data in the storage medium, enabling the data to be quickly located and accessed. The inverted index maps each word in the document to the documents containing that word, allowing Elastic Search to quickly locate the documents containing specific terms, thereby generating accurate response results. For example, through the Elastic Search method, search in the knowledge graph to obtain detailed information about leasing, sharing, and self-built energy storage, and obtain the response result. An example of a response result: Leased energy storage: Suitable for users with short-term needs or limited budgets. Shared energy storage: Suitable for multiple users who need to cooperate, emphasizing resource sharing. Self-built energy storage: Suitable for users with long-term use and sufficient funds.

[0110] Through the above search mechanism, the system can maintain high performance when processing massive data, meet the user's needs for fast and accurate information retrieval, enable the Q&A system to still provide a high-quality user experience in complex query scenarios, ensure that users can obtain the required information in a timely manner, and return response results highly relevant to the user's questions.

[0111] S504: Use the large language model to polish the response result to obtain a response result that conforms to the user's language habits.

[0112] In this step, the Qwen 2.5 model receives the scattered reply results returned by Elastic Search and further integrates and polishes them. During the integration process, the model identifies the logical relationships between individual information segments to ensure the coherence and consistency of the content. By analyzing the theme and context of the information, it determines the order of information presentation, making the reply results clearer and easier to understand. In addition, the model also polishes the language, adjusts the diction and grammatical structure of the sentences, and makes personalized adjustments to the reply style according to the user's language habits and preferences, including using terms, tones, and expressions more suitable for the user to improve the user's reading experience. In this way, the model not only provides accurate information but also ensures that the reply results are semantically fluent and structurally reasonable, thereby enhancing user satisfaction and the overall performance of the system.

[0113] Finally, the server returns the reply results that conform to the user's language habits to the terminal device, meeting their query needs and enhancing the interaction experience.

[0114] An example of a reply result that conforms to the user's language habits:

[0115] In the power industry, leasing, sharing, and self-building energy storage are three common energy storage models, each with its own characteristics and applicable scenarios:

[0116] 1. Leased energy storage:

[0117] Definition: Users use energy storage equipment or services provided by a third party by paying rent.

[0118] Advantages: No initial investment required, flexible capacity adjustment, and access to professional operation and maintenance support.

[0119] Disadvantages: Higher long-term costs and dependence on suppliers.

[0120] Applicable scenarios: Users with short-term needs or limited budgets.

[0121] 2. Shared energy storage:

[0122] Definition: Multiple users jointly use an energy storage system to reduce investment costs through resource integration.

[0123] Advantages: Cost sharing, improved resource utilization, and flexible expansion.

[0124] Disadvantages: High coordination difficulty and complex revenue distribution.

[0125] Applicable scenarios: Multiple users who need to cooperate.

[0126] 3. Self-built energy storage:

[0127] Definition: Users invest in building energy storage facilities by themselves and have full control over energy storage resources.

[0128] Advantages: Full control, lower long-term costs, and customizable design.

[0129] Disadvantages: High initial investment and self-responsibility for operation and maintenance.

[0130] Applicable scenarios: Users with long-term usage and sufficient funds.

[0131] Generally speaking, leased energy storage is suitable for short-term needs, shared energy storage emphasizes resource integration, while self-built energy storage provides full control. The choice of which mode depends on the actual needs and budget of the user.

[0132] A method for answering questions about power grid energy storage based on a knowledge graph provided by an embodiment of this application aims to optimize the user's query experience through natural language processing technology and search engine. First, the qwen2.5 model extracts information from the question statement input by the user, identifies multiple keywords for efficient retrieval in the knowledge base. Then, the model performs intent recognition, clarifies the user's query needs, and decomposes complex questions into multiple sub-questions to enhance the system's semantic understanding ability and the pertinence of information retrieval. In the information retrieval stage, Elastic Search is used to quickly locate relevant information from the knowledge graph and obtain the reply results. Finally, the qwen2.5 model polishes the retrieved reply results to ensure the coherence of the content and the naturalness of the language. Through the above method, the system can quickly and accurately process complex queries, provide high-quality reply results, and meet the diverse needs of users.

[0133] In a possible implementation, when the qwen2.5 model deployed on the terminal device obtains the question statement input by the user, it makes predictions based on partial questions or keywords input by the user and provides possible question options for the user according to a certain priority.

[0134] Specifically, the system will retrieve the user's historical question records to quickly display previously relevant questions. In addition, the qwen2.5 model identifies partial keywords that the user has already input, predicts and supplements complete questions based on these keywords, and selects the five questions most relevant to the user's input for the user to choose and refer to. This function aims to improve the efficiency and accuracy of the user's input and help the user find the required information more quickly. The process of the model identifying entities in the question is as follows:

[0135] The core component of the qwen2.5 model is the Embedding Layer, which converts the question statement into a fixed-length vector, enabling the model to process various input texts. Mathematically, this can be expressed as:

[0136]

[0137] Among them, represents the input text, represents a fixed-length vector, which represents the representation of the question sentence in the embedding space.

[0138] The question sentence is first represented by a pre-defined word vector (such as Word2Vec), and then enters the embedding layer. The embedding layer extracts features from the question sentence through multiple activation functions. Then, through a series of layers, such as the Gated Recurrent Unit (GRU), LSTM, etc., the model can learn more complex feature representations, so as to realize the extraction of various information including entity recognition from the question sentence.

[0139] Mathematically, this can be represented as a series of non-linear transformations:

[0140]

[0141] Among them, represents the hidden state at time step , represents the input vector (i.e., the embedded word vector) at time step , represents the non-linear transformation function, that is, the unit functions such as LSTM and GRU.

[0142] In another possible implementation, during the model training process, in response to the parameter adjustment request sent by the training terminal received, the model parameters of the qwen2.5 model are adjusted; among them, the model parameters include the learning rate, batch size, number of training epochs, and weight decay.

[0143] The hyperparameters such as the loss function, learning rate, batch size, number of training epochs, weight decay, dropout probability, etc. are adjusted by methods such as the learning rate scheduler and Bayesian optimization. Among them, the learning rate adjuster can dynamically adjust the learning rate. For example, the learning rate is gradually decreased during the training process, or the learning rate is decreased when the validation error no longer decreases. Bayesian optimization uses a probability model to predict which parameter combinations are most likely to produce better results and gradually optimizes the parameters.

[0144] In addition, the model parameters also include the sizes of the Qwen 2.5 models, including 0.5B, 1.5B, 7B, and 72B. For the 0.5B parameter model, it is usually used in resource-constrained environments and can provide basic natural language processing functions with lower computing and storage requirements. The 1.5B parameter model performs better in handling complex tasks and is suitable for applications that require higher accuracy and more complex understanding. The 7B parameter model further enhances the language understanding and generation capabilities, can handle more complex contexts, and provide smoother language generation, suitable for scenarios that require high-quality output. The 72B parameter model represents top performance and can provide excellent understanding and generation capabilities in extremely complex tasks, suitable for applications that require the highest accuracy and the most complex analysis. Different-sized models have trade-offs in terms of computing resources, response speed, and result quality. Selecting the appropriate model size depends on specific application requirements and available resources.

[0145] Figure 6 The following is a schematic structural diagram of a power grid energy storage question-answering device based on a knowledge graph provided by this application, as Figure 6 shown. The power grid energy storage question-answering device 60 provided in this embodiment includes:

[0146] A first processing module 601, configured to receive a question statement sent by a terminal device;

[0147] A second processing module 602, configured to obtain a reply result corresponding to the question statement according to the question statement and a pre-constructed knowledge graph, where the knowledge graph is constructed based on first power grid energy storage corpus data uploaded locally in the power grid field and second power grid energy storage corpus data obtained from the network;

[0148] A third processing module 603, configured to return the reply result to the terminal device.

[0149] In a possible implementation manner, the second processing module 602 is specifically configured to:

[0150] Extract information from the question statement according to the Qwen 2.5 model to obtain multiple keywords;

[0151] Search the knowledge graph using the Elastic Search method according to the multiple keywords to obtain the reply result.

[0152] In a possible implementation manner, the second processing module 602 is further specifically configured to:

[0153] Identify the user's question intention according to the question statement using the Qwen 2.5 model;

[0154] According to the question intention and keywords, use the Elastic Search method to search from the knowledge graph to obtain the response result.

[0155] In a possible implementation, the power grid energy storage question-answering device 60 based on the knowledge graph further includes a fourth processing module 604, which is used for:

[0156] Obtain a set of data to be processed, where the set of data to be processed includes first power grid energy storage corpus data and second power grid energy storage corpus data;

[0157] Annotate the set of data to be processed through the decoder of the qwen2.5 model to obtain entity annotation data, relationship annotation data, and sentiment annotation data, where the decoder includes an entity recognition decoder, a relationship extraction decoder, and a sentiment analysis decoder;

[0158] Construct a knowledge graph based on the entity annotation data, relationship annotation data, and sentiment annotation data.

[0159] In a possible implementation, the power grid energy storage question-answering device 60 based on the knowledge graph further includes a fifth processing module 605, which is used for:

[0160] Segment the entity annotation data, relationship annotation data, and sentiment annotation data into multiple sub-word units;

[0161] Map each sub-word unit and add positional encoding to obtain multiple encoded sub-word units;

[0162] Calculate the correlation weights between each encoded sub-word unit and other encoded sub-word units;

[0163] Train the initial qwen2.5 model based on the multiple encoded sub-word units and the multiple correlation weights corresponding to each sub-word unit to obtain the qwen2.5 model.

[0164] In a possible implementation, the fourth processing module 604 is specifically used to indicate that the ratio of the data volume of the first power grid energy storage corpus data to the data volume of the second power grid energy storage corpus data in the set of data to be processed is a preset ratio.

[0165] In another possible implementation, the power grid energy storage question-answering device 60 based on the knowledge graph further includes a sixth processing module 606, which is used for:

[0166] During the model training process, in response to the parameter adjustment request sent by the training terminal, adjust the model parameters of the qwen2.5 model;

[0167] Among them, the model parameters include learning rate, batch size, number of training epochs, and weight decay.

[0168] A power grid energy storage question-answering device based on a knowledge graph provided in this embodiment can execute the method provided in the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here in this embodiment.

[0169] Figure 7 It is a schematic structural diagram of an electronic device provided in this application. As Figure 7 shown, the electronic device 70 provided in this embodiment includes: at least one processor 701 and a memory 702. Optionally, the device 70 further includes a communication component 703. Among them, the processor 701, the memory 702, and the communication component 703 are connected through a bus 704.

[0170] In the specific implementation process, at least one processor 701 executes the computer execution instructions stored in the memory 702, so that at least one processor 701 executes the above method.

[0171] For the specific implementation process of the processor 701, reference can be made to the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here in this embodiment.

[0172] In the above embodiment, it should be understood that the processor may be a central processing unit (Central Processing Unit, CPU), or other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the invention can be directly embodied as being executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.

[0173] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.

[0174] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience in representation, the buses in the drawings of this application are not limited to only one bus or one type of bus.

[0175] This application also provides a power grid energy storage question-answering system based on a knowledge graph, including:

[0176] a terminal device and a server;

[0177] Among them, the terminal device is used to obtain the question statement input by the user and transmit the question statement to the server; the server is used to execute the method provided in the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here in this embodiment.

[0178] This application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the processor executes the computer-executable instructions, the above method is implemented.

[0179] The above-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random-Access Memory (SRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic memory, flash memory, a magnetic disk or an optical disc. The readable storage medium can be any available medium accessible by a general-purpose or special-purpose computer.

[0180] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an Application Specific Integrated Circuits (ASIC). Of course, the processor and the readable storage medium can also exist as discrete components in a device.

[0181] The division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the couplings, direct couplings, or communication connections shown or discussed among each other can be indirect couplings or communication connections through some interfaces, devices, or units, and can be in electrical, mechanical, or other forms.

[0182] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0183] In addition, in each embodiment of the present invention, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.

[0184] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or a part of this technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in each embodiment of the present invention. And the aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory ROM, random access memory (RAM), magnetic disks, or optical discs that can store program codes.

[0185] Those of ordinary skill in the art will understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments; and the foregoing storage medium includes: various media such as ROM, RAM, magnetic disk, or optical disk that can store program code.

[0186] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses, or adaptations of the present invention, which follow the general principles of the present invention and include known common general knowledge or conventional technical means in the technical field not disclosed by the present invention. It is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present invention is only limited by the appended claims.

Claims

1. A knowledge graph-based question-answering method for power grid energy storage, characterized in that: include: Receiving question statements sent by the terminal device; According to the question statement and the pre-constructed knowledge graph, an answer result corresponding to the question statement is obtained, wherein the knowledge graph is constructed based on first power grid energy storage corpus data uploaded locally in the power grid field and second power grid energy storage corpus data obtained from the network; The reply result is returned to the terminal device.

2. The method according to claim 1, characterized in that The step of obtaining a response result corresponding to the question statement according to the question statement and the pre-constructed knowledge graph includes: Extract information from the question statement according to the qwen2.5 model to obtain multiple keywords; According to the multiple keywords, an Elastic Search method is used to search the knowledge graph to obtain the reply result.

3. The method according to claim 2, characterized in that The method of searching the knowledge graph using the ElasticSearch method according to the multiple keywords to obtain the response result includes: According to the question statement, the qwen2.5 model is used to perform intent recognition to obtain the user's question intention; According to the question intention and the keywords, an Elastic Search method is used to search the knowledge graph to obtain the answer result.

4. The method according to any one of claims 1 to 3, characterized in that: Before returning the reply result to the terminal device, the method further includes: The reply result is polished by a large language model to obtain a reply result that conforms to the user's language habits.

5. The method according to any one of claims 1 to 3, characterized in that: Before obtaining a response result corresponding to the question statement according to the question statement and the pre-constructed knowledge graph, the method further includes: Acquire a set of data to be processed, wherein the set of data to be processed includes the first power grid energy storage corpus data and the second power grid energy storage corpus data; The data set to be processed is annotated by a decoder of the qwen2.5 model to obtain entity annotation data, relationship annotation data and sentiment annotation data, wherein the decoder includes an entity recognition decoder, a relationship extraction decoder and a sentiment analysis decoder; The knowledge graph is constructed based on the entity annotation data, the relationship annotation data and the sentiment annotation data.

6. The method according to claim 5, characterized in that The method further comprises: Splitting the entity annotation data, the relationship annotation data, and the sentiment annotation data into a plurality of subword units; Map each sub-word unit and add position encoding to obtain multiple encoded sub-word units; Calculate the correlation weight between each encoded sub-word unit and other encoded sub-word units; Based on the multiple encoded sub-word units and the multiple relevance weights corresponding to each sub-word unit, the initial qwen2.5 model is trained to obtain the qwen2.5 model.

7. The method according to claim 5, characterized in that The ratio of the data volume of the first power grid energy storage corpus data to the data volume of the second power grid energy storage corpus data in the to-be-processed data set is a preset ratio.

8. The method according to claim 6, characterized in that The method further comprises: During the model training process, in response to a parameter adjustment request received from the training terminal, the model parameters of the qwen2.5 model are adjusted; The model parameters include learning rate, batch size, number of training rounds and weight decay.

9. A knowledge graph-based power grid energy storage question-answering device, characterized in that: include: A first processing module is used to receive a question statement sent by a terminal device; A second processing module is used to obtain a reply result corresponding to the question statement according to the question statement and a pre-constructed knowledge graph, wherein the knowledge graph is constructed based on first power grid energy storage corpus data uploaded locally in the power grid field and second power grid energy storage corpus data obtained from the network; The third processing module is used to return the reply result to the terminal device.

10. An electronic device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 8 when executed by a processor.

12. A knowledge graph-based power grid energy storage question-answering system, characterized in that: include: Terminal equipment and server; The terminal device is used to obtain a question statement input by a user and transmit the question statement to the server; The server is used to execute the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Question answering method combining sequence model and knowledge graph

    CN116127095A

  • Retrieval enhancement generation method, system and equipment, medium and query method and system

    CN118643903A

  • Power system knowledge question-answering system based on GPT model

    CN119202197A

  • Real-time contextually aware artificial intelligence (AI) assistant system and a method for providing a contextualized response to a user using ai

    US20240412720A1