Method, device, terminal and storage medium for air quality prediction
By introducing adaptive genetic algorithms and improved genetic simulation annealing algorithms into the Kriging model, the problem of inaccurate optimization results in the air prediction method is solved, and more accurate prediction of spatial distribution of air mass is achieved.
Patent Information
- Application Number
- CN202210288310.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-22
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2042-03-22
AI Technical Summary
In the existing air prediction method, the initial data processing based on the Kriging model has the problem of inaccurate optimization results.
Adaptive genetic algorithm is introduced, and the probability of crossing and mutation is adjusted through sigmoid function and Metropolis criterion is increased to increase the diversity of population individuals, and an improved genetic simulation annealing algorithm is applied in the Kriging model to avoid falling into local optimal solutions.
The spatial distribution accuracy of air quality prediction is improved, ensuring that the algorithm converges to the global optimal solution, and enhancing the accuracy of prediction.
Smart Images

Figure CN114611695B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of statistics, and in particular to a method, device, terminal and storage medium for air quality prediction. Background Art
[0002] Atmospheric environmental pollution is one of the environmental pollutions that currently plagues my country. It has caused many obstacles to daily life, transportation and other activities, and has seriously affected people's physical and mental health, causing serious losses to the economy of families and the country. Kriging interpolation is a common spatial interpolation method based on mathematical models and statistical models. It associates probability and prediction results, and gives incompletely accurate prediction values and error values from statistical models. This method performs linear, optimal and unbiased estimation of regionalized variable values of unsampled points, taking into account both the spatial correlation of variables and the positional relationship between known data points and the points to be estimated. Today, Kriging technology is not only used in research fields such as geology and mining, but is also widely used in research fields such as meteorology, remote sensing, resources and environment.
[0003] Kriging models can be roughly divided into intelligent optimization algorithms and traditional mathematical methods to optimize related parameters. Traditional mathematical statistics methods mainly use maximum likelihood method, linear programming method, weighted least squares method, etc. to optimize. The Kriging model construction algorithm proposed by Lophaven is widely used. It uses a pattern search algorithm to determine relevant parameters. The pattern search algorithm is a direct search numerical optimization method. It starts from a given starting point and uses detection movement and pattern movement to complete the optimization process. Its biggest disadvantage is that the optimization result is very sensitive to the starting point. The Kriging model constructed by solving the relevant parameter vector is not necessarily the best.
[0004] In the existing air prediction methods, the initial data processing based on the Kriging model has the problem of inaccurate optimization results. Summary of the invention
[0005] The embodiments of the present invention provide a method, device, terminal and storage medium for air quality prediction to solve the problem that the existing solutions have inaccurate optimization results for initial data processing for air quality prediction.
[0006] A first aspect of an embodiment of the present invention provides a method for air quality prediction, comprising: randomly initializing a population according to a genetic algorithm, and giving an initial temperature , termination temperature and the maximum number of iterations ;
[0007] Execute a cyclic iteration process until a preset condition is met, the cyclic iteration process comprising: calculating the fitness function value of each individual in the contemporary initial population according to a fitness function value calculation formula, determining the minimum individual fitness value and the average value of all individual fitness values; performing a crossover operation and a mutation operation on the initial population according to a sigmoid function, the minimum fitness value of all individuals and the average value of all individual fitness values to obtain a first population; performing a replacement operation or an evolutionary reversal operation according to a Metropolis criterion and a difference between a new fitness value and an old fitness value of each individual in the first population to obtain a second population, and replacing the worst individual in the second population with the best individual in the contemporary initial population as the next generation initial population;
[0008] The preset condition is that after the cooling annealing operation is performed on the second population, the temperature and the number of iterations do not meet the exit condition;
[0009] After the iterative process is finished, the optimal individual information in the second population at the time of termination of the iteration is output and substituted into the Kriging model for air quality prediction data difference processing.
[0010] In a possible implementation, performing a crossover operation and a mutation operation on the initial population according to a sigmoid function, a minimum value of all individual fitnesses, and an average value of all individual fitnesses includes:
[0011] The crossover rate is adjusted according to the following formula:
[0012]
[0013] The mutation rate is adjusted according to the following formula:
[0014]
[0015] in, and are the maximum and minimum values of the crossover rate respectively; and are the maximum and minimum values of the mutation rate respectively; is the minimum fitness of all individuals; is the average fitness of all individuals; is the fitness value during the crossover process; The curve smoothing parameter is used to adjust the smoothness of the curve.
[0016] In a possible implementation, before performing the replacement operation or the evolution reversal operation according to the Metropolis criterion and the difference between the new fitness and the old fitness of each individual in the first population, the method further includes:
[0017] The probability of acceptance is determined according to the following formula:
[0018]
[0019] in, is the probability of acceptance; is a constant; is the current temperature; It is the first The fitness value of each individual; is the first The fitness value of an individual.
[0020] In a possible implementation, performing a replacement operation or an evolutionary reversal operation according to the Metropolis criterion and the difference between the new fitness and the old fitness of each individual in the first population includes:
[0021] When the fitness value of an individual in the initial population is greater than the fitness value of the corresponding individual in the first population, a replacement operation is performed to replace the corresponding old individual with the new individual;
[0022] When the individual fitness value of the initial population is less than or equal to the corresponding individual fitness value in the first population, an evolutionary reversal operation is used to reverse part of the sequence genes in the individual.
[0023] In a possible implementation, the evolution reversal operation includes:
[0024] Two critical points were randomly set in the individual coding strings;
[0025] The gene sequences within the two critical points are reversed.
[0026] In a possible implementation, after the evolution reversal operation is performed, the method further includes:
[0027] The new individual replaces the corresponding old individual with probability P.
[0028] In a possible implementation, the exit condition includes: or ;in, is the current iteration number; is the maximum number of iterations; is the current temperature; is the termination temperature.
[0029] In a possible implementation, the fitness function value calculation formula is:
[0030]
[0031] in, is the sample point and The related functions of is the first individual; ; ; is the relevant parameter vector; is the dimension of the space; It is The individual Dimensional component; yes An estimated value of is composed of sample data response values Dimensional column vector.
[0032] A second aspect of an embodiment of the present invention provides an apparatus for air quality prediction, comprising:
[0033] Initialization module, used to randomly initialize the population according to the genetic algorithm and give the initial temperature , termination temperature and the maximum number of iterations ;
[0034] A population optimization module is used to execute a cyclic iteration process until a preset condition is met; the cyclic iteration process includes: calculating the fitness function value of each individual in the contemporary initial population according to the fitness function value calculation formula, determining the minimum individual fitness and the average value of all individual fitness; performing a crossover operation and a mutation operation on the initial population according to the sigmoid function, the minimum fitness of all individuals and the average value of all individual fitness to obtain a first population; performing a replacement operation or an evolutionary reversal operation according to the Metropolis criterion and the difference between the new fitness and the old fitness of each individual in the first population to obtain a second population, and replacing the worst individual in the second population with the best individual in the contemporary initial population as the next generation initial population;
[0035] The preset condition is that after the cooling annealing operation is performed on the second population, the temperature and the number of iterations do not meet the exit condition;
[0036] The output module is used to output the optimal individual information in the second population when the iteration is terminated after the iteration process is completed, and substitute it into the Kriging model for air quality prediction data difference processing.
[0037] A third aspect of an embodiment of the present invention provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for air quality prediction as described above when executing the computer program.
[0038] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for air quality prediction as described above is implemented.
[0039] The embodiment of the present invention provides a method, device, terminal and storage medium for air quality prediction. The embodiment of the present invention introduces an adaptive genetic algorithm into a Kriging model, so that the crossover and mutation probabilities of the genetic algorithm part can be nonlinearly adaptively adjusted, the Metropolis criterion is improved, and a gene reversal operation is performed on individuals with poor performance, thereby increasing the diversity of population individuals. The improved genetic simulated annealing algorithm takes into account the advantages of the simulated annealing algorithm that can avoid falling into a local optimum and the fast convergence speed of the genetic algorithm, and can more accurately predict the spatial distribution of air quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0041] Figure 1 is a flow chart of a method for air quality prediction provided by an embodiment of the present invention;
[0042] Figure 2 is a schematic diagram of a sigmoid curve for cross rate adjustment provided by an embodiment of the present invention;
[0043] Figure 3 is a schematic diagram of a sigmoid curve for mutation rate adjustment provided by an embodiment of the present invention;
[0044] Figure 4 is a schematic diagram of air quality prediction results shown in a specific embodiment of the present invention;
[0045] Figure 5 is a schematic structural diagram of a device for air quality prediction provided by an embodiment of the present invention;
[0046] Figure 6 is a schematic diagram of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0047] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.
[0048] The present invention aims to provide an improved genetic simulated annealing algorithm based on traditional Kriging interpolation, which can converge the algorithm to the global optimal solution by setting a higher initial temperature and delaying the annealing process, so as to solve the problem of inaccurate optimization results in the existing air prediction method when performing initial data processing according to the Kriging model.
[0049] The Kriging model is a high-precision interpolation model, and its random process expression is:
[0050] (1)
[0051] Where: is the global trend model, which is Related unknown functions, usually is the unknown constant term; is a random variable with variance , a random process with mean 0.
[0052] random variable The covariance matrix of is expressed as follows:
[0053] (2)
[0054] Where: is the sample point and The related function of It is Sample points.
[0055] The correlation function used in this paper is the currently popular "Gaussian exponential model", and its expression is:
[0056] (3)
[0057] Where: is the dimension of the space; It is The individual Dimensional component; is the unknown related parameter vector, which can generally be used as a scalar Alternative.
[0058] Formula (3) can be transformed into the following expression:
[0059] (4)
[0060] After calculating the unknown point The estimated value expression at is:
[0061] (5)
[0062] Where: yes An estimated value of are samples and unknown points The correlation vector between is an M-dimensional column vector consisting of sample data response values; For elements that are all 1 Dimensional column vector. The calculation expression is as follows:
[0063] (6)
[0064] Variance estimate Depend on and y gives:
[0065] (7)
[0066] The relevant parameters of formula (4) , the maximum likelihood expression can be transformed into the following expression:
[0067] (8)
[0068] Where: , All are parameters Related functions. The maximization problem of expression (8) can be transformed into the minimization problem of expression (9):
[0069] (9)
[0070] From the above calculation, it can be seen that any relevant parameter The corresponding Kriging interpolation model can be established, and the optimal Kriging model can be obtained by solving the optimization problem of expression (9).
[0071] The present invention aims to apply the improved genetic simulated annealing algorithm to solve the optimal value of expression (9), thereby obtaining the optimal Kriging model. To make the purpose, technical solution and advantages of the present invention clearer, the following will be described through specific embodiments in conjunction with the accompanying drawings.
[0072] See also Figure 1 , which shows a flow chart of an implementation of a method for air quality prediction provided by an embodiment of the present invention, comprising the following steps:
[0073] S101, randomly initialize the population according to the genetic algorithm and give the initial temperature , termination temperature and the maximum number of iterations .
[0074] S102, executing a loop iteration process until a preset condition is met.
[0075] The iterative process includes:
[0076] Step a, calculating the fitness function value of each individual in the contemporary initial population according to the fitness function value calculation formula, determining the minimum individual fitness value and the average value of all individual fitness values;
[0077] Step b, performing crossover and mutation operations on the initial population according to the sigmoid function, the minimum value of all individual fitnesses and the average value of all individual fitnesses to obtain the first population;
[0078] Step c, performing a replacement operation or an evolutionary reversal operation according to the Metropolis criterion and the difference between the new fitness and the old fitness of each individual in the first population to obtain a second population;
[0079] Step d: Replace the worst individual of the second population with the best individual in the current initial population as the initial population of the next generation.
[0080] After the second population is obtained in step c, step d is executed if the preset condition is not met, and the loop iteration process is exited and step S103 is executed if the preset condition is met. The preset condition is that after the second population is subjected to the cooling annealing operation, both the temperature and the number of iterations do not meet the exit condition.
[0081] Among them, in step a, the fitness function value calculation formula is the above expression (9), that is, the fitness function value calculation formula is;
[0082]
[0083] in, is the sample point and The related functions of is the first individual; ; ; is the relevant parameter vector; is the dimension of the space; It is The individual Dimensional component; yes An estimated value of is composed of sample data response values Dimensional column vector.
[0084] The crossover rate and mutation rate of the standard genetic algorithm are fixed. In step S101, an adaptive genetic algorithm is introduced. In step S102, the adaptive crossover rate and mutation rate adjustment curves are nonlinearized based on the sigmoid function during the loop iteration process. The fitness of the individual is compared with the average fitness of the contemporary population. In the population evolution, the pattern of excellent individuals is effectively retained, the mutation ability of poor individuals is enhanced, and the algorithm jumps out of the local optimal solution to overcome the disadvantage of premature maturity. In addition, the Metropolis criterion is improved during the loop iteration process, and the gene reversal operation is performed on individuals with poor performance to increase the diversity of individuals in the population.
[0085] S103, after the iterative process is finished, the optimal individual information in the second population at the time of terminating the iteration is output and substituted into the Kriging model for air quality prediction data difference processing.
[0086] In the embodiment of the present invention, an adaptive genetic algorithm is introduced into the Kriging model, so that the crossover and mutation probabilities of the genetic algorithm part can be nonlinearly adaptively adjusted, the Metropolis criterion is improved, and the gene reversal operation is taken for individuals with poor performance, thereby increasing the diversity of population individuals. The improved genetic simulated annealing algorithm takes into account the advantages of the simulated annealing algorithm in avoiding falling into the local optimum and the fast convergence speed of the genetic algorithm, and can more accurately predict the spatial distribution of air quality.
[0087] In a possible implementation, a crossover operation and a mutation operation are performed on the initial population according to the sigmoid function, the minimum value of all individual fitnesses, and the average value of all individual fitnesses, including:
[0088] The crossover rate is adjusted according to the following formula:
[0089]
[0090] The mutation rate is adjusted according to the following formula:
[0091]
[0092] in, and are the maximum and minimum values of the crossover rate respectively; and are the maximum and minimum values of the mutation rate respectively; is the minimum fitness of all individuals; is the average fitness of all individuals; is the fitness value during the crossover process; The curve smoothing parameter is used to adjust the smoothness of the curve. Set to 9.903438.
[0093] Figure 2 Schematic diagram of the sigmoid curve used for cross rate adjustment. Figure 3 is a schematic diagram of the sigmoid curve used for mutation rate adjustment. Figure 2 and 3 As shown, the crossover rate and mutation rate change nonlinearly according to the sigmoid curve based on the individual fitness value between the minimum fitness value and the average fitness value.
[0094] Among them, the crossover rate and mutation rate are in the interval Slowly rising is conducive to protecting the excellent individuals in the population from destruction; the crossover rate and mutation rate are in the range A rapid rise is beneficial to the poor individuals in the evolving population. The crossover mutation rate using the sigmoid curve can maximize the retention of excellent individuals with small fitness, while allowing poor individuals with large fitness to evolve with a high probability, thereby ensuring that the population converges to the optimal value.
[0095] In a possible implementation, before performing a replacement operation or an evolutionary reversal operation according to the Metropolis criterion and the difference between the new fitness and the old fitness of each individual in the first population in step S104, the method further includes:
[0096] The probability of acceptance is determined according to the following formula:
[0097]
[0098] in, is the probability of acceptance; is a constant; is the current temperature; It is the first group. The fitness value of each individual; is the first The fitness value of an individual.
[0099] In a possible implementation, step c performs a replacement operation or an evolutionary reversal operation according to the Metropolis criterion and the difference between the new fitness and the old fitness of each individual in the first population, including:
[0100] When the fitness value of an individual in the initial population is greater than the fitness value of the corresponding individual in the first population, a replacement operation is performed to replace the corresponding old individual with the new individual;
[0101] When the individual fitness value of the initial population is less than or equal to the corresponding individual fitness value in the first population, an evolutionary reversal operation is used to reverse some sequence genes in the individual.
[0102] In a possible implementation, the reversal operation includes:
[0103] Two critical points were randomly set in the individual coding strings;
[0104] The gene sequences within two critical points are reversed.
[0105] The reversal operation is described using a specific embodiment: for example, the binary code string is 101101001011, and the critical points randomly selected are the 3rd and 11th positions. The gene sequence within the two critical points is 1010010, which is 0100101 after reversal. The binary code string of the gene sequence after reversal is 101010010111.
[0106] In a possible implementation, after the evolution reversal operation is performed, the following steps are further included:
[0107] By probability Replace the corresponding old individuals with new ones.
[0108] Specifically, if the probability If the random number is greater than the interval [0,1), the new individual is accepted; if not, the old individual is retained.
[0109] Among them, when faced with a poor new individual, the improved Metropolis criterion attempts to reverse part of the sequence genes of the chromosome to improve the performance of the individual, and then replaces the old individual with probability P. This method can effectively enrich the individual diversity of the population and enhance the optimization ability of the annealing algorithm.
[0110] In a possible implementation, the exit condition includes: or ;in, is the current iteration number; is the maximum number of iterations; is the current temperature; is the termination temperature.
[0111] Among them, in order to delay the annealing process and avoid falling into the local optimum and the genetic algorithm converges quickly, the termination temperature should not be too large, but to avoid the optimization time process, the termination temperature should not be too small.
[0112] For example, .in, is the termination temperature, is the starting temperature, and The ratio is 0.99. Optional, and The ratio is 0.7~0.99.
[0113] like Figure 4 1 is a schematic diagram of an air quality prediction result shown in a specific embodiment. The result is obtained after interpolation processing based on the improved Kriging model according to the method for air quality prediction provided by the embodiment of the present invention.
[0114] Among them, 11 cities including Shijiazhuang, Handan, Tangshan and Zhangjiakou in Hebei Province were selected as research objects, and the longitude, latitude and monthly average air quality index values of the 11 cities were used as experimental data.
[0115] Initialize the population and set the number of iterations =150, population size =30, crossover probability = 0.7, mutation probability = 0.05, initial temperature =100, termination temperature =0.001, the maximum and minimum values of the crossover probability are 0.7 and 0.4; the maximum and minimum values of the mutation probability are 0.045 and 0.005.
[0116] Run the improved genetic simulated annealing algorithm to find The optimal solution is [19.9245 19.9245]. Substituting the experimental data into the optimized Kriging model for solution, the result is as follows Figure 4 As shown, the spatial distribution map of air quality index values in Hebei Province is obtained.
[0117] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0118] The following is an embodiment of the device of the present invention. For details not described in detail, reference may be made to the corresponding method embodiments described above.
[0119] Figure 5 The following is a schematic diagram of the structure of the device for air quality prediction provided by an embodiment of the present invention. For ease of description, only the parts related to the embodiment of the present invention are shown, which are described in detail as follows:
[0120] like Figure 5 As shown, the device for air quality prediction includes: an initialization module 501, a population optimization module 502 and an output module 503.
[0121] Initialization module 501 is used to randomly initialize the population according to the genetic algorithm and give an initial temperature , termination temperature and the maximum number of iterations .
[0122] The population optimization module 502 is used to perform a cyclic iteration process until a preset condition is met. The cyclic iteration process includes: calculating the fitness function value of each individual in the contemporary initial population according to the fitness function value calculation formula, determining the minimum individual fitness and the average value of all individual fitness; performing crossover and mutation operations on the initial population according to the sigmoid function, the minimum fitness of all individuals and the average value of all individual fitness to obtain a first population; performing a replacement operation or evolutionary reversal operation according to the Metropolis criterion and the difference between the new fitness and the old fitness of each individual in the first population to obtain a second population, and replacing the worst individual in the second population with the best individual in the contemporary initial population as the next generation initial population.
[0123] Among them, the preset condition is that after the cooling annealing operation is performed on the second population, the temperature and the number of iterations do not meet the exit condition.
[0124] The output module 503 is used to output the optimal individual information in the second population when the iteration is terminated after the iteration process is completed, and substitute it into the Kriging model for air quality prediction data difference processing.
[0125] In the embodiment of the present invention, an adaptive genetic algorithm is introduced into the Kriging model, so that the crossover and mutation probabilities of the genetic algorithm part can be nonlinearly adaptively adjusted, the Metropolis criterion is improved, and the gene reversal operation is taken for individuals with poor performance, thereby increasing the diversity of population individuals. The improved genetic simulated annealing algorithm takes into account the advantages of the simulated annealing algorithm in avoiding falling into the local optimum and the fast convergence speed of the genetic algorithm, and can more accurately predict the spatial distribution of air quality.
[0126] Figure 6 is a schematic diagram of a terminal provided by an embodiment of the present invention. Figure 6 As shown, the terminal 6 of this embodiment includes: a processor 60, a memory 61, and a computer program 62 stored in the memory 61 and executable on the processor 60. When the processor 60 executes the computer program 62, the steps in the above-mentioned method embodiments for air quality prediction are implemented, for example Figure 1 Alternatively, when the processor 60 executes the computer program 62, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Figure 5 Functions of modules 501 to 503 are shown.
[0127] Exemplarily, the computer program 62 may be divided into one or more modules / units, which are stored in the memory 61 and executed by the processor 60 to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program 62 in the terminal 6. For example, the computer program 62 may be divided into Figure 5 Modules 501 to 503 are shown.
[0128] The terminal 6 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal 6 may include, but is not limited to, a processor 60 and a memory 61. Those skilled in the art will appreciate that Figure 6 It is only an example of terminal 6 and does not constitute a limitation on terminal 6. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal may also include input and output devices, network access devices, buses, etc.
[0129] The processor 60 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0130] The memory 61 may be an internal storage unit of the terminal 6, such as a hard disk or memory of the terminal 6. The memory 61 may also be an external storage device of the terminal 6, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal 6. Further, the memory 61 may also include both an internal storage unit of the terminal 6 and an external storage device. The memory 61 is used to store the computer program and other programs and data required by the terminal. The memory 61 may also be used to temporarily store data that has been output or is to be output.
[0131] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0132] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0133] 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 to be beyond the scope of the present invention.
[0134] In the embodiments provided by the present invention, it should be understood that the disclosed devices / terminals and methods can be implemented in other ways. For example, the device / terminal embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, 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.
[0135] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0136] In addition, each functional unit in each embodiment of the present invention 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. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0137] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. According to this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned method embodiments for air quality prediction can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0138] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A method for air quality prediction, characterized in that: include: Using longitude, latitude and monthly average air quality index as initial data, the population is randomly initialized according to the genetic algorithm, and the initial temperature is given , termination temperature and the maximum number of iterations ; Execute a cyclic iteration process until a preset condition is met, the cyclic iteration process comprising: calculating the fitness function value of each individual in the contemporary initial population according to a fitness function value calculation formula, determining the minimum individual fitness value and the average value of all individual fitness values; performing a crossover operation and a mutation operation on the initial population according to a sigmoid function, the minimum fitness value of all individuals and the average value of all individual fitness values to obtain a first population; performing a replacement operation or an evolutionary reversal operation according to a Metropolis criterion and a difference between a new fitness value and an old fitness value of each individual in the first population to obtain a second population, and replacing the worst individual in the second population with the best individual in the contemporary initial population as the next generation initial population; The preset condition is that after the cooling annealing operation is performed on the second population, the temperature and the number of iterations do not meet the exit condition; After the iterative process is finished, the optimal individual information in the second population at the time of termination of the iteration is output and substituted into the Kriging model for air quality prediction data difference processing to obtain the spatial distribution map of the air quality index value.
2. The method according to claim 1, characterized in that The crossover operation and mutation operation are performed on the initial population according to the sigmoid function, the minimum value of all individual fitness and the average value of all individual fitness, including: The crossover rate is adjusted according to the following formula: The mutation rate is adjusted according to the following formula: in, and are the maximum and minimum values of the crossover rate respectively; and are the maximum and minimum values of the mutation rate respectively; is the minimum fitness of all individuals; is the average fitness of all individuals; is the fitness value during the crossover process; The curve smoothing parameter is used to adjust the smoothness of the curve.
3. The method according to claim 1, characterized in that Before performing a replacement operation or an evolutionary reversal operation according to the Metropolis criterion and the difference between the new fitness and the old fitness of each individual in the first population, the method further includes: The probability of acceptance is determined according to the following formula: in, is the probability of acceptance; is a constant; is the current temperature; It is the first The fitness value of each individual; is the first The fitness value of an individual.
4. The method according to claim 3, characterized in that The performing of a replacement operation or an evolutionary reversal operation according to the Metropolis criterion and the difference between the new fitness and the old fitness of each individual in the first population comprises: When the fitness value of an individual in the initial population is greater than the fitness value of the corresponding individual in the first population, a replacement operation is performed to replace the corresponding old individual with the new individual; When the individual fitness value of the initial population is less than or equal to the corresponding individual fitness value in the first population, an evolutionary reversal operation is used to reverse part of the sequence genes in the individual.
5. The method according to claim 4, characterized in that The evolution reversal operation comprises: Two critical points were randomly set in the individual coding strings; The gene sequences within the two critical points are reversed.
6. The method according to claim 4, characterized in that After the evolution reversal operation is adopted, the method further comprises: The new individual replaces the corresponding old individual with probability P.
7. The method according to any one of claims 1 to 6, characterized in that: The exit conditions include: or ;in, is the current iteration number; is the maximum number of iterations; is the current temperature; is the termination temperature.
8. A device for air quality prediction, characterized in that: include: The initialization module is used to use longitude, latitude and monthly average air quality index values as experimental data, randomly initialize the population according to the genetic algorithm, and give the initial temperature , termination temperature and the maximum number of iterations ; A population optimization module is used to execute a cyclic iterative process until the preset conditions are met; The cyclic iteration process includes: calculating the fitness function value of each individual in the contemporary initial population according to the fitness function value calculation formula, determining the minimum individual fitness and the average value of all individual fitness; performing crossover operation and mutation operation on the initial population according to the sigmoid function, the minimum fitness of all individuals and the average value of all individual fitness, to obtain a first population; performing a replacement operation or an evolutionary reversal operation according to the Metropolis criterion and the difference between the new fitness and the old fitness of each individual in the first population, to obtain a second population, and replacing the worst individual in the second population with the best individual in the contemporary initial population as the next generation initial population; The preset condition is that after the cooling annealing operation is performed on the second population, the temperature and the number of iterations do not meet the exit condition; The output module is used to output the optimal individual information in the second population when the iteration is terminated after the iteration process is completed, and substitute it into the Kriging model for air quality prediction data difference processing to obtain the spatial distribution map of the air quality index value.
9. A terminal comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method as claimed in any one of claims 1 to 7 are implemented.
