Prediction method, training method, device, electronic device and storage medium
By combining the Kriging interpolation model and the deep learning model, the air quality prediction method is optimized, which solves the problem of insufficient prediction accuracy of the traditional model and achieves higher-precision air quality prediction.
Patent Information
- Application Number
- CN202210348989.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-01
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2042-04-01
AI Technical Summary
The traditional Kriging interpolation model is less effective in predicting the spatial distribution of regional air pollutants and is inconsistent with the mechanism of air pollution, resulting in insufficient prediction accuracy.
Combining the Kriging interpolation model and the deep learning model, time series data is generated by preprocessing pollutant and meteorological data. The deep learning model is then used to optimize the semivariogram function of the Kriging interpolation model, taking into account the time dependence of pollutants and meteorological factors, thereby improving prediction accuracy.
It improves the accuracy of air quality prediction, can better express the regional atmospheric pollution transmission mechanism, and combines spatial physical properties to achieve more accurate air quality prediction.
Smart Images

Figure CN114819289B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of environment, and in particular to an air quality prediction method, a prediction device, a training method for an air quality prediction model, an electronic device, and a computer-readable storage medium. Background Art
[0002] Representing the spatial distribution of regional atmospheric pollutants is crucial for studying and controlling large-scale atmospheric pollution. Among related technologies, Kriging interpolation models are widely used to predict the spatial distribution of atmospheric pollution. However, due to the complexity of atmospheric turbulence, traditional Kriging interpolation models perform poorly in this application. Furthermore, the core algorithm is inconsistent with the mechanisms of atmospheric pollution. Therefore, improving the accuracy of regional spatial distribution predictions of atmospheric pollutants has become an urgent issue. Summary of the Invention
[0003] In view of this, the present application provides an air quality prediction method, a prediction device, an air quality prediction model training method, an electronic device, and a non-volatile computer-readable storage medium.
[0004] The air quality prediction method of the embodiment of the present application includes:
[0005] Obtain pollutant data and meteorological data for multiple monitoring points within a predetermined area during a predetermined time period;
[0006] Preprocessing the pollutant data and meteorological data to generate pollutant time series data and meteorological time series data;
[0007] The pollutant time series data and the meteorological time series data are processed by an air quality prediction model to obtain a prediction result for a target monitoring point in a target time period; the air quality prediction model includes a Kriging interpolation model and a deep learning model.
[0008] In certain embodiments, the processing of the time series data using an air quality prediction model to obtain a prediction result for a target monitoring point in a target time period includes:
[0009] Obtaining pollutant prediction data for each monitoring point based on the pollutant time series data using the Kriging interpolation model;
[0010] Calculating an error sequence based on the pollutant prediction data and the pollutant time series data;
[0011] Inputting the error sequence, the meteorological time series data, and the pollutant time series data of the target monitoring point into the deep learning model for processing to obtain a semivariance matrix;
[0012] The semivariance matrix is used as a fitting result of the semivariance function of the Kriging interpolation model to calculate the prediction result of the target monitoring point based on the pollutant time series data.
[0013] In certain embodiments, the preprocessing of the pollutant data and the meteorological data to generate pollutant time series data and meteorological time series data includes:
[0014] Deleting the pollutant data, erroneous data and missing data for the entire day in the meteorological data respectively;
[0015] Filling in locally missing data using the average values of the pollutant data and the meteorological data respectively; and
[0016] The Laida criterion is used to eliminate abnormal data in the pollutant data and the meteorological data, respectively, to obtain the pollutant time series data and the meteorological time series data.
[0017] In certain embodiments, before the time series data and the meteorological time series data are processed by the air quality prediction model to obtain the prediction result of the target monitoring point in the target time period, the air quality prediction method further includes:
[0018] Normalize the pollutant time series data and the meteorological time series data.
[0019] In certain embodiments, the meteorological data includes atmospheric temperature, humidity, wind speed, air pressure, rainfall, and wind direction.
[0020] In certain embodiments, the pollutants include at least one of PM2.5, O3, CO, PM10, SO2, and NO2.
[0021] The training method of the air quality prediction model in the embodiment of the present application is used to train the above-mentioned air quality prediction model, and the training method includes:
[0022] Obtain historical pollutant data and historical meteorological data collected from multiple monitoring points;
[0023] Performing Kriging interpolation calculation on the historical pollutant data using the original Kriging interpolation model to obtain historical pollutant prediction data;
[0024] Calculating a historical error sequence based on the historical pollutant data and the historical pollutant prediction data;
[0025] Training a recurrent neural network based on the historical pollutant data, the historical meteorological data, and the historical error sequence to obtain the deep learning model;
[0026] Using the deep learning model as the semivariogram function of the original Kriging interpolation model to obtain a Kriging interpolation optimization model;
[0027] The Kriging interpolation optimization model is trained according to the historical pollutant data and historical meteorological data to obtain the air quality prediction model.
[0028] In certain embodiments, the training of the Kriging interpolation optimization model based on the historical pollutant data and the historical meteorological data to obtain the air quality prediction model includes:
[0029] dividing the historical pollutant data and the historical meteorological data into training samples and verification samples;
[0030] Using the training samples to train the Kriging interpolation optimization model to obtain historical prediction results;
[0031] According to the verification samples and the historical prediction results, hyperparameters such as the time step and the number of neurons in each layer in the deep learning model are adjusted and optimized to obtain the trained air quality prediction model.
[0032] The air quality prediction device of the embodiment of the present application includes:
[0033] An acquisition module, used to obtain pollutant data and meteorological data at multiple monitoring points in a predetermined area during a predetermined time period;
[0034] A preprocessing module, configured to preprocess the pollutant data and meteorological data to generate pollutant time series data and meteorological time series data;
[0035] The prediction module processes the pollutant time series data and the meteorological time series data through an air quality prediction model to obtain a prediction result for a target monitoring point in a target time period; the air quality prediction model includes a Kriging interpolation model and a deep learning model.
[0036] The electronic device of the embodiment of the present application includes a processor and a memory; the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the air quality prediction method and the air quality prediction model training method.
[0037] The non-volatile computer-readable storage medium of an embodiment of the present application includes a computer program. When the computer program is executed by the processor, the processor executes the air quality prediction method and the air quality prediction model training method.
[0038] In the air quality prediction method, prediction device, training method, electronic device and computer-readable storage medium of the embodiments of the present application, pollutant data and meteorological data of multiple monitoring points in a predetermined area in a predetermined time period are obtained and pre-processed, and then input into the air quality prediction model for processing to obtain the air quality prediction results of the target monitoring point in the target time period. In this way, not only the time dependence of pollutants is taken into account, but also meteorological, geographical and other factors are taken into account, the regional atmospheric pollution transmission mechanism is expressed, and the spatial physical properties and Kriging interpolation are more perfectly combined, so that the obtained air quality prediction results are more accurate, thereby improving the prediction accuracy of air quality.
[0039] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become obvious from the description below, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0041] Figure 1 is a flow chart of a method for predicting air quality in certain embodiments of the present application;
[0042] Figure 2 This is a schematic diagram of a module of an air quality prediction device according to certain embodiments of the present application;
[0043] Figure 3 Schematic diagram of a scenario of an air quality prediction method according to certain embodiments of the present application;
[0044] Figure 4-6 is a flow chart of a method for predicting air quality in certain embodiments of the present application;
[0045] Figure 7 is a flowchart of a method for training an air quality prediction model according to certain embodiments of the present application;
[0046] Figure 8 Schematic diagram of a module of a training device for an air quality prediction model according to certain embodiments of the present application;
[0047] Figure 9 It is a flowchart of a training method for an air quality prediction model in certain embodiments of the present application. DETAILED DESCRIPTION
[0048] The following describes in detail embodiments of the present application. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0049] See also Figure 1 , this application provides an air quality prediction method, comprising:
[0050] 01. Obtain pollutant data and meteorological data from multiple monitoring points within a predetermined area during a predetermined time period;
[0051] 02. Preprocess pollutant data and meteorological data to generate pollutant time series data and meteorological time series data;
[0052] 03. The pollutant time series data and meteorological time series data are processed through the air quality prediction model to obtain the prediction results of the target monitoring point in the target time period; the air quality prediction model includes the Kriging interpolation model and the deep learning model.
[0053] See also Figure 2 The embodiment of the present application provides an air quality prediction device 100. The prediction device 100 includes an acquisition module 110, a pre-processing module 120 and a prediction module 130.
[0054] Among them, step 01 can be implemented by the acquisition module 110, step 02 can be implemented by the preprocessing module 120, and step 03 can be implemented by the prediction module 130. In other words, the acquisition module 110 can be used to obtain pollutant data and meteorological data for multiple monitoring points in a predetermined area during a predetermined time period. The preprocessing module 120 can be used to preprocess the pollutant data and meteorological data to generate pollutant time series data and meteorological time series data; the prediction module 130 can be used to process the pollutant time series data and meteorological time series data using an air quality prediction model to obtain prediction results for the target monitoring point during the target time period; the air quality prediction model includes a Kriging interpolation model and a deep learning model.
[0055] The present application also provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor implements the above-mentioned air quality prediction method. That is, the processor is configured to obtain pollutant data and meteorological data from multiple monitoring points within a predetermined area during a predetermined time period, pre-process the pollutant data and meteorological data to generate pollutant time series data and meteorological time series data, and process the pollutant time series data and meteorological time series data using an air quality prediction model to obtain a prediction result for a target monitoring point during a target time period; the air quality prediction model includes a Kriging interpolation model and a deep learning model.
[0056] In the air quality prediction method, prediction device 100 and electronic device of the present application, pollutant data and meteorological data of multiple monitoring points in a predetermined area in a predetermined time period are obtained and pre-processed, and then input into the air quality prediction model for processing to obtain the air quality prediction results of the target monitoring point in the target time period. In this way, not only the time dependence of pollutants is taken into account, but also meteorological, geographical and other factors are taken into account, the regional atmospheric pollution transmission mechanism is expressed, and the spatial physical properties and Kriging interpolation are more perfectly combined, so that the obtained air quality prediction results are more accurate, thereby improving the prediction accuracy of air quality.
[0057] In some implementations, the prediction device 100 may be a part of an electronic device. In other words, the electronic device includes the prediction device 100 .
[0058] In some embodiments, the prediction device 100 may be discrete components assembled in a certain manner to have the aforementioned functions, or a chip in the form of an integrated circuit having the aforementioned functions, or a computer software code segment that enables the computer to have the aforementioned functions when running on the computer.
[0059] In some embodiments, the prediction device 100 may be a standalone hardware component or an additional peripheral component added to an electronic device. The prediction device 100 may also be integrated into the electronic device. For example, when the prediction device 100 is part of the electronic device, the prediction device 100 may be integrated into a processor.
[0060] It should be noted that different monitoring points are distributed at different locations in the predetermined area. The monitoring points can continuously monitor pollutant data and meteorological data online. The target monitoring point can be any one of the multiple monitoring points.
[0061] Meteorological data includes but is not limited to atmospheric temperature, humidity, wind speed, air pressure, rainfall and wind direction. Pollutant data includes at least one of PM2.5, O3, CO, PM10, SO2 and NO2. For example, in some examples, the pollutant data only includes PM2.5, that is, the PM2.5 value of the target monitoring point in the target time period is predicted by obtaining the PM2.5 of multiple monitoring points in a predetermined time period. For another example, if the pollutant data includes PM2.5 and O3, the PM2.5 value and O3 value of the target monitoring point in the target time period can be predicted respectively by obtaining the PM2.5 and O3 of multiple monitoring points in the predetermined time period.
[0062] Time series data refers to data arranged in time sequence. For example, pollutant time series data refers to data including multiple pollutant data, and the multiple pollutant data are arranged in time sequence.
[0063] The scheduled time period and the target time period are adjacent time periods. For example, the scheduled time period is the time period from 0:00 to 12:00 on a certain day, and the target time period is the time period from 12:00 to 14:00 on the same day. For another example, the scheduled time period is the time period from January to March this year, and the target time period is the time period during April.
[0064] It should also be noted that the deep learning model is trained using a recurrent neural network (RNN). An RNN is a type of recursive neural network that takes sequence data as input, performs recursion in the direction of the sequence's evolution, and has all nodes (recurrent units) connected in a chain-like fashion. In this embodiment, the RNN can be a long short-term memory (LSTM) network. In other words, the deep learning model is trained using an LSTM network.
[0065] Kriging interpolation models are generated using the Kriging method, a regression algorithm that uses a covariance function to spatially model and predict (interpolate) random processes or fields. For certain random processes, such as intrinsically stationary processes, Kriging can provide a Best Linear Unbiased Prediction (BLUP), hence its name in geostatistics as a spatial BLUP.
[0066] For example, please combine Figure 3In some embodiments, to verify the predictive performance of the air quality prediction method of the present application, the air quality prediction method of the present application is used to predict the predicted PM2.5 concentration value at a target monitoring point within 250 hours, and the predicted PM2.5 concentration value is compared with the actual PM2.5 concentration value monitored at the target monitoring point. It can be concluded that within 250 hours, the predicted PM2.5 concentration value at the target monitoring point shows a consistent trend with the actual concentration value. Therefore, the air quality prediction method of the present application has good predictive performance.
[0067] See also Figure 4 In some embodiments, sub-step 03 includes the sub-steps of:
[0068] 031, obtain the pollutant prediction data of each monitoring point based on the pollutant time series data through the Kriging interpolation model;
[0069] 032, calculate the error sequence based on the pollutant prediction data and the pollutant time series data;
[0070] 033, the error sequence, meteorological time series data, and pollutant time series data of the target monitoring point are input into the deep learning model for processing to obtain the semivariance matrix;
[0071] 034, the semivariance matrix is used as the fitting result of the semivariance function of the Kriging interpolation model to calculate the prediction results of the target monitoring points based on the pollutant time series data.
[0072] Please further combine Figure 2 In some embodiments, sub-steps 031-034 can be implemented by the prediction module 130. In other words, the prediction module 130 can be used to obtain pollutant prediction data for each monitoring point based on the pollutant time series data using a Kriging interpolation model, calculate an error series based on the pollutant prediction data and the pollutant data; input the error series, meteorological time series data, and pollutant time series data of the target monitoring point into a deep learning model for processing to obtain a semivariance matrix; and use the semivariance matrix as the fitting result of the semivariance function of the Kriging interpolation model to calculate the prediction result of the target monitoring point based on the pollutant time series data.
[0073] In some embodiments, the processor can be used to obtain pollutant prediction data for each monitoring point based on the pollutant time series data through a Kriging interpolation model, and calculate an error sequence based on the pollutant prediction data and the pollutant data; input the error sequence as well as the meteorological time series data and the pollutant time series data of the target monitoring point into a deep learning model for processing to obtain a semi-variance matrix, and use the semi-variance matrix as the fitting result of the semi-variance function of the Kriging interpolation model to calculate the prediction result of the target monitoring point based on the pollutant time series data.
[0074] It should be noted that, in sub-step 031, the pollutant prediction data is also time series data, that is, the pollutant prediction data includes multiple and corresponds to the pollutant time series data.
[0075] Specifically, the Kriging interpolation model includes the Kriging basic equation:
[0076] (1)
[0077] in, Yes The true value of Yes The evaluation value at , It is the satisfaction point The estimated value at and the true value The optimal set of coefficients with the smallest difference.
[0078] It should be noted that the weight coefficient The calculation formula is:
[0079] (2)
[0080] This application can obtain pollutant prediction data for each monitoring point based on pollutant time series data through the Kriging basic equation.
[0081] After obtaining the pollutant prediction data, the error sequence can be calculated based on the pollutant prediction data and pollutant time series data through the error calculation formula ; Among them, the error sequence The calculation formula is:
[0082] (3)
[0083] According to the unbiased constraint, Error sequence Calculation formula:
[0084] (4)
[0085] Furthermore, when we get the error sequence Finally, the meteorological time series data (such as temperature, humidity, air pressure, wind speed, wind direction, etc.), pollutant time series data and error sequence at different times in the predetermined time period are arranged in chronological order, and then the time series data, pollutant time series data and error sequence are spliced to obtain the input sequence Then input the sequence Input into the deep learning model for processing to obtain the semi-variance matrix;
[0086] Finally, the semivariance matrix is used as the fitting result of the semivariance function of the Kriging interpolation model, and then the Kriging interpolation calculation is performed again based on the pollutant time series data with the semivariance matrix as the fitting result to obtain the prediction results of the target monitoring point within the target time period.
[0087] See also Figure 5 In some embodiments, step 02 includes:
[0088] 021, delete the erroneous data and missing data of the whole day in the pollutant data and meteorological data respectively;
[0089] 022, using the average values of pollutant data and meteorological data to fill in the local missing data; and
[0090] 023, the Raida criterion is used to eliminate abnormal data in pollutant data and meteorological data to obtain pollutant time series data and meteorological time series data.
[0091] Please combine Figure 2 In some embodiments, sub-steps 021-023 can be implemented by the pre-processing module 120. In other words, the pre-processing module 120 can be used to delete erroneous data and missing data for the entire day in the pollutant data and meteorological data, fill in locally missing data with the average values of the pollutant data and meteorological data, and eliminate abnormal data in the pollutant data and meteorological data using the Laida criterion, so as to obtain pollutant time series data and meteorological time series data.
[0092] In some embodiments, the processor is used to delete erroneous data and missing data for the entire day in pollutant data and meteorological data, and to fill in locally missing data using the average values of pollutant data and meteorological data, and to use the Laida criterion to eliminate abnormal data in pollutant data and meteorological data, so as to obtain pollutant time series data and meteorological time series data.
[0093] In this way, by preprocessing the pollutant data and meteorological data by deleting, filling, and eliminating anomalies, the prediction results obtained based on the pollutant time series data and meteorological time series data obtained after preprocessing are more accurate, thereby effectively improving the prediction accuracy.
[0094] Please combine Figure 6 In some embodiments, before step 03, the air quality prediction method further includes:
[0095] 05, normalized pollutant time series data and meteorological time series data.
[0096] In some embodiments, step 05 may be implemented by the pre-processing module 120. In other words, the pre-processing module 120 may be used to normalize the pollutant time series data and the meteorological time series data.
[0097] In certain embodiments, the processor may be configured to normalize the pollutant time series data and the meteorological time series data.
[0098] In this embodiment, linear function normalization (Min-Max Scaling) can be used to normalize pollutant time series data and meteorological time series data. It should be noted that Min-Max is a linear transformation of the original data so that the result is mapped to the range of [0, 1], thereby achieving geometric scaling of the original data.
[0099] The Min-Max normalization process is as follows:
[0100] (twenty one)
[0101] in, To monitor data, is the minimum value in the original monitoring data (pollutant time series data and meteorological time series data), is the maximum value in the original monitoring data, The monitoring data after normalization.
[0102] In this way, inputting the normalized pollutant time series data and meteorological time series data into the air quality prediction model can improve the prediction accuracy of the error prediction model, thereby obtaining more accurate prediction results.
[0103] Please combine Figure 7 The present application also provides a method for training an air quality prediction model, which is used to train the air quality prediction model of the above prediction method. The training method includes:
[0104] 11. Obtain historical pollutant data and historical meteorological data collected from multiple monitoring points;
[0105] 12. Perform Kriging interpolation calculation on historical pollutant data using the original Kriging interpolation model to obtain historical pollutant prediction data;
[0106] 13. Calculate the historical error series based on historical pollutant data and historical pollutant forecast data;
[0107] 14. Train a recurrent neural network based on historical pollutant data, historical meteorological data, and historical error sequences to obtain a deep learning model;
[0108] 15. The deep learning model is used as the semivariogram function of the original Kriging interpolation model to obtain the Kriging interpolation optimization model;
[0109] 16. The Kriging interpolation optimization model is trained based on historical pollutant data and historical meteorological data to obtain an air quality prediction model.
[0110] Please combine Figure 8 The present application also provides an air quality prediction model training device 200. The training device 200 may include an acquisition module 210, an interpolation calculation module 220, an error calculation module 230, a first training module 240, a replacement module 250, and a second training module 260. Step 11 may be implemented by the acquisition module 210, step 12 may be implemented by the interpolation calculation module 220, step 13 may be implemented by the error calculation module 230, step 14 may be implemented by the first training module 240, and step 15 may be implemented by the replacement module 250. Step 16 may be implemented by the second training module 260.
[0111] In other words, the acquisition module 210 can be used to obtain historical pollutant data and historical meteorological data collected from multiple monitoring points, the interpolation calculation module 220 can be used to perform Kriging interpolation calculation on the historical pollutant data through the original Kriging interpolation model to obtain historical pollutant prediction data; the error calculation module 230 can be used to calculate the historical error sequence based on the historical pollutant data and the historical pollutant prediction data; the first training module 240 can be used to train the neural network based on the historical pollutant data, historical meteorological data and historical error sequence to obtain a deep learning model; the replacement module 250 can be used to use the deep learning model as the semi-variance function of the original Kriging interpolation model to obtain a Kriging interpolation optimization model; the second training module 260 can be used to train the Kriging interpolation optimization model based on the historical pollutant data and historical meteorological data to obtain an air quality prediction model.
[0112] The present application also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program. When the computer program is executed by the processor, the processor implements the above-mentioned air quality prediction model training method. That is, the processor is used to obtain historical pollutant data and historical meteorological data collected by multiple monitoring points, and perform Kriging interpolation calculations on the historical pollutant data using the original Kriging interpolation model to obtain historical pollutant prediction data; and calculate a historical error sequence based on the historical pollutant data and the historical pollutant prediction data; the processor can also be used to train a neural network based on the historical pollutant data, historical meteorological data, and historical error sequence to obtain a deep learning model; and use the deep learning model as the semivariogram function of the original Kriging interpolation model to obtain a Kriging interpolation optimization model; finally, the Kriging interpolation optimization model is trained based on the historical pollutant data and historical meteorological data to obtain an air quality prediction model.
[0113] In the training method, training device and electronic device of the air quality prediction model of the present application, the deep learning model obtained by the recurrent neural network is used as the semi-variance function of the original Kriging interpolation model to obtain the Kriging interpolation optimization model, and the Kriging interpolation optimization model is trained by the historical pollutant data and historical meteorological data to obtain the air quality prediction model. Thus, the trained air quality prediction model can be used to predict the air quality of the target monitoring point based on the collected pollutant data and meteorological data, thereby obtaining the air quality prediction result. In this way, not only the time dependence of the pollutants is taken into account, but also meteorological, geographical and other factors are taken into account, the regional atmospheric pollution transmission mechanism is expressed, and the spatial physical properties and Kriging interpolation are more perfectly combined, so that the prediction result is more accurate, thereby improving the accuracy of the air quality prediction result.
[0114] Please combine Figure 9 In some embodiments, step 16 includes:
[0115] 161, historical pollutant data and historical meteorological data are divided into training samples and validation samples;
[0116] 162, using training samples to train the Kriging interpolation optimization model to obtain historical prediction results;
[0117] 163. Based on the validation samples and historical prediction results, the hyperparameters such as the time step and the number of neurons in each layer in the deep learning model are adjusted and optimized to obtain a trained air quality prediction model.
[0118] Please further combine Figure 8 In some embodiments, sub-steps 161-163 may be implemented by a second training module 260. In other words, the second training module 260 may be configured to divide historical pollutant data and historical meteorological data into training samples and validation samples, and to train a kriging interpolation optimization model using the training samples to obtain historical prediction results. Furthermore, the second training module 260 may be configured to optimize hyperparameters such as the time step and the number of neurons per layer in the deep learning model based on the validation samples and historical prediction results to obtain a trained air quality prediction model.
[0119] In certain embodiments, historical pollutant data and historical meteorological data are divided into training samples and validation samples, and the training samples are used to train the Kriging interpolation optimization model to obtain historical prediction results. The hyperparameters such as the time step and the number of neurons per layer in the deep learning model are adjusted and optimized based on the validation samples and historical prediction results to obtain a trained air quality prediction model.
[0120] In sub-step 161, the historical pollutant data and historical meteorological data can be divided into training samples and validation samples according to the time sequence. For example, among the historical pollutant data and historical meteorological data collected from multiple monitoring points from January to March, the historical pollutant data and historical meteorological data collected from January to February can be used as training samples, and the historical pollutant data and historical meteorological data collected in March can be used as validation samples.
[0121] In substep 162, the kriging interpolation optimization model is trained in mini-batches, with a batch size of 50, and all models are trained for 100 iterations. The designed model's hyperparameters primarily focus on the number of neurons and the time_step parameter. During model training, the input layer has 11 neurons, and the output layer has one neuron representing each predictor variable. The dropout probability between layers is set to 0.2 to prevent overfitting. The number of neurons is selected from the candidate set {16, 32, 64, 128, 256}.
[0122] In sub-step 163, a grid search method can be used to adjust and optimize hyperparameters such as the time step and the number of neurons in each layer in the deep learning model in the Kriging interpolation optimization model based on the verification samples and historical prediction results to obtain a trained air quality prediction model.
[0123] An embodiment of the present application also provides a non-volatile computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor executes the above-mentioned air quality prediction method or the above-mentioned air quality prediction model training method.
[0124] In the above embodiments, all or part of the embodiments can be implemented using software, hardware, firmware, or any other combination. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer, or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital video disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0125] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0126] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0127] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0128] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application 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 this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A method for predicting air quality, characterized in that: The air quality prediction method includes: Obtaining pollutant data and meteorological data for a predetermined time period at a plurality of monitoring points within a predetermined area, wherein the meteorological data includes atmospheric temperature, humidity, wind speed, air pressure, rainfall, and wind direction; Preprocessing the pollutant data and meteorological data to generate pollutant time series data and meteorological time series data; The pollutant time series data and the meteorological time series data are processed by an air quality prediction model to obtain a prediction result for a target monitoring point in a target time period; the air quality prediction model includes a Kriging interpolation model and a deep learning model, and the deep learning model is obtained by training a long short-term memory network (LSTM); and includes: The pollutant prediction data of each monitoring point is obtained according to the pollutant time series data through the Kriging interpolation model; an error sequence is calculated according to the pollutant prediction data and the pollutant time series data; the error sequence, the meteorological time series data, and the pollutant time series data of the target monitoring point are input into the deep learning model for processing to obtain a semivariance matrix; the semivariance matrix is used as the fitting result of the semivariance function of the Kriging interpolation model, and the Kriging interpolation calculation is re-performed according to the pollutant time series data with the semivariance matrix as the fitting result to obtain the prediction result of the target monitoring point within the target time period.
2. The prediction method according to claim 1, characterized in that The preprocessing of the pollutant data and the meteorological data to generate pollutant time series data and meteorological time series data includes: Deleting the pollutant data, erroneous data and missing data for the entire day in the meteorological data respectively; Filling in locally missing data using the average values of the pollutant data and the meteorological data respectively; and The Laida criterion is used to eliminate abnormal data in the pollutant data and the meteorological data, respectively, to obtain the pollutant time series data and the meteorological time series data.
3. The prediction method according to claim 1, wherein: Before the air quality prediction model is used to process the time series data and the meteorological time series data to obtain the prediction result of the target monitoring point in the target time period, the air quality prediction method further includes: Normalize the pollutant time series data and the meteorological time series data.
4. The prediction method according to claim 1, wherein: The pollutant data includes at least one of PM2.5, O3, CO, PM10, SO2 and NO2.
5. A method for training an air quality prediction model, for training an air quality prediction model according to any one of claims 1 to 4, characterized in that: The training method comprises: Obtain historical pollutant data and historical meteorological data collected from multiple monitoring points; Performing Kriging interpolation calculation on the historical pollutant data using the original Kriging interpolation model to obtain historical pollutant prediction data; Calculating a historical error sequence based on the historical pollutant data and the historical pollutant prediction data; Training a recurrent neural network based on the historical pollutant data, the historical meteorological data, and the historical error sequence to obtain the deep learning model, wherein the recurrent neural network is a long short-term memory network; Using the deep learning model as the semivariogram function of the original Kriging interpolation model to obtain a Kriging interpolation optimization model; The Kriging interpolation optimization model is trained according to the historical pollutant data and historical meteorological data to obtain the air quality prediction model.
6. The training method according to claim 5, characterized in that The step of training the Kriging interpolation optimization model based on the historical pollutant data and the historical meteorological data to obtain the air quality prediction model includes: dividing the historical pollutant data and the historical meteorological data into training samples and verification samples; Using the training samples to train the Kriging interpolation optimization model to obtain historical prediction results; The time step and the number of neurons in each layer hyperparameters in the deep learning model are adjusted and optimized according to the verification sample and the historical prediction results to obtain the trained air quality prediction model.
7. An air quality prediction device, characterized in that: The prediction device comprises: An acquisition module is used to acquire pollutant data and meteorological data at multiple monitoring points in a predetermined area during a predetermined time period, wherein the meteorological data includes atmospheric temperature, humidity, wind speed, air pressure, rainfall, and wind direction; A preprocessing module, configured to preprocess the pollutant data and meteorological data to generate pollutant time series data and meteorological time series data; A prediction module processes the pollutant time series data and the meteorological time series data through an air quality prediction model to obtain a prediction result of a target monitoring point in a target time period; the air quality prediction model includes a Kriging interpolation model and a deep learning model, and the deep learning model is obtained by training a long short-term memory network LSTM, including: obtaining pollutant prediction data of each monitoring point according to the pollutant time series data through the Kriging interpolation model; calculating an error sequence according to the pollutant prediction data and the pollutant time series data; inputting the error sequence and the meteorological time series data and the pollutant time series data of the target monitoring point into the deep learning model for processing to obtain a semivariance matrix; using the semivariance matrix as the fitting result of the semivariance function of the Kriging interpolation model, and re-performing Kriging interpolation calculation based on the pollutant time series data with the semivariance matrix as the fitting result to obtain a prediction result of the target monitoring point in the target time period.
8. An electronic device, characterized in that: It includes a processor and a memory, the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the air quality prediction method described in any one of claims 1 to 4 and the training method of the air quality prediction model described in any one of 5 to 6.
9. A readable storage medium containing a computer program, characterized in that When the computer program is executed by a processor, the processor executes the air quality prediction method according to any one of claims 1 to 4 and the air quality prediction model training method according to any one of claims 5 to 6.
Citation Information
Patent Citations
Air quality index prediction method based on spatial and temporal distribution characteristics
CN104850734A
Atmospheric environment data prediction method, system and device and storage medium
CN112529240A
Air quality index prediction method and device, terminal and storage medium
CN113887815A