Urban pollutant tracking prediction method and system based on big data

Through the big data-based urban pollutant tracking and prediction method, combined with the XGBoost model and the gray wolf optimization algorithm, the problem of inaccurate pollutant concentration prediction in the existing technology is solved, and a comprehensive range of pollutants of urban pollutants is achieved. Detection and prediction improve prediction accuracy and provide a scientific basis for environmental protection.

CN119004292AInactive Publication Date: 2024-11-22SHANGHAI JIUWEI ENVIRONMENTAL PROTECTION TECHNOLOGY CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411062210.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-05
Publication Date
2024-11-22
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing technology is difficult to track and accurately predict urban pollutant concentrations in real time, resulting in environmental impacts and health hazards. The factors affecting pollutant concentrations are complex and difficult to comprehensively consider.

Method used

Using the urban pollutant tracking and prediction method based on big data, the urban pollutant species set and influencing factor set are set, data is collected in real time, preprocessing and correlation calculation are carried out, XGBoost model is constructed for prediction, and the gray wolf optimization algorithm is adjusted. Model parameters to improve prediction accuracy.

Benefits of technology

Comprehensive detection and prediction of various urban pollutants is achieved, comprehensive prediction is carried out in combination with influencing factors, and prediction accuracy is improved, providing a basis for taking protective measures in advance, and the prediction effect of the XGBoost model is optimized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119004292A_ABST
    Figure CN119004292A_ABST
Patent Text Reader

Abstract

The invention discloses an urban pollutant tracking prediction method and system based on big data, and relates to the field of pollutant prediction management. The system comprises an urban pollutant concentration data acquisition module, an influence factor occurrence degree parameter data acquisition module, a correlation calculation module and an urban pollutant concentration prediction module. The primary prediction parameter adjusting module and the secondary prediction parameter adjusting module are used for acquiring data corresponding to the types of the urban pollutants and analyzing the data so as to comprehensively detect and predict the various urban pollutants, so that comprehensive environmental protection of a city can be realized; meanwhile, the influence degree of the pollutant concentration influence factors on the pollutant concentration is also considered, the pollutant type concentration data is predicted, comprehensive prediction is also carried out in combination with correlation, prediction is more accurate, and therefore control and protection measures can be taken in advance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of pollutant prediction management, and in particular, relates to a method and system for tracking and predicting urban pollutants based on big data. Background Art

[0002] Urban pollutants refer to various pollutants present in the urban environment, including gases, solids and liquids; these pollutants can come from industrial emissions, traffic exhaust, household waste, domestic sewage, construction activities, etc.; common urban pollutants include but are not limited to the following categories: air pollutants: such as carbon dioxide (CO2), sulfur dioxide (SO2), nitrogen oxides (NOx), carbon monoxide (CO), ozone (O3), particulate matter (PM2.5, PM10), etc.; water pollutants: such as industrial wastewater, domestic sewage, farmland drainage, pollutants in rivers and lakes, etc.; these pollutants include heavy metals, organic matter, pesticides, chemicals and microorganisms.

[0003] Chinese patent CN109508816B discloses a method for predicting the ability of urban garden vegetation to absorb and purify air pollutants, including five steps: regional division, pollution value determination, purification capacity determination, data calculation and prediction planning; the method of the invention is simple, easy to operate and implement, and can effectively meet the needs of urban garden planning and construction on the one hand, and can effectively improve the ability of urban garden construction to purify the urban atmospheric environment while meeting the needs of urban landscape beautification on the other hand, and can provide a scientific and effective basis for the future planning and construction of urban industry, commerce, residents and urban greening.

[0004] With the current development of urban industry, the emission of pollutants has increased dramatically. Urban pollutants exist in every corner of the city. If the content of these pollutants cannot be tracked and predicted in real time, and then prevented and controlled, these pollutants will have an impact on the city’s environment and even endanger human health. At the same time, there are many factors that affect the concentration of these pollutants. If these factors are not considered comprehensively, the prediction of urban pollutant concentrations will be inaccurate. Summary of the invention

[0005] In view of the problems in the related technology, the present invention proposes a method and system for tracking and predicting urban pollutants based on big data to overcome the above-mentioned technical problems existing in the existing related technology.

[0006] In order to solve the above technical problems, the present invention is achieved through the following technical solutions:

[0007] The present invention is a method for tracking and predicting urban pollutants based on big data, comprising the following steps:

[0008] S1. Set a set of urban pollutant types, set a minimum predicted sample number, an initial collection time, and a collection interval, and collect corresponding urban pollutant concentration data in real time according to the set of urban pollutant types, the initial collection time, the minimum predicted sample number, and the collection interval to obtain a first data matrix;

[0009] S2. Obtain a set of factors affecting pollutant concentrations according to the set of urban pollutant types; collect corresponding parameter data of the degree of occurrence of the factors affecting the pollutant concentrations in real time according to the set of factors affecting the pollutant concentrations, the minimum number of predicted samples, the initial collection time, and the collection interval time, to obtain a second data matrix;

[0010] S3, performing a preprocessing operation on the data in the first data matrix and the second data matrix to obtain a preprocessed first data matrix and a preprocessed second data matrix; performing a correlation calculation on the data in the preprocessed first data matrix and the preprocessed second data matrix to obtain a third data matrix;

[0011] S4, predicting the urban pollutant concentration data at the next collection time point of the current collection time point according to the preprocessed first data matrix to obtain a first prediction data set;

[0012] S5. Collect the real data of urban pollutant concentration at the time point corresponding to the first prediction data set, obtain the first real data set, compare it, and adjust the prediction parameters once according to the comparison results; merge the first prediction data set with the preprocessed first data matrix; at the same time, collect the degree parameter data of the influencing factors at the time point corresponding to the first prediction data set, and merge them again; calculate the correlation and compare it with the final first correlation data matrix, adjust the prediction parameters twice according to the comparison results, obtain the final XGBoost model, and use the final XGBoost model to predict the concentration of subsequent urban pollutants;

[0013] The types of pollutants concentrated in urban pollutants include, for example, particulate matter PM2.5, PM10, sulfur dioxide, nitrogen oxides, carbon monoxide, ozone, organic matter; such as organic solvents, petroleum substances; heavy metals such as mercury, lead, cadmium; nutrients such as nitrogen, phosphorus, suspended matter, etc.; organic pollutants such as benzene, toluene, xylene, pesticides, fertilizers, food additives, pesticide residues, etc.; the factors affecting pollutant concentrations include, for example, population density and activity level, industry, traffic emissions, wind speed, atmospheric pressure, temperature, geographical and climatic conditions, policies and control measures, and building layout and green coverage. By collecting data corresponding to the above-mentioned types of urban pollutants and analyzing these data themselves, a comprehensive detection and prediction of various urban pollutants is obtained, which is conducive to achieving comprehensive urban environmental protection. At the same time, the influence of the above-mentioned pollutant concentration influencing factors on pollutant concentration is also considered. By calculating the correlation between the occurrence of pollutant concentration influencing factors and the change of urban pollutant concentration, in addition to predicting the pollutant type concentration data itself, a comprehensive prediction is also made in combination with the correlation, making the prediction more accurate, so that control and protection measures can be taken in advance.

[0014] Preferably, the S1 comprises the following steps:

