A lightning detection network layout optimization method
By integrating geographical, meteorological and lightning historical data, and using neural networks and reinforcement learning to optimize the layout of the lightning detection network, it solves the problem of insufficient lightning positioning accuracy in the existing technology, achieves more efficient lightning prediction and real-time adjustment, and improves lightning prediction accuracy and data collection capabilities.
Patent Information
- Application Number
- CN202311417755.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-27
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2043-10-27
AI Technical Summary
Existing lightning detection network layout optimization methods fail to effectively improve lightning positioning accuracy, especially in horizontal and vertical positioning accuracy, and fail to adjust site layout in real time to adapt to changes in lightning activity.
By integrating geographical, meteorological and lightning historical data, using neural networks and reinforcement learning methods, a lightning location prediction model is constructed, and a genetic algorithm is used to optimize the detection site layout and adjust the site layout in real time to improve the accuracy of lightning predictions.
It improves the accuracy and real-time nature of lightning prediction, reduces positioning errors, especially under dynamic changes in lightning activity hot spots, and enhances data collection capabilities and prediction accuracy.
Smart Images

Figure CN117474154B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of intelligent lightning detection, and in particular relates to a lightning detection network layout optimization method. Background Art
[0002] Thunderstorm climate is a common weather phenomenon that occurs in small and medium-scale convective systems. Thunderstorm weather is often accompanied by lightning activity, which can cause forest and oil depot fires, power supply and communication information system failures or damage, and pose a major threat to aerospace, mining, and some important and sensitive high-tech equipment. After the 1980s, the hazards caused by lightning increased significantly, especially in fields closely related to high-tech, such as aerospace, national defense, communications, electricity, computers, and electronics industries. The widespread use of large-scale and ultra-large-scale integrated circuits that are extremely sensitive to lightning electromagnetic interference has greatly increased the probability of being struck by lightning. Therefore, lightning radiation source positioning technology is particularly important.
[0003] The development of lightning radiation source location technology can predict thunderstorms and provide targeted theoretical guidance for lightning protection design. At the same time, by superimposing lightning radiation sources in different time periods, the transmission path of the lightning channel can be fully depicted, and then the physical characteristics of lightning can be studied. "Locating Preliminary Breakdown Pulses in Positive Cloud-to-Ground Lightning" ("Journal of Geophysical Research: Atmospheres" (2018)). In the literature "Leader Polarity-Reversal Feature and Charge Structure of Three Upward Bipolar Lightning Flashes" ("Jourrnal of Geophysical Research: Atmospheres" (2018)), the bipolar transmission characteristics and polarity reversal mechanism of lightning are studied. In short, lightning location technology not only provides important data support for lightning protection and lightning warning, but also plays a vital role in lightning physics research.
[0004] The commonly used lightning location technology uses the time difference algorithm (TOA), that is, the location calculation is performed based on the time difference from a radiation source to each measuring station. The geometric layout of the measuring station is one of the important factors affecting the accuracy of lightning location. The geometric distribution of the measuring station affects the positioning accuracy in both the horizontal and vertical directions. "A lowfrequency 3D lightning mapping network in north China" (Atmospheric Research) (2022). In the horizontal direction, the geometric distribution of base stations should try to avoid redundant information or overly concentrated distribution to reduce the impact of system errors. In the vertical direction, a reasonable height layout can improve the positioning accuracy and avoid errors in the height of the target object.
[0005] Patents with publication numbers CN115796578A, CN112966863A, CN105182450B, WO2023155178A1, CN102147807A, and CN102156739A propose some lightning prediction methods based on neural networks or GIS technology, but none of these methods involve the layout optimization of the lightning detection network. In summary, it is currently necessary to develop a set of lightning detection network layout optimization methods to find the optimal lightning location station layout. Summary of the invention
[0006] Technical problem to be solved: The present invention proposes a method for optimizing the layout of a lightning detection network, which integrates geographical, meteorological and historical lightning data, and optimizes and adjusts the site layout in real time through neural networks and reinforcement learning methods, thereby improving the accuracy of lightning prediction.
[0007] Technical solution:
[0008] A lightning detection network layout optimization method, the lightning detection network layout optimization method comprising the following steps:
[0009] S1, collect the terrain historical data, meteorological historical data and lightning activity historical data of each detection station in the study area, construct terrain data vector, meteorological data vector and lightning activity historical data vector respectively, and merge them to obtain data set D;
[0010] S2, standardize and normalize the data vectors in the data set to obtain the preprocessed data set D′;
[0011] S3, constructing a lightning position prediction model based on the neural network model, taking minimizing the difference between the predicted lightning position and the actual lightning position as a constraint condition, and using the preprocessed data set D′ to train the lightning position prediction model to obtain a trained lightning position prediction model;
[0012] S4, define the objective function, and use the distance between the predicted lightning location and the actual lightning location to measure the matching degree between the detection site layout and the lightning location prediction requirements; based on the objective function, use the genetic algorithm to continuously iterate the detection site layout until the stopping criterion is met, and output the optimal detection site layout; wherein, after each detection site layout is updated, the lightning location prediction model is used to calculate the predicted lightning location of the corresponding iteration round, and then the study area is divided into multiple grids, and the distance between the actual lightning location and the predicted lightning location is calculated in each grid, which is used as the prediction error of the current grid.
[0013] Furthermore, in step S1, the process of obtaining the data set D includes the following steps:
[0014] Collect the terrain historical data of each detection station in the study area and construct the terrain data vector D t ={D t,i}, D t,i =[e i , t i , m i ], where e i is the elevation data at the i-th detection station, t i is the land cover type at the i-th detection site, m i is the geomorphic feature data at the i-th detection site;
[0015] Collect meteorological data at each time point t in the study area, including temperature T t 、Humidity t , air pressure P t , wind speed W t , Wind direction Z t 、Cloud thickness C t , construct the meteorological data vector D w =[T t , H t , P t , W t , Z t , C t ];
[0016] Collect data for each lightning event I, including time T I 、Position P I 、Typetype I , intensity i I, construct lightning activity historical data vector D I =[T t , P I , type I ,i I ];
[0017] Combine the terrain historical data, meteorological data vectors and lightning activity historical data vectors to construct the data set D = [D t , D w , D I ].
[0018] Furthermore, in step S2, the following formulas are used to perform standardization and normalization on the data vectors in the data set:
[0019] X std =(X-μ) / σ
[0020] X norm =(XX min ) / (X max -X min )
[0021] In the formula, X is the original data to be processed, X std is the standardized data, μ is the mean of the same type of data to which the original data to be processed belongs, and σ is the standard deviation of the same type of data to which the original data to be processed belongs; X min and X max are the minimum and maximum values of the same type of data to which the original data to be processed belongs, X norm It is the normalized data.
[0022] Further, in step S3, the lightning location prediction model includes an input layer, a self-attention layer, a temporal convolution layer, a geographic attention pooling layer, a neural tensor network layer, a fully connected layer and an output layer;
[0023] The self-attention layer is constructed by learning the weight matrix W q , W k and W v , map the data in the dataset D′ imported by the input layer into three subspaces: query (Q), key (K), and value (V): Q = D′W q , K = D′W k , V = D′W v , calculate the attention weight:
[0024]
[0025] Among them, d k is the dimension of K;
[0026] Use the attention weight to weight the sum V and get the output O of the self-attention layer attention :
[0027] O attention =attention_weights*V;
[0028] The temporal convolution layer performs convolution operation on the time series data of lightning activity in the time dimension to capture the local patterns and trends of the time series data of lightning activity; the temporal convolution layer uses one-dimensional convolution to process the time series data, and the output of the temporal convolution layer is conv for:
[0029] O conv =relu(conv1d(O attention , kernel)+bias)
[0030] Among them, conv1d() represents a one-dimensional convolution operation, kernel is the convolution kernel, bias is the bias term, and relu() is the activation function;
[0031] The geographic attention pooling layer assigns different attention weights to different regions according to the geographic data, and pools the outputs of the convolutional layer and the attention layer. pool for:
[0032] attention_weights = softmax(W pool *O conv +b pool )
[0033] O pool =sum(attention_weights*O conv )
[0034] Among them, W pool and b pool are the weights and biases that need to be learned, softmax() is the activation function, and sum() is the weighted average operation;
[0035] The neural tensor network layer is used to process the complex relationship between geographic and meteorological data. The output of the neural tensor network layer is ntn for:
[0036] O ntn = relu(O pool *W ntn *O pool T +W iinear *O pool +b)
[0037] Among them, W ntn , W linear and b are the weights and biases to be learned, * represents matrix multiplication, and relu() is the activation function;
[0038] The fully connected layer converts the output of the neural tensor network layer into a prediction result O fc , and output the predicted lightning position y through the output layer hat :
[0039] O fc =W fc *O ntn +b fc
[0040] y hat =W out *O fc +b out
[0041] Among them, W fc and W out is the weight to be learned, b fc and b out is the bias to be learned;
[0042] The loss function of the lightning location prediction model is:
[0043]
[0044] Where θ represents the parameters of the lightning location prediction model, θ* represents the optimal parameters of the lightning location prediction model, y is the actual lightning location, It is to predict the location of lightning.
[0045] Furthermore, in step S4, the genetic algorithm is used to continuously iterate the detection site layout until the stop criterion is met, and the process of outputting the optimal detection site layout includes the following steps:
[0046] Define the mean square error objective function Used to measure the detection site layout S and predicted lightning location The degree of match between:
[0047]
[0048] Where N is the number of data points, y i is the actual lightning position of the ith observation, is the predicted lightning position of the ith observation;
[0049] The genetic algorithm is used to optimize the site layout S; in each iteration, the genetic algorithm is used to generate a new set of site layouts S, and the objective function to calculate and predict lightning locations The matching degree between them is used to evaluate the advantages and disadvantages of the new site layout S. Through selection, crossover and mutation operations, the optimal site layout S is continuously searched in the search space until the stopping criterion is met.
[0050] In each iteration of the genetic algorithm, the corresponding predicted lightning position is calculated according to the generated new site layout S The study area is then divided into multiple grids, and the size of each grid is determined by the preset accuracy threshold E m Determine; in each grid, calculate the actual lightning position y and the predicted lightning position The distance between them is taken as the prediction error:
[0051]
[0052] where, for each grid g∈G, E(g) represents the predicted lightning position in the grid The actual lightning position y g The distance between them; if E(g)<E m , then the prediction of the grid is considered accurate, the corresponding site layout S is feasible, and E m is the preset distance threshold;
[0053] The prediction accuracy of the entire study area is calculated by the proportion of accurate predictions in all grids. The formula is:
[0054]
[0055] Furthermore, the lightning detection network layout optimization method further comprises the following steps:
[0056] Define a state s for representing the current environmental situation, which includes the current lightning activity: lightning frequency, intensity, geographical location, and current detection site layout S;
[0057] Define an action set A, which contains all the allowed site layout adjustments: moving a site to a new location, adding a new site, and deleting an existing site;
[0058] Layout optimization strategy model π(s;θ nn ), the policy model determines what action to take in a given state s. The policy model is constructed using a deep learning model based on a neural network. The parameter θ nn It is the weight of the neural network model based on deep learning;
[0059] Define a reward function R(a, s) that measures the consequences of taking an action based on the accuracy of predicting the lightning location:
[0060] R(a, s) = -e(a, s)
[0061] Where e(a, s) is the prediction error of the lightning position prediction model under the scenario of state s and action a;
[0062] At each time step, the layout optimization strategy parameter θ is updated using the following formula nn :
[0063]
[0064] In the formula, α is the learning rate, a t is in state s t Next, select the action, R t is the reward received, is the gradient of the policy.
[0065] Beneficial effects:
[0066] First, the lightning detection network layout optimization method of the present invention collects historical data on terrain, meteorology and lightning activity, performs preprocessing, and uses it to train a neural network model. It takes terrain, meteorology and historical lightning activity data into consideration together, fully explores the correlation between various types of data, and improves the accuracy of prediction.
[0067] Second, the lightning detection network layout optimization method of the present invention designs a specific neural network architecture, which includes a self-attention layer, a temporal convolution layer, a geographic attention pooling layer and a neural tensor network layer, which can effectively process the complex relationships and time series characteristics in geographic and meteorological data, and increase the ability to understand geographic and meteorological data, further improving the prediction accuracy.
[0068] Third, the lightning detection network layout optimization method of the present invention designs a site layout optimization method based on a genetic algorithm. Through area division and error evaluation, the site layout generated by the genetic algorithm is evaluated, which effectively optimizes the site layout and improves the data collection capability and the accuracy of lightning prediction.
[0069] Fourth, the lightning detection network layout optimization method of the present invention proposes a real-time site layout optimization method based on reinforcement learning in order to adapt to changes in lightning activity hotspots. By defining environmental states, action sets, layout optimization strategies and reward functions, a reinforcement learning model that can dynamically adjust site layouts is designed, thereby realizing real-time optimization of site layouts. The site layout can be adjusted at any time according to the hotspots of lightning activity, thereby improving the real-time and accuracy of predictions. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] Figure 1 The horizontal positioning error distribution diagrams of the lightning low-frequency radiation source positioning network of the artificial lightning induction base before and after optimization are shown respectively; among them, (a) is the horizontal positioning error distribution diagram before optimization, and (b) is the horizontal positioning error distribution diagram after optimization;
[0071] Figure 2 They are the height positioning error distribution diagrams of the lightning low-frequency radiation source positioning network of the artificial lightning induction base; among them, (a) is the height positioning error distribution diagram before optimization, and (b) is the height positioning error distribution diagram after optimization;
[0072] Figure 3 This is a flow chart of a lightning detection network layout optimization method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0073] The following examples will enable those skilled in the art to more fully understand the present invention, but are not intended to limit the present invention in any way.
[0074] See also Figure 3 The present invention discloses a lightning detection network layout optimization method, which comprises the following steps:
[0075] S1, collect the terrain historical data, meteorological historical data and lightning activity historical data of each detection station in the study area, construct terrain data vector, meteorological data vector and lightning activity historical data vector respectively, and merge them to obtain data set D;
[0076] S2, standardize and normalize the data vectors in the data set to obtain the preprocessed data set D′;
[0077] S3, constructing a lightning position prediction model based on the neural network model, taking minimizing the difference between the predicted lightning position and the actual lightning position as a constraint condition, and using the preprocessed data set D′ to train the lightning position prediction model to obtain a trained lightning position prediction model;
[0078] S4, define the objective function, and use the distance between the predicted lightning location and the actual lightning location to measure the matching degree between the detection site layout and the lightning location prediction requirements; based on the objective function, use the genetic algorithm to continuously iterate the detection site layout until the stopping criterion is met, and output the optimal detection site layout; wherein, after each detection site layout is updated, the lightning location prediction model is used to calculate the predicted lightning location of the corresponding iteration round, and then the study area is divided into multiple grids, and the distance between the actual lightning location and the predicted lightning location is calculated in each grid, which is used as the prediction error of the current grid.
[0079] Step 1: Data collection and preprocessing
[0080] Collect various types of data, including topographic data, meteorological data, and historical records of lightning activity:
[0081] · Terrain data (D t ): including the elevation of terrain data i , land cover type i 、Geomorphological features i . Create a terrain data vector D t =[e i , t i , m i ].
[0082] · Weather data (D w ): Collect meteorological data at each time point t: temperature T t 、Humidity t , air pressure P t , wind speed W t , Wind direction Z t 、Cloud thickness C t . Create a weather data vector D w =[T t , H t , P t , W t , D t , C t ].
[0083] · Historical records of lightning activity (D I ): Collect information about each lightning event I: time t I , position p I 、Typetype I , intensity i I . Create a lightning activity data vector D I =[t I , p I , type I ,i I ].
[0084] Combining all these data, we get the data set D = [D t , D w , D I ].
[0085] Data preprocessing mainly involves standardizing and normalizing the data to ensure that all types of data are at the same level.
[0086] The standardized calculation formula is as follows:
[0087] X std =(X-μ) / σ;
[0088] The normalized calculation formula is as follows:
[0089] X orm =(XX min ) / (X max -X min );
[0090] Where X is the data to be preprocessed, X min and X max are the minimum and maximum values of the data, μ is the mean of the data, and σ is the standard deviation of the data.
[0091] After the above steps, the preprocessed data set D′ is obtained.
[0092] Step 2: Build a neural network model to predict lightning locations
[0093] Build a neural network model f that takes data D′ as input and outputs the predicted lightning location y hat The model training process is an optimization problem, whose goal is to minimize the predicted value y hat The gap between the actual value y and the actual value y is usually measured using the loss function L. This process can be described as:
[0094] y hat =f(D′;θ);
[0095] Here, θ is the parameter of the neural network.
[0096] The above neural network model can be any neural network model. The present invention proposes a new lightning location prediction model to better adapt to the lightning location prediction task. The model architecture is described as follows:
[0097] 1. Input layer: Input the preprocessed dataset D′.
[0098] 2. Self-attention layer: The self-attention mechanism helps the model focus on the most important parts of the data. This is very useful for dealing with geographic and meteorological data that have a large number of features and need to capture complex relationships between these features. The self-attention mechanism allows the model to focus on the most important parts of the input data. This is very important for lightning location prediction because some features in geographic and meteorological data may have a greater impact on the prediction results than other features.
[0099] The input dataset D′ is mapped into three subspaces: query (Q), key (K), and value (V). These mappings are achieved through the learned weight matrix W q , W k , W v The completed form is as follows:
[0100] Q=D′W q ;
[0101] K=D′W k ;
[0102] V=D′W v ;
[0103] Then, the attention weight is calculated by taking the dot product of Q and K and normalizing it through the softmax function:
[0104]
[0105] Among them, d k is the dimension of K.
[0106] Then, use these attention weights to weight the sum V and get the output:
[0107] O attention =attention_weights*V.
[0108] 3. Temporal convolution layer: Considering that the historical records of lightning activity have obvious time series characteristics, a temporal convolution layer can be designed to process this part of the data. This layer can capture local patterns and trends in time series data. The temporal convolution layer was originally designed to process data with time series characteristics, such as the historical records of lightning activity. By performing convolution operations in the time dimension, the model can capture local patterns and trends in time series data, which is very useful for predicting the location of future lightning activity.
[0109] The temporal convolution layer uses one-dimensional convolution to process time series data in the following form:
[0110] 0 conv =relu(conv1d(0 attention , kernel)+bias);
[0111] Among them, conv1d() represents a one-dimensional convolution operation, kernel is the convolution kernel, bias is the bias term, and relu() is the activation function.
[0112] 4. Geographic Attention Pooling Layer: This layer will use geographic information to pool the output of the convolutional layer and the attention layer. The geographic attention pooling here will give different attention weights to different regions based on geographic data, because some areas may be more prone to lightning. For example, high altitudes, plains, or specific climate zones may be more prone to lightning, and these areas should receive greater attention in the model.
[0113] Specifically, the input is weighted averaged using attention weights in the following form:
[0114] attention_weights = softmax(W pool *O conv +b pool );
[0115] O pool =sum(attention_weights*O conv );
[0116] Among them, W pool and b pool are the weights and biases that need to be learned, softmax() is the activation function, and sum() is the weighted average operation.
[0117] 5. Neural Tensor Network Layer: Neural Tensor Network can learn and model complex interactions between data at a higher-order perspective, which is beneficial for processing complex relationships in geographic and meteorological data. This layer is designed to better handle complex relationships in geographic and meteorological data. The calculation formula of this layer is as follows:
[0118] O ntn = relu(O pool *W ntn *O pool T +W linear *O pool + b);
[0119] Among them, W ntn , W linear and b are the weights and biases to be learned, * denotes matrix multiplication, and relu() is the activation function.
[0120] 6. Fully connected layer and output layer: The fully connected layer converts the output of the neural tensor network into a prediction result, and the output layer finally gives the predicted lightning position y hat .
[0121] O fc =W fc *O ntn +b fc ;
[0122] y nat =W out *O fc +b out ;
[0123] Among them, W fo , b fo , W out , b out are the weights and biases that need to be learned.
[0124] Finally, the following optimization problem is solved by the gradient descent method to obtain the optimal parameters of the neural network model:
[0125]
[0126] Where θ represents the parameters of the model and θ* represents the optimal parameters.
[0127] Step 3: Site layout optimization
[0128] Since the layout of the site affects the quality and quantity of the collected data, the site layout S has an important impact on the prediction result y hat The present invention uses genetic algorithm to optimize the layout of the site.
[0129] First, define an objective function 0, which measures the layout S of the site and the predicted lightning location y hat The objective function 0(S, y_hat) measures the match between the site layout S and the predicted lightning location y hat The degree of match between them can be understood as the prediction error. Given the site layout S, the predicted lightning position y can be obtained: hat , and calculate the distance between the predicted result and the actual lightning location, that is, the prediction error. By optimizing this objective function, the best site layout S can be found so that the predicted lightning location y hat This is done as closely as possible to the actual location of lightning, thereby improving the accuracy of the prediction.
[0130] The objective function O(S, y hat ) measures the relationship between the site layout S and the predicted lightning location y hat The degree of match between them can be understood as the prediction error. Given the site layout S, the predicted lightning position y can be obtained: hat , and calculate the distance between the predicted result and the actual lightning location, that is, the prediction error. By optimizing this objective function, the best site layout S can be found so that the predicted lightning location y hat This is done as closely as possible to the actual location of lightning, thereby improving the accuracy of the prediction.
[0131] Then, during the optimization process of the genetic algorithm, a new site layout S is generated in each iteration and the objective function O(S, y hat ) calculates the degree of matching to evaluate the pros and cons of the new site layout S. According to the selection, crossover and mutation operations of the genetic algorithm, the optimal site layout S is continuously searched in the search space until the stopping criterion is met (for example, a preset number of iterations is reached or the value of the objective function reaches a preset threshold).
[0132] The specific implementation process is as follows:
[0133] In each iteration of the genetic algorithm, a new set of site layouts is generated, and the corresponding predicted lightning locations are calculated using the neural network model f. After that, the area is divided into multiple grids, and the size of each grid is a preset accuracy threshold, such as 500 meters. In each grid, the distance between the actual lightning location and the predicted lightning location is calculated. This distance is regarded as the prediction error, and it is hoped that the site layout will be optimized to minimize this error. Specifically, the genetic algorithm is used to continuously iterate the detection site layout until the stopping criterion is met. The process of outputting the optimal detection site layout includes the following steps:
[0134] a. Objective function definition: First, define an objective function Used to measure the detection site layout S and predicted lightning location The degree of match between them. This function is regarded as the prediction error, where the predicted lightning location can be obtained for a given site layout S Then the difference between the predicted result and the actual lightning position y is calculated. By optimizing this objective function, an optimal site layout S can be found so that the predicted lightning position As close as possible to the actual lightning location, thus improving the accuracy of the prediction. The mean square error objective function O is defined as:
[0135]
[0136] Where N is the number of data points, y i is the actual lightning position of the ith observation, is the predicted lightning location for the ith observation. In this setting, the site layout S affects the predicted lightning location And further affects the objective function O. The goal of this solution is to find a value of the site layout S that minimizes O. This can usually be achieved through an optimization algorithm, such as a genetic algorithm (introduced in step b). In each iteration, the model f is used to make predictions based on the current site layout S and other input variables, calculate the objective function O, and update S accordingly until O reaches the set minimum value or meets other stopping criteria.
[0137] b. Genetic Algorithm Application: Next, the genetic algorithm is used to optimize the site layout S. In each iteration, the genetic algorithm generates a new set of site layouts S and uses the objective function to calculate and predict lightning locations The matching degree between them is used to evaluate the advantages and disadvantages of the new site layout S. The genetic algorithm continuously searches for the optimal site layout S in the search space through selection, crossover and mutation operations until the stopping criterion is met (for example, the preset number of iterations is reached or the value of the objective function reaches a preset threshold).
[0138] c. Grid division and accuracy calculation: Further, in each iteration of the genetic algorithm, the generated new site layout S is used in the neural network model f to calculate the corresponding predicted lightning location Next, the study area is divided into multiple grids, and the size of each grid is determined by the preset accuracy threshold E m In each grid, calculate the actual lightning position y and the predicted lightning position The distance between the two is taken as the prediction error. This process aims to optimize the site layout to minimize this error. The specific process can be described by the following formula:
[0139]
[0140] where, for each grid g∈G, E(g) represents the predicted lightning position in the grid The actual lightning position y g If E(g)<E m (The present invention makes E m =500, the prediction of the grid is considered accurate and the corresponding site layout S is feasible.
[0141] Finally, the prediction accuracy of the entire study area is calculated by the proportion of accurate predictions in all grids, and the formula is:
[0142]
[0143] Step 4: Real-time optimization of site layout
[0144] For the layout of lightning prediction sites, a fixed layout may not always be optimal. This is because optimizing the site layout can help improve the accuracy and effectiveness of lightning prediction. For example, if the hotspots of lightning activity change, the site layout may need to be adjusted accordingly so that the sites are more concentrated in these hotspots.
[0145] In order to achieve the implementation optimization of site layout, the present invention proposes a real-time optimization method for site layout based on reinforcement learning model. The specific implementation steps are as follows:
[0146] (1) Define state s: State s represents the current environmental conditions, including the current lightning activity (frequency, intensity, and geographic location of lightning) and the current site layout.
[0147] (2) Define an action set A: A: The action set A may include all possible site layout adjustments, such as moving a site to a new location, adding a new site, or deleting an existing site.
[0148] (3) Layout optimization strategy model π(s; θ nn ): The policy model determines what action (layout optimization) should be taken in a given state s. This policy model may be a neural network model based on deep learning, with parameters θ nn It is the weight of the neural network model based on deep learning.
[0149] (4) Reward function: The reward function measures the result of taking an action. For example, rewards can be given based on the accuracy of predicting the location of lightning. If the new layout can improve the prediction accuracy, then a positive reward is given; if it reduces the prediction accuracy, a negative reward is given. For each prediction step, the prediction error e(a, s) can be calculated. Then, rewards can be given based on this error:
[0150] R(a, s) = -e(a, s)
[0151] In this way, the smaller the prediction error, the larger the value of R(a, s), which encourages the reinforcement learning algorithm to find a layout strategy that can reduce the prediction error. At the same time, since negative rewards are given to actions with large prediction errors, this will punish those layout strategies that lead to a decrease in prediction accuracy.
[0152] (5) Solving the layout optimization strategy parameters: At each time step, the strategy parameter θ is updated using the following formula nn :
[0153]
[0154] In the formula, α is the learning rate, a t is in state s t Next, select the action, R t is the reward received, is the gradient of the policy.
[0155] Figure 1 (a) and Figure 2(a) in the figure shows the horizontal and height positioning error distribution diagrams of the lightning low-frequency radiation source positioning network of the artificial lightning induction base in Zhanhua, Binzhou, Shandong. The Monte Carlo method is used for error estimation. An area of 80km×80km is set with the most central measuring station as the center, and the grid point spacing is 3km. A total of 2916 grid points are used to evaluate the accuracy at an altitude of 5km. It is assumed that all stations can receive signals from all grid points. A random time error with an average value of zero and a root mean square of 80ns is introduced in the calculation. The positioning result is compared with the actual grid position to obtain the positioning error. After 1000 repeated calculations, the average positioning error of the lightning radiation source emitted at a certain location is obtained. After the station layout is optimized according to the algorithm of the present invention, Figure 1 (b) and Figure 2 In (b), it can be clearly seen that after optimization, the area with horizontal error below 200m is larger, and the positioning accuracy in the northeast-southwest region is significantly improved; similarly, the area with vertical error below 200m is larger, and the range within 1km is larger.
[0156] The above are only preferred embodiments of the present invention. The protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should be regarded as the protection scope of the present invention.
Claims
1. A lightning detection network layout optimization method, characterized in that: The lightning detection network layout optimization method comprises the following steps: S1, collect the terrain historical data, meteorological historical data and lightning activity historical data of each detection station in the study area, construct terrain data vector, meteorological data vector and lightning activity historical data vector respectively, and merge them to obtain data set D; S2, standardize and normalize the data vectors in the data set to obtain the preprocessed data set D'; S3, constructing a lightning position prediction model based on the neural network model, taking minimizing the difference between the predicted lightning position and the actual lightning position as a constraint condition, and using the preprocessed data set D' to train the lightning position prediction model to obtain a trained lightning position prediction model; S4, define the objective function, use the distance between the predicted lightning position and the actual lightning position to measure the matching degree between the detection site layout and the lightning position prediction requirements; based on the objective function, use the genetic algorithm to continuously iterate the detection site layout until the stopping criterion is met, and output the optimal detection site layout; wherein, after each detection site layout is updated, the lightning position prediction model is used to calculate the predicted lightning position of the corresponding iteration round, and then the study area is divided into multiple grids, and the distance between the actual lightning position and the predicted lightning position is calculated in each grid, which is used as the prediction error of the current grid; In step S3, the lightning location prediction model includes an input layer, a self-attention layer, a temporal convolution layer, a geographic attention pooling layer, a neural tensor network layer, a fully connected layer and an output layer; The self-attention layer is constructed by learning the weight matrix W q , W k and W v , map the data in the dataset D' imported by the input layer into three subspaces: query (Q), key (K) and value (V): Q = D'W q , K = D′W k , V = D′W v , calculate the attention weight: Among them, d k is the dimension of K; Use the attention weight to weight the sum V and get the output O of the self-attention layer attention : O attention =attention_weights*V; The temporal convolution layer performs convolution operation on the time series data of lightning activity in the time dimension to capture the local patterns and trends of the time series data of lightning activity; the temporal convolution layer uses one-dimensional convolution to process the time series data, and the output of the temporal convolution layer is conv for: Oh conv =relu(conv1d(O attention ,kernel)+bias) Among them, conv1d() represents a one-dimensional convolution operation, kernel is the convolution kernel, bias is the bias term, and relu() is the activation function; The geographic attention pooling layer assigns different attention weights to different regions according to the geographic data, and pools the outputs of the convolutional layer and the attention layer. pool for: attention_weights=softmax(W pool *O conv +b pool ) O pool =sum(attention_weights*O conv ) Among them, W pool and b pool are the weights and biases that need to be learned, softmax() is the activation function, and sum() is the weighted average operation; The neural tensor network layer is used to process the complex relationship between geographic and meteorological data. The output of the neural tensor network layer is ntn for: O ntn =relu(O pool *W ntn *O pool T +W linear *O pool +b) Among them, W ntn , W linear and b are the weights and biases to be learned, * represents matrix multiplication, and relu() is the activation function; The fully connected layer converts the output of the neural tensor network layer into a prediction result O fc , and output the predicted lightning position y through the output layer hat : O fc =W fc *O ntn +b fc y hat =W out *O fc +b out Among them, W fc and W out is the weight to be learned, b fc and b out is the bias to be learned; The loss function of the lightning location prediction model is: Where θ represents the parameters of the lightning location prediction model, θ* represents the optimal parameters of the lightning location prediction model, y is the actual lightning location, It is to predict the location of lightning; In step S4, the genetic algorithm is used to continuously iterate the detection site layout until the stopping criterion is met. The process of outputting the optimal detection site layout includes the following steps: Define the mean square error objective function Used to measure the detection site layout S and predicted lightning location The degree of match between: Where N is the number of data points, y i is the actual lightning position of the ith observation, is the predicted lightning position of the ith observation; The genetic algorithm is used to optimize the site layout S; in each iteration, the genetic algorithm is used to generate a new set of site layouts S, and the objective function to calculate and predict lightning locations The matching degree between them is used to evaluate the advantages and disadvantages of the new site layout S. Through selection, crossover and mutation operations, the optimal site layout S is continuously searched in the search space until the stopping criterion is met. In each iteration of the genetic algorithm, the corresponding predicted lightning position is calculated according to the generated new site layout S The study area is then divided into multiple grids, and the size of each grid is determined by the preset accuracy threshold E m Determine; in each grid, calculate the actual lightning position y and the predicted lightning position The distance between them is taken as the prediction error: where, for each grid g∈G, E(g) represents the predicted lightning position in the grid The actual lightning position y g The distance between them; if E(g)<E m , then the prediction of the grid is considered accurate, the corresponding site layout S is feasible, and E m is the preset distance threshold; The prediction accuracy of the entire study area is calculated by the proportion of accurate predictions in all grids. The formula is: The lightning detection network layout optimization method further comprises the following steps: Define a state s for representing the current environmental situation, which includes the current lightning activity: lightning frequency, intensity, geographical location, and current detection site layout S; Define an action set A, which contains all the allowed site layout adjustments: moving a site to a new location, adding a new site, and deleting an existing site; Layout optimization strategy model π(s;θ nn ), the policy model determines what action to take in a given state s. The policy model is constructed using a deep learning model based on a neural network. The parameter θ nn It is the weight of the neural network model based on deep learning; Define a reward function R(a,s) that measures the result of taking an action based on the accuracy of predicting the lightning location: R(a,s)=-e(a,s) Where e(a,s) is the prediction error of the lightning position prediction model under the scenario of state s and action a; At each time step, the layout optimization strategy parameter θ is updated using the following formula nn : In the formula, α is the learning rate, a t is in state s t Next, select the action, R t is the reward received, is the gradient of the policy.
2. The lightning detection network layout optimization method according to claim 1, characterized in that: In step S1, the process of obtaining the data set D includes the following steps: Collect the terrain historical data of each detection station in the study area and construct the terrain data vector D t ={D t,i }, D t,i =[e i ,t i ,m i ], where e i is the elevation data at the i-th detection station, t i is the land cover type at the i-th detection site, m i is the geomorphic feature data at the i-th detection site; Collect meteorological data at each time point t in the study area, including temperature T t 、Humidity t , air pressure P t , wind speed W t , Wind direction Z t 、Cloud thickness C t , construct the meteorological data vector D w =[T t ,H t ,P t ,W t ,Z t ,C t ]; Collect data for each lightning event I, including time T I 、Position P I 、Typetype I , intensity i I , construct lightning activity historical data vector D I =[T t ,P I ,type I ,i I ]; Combine the terrain historical data, meteorological data vectors and lightning activity historical data vectors to construct the data set D = [D t ,D w ,D I ].
3. The lightning detection network layout optimization method according to claim 1, characterized in that: In step S2, the data vectors in the data set are standardized and normalized using the following formulas: X std =(X-μ) / σ X norm =(X-X min ) / (X max -X min ) In the formula, X is the original data to be processed, X std is the standardized data, μ is the mean of the same type of data to which the original data to be processed belongs, and σ is the standard deviation of the same type of data to which the original data to be processed belongs; X min and X max are the minimum and maximum values of the same type of data to which the original data to be processed belongs, X norm It is the normalized data.
Citation Information
Patent Citations
Mass lightning data space-time analysis method based on GIS
CN102147807A
GIS (Geographic Information System) platform processing method for mass lightning data
CN102156739A
A short-term warning system for severe convective weather
CN105182450B
Integrated intelligent grid forecasting service system for weather forecasting
CN112966863A
Intelligent lightning protection system and method based on Internet of Things
CN115796578A
