A method for calculating enterprise nitrogen and phosphorus emission fluxes based on multi-source heterogeneous data fusion
Through multi-source heterogeneous data fusion and machine learning methods, the accuracy and completeness issues of enterprise nitrogen and phosphorus emission flux data were solved, efficient and accurate emission flux calculation was achieved, and reliable technical support was provided for environmental supervision.
Patent Information
- Application Number
- CN202510880986.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-06-27
AI Technical Summary
The current acquisition and integration of enterprise pollution discharge data on nitrogen and phosphorus discharge fluxes faces problems such as scattered and heterogeneous data sources, inconsistent data formats, and missing data, which affects the accuracy and completeness of the data.
A multi-source heterogeneous data fusion method is adopted to integrate enterprise attribute information, spatial location information, remote sensing images, land use maps and other data, use a large language model for data recognition and structured extraction, and combine the random forest algorithm to fill in missing data and calculate the enterprise nitrogen and phosphorus emission fluxes.
It has significantly improved data coverage and calculation dimensions, improved the efficiency and consistency of data processing, enhanced the temporal and spatial representativeness and accuracy of calculation results, and provided scientific support for environmental supervision.
Smart Images

Figure CN120373675B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of environmental data processing and pollution monitoring, and specifically relates to a method for calculating enterprise nitrogen and phosphorus emission fluxes based on multi-source heterogeneous data fusion. Background Art
[0002] Currently, the acquisition and integration of enterprise pollution data on nitrogen and phosphorus emission fluxes still face technical challenges: on the one hand, data sources are scattered and heterogeneous. Enterprise information is obtained from the industrial and commercial registration system and the enterprise credit database and stored in tabular form. Pollution emission data mainly comes from the pollution permit system and is mostly stored in the form of images. At the same time, geographic location information relies on map APIs, while spatial data such as remote sensing images and land use data are scattered across different data platforms and stored in raster form. These data formats vary and are subject to problems such as missing and inconsistencies, which affect the accuracy and completeness of enterprise pollution data on nitrogen and phosphorus emission fluxes. On the other hand, pollution emission data for some enterprises is missing. Due to imperfect data collection mechanisms, it is impossible to accurately assess the pollution emissions of enterprises. With the development of large language model technology, it has excellent performance in image understanding and text recognition, and is particularly suitable for processing unstructured image data such as those containing watermarks and complex backgrounds. It breaks through the limitations of traditional optical character recognition in heterogeneous data processing and provides support for the standardization and intelligent analysis of pollution emission data.
[0003] Therefore, how to effectively integrate multi-source data, use the image recognition capabilities of large language models to process heterogeneous data, build a complete and reliable enterprise nitrogen and phosphorus emission flux dataset, and use advanced data filling and calculation methods to improve data quality has become an urgent problem to be solved in the current environmental data processing field. Summary of the Invention
[0004] To solve the above problems, the present invention proposes a method for calculating enterprise nitrogen and phosphorus emission fluxes based on multi-source heterogeneous data fusion. This method aims to fuse multi-source heterogeneous data, construct an enterprise nitrogen and phosphorus emission flux dataset, and use the random forest algorithm to supplement missing data and predict emissions, thereby improving data integrity and accuracy and providing scientific support for environmental supervision.
[0005] To achieve the above object, the present invention adopts the following technical solutions:
[0006] A method for calculating enterprise nitrogen and phosphorus emission fluxes based on multi-source heterogeneous data fusion includes the following steps:
[0007] S1. Collect attribute information from multiple sources of the enterprise and classify it uniformly according to industry standards;
[0008] S2. Call multiple map APIs to obtain and standardize the enterprise's latitude and longitude coordinates to achieve the integration of attribute data and spatial location information;
[0009] S3. Integrate multi-source spatial data and match it with enterprise location information to extract regional environmental characteristics; multi-source spatial data includes remote sensing image data, land use map data, and administrative division data;
[0010] The specific process of step S3 is:
[0011] S31. Obtain publicly available building rooftop data and convert the original coordinate system into the WGS84 coordinate system so that the building rooftop data and the enterprise latitude and longitude coordinate data use the same spatial reference system;
[0012] S32. Load the converted building roof data and enterprise vector point data into ArcMap software and perform spatial matching processing using spatial overlay analysis tools;
[0013] S33, using the point extraction grid value function to extract the roof grid value information corresponding to each enterprise vector point;
[0014] S34, performing discriminant analysis on the extraction results to identify enterprise vector point data that can accurately fall on the building roof;
[0015] S35. Eliminate enterprise vector point data that does not accurately fall on the building roof to eliminate positioning errors caused by spatial coordinate conversion errors or data offsets;
[0016] S4. Use a general large language model and batch scanning tools to identify and extract structured data from heterogeneous formats, and perform fusion comparison and data correction on the extracted results to obtain enterprise nitrogen and phosphorus emission permit data;
[0017] S5. Integrate the enterprise's attribute information, spatial characteristics, and enterprise nitrogen and phosphorus emission permit data, use machine learning methods to complete missing information, calculate the enterprise's nitrogen and phosphorus emission fluxes, and perform raster processing. The calculation formula is:
[0018] Enter the enterprise data to be tested, which is defined as follows: ,in, is enterprise data; X1 is the date of establishment; X2 is the registered capital; X3 is the enterprise category; S K is the one-hot encoded variable of industry size;
[0019] Use the trained random forest regression model to make predictions. The calculation formula is: ,in, is the predicted value of the final nitrogen and phosphorus pollutant emissions; M is the number of decision trees in the random forest regression model; m is the decision tree number; is the predicted output of the mth decision tree;
[0020] The three nitrogen and phosphorus discharge fluxes of total nitrogen, total phosphorus and ammonia nitrogen are mapped to the grid.
[0021] Preferably, the attribute information in step S1 includes company name, registration status, unified social credit code, legal representative, available telephone number, registered address, district and county, establishment date, approval date, industry classification, national standard industry category, national standard industry major category, national standard industry medium category, enterprise scale, registered capital, paid-in capital, business term, province, city, company type, former name, taxpayer identification number, registration number, organization code, number of insured persons, annual report to which the number of insured persons belongs, latest annual report address, mailing address, website, email address and business scope.
[0022] Preferably, the map API in step S2 includes Baidu map API and Amap API; the specific process of obtaining and standardizing the longitude and latitude coordinates of the enterprise in step S2 is:
[0023] S21. Filtering coordinate data that is non-numeric or exceeds a normal range;
[0024] S22. Convert the coordinates obtained from the map API into Martian coordinates using an offset correction method;
[0025] S23. Convert the Martian coordinates into WGS84 coordinates through geographic transformation algorithm to obtain enterprise vector point data.
[0026] Preferably, in step S4, the specific process of using the universal large language model to identify and extract structured data in heterogeneous formats is as follows:
[0027] S41A, identifying the image file and screening the content containing the target keyword;
[0028] S42A, set the root directory path where the image to be processed is located, and specify the supported image formats; the image formats include PNG, JPG, JPEG, BMP, WEBP, TIF and TIFF;
[0029] S43A, setting an output file path for saving the recognition result text, and defining a keyword set for screening; the keywords include total nitrogen, total phosphorus and ammonia nitrogen;
[0030] S44A, traverse all subfolders and image files under the root directory, for each image file that meets the format requirements, read the image content and convert it into Base64 encoding form, and construct a standard data URL format string;
[0031] S45A: Calling a language model interface with image recognition capabilities to submit a request including image data and a recognition instruction; the recognition instruction is used to extract water quality index information in a table in the image and limit the retention of only relevant row data containing keywords;
[0032] S46A. After obtaining the recognition results, the returned text content is parsed line by line to filter out lines containing the target keyword. If there is a line that meets the conditions, it is written to the output file together with the image path information; if there is no matching content, it is recorded as no relevant line is recognized;
[0033] S47A: Set a fixed time interval between image recognition tasks, output a task completion prompt after all image processing is completed, and save all recognition results.
[0034] Preferably, in step S4, the specific process of using a batch scanning tool to identify and extract structured data from heterogeneous formats is as follows:
[0035] S41B, Data organization and automatic traversal: Set the root directory for storing the images to be processed, and the system will automatically traverse all subfolders under this directory;
[0036] S42B, Optical Character Recognition Text Recognition and Preprocessing: Initialize the PaddleOCR tool library and enable the angle classification function to optimize the recognition of tilted text; process qualified images one by one and call the optical character recognition model for text recognition; the recognition results include text content, text box coordinates, and confidence level;
[0037] S43B, anomaly detection and error handling: if the optical character recognition result is empty or no text is detected, automatically record the image path and mark that no text is detected;
[0038] S44B. Result storage and output: Use a unified format to store optical character recognition results, including image path, text content, text box coordinates, and confidence level; save the results to a designated output text file, and use delimiters to distinguish recognition results for different images; and use an append write mode to ensure that processed results are not lost if the program is interrupted during long-term operation.
[0039] S45B, parsing the recognized text data: reading the text file storing the recognition result, parsing the image path, text content, text coordinates, and confidence level in the text file, and then storing the parsed data in a structured manner;
[0040] S46B, intelligent grouping by vertical coordinate: Use the image path as the primary key to segment data so that data from different images are not mixed; calculate the average vertical coordinate value of the text box and set the vertical coordinate tolerance threshold to determine whether the text belongs to the same row; use the proximity analysis method to automatically determine whether the recognized text belongs to the same visual row, and merge text with a distance less than the threshold into the same group;
[0041] S47B. Generate structured output: In the grouped data, retain the image path of each group of text for subsequent tracing; unify the storage method so that each group contains the text content, confidence score and corresponding image path of the row of text, and generate a clear structured data table.
[0042] Preferably, in step S5, the spatial feature is the location of the enterprise plot; the nitrogen and phosphorus emission fluxes include total nitrogen emission flux, total phosphorus emission flux and ammonia nitrogen emission flux.
[0043] Preferably, the training steps of the random forest regression model in step S5 are:
[0044] S51. Data processing:
[0045] The date of incorporation is converted into the company's duration as of the scheduled date;
[0046] The industry scale variable is converted into an industry scale coefficient through a mapping function to enhance the impact of the categorical variable on the prediction results. The mapping function is defined as: ,in, is the industry scale coefficient; is the mapping function; C is the industry scale variable; f is the pollution emission coefficient corresponding to the industry in the Second National Pollution Source Census Bulletin;
[0047] The industry scale variable is converted into a one-hot encoding, and the conversion formula is: OHE(S)=
S1,S2,……,S K
[0048] The input data is standardized to make the order of magnitude of different eigenvalues consistent. The calculation formula is: , where x is the input data; μ is the mean of the enterprise's numerical characteristics; σ is the standard deviation of the enterprise's numerical characteristics;
[0049] Divide the standardized data into training set and test set;
[0050] S52. Use the training set data to train the random forest regression model, input 、 Calculate the predicted values of nitrogen and phosphorus pollutant emissions based on the enterprise's attribute information;
[0051] S53. Calculate the prediction mean square error using the test set data. The calculation formula is: , where MSE is the mean square error of prediction; N is the number of training samples; j is the sample number; y j is the true value of nitrogen and phosphorus pollutants; is the predicted value of nitrogen and phosphorus pollutants;
[0052] S54, decision tree splitting rule: In the process of building a decision tree, a subset of input features is randomly selected at each decision node as a candidate split feature to find the optimal feature x j And the corresponding threshold t, so that the error of the left and right subtrees is minimized, the optimization goal is defined as: ,in, is the total number of samples in the current node data set; and According to the optimal The number of samples contained in the left child node and the right child node after the split; and are the mean squared errors of samples in the left and right child nodes respectively.
[0053] After adopting the above technical solution, the present invention has the following beneficial effects:
[0054] 1. This invention adopts the deep fusion of multi-source data. By integrating enterprise attribute data, spatial location information (latitude and longitude coordinates), remote sensing images, land use maps, administrative divisions and other multi-source heterogeneous data, it breaks through the limitations of a single data source, significantly improves data coverage and calculation dimensions, and provides comprehensive and multi-dimensional data support for pollution flux analysis.
[0055] 2. The present invention adopts standardized and automated processing, uniformly classifies enterprise attribute information based on industry standards, and uses map API to achieve standardized processing of spatial data, effectively solving the problem of incompatibility of heterogeneous data formats, reducing manual intervention errors, and improving the efficiency and consistency of data processing.
[0056] 3. This invention uses intelligent data extraction and correction, combined with a general large language model (LLM) and batch scanning tools, to automatically identify, structure, extract, and fusion-match unstructured enterprise emission permit data, significantly improving data extraction accuracy. It also corrects data deviations through a cross-validation mechanism to ensure the reliability of emission data.
[0057] 4. The present invention adopts dynamic spatial feature association to accurately extract regional environmental characteristics by matching enterprise location information with multi-source spatial data (such as remote sensing images and land use types), realize dynamic correlation analysis between pollution flux and geographical environment, and enhance the spatiotemporal representativeness of calculation results.
[0058] 5. This invention uses machine learning to optimize and complete data, utilizing machine learning methods to fuse multidimensional data and intelligently complete missing information. This reduces estimation bias caused by incomplete data and improves the integrity and accuracy of pollutant flux calculations, making it particularly suitable for data-sparse scenarios. Furthermore, this invention enables visualization and decision support. By rasterizing pollutant flux results, it generates intuitive visualization outputs of spatial distribution, facilitating rapid location of key pollutant discharge areas by environmental regulators and providing a scientific basis for differentiated management and precise pollution control.
[0059] In summary, the present invention achieves high-precision and efficient calculation of nitrogen and phosphorus emission fluxes of enterprises through multi-source data fusion, intelligent processing and machine learning optimization, providing a reliable technical means for environmental pollution supervision and control. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 Flowchart of the present invention; DETAILED DESCRIPTION
[0061] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0062] like Figure 1 As shown, a method for calculating enterprise nitrogen and phosphorus emission fluxes based on multi-source heterogeneous data fusion includes the following steps:
[0063] S1. Collect attribute information from multiple sources of the enterprise and classify it uniformly according to industry standards;
[0064] The attribute information in step S1 includes company name, registration status, unified social credit code, legal representative, available telephone number, registered address, district and county, establishment date, approval date, industry classification, national standard industry category, national standard industry major category, national standard industry medium category, enterprise scale, registered capital, paid-in capital, business term, province and city, company type, former name, taxpayer identification number, registration number, organization code, number of insured persons, annual report to which the number of insured persons belongs, latest annual report address, mailing address, website, email address, and business scope;
[0065] In step S1, the national standard industry categories, national standard industry categories, and national standard industry categories are combined to classify according to the principle of matching the primary industry with land distribution and land use data, subdividing the secondary industry, and merging the tertiary industry. The specific classification standards are as follows:
[0066] Agriculture: Enterprises engaged in the planting and production of crops such as grains, vegetables, and fruits.
[0067] Forestry: Enterprises engaged in forest cultivation, timber harvesting, forest product processing and forest resource management.
[0068] Animal husbandry: Enterprises engaged in livestock and poultry breeding and the production and processing of livestock products.
[0069] Fisheries: Enterprises engaged in aquaculture, fishing and aquatic product processing.
[0070] Mining industry: Enterprises that mine coal, metal ores, non-metallic ores and other mineral resources.
[0071] Food manufacturing industry: enterprises that produce various types of food, beverages, tobacco products, etc. for human consumption.
[0072] Textile industry: enterprises engaged in spinning, weaving, dyeing and finishing, and production of clothing and textile products.
[0073] Chemical manufacturing industry: enterprises that produce chemical raw materials, chemicals, pharmaceuticals and chemical fibers, etc.
[0074] Metal manufacturing industry: enterprises engaged in ferrous and non-ferrous metal smelting, rolling processing and metal product production.
[0075] Various equipment manufacturing industries: enterprises that produce mechanical equipment, special equipment, general equipment and transportation equipment.
[0076] Electronic manufacturing industry: companies that manufacture electronic components, electronic devices, communication equipment, computers and other electronic products.
[0077] Other manufacturing industries: covers manufacturing industries not classified into other categories, such as furniture, toys, stationery, etc.
[0078] Electricity, heat, gas and water production and supply industry: enterprises that provide electricity, heat, gas and water production, supply and related services.
[0079] Construction industry: Enterprises engaged in the construction, installation, repair and decoration of various types of construction projects.
[0080] The tertiary industry covers wholesale and retail, transportation, warehousing, postal services, accommodation and catering, finance, education, medical care, culture, entertainment and all other service industries.
[0081] S2. Call multiple map APIs to obtain and standardize the enterprise's latitude and longitude coordinates to achieve the integration of attribute data and spatial location information;
[0082] The map API in step S2 includes Baidu Map API and Amap API. The specific process of obtaining and standardizing the longitude and latitude coordinates of the enterprise in step S2 is as follows:
[0083] S21. Filtering coordinate data that is non-numeric or exceeds a normal range;
[0084] S22. Convert the coordinates obtained from the map API into Martian coordinates using an offset correction method;
[0085] S23. Convert the Martian coordinates into WGS84 coordinates using a geographic transformation algorithm to obtain enterprise vector point data;
[0086] S3. Integrate multi-source spatial data and match it with enterprise location information to extract regional environmental characteristics; multi-source spatial data includes remote sensing image data, land use map data, and administrative division data;
[0087] The specific process of step S3 is:
[0088] S31. Obtain publicly available building rooftop data and convert the original coordinate system into the WGS84 coordinate system so that the building rooftop data and the enterprise latitude and longitude coordinate data use the same spatial reference system; wherein the building rooftop data is obtained from Sentinel-2 images from 2016 to 2021, using super-resolution technology to generate a 2.5-resolution building rooftop distribution dataset for each year from 2016 to 2021;
[0089] S32. Load the converted building roof data and enterprise vector point data into ArcMap software and perform spatial matching processing using spatial overlay analysis tools;
[0090] S33, using the point extraction grid value function to extract the roof grid value information corresponding to each enterprise vector point;
[0091] S34, performing discriminant analysis on the extraction results to identify enterprise vector point data that can accurately fall on the building roof;
[0092] S35. Eliminate enterprise vector point data that does not accurately fall on the building roof to eliminate positioning errors caused by spatial coordinate conversion errors or data offsets;
[0093] S4. Use a general large language model and batch scanning tools to identify and extract structured data from heterogeneous formats, and perform fusion comparison and data correction on the extracted results to obtain enterprise nitrogen and phosphorus emission permit data;
[0094] In step S4, the specific process of using the universal large language model to identify and extract structured data in heterogeneous formats is as follows:
[0095] S41A, identifying the image file and screening the content containing the target keyword;
[0096] S42A, set the root directory path where the image to be processed is located, and specify the supported image formats; the image formats include PNG, JPG, JPEG, BMP, WEBP, TIF and TIFF;
[0097] S43A, setting an output file path for saving the recognition result text, and defining a keyword set for screening; the keywords include total nitrogen, total phosphorus and ammonia nitrogen;
[0098] S44A, traverse all subfolders and image files under the root directory, for each image file that meets the format requirements, read the image content and convert it into Base64 encoding form, and construct a standard data URL format string;
[0099] S45A: Calling a language model interface with image recognition capabilities to submit a request including image data and a recognition instruction; the recognition instruction is used to extract water quality index information in a table in the image and limit the retention of only relevant row data containing keywords;
[0100] S46A. After obtaining the recognition results, the returned text content is parsed line by line to filter out lines containing the target keyword. If there is a line that meets the conditions, it is written to the output file together with the image path information; if there is no matching content, it is recorded as no relevant line is recognized;
[0101] S47A, set a fixed time interval between image recognition tasks, output a task completion prompt after all image processing is completed, and save all recognition results;
[0102] In step S4, the specific process of using the batch scanning tool to identify and extract structured data from heterogeneous formats is as follows:
[0103] S41B, Data organization and automatic traversal: Set the root directory for storing the images to be processed, and the system will automatically traverse all subfolders under this directory;
[0104] S42B, Optical Character Recognition Text Recognition and Preprocessing: Initialize the PaddleOCR tool library and enable the angle classification function to optimize the recognition of tilted text; process qualified images one by one and call the optical character recognition model for text recognition; the recognition results include text content, text box coordinates, and confidence level;
[0105] S43B, anomaly detection and error handling: if the optical character recognition result is empty or no text is detected, automatically record the image path and mark that no text is detected;
[0106] S44B. Result storage and output: Use a unified format to store optical character recognition results, including image path, text content, text box coordinates, and confidence level; save the results to a designated output text file, and use delimiters to distinguish recognition results for different images; and use an append write mode to ensure that processed results are not lost if the program is interrupted during long-term operation.
[0107] S45B, parsing the recognized text data: reading the text file storing the recognition result, parsing the image path, text content, text coordinates, and confidence level in the text file, and then storing the parsed data in a structured manner;
[0108] S46B, intelligent grouping by vertical coordinate: Use the image path as the primary key to segment data so that data from different images are not mixed; calculate the average vertical coordinate value of the text box and set the vertical coordinate tolerance threshold to determine whether the text belongs to the same row; use the proximity analysis method to automatically determine whether the recognized text belongs to the same visual row, and merge text with a distance less than the threshold into the same group;
[0109] S47B. Generate structured output: In the grouped data, retain the image path of each group of text for subsequent traceability; unify the storage method so that each group contains the text content, confidence score and corresponding image path of the text row, and generate a clear structured data table;
[0110] S5. Integrate the enterprise's attribute information, spatial characteristics, and enterprise nitrogen and phosphorus emission permit data, use machine learning methods to complete missing information, calculate the enterprise's nitrogen and phosphorus emission fluxes, and perform raster processing. The calculation formula is:
[0111] Enter the enterprise data to be tested, which is defined as follows: ,in, is enterprise data; X1 is the date of establishment; X2 is the registered capital; X3 is the enterprise category; SK is the one-hot encoded variable of industry size;
[0112] Use the trained random forest regression model to make predictions. The calculation formula is: ,in, is the predicted value of the final nitrogen and phosphorus pollutant emissions; M is the number of decision trees in the random forest regression model; m is the decision tree number; is the predicted output of the mth decision tree;
[0113] The three nitrogen and phosphorus discharge fluxes of total nitrogen, total phosphorus and ammonia nitrogen are mapped to the grid;
[0114] In step S5, the spatial feature is the location of the enterprise plot; the nitrogen and phosphorus discharge flux includes the total nitrogen discharge flux, the total phosphorus discharge flux and the ammonia nitrogen discharge flux;
[0115] The training steps of the random forest regression model in step S5 are:
[0116] S51. Data processing:
[0117] The date of incorporation is converted into the company's duration as of the scheduled date;
[0118] The industry scale variable is converted into an industry scale coefficient through a mapping function to enhance the impact of the categorical variable on the prediction results. The mapping function is defined as: ,in, is the industry scale coefficient; is the mapping function; C is the industry scale variable; f is the pollution emission coefficient corresponding to the industry in the Second National Pollution Source Census Bulletin;
[0119] The industry scale variable is converted into a one-hot encoding, and the conversion formula is: OHE(S)=
S1,S2,……,S K
[0120] The input data is standardized to make the order of magnitude of different eigenvalues consistent. The calculation formula is: , where x is the input data; μ is the mean of the enterprise's numerical characteristics; σ is the standard deviation of the enterprise's numerical characteristics;
[0121] Divide the standardized data into training set and test set;
[0122] S52. Use the training set data to train the random forest regression model, input 、 Calculate the predicted values of nitrogen and phosphorus pollutant emissions based on the enterprise's attribute information;
[0123] S53. Calculate the prediction mean square error using the test set data. The calculation formula is: , where MSE is the mean square error of prediction; N is the number of training samples; j is the sample number; y j is the true value of nitrogen and phosphorus pollutants; is the predicted value of nitrogen and phosphorus pollutants;
[0124] S54, decision tree splitting rule: In the process of building a decision tree, a subset of input features is randomly selected at each decision node as a candidate split feature to find the optimal feature x j And the corresponding threshold t, so that the error of the left and right subtrees is minimized, the optimization goal is defined as: ,in, is the total number of samples in the current node data set; and According to the optimal The number of samples contained in the left child node and the right child node after the split; and are the mean squared errors of samples in the left and right child nodes respectively.
[0125] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A method for calculating enterprise nitrogen and phosphorus discharge flux based on multi-source heterogeneous data fusion, characterized in that: The following steps are involved: S1. Collect attribute information from multiple sources of the enterprise and classify it uniformly according to industry standards; S2. Call multiple map APIs to obtain and standardize the enterprise's latitude and longitude coordinates to achieve the integration of attribute data and spatial location information; S3. Integrate multi-source spatial data and match it with enterprise location information to extract regional environmental characteristics; multi-source spatial data includes remote sensing image data, land use map data, and administrative division data; The specific process of step S3 is: S31. Obtain publicly available building rooftop data and convert the original coordinate system into the WGS84 coordinate system so that the building rooftop data and the enterprise latitude and longitude coordinate data use the same spatial reference system; S32. Load the converted building roof data and enterprise vector point data into ArcMap software and perform spatial matching processing using spatial overlay analysis tools; S33, using the point extraction grid value function to extract the roof grid value information corresponding to each enterprise vector point; S34, performing discriminant analysis on the extraction results to identify enterprise vector point data that can accurately fall on the building roof; S35. Eliminate enterprise vector point data that does not accurately fall on the building roof to eliminate positioning errors caused by spatial coordinate conversion errors or data offsets; S4. Use a general large language model and batch scanning tools to identify and extract structured data from heterogeneous formats, and perform fusion comparison and data correction on the extracted results to obtain enterprise nitrogen and phosphorus emission permit data; S5. Integrate the enterprise's attribute information, spatial characteristics, and enterprise nitrogen and phosphorus emission permit data, use machine learning methods to complete missing information, calculate the enterprise's nitrogen and phosphorus emission fluxes, and perform raster processing. The calculation formula is: Enter the enterprise data to be tested, which is defined as follows: ,in, is enterprise data; X1 is the date of establishment; X2 is the registered capital; X3 is the enterprise category; S K is the one-hot encoded variable of industry size; Use the trained random forest regression model to make predictions. The calculation formula is: ,in, is the predicted value of the final nitrogen and phosphorus pollutant emissions; M is the number of decision trees in the random forest regression model; m is the decision tree number; is the predicted output of the mth decision tree; The three nitrogen and phosphorus discharge fluxes of total nitrogen, total phosphorus and ammonia nitrogen are mapped to the grid.
2. The method for calculating enterprise nitrogen and phosphorus discharge fluxes based on multi-source heterogeneous data fusion according to claim 1, characterized in that: The attribute information described in step S1 includes company name, registration status, unified social credit code, legal representative, available telephone number, registered address, district and county, establishment date, approval date, industry classification, national standard industry category, national standard industry major category, national standard industry medium category, enterprise scale, registered capital, paid-in capital, business term, province, city, company type, former name, taxpayer identification number, registration number, organization code, number of insured persons, annual report to which the number of insured persons belongs, latest annual report address, mailing address, website, email address and business scope.
3. The method for calculating enterprise nitrogen and phosphorus discharge flux based on multi-source heterogeneous data fusion according to claim 1, characterized in that: The map API in step S2 includes Baidu Map API and Amap API. The specific process of obtaining and standardizing the longitude and latitude coordinates of the enterprise in step S2 is as follows: S21. Filtering coordinate data that is non-numeric or exceeds a normal range; S22. Convert the coordinates obtained from the map API into Martian coordinates using an offset correction method; S23. Convert the Martian coordinates into WGS84 coordinates through geographic transformation algorithm to obtain enterprise vector point data.
4. The method for calculating enterprise nitrogen and phosphorus discharge flux based on multi-source heterogeneous data fusion according to claim 1, characterized in that: In step S4, the specific process of using the universal large language model to identify and extract structured data in heterogeneous formats is as follows: S41A, identifying the image file and screening the content containing the target keyword; S42A, set the root directory path where the image to be processed is located, and specify the supported image formats; the image formats include PNG, JPG, JPEG, BMP, WEBP, TIF and TIFF; S43A, setting an output file path for saving the recognition result text, and defining a keyword set for screening; the keywords include total nitrogen, total phosphorus and ammonia nitrogen; S44A, traverse all subfolders and image files under the root directory, for each image file that meets the format requirements, read the image content and convert it into Base64 encoding form, and construct a standard data URL format string; S45A: Calling a language model interface with image recognition capabilities to submit a request including image data and a recognition instruction; the recognition instruction is used to extract water quality index information in a table in the image and limit the retention of only relevant row data containing keywords; S46A, after obtaining the recognition result, parse the returned text content line by line, filter out the lines containing the target keyword, and if there is a line that meets the conditions, write it together with the image path information into the output file; If there is no matching content, it is recorded as no relevant row is identified; S47A: Set a fixed time interval between image recognition tasks, output a task completion prompt after all image processing is completed, and save all recognition results.
5. The method for calculating enterprise nitrogen and phosphorus discharge flux based on multi-source heterogeneous data fusion according to claim 1, characterized in that: In step S4, the specific process of using the batch scanning tool to identify and extract structured data from heterogeneous formats is as follows: S41B, Data organization and automatic traversal: Set the root directory for storing the images to be processed, and the system will automatically traverse all subfolders under this directory; S42B, Optical Character Recognition Text Recognition and Preprocessing: Initialize the PaddleOCR tool library and enable the angle classification function to optimize the recognition of tilted text; process qualified images one by one and call the optical character recognition model for text recognition; the recognition results include text content, text box coordinates, and confidence level; S43B, anomaly detection and error handling: if the optical character recognition result is empty or no text is detected, automatically record the image path and mark that no text is detected; S44B. Result storage and output: Use a unified format to store optical character recognition results, including image path, text content, text box coordinates, and confidence level; save the results to a designated output text file, and use delimiters to distinguish recognition results for different images; and use an append write mode to ensure that processed results are not lost if the program is interrupted during long-term operation. S45B, parsing the recognized text data: reading the text file storing the recognition result, parsing the image path, text content, text coordinates, and confidence level in the text file, and then storing the parsed data in a structured manner; S46B, Intelligent grouping by vertical coordinate: Use the image path as the primary key to segment the data so that data from different images are not mixed; Calculate the average vertical coordinate value of the text box and set the vertical coordinate tolerance threshold to determine whether the text belongs to the same line; Through the proximity analysis method, it automatically determines whether the recognized texts belong to the same visual line, and merges the texts with a distance less than a threshold into the same group; S47B. Generate structured output: In the grouped data, retain the image path of each group of text for subsequent tracing; unify the storage method so that each group contains the text content, confidence score and corresponding image path of the row of text, and generate a clear structured data table.
6. The method for calculating enterprise nitrogen and phosphorus discharge flux based on multi-source heterogeneous data fusion according to claim 1, characterized in that: In step S5, the spatial feature is the location of the enterprise plot; the nitrogen and phosphorus emission fluxes include total nitrogen emission flux, total phosphorus emission flux and ammonia nitrogen emission flux.
7. The method for calculating enterprise nitrogen and phosphorus discharge flux based on multi-source heterogeneous data fusion according to claim 1, characterized in that: The training steps of the random forest regression model in step S5 are: S51. Data processing: The date of incorporation is converted into the company's duration as of the scheduled date; The industry scale variable is converted into an industry scale coefficient through a mapping function to enhance the impact of the categorical variable on the prediction results. The mapping function is defined as: ,in, is the industry scale coefficient; is the mapping function; C is the industry scale variable; f is the pollution emission coefficient corresponding to the industry in the Second National Pollution Source Census Bulletin; The industry scale variable is converted into a one-hot encoding, and the conversion formula is: OHE(S)=[S1,S2,……,S K ], , ,in, is the one-hot encoding conversion result; S1, S2, ..., S K is the one-hot encoding variable of the first k industry sizes; S i =1 indicates that the enterprise belongs to the i-th industry scale; S i =0 means the enterprise does not belong to the corresponding category; i is the enterprise number; k is the specific enterprise size, including large, medium, small and micro; The input data is standardized to make the order of magnitude of different eigenvalues consistent. The calculation formula is: , where x is the input data; μ is the mean of the enterprise's numerical characteristics; σ is the standard deviation of the enterprise's numerical characteristics; Divide the standardized data into training set and test set; S52. Use the training set data to train the random forest regression model, input 、 Calculate the predicted values of nitrogen and phosphorus pollutant emissions based on the enterprise's attribute information; S53. Calculate the prediction mean square error using the test set data. The calculation formula is: , where MSE is the mean square error of prediction; N is the number of training samples; j is the sample number; y j is the true value of nitrogen and phosphorus pollutants; is the predicted value of nitrogen and phosphorus pollutants; S54, decision tree splitting rule: In the process of building a decision tree, a subset of input features is randomly selected at each decision node as a candidate split feature to find the optimal feature x j And the corresponding threshold t, so that the error of the left and right subtrees is minimized, the optimization goal is defined as: ,in, is the total number of samples in the current node data set; and According to the optimal The number of samples contained in the left child node and the right child node after the split; and are the mean squared errors of samples in the left and right child nodes respectively.
Citation Information
Patent Citations
Steel industry carbon emission monitoring method based on electric power data driving
CN117689078A
Regional energy carbon emission rapid accounting method based on space-time correlation
CN119006013A