[0015] S11, set the urban pollutant type set a = {a1, a2, ..., a i ,...,a a′}, a i represents the i-th urban pollutant, a′ represents the total number of urban pollutant types in the urban pollutant type set; at the same time, the minimum prediction sample number a″, the initial collection time a″′ and the collection interval time b are set;

[0016] S12, according to the urban pollutant type set a={a1, a2, ..., a i ,...,a a′}, initial collection time a″′, minimum prediction sample number a″ and collection interval time b to collect the corresponding urban pollutant concentration data in real time, and obtain the first data matrix b′, as follows:

[0017]

[0018] Where: b′ ij is the concentration value of the i-th urban pollutant at the j-th time point;

[0019] By setting the urban pollutant type set, the minimum predicted sample number, the initial collection time and the collection interval, the collection objects and methods are determined, which provides a basis for the subsequent collection of urban pollutant concentration data. At the same time, urban pollutant concentration data is collected in real time, which provides a data basis for the subsequent prediction of urban pollutant concentrations at future times and the calculation of the correlation between urban pollutant concentration changes and the occurrence of pollutant concentration influencing factors.

[0020] Preferably, S2 comprises the following steps:

[0021] S21, according to the urban pollutant type set a={a1, a2, ..., a i ,...,a a′}Get the pollutant concentration influencing factor set b″={b″1,b″2,...,b″ i ,...,b″ b″′}; b″ i represents the i-th pollutant concentration influencing factor, b″′ represents the total number of pollutant concentration influencing factor types in the pollutant concentration influencing factor set;

[0022] S22, according to the pollutant concentration influencing factor set b″={b″1,b″2,...,b″ i ,...,b″ b″′}, the minimum prediction sample number a″, the initial collection time a″′ and the collection interval time b are used to collect the corresponding degree parameter data of the influencing factors in real time, and the second data matrix c is obtained as follows:

[0023]

[0024] Where: c ij The parameter data representing the degree of occurrence of the factors affecting the concentration of the i-th pollutant at the j-th time point;

[0025] By setting a set of factors affecting pollutant concentrations, the objects that need to be considered are determined, which provides a basis for the subsequent data collection of influencing factors. By real-time collection of parameter data on the degree of occurrence of influencing factors, a data basis is provided for the subsequent calculation of the correlation between changes in urban pollutant concentrations and the occurrence of factors affecting pollutant concentrations.

[0026] Preferably, S3 comprises the following steps:

[0027] S31, preprocessing the data in the first data matrix and the second data matrix to obtain a preprocessed first data matrix c′ and a preprocessed second data matrix c″, respectively as follows;

[0028]

[0029] Where: c″ ij represents the concentration value of the i-th urban pollutant after pretreatment at the j-th time point, c″ ij It represents the parameter data of the occurrence degree of the factors affecting the concentration of the i-th pollutant after pretreatment at the j-th time point.

[0030] S32, performing correlation calculation on the data in the preprocessed first data matrix c′ and the preprocessed second data matrix c″ to obtain a final first correlation data matrix d; and obtaining a third data matrix c″′ based on the first correlation data matrix d;

[0031] By preprocessing the data in the first data matrix and the second data matrix, the collected data is easier to analyze and the correlation calculation process is more convenient.

[0032] Preferably, the S32 comprises the following steps:

[0033] S321, set the correlation to select a value d', and then calculate the degree parameter data of various pollutant concentration influencing factors in the pre-processed second data matrix c' and the concentration values ​​of various urban pollutants in the pre-processed first data matrix c' to obtain the initial first correlation data matrix d, as follows:

[0034]

[0035] Where: d ii It represents the correlation between the concentration value of the i-th urban pollutant and the degree parameter data of the factors affecting the concentration of the i-th pollutant over time; the calculation formula is as follows:

[0036]

[0037] S322, sorting each row of data in the initial first correlation data matrix d from large to small to obtain a sorted initial first correlation data matrix;

[0038] S323, selecting the first d′ data from each row of the sorted initial first correlation data matrix to obtain a final first correlation data matrix d″, as follows:

[0039]

[0040] Where: d″ iiIt represents the correlation between the concentration value of the i-th urban pollutant after selection and the degree parameter data of the factors affecting the concentration of the i-th pollutant over time;

[0041] S324, obtaining a third data matrix c'' according to the final first correlation data matrix d'', as follows:

[0042]

[0043] Where: c″′ ii Indicates d″ ii The corresponding data set of the degree parameter data of the pollutant concentration influencing factors changing with time, c″′ ii ={c″′ ii1 ,c″′ ii2 ,...,c″′ iij ,...,c″′ iia″},c″′ iij Indicates d″ ii The corresponding parameter data of the degree of occurrence of the factors affecting the concentration of pollutants at the jth time point;

[0044] By calculating the correlation, we can determine which influencing factors have a stronger correlation with the concentration change of a pollutant, thus providing a basis for subsequent correlation analysis.

[0045] Preferably, S4 comprises the following steps:

[0046] S41, set the training set ratio to e'%, and the test set ratio to h'%;

[0047] S42, dividing the preprocessed first data matrix c′ according to the training set ratio and the test set ratio to obtain a training data set matrix f′ and a test data set matrix f″, which are respectively as follows:

[0048]

[0049] Where: f′ ij represents the concentration training data of the i-th urban pollutant at the j-th time point after pretreatment, f″′ represents the total number of concentration training data of the i-th urban pollutant at the j-th time point after pretreatment; f″ ij represents the concentration test data of the i-th urban pollutant after pretreatment at the j-th time point, and h″′ represents the total number of concentration test data of the i-th urban pollutant after pretreatment at the j-th time point;

[0050] S43, constructing an initial XGBoost model, setting the initial maximum spanning tree count parameter of the initial XGBoost model to α, the initial learning rate parameter to α′, the maximum depth parameter of the initial tree to α″, and the initial minimum leaf node sample weight sum parameter to α″′;

[0051] S44, setting an error threshold h; inputting the training data set matrix f′ and the test data set matrix f″ into the initial XGBoost model for training; using the second training data set matrix f′ and the second test data set matrix f″ to train the initial XGBoost model, and when the training error is less than h, stopping the training to obtain the trained XGBoost model;

[0052] S45, input the remaining data in the preprocessed first data matrix c′ into the trained XGBoost model to obtain the first prediction data set e={e1, e2, ..., e i ,...,e a′},e i Represents the predicted concentration data of the i-th pollutant at the next time point after the current time point;

[0053] By using the XGBoost model to predict the concentration of urban pollutants at future times, the prediction process becomes more efficient.

[0054] Preferably, the S5 comprises the following steps:

[0055] S51, collecting real data of urban pollutant concentration at a time point corresponding to the first prediction data set, and obtaining a first real data set e″={e″1, e″2, ..., e″ i ,...,e″ a′},e″ i Indicates the first prediction data set e i The actual data of pollutant concentration corresponding to the i-th type;

[0056] S52: The first real data set e″={e″1, e″2, ..., e″ i ,...,e″ a′} and the first prediction data set e={e1,e2,...,e i ,...,e a′} to make a comparison, and adjust the prediction parameters according to the comparison results;

