Electricity-carbon knowledge question-answering method in power industry and related equipment
By constructing an electricity carbon knowledge database and a question-and-answer model, and combining user identity information to generate professional answers, the problem of fragmented and inefficient electricity carbon knowledge in the power industry has been solved, achieving efficient and accurate electricity carbon knowledge query and management.
Patent Information
- Application Number
- CN202511531334.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-24
- Publication Date
- 2026-03-17
AI Technical Summary
The fragmentation and low efficiency of knowledge acquisition in the power industry's carbon sector make it difficult for existing technologies to meet enterprises' demands for real-time performance and efficiency. Furthermore, general-purpose large language models lack professional knowledge in the power industry and the dual-carbon field.
We construct an electric carbon knowledge database and a question-and-answer model. By receiving question text input by users, we retrieve related data from the database, combine it with user identity information to generate target answer text, and use a large language model for professional question and answer.
It improves the accuracy and efficiency of carbon-related knowledge retrieval, provides professional and coherent answers, reduces consulting costs, and enhances enterprises' knowledge management level and green transformation capabilities.
Smart Images

Figure CN121684002A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method and related equipment for answering questions about carbon emissions in the power industry. Background Technology
[0002] In addressing the challenges of global climate change, the power industry, as a significant contributor to carbon emissions, faces immense pressure to transform and reduce its carbon footprint. As the policy mechanisms for integrating electricity and carbon emissions continue to improve, power companies and related practitioners urgently need to accurately understand and apply the policies, regulations, technical knowledge, and market mechanisms in the field of electricity and carbon emissions. However, knowledge about electricity and carbon emissions spans multiple disciplines, including power system engineering, energy economics, and environmental science. The information sources are complex and frequently updated, leading to highly fragmented knowledge, making it difficult for non-professionals to grasp the core points in a timely manner.
[0003] Existing methods for acquiring knowledge about carbon dioxide also have significant shortcomings. Traditional keyword searches are insufficient for complex problems, often yielding only fragmented information lacking systematicity and contextual relevance, requiring substantial time to integrate the retrieved knowledge. Furthermore, while relying on expert interpretation and consultation is accurate, it is inefficient and cannot be scaled up to meet enterprises' demands for real-time and high-efficiency solutions. Summary of the Invention
[0004] In view of this, the purpose of this application is to propose a method and related equipment for answering questions about carbon-related electrical energy in the power industry, so as to overcome all or part of the deficiencies in the prior art.
[0005] To achieve the above objectives, this application provides a method for answering questions about carbon emissions in the power industry, comprising: responding to receiving a question text input by a user; searching a pre-built carbon emissions knowledge database based on the question text to obtain multiple related data; obtaining the user's identity information; and generating a target answer text based on the question text, the multiple related data, and the identity information through a pre-built carbon emissions question-answering model.
[0006] Optionally, the step of generating the target answer text based on the question text, the multiple associated data, and the identity information through a pre-built carbon-based question-and-answer model includes: generating feature information corresponding to the identity information based on the identity information; and extracting information and generating natural language from the multiple associated data based on the question text and the feature information to obtain the target answer text.
[0007] Optionally, the method for constructing the electric carbon knowledge database includes: acquiring multiple electric carbon information items, wherein the multiple electric carbon information items include multiple electric carbon domain documents and multiple electric carbon domain web page information; for each electric carbon information item, according to the data order in the electric carbon information item, using a preset data length and a preset data overlap, sequentially dividing the electric carbon information item into data segments to obtain a sequence including multiple initial data blocks; performing multiple rounds of association operations on the multiple initial data blocks to obtain multiple target data blocks; vectorizing the multiple target data blocks to obtain multiple target vectors, and storing the multiple target vectors in a pre-constructed initial electric carbon knowledge database; in response to determining that the multiple target data blocks corresponding to each electric carbon information item are stored in the initial electric carbon knowledge database, defining the initial electric carbon knowledge database as the electric carbon knowledge database.
[0008] Optionally, the step of performing multiple rounds of association operations on the plurality of initial data blocks to obtain a plurality of target data blocks includes: each round of association operation is performed as follows: in response to determining that the first initial data block in the sequence has an adjacent next initial data block, calculating the association degree between the first initial data block and the next initial data block; in response to determining that the association degree is greater than a predetermined association degree, merging the first initial data block and the next initial data block to obtain a merged data block, and using the merged data block as the first initial data block in the next round of association operation, and performing the next round of association operation; in response to determining that the association degree is less than or equal to the predetermined association degree, determining the first initial data block as a target data block, and using the next initial data block as the first initial data block in the next round of association operation, and performing the next round of association operation; in response to determining that the first initial data block does not have an adjacent next initial data block, exiting at least one round of association operation.
[0009] Optionally, before dividing the carbon information into multiple initial data blocks with a division order according to the data order in the carbon information, using a preset data length and a preset data overlap, the method includes: in response to determining that the carbon information is an unstructured document, converting the carbon information into a string.
[0010] Optionally, the step of retrieving multiple related data from a pre-built carbon knowledge database based on the question text includes: vectorizing the question text to obtain a question vector corresponding to the question text; performing similarity matching in the carbon knowledge database based on the question vector to obtain multiple matching target vectors; and performing vector restoration on the multiple matching target vectors to obtain the multiple related data.
[0011] Optionally, the step of performing similarity matching in the carbon dioxide knowledge database based on the question vector to obtain multiple matching target vectors includes: parsing the question vector for key information to obtain a key vector; calculating the similarity between the key vector and the target vector for each target vector in the carbon dioxide knowledge database; sorting all similarities in descending order to obtain a similarity sequence containing all similarities; and determining the target vectors corresponding to the first N similarities in the similarity sequence as the multiple matching target vectors.
[0012] Based on the same inventive concept, this application also provides an electric carbon knowledge question-and-answer device for the power industry, comprising: a retrieval module configured to, in response to receiving a question text input by a user, perform a retrieval in a pre-built electric carbon knowledge database based on the question text to obtain multiple related data; an acquisition module configured to acquire the user's identity information; and a generation module configured to, based on the question text, the multiple related data, and the identity information, generate a target answer text through a pre-built electric carbon question-and-answer model.
[0013] Based on the same inventive concept, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements the method described above when executing the computer program.
[0014] Based on the same inventive concept, this application also provides a non-transitory computer-readable storage medium that stores computer instructions for causing a computer to perform the method described above.
[0015] As can be seen from the above, the power industry carbon knowledge question-answering method and related equipment provided in this application include the following steps: In response to receiving a question text input by a user, the method retrieves multiple related data from a pre-built carbon knowledge database based on the question text. This not only ensures the accuracy of the obtained related data but also improves the efficiency of retrieving multiple related data. The method also involves obtaining the user's identity information. Based on the question text, the multiple related data, and the identity information, a target answer text is generated through a pre-built carbon question-answering model. This improves both the reliability and relevance of the specific carbon-related question-answering task and enhances the user's query efficiency. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in this application or related technologies, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a flowchart illustrating the electricity carbon knowledge question-and-answer method in the power industry according to an embodiment of this application; Figure 2 This is a schematic diagram illustrating the specific process of the electricity carbon knowledge question-and-answer method in the power industry according to an embodiment of this application. Figure 3 This is a flowchart illustrating the carbon-based question-and-answer system according to an embodiment of this application. Figure 4 This is a schematic diagram illustrating the construction of the carbon electrochemical knowledge database according to an embodiment of this application; Figure 5 This is a schematic diagram of the structure of the electric carbon knowledge Q&A device for the power industry according to an embodiment of this application; Figure 6 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with specific embodiments and the accompanying drawings.
[0019] It should be noted that, unless otherwise defined, the technical or scientific terms used in the embodiments of this application should have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms "first," "second," and similar terms used in the embodiments of this application do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are only used to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0020] As described in the background section, in addressing the challenges of global climate change, the power industry, as a significant contributor to carbon emissions, faces immense pressure for transformation and carbon reduction. Against the backdrop of rapid development of renewable energy and continuous advancements in smart grid technology, electricity-carbon linkage can not only promote the optimization of the energy structure but also drive the green transformation of the economy. With the continuous improvement of electricity-carbon linkage policies and mechanisms, power companies and related practitioners urgently need to accurately understand and apply policies, regulations, technical knowledge, and market mechanisms in the field of electricity-carbon. Electricity-carbon knowledge itself spans multiple disciplines such as power system engineering, energy economics, and environmental science. The information sources are complex and frequently updated, leading to highly fragmented knowledge, making it difficult for non-professionals to grasp the core points in a timely manner.
[0021] Existing methods for acquiring carbon knowledge in the power industry have significant shortcomings. Traditional keyword searches are insufficient for complex issues, often yielding only fragmented information lacking systematicity and contextual understanding, requiring substantial time to integrate the retrieved knowledge. Furthermore, while relying on expert interpretation and consultation is accurate, it is inefficient and cannot be scaled up to meet enterprises' demands for real-time and high-efficiency solutions. As the "dual carbon" process progresses, these pain points are gradually becoming significant factors hindering the improvement of carbon management levels in the power industry and enterprises.
[0022] Furthermore, with the emergence of large language models, dialogue systems based on large language models have been widely used in general domains. However, question-answering systems for general domains are usually mainly trained on extensive Internet corpora, lacking specialized knowledge in the power industry and carbon-related fields, and are unable to provide rigorous and professional answers to questions related to the power and carbon sectors.
[0023] In view of this, embodiments of this application propose a method for answering questions about carbon dioxide in the power industry, with reference to... Figure 1 This includes the following steps: Step 101: In response to receiving the question text input by the user, a search is performed in the pre-built carbon knowledge database based on the question text to obtain multiple related data.
[0024] In this step, the power industry is a significant area of carbon emissions, and the knowledge linking power systems and carbon emissions within the power industry is increasingly abundant. In existing technologies, if users want to query knowledge about the relationship between power systems and carbon emissions, they need to rely on keyword searches or expert answers, resulting in low efficiency. This application proposes a question-and-answer method for power industry carbon knowledge. After users input a question, they can obtain a precise answer through a pre-built power carbon knowledge database and a power carbon question-and-answer model. First, the system receives the user's input question text, which is a question related to knowledge about power systems and carbon emissions. For example, the question text could be, "What specific measures has the power industry implemented to achieve its goals? What results have these measures achieved?" or, "How do the power industry's carbon emission reduction policies coordinate with energy policies and environmental policies? What experiences or challenges exist in terms of institutional coordination?" After receiving the user's input question text, the system searches the pre-built power carbon knowledge database based on the question text, obtaining multiple related data, including answers to the question text. It should be noted that in this application, "power carbon" is an abbreviation for power systems and carbon emissions. The Electric Carbon Knowledge Database contains comprehensive knowledge related to power systems and carbon emissions. By using the Electric Carbon Knowledge Database for retrieval, multiple related data with strong relevance to the question text can be obtained. This not only ensures the accuracy of the obtained related data but also improves the efficiency of retrieving multiple related data.
[0025] Step 102: Obtain the user's identity information.
[0026] In this step, the user's identity information is obtained. Different users may have different focuses when querying electricity carbon knowledge or have different requirements for the output answers. For example, the focus of electricity carbon knowledge queries will be different for a businessperson in the power industry and a policy research expert. Therefore, in order to generate targeted and practical answer texts, the user's identity information is obtained. For example, before entering the question text, the user needs to enter account information into the electricity carbon Q&A system. Based on the received account information, the identity information corresponding to the account information is obtained. The identity information is the personal information that the user entered when registering an account in the electricity carbon Q&A system, such as occupation, job level, education level, and favorite books.
[0027] Step 103: Based on the question text, the multiple associated data and the identity information, generate the target answer text through a pre-built carbon-based question-and-answer model.
[0028] In this step, a pre-built carbon-based question-answering model is used to generate the target answer text using the question text, multiple related data, and identity information. The carbon-based question-answering model understands the question text, combines it with the user's identity information to understand the user's answer preferences, and finally integrates multiple related data based on the understood question text and user answer preferences. This avoids the separation between the question text and related data, resulting in a more complete, logical, and targeted target answer text. The carbon-based question-answering model can not only answer explicit questions but also integrate related data across multiple documents or fragments based on identity information. It effectively integrates related data from multiple sources to generate coherent answers, avoiding information fragmentation, improving the relevance between information, and ensuring the accuracy and relevance of the answer. This application pre-constructs an electric carbon knowledge database and an electric carbon question-answering model. A large language model is applied to the electric carbon question-answering system to obtain the electric carbon question-answering model. To ensure the accuracy of the answer text output by the electric carbon question-answering model, it not only relies on its own parameters to output the answer text but also integrates external knowledge from the electric carbon knowledge database and user identity information to improve the relevance and factual accuracy of the generated answer text. The combined use of the electric carbon knowledge database and the electric carbon question-answering model enables the electric carbon question-answering system based on the large language model to more accurately generate electric carbon-specific answer text. After the user inputs the question text, the system utilizes the factual basis of electric carbon-specific knowledge in the electric carbon knowledge database for retrieval enhancement. Furthermore, it leverages the expressive power of the electric carbon question-answering model and integrates user identity information for information integration, thereby improving the reliability and relevance of the electric carbon-specific question-answering task and enhancing the user's query efficiency.
[0029] like Figure 2 As shown, Figure 2This is a schematic diagram illustrating the specific process of the electricity carbon knowledge question-and-answer method in an embodiment of this application. This application preprocesses information related to the electricity carbon field, constructs an electricity carbon knowledge database, receives the user's question text, and retrieves information from the electricity carbon knowledge database using an electricity carbon question-and-answer model retrieval generation technology. Multiple related data are obtained, and combined with the question text, user identity information, and prompts composed of multiple related data, the electricity carbon question-and-answer model generates a target answer text expressed in natural language. This allows for more professional and effective answers to electricity carbon-related questions based on a large language model, solving the problem that general-purpose large language models cannot rigorously and professionally answer questions related to electricity carbon. The electricity carbon question-and-answer system built in this application, based on a large language model retrieval enhancement generation, is a powerful means to promote intelligent knowledge management in the power industry and contribute to the achievement of "dual carbon" goals. On the one hand, it can help enterprises and practitioners quickly understand and apply electricity carbon-related policies and regulations, reducing compliance risks; on the other hand, it can serve as a knowledge empowerment and training tool to improve the professional level of personnel. Meanwhile, the electricity carbon Q&A system can also provide enterprises with auxiliary decision support in actual operation, significantly reduce consulting costs, and improve the efficiency and inclusiveness of information acquisition, thereby providing strong support for promoting the green and low-carbon transformation of the power industry and achieving the "dual carbon" goal.
[0030] The above scheme, in response to receiving user-inputted question text, retrieves multiple related data from a pre-built carbon dioxide knowledge database based on the question text. This not only ensures the accuracy of the obtained related data but also improves the efficiency of retrieving multiple related data. The user's identity information is then obtained. Based on the question text, the multiple related data, and the identity information, a target answer text is generated using a pre-built carbon dioxide question-answering model. This improves both the reliability and relevance of the carbon dioxide-specific question-answering task and enhances the user's query efficiency.
[0031] In some embodiments, generating the target answer text based on the question text, the plurality of associated data, and the identity information using a pre-built carbon-based question-and-answer model includes: generating feature information corresponding to the identity information based on the identity information; and performing information extraction and natural language generation on the plurality of associated data based on the question text and the feature information to obtain the target answer text. In this embodiment, the user's identity information is analyzed and refined using an electrocarbon question-and-answer model to generate corresponding feature information. This feature information reflects the user's preferences, including their knowledge background, focus, knowledge preferences, and question motivation. Based on the user's input question text, the question is clarified; based on the user's feature information, the user's query focus and answer requirements are defined. Information extraction is performed on multiple related data sets based on the question text and feature information to accurately extract key information. However, the extracted key information may not fully and logically express the answer. Therefore, natural language processing is applied to the extracted key information based on the feature information to convert it into targeted, high-quality natural language text, resulting in the target answer text. This makes the target answer text more targeted, complete, and logical, and also adds depth, thus improving the quality of the target answer text.
[0032] In some embodiments, the method for constructing the electric carbon knowledge database includes: acquiring multiple electric carbon information items, wherein the multiple electric carbon information items include multiple electric carbon domain documents and multiple electric carbon domain web page information; for each electric carbon information item, according to the data order in the electric carbon information item, using a preset data length and a preset data overlap, sequentially dividing the electric carbon information item into data segments to obtain a sequence including multiple initial data blocks; performing multiple rounds of association operations on the multiple initial data blocks to obtain multiple target data blocks; vectorizing the multiple target data blocks to obtain multiple target vectors, and storing the multiple target vectors in a pre-constructed initial electric carbon knowledge database; in response to determining that the multiple target data blocks corresponding to each electric carbon information item are stored in the initial electric carbon knowledge database, determining the initial electric carbon knowledge database as the electric carbon knowledge database. In this embodiment, to construct an electricity carbon knowledge database, the first step is to collect knowledge about the relationship between power systems and carbon emissions; therefore, multiple electricity carbon information items are acquired. To ensure the comprehensiveness of these multiple electricity carbon information items, they include not only multiple documents in the electricity carbon field but also multiple web pages in the electricity carbon field. The documents in the multiple electricity carbon field include policy documents, emission reports, technical standards, etc. The content in the electricity carbon information is usually relatively large and has a data order. To facilitate searching within the electricity carbon information, the data needs to be divided according to the data order, using a preset data length and a preset data overlap, resulting in a sequence including multiple initial data blocks. The preset data length and preset data overlap are determined based on historical experience. To ensure the continuity between each initial data block, the preset data overlap ensures that there is identical data between adjacent initial data blocks. By adjusting the length and overlap of the initial data blocks, the semantics of the initial data blocks are preserved.
[0033] Because dividing carbon information according to preset data length and preset data overlap may result in a coherent semantic passage being divided into several initial data blocks, affecting semantic coherence, multiple rounds of association operations are performed on multiple initial data blocks to obtain multiple target data blocks. Related initial data blocks are then associated, improving the accuracy of data block division. Multiple target data blocks are vectorized to obtain multiple target vectors; for example, the word2vec method is used for vectorization. Since vectorization allows for parallel data processing, multiple target data blocks are vectorized to accelerate the matching speed between the question text and multiple target data blocks. These target vectors are stored in a pre-built initial carbon knowledge database. When multiple target data blocks corresponding to each piece of carbon information are stored in the initial carbon knowledge database, the initial carbon knowledge database is used as the overall carbon knowledge database. It should be noted that, to facilitate differentiation of each piece of carbon information, multiple target data blocks corresponding to each piece of carbon information are stored in the carbon knowledge database according to a preset index. The construction of the electricity carbon knowledge database was completed through adaptive data block partitioning and pre-building an initial electricity carbon knowledge database. This database centrally stores knowledge about power systems and carbon emissions, avoiding data fragmentation and laying the foundation for accurate and efficient text-based retrieval of relevant information.
[0034] This application's adaptive data block segmentation and pre-construction of an initial carbon emission knowledge database can automatically complete the database entry of carbon emission information, enabling efficient semantic retrieval and similarity matching, which helps large language models generate more professional answers. In the carbon emission question-answering system of this application, the construction of the carbon emission knowledge database plays a fundamental role. The construction of the carbon emission knowledge database involves converting the segmented data blocks into vector representations and then storing these vectors in the initial carbon emission knowledge database. For example, carbon emission information such as policy documents, emission reports, and technical standards are segmented into smaller data blocks and converted into high-dimensional vectors through vectorization, preserving the semantic features of the information. This process not only maintains the semantic relationships between different knowledge units but also provides a computational foundation for accurate context-aware question answering, semantic reasoning, and knowledge discovery in the field of carbon emissions.
[0035] In some embodiments, performing multiple rounds of association operations on the plurality of initial data blocks to obtain a plurality of target data blocks includes: each round of association operation is performed as follows: in response to determining that the first initial data block in the sequence has an adjacent next initial data block, calculating the association degree between the first initial data block and the next initial data block; in response to determining that the association degree is greater than a predetermined association degree, merging the first initial data block and the next initial data block to obtain a merged data block, using the merged data block as the first initial data block in the next round of association operation, and performing the next round of association operation; in response to determining that the association degree is less than or equal to the predetermined association degree, determining the first initial data block as a target data block, and using the next initial data block as the first initial data block in the next round of association operation, and performing the next round of association operation; in response to determining that the first initial data block does not have an adjacent next initial data block, exiting at least one round of association operation. In this embodiment, each round of association operations is performed as follows: When the first initial data block in the sequence has an adjacent next initial data block, the association degree between the first initial data block and the next initial data block is calculated. If the association degree is greater than a predetermined association degree, the first initial data block and the next initial data block are merged to obtain a merged data block. The starting information in the next initial data block that is identical to the ending information of the first initial data block is deleted. The next initial data block after deleting the starting information is then appended to the first initial data block, completing the merging of data blocks and merging adjacent initial data blocks with strong correlations. Since the merged data block may still have a next initial data block with strong correlations, the merged data block is used as the first initial data block in the next round of association operations to achieve the goal of comprehensively establishing associations between adjacent initial data blocks with correlations. If the association degree is less than or equal to the predetermined association degree, it indicates that the correlation between the first initial data block and the next initial data block is low, and the first initial data block is determined as the target data block. The process continues by searching for a highly correlated adjacent initial data block. If this adjacent initial data block is found, it is used as the first initial data block in the next round of join operations. If the first initial data block does not have an adjacent next initial data block, it indicates that the first initial data block is the last initial data block in the sequence, and no further join operation is needed; the process exits after at least one round of join operations. By performing multiple rounds of join operations on multiple initial data blocks, highly correlated adjacent initial data blocks are merged, improving the accuracy of data block partitioning and ensuring the continuity of the target data block's content.
[0036] In some embodiments, before dividing the carbon information into multiple initial data blocks with a division order according to the data order in the carbon information, using a preset data length and a preset data overlap, the method includes: in response to determining that the carbon information is an unstructured document, converting the carbon information into a string. In this embodiment, the existing database is incompatible with unstructured documents. In order to ensure the comprehensiveness of the carbon information stored in the database, when the carbon information exists in the form of unstructured documents (such as PDF reports, Word files, scanned copies or web page text), it is necessary to convert it into structured data that can be processed by a computer through string conversion. This solves the problem that the complex database structure cannot be compatible with unstructured documents, and avoids users manually entering carbon information, thereby improving the processing efficiency of unstructured documents.
[0037] In some embodiments, the step of retrieving multiple related data from a pre-built carbon dioxide knowledge database based on the question text includes: vectorizing the question text to obtain a question vector corresponding to the question text; performing similarity matching in the carbon dioxide knowledge database based on the question vector to obtain multiple matching target vectors; and performing vector restoration on the multiple matching target vectors to obtain the multiple related data. In this embodiment, since the data blocks in the carbon dioxide knowledge database are stored in vector form, the question text is vectorized to obtain the corresponding question vector for data matching consistency. Based on the question vector, similarity matching is performed in the carbon dioxide knowledge database to obtain multiple matching target vectors. Through similarity matching, the goal is to accurately find target vectors with strong relevance to the question vector in the carbon dioxide knowledge database. Vector reconstruction is then performed on the multiple matching target vectors to obtain multiple related data, mapping the vector representation in high-dimensional space back to the original data form, improving data interpretability, and facilitating the subsequent integration of related data by the carbon dioxide question-answering model.
[0038] In some embodiments, the step of performing similarity matching in the carbon dioxide knowledge database based on the question vector to obtain multiple matching target vectors includes: parsing the question vector for key information to obtain a key vector; calculating the similarity between the key vector and the target vector for each target vector in the carbon dioxide knowledge database; sorting all similarities in descending order to obtain a similarity sequence containing all similarities; and determining the target vectors corresponding to the first N similarities in the similarity sequence as the multiple matching target vectors. In this embodiment, the vectorized question vector may contain redundant information. To eliminate the influence of redundant information, key information parsing is performed on the question vector to obtain key vectors. Irrelevant information in the question vector is filtered out to obtain key vectors, which can reflect the keywords in the question text. For each target vector in the carbon dioxide knowledge database, the similarity between the key vector and the target vector is calculated to obtain the degree of association between the key vector and the target vector. All similarities are sorted in descending order to obtain a similarity sequence containing all similarities. There is a correspondence between similarity and target vector. By sorting the similarities, it is possible to know which target vectors are highly associated with the key vector. The target vectors corresponding to the top N similarities in the similarity sequence are determined as multiple matching target vectors, which can obtain multiple target vectors with relatively high association with the key vector, where N is a positive integer determined based on historical experience. By performing key information matching in the database, the key information contains information from the simplified and vectorized question text without redundant information. Therefore, the key information can be accurately matched in the carbon dioxide knowledge database to achieve the purpose of accurately selecting target vectors. Furthermore, the target vector being matched is relatively highly correlated with the key information, which avoids interference from target vectors with relatively low correlation in the generated answer, thus helping to improve the efficiency of answer generation.
[0039] For example, the similarity between the key vector and the target vector can be calculated using the following method: First, the user-input question text is vectorized and key information is parsed to obtain the key vector. Relevant information is retrieved from the carbon dioxide knowledge database using a similarity search. This process is accomplished through cosine similarity. Specifically, the target vector in the carbon dioxide knowledge database... Calculate cosine similarity with key vectors The formula is as follows: , in, , Describes the Euclidean norm of the key vector. This represents the Euclidean norm of the target vector. Based on the cosine similarity of all target vectors, find the N target vectors corresponding to the key vector. The N matching target vectors are determined by the formula... Selected.
[0040] In another embodiment provided in this application, such as Figure 3 As shown, Figure 3This is a flowchart illustrating the electric carbon question-and-answer system of this application embodiment. Multiple electric carbon information items are acquired, which can be unstructured or structured documents. For each piece of electric carbon information, the information is read, segmented, and vectorized to obtain a target vector. An electric carbon knowledge database is constructed based on all target vectors. It should be noted that when the electric carbon information is an unstructured document, string conversion is required. Upon receiving the user's question text, the question text is vectorized to obtain a question vector. The question vector is used to search the electric carbon knowledge database to obtain multiple related data. Finally, based on the question text, identity information, and multiple related data, the target answer text is output through the electric carbon question-and-answer model. The construction process of the electric carbon knowledge database in this application embodiment is as follows: Figure 4 As shown, the process involves acquiring carbon information, dividing it into blocks to obtain a sequence containing multiple initial data blocks, and calculating the correlation between the first initial data block and its adjacent next initial data block. If a predetermined correlation is achieved, the first and next initial data blocks are merged and vectorized. If the correlation is less than or equal to the predetermined correlation, the next initial data block is used as the first initial data block in the next round of calculation. Alternatively, it can be determined whether there is a sharp drop in cosine distance between the first initial data block and its adjacent next initial data block. If a sharp drop in cosine distance occurs, the first and next initial data blocks are merged and vectorized. If no sharp drop in cosine distance occurs, the next initial data block is used as the first initial data block in the next round of calculation.
[0041] For example, this application pre-defines 63 PDF documents and 14 websites as the knowledge base for the electrocarbon coupling database. The block parameter is set to a maximum block size of 1,000 characters and an overlap of 20 characters. After chunking and vectorization, the electrocarbon knowledge database contains 6217 vectors. To manage these vectors, LanceDB (Lance Database) is used as the initial electrocarbon knowledge database. DeepSeek R1 1.5b is chosen as the electrocarbon question-answering model. Finally, AnythingLLM acts as an LLM (Large Language Model) agent to generate accurate context-based responses from the knowledge base. Experiments show that compared to the answers from a general-domain large language model to the same question, the electrocarbon question-answering system provides more professional and meaningful answers, effectively reducing the problem of illusions or vague statements. Simultaneously, the system's interpretability advantage is highlighted through citations. By citing relevant sources and generated responses, users can better understand the source of information and verify its reliability.
[0042] It should be noted that the method in this embodiment can be executed by a single device, such as a computer or server. The method can also be applied in a distributed scenario, where multiple devices cooperate to complete the task. In such a distributed scenario, one of these devices may execute only one or more steps of the method in this embodiment, and the multiple devices will interact with each other to complete the method described.
[0043] It should be noted that the above description describes some embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in a different order than that shown in the above embodiments and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0044] Based on the same inventive concept, and corresponding to any of the above embodiments, this application also provides an electric carbon knowledge question-and-answer device for the power industry.
[0045] refer to Figure 5 The power industry carbon knowledge Q&A device includes: The retrieval module 10 is configured to, in response to receiving a question text input by a user, perform a retrieval in a pre-built carbon knowledge database based on the question text to obtain multiple related data.
[0046] The acquisition module 20 is configured to acquire the user's identity information.
[0047] The generation module 30 is configured to generate the target answer text based on the question text, the multiple associated data and the identity information, through a pre-built carbon-based question-and-answer model.
[0048] The aforementioned device, in response to receiving user-inputted question text, retrieves multiple related data from a pre-built carbon dioxide knowledge database based on the question text. This not only ensures the accuracy of the obtained related data but also improves the efficiency of retrieving multiple related data. The user's identity information is then obtained. Based on the question text, the multiple related data, and the identity information, a target answer text is generated using a pre-built carbon dioxide question-answering model. This improves both the reliability and relevance of the specific carbon dioxide question-answering task and enhances the user's query efficiency.
[0049] In some embodiments, the generation module 30 is further configured to generate feature information corresponding to the identity information based on the identity information; and to perform information extraction and natural language generation on the multiple related data based on the question text and the feature information to obtain the target answer text.
[0050] In some embodiments, the system further includes a construction module configured to acquire multiple pieces of electrocarbon information, wherein the multiple pieces of electrocarbon information include multiple documents in the electrocarbon field and multiple web page information in the electrocarbon field; for each piece of electrocarbon information, according to the data order in the electrocarbon information, the electrocarbon information is sequentially divided into data segments using a preset data length and a preset data overlap to obtain a sequence including multiple initial data blocks; multiple rounds of association operations are performed on the multiple initial data blocks to obtain multiple target data blocks; the multiple target data blocks are vectorized to obtain multiple target vectors, and the multiple target vectors are stored in a pre-constructed initial electrocarbon knowledge database; in response to determining that the multiple target data blocks corresponding to each piece of electrocarbon information are stored in the initial electrocarbon knowledge database, the initial electrocarbon knowledge database is determined as the electrocarbon knowledge database.
[0051] In some embodiments, the construction module is further configured to perform the following in each round of association operation: in response to determining that the first initial data block in the sequence has an adjacent next initial data block, calculate the association degree between the first initial data block and the next initial data block; in response to determining that the association degree is greater than a predetermined association degree, merge the first initial data block and the next initial data block to obtain a merged data block, and use the merged data block as the first initial data block in the next round of association operation to perform the next round of association operation; in response to determining that the association degree is less than or equal to the predetermined association degree, determine the first initial data block as the target data block, and use the next initial data block as the first initial data block in the next round of association operation to perform the next round of association operation; in response to determining that the first initial data block does not have an adjacent next initial data block, exit at least one round of association operation.
[0052] In some embodiments, a conversion module is further included, which is configured to perform string conversion on the carbon information in response to determining that the carbon information is an unstructured document before dividing the carbon information into multiple initial data blocks with a division order by using a preset data length and a preset data overlap according to the data order in the carbon information.
[0053] In some embodiments, the retrieval module 10 is further configured to vectorize the question text to obtain a question vector corresponding to the question text; perform similarity matching in the carbon dioxide knowledge database based on the question vector to obtain multiple matching target vectors; and perform vector restoration on the multiple matching target vectors to obtain the multiple associated data.
[0054] In some embodiments, the retrieval module 10 is further configured to perform key information parsing on the question vector to obtain a key vector; calculate the similarity between the key vector and the target vector for each target vector in the carbon knowledge database; sort all similarities in descending order to obtain a similarity sequence containing all similarities; and determine the target vectors corresponding to the first N similarities in the similarity sequence as the plurality of matching target vectors.
[0055] For ease of description, the above devices are described in terms of function, divided into various modules. Of course, in implementing this application, the functions of each module can be implemented in one or more software and / or hardware.
[0056] The apparatus described above is used to implement the corresponding electric carbon knowledge question-and-answer method for the power industry in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0057] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the electric carbon knowledge question-and-answer method for the power industry as described in any of the above embodiments.
[0058] Figure 6 This embodiment illustrates a more specific hardware structure of an electronic device. The device may include a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, memory 1020, input / output interface 1030, and communication interface 1040 are interconnected internally via the bus 1050.
[0059] The processor 1010 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0060] The memory 1020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 1020 and is called and executed by the processor 1010.
[0061] The input / output interface 1030 is used to connect input / output modules to realize information input and output. The input / output modules can be configured as components in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touch screens, microphones, various sensors, etc., and output devices may include displays, speakers, vibrators, indicator lights, etc.
[0062] The communication interface 1040 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0063] Bus 1050 includes a pathway for transmitting information between various components of the device, such as processor 1010, memory 1020, input / output interface 1030, and communication interface 1040.
[0064] It should be noted that although the above-described device only shows the processor 1010, memory 1020, input / output interface 1030, communication interface 1040, and bus 1050, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.
[0065] The electronic devices described above are used to implement the corresponding electric carbon knowledge question-and-answer method for the power industry in any of the foregoing embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0066] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides a non-transitory computer-readable storage medium that stores computer instructions for causing the computer to execute the electric carbon knowledge question-and-answer method for the power industry as described in any of the above embodiments.
[0067] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0068] The computer instructions stored in the storage medium of the above embodiments are used to cause the computer to execute the electric carbon knowledge question-and-answer method for the power industry as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0069] Based on the same concept, corresponding to any of the above embodiments, this application also provides a computer program product, including computer program instructions. When the computer program instructions are run on a computer, the computer causes the computer to execute the electric carbon knowledge question-and-answer method for the power industry as described in any of the above embodiments, which has the beneficial effects of the corresponding method embodiments, and will not be repeated here.
[0070] It should be noted that the embodiments of this application can also be further described in the following ways: It is understood that before using the technical solutions of the various embodiments in this disclosure, users will be informed of the type, scope of use, and usage scenarios of the personal information involved in an appropriate manner, and user authorization will be obtained.
[0071] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose, based on the prompt message, whether to provide personal information to the software or hardware such as electronic devices, applications, servers, or storage media performing the operations of this disclosed technical solution.
[0072] As an optional but not limited implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0073] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0074] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of this application is limited to these examples; under the concept of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the embodiments of this application as described above, which are not provided in detail for the sake of brevity.
[0075] Additionally, to simplify the description and discussion, and to avoid obscuring the embodiments of this application, the well-known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided drawings. Furthermore, the apparatus may be shown in block diagram form to avoid obscuring the embodiments of this application, and this also takes into account the fact that the details of the implementation of these block diagram apparatuses are highly dependent on the platform on which the embodiments of this application will be implemented (i.e., these details should be fully understood by those skilled in the art). While specific details (e.g., circuits) have been set forth to describe exemplary embodiments of this application, it will be apparent to those skilled in the art that the embodiments of this application can be implemented without these specific details or with variations thereof. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0076] Although this application has been described in conjunction with specific embodiments thereof, many substitutions, modifications, and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed.
[0077] The embodiments of this application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of this application. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the embodiments of this application should be included within the protection scope of this application.
Claims
1. A method for electric carbon knowledge Q&A in the power industry, characterized in that, The method comprises the following steps: in response to receiving question text of user input, searching in a pre-constructed electric carbon knowledge database based on the question text to obtain a plurality of associated data; obtaining identity information of the user; generating target answer text based on the question text, the plurality of associated data and the identity information through a pre-constructed electric carbon question and answer model.
2. The method of claim 1, wherein, The method of generating target answer text based on the question text, the plurality of associated data and the identity information through a pre-constructed electric carbon question and answer model comprises: generating feature information corresponding to the identity information based on the identity information; performing information extraction and natural language generation on the plurality of associated data based on the question text and the feature information to obtain the target answer text.
3. The method of claim 1, wherein, The construction method of the electric carbon knowledge database comprises: obtaining a plurality of electric carbon information, wherein the plurality of electric carbon information comprises a plurality of electric carbon field documents and a plurality of electric carbon field webpage information; for each electric carbon information, performing data division on the electric carbon information in sequence according to data order in the electric carbon information by using a preset data length and a preset data overlap degree to obtain a sequence comprising a plurality of initial data blocks; performing a plurality of rounds of association operations on the plurality of initial data blocks to obtain a plurality of target data blocks; vectorizing the plurality of target data blocks to obtain a plurality of target vectors, and storing the plurality of target vectors in a pre-constructed initial electric carbon knowledge database; determining the initial electric carbon knowledge database as the electric carbon knowledge database in response to determining that the plurality of target data blocks corresponding to each electric carbon information are all stored in the initial electric carbon knowledge database.
4. The method of claim 3, wherein, The method of performing a plurality of rounds of association operations on the plurality of initial data blocks to obtain a plurality of target data blocks comprises: each round of association operation is performed as follows: in response to determining that a first initial data block in the sequence has a next initial data block adjacent thereto, calculating an association degree of the first initial data block and the next initial data block; in response to determining that the association degree is greater than a predetermined association degree, merging the first initial data block and the next initial data block to obtain a merged data block, taking the merged data block as the first initial data block in the next round of association operation, and performing the next round of association operation; in response to determining that the association degree is less than or equal to the predetermined association degree, determining the first initial data block as a target data block, and taking the next initial data block as the first initial data block in the next round of association operation, and performing the next round of association operation; in response to determining that the first initial data block does not have the next initial data block adjacent thereto, exiting at least one round of association operation.
5. The method of claim 3, wherein, Before performing data division on the electric carbon information in sequence according to data order in the electric carbon information by using a preset data length and a preset data overlap degree to obtain a plurality of initial data blocks with a division order, the method comprises: in response to determining that the electric carbon information is an unstructured document, performing string conversion on the electric carbon information.
6. The method of claim 1, wherein, The method of searching in a pre-constructed electric carbon knowledge database based on the question text to obtain a plurality of associated data comprises: vectorize the question text to obtain a question vector corresponding to the question text; perform similarity matching in the electric carbon knowledge database based on the question vector to obtain a plurality of matched target vectors; vector reduction is performed on the plurality of matched target vectors to obtain the plurality of associated data.
7. The method of claim 6, wherein, The similarity matching in the electric carbon knowledge database based on the question vector to obtain a plurality of matched target vectors comprises: performing key information analysis on the question vector to obtain a key vector; for each target vector in the electric carbon knowledge database, calculating the similarity between the key vector and the target vector; sorting all similarities in descending order to obtain a similarity sequence containing all similarities, and determining the target vectors corresponding to the first N similarities in the similarity sequence as the plurality of matched target vectors.
8. An electric carbon knowledge Q&A device in the electric power industry, characterized by, comprises: a retrieval module configured to, in response to receiving a question text input by a user, perform retrieval in a pre-constructed electric carbon knowledge database based on the question text to obtain a plurality of associated data; an acquisition module configured to acquire identity information of the user; a generation module configured to generate a target answer text based on the question text, the plurality of associated data and the identity information through a pre-constructed electric carbon question and answer model.
9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and running on the processor, characterized in that, The processor implements the method of any one of claims 1 to 7 when executing the program.
10. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to make the computer execute the method of any one of claims 1 to 7. The computer instructions are used to make the computer execute the method of any one of claims 1 to 7.
Citation Information
Cited By
Energy-carbon platform intelligent question answering and knowledge pushing system and method based on AI analysis
CN121980001A