Multi-source carbon emission data fusion method and fusion system based on large language model and knowledge graph, and computer readable storage medium
Through large language model and knowledge graph technology, the flexibility and scalability of multi-source carbon emission data fusion are solved, and the accurate division and integration of carbon emission data is achieved, providing more comprehensive and reliable information support, and in-depth understanding of the Carbon emissions.
Patent Information
- Application Number
- CN202410692851.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-11-05
AI Technical Summary
The existing technology cannot effectively integrate multi-source carbon emission data, lacks flexibility and scalability, and cannot deeply explore the correlation and trends between data, resulting in limitations of analysis results.
Using large language models and knowledge graphs, create text data sets of carbon emission entities and categories, build carbon emission knowledge graphs, and classify and integrate multi-source carbon emission data, including industry, agriculture, life, transportation, construction, energy, etc. category and show fusion results.
The accurate division and integration of multi-source carbon emission data has been achieved, the information obtained is more reliable and comprehensive, and the in-depth understanding of the emissions situation in different fields and industries is possible, and multi-dimensional data support is provided for carbon emission management.
Smart Images

Figure CN118897871A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of multi-source carbon emission data fusion, and in particular provides a multi-source carbon emission data fusion method, a fusion system and a computer-readable storage medium based on a large language model and a knowledge graph. Background Art
[0004] The patent with publication number CN117454313A provides a multi-source heterogeneous data fusion method, device, electronic device and storage medium. The method includes: obtaining multi-source heterogeneous data of supply chain financing, including financing data, user data and social data, and then constructing a supply chain financing knowledge graph based on the data, and fusing the multi-source heterogeneous data of the supply chain financing knowledge graph based on a predetermined deep learning network model to obtain target data. This method effectively improves the comprehensive ability of supply chain financing management, and effectively improves the data mining ability of financing data, thereby improving the accuracy of predicting customer risks. However, this method is more suitable for specific types of data, and cannot fuse multi-source carbon emission data, lacking flexibility and scalability.
[0005] Therefore, providing a fusion method suitable for multi-source carbon emission data to improve the flexibility and scalability of data fusion has become an urgent problem to be solved. Summary of the invention
[0006] In view of this, the purpose of the present invention is to provide a multi-source carbon emission data fusion method, fusion system and computer-readable storage medium based on a large language model and a knowledge graph to solve the problems existing in the prior art.
[0007] On the one hand, the present invention provides a multi-source carbon emission data fusion method based on a large language model and a knowledge graph, comprising the following steps:
[0008] S1: Use a large language model to create a text dataset about the relationship between carbon emission entities contained in different categories and the categories;
[0009] S2: construct a carbon emission knowledge graph for each category using the text dataset, wherein the nodes of the carbon emission knowledge graph for each category are the carbon emission entities contained in the category, and the edges of the carbon emission knowledge graph for each category are the relationships between the carbon emission entities and the categories;
[0010] S3: Using the carbon emission knowledge graph, the multi-source carbon emission data to be integrated are divided into categories and the carbon emission data of the same category are integrated.
[0011] Preferably, in S1, the categories include industry, agriculture, life, transportation, construction, and energy.
[0012] Further preferably, in S3, the fusion includes calculating the carbon emission data corresponding to each category and / or the total carbon emission data.
[0013] Further preferably, the multi-source carbon emission data to be integrated includes multi-source carbon emission data of different provinces and cities, and S3 also includes the step of integrating the multi-source carbon emission data of different cities according to provinces in advance.
[0014] Further preferably, the multi-source carbon emission data fusion method based on a large language model and a knowledge graph also includes the following steps: S4: displaying the fusion results.
[0015] The present invention also provides a multi-source carbon emission data fusion system based on a large language model and a knowledge graph, which is used to execute the above-mentioned multi-source carbon emission data fusion method based on a large language model and a knowledge graph.
[0016] Preferably, the multi-source carbon emission data fusion system based on the large language model and the knowledge graph includes a data upload module, a data fusion module and a data visualization module. The data upload module is used to upload multi-source carbon emission data, the data fusion module is used to execute the above-mentioned multi-source carbon emission data fusion method based on the large language model and the knowledge graph to realize multi-source carbon emission data fusion, and the data visualization module is used to display the data fusion results.
[0017] Further preferably, the multi-source carbon emission data fusion system based on large language model and knowledge graph also includes a data information display module for displaying data information uploaded by users.
[0018] The present invention also provides a computer-readable storage medium, in which a plurality of instructions are stored. The plurality of instructions can be read by a processor and execute the above-mentioned multi-source carbon emission data fusion method based on a large language model and a knowledge graph.
[0019] The multi-source carbon emission data fusion method and fusion system based on a large language model and knowledge graph provided by the present invention have the following beneficial effects:
[0020] 1. Using a large language model to construct multi-source knowledge graph node relationship data can accurately classify carbon emission data, avoiding the errors and subjective judgments that may exist in traditional methods, and the information obtained is more reliable and accurate;
[0021] 2. It is possible to integrate carbon emission data from multiple sources instead of processing only a single data source. Since it covers multiple data sources and multiple fields, the information obtained is more comprehensive and rich. It can not only understand the overall situation of carbon emissions, but also deeply understand the emissions in different fields and industries. It provides more dimensional data support for a comprehensive understanding of carbon emissions, and can obtain richer and more reliable information than a single data source or a single structure data. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The present invention will be further explained below in conjunction with the accompanying drawings:
[0023] Figure 1 A flow chart of a multi-source carbon emission data fusion method based on a large language model and a knowledge graph provided by the present invention;
[0024] Figure 2 Schematic diagram of text datasets created for using large language models;
[0025] Figure 3 This is a display diagram of the constructed carbon emission knowledge graph in the graph database neo4j. Figure 3 (1)-(6) in the figure correspond to the carbon emission knowledge graphs of industry, agriculture, life, transportation, construction, and energy categories respectively. DETAILED DESCRIPTION
[0026] The present invention will be further explained below in conjunction with the accompanying drawings and specific implementation schemes, but the present invention is not limited thereto.
[0027] In the existing technology, the sources of carbon emission data are numerous and complex, and the data are relatively fragmented. The integration of multi-source carbon emission data requires solving problems such as inconsistent data formats, uneven data quality, and complexity of data processing. In addition, traditional methods lack effective technical means for comprehensive analysis of carbon emission data, and are unable to deeply explore the correlation and trends between data, resulting in limitations in the analysis results.
[0028] In view of this, if Figure 1 As shown, the present invention provides a multi-source carbon emission data fusion method based on a large language model and a knowledge graph, comprising the following steps:
[0029] S1: Using a large language model to create a text dataset about the relationship between carbon emission entities and categories contained in different categories, to provide data support for building a knowledge graph. Preferably, the categories include industry, agriculture, life, transportation, construction, and energy.
[0030] S2: construct a carbon emission knowledge graph for each category using the text dataset, wherein the nodes of the carbon emission knowledge graph for each category are the carbon emission entities contained in the category, and the edges of the carbon emission knowledge graph for each category are the relationships between the carbon emission entities and the categories;
[0031] S3: Using the carbon emission knowledge graph, the multi-source carbon emission data to be integrated are divided into categories and the carbon emission data of the same category are integrated.
[0032] As an improvement to the technical solution, in S3, the fusion includes calculating the carbon emission data and / or total carbon emission data corresponding to each category.
[0033] As an improvement to the technical solution, the multi-source carbon emission data to be integrated include multi-source carbon emission data from different provinces and cities. S3 also includes a process of pre-integrating the multi-source carbon emission data from different cities according to provinces, so as to obtain carbon emission data and / or total carbon emission data corresponding to different categories in different provinces.
[0034] As an improvement of the technical solution, the multi-source carbon emission data fusion method based on the large language model and the knowledge graph also includes the following steps:
[0035] S4: Shows the fusion results.
[0036] Among them, the display of fusion results can allow users to intuitively understand which provinces have the highest carbon emissions through pie charts or bar charts, and understand the proportion of each category of carbon emissions. It has a certain degree of interactivity and flexibility.
[0037] The present invention also provides a multi-source carbon emission data fusion system based on a large language model and a knowledge graph, which is used to execute the above-mentioned multi-source carbon emission data fusion method based on a large language model and a knowledge graph.
[0038] The present invention also provides a computer-readable storage medium, in which a plurality of instructions are stored. The plurality of instructions can be read by a processor to execute the above method.
[0039] The multi-source carbon emission data fusion method and fusion system based on a large language model and a knowledge graph provided by the present invention use a large language model to construct multi-source knowledge graph node relationship data, which can more accurately classify the categories to which carbon emission data belongs, avoiding errors and subjective judgments that may exist in traditional methods, and the information obtained is more reliable and accurate; multi-source carbon emission data can be fused instead of only processing a single data. Since it covers multiple data sources and multiple fields, the information obtained is more comprehensive and rich, not only the overall situation of carbon emissions can be understood, but also the emission situations in different fields and industries can be deeply understood, which provides more dimensional data support for a comprehensive understanding of carbon emissions, and can obtain richer and more reliable information than a single data source or a single structure data.
[0040] Example
[0041] A multi-source carbon emission data fusion system based on a large language model and knowledge graph. The system is a front-end and back-end separation project with the front-end developed using mainstream technologies such as vue3 and Element-Plus, and the back-end built using Python's mainstream lightweight development framework Django.
[0042] The front-end is developed using the latest vue3 and Element-Plus technology stack, with proper functional division and reasonable overall design. It has a good interactive experience, and the user interface operates naturally and smoothly, making it easy to understand and use. The back-end uses Python's mainstream web development framework Django, which is a relatively stable framework.
[0043] The system architecture is designed as a three-layer architecture: basic data layer, development layer and user display layer, among which the user display layer has the highest level and is responsible for presenting the operating interface of the system and the feedback results of user operations to the user; the development layer has a middle level and is responsible for calling the underlying basic data layer to implement the corresponding functions and feedback to the user display layer; the basic data layer is the bottom layer of the system and is responsible for cooperating to implement the functions of the development layer and returning the results to the superior.
[0044] The system as a whole includes three modules: data upload module, data fusion module and data visualization module. Users can use the data upload module to upload multi-source carbon emission data, and the system records the uploaded data name, upload time and other valid information; the data fusion module is used to perform category fusion processing on the uploaded multi-source carbon emission data by querying the carbon emission knowledge graph constructed by text data generated by the large language model, thereby realizing multi-source carbon emission data fusion, and the data visualization module is used to display the data fusion results. Preferably, it also includes a data information display module for displaying the data information uploaded by the user.
[0045] Among them, the specific implementation methods of each module of the system are as follows:
[0046] 1. Data upload module
[0047] This module is used for users to upload multi-source carbon emission data, which may include annual national, provincial, city, and county carbon emission inventory data. The uploaded multi-source carbon emission data is used to establish a multi-dimensional, multi-source, and multi-structured original energy carbon emission database.
[0048] The uploaded data can be Excel data, and each column in the data corresponds to a different title, which is used to distinguish information such as year, country, province, city, carbon emission entity, etc. In addition, by setting the multiple attribute of the Element-Plus el-upload component, the function of batch uploading data can also be realized; at the same time, the uploaded data can also be deleted or cleared;
[0049] Preferably, the implementation steps of the data upload module are as follows:
[0050] First, after the user clicks the upload data button, the function of batch uploading data can be realized through the multiple attribute of the el-upload component of Element-Plus. After the upload is completed, the front end sends an axios request, and the back end receives the data passed by the front end, obtains the file name, upload time, size and other information, and stores it in the upload_file table of the MySQL database. Then, by reading the data in the database table, the data is returned to the front end in json format, and the front end is rendered into a table after parsing. When the clear data button is clicked, the back end will delete all data in the upload_file table so that new carbon emission data can be uploaded for fusion processing next time;
[0051] 2. Data information display module
[0052] Preferably, the implementation steps of the data information display module are as follows:
[0053] The backend calls the upload_file method to obtain the data uploaded by the frontend;
[0054] Store the data file name, upload time, and file size information in the uploaded_files table of the MySQL database;
[0055] The backend calls the initial method, obtains file information from the uploaded_files database, and combines it into json format data to pass to the frontend;
[0056] The front end uses axios to initiate a request to obtain data, and uses the JSON.parse method to parse the JSON data sent from the back end, and then displays it in a table;
[0057] 3. Data fusion module
[0058] This module uses knowledge graphs to fuse multi-source carbon emission data in order to better understand and analyze the carbon emissions of various provinces and provide more accurate and comprehensive support for carbon emission management and decision-making.
[0059] The implementation steps of the data fusion module are as follows:
[0060] First, the user clicks the data fusion button, the front end sends an axios request to the back end, the back end calls the dataConfuse interface, reads the uploadData folder used to store the user's uploaded data, and executes the data fusion code in a loop. The main idea is: first, the data of different cities in the same province are merged using the groupby method, and then the data titles are divided into categories by querying the constructed knowledge graph, and then the data of the same category are merged using the groupby method. Finally, the total fused data merged_data is generated, and then the fused data is passed to the front end in json format and displayed on the page.
[0061] The data fusion process is as follows:
[0062] Use the large language model to create a text dataset about the relationship between carbon emission entities and categories in six categories: industry, agriculture, life, transportation, construction, and energy, to provide data support for building a knowledge graph;
[0063] Figure 2 It is part of a text dataset built using a large language model that contains the relationships between carbon emission entities and categories in six categories: industry, agriculture, life, transportation, construction, and energy.
[0064] Create a graph database neo4j, and call the python open source library py2neo to connect to the graph database neo4j in python;
[0065] Read the data in the text dataset and store it in the graph database neo4j in the form of a knowledge graph to obtain a knowledge graph of carbon emissions for each category, which is used to provide basic support for subsequent data fusion;
[0066] Figure 3The display diagram of the constructed carbon emission knowledge graph in the graph database neo4j includes carbon emission knowledge graphs of industry, agriculture, life, transportation, construction, and energy categories. The nodes of each type of carbon emission knowledge graph are various carbon emission entities belonging to this category, and the relationship between the nodes (i.e., edges) is the relationship between these carbon emission entities. For example, various forms of energy data such as fossil energy, renewable energy, and nuclear energy belong to the energy type; manufacturing, process manufacturing, industrial automation, etc. belong to the industrial type, etc. The construction of the carbon emission knowledge graph provides support for subsequent data fusion, so that carbon emission data from different fields can be effectively integrated, laying the foundation for further research and application;
[0067] Traverse the folders storing the user uploaded data. Preferably, by setting the value of the v-loading attribute, the page displays the loading status during the data fusion process, so that the user cannot perform other operations to prevent incorrect data from being obtained. After the fusion is completed, the loading is canceled;
[0068] Preprocess the data and use the groupby method to sum the data of different cities in the same province to obtain the processed data;
[0069] Use Cypher statements to query the knowledge graph, divide each column title of the user-uploaded data into knowledge graph categories, and store them in category data;
[0070] Redefine the Excel titles to province, industry, agriculture, life, transportation, construction, energy category carbon emission data and total carbon emission data;
[0071] Use the groupby method to sum the data of the same category;
[0072] Use the above data fusion method to fuse all uploaded data, integrate all fused data, and generate a merged-data Excel file;
[0073] The fused data can preferably be downloaded by the user.
[0074] 4. Data visualization module
[0075] This module is used to visualize the fused data, mainly using pie charts and bar charts, allowing users to intuitively understand which provinces have the highest carbon emissions, and understand the proportion of each category of carbon emissions. It has a certain degree of interactivity and flexibility.
[0076] The implementation steps of the data visualization module are as follows:
[0077] The front end uses axios to send a GET request to the API endpoint. The back end reads the fused Excel data, modifies the data format to the data format required by the front end (for example: province: total carbon emission data), and passes the corresponding json data to the front end.
[0078] The front end receives data, sets the chart type, style, label and other parameters through the renderChart method, and assigns the data passed by the back end to the data variable;
[0079] Use ECharts, a powerful and flexible visualization library, to render charts, and finally present interactive charts. Among them, use the ECharts open source library to visualize the fused data, which can provide more in-depth and comprehensive data analysis and comprehensive evaluation, and provide stronger support for carbon emission management and the formulation of emission reduction policies.
[0080] The above-mentioned fusion system can realize the fusion of multi-source carbon emission data, eliminate the problem of data fragmentation, improve the comprehensiveness and accuracy of data, and thus provide a more comprehensive understanding of carbon emissions.
[0081] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems or computer program products. Therefore, the application can adopt the form of complete hardware embodiment, complete software embodiment, or the embodiment in combination with software and hardware. Moreover, the application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code. The scheme in the embodiment of the present application can be implemented in various computer languages, for example, object-oriented programming language Java and literal scripting language JavaScript, etc.
[0082] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0083] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0084] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0085] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0086] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A multi-source carbon emission data fusion method based on a large language model and knowledge graph, characterized in that: The steps include: S1: Use a large language model to create a text dataset about the relationship between carbon emission entities contained in different categories and the categories; S2: construct a carbon emission knowledge graph for each category using the text dataset, wherein the nodes of the carbon emission knowledge graph for each category are the carbon emission entities contained in the category, and the edges of the carbon emission knowledge graph for each category are the relationships between the carbon emission entities and the categories; S3: Using the carbon emission knowledge graph, the multi-source carbon emission data to be integrated are divided into categories and the carbon emission data of the same category are integrated.
2. The multi-source carbon emission data fusion method based on a large language model and a knowledge graph according to claim 1 is characterized in that: In S1, the categories include industry, agriculture, life, transportation, construction, and energy.
3. The multi-source carbon emission data fusion method based on a large language model and a knowledge graph according to claim 1 is characterized in that: In S3, the fusion includes calculating the carbon emission data corresponding to each category and / or the total carbon emission data.
4. The multi-source carbon emission data fusion method based on a large language model and a knowledge graph according to claim 1, characterized in that: The multi-source carbon emission data to be integrated include multi-source carbon emission data of different provinces and cities. S3 also includes the step of integrating the multi-source carbon emission data of different cities according to provinces in advance.
5. The multi-source carbon emission data fusion method based on a large language model and a knowledge graph according to claim 1 is characterized in that: The method also includes the following steps: S4: displaying the fusion result.
6. A multi-source carbon emission data fusion system based on a large language model and knowledge graph, characterized by: Used to execute the multi-source carbon emission data fusion method based on a large language model and a knowledge graph as described in any one of claims 1 to 5.
7. The multi-source carbon emission data fusion system based on a large language model and a knowledge graph according to claim 6, characterized in that: The multi-source carbon emission data fusion system based on a large language model and a knowledge graph includes a data upload module, a data fusion module and a data visualization module. The data upload module is used to upload multi-source carbon emission data. The data fusion module is used to execute the multi-source carbon emission data fusion method based on a large language model and a knowledge graph according to any one of claims 1 to 4 to achieve multi-source carbon emission data fusion. The data visualization module is used to display the data fusion results.
8. The multi-source carbon emission data fusion system based on a large language model and a knowledge graph according to claim 7, characterized in that: It also includes a data information display module for displaying data information uploaded by users.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, which can be read by a processor and executed according to the multi-source carbon emission data fusion method based on a large language model and a knowledge graph as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Multi-domain knowledge graph construction method and device, electronic equipment and storage medium
CN117033661A
Knowledge graph construction method and system based on large language model
CN117150050A
Method and device for constructing knowledge graph, and computer readable storage medium
CN117407533A
Multi-source heterogeneous data fusion method and device, electronic equipment and storage medium
CN117454313A
Cited By
Urban carbon metering method, prediction method and device based on mapping knowledge domain
CN119443414A