[0057] S53: The first prediction data set e={e1, e2, ..., e i ,...,e a′} is merged with the preprocessed first data matrix c′ to obtain a fourth data matrix e″′; at the same time, the degree parameter data of the influencing factors at the time point corresponding to the first prediction data set is collected to obtain a fifth data matrix f; the fifth data matrix f is then merged with the third data matrix c″′ to obtain a sixth data matrix h″; the correlation between the sixth data matrix h″ and the fourth data matrix e″′ is calculated to obtain a second correlation data matrix g″′; the second correlation data matrix g″′ is compared with the final first correlation data matrix d″, and a secondary prediction parameter adjustment is performed according to the comparison results to obtain a final XGBoost model, and the final XGBoost model is used to predict the concentration of subsequent urban pollutants;

[0058] By adjusting the parameters of the XGBoost model, the XGBoost model can more accurately predict the concentration data of urban pollutants at future times, thereby optimizing the XGBoost model and providing an accurate basis for early prevention and control of pollutants.

[0059] Preferably, the S52 comprises the following steps:

[0060] S521, the initial maximum spanning tree count parameter of the initial XGBoost model is set to α, the initial learning rate parameter is α′, the maximum depth parameter of the initial tree is α″, and the initial minimum leaf node sample weight sum parameter is α″′ as parameters to be optimized; then the maximum value of the initial maximum spanning tree count parameter is set to α max , the minimum value is α min ; Set the maximum value of the initial learning rate parameter to α′ max , the minimum value is α′ min ; Set the maximum depth parameter of the initial tree to α″ max , the minimum value is α″ min ; Set the maximum value of the sum of the initial minimum leaf node sample weights to α″′ max , the minimum value is α″′ min ;

[0061] S522, according to α max , α min , α′ max , α′ min , α″ max , α″ min , α″′ max and α″′ minNormalizing the initial maximum spanning tree count parameter, the initial learning rate parameter, the maximum depth parameter of the initial tree, and the initial minimum leaf node sample weight sum parameter to obtain a normalized maximum spanning tree count parameter β, a normalized learning rate parameter β′, a normalized maximum depth parameter β″ of the tree, and a normalized minimum leaf node sample weight sum parameter β″′;

[0062] S522, setting the size of the first wolf group to g, the first maximum number of iterations to g′, and the first current number of iterations to g″′; the first wolf group is represented by g″={g″1, g″2, ..., g″ i ,...,g″ g},g″ i represents the i-th wolf in the first wolf population; the first wolf population is divided into four wolf sub-populations, and the initial positions of the wolf individuals in the four wolf sub-populations are set to β, β′, β″ and β″′ respectively;

[0063] S523, calculate the first wolf group g″={g″1,g″2,...,g″ i ,...,g″ g The fitness value of each wolf individual in} is calculated as follows:

[0064]

[0065] Where: d″′ represents the fitness value of individual wolf;

[0066] S524, starting an iterative process according to the calculation formula of the fitness value of the individual wolf, updating the position of each individual wolf in the first wolf group and adding 1 to g″′ at the end of each iteration; obtaining the global best individual wolf positions of the four wolf sub-populations of the first wolf group after the current iteration, inputting the four global best individual wolf positions of the first wolf group as parameters into the trained XGBoost model, and at the same time inputting the preprocessed first data matrix c′ into the trained XGBoost model for prediction, and calculating the fitness values ​​of the individual wolves in the first wolf group again according to the prediction results;

[0067] S525, repeat S524, when g″′≥g′, stop iteration, obtain the first optimal maximum spanning tree count parameter χ, the first optimal learning rate parameter χ′, the first optimal tree maximum depth parameter χ″ and the first optimal minimum leaf node sample weight sum parameter χ″′, and obtain the first optimized XGBoost model; so far, the prediction parameter adjustment process is completed;

[0068] Preferably, the S53 comprises the following steps:

[0069] S531: The first prediction data set e={e1, e2, ..., e i ,...,e a′} is merged with the preprocessed first data matrix c′ to obtain a fourth data matrix e″′; at the same time, the degree parameter data of the influencing factors at the time point corresponding to the first prediction data set is collected to obtain a fifth data matrix f; the fifth data matrix f is then merged with the third data matrix c″′ to obtain a sixth data matrix h″; the correlation between the sixth data matrix h″ and the fourth data matrix e″′ is calculated to obtain a second correlation data matrix g″′;

[0070] S532, comparing the second correlation data matrix g″′ with the final first correlation data matrix d″, performing secondary prediction parameter adjustment according to the comparison result, obtaining a final XGBoost model, and using the final XGBoost model to predict the concentration of subsequent urban pollutants;

[0071] The specific steps include:

[0072] S5321, set the size of the second wolf group to l, the second maximum number of iterations to l', and the second current number of iterations to l"; the second wolf group is represented by l"'={l"'1,'l"'2,...,l"' i ,...,l″′ l}, l″′ i represents the i-th wolf in the second wolf population; the second wolf population is divided into four wolf sub-populations, and the initial positions of the wolf individuals in the four wolf sub-populations are set to χ, χ′, χ″ and χ″′ respectively;

[0073] S5322, calculate the second wolf group l″′={l″′1,l″′2,...,l″′ i ,...,l″′ l}, the second wolf population l″′={l″′1,l″′2,...,l″ i ,...,l″′ l The fitness value calculation formula of each wolf in} is as follows:

[0074]

[0075] Wherein: g″′[i][j] and d″[i][j] respectively represent the data of the i-th row and j-th column in the second correlation data matrix g″′ and the data of the i-th row and j-th column in the final first correlation data matrix d″;

[0076] S5323, according to the second wolf group l″′={l″′1,l″′2,...,l″′ i ,...,l″′ l}, and then the fitness value calculation formula of each wolf individual in the second wolf group is used to start the iteration process. At the end of each iteration, the position of each wolf individual in the second wolf group is updated and l″ is increased by 1; the global best wolf individual position of the four wolf sub-populations of the second wolf group after the current iteration is obtained, and the four global best wolf individual positions of the second wolf group are input as parameters to the XGBoost model after the first optimization. At the same time, the preprocessed first data matrix c′ is also input to the XGBoost model after the first optimization for prediction, and S531 is repeated according to the prediction results to calculate the fitness value of each wolf individual in the second wolf group again;

[0077] S5324, repeat S5323, when l″≥l′, stop iteration, obtain the second optimal maximum spanning tree count parameter δ, the second optimal learning rate parameter δ′, the second optimal tree maximum depth parameter δ″ and the second optimal minimum leaf node sample weight sum parameter δ″′, and obtain the final XGBoost model; the secondary prediction parameter adjustment process ends here;

[0078] S5325, using the final XGBoost model to predict the concentration of subsequent urban pollutants;

[0079] Taking advantage of the strong global parameter search convergence ability of the Gray Wolf Optimization Algorithm, the Gray Wolf Optimization Algorithm is used to optimize the parameters of XGBoost (maximum number of spanning trees, learning rate, and maximum depth of the tree) to obtain the best prediction performance of XGBoost, thereby making the prediction of the concentration data of urban pollutants at future times more accurate.

[0080] A big data-based urban pollutant tracking and prediction system, comprising an urban pollutant concentration data acquisition module, an influencing factor occurrence degree parameter data acquisition module, a correlation calculation module, an urban pollutant concentration prediction module, a primary prediction parameter adjustment module, and a secondary prediction parameter adjustment module;

