Knowledge graph-based question-answering method and system for power grid energy storage
By constructing a knowledge graph based on power grid energy storage corpus data and combining it with the Qwen2.5 model and Elastic Search for information processing, the data diversity and accuracy issues of the power grid energy storage question-and-answer system were resolved, achieving more efficient information acquisition and user experience.
Patent Information
- Application Number
- CN202510250103.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-04
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2045-03-04
AI Technical Summary
The existing knowledge graph for power grid energy storage has a single data source and lacks diversity and comprehensiveness. It cannot cover professional knowledge in multiple fields such as electrochemical energy storage, physical energy storage, and battery management. It is difficult to integrate power market reform and artificial intelligence technology, resulting in incomplete information, inaccurate or wrong answers when answering user questions.
By combining locally uploaded power grid energy storage corpus data with power grid energy storage corpus data obtained from the Internet to build a knowledge graph, the qwen2.5 model is used for entity, relationship and sentiment annotation. Elastic Search is combined for information retrieval and large language model polishing to generate response results that conform to user language habits.
The accuracy and adaptability of the question-answering system's responses have been significantly improved, enabling it to quickly and accurately provide relevant information in the field of power grid energy storage, enhancing the system's flexibility and user experience.
Smart Images

Figure CN120067271B_ABST
Abstract
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 renewable energy development, is becoming increasingly important. However, grid energy storage involves diverse expertise in various forms that are difficult to integrate, hindering practitioners from quickly and accurately obtaining information. Therefore, developing a knowledge graph-based grid energy storage question-and-answer method and system that can provide fast and accurate answers to questions in the field is crucial for promoting the development and application of grid energy storage technology.
[0003] The existing energy storage knowledge graph in the power grid field has a relatively single data source, which is only obtained through web crawlers or imported relevant files. 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 artificial intelligence technology applications. The coverage of the knowledge graph is limited and it cannot fully reflect the complexity and dynamic changes in the power grid energy storage field. As a result, the question-answering 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-answering method and system to improve the accuracy of the answers given by the power grid energy storage question-answering 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 question statements sent by the terminal device;
[0008] Obtaining a response 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;
[0009] The reply result is returned to the terminal device.
[0010] In a possible implementation, obtaining a response result corresponding to the question statement based on the question statement and a pre-built knowledge graph includes:
[0011] Extract information from the question statement according to the qwen2.5 model to obtain multiple keywords;
[0012] Based on the multiple keywords, an Elastic Search method is used to search the knowledge graph to obtain the response result.
[0013] In a possible implementation, searching the knowledge graph using an Elastic Search method based on the multiple keywords to obtain the response result includes:
[0014] According to the question statement, the qwen2.5 model is used to perform intent recognition to obtain the user's question intention;
[0015] According to the question intention and the keywords, the Elastic Search method is used to search the knowledge graph to obtain the answer result.
[0016] In a possible implementation, before returning the reply result to the terminal device, the method further includes:
[0017] The response result is polished by a large language model to obtain a response result that conforms to the user's language habits.
[0018] In a possible implementation, before obtaining a response result corresponding to the question statement based on the question statement and the pre-constructed knowledge graph, the method further includes:
[0019] Acquire a data set to be processed, wherein the data set to be processed includes the first power grid energy storage corpus data and the second power grid energy storage corpus data;
[0020] The data set to be processed is annotated by the 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;
[0021] The knowledge graph is constructed based on the entity annotation data, the relationship annotation data, and the sentiment annotation data.
[0022] In one possible implementation, the method further includes:
[0023] Splitting the entity annotation data, the relationship annotation data, and the sentiment annotation data into a plurality of subword units;
[0024] Map each subword unit and add position encoding to obtain multiple encoded subword units;
[0025] Calculate the correlation weight between each encoded subword unit and other encoded subword units;
[0026] 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.
[0027] In a possible 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 to-be-processed data set is a preset ratio.
[0028] In one possible implementation, the method further includes:
[0029] 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;
[0030] The model parameters include learning rate, batch size, training set, and weight decay.
[0031] In a second aspect, an embodiment of the present application provides a knowledge graph-based power grid energy storage question-answering device, comprising:
[0032] A first processing module is configured to receive a question statement sent by a terminal device;
[0033] A second processing module is configured to obtain a response result corresponding to the question statement based on 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;
[0034] The third processing module is used to return the reply result to the terminal device.
[0035] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory, a processor;
[0036] The memory stores computer-executable instructions;
[0037] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.
[0038] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementation methods of the first aspect.
[0039] In a fifth aspect, an embodiment of the present application provides a knowledge graph-based power grid energy storage question-answering system, including:
[0040] Terminal devices and servers;
[0041] The terminal device is used to obtain a question statement input by the user and transmit the question statement to the server; the server is used to execute the first aspect and / or various possible implementation methods of the first aspect as described above.
[0042] The present application provides a knowledge graph-based power grid energy storage question-and-answer method and system. This method receives a question from a terminal device, uses a knowledge graph constructed based on first locally uploaded power grid energy storage corpus data and second power grid energy storage corpus data acquired online, and then retrieves the corresponding answer to the question. This answer is then returned to the terminal device. This method significantly improves the accuracy of the Q&A system's responses, helping users quickly and accurately obtain relevant information in the power grid energy storage field. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0044] Figure 1 A schematic diagram of a scenario for a knowledge graph-based question-answering method for power grid energy storage provided in this application;
[0045] Figure 2 Schematic diagram of the process of a knowledge graph-based grid energy storage question-answering method provided in this application Figure 1 ;
[0046] Figure 3 Schematic diagram of the process of a knowledge graph-based grid energy storage question-answering method provided in this application Figure 2 ;
[0047] Figure 4 Schematic diagram of the process of a knowledge graph-based grid energy storage question-answering method provided in this application Figure 3 ;
[0048] Figure 5 Schematic diagram of the process of a knowledge graph-based grid energy storage question-answering method provided in this application Figure 4 ;
[0049] Figure 6 A schematic diagram of the structure of a knowledge graph-based power grid energy storage question-answering device provided in this application;
[0050] Figure 7 This is a schematic diagram of the structure of an electronic device provided in this application.
[0051] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION
[0052] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0053] First, the application background of this application is explained as follows:
[0054] As the global energy transition accelerates, grid energy storage, as a critical infrastructure for renewable energy development, not only balances grid supply and demand but also provides backup power in emergencies, making it a crucial tool for maintaining safe and stable grid operation. Furthermore, energy storage technology plays a vital role in improving energy efficiency, enhancing grid stability, supporting emergency backup and disaster recovery, and promoting energy transformation. Energy storage technology can better utilize renewable energy, reduce reliance on fossil fuels, and ultimately lower greenhouse gas emissions. Consequently, grid energy storage has become a research hotspot and a key development direction in the global energy sector.
[0055] However, the field of grid energy storage involves specialized expertise across multiple fields, including electrochemical energy storage, physical energy storage, battery management, and grid dispatch. Furthermore, with the reform of the electricity market and the development of artificial intelligence technology, these specialized expertise barriers have further increased. Because relevant knowledge is scattered across diverse literature, standards, and experience, and its diverse forms are difficult to integrate, it can be difficult for non-professionals to quickly and accurately access information. Therefore, developing a knowledge graph-based grid energy storage question-and-answer method and system that can provide fast and accurate answers is crucial for promoting the development and application of 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 obtained through web crawlers or imported related files. As a result, the content of the knowledge graph lacks diversity and comprehensiveness, 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 issues, 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. This not only reduces users' 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. 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] Furthermore, existing knowledge graph-based grid energy storage question-and-answer systems rely on natural language processing (NLP) technology, long short-term memory (LSTM), or large non-Chinese language models to process data source corpora and question statements. This results in the system being unable to fully and accurately capture the semantics and intent of Chinese contexts. Furthermore, existing question-and-answer systems rely on template matching or simple semantic parsing, making them ineffective when handling complex and diverse user questions.
[0058] In summary, providing a technical solution that can significantly improve the accuracy of the answers of the power grid energy storage question-and-answer system, and thus promote the promotion and development of power grid energy storage technology, is a technical problem that needs to be solved urgently.
[0059] Figure 1 A scenario diagram of a knowledge graph-based 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 from 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 corpus data uploaded locally in the power grid field and the second power grid energy storage corpus data obtained from the network, and returns the answer result to the terminal device.
[0060] The terminal device can be a local personal computer (PC), a laptop, a tablet computer, or other electronic devices with functions such as a display screen and data transmission. 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. The physical devices involved in the above description are all exemplary in the figures and do not represent the only ones. This application does not specifically limit the specific form and type of the physical devices involved. It should be noted that the knowledge graph-based power grid energy storage question-and-answer method provided in this application can be used in the field of energy storage technology, and can also be used in fields other than energy storage technology. This application does not specifically limit its application field.
[0061] Combined with the above scenarios, it can be seen that the existing energy storage knowledge graph data sources in the power grid field are relatively single, and are only obtained through web crawlers or by importing relevant files, resulting in a lack of diversity and comprehensiveness in the content of the knowledge graph, which in turn leads to the question-answering system based on the knowledge graph. When answering user questions, the information may be incomplete, the answers may be inaccurate, or even wrong. The present application provides a power grid energy storage question-answering method and system based on a knowledge graph, which uses a knowledge graph 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 to obtain the answer result corresponding to the question statement sent from the terminal device, and return the answer result to the terminal device. The accuracy of the question-answering system's answers is improved, helping users to quickly and accurately obtain relevant information in the field of power grid energy storage.
[0062] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0063] Figure 2 Schematic diagram of the process of a knowledge graph-based grid energy storage question-answering method provided in this application Figure 1 ,like Figure 2 As shown in the figure, the knowledge graph-based grid energy storage question-answering method is applied to the server, including:
[0064] S201: Receive a question statement sent by a terminal device.
[0065] For the terminal device side, a question statement is sent to the server.
[0066] In this step, the terminal device provides a visual interface for receiving user input. Users can enter text via the keyboard or use voice recognition technology to convert voice commands into text. The terminal device then sends the user input via a network connection to the server, which parses and processes it. The visual interface provided by the terminal device, including elements such as a text input box, voice input button, and submit button, facilitates user interaction with the server, improving operational efficiency and user experience.
[0067] S202: Obtain a response result corresponding to the question statement based on 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.
[0068] In this step, the first grid energy storage corpus data, based on locally uploaded data from the power grid sector, refers to materials focused on grid energy storage technology, collected and organized by relevant organizations or enterprises within the power grid industry. This includes, but is not limited to, technical documents, research reports, operating manuals, fault records, maintenance logs, and other materials. These materials can be in the form of text, audio, video, graphs, and charts. The second grid energy storage corpus data, obtained online, refers to publicly available information and materials related to grid energy storage technology collected from the internet. These materials include, but are not limited to, academic papers, industry news, technical blogs, online forum discussions, public standards and specifications, and reports issued by government and industry organizations. These materials can also be in a variety of forms, including text, audio, video, and charts. The second grid energy storage corpus data is typically obtained from the public internet using web crawlers, application programming interfaces (APIs), or other data collection technologies. Unlike locally uploaded corpus data, online data may contain a broader perspective and the latest industry trends, but its accuracy and relevance require further screening and verification. By combining local and online data, the server can build a more comprehensive and dynamic knowledge graph, supporting more accurate and diverse question-and-answer functions.
[0069] Specifically, after receiving the question sent by the terminal device, the server identifies the knowledge nodes and relationship paths related to the question through a knowledge graph constructed based on the first grid energy storage corpus data uploaded locally in the power grid domain and the second grid energy storage corpus data obtained from the network. It then generates one or more possible responses, sorts them by relevance and accuracy, and obtains the corresponding response result. This method achieves more comprehensive and dynamic knowledge management and question-and-answer capabilities in the power grid energy storage domain, improving not only the accuracy and relevance of responses but also the adaptability and flexibility of the system, enabling it to cope with diverse and complex user needs.
[0070] S203: Return the response 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] The embodiment of the present application provides a knowledge graph-based question-and-answer method for power grid energy storage, which is applied to the server side. By receiving the question statement sent by the terminal device, it generates the corresponding answer result using the pre-built knowledge graph and returns the result to the terminal device. The knowledge graph is constructed by the server side by integrating the locally uploaded power grid energy storage corpus data and the public information obtained from the network. It not only covers the professional information within the power grid industry, but also includes the latest industry trends and a wide range of perspectives. Through the above method, the accuracy and relevance of the question-and-answer system are improved, the adaptability and flexibility of the system are enhanced, and it can effectively respond to the diverse and complex user needs, thereby improving the user experience and satisfaction.
[0073] Figure 3 Schematic diagram of the process of a knowledge graph-based grid energy storage question-answering method provided in this application Figure 2 , this embodiment Figure 2 Based on the embodiment, before obtaining the answer result corresponding to the question statement based on the question statement and the pre-built knowledge graph, the method includes:
[0074] S301: Acquire a data set to be processed, where the data set to be processed includes first power grid energy storage corpus data and second power grid energy storage corpus data.
[0075] In this step, if Figure 2 In this embodiment, the first power grid energy storage corpus data is obtained through local uploads from the power grid field, while the second power grid energy storage corpus data is obtained from the public network using web crawlers, API interfaces, or other data collection technologies. This dataset to be processed not only covers professional information within the power grid industry but also includes the latest industry trends and a wide range of perspectives, ensuring that the dataset is always up-to-date and relevant.
[0076] Specifically, in one implementation, during web crawler tasks, the terminal device is pre-configured with multiple crawler Uniform Resource Locators (URLs). These URLs are typically selected, high-quality data sources. Users are allowed to view, edit, add, or delete these URLs. Users can manually initiate crawler tasks or schedule scheduled tasks to perform web crawlers regularly. When uploading First Grid Energy Storage Corpus data locally, the terminal device supports a variety of common file formats, such as PDF, Word, Excel, CSV, and PNG, and automatically parses the uploaded files to extract text, images, tables, and other information.
[0077] In a specific embodiment, 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 a 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 needs of specific application scenarios. For example, in situations where a high degree of specialization and accuracy is required, the user can increase the proportion of the first power grid energy storage corpus data, because the data comes from within the power grid industry and has high authority and reliability. In situations where it is necessary to obtain the latest industry dynamics and a broad perspective, the user can increase the proportion of the second power grid energy storage corpus data, because the data comes from the public network and can reflect current technological trends and diverse viewpoints. By adjusting the 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-and-answer 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, this preset ratio can also be set to 8:2, 6:4, etc. Users can adjust the ratio of data sources at any time according to actual conditions to adapt to different application scenarios and needs. This application does not impose specific restrictions on this.
[0080] S302: Label the data set to be processed through the decoder of the qwen2.5 model to obtain entity labeling data, relationship labeling data and sentiment labeling data, wherein 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, a new generation of large-scale language models launched by the Alibaba Tongyi Qianwen team, is used. As a major upgrade in the series, it demonstrates significant improvements in natural language understanding, generation capabilities, and multimodal interaction. This model continues the core design based on the Transformer architecture, with a particular focus on deep optimization of the decoder to support more complex contextual reasoning and long sequence generation tasks. Its decoder utilizes a multi-layer stacked self-attention mechanism and feedforward neural network modules. By improving the dynamic allocation strategy of attention heads and optimizing sparse computation, the model significantly improves its efficiency and accuracy in processing long texts.
[0082] First, the data set to be processed undergoes preprocessing operations such as cleaning, removing noise, duplicates, and invalid information to ensure data quality. Next, the server uses the qwen2.5 model to annotate the data set to be processed. The entity recognition decoder uses a conditional random field (CRF) layer to perform sequence annotation, annotating energy storage-related entities in the data to obtain entity annotation data. The relationship extraction decoder uses a Bi-LSTM or Transformer layer to classify relationships and annotate the relationships between entities to obtain relationship annotation data. The sentiment analysis decoder uses a fully connected layer to classify the data and annotate the emotional tendency of the data to obtain sentiment annotation data.
[0083] For example, the server uses the Qwen2.5 model to annotate a piece of data in the processing data set: "By the end of 2023, the cumulative installed capacity of operational power storage projects reached 86.5 GW, accounting for 30% of the global market, a year-on-year increase of 45%. The cumulative installed capacity of pumped storage also fell below 60% for the first time, while the cumulative installed capacity of new energy storage exceeded 30 GW for the first time, with both power and energy scale increasing by more than 150% year-on-year." In the 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 type." In the relationship annotation, the relationship between "pumped storage" as a technology type and "falling below 60% for the first time" is annotated as "installed capacity share," and the relationship between "new energy storage" and "year-on-year growth exceeding 150%" is annotated as "growth rate association." The sentiment annotation result is positive.
[0084] By using multiple decoders of the qwen2.5 model, efficient and accurate annotation of the data set to be processed is achieved, which significantly improves the qwen2.5 model in natural language understanding, generation capabilities, and multimodal interaction, and better handles complex contextual reasoning and long sequence generation tasks.
[0085] S303: Build a knowledge graph based on entity annotation data, relationship annotation data, and sentiment annotation data.
[0086] In step 302, 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, and edges representing the relationships between the entity nodes are established using the relationship annotation data. For example, the "installed capacity ratio" relationship between "pumped storage" and "less than 60% for the first time" will be represented as an edge connecting the two nodes. In addition, during the construction process, in order to ensure the standardization and consistency of the data, the server performs entity disambiguation and reference resolution on the entity names involved to avoid the same entity being created repeatedly due to different naming methods. Finally, the constructed knowledge graph is stored on the server using neo4j technology. Through the above method, the construction of the energy storage knowledge graph in the power grid field is realized, which provides a solid foundation for the further research and application of intelligent question and answer of energy storage in the power grid field.
[0087] The present application provides a knowledge graph-based Q&A method for power grid energy storage. This method constructs a knowledge graph for energy storage in the power grid field. Data sets are acquired through local upload and web crawling, and the data sets are annotated using 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 annotated data. This method lays the foundation for the system to better support data-driven decision-making and intelligent applications, and to improve the overall effectiveness of the Q&A function and user satisfaction.
[0088] Figure 4 Schematic diagram of the process of a knowledge graph-based grid energy storage question-answering method provided in this application Figure 3 , this embodiment Figure 2 Based on the embodiment, before obtaining the answer result corresponding to the question statement based on the question statement and the pre-built knowledge graph, the method further includes:
[0089] S401: Segment the entity annotation data, the relationship annotation data, and the sentiment annotation data into multiple sub-word units; and map each sub-word unit and add a position code to obtain multiple encoded sub-word units.
[0090] In this step, the Transformer encoder of the qwen2.5 model is one of the core components of the model, focusing on representation learning and contextual understanding of the input data. Its primary function is feature extraction, mapping the input text data into a high-dimensional vector representation. The Transformer encoder achieves feature extraction through a multi-layer stacked self-attention mechanism and a feedforward neural network. Furthermore, by improving the dynamic allocation strategy of attention heads and optimizing sparse computation, the encoder improves the efficiency and accuracy of the qwen2.5 model in processing long texts. This makes the model more efficient when handling large-scale datasets and complex tasks, and generates more professional and accurate responses.
[0091] Specifically, taking the data set "New energy storage is an energy storage technology that primarily outputs electricity, in addition to pumped hydropower storage, and features a short construction cycle, simple and flexible site selection, and strong regulation capabilities" as an example, which has been completed with entity, relationship, and sentiment annotations, the Transformer encoder performs feature extraction on this data, segmenting it into multiple sub-word units (tokens), such as ["new", "energy storage", "is", "in addition to", "pumped", "storage", "outside", "with", "output", "electricity", "as", "main", "form", "of", "energy storage", "technology", "has", "construction", "cycle", "short", "site selection", "simple", "flexible", "regulation", "capability", "strong", "characteristics", "."]]. Each token is mapped into a high-dimensional vector (e.g., 768 dimensions) to capture the semantic features of each sub-word unit, enabling the model to use these features in subsequent computations for complex semantic analysis and reasoning. Furthermore, to enable the Qwen2.5 model to understand the sequential information of the input data, a positional encoding is added to the vector representation of each token, providing information about the token's position in the sequence, thereby better capturing contextual relationships and semantic structure. In this way, the model is able to process and generate natural language text more accurately.
[0092] S402: Calculate the correlation weight between each encoded sub-word unit and other encoded sub-word units.
[0093] In this step, the Transformer encoder uses an attention mechanism to dynamically focus on the importance of different parts of the input sequence, thereby better understanding contextual relationships. The attention mechanism determines which parts are most important to 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 treated as a "query" and interacts with all sub-word units (including itself) as "keys" and "values." In this way, the Transformer encoder is able to dynamically focus on different parts of the input sequence and further understand the contextual relationships of the data.
[0094] Specifically, the correlation weight between each encoded sub-word unit and other encoded sub-word units is calculated. Taking the sub-word unit "energy storage" as an example, "energy storage" is used as the query, and its corresponding vector is , all other subword units in the sequence are used as keys, for example, the key vector of “novel” is , then the attention score between the two is A similar calculation is performed on the key vectors of "energy storage" and all other sub-word units in the sequence, resulting in an attention score. To prevent excessively large scores, the attention scores are scaled by dividing them by the square root of the key vector dimension. The scaled attention scores are then normalized using a softmax function so that the sum of all scores is 1. Each score is then converted into a probability value between 0 and 1, known as an attention weight. These weights indicate the degree to which "energy storage" should pay attention to other sub-word units in the current context. For example, suppose that after calculation and normalization, the attention weight of "energy storage" is 0.3 with "new type," 0.6 with "energy storage," 0.7 with "electricity," and so on. This weight vector indicates that when understanding the current sentence, "energy storage" should pay more attention to sub-word units such as "energy storage" and "electricity." This method enables the model to dynamically adjust its attention to different sub-word units, thereby better understanding the semantic structure of the sentence.
[0095] S403: 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.
[0096] In this step, the initial Qwen2.5 model is trained based on multiple encoded subword units and the multiple relevance weights corresponding to each subword unit to optimize the model's parameters, enabling it to more accurately understand and generate natural language text. During this process, the model adjusts its internal parameters through a backpropagation algorithm to minimize the error between the predicted output and the true label.
[0097] Specifically, during training, model parameters (such as attention weights and linear transformation matrices) are updated using the backpropagation algorithm. This algorithm calculates gradients based on the error between the model's predicted output 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 until the model's performance reaches the desired level. In this way, the Qwen2.5 model gradually learns how to effectively process and generate natural language text during training. Ultimately, the fully trained Qwen2.5 model is able to excel in complex natural language processing tasks, generating more professional and accurate responses.
[0098] The embodiment of the present application provides a knowledge graph-based power grid energy storage question-answering method, which uses the Transformer encoder of the qwen2.5 model to achieve efficient text representation learning and context understanding. First, the entity, relationship and sentiment annotation data are divided into sub-word units, and a high-dimensional vector representation is obtained through mapping and position encoding to capture the semantic features and sequential information of the text. Subsequently, the correlation weights between sub-word units are calculated through the self-attention mechanism, so that the model dynamically focuses on important parts and enhances context understanding. During the training phase, the model optimizes parameters through back propagation and gradually improves its processing capabilities for 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 Schematic diagram of the process of a knowledge graph-based grid energy storage question-answering method provided in this application Figure 4 , this embodiment Figure 2 Based on the embodiment, according to the question statement and the pre-built knowledge graph, the answer 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 after sufficient training as mentioned above. 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 the differences between them? The server receives the original question statement, and first extracts information from the question statement through the qwen2.5 model to obtain multiple keywords: "power industry", "leasing", "sharing", "self-built", "energy storage", "differences", etc. By breaking down the question statement into multiple keywords, the system can more efficiently retrieve information in the knowledge base and quickly find content related to the user's question, especially in complex or long sentences, and can grasp the core concepts and themes. Keyword extraction is an important step to improve the performance of the question-answering system and user experience, ensuring that the model can quickly and accurately process and respond to user questions.
[0102] S502: Use the qwen2.5 model to perform intent recognition based on the question statement to obtain the user's question intention.
[0103] In this step, the Qwen2.5 model is used to identify the user's intent in the question. This process is a key step in natural language understanding, aiming to extract the user's true question from the text they entered. Intent identification involves in-depth analysis of sentence structure, semantic relationships, and context.
[0104] Specifically, based on the multiple keywords extracted above, the qwen2.5 model further analyzes the user's semantic needs. For the question "What is leased, shared, and self-built energy storage in the power industry, and what are the differences?", it identifies that the user's intent is to inquire about the concepts and differences of different energy storage models in the power industry. In this way, the model can convert the user's natural language input into a structured representation of intent. The accuracy of intent recognition directly affects the direction of subsequent information retrieval and answer generation. Accurate intent recognition ensures that the system can provide targeted responses that meet user needs, thereby improving user experience and overall system efficiency.
[0105] In a specific implementation, qwen2.5 is also used to decompose the original question statement, converting the question statement into more specific sub-questions to facilitate subsequent queries. For example, the model decomposes the question statement "What is leased, shared, and self-built energy storage in the power industry, and what are the differences between them?" 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?", and "What are the main differences between leased, shared, and self-built energy storage?".
[0106] By breaking down complex questions into multiple sub-questions, the system can more meticulously understand the user's query intent and conduct more targeted searches within the knowledge base. Each sub-question focuses on a specific aspect, such as definition, applicable scenarios, implementation methods, advantages and disadvantages, enabling the system to provide more detailed and comprehensive answers. This not only improves information retrieval efficiency but also enhances the system's semantic understanding capabilities, ensuring that the generated responses better meet the user's actual needs.
[0107] S503: Based on the question intention and keywords, the Elastic Search method is used to search the knowledge graph to obtain the answer results.
[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, achieving efficient data access and query performance.
[0109] Based on the query intent and keywords, Elastic Search uses its full-text and structured search capabilities to traverse and compare data in the knowledge graph, quickly identifying the specific content and scope of the user's search and finding nodes and edges in the knowledge graph that match the query. Because Elastic Search supports distributed search, it can execute search operations in parallel across multiple nodes, accelerating search speed and improving efficiency. Elastic Search also utilizes indexes and inverted indexes to accelerate retrieval. Indexes record the location of data within storage media, enabling rapid data location and access. Inverted indexes map each word in a document to documents containing that word, allowing Elastic Search to quickly locate documents containing specific terms and generate accurate responses. For example, using Elastic Search methods, a search on the knowledge graph can retrieve detailed information about rental, shared, and self-built energy storage, generating a response. An example response: Rental energy storage is suitable for users with short-term needs or limited budgets. Shared energy storage is suitable for collaborative, multi-party users emphasizing resource sharing. Self-built energy storage is suitable for long-term use and users with sufficient funds.
[0110] Through the above search mechanism, the system can maintain high performance when processing massive amounts of data, meet users' needs for fast and accurate information retrieval, and enable the question-answering system to still provide a high-quality user experience in complex query scenarios, ensuring that users can obtain the required information in a timely manner and return answers that are highly relevant to the user's questions.
[0111] S504: The reply result is polished by a large language model to obtain a reply result that conforms to the user's language habits.
[0112] In this step, the qwen2.5 model receives the scattered response results returned by Elastic Search and further integrates and polishes them. During the integration process, the model identifies the logical relationship between each piece of information to ensure the coherence and consistency of the content. By analyzing the subject and context of the information, the order in which the information is presented is determined, making the response results clearer and easier to understand. In addition, the model also polishes the language, adjusts the wording and grammatical structure of the sentences, and personalizes the response style according to the user's language habits and preferences, including using terminology, tone, and expressions that are 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 response results are semantically fluent and structurally reasonable, thereby improving user satisfaction and the overall performance of the system.
[0113] Ultimately, the server returns a response that conforms to the user's language habits to the terminal device, meeting their query needs and enhancing the interactive experience.
[0114] An example of a response result that conforms to the user's language habits:
[0115] In the power industry, leasing, sharing, and self-built energy storage are three common energy storage models, each with its own characteristics and applicable scenarios:
[0116] 1. Leasing energy storage:
[0117] Definition: Users pay rent to use energy storage equipment or services provided by a third party.
[0118] Advantages: No initial investment required, flexible capacity adjustment, and 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 share an energy storage system, reducing investment costs through resource integration.
[0123] Advantages: cost sharing, improved resource utilization, and flexible expansion.
[0124] Disadvantages: high difficulty in coordination and complex benefit distribution.
[0125] Applicable scenarios: Multiple users who need to cooperate.
[0126] 3. Self-built energy storage:
[0127] Definition: Users invest in and build energy storage facilities on their own and have full control over energy storage resources.
[0128] Advantages: Complete control, lower long-term costs, customizable design.
[0129] Disadvantages: High initial investment and self-responsibility for operation and maintenance.
[0130] Applicable scenarios: users who use the product for a long time and have sufficient funds.
[0131] In summary, leasing energy storage is suitable for short-term needs, shared energy storage emphasizes resource integration, and self-built energy storage provides complete control. The choice of which model depends on the user's actual needs and budget.
[0132] The embodiment of the present application provides a knowledge graph-based question-and-answer method for power grid energy storage, which aims to optimize the user's query experience through natural language processing technology and search engines. First, the qwen2.5 model extracts information from the question statement input by the user and identifies multiple keywords for efficient retrieval in the knowledge base. Next, the model performs intent recognition, clarifies the user's query requirements, and breaks down complex questions into multiple sub-questions, enhancing the system's semantic understanding capabilities 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 answer results. Finally, the qwen2.5 model polishes the retrieved answer 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 answer 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 sentence input by the user, it makes predictions based on part of the question sentence or keywords input by the user, and provides the user with possible question options according to a certain priority.
[0134] Specifically, the system will retrieve the user's historical question records to quickly display previously asked questions that may be relevant. In addition, the qwen2.5 model will identify some of the keywords that the user has entered, and based on these keywords, it will predict and complete the question, selecting the five most relevant questions for the user to choose and refer to. This feature is designed to improve the efficiency and accuracy of user input and help users find the information they need more quickly. The model identifies entities in the question as follows:
[0135] The core component of the qwen2.5 model is the embedding layer, which converts question sentences into fixed-length vectors, allowing the model to process a variety of input texts. Mathematically, this can be expressed as:
[0136]
[0137] in, Represents the input text, Represents a fixed-length vector that represents the question in the embedding space.
[0138] The question sentence is first represented using a predefined word vector (such as Word2Vec) and then enters the embedding layer. The embedding layer extracts features from the question sentence using multiple activation functions. Next, through a series of layers, such as gated recurrent units (GRUs) and LSTMs, the model learns more complex feature representations, enabling the extraction of various information from the question sentence, including entity recognition.
[0139] Mathematically, this can be expressed as a series of nonlinear transformations:
[0140]
[0141] in, Indicates that at time step The hidden state of Indicates that at time step The input vector (i.e. the word vector after embedding), Represents a nonlinear transformation function, i.e., a unit function such as LSTM and GRU.
[0142] In another possible implementation, during the model training process, the model parameters of the qwen2.5 model are adjusted in response to a parameter adjustment request received from the training terminal; wherein the model parameters include learning rate, batch size, number of training rounds, and weight decay.
[0143] Parameters such as the loss function, learning rate, batch size, number of training rounds, weight decay, and dropout probability are adjusted using methods such as the learning rate scheduler and Bayesian optimization. The learning rate scheduler can dynamically adjust the learning rate, for example, gradually reducing the learning rate during training or when the validation error stops decreasing. Bayesian optimization uses probabilistic models to predict which parameter combinations are most likely to produce better results, gradually optimizing the parameters.
[0144] In addition, the model parameters also include the size of the qwen2.5 model, including 0.5B, 1.5B, 7B, and 72B. The 0.5B parameter model is typically used in resource-constrained environments and can provide basic natural language processing capabilities with lower computing and storage requirements. The 1.5B parameter model performs better when handling complex tasks and is suitable for applications that require higher accuracy and more complex understanding. The 7B parameter model further improves language understanding and generation capabilities, can handle more complex contexts and provide more fluent language generation, and is suitable for scenarios that require high-quality output. The 72B parameter model represents top-level performance, can provide excellent understanding and generation capabilities in extremely complex tasks, and is suitable for applications that require the highest accuracy and the most complex analysis. Models of different sizes have their own trade-offs in computing resources, response speed, and result quality. Choosing the appropriate model size depends on the specific application requirements and available resources.
[0145] Figure 6 A schematic diagram of the structure of a knowledge graph-based grid energy storage question-answering device provided in this application, such as Figure 6 As shown, the knowledge graph-based power grid energy storage question-answering device 60 provided in this embodiment includes:
[0146] The first processing module 601 is configured to receive a question statement sent by a terminal device;
[0147] A second processing module 602 is configured to obtain a corresponding answer result to the question statement based on 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;
[0148] The third processing module 603 is used to return the reply result to the terminal device.
[0149] In a possible implementation, the second processing module 602 is specifically configured to:
[0150] Extract information from the question statement based on the qwen2.5 model and obtain multiple keywords;
[0151] Based on multiple keywords, the Elastic Search method is used to search the knowledge graph to obtain the answer results.
[0152] In a possible implementation, the second processing module 602 is further configured to:
[0153] According to the question statement, the qwen2.5 model is used to identify the user's intention to ask the question;
[0154] Based on the question intent and keywords, the Elastic Search method is used to search the knowledge graph to obtain the answer results.
[0155] In a possible implementation, the knowledge graph-based power grid energy storage question-answering device 60 further includes a fourth processing module 604 configured to:
[0156] Acquire a data set to be processed, where the data set to be processed includes first power grid energy storage corpus data and second power grid energy storage corpus data;
[0157] The decoder of the qwen2.5 model is used to annotate the data set to be processed, and entity annotation data, relationship annotation data, and sentiment annotation data are obtained. The decoder includes an entity recognition decoder, a relationship extraction decoder, and a sentiment analysis decoder.
[0158] Build a knowledge graph based on entity annotation data, relationship annotation data, and sentiment annotation data.
[0159] In a possible implementation, the knowledge graph-based power grid energy storage question-answering device 60 further includes a fifth processing module 605 for:
[0160] Split entity annotation data, relationship annotation data, and sentiment annotation data into multiple subword units;
[0161] Map each subword unit and add position encoding to obtain multiple encoded subword units;
[0162] Calculate the correlation weight between each encoded subword unit and other encoded subword units;
[0163] 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.
[0164] In a possible implementation, the fourth processing module 604 is specifically configured 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 to-be-processed data set is a preset ratio.
[0165] In another possible implementation, the knowledge graph-based power grid energy storage question-answering device 60 further includes a sixth processing module 606 for:
[0166] 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;
[0167] Among them, model parameters include learning rate, batch size, number of training rounds, and weight decay.
[0168] This embodiment provides a knowledge graph-based power grid energy storage question-and-answer device that can execute the method provided in the above method embodiment. Its implementation principle and technical effects are similar, and this embodiment will not be repeated here.
[0169] Figure 7 This is a schematic diagram of the structure of an electronic device provided in this application. Figure 7 As 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. The processor 701, the memory 702 and the communication component 703 are connected via a bus 704.
[0170] During the specific implementation process, at least one processor 701 executes the computer-executable instructions stored in the memory 702, so that the at least one processor 701 performs the above method.
[0171] The specific implementation process of the processor 701 can be found in the above method embodiment. Its implementation principle and technical effects are similar and will not be repeated here in this embodiment.
[0172] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the present invention may be directly implemented by a hardware processor or implemented by a combination of hardware and software modules in the processor.
[0173] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage.
[0174] A bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Buses can be categorized as address buses, data buses, and control buses. For ease of illustration, the buses in the figures of this application are not limited to just one bus or just one type of bus.
[0175] This application also provides a knowledge graph-based power grid energy storage question-answering system, including:
[0176] Terminal devices and servers;
[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 by the above method embodiment, and its implementation principle and technical effects are similar, which will not be repeated here in this embodiment.
[0178] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.
[0179] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile memory 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 storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium that can be accessed 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. Alternatively, the readable storage medium may be an integral part of the processor. The processor and the readable storage medium may reside in an application-specific integrated circuit (ASIC). Alternatively, the processor and the readable storage medium may reside in a device as discrete components.
[0181] The division of units is merely a logical functional division; actual implementations may employ alternative divisions, such as combining or integrating multiple units or components into another system, or omitting or disabling certain features. Furthermore, any direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or units, either through an interface, electrical, mechanical, or other means.
[0182] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0183] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0184] If a function is implemented as 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, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes instructions for causing a computer device (such as a personal computer, server, or network device) to perform all or part of the steps of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, mobile hard drives, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical disks.
[0185] Those skilled in the art will appreciate that all or part of the steps in the above-described method embodiments can be implemented using hardware associated with program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0186] Finally, it should be noted that those skilled in the art will readily identify 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 that follow the general principles of the present invention and include common knowledge or customary techniques in the art not disclosed herein. The present invention is not limited to the precise structure described above and illustrated in the accompanying drawings, and various modifications and variations may be made without departing from the scope thereof. The scope of the present invention is limited solely 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; Extract information from the question statement according to the qwen2.5 model to obtain multiple keywords; 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 a response result; Returning the response result to the terminal device; The knowledge graph is annotated by a decoder based on the qwen2.5 model to obtain entity annotation data, relationship annotation data and sentiment annotation data, and a graph is constructed based on the entity annotation data, the relationship annotation data and the sentiment annotation data; the decoder includes an entity recognition decoder, a relationship extraction decoder and a sentiment analysis decoder, and the data set to be processed includes: 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 qwen2.5 model is obtained by dividing the entity annotation data, the relationship annotation data and the sentiment annotation data into multiple sub-word units, mapping each sub-word unit and adding position encoding to obtain multiple encoded sub-word units, then calculating the correlation weight between each encoded sub-word unit and other encoded sub-word units, and then training the initial qwen2.5 model based on the multiple encoded sub-word units and the multiple correlation weights corresponding to each sub-word unit.
2. The method according to claim 1, characterized in that Before returning the reply result to the terminal device, the method further includes: The response result is polished by a large language model to obtain a response result that conforms to the user's language habits.
3. The method according to claim 1 or 2, 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.
4. The method according to claim 1 or 2, 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.
5. A knowledge graph-based power grid energy storage question-answering device, characterized in that: include: A first processing module is configured to receive a question statement sent by a terminal device; A second processing module is configured to extract information from the question statement using the qwen2.5 model to obtain multiple keywords, identify intent based on the question statement using the qwen2.5 model to obtain the user's question intent, and search the knowledge graph using the Elastic Search method based on the question intent and the keywords to obtain a response result; A third processing module, configured to return the reply result to the terminal device; The knowledge graph is annotated by a decoder based on the qwen2.5 model to obtain entity annotation data, relationship annotation data and sentiment annotation data, and a graph is constructed based on the entity annotation data, the relationship annotation data and the sentiment annotation data; the decoder includes an entity recognition decoder, a relationship extraction decoder and a sentiment analysis decoder, and the data set to be processed includes: 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 qwen2.5 model is obtained by dividing the entity annotation data, the relationship annotation data and the sentiment annotation data into multiple sub-word units, mapping each sub-word unit and adding position encoding to obtain multiple encoded sub-word units, then calculating the correlation weight between each encoded sub-word unit and other encoded sub-word units, and then training the initial qwen2.5 model based on the multiple encoded sub-word units and the multiple correlation weights corresponding to each sub-word unit.
6. 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 4.
7. 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 4 when executed by a processor.
8. A knowledge graph-based power grid energy storage question-answering system, characterized in that: include: Terminal devices and servers; The terminal device is used to obtain a question statement input by the 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 4.
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