[0081] The urban pollutant concentration data collection module is used to collect corresponding urban pollutant concentration data in real time according to the urban pollutant type set, initial collection time, minimum predicted sample number and collection interval time;

[0082] The degree parameter data collection module of the influencing factor occurrence is used to collect the degree parameter data of the corresponding influencing factor occurrence in real time according to the pollutant concentration influencing factor set, the minimum predicted sample number, the initial collection time and the collection interval time;

[0083] The correlation calculation module is used to calculate the correlation of the data in the preprocessed first data matrix and the preprocessed second data matrix and compare the calculated correlation with the final first correlation data matrix;

[0084] The urban pollutant concentration prediction module is used to predict the urban pollutant concentration data at the next collection time point of the current collection time point according to the preprocessed first data matrix;

[0085] The primary prediction parameter adjustment module is used to perform a primary prediction parameter adjustment;

[0086] The secondary prediction parameter adjustment module is used to adjust the secondary prediction parameters.

[0087] The present invention has the following beneficial effects:

[0088] 1. In the present invention, by setting up an urban pollutant concentration data acquisition module, an influencing factor occurrence degree parameter data acquisition module, a correlation calculation module, an urban pollutant concentration prediction module, a primary prediction parameter adjustment module and a secondary prediction parameter adjustment module, the pollutant types in the urban pollutant type collection include, for example, particulate matter PM2.5, PM10, sulfur dioxide, nitrogen oxides, carbon monoxide, ozone, organic matter; such as organic solvents, petroleum substances; heavy metals such as mercury, lead, cadmium; nutrients such as nitrogen, phosphorus, suspended matter, etc.; organic pollutants such as benzene, toluene, xylene, pesticides, fertilizers, food additives, pesticide residues, etc.; the pollutant concentration influencing factors include, for example, population density and activity level, Industrial and traffic emissions, wind speed, atmospheric pressure, temperature, geographical and climatic conditions, policies and control measures, as well as building layout and green coverage. By collecting data corresponding to the above types of urban pollutants and analyzing these data themselves, we can comprehensively detect and predict a variety of urban pollutants, which is conducive to achieving comprehensive urban environmental protection. At the same time, we also consider the influence of the above-mentioned pollutant concentration influencing factors on pollutant concentrations. By calculating the correlation between the occurrence of pollutant concentration influencing factors and the changes in urban pollutant concentrations, in addition to predicting the pollutant type concentration data itself, we also combine the correlation for comprehensive prediction, making the prediction more accurate, so that control and protection measures can be taken in advance.

[0089] 2. In the present invention, by setting the urban pollutant type set, the minimum predicted sample number, the initial collection time and the collection interval time, the collection object and the collection method are determined, which provides a basis for the subsequent collection of urban pollutant concentration data. At the same time, the urban pollutant concentration data is collected in real time, which provides a data basis for the subsequent prediction of the concentration of urban pollutants at future moments and the calculation of the correlation between the change in urban pollutant concentration and the occurrence of pollutant concentration influencing factors; secondly, by setting the pollutant concentration influencing factor set, the objects that need to be considered are determined, which provides a basis for the subsequent data collection of influencing factors. By collecting the parameter data of the degree of occurrence of influencing factors in real time, it provides a data basis for the subsequent calculation of the correlation between the change in urban pollutant concentration and the occurrence of pollutant concentration influencing factors.

[0090] 3. In the present invention, by preprocessing the data in the first data matrix and the second data matrix, the collected data is easier to analyze and the process of correlation calculation is more convenient; then, the XGBoost model is used to predict the concentration of urban pollutants at future times, making the prediction process more efficient, wherein the parameters of the XGBoost model are adjusted to make the XGBoost model more accurate in predicting the concentration data of urban pollutants at future times, thereby optimizing the XGBoost model, thereby providing an accurate basis for early prevention and control of pollutants, and utilizing the advantages of the gray wolf optimization algorithm's strong global parameter search and convergence ability, using the gray wolf optimization algorithm to optimize the parameters of XGBoost (maximum number of spanning trees, learning rate, and maximum depth of the tree), thereby obtaining the best prediction performance of XGBoost, thereby more accurately predicting the concentration data of urban pollutants at future times.

[0091] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0092] In order to more clearly illustrate the technical solutions of the embodiments of the invention, the drawings required for describing the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the invention. For ordinary technicians in this field, they can also obtain drawings based on these drawings without paying creative work.

[0093] Figure 1 The present invention is a schematic diagram of a process of predicting urban pollutants using a big data-based urban pollutant tracking and prediction system. DETAILED DESCRIPTION

[0094] The following will be combined with the drawings in the embodiments of the invention to clearly and completely describe the technical solutions in the embodiments of the invention. Obviously, the described embodiments are only part of the embodiments of the invention, not all of the embodiments. Based on the embodiments in the invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the invention.

[0095] In the description of the present invention, it is necessary to understand that the terms "opening", "upper", "lower", "top", "middle", "inside" and the like indicating orientation or positional relationship are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the components or elements referred to must have a specific orientation, be constructed and operate in a specific orientation, and therefore cannot be understood as limiting the invention.

[0096] The present invention is a method for tracking and predicting urban pollutants based on big data, comprising the following steps:

[0097] S1. Set a set of urban pollutant types, set a minimum predicted sample number, an initial collection time, and a collection interval, and collect corresponding urban pollutant concentration data in real time according to the set of urban pollutant types, the initial collection time, the minimum predicted sample number, and the collection interval to obtain a first data matrix;

[0098] The S1 comprises the following steps:

[0099] S11, set the urban pollutant type set a = {a1, a2, ..., a i ,...,a a′}, a i represents the i-th urban pollutant, a′ represents the total number of urban pollutant types in the urban pollutant type set; at the same time, the minimum prediction sample number a″, the initial collection time a″′ and the collection interval time b are set;

[0100] S12, according to the urban pollutant type set a={a1, a2, ..., a i ,...,a a′}, initial collection time a″′, minimum prediction sample number a″ and collection interval time b to collect the corresponding urban pollutant concentration data in real time, and obtain the first data matrix b′, as follows:

[0101]

[0102] Where: b′ ij is the concentration value of the i-th urban pollutant at the j-th time point;

[0103] S2. Obtain a set of factors affecting pollutant concentrations according to the set of urban pollutant types; collect corresponding parameter data of the degree of occurrence of the factors affecting the pollutant concentrations in real time according to the set of factors affecting the pollutant concentrations, the minimum number of predicted samples, the initial collection time, and the collection interval time, to obtain a second data matrix;

[0104] The S2 comprises the following steps:

[0105] S21, according to the urban pollutant type set a={a1, a2, ..., a i ,...,a a′}Get the pollutant concentration influencing factor set b″={b″1,b″2,...,b″ i ,...,b″ b″′}; b″ i represents the i-th pollutant concentration influencing factor, b″′ represents the total number of pollutant concentration influencing factor types in the pollutant concentration influencing factor set;

[0106] S22, according to the pollutant concentration influencing factor set b″={b″1,b″2,...,b″ i ,...,b″ b″′}, the minimum prediction sample number a″, the initial collection time a″′ and the collection interval time b are used to collect the corresponding degree parameter data of the influencing factors in real time, and the second data matrix c is obtained as follows:

[0107]

[0108] Where: c ij The parameter data representing the degree of occurrence of the factors affecting the concentration of the i-th pollutant at the j-th time point;

[0109] S3, performing a preprocessing operation on the data in the first data matrix and the second data matrix to obtain a preprocessed first data matrix and a preprocessed second data matrix; performing a correlation calculation on the data in the preprocessed first data matrix and the preprocessed second data matrix to obtain a third data matrix;

[0110] The S3 comprises the following steps:

[0111] S31, preprocessing the data in the first data matrix and the second data matrix to obtain a preprocessed first data matrix c′ and a preprocessed second data matrix c″, respectively as follows;

[0112]

[0113] Where: c′ ij represents the concentration value of the i-th urban pollutant after pretreatment at the j-th time point, c″ ij It represents the parameter data of the occurrence degree of the factors affecting the concentration of the i-th pollutant after pretreatment at the j-th time point.

[0114] S32, performing correlation calculation on the data in the preprocessed first data matrix c′ and the preprocessed second data matrix c″ to obtain a final first correlation data matrix d; and obtaining a third data matrix c″′ based on the first correlation data matrix d;

[0115] The S32 comprises the following steps:

[0116] S321, set the correlation to select a value d', and then calculate the degree parameter data of various pollutant concentration influencing factors in the pre-processed second data matrix c' and the concentration values ​​of various urban pollutants in the pre-processed first data matrix c' to obtain the initial first correlation data matrix d, as follows:

[0117]

[0118] Where: d ii It represents the correlation between the concentration value of the i-th urban pollutant and the degree parameter data of the factors affecting the concentration of the i-th pollutant over time; the calculation formula is as follows:

[0119]

[0120] S322, sorting each row of data in the initial first correlation data matrix d from large to small to obtain a sorted initial first correlation data matrix;

[0121] S323, selecting the first d′ data from each row of the sorted initial first correlation data matrix to obtain a final first correlation data matrix d″, as follows:

[0122]

[0123] Where: d″ ii It represents the correlation between the concentration value of the i-th urban pollutant after selection and the degree parameter data of the factors affecting the concentration of the i-th pollutant over time;

[0124] S324, obtaining a third data matrix c'' according to the final first correlation data matrix d'', as follows:

[0125]

[0126] Where: c″′ ii Indicates d″ii The corresponding data set of the degree parameter data of the pollutant concentration influencing factors changing with time, c″′ ii ={c″′ ii1 ,c″′ ii2 ,...,c″′ iij ,...,c″′ iia″},c″′ iij Indicates d″ ii The corresponding parameter data of the degree of occurrence of the factors affecting the concentration of pollutants at the jth time point;

[0127] S4, predicting the urban pollutant concentration data at the next collection time point of the current collection time point according to the preprocessed first data matrix to obtain a first prediction data set;

[0128] The S4 comprises the following steps:

[0129] S41, set the training set ratio to e'%, and the test set ratio to h'%;

[0130] S42, dividing the preprocessed first data matrix c′ according to the training set ratio and the test set ratio to obtain a training data set matrix f′ and a test data set matrix f″, which are respectively as follows:

[0131]

[0132] Where: f′ ij represents the concentration training data of the i-th urban pollutant at the j-th time point after pretreatment, f″′ represents the total number of concentration training data of the i-th urban pollutant at the j-th time point after pretreatment; f″ ij represents the concentration test data of the i-th urban pollutant after pretreatment at the j-th time point, and h″′ represents the total number of concentration test data of the i-th urban pollutant after pretreatment at the j-th time point;

[0133] S43, constructing an initial XGBoost model, setting the initial maximum spanning tree count parameter of the initial XGBoost model to α, the initial learning rate parameter to α′, the maximum depth parameter of the initial tree to α″, and the initial minimum leaf node sample weight sum parameter to α″′;

[0134] S44, setting an error threshold h; inputting the training data set matrix f′ and the test data set matrix f″ into the initial XGBoost model for training; using the second training data set matrix f′ and the second test data set matrix f″ to train the initial XGBoost model, and when the training error is less than h, stopping the training to obtain the trained XGBoost model;

[0135] S45, input the remaining data in the preprocessed first data matrix c′ into the trained XGBoost model to obtain the first prediction data set e={e1, e2, ..., e i ,...,e a′},e i Represents the predicted concentration data of the i-th pollutant at the next time point after the current time point;

[0136] S5. Collect the real data of urban pollutant concentration at the time point corresponding to the first prediction data set, obtain the first real data set, compare it, and adjust the prediction parameters once according to the comparison results; merge the first prediction data set with the preprocessed first data matrix; at the same time, collect the degree parameter data of the influencing factors at the time point corresponding to the first prediction data set, and merge them again; calculate the correlation and compare it with the final first correlation data matrix, adjust the prediction parameters twice according to the comparison results, obtain the final XGBoost model, and use the final XGBoost model to predict the concentration of subsequent urban pollutants;

[0137] The S5 comprises the following steps:

[0138] S51, collecting real data of urban pollutant concentration at a time point corresponding to the first prediction data set, and obtaining a first real data set e″={e″1, e″2, ..., e″ i ,...,e″ a′},e″ i Indicates the first prediction data set e i The actual data of pollutant concentration corresponding to the i-th type;

[0139] S52: The first real data set e″={e″1, e″2, ..., e″ i ,...,e″ a′} and the first prediction data set e={e1,e2,...,e i ,...,e a′} to make a comparison, and adjust the prediction parameters according to the comparison results;

[0140] The S52 comprises the following steps:

[0141] S521, the initial maximum spanning tree count parameter of the initial XGBoost model is set to α, the initial learning rate parameter is α′, the maximum depth parameter of the initial tree is α″, and the initial minimum leaf node sample weight sum parameter is α″′ as parameters to be optimized; then the maximum value of the initial maximum spanning tree count parameter is set to α max , the minimum value is α min ; Set the maximum value of the initial learning rate parameter to α′max , the minimum value is α′ min ; Set the maximum depth parameter of the initial tree to α″ max , the minimum value is α″ min ; Set the maximum value of the sum of the initial minimum leaf node sample weights to α″′ max , the minimum value is α″′ min ;

[0142] S522, according to α max , α min , α′ max , α′ min , α″ max , α″ min , α″′ max and α″′ min Normalizing the initial maximum spanning tree count parameter, the initial learning rate parameter, the maximum depth parameter of the initial tree, and the initial minimum leaf node sample weight sum parameter to obtain a normalized maximum spanning tree count parameter β, a normalized learning rate parameter β′, a normalized maximum depth parameter β″ of the tree, and a normalized minimum leaf node sample weight sum parameter β″′;

[0143] S522, setting the size of the first wolf group to g, the first maximum number of iterations to g′, and the first current number of iterations to g″′; the first wolf group is represented by g″={g″1, g″2, ..., g″ i ,...,g″ g},g″ i represents the i-th wolf in the first wolf population; the first wolf population is divided into four wolf sub-populations, and the initial positions of the wolf individuals in the four wolf sub-populations are set to β, β′, β″ and β″′ respectively;

[0144] S523, calculate the first wolf group g″={g″1,g″2,...,g″ i ,...,g″ g The fitness value of each wolf individual in} is calculated as follows:

[0145]

[0146] Where: d″′ represents the fitness value of individual wolf;

[0147] S524, starting an iterative process according to the calculation formula of the fitness value of the individual wolf, updating the position of each individual wolf in the first wolf group and adding 1 to g″′ at the end of each iteration; obtaining the global best individual wolf positions of the four wolf sub-populations of the first wolf group after the current iteration, inputting the four global best individual wolf positions of the first wolf group as parameters into the trained XGBoost model, and at the same time inputting the preprocessed first data matrix c′ into the trained XGBoost model for prediction, and calculating the fitness values ​​of the individual wolves in the first wolf group again according to the prediction results;

[0148] S525, repeat S524, when g″′≥g′, stop iteration, obtain the first optimal maximum spanning tree count parameter χ, the first optimal learning rate parameter χ′, the first optimal tree maximum depth parameter χ″ and the first optimal minimum leaf node sample weight sum parameter χ″′, and obtain the first optimized XGBoost model; so far, the prediction parameter adjustment process is completed;

[0149] S53: The first prediction data set e={e1, e2, ..., e i ,...,e a′} is merged with the preprocessed first data matrix c′ to obtain a fourth data matrix e″′; at the same time, the degree parameter data of the influencing factors at the time point corresponding to the first prediction data set is collected to obtain a fifth data matrix f; the fifth data matrix f is then merged with the third data matrix c″′ to obtain a sixth data matrix h″; the correlation between the sixth data matrix h″ and the fourth data matrix e″′ is calculated to obtain a second correlation data matrix g″′; the second correlation data matrix g″′ is compared with the final first correlation data matrix d″, and a secondary prediction parameter adjustment is performed according to the comparison results to obtain a final XGBoost model, and the final XGBoost model is used to predict the concentration of subsequent urban pollutants;

[0150] The S53 comprises the following steps:

[0151] S531: The first prediction data set e={e1, e2, ..., e i ,...,e a′} is merged with the preprocessed first data matrix c′ to obtain a fourth data matrix e″′; at the same time, the degree parameter data of the influencing factors at the time point corresponding to the first prediction data set is collected to obtain a fifth data matrix f; the fifth data matrix f is then merged with the third data matrix c″′ to obtain a sixth data matrix h″; the correlation between the sixth data matrix h″ and the fourth data matrix e″′ is calculated to obtain a second correlation data matrix g″′;

[0152] S532, comparing the second correlation data matrix g″′ with the final first correlation data matrix d″, performing secondary prediction parameter adjustment according to the comparison result, obtaining a final XGBoost model, and using the final XGBoost model to predict the concentration of subsequent urban pollutants;

[0153] The specific steps include:

[0154] S5321, set the size of the second wolf group to l, the second maximum number of iterations to l', and the second current number of iterations to l"; the second wolf group is represented by l"'={l"'1, l"'2, ..., l"' i ,...,l″′ l}, l″′ i represents the i-th wolf in the second wolf population; the second wolf population is divided into four wolf sub-populations, and the initial positions of the wolf individuals in the four wolf sub-populations are set to χ, χ′, χ″ and χ″′ respectively;

[0155] S5322, calculate the second wolf group l″′={l″′1, l″′2, ..., l″′ i ,...,l″′ l}, the second wolf population l″′={l″′1,l″′2,...,l″′ i ,...,l″′ l The fitness value calculation formula of each wolf in} is as follows:

[0156]

[0157] Wherein: g″′[i][j] and d″[i][j] respectively represent the data of the i-th row and j-th column in the second correlation data matrix g″′ and the data of the i-th row and j-th column in the final first correlation data matrix d″;

[0158] S5323, according to the second wolf group l″′={l″′1,l″′2,...,l″′ i ,...,l″′ l}, and then the fitness value calculation formula of each wolf individual in the second wolf group is used to start the iteration process. At the end of each iteration, the position of each wolf individual in the second wolf group is updated and l″ is increased by 1; the global best wolf individual position of the four wolf sub-populations of the second wolf group after the current iteration is obtained, and the four global best wolf individual positions of the second wolf group are input as parameters to the XGBoost model after the first optimization. At the same time, the preprocessed first data matrix c′ is also input to the XGBoost model after the first optimization for prediction, and S531 is repeated according to the prediction results to calculate the fitness value of each wolf individual in the second wolf group again;

[0159] S5324, repeat S5323, when l″≥l′, stop iteration, obtain the second optimal maximum spanning tree count parameter δ, the second optimal learning rate parameter δ′, the second optimal tree maximum depth parameter δ″ and the second optimal minimum leaf node sample weight sum parameter δ″′, and obtain the final XGBoost model; the secondary prediction parameter adjustment process ends here;

[0160] S5325. Use the final XGBoost model to predict the concentration of subsequent urban pollutants.

[0161] A big data-based urban pollutant tracking and prediction system, comprising an urban pollutant concentration data acquisition module, an influencing factor occurrence degree parameter data acquisition module, a correlation calculation module, an urban pollutant concentration prediction module, a primary prediction parameter adjustment module, and a secondary prediction parameter adjustment module;

[0162] The urban pollutant concentration data collection module is used to collect corresponding urban pollutant concentration data in real time according to the urban pollutant type set, initial collection time, minimum predicted sample number and collection interval time;

[0163] The degree parameter data collection module of the influencing factor occurrence is used to collect the degree parameter data of the corresponding influencing factor occurrence in real time according to the pollutant concentration influencing factor set, the minimum predicted sample number, the initial collection time and the collection interval time;

[0164] The correlation calculation module is used to calculate the correlation of the data in the preprocessed first data matrix and the preprocessed second data matrix and compare the calculated correlation with the final first correlation data matrix;

[0165] The urban pollutant concentration prediction module is used to predict the urban pollutant concentration data at the next collection time point of the current collection time point according to the preprocessed first data matrix;

[0166] The primary prediction parameter adjustment module is used to perform a primary prediction parameter adjustment;

[0167] The secondary prediction parameter adjustment module is used to adjust the secondary prediction parameters.

[0168] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0169] The preferred embodiments of the invention disclosed above are only used to help explain the invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the invention, so that those skilled in the art can understand and use the invention well.

Claims

1. A method for tracking and predicting urban pollutants based on big data, characterized by: The following steps are involved: S1. Set a set of urban pollutant types, set a minimum predicted sample number, an initial collection time, and a collection interval, and collect corresponding urban pollutant concentration data in real time according to the set of urban pollutant types, the initial collection time, the minimum predicted sample number, and the collection interval to obtain a first data matrix; S2. Obtain a set of factors affecting pollutant concentrations according to the set of urban pollutant types; collect corresponding parameter data of the degree of occurrence of the factors affecting the pollutant concentrations in real time according to the set of factors affecting the pollutant concentrations, the minimum number of predicted samples, the initial collection time, and the collection interval time, to obtain a second data matrix; S3, performing a preprocessing operation on the data in the first data matrix and the second data matrix to obtain a preprocessed first data matrix and a preprocessed second data matrix; Performing correlation calculation on the data in the preprocessed first data matrix and the preprocessed second data matrix to obtain a third data matrix; S4, predicting the urban pollutant concentration data at the next collection time point of the current collection time point according to the preprocessed first data matrix to obtain a first prediction data set; S5, collecting real data of urban pollutant concentration at a time point corresponding to the first prediction data set, obtaining a first real data set, performing comparison, and adjusting prediction parameters once according to the comparison result; merging the first prediction data set with the preprocessed first data matrix; and simultaneously collecting parameter data of the degree of occurrence of the influencing factors at the time point corresponding to the first prediction data set, and merging again; The calculated correlation is compared with the final first correlation data matrix, and secondary prediction parameters are adjusted according to the comparison results to obtain the final XGBoost model, and the final XGBoost model is used to predict the concentration of subsequent urban pollutants.

2. The method for tracking and predicting urban pollutants based on big data according to claim 1 is characterized by: The S1 comprises the following steps: S11, set the urban pollutant type set a = {a1, a2, ..., a i ,...,a a′ }, a i represents the i-th urban pollutant, a′ represents the total number of urban pollutant types in the urban pollutant type set; at the same time, the minimum prediction sample number a″, the initial collection time a″′ and the collection interval time b are set; S12, according to the urban pollutant type set a={a1, a2, ..., a i ,...,a a′ }, initial collection time a″′, minimum prediction sample number a″ and collection interval time b to collect the corresponding urban pollutant concentration data in real time, and obtain the first data matrix b′, as follows: Where: b′ ij is the concentration value of the i-th urban pollutant at the j-th time point.

3. The urban pollutant tracking and prediction method based on big data according to claim 1 is characterized by: The S2 comprises the following steps: S21, according to the urban pollutant type set a={a1, a2, ..., a i ,...,a a′ }Get the pollutant concentration influencing factor set b″={b″1,b″2,...,b″ i ,...,b″ b″′ }; b″ i represents the i-th pollutant concentration influencing factor, b″′ represents the total number of pollutant concentration influencing factor types in the pollutant concentration influencing factor set; S22, according to the pollutant concentration influencing factor set b″={b″1,b″2,...,b″ i ,...,b″ b″′ }, the minimum prediction sample number a″, the initial collection time a″′ and the collection interval time b are used to collect the corresponding degree parameter data of the influencing factors in real time, and the second data matrix c is obtained as follows: Where: c ij It represents the parameter data of the degree of occurrence of the factors affecting the concentration of the i-th pollutant at the j-th time point.

4. The method for tracking and predicting urban pollutants based on big data according to claim 1 is characterized by: The S3 comprises the following steps: S31, preprocessing the data in the first data matrix and the second data matrix to obtain a preprocessed first data matrix c′ and a preprocessed second data matrix c″, respectively as follows; Where: c′ ij represents the concentration value of the i-th urban pollutant after pretreatment at the j-th time point, c″ ij It represents the parameter data of the occurrence degree of the factors affecting the concentration of the i-th pollutant after pretreatment at the j-th time point. S32. Perform correlation calculation on the data in the preprocessed first data matrix c′ and the preprocessed second data matrix c″ to obtain a final first correlation data matrix d; and obtain a third data matrix c″′ based on the first correlation data matrix d.

5. The method for tracking and predicting urban pollutants based on big data according to claim 4 is characterized by: The S32 comprises the following steps: S321, set the correlation to select a value d', and then calculate the degree parameter data of various pollutant concentration influencing factors in the pre-processed second data matrix c' and the concentration values ​​of various urban pollutants in the pre-processed first data matrix c' to obtain the initial first correlation data matrix d, as follows: Where: d ii It represents the correlation between the concentration value of the i-th urban pollutant and the degree parameter data of the factors affecting the concentration of the i-th pollutant over time; the calculation formula is as follows: S322, sorting each row of data in the initial first correlation data matrix d from large to small to obtain a sorted initial first correlation data matrix; S323, selecting the first d' data from each row of the sorted initial first correlation data matrix to obtain a final first correlation data matrix d", as follows: Where: d″ ii It represents the correlation between the concentration value of the i-th urban pollutant after selection and the degree parameter data of the factors affecting the concentration of the i-th pollutant over time; S324, obtaining a third data matrix c'' according to the final first correlation data matrix d'', as follows: Where: c″′ ii Indicates d″ ii The corresponding data set of the degree parameter data of the pollutant concentration influencing factors changing with time, c″′ ii ={c″′ ii1 ,c″′ ii2 ,...,c″′ iij ,...,c″′ iia″ },c″′ iij Indicates d″ ii The corresponding parameter data of the degree of occurrence of the pollutant concentration influencing factors at the jth time point.

6. The method for tracking and predicting urban pollutants based on big data according to claim 1 is characterized by: The S4 comprises the following steps: S41, set the training set ratio to e'%, and the test set ratio to h'%; S42, dividing the preprocessed first data matrix c′ according to the training set ratio and the test set ratio to obtain a training data set matrix f′ and a test data set matrix f″, which are respectively as follows: Where: f′ ij represents the concentration training data of the i-th urban pollutant at the j-th time point after pretreatment, f″′ represents the total number of concentration training data of the i-th urban pollutant at the j-th time point after pretreatment; f″ ij represents the concentration test data of the i-th urban pollutant after pretreatment at the j-th time point, and h″′ represents the total number of concentration test data of the i-th urban pollutant after pretreatment at the j-th time point; S43, constructing an initial XGBoost model, setting the initial maximum spanning tree count parameter of the initial XGBoost model to α, the initial learning rate parameter to α′, the maximum depth parameter of the initial tree to α″, and the initial minimum leaf node sample weight sum parameter to α″′; S44, setting an error threshold h; inputting the training data set matrix f′ and the test data set matrix f″ into the initial XGBoost model for training; using the second training data set matrix f′ and the second test data set matrix f″ to train the initial XGBoost model, and when the training error is less than h, stopping the training to obtain the trained XGBoost model; S45, input the remaining data in the preprocessed first data matrix c′ into the trained XGBoost model to obtain the first prediction data set e={e1, e2, ..., e i ,...,e a′ },e i Represents the predicted concentration data of the i-th pollutant at the next time point after the current time point.

7. The method for tracking and predicting urban pollutants based on big data according to claim 1 is characterized by: The S5 comprises the following steps: S51, collecting real data of urban pollutant concentration at a time point corresponding to the first prediction data set, and obtaining a first real data set e″={e″1, e″2, ..., e″ i ,...,e″ a },e″ i Indicates the first prediction data set e i The actual data of pollutant concentration corresponding to the i-th type; S52: The first real data set e″={e″1, e″2, ..., e″ i ,...,e″ a′ } and the first prediction data set e={e1,e2,...,e i ,...,e a′ } to make a comparison, and adjust the prediction parameters according to the comparison results; S53: The first prediction data set e={e1, e2, ..., e i ,...,e a′ } is merged with the preprocessed first data matrix c′ to obtain a fourth data matrix e″′; at the same time, the degree parameter data of the influencing factors at the time point corresponding to the first prediction data set is collected to obtain a fifth data matrix f; the fifth data matrix f is then merged with the third data matrix c″′ to obtain a sixth data matrix h″; the correlation between the sixth data matrix h″ and the fourth data matrix e″′ is calculated to obtain a second correlation data matrix g″′; the second correlation data matrix g″′ is compared with the final first correlation data matrix d″, and a secondary prediction parameter adjustment is performed according to the comparison results to obtain the final XGBoost model, and the final XGBoost model is used to predict the concentration of subsequent urban pollutants.

8. The method for tracking and predicting urban pollutants based on big data according to claim 7 is characterized by: The S52 comprises the following steps: S521, the initial maximum spanning tree count parameter of the initial XGBoost model is set to α, the initial learning rate parameter is α′, the maximum depth parameter of the initial tree is α″, and the initial minimum leaf node sample weight sum parameter is α″′ as parameters to be optimized; then the maximum value of the initial maximum spanning tree count parameter is set to α max , the minimum value is α min ; Set the maximum value of the initial learning rate parameter to α′ max , the minimum value is α′ min ; Set the maximum depth parameter of the initial tree to α″ max , the minimum value is α″ min ; Set the maximum value of the sum of the initial minimum leaf node sample weights to α″′ max , the minimum value is α″′ min ; S522, according to α max , α min , α′ max , α′ min , α″ max , α″ min , α″ max and α″′ min Normalizing the initial maximum spanning tree count parameter, the initial learning rate parameter, the maximum depth parameter of the initial tree, and the initial minimum leaf node sample weight sum parameter to obtain a normalized maximum spanning tree count parameter β, a normalized learning rate parameter β′, a normalized maximum depth parameter β″ of the tree, and a normalized minimum leaf node sample weight sum parameter β″′; S522, setting the size of the first wolf group to g, the first maximum number of iterations to g′, and the first current number of iterations to g″′; the first wolf group is represented by g″={g″1, g″2, ..., g″ i ,...,g″ g },g″ i represents the i-th wolf in the first wolf population; the first wolf population is divided into four wolf sub-populations, and the initial positions of the wolf individuals in the four wolf sub-populations are set to β, β′, β″ and β″′ respectively; S523, calculate the first wolf group g″={g″1,g″2,...,g″ i ,...,g″ g The fitness value of each wolf individual in} is calculated as follows: Where: d″′ represents the fitness value of individual wolf; S524, starting an iterative process according to the calculation formula of the fitness value of the individual wolf, updating the position of each individual wolf in the first wolf group and adding 1 to g″′ at the end of each iteration; obtaining the global best individual wolf positions of the four wolf sub-populations of the first wolf group after the current iteration, inputting the four global best individual wolf positions of the first wolf group as parameters into the trained XGBoost model, and at the same time inputting the preprocessed first data matrix c′ into the trained XGBoost model for prediction, and calculating the fitness values ​​of the individual wolves in the first wolf group again according to the prediction results; S525. Repeat S524. When g″′≥g′, stop the iteration to obtain the first optimal maximum spanning tree count parameter χ, the first optimal learning rate parameter χ′, the first optimal tree maximum depth parameter χ″, and the first optimal minimum leaf node sample weight sum parameter χ″′, and obtain the XGBoost model after the first optimization. At this point, the prediction parameter adjustment process is completed.

9. The method for tracking and predicting urban pollutants based on big data according to claim 8 is characterized by: The S53 comprises the following steps: S531: The first prediction data set e={e1, e2, ..., e i ,...,e a′ } is merged with the preprocessed first data matrix c′ to obtain a fourth data matrix e″′; at the same time, the degree parameter data of the influencing factors at the time point corresponding to the first prediction data set is collected to obtain a fifth data matrix f; the fifth data matrix f is then merged with the third data matrix c″′ to obtain a sixth data matrix h″; the correlation between the sixth data matrix h″ and the fourth data matrix e″′ is calculated to obtain a second correlation data matrix g″′; S532, comparing the second correlation data matrix g″′ with the final first correlation data matrix d″, performing secondary prediction parameter adjustment according to the comparison result, obtaining a final XGBoost model, and using the final XGBoost model to predict the concentration of subsequent urban pollutants; The specific steps include: S5321, set the size of the second wolf group to l, the second maximum number of iterations to l', and the second current number of iterations to l"; the second wolf group is represented by l"'={l"'1, l"'2, ..., l"' i ,...,l″′ l }, l″′ i represents the i-th wolf in the second wolf population; the second wolf population is divided into four wolf sub-populations, and the initial positions of the wolf individuals in the four wolf sub-populations are set to χ, χ′, χ″ and χ″′ respectively; S5322, calculate the second wolf group l″′={l″′1,l″′2,...,l″′ i ,...,l″′ l }, the second wolf population l″′={l″′1,l″′2,...,l″′ i ,...,l″′ l The fitness value calculation formula of each wolf in} is as follows: Wherein: g″′[i][j] and d″[i][j] respectively represent the data of the i-th row and j-th column in the second correlation data matrix g″′ and the data of the i-th row and j-th column in the final first correlation data matrix d″; S5323, according to the second wolf group l″′={l″′1,l″′2,...,l″′ i ,...,l″′ l }, and then the fitness value calculation formula of each wolf individual in the second wolf group is used to start the iteration process. At the end of each iteration, the position of each wolf individual in the second wolf group is updated and l″ is increased by 1; the global best wolf individual position of the four wolf sub-populations of the second wolf group after the current iteration is obtained, and the four global best wolf individual positions of the second wolf group are input as parameters to the XGBoost model after the first optimization. At the same time, the preprocessed first data matrix c′ is also input to the XGBoost model after the first optimization for prediction, and S531 is repeated according to the prediction results to calculate the fitness value of each wolf individual in the second wolf group again; S5324, repeat S5323, when l″≥l′, stop iteration, obtain the second optimal maximum spanning tree count parameter δ, the second optimal learning rate parameter δ′, the second optimal tree maximum depth parameter δ″ and the second optimal minimum leaf node sample weight sum parameter δ″′, and obtain the final XGBoost model; the secondary prediction parameter adjustment process ends here; S5325. Use the final XGBoost model to predict the concentration of subsequent urban pollutants.

10. A system for implementing the urban pollutant tracking and prediction method based on big data according to any one of claims 1 to 9, characterized in that: It includes an urban pollutant concentration data acquisition module, an influencing factor occurrence degree parameter data acquisition module, a correlation calculation module, an urban pollutant concentration prediction module, a primary prediction parameter adjustment module and a secondary prediction parameter adjustment module; The urban pollutant concentration data collection module is used to collect corresponding urban pollutant concentration data in real time according to the urban pollutant type set, initial collection time, minimum predicted sample number and collection interval time; The degree parameter data collection module of the influencing factor occurrence is used to collect the degree parameter data of the corresponding influencing factor occurrence in real time according to the pollutant concentration influencing factor set, the minimum predicted sample number, the initial collection time and the collection interval time; The correlation calculation module is used to calculate the correlation of the data in the preprocessed first data matrix and the preprocessed second data matrix and compare the calculated correlation with the final first correlation data matrix; The urban pollutant concentration prediction module is used to predict the urban pollutant concentration data at the next collection time point of the current collection time point according to the preprocessed first data matrix; The primary prediction parameter adjustment module is used to perform a primary prediction parameter adjustment; The secondary prediction parameter adjustment module is used to adjust the secondary prediction parameters.

Citation Information

Cited By

  • Urban air adsorption purification method based on forestry planning

    CN120815430A

  • Urban air adsorption purification method based on forestry planning

    CN120815430B