Prediction method, device, equipment and storage medium for harmful gas diffusion in semi-enclosed space

By applying dynamic grid reconstruction, deep reinforcement learning and Monte Carlo tree search algorithm in semi-enclosed space, the problem of insufficient dynamic adaptability and accuracy of harmful gas diffusion prediction in the prior art is solved, and efficient and accurate gas diffusion path prediction is achieved, enhancing public safety.

CN118824408BActive Publication Date: 2025-05-02NANJING LONGDUN INTELLIGENT TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410807626.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-21
Publication Date
2025-05-02
Estimated Expiration
2044-06-21

AI Technical Summary

Technical Problem

The prior art lacks dynamic adaptability and accuracy when predicting the diffusion of harmful gases in semi-enclosed spaces, especially in the early stages of gas leakage and high concentration areas, where prediction accuracy decreases and historical data cannot be effectively utilized.

Method used

Dynamic grid reconstruction, deep reinforcement learning and Monte Carlo tree search algorithm are used to dynamically adjust the grid layout, combine historical and real-time data for learning and training, and predict gas diffusion paths.

Benefits of technology

It significantly improves the real-time and accuracy of harmful gas diffusion prediction, can capture gas diffusion details more accurately and adapt to environmental changes in real time, provide immediate and accurate early warning information, and enhance public safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118824408B_ABST
    Figure CN118824408B_ABST
Patent Text Reader

Abstract

The present invention discloses a prediction method, device, equipment and storage medium for the diffusion of harmful gases in a semi-enclosed space, the method comprising: collecting initial data; according to the initial data, using a dynamic grid reconstruction algorithm, adjusting the grid size according to the gas concentration change and the airflow dynamics characteristics, and dynamically constructing a spatial grid model; constructing a deep reinforcement learning model, and performing learning and training through the initial data in each grid of the spatial grid model to obtain a trained reinforcement learning model; obtaining real-time gas concentration distribution data; by combining the deep reinforcement learning model and the Monte Carlo tree search algorithm, and based on the real-time gas concentration distribution data and real-time environmental parameters, predicting the future diffusion path of harmful gases in the semi-enclosed space. The present invention can improve the real-time and accuracy of the prediction of the diffusion of harmful gases in the semi-enclosed space.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of digital processing technology, and in particular to a prediction method, device, equipment and storage medium for the diffusion of harmful gases in a semi-enclosed space. Background Art

[0002] In the context of rapid development of modern cities and industries, semi-enclosed spaces such as subways, underground parking lots, tunnels, warehouses, etc. are increasing day by day, and these environments have become an indispensable part of people's lives and work. However, this is accompanied by the potential risk of harmful gas leakage. Frequent incidents such as gas leaks and chemical spills pose a serious threat to public safety. Once harmful gases spread in a semi-enclosed space, the consequences may deteriorate rapidly, leading to poisoning, fire, or even explosion. Therefore, accurate prediction of gas diffusion paths and concentration distribution is crucial for timely initiation of emergency response.

[0003] The problem with existing technologies is that the dynamic adaptability and accuracy of the prediction model are insufficient. Traditional gas diffusion models mostly rely on static grid layouts and simplified environmental assumptions, and cannot dynamically adapt to the ever-changing gas concentrations and complex airflow characteristics in the actual environment, especially in the early stages of gas leakage and in high-concentration areas, where the prediction accuracy drops sharply. In addition, the models often ignore the effective use of historical data, especially the historical trajectory information of gas diffusion, resulting in a lack of continuity and predictability in the prediction of gas diffusion behavior. Therefore, how to build a prediction system in a complex, dynamically changing semi-enclosed space that can accurately capture the details of gas diffusion and adapt to environmental changes in real time has become a technical problem that needs to be solved urgently. Summary of the invention

[0004] The embodiments of the present invention provide a method, device, equipment and storage medium for predicting the diffusion of harmful gases in a semi-enclosed space. By introducing dynamic grid reconstruction, deep reinforcement learning and Monte Carlo tree search algorithm, the real-time and accuracy of the prediction of the diffusion of harmful gases in a semi-enclosed space can be improved to ensure public safety.

[0005] An embodiment of the present invention provides a method for predicting the diffusion of harmful gases in a semi-enclosed space, comprising:

[0006] Collect initial data; the initial data includes the three-dimensional structure information of the semi-enclosed space, initial environmental parameters and historical gas concentrations at each detection location;

[0007] According to the initial data, a dynamic grid reconstruction algorithm is used to adjust the grid size according to the change of gas concentration and the dynamic characteristics of the airflow, and a spatial grid model is dynamically constructed;

[0008] Construct a deep reinforcement learning model, and perform learning and training through the initial data in each grid of the spatial grid model to obtain a trained reinforcement learning model;

[0009] Obtain real-time gas concentration distribution data;

[0010] By combining the deep reinforcement learning model and the Monte Carlo tree search algorithm, and based on real-time gas concentration distribution data and real-time environmental parameters, the future diffusion path of harmful gases in semi-enclosed spaces can be predicted.

[0011] As an improvement of the above scheme, the dynamic grid reconstruction algorithm is used according to the initial data, the grid size is adjusted according to the gas concentration change and the airflow dynamics characteristics, and the spatial grid model is dynamically constructed, including:

[0012] According to the spatial information collected by the laser radar and the environmental sensor network, a basic uniform grid model is generated. The initial grid set is G 0 = {g 1 , g 2 , ..., g N-1 , g N}; where g 1 , g 2 ,...,g N-1 , g N is the set G 0 The grid elements in g 1 is the first element, g N is the Nth element, where N is the total number of grids;

[0013] For each grid g i Calculate the concentration gradient ΔC and the fluid dynamics factor Λ; Λ=α·V i +β··γ·ΔC;V i is the grid g i The average wind speed in the grid, α, β, and γ are adjustment factors, balancing the influence of wind speed and concentration gradient on grid adjustment;

[0014] According to the gas concentration change rate ΔC i and the hydrodynamic factor Λ, and based on the grid adjustment function for each grid g i Calculate an adjustment factor, the grid adjustment function is: AdjustGridDensity(g i ,ΔC,A)->scaleFactor; AdjustGridDensity function accepts the grid g i, concentration gradient ΔC and fluid dynamics factor Λ, return the adjustment factor scaleFactor to control the density adjustment of the grid; the value range of the adjustment factor is (0,1), where 1 means no adjustment and 0 means an extremely sparse grid; the calculation formula of the adjustment factor is: η and λ are two regularization parameters that determine the sensitivity of grid adjustment;

[0015] Update the grid size: new grid g′ i The length and width of the side are multiplied by the adjustment factor to obtain the dynamically adjusted grid size.

[0016] As an improvement of the above scheme, the deep reinforcement learning model is constructed, and the initial data in each grid of the spatial grid model is used for learning and training to obtain a trained reinforcement learning model, including:

[0017] The initial data of each grid in the dynamic grid model is used to generate the environment state s t Extract and Actiona t Extraction; where the design environment state is s t =[c t , Δc t , w t ,T t , H t ,V t , P t ] where c t is the grid concentration at each moment in the history of the tth grid, Δc t is the concentration change rate at each moment in the history of the tth grid, w t is the humidity of the t-th grid at each moment in history, T t is the temperature of the t-th grid at each moment in history, V t is the wind speed at each moment in the history of the tth grid, P t is the grid position information of the tth grid; where H t represents the number of historical moments of the t-th grid; the design action space is defined as the diffusion concentration of harmful gases in the grid at the historical time step, where the action is: a t , a t Represents the set of diffusion concentrations at each time step at each moment in the history of the t-th grid;

[0018] Initialize the deep neural network, the input layer is the state vector, the hidden layer combines the convolutional neural network to capture the spatial correlation between grids, the fully connected layer abstracts the features, and the output layer predicts the action vector;

[0019] Using the A3C algorithm, and based on the environmental state s t and action a t, train the deep neural network to obtain a trained reinforcement learning model; the deep neural network structure of the reinforcement learning model includes:

[0020] Input layer: receives the state vector S, which contains the gas concentration distribution data, environmental parameters and grid position of the spatial grid model;

[0021] Convolutional layer: Use multiple convolution kernels to capture the spatial correlation between each grid and its neighboring grids. The output of the convolutional layer is a spatial feature map.

[0022] Fully connected layer: converts the output of the convolutional layer into higher-level abstract features;

[0023] Output layer: predicts the expected return of each possible action a, that is, the total reward expected after taking action a in a given state. This provides the model with a basis for decision-making, guiding it on how to choose the best strategy.

[0024] As an improvement of the above scheme, the future diffusion path of harmful gases in a semi-enclosed space is predicted by combining a deep reinforcement learning model and a Monte Carlo tree search algorithm based on real-time gas concentration distribution data and real-time environmental parameters, including:

[0025] A predicted action vector a is output based on the current state vector S through a deep reinforcement learning model; the current state vector includes real-time gas concentration distribution data and real-time environmental parameters;

[0026] The current state is used as the root node through the Monte Carlo tree search algorithm, and several child nodes are generated according to the action vector provided by the deep reinforcement learning model. Each child node represents the new state after taking an action.

[0027] Each child node continues to generate its child nodes through the Monte Carlo tree search algorithm until the preset termination state is reached, and the leaf node represents the predicted future state; the preset termination state includes: a set number of time steps or reaching a predetermined diffusion range;

[0028] Selection: Starting from the root node, select the next child node to explore according to the following exploration formula:

[0029]

[0030] Among them, Q(S t ,a) is the average return of action a in state S; P(s,a) is the prior probability of taking action a; N(s) is the number of visits to state S; N(s,a) is the number of visits from state S t The number of visits to the substate reached after taking action a; C is a constant that balances exploration and exploitation;

[0031] Expansion: When reaching an unexplored leaf node, create a new child node based on the model;

[0032] Simulation: Starting from the current leaf node, simulate along a random path to simulate the gas diffusion process until a termination state is reached, and record the reward on this path at the end of the simulation;

[0033] Backpropagation: Backpropagate the simulated rewards and update the statistics of all nodes on the path from the root node to the current leaf node; the statistics include the number of visits and the accumulated rewards;

[0034] After multiple iterations, the Monte Carlo tree search algorithm is used to evaluate the expected values ​​of different paths based on the number of visits and cumulative rewards of each node, and the path with the largest expected value is selected as the predicted future diffusion path.

[0035] Another embodiment of the present invention provides a prediction device for the diffusion of harmful gases in a semi-enclosed space, comprising:

[0036] A collection module is used to collect initial data; the initial data includes three-dimensional structural information of the semi-enclosed space, initial environmental parameters and historical gas concentrations at each detection location;

[0037] The first construction module is used to dynamically construct a spatial grid model by using a dynamic grid reconstruction algorithm based on the initial data and adjusting the grid size according to the change of gas concentration and the dynamic characteristics of the airflow;

[0038] The second building module is used to build a deep reinforcement learning model, and perform learning and training through the initial data in each grid of the spatial grid model to obtain a trained reinforcement learning model;

[0039] An acquisition module is used to obtain real-time gas concentration distribution data;

[0040] The prediction module is used to predict the future diffusion path of harmful gases in a semi-enclosed space by combining a deep reinforcement learning model and a Monte Carlo tree search algorithm based on real-time gas concentration distribution data and real-time environmental parameters.

[0041] As an improvement of the above solution, the first building block is specifically used for:

[0042] According to the spatial information collected by the laser radar and the environmental sensor network, a basic uniform grid model is generated. The initial grid set is G 0 = {g 1 ,g 2 ,...,g N-1 ,g N}; where g 1 ,g 2 ,…,gN-1 ,g N is the set G 0 The grid elements in g 1 is the first element, g N is the Nth element, where N is the total number of grids;

[0043] For each grid g i Calculate the concentration gradient ΔC and the fluid dynamics factor Λ; Λ=α·V i +β··γ·ΔC;V i is the grid g i The average wind speed in the grid, α, β, and γ are adjustment factors, balancing the influence of wind speed and concentration gradient on grid adjustment;

[0044] According to the gas concentration change rate ΔC i and the hydrodynamic factor Λ, and based on the grid adjustment function for each grid g i Calculate an adjustment factor, the grid adjustment function is: AdjustGridDensity(g i ,△C,Λ)->scaleFactor; AdjustGridDensity function accepts grid g i , concentration gradient ΔC and fluid dynamics factor Λ, return the adjustment factor scaleFactor to control the density adjustment of the grid; the value range of the adjustment factor is (0,1), where 1 means no adjustment and 0 means an extremely sparse grid; the calculation formula of the adjustment factor is: η and λ are two regularization parameters that determine the sensitivity of grid adjustment;

[0045] Update the grid size: new grid g′ i The length and width of the side are multiplied by the adjustment factor to obtain the dynamically adjusted grid size.

[0046] As an improvement of the above solution, the second building block is used for:

[0047] The initial data of each grid in the dynamic grid model is used to generate the environment state s t Extract and Actiona t Extraction; where the design environment state is s t =[c t , Δc t , w t , T t , H t , V t , P t ], where c t is the grid concentration at each moment in the history of the tth grid, Δc t is the concentration change rate at each moment in the history of the tth grid, wt is the humidity of the t-th grid at each moment in history, T t is the temperature of the t-th grid at each moment in history, V t is the wind speed at each moment in the history of the tth grid, P t is the grid position information of the tth grid; where H t represents the number of historical moments of the t-th grid; the design action space is defined as the diffusion concentration of harmful gases in the grid at the historical time step, where the action is: a t , a t Represents the set of diffusion concentrations at each time step at each moment in the history of the t-th grid;

[0048] Initialize the deep neural network, the input layer is the state vector, the hidden layer combines the convolutional neural network to capture the spatial correlation between grids, the fully connected layer abstracts the features, and the output layer predicts the action vector;

[0049] Using the A3C algorithm, and based on the environmental state s t and action a t , train the deep neural network to obtain a trained reinforcement learning model; the deep neural network structure of the reinforcement learning model includes:

[0050] Input layer: receives the state vector S, which contains the gas concentration distribution data, environmental parameters and grid position of the spatial grid model;

[0051] Convolutional layer: Use multiple convolution kernels to capture the spatial correlation between each grid and its neighboring grids. The output of the convolutional layer is a spatial feature map.

[0052] Fully connected layer: converts the output of the convolutional layer into higher-level abstract features;

[0053] Output layer: predicts the expected return of each possible action a, that is, the total reward expected after taking action a in a given state. This provides the model with a basis for decision-making, guiding it on how to choose the best strategy.

[0054] As an improvement of the above solution, the prediction module is specifically used for:

[0055] A predicted action vector a is output based on the current state vector S through a deep reinforcement learning model; the current state vector includes real-time gas concentration distribution data and real-time environmental parameters;

[0056] The current state is used as the root node through the Monte Carlo tree search algorithm, and several child nodes are generated according to the action vector provided by the deep reinforcement learning model. Each child node represents the new state after taking an action.

[0057] Each child node continues to generate its child nodes through the Monte Carlo tree search algorithm until the preset termination state is reached, and the leaf node represents the predicted future state; the preset termination state includes: a set number of time steps or reaching a predetermined diffusion range;

[0058] Selection: Starting from the root node, select the next child node to explore according to the following exploration formula:

[0059]

[0060] Among them, Q(S t , a) is the average return of action a in state S; P(s, a) is the prior probability of taking action a; N(s) is the number of visits to state S; N(s, a) is the number of visits from state S t The number of visits to the substate reached after taking action a; C is a constant that balances exploration and exploitation;

[0061] Expansion: When reaching an unexplored leaf node, create a new child node based on the model;

[0062] Simulation: Starting from the current leaf node, simulate along a random path to simulate the gas diffusion process until a termination state is reached, and record the reward on this path at the end of the simulation;

[0063] Backpropagation: Backpropagate the simulated rewards and update the statistics of all nodes on the path from the root node to the current leaf node; the statistics include the number of visits and the accumulated rewards;

[0064] After multiple iterations, the Monte Carlo tree search algorithm is used to evaluate the expected values ​​of different paths based on the number of visits and cumulative rewards of each node, and the path with the largest expected value is selected as the predicted future diffusion path.

[0065] Another embodiment of the present invention provides a prediction device for the diffusion of harmful gases in a semi-enclosed space, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the prediction method for the diffusion of harmful gases in a semi-enclosed space described in the above-mentioned embodiment of the invention is implemented.

[0066] Another embodiment of the present invention provides a storage medium, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the method for predicting the diffusion of harmful gases in a semi-enclosed space as described in the above-mentioned embodiment of the invention.

[0067] Compared with the prior art, one of the above technical solutions has the following advantages:

[0068] The embodiment of the present invention first constructs a detailed understanding of the semi-enclosed space, including its three-dimensional structure, environmental parameters and historical gas concentration profiles. Subsequently, an innovative dynamic grid reconstruction technology is used to intelligently adjust the grid layout according to the gas diffusion characteristics and gas flow mechanics to achieve accurate modeling. On this basis, a deep reinforcement learning model is used to train with rich data in the spatial grid to form a reinforcement learning model that can deeply understand the diffusion behavior. Finally, combined with real-time monitoring data and the Monte Carlo tree search algorithm, the real-time situation is quickly analyzed, the gas diffusion path is predicted, and immediate and accurate warning information is provided. From the above analysis, it can be seen that the embodiment of the present invention integrates dynamic grid reconstruction, deep reinforcement learning and Monte Carlo tree search algorithms. First, a dynamically adaptive grid model is constructed based on the initial data, and then the deep reinforcement learning model is used to learn the diffusion laws in historical and real-time data, and the prediction process is optimized through the Monte Carlo tree search strategy to achieve efficient and accurate prediction of the diffusion path of harmful gases in semi-enclosed spaces. Therefore, the embodiment of the present invention significantly improves the real-time and accuracy of harmful gas diffusion prediction, and provides strong support for early warning and response strategies for public safety. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] Figure 1 It is a flow chart of a method for predicting the diffusion of harmful gases in a semi-enclosed space provided by one embodiment of the present invention;

[0070] Figure 2 It is a structural schematic diagram of a device for predicting the diffusion of harmful gases in a semi-enclosed space provided by one embodiment of the present invention. DETAILED DESCRIPTION

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

[0072] See also Figure 1 , is a flow chart of a method for predicting the diffusion of harmful gases in a semi-enclosed space provided by an embodiment of the present invention. The method for predicting the diffusion of harmful gases in a semi-enclosed space comprises steps S10 to S14:

[0073] Step S10, collecting initial data; the initial data includes three-dimensional structural information of the semi-enclosed space, initial environmental parameters and historical gas concentrations at each detection location;

[0074] Step S11, based on the initial data, a dynamic grid reconstruction algorithm is used to adjust the grid size according to the change of gas concentration and the dynamic characteristics of the airflow, and a spatial grid model is dynamically constructed;

[0075] Step S12, constructing a deep reinforcement learning model, and performing learning training through the initial data in each grid of the spatial grid model to obtain a trained reinforcement learning model;

[0076] Step S13, obtaining real-time gas concentration distribution data;

[0077] Step S14, by combining the deep reinforcement learning model and the Monte Carlo tree search algorithm, and based on the real-time gas concentration distribution data and real-time environmental parameters, the future diffusion path of harmful gases in the semi-enclosed space is predicted.

[0078] The embodiment of the present invention first constructs a detailed understanding of the semi-enclosed space, including its three-dimensional structure, environmental parameters and historical gas concentration profiles. Subsequently, an innovative dynamic grid reconstruction technology is used to intelligently adjust the grid layout according to the gas diffusion characteristics and gas flow mechanics to achieve accurate modeling. On this basis, a deep reinforcement learning model is used to train with rich data in the spatial grid to form a reinforcement learning model that can deeply understand the diffusion behavior. Finally, combined with real-time monitoring data and the Monte Carlo tree search algorithm, the real-time situation is quickly analyzed, the gas diffusion path is predicted, and immediate and accurate warning information is provided. From the above analysis, it can be seen that the embodiment of the present invention integrates dynamic grid reconstruction, deep reinforcement learning and Monte Carlo tree search algorithms. First, a dynamically adaptive grid model is constructed based on the initial data, and then the deep reinforcement learning model is used to learn the diffusion laws in historical and real-time data, and the prediction process is optimized through the Monte Carlo tree search strategy to achieve efficient and accurate prediction of the diffusion path of harmful gases in semi-enclosed spaces. Therefore, the embodiment of the present invention significantly improves the real-time and accuracy of harmful gas diffusion prediction, and provides strong support for early warning and response strategies for public safety.

[0079] For example, the semi-enclosed space may be a public semi-enclosed space such as a subway or a tunnel.

[0080] As an improvement of the above scheme, the dynamic grid reconstruction algorithm is used according to the initial data, the grid size is adjusted according to the gas concentration change and the airflow dynamics characteristics, and the spatial grid model is dynamically constructed, including:

[0081] According to the spatial information collected by the laser radar and the environmental sensor network, a basic uniform grid model is generated. The initial grid set is G 0 = {g 1 ,g 2 ,...,g N-1 ,g N}; where g 1 , g 2 ,...,g N-1 , g N is the set G 0 The grid elements in g 1 is the first element, g N is the Nth element, where N is the total number of grids;

[0082] For each grid g i Calculate the concentration gradient ΔC and the fluid dynamics factor Λ; Λ=α·V i +β··γ·ΔC;V i is the grid g i The average wind speed in the grid, α, β, and γ are adjustment factors, balancing the influence of wind speed and concentration gradient on grid adjustment;

[0083] According to the gas concentration change rate ΔC i and the hydrodynamic factor Λ, and based on the grid adjustment function for each grid g i Calculate an adjustment factor, the grid adjustment function is: AdjustGridDensity(g i ,△C,Λ)->scaleFactor:AdjustGridDen.sity function accepts the grid g i , concentration gradient ΔC and fluid dynamics factor Λ, return the adjustment factor scaleFactor to control the density adjustment of the grid; the value range of the adjustment factor is (0,1), where 1 means no adjustment and 0 means an extremely sparse grid; the calculation formula of the adjustment factor is: η and λ are two regularization parameters that determine the sensitivity of grid adjustment;

[0084] Update the grid size: new grid g′ i The length and width of the side are multiplied by the adjustment factor to obtain the dynamically adjusted grid size.

[0085] This embodiment first generates a basic grid framework by integrating real-time data from lidar and environmental sensors. Then, the gas concentration change rate and airflow characteristics of each grid unit are carefully analyzed, and an adjustment factor is introduced to balance the influence of wind speed and concentration gradient. The core lies in the application of a grid adjustment function, which adaptively calculates the adjustment factor of each grid according to a specific algorithm, aiming to intelligently optimize the grid layout according to gas diffusion characteristics and airflow conditions. Finally, based on the calculated adjustment factor, the grid size is dynamically scaled to achieve fine focus on key areas or appropriate simplification of slowly changing areas, thereby constructing a highly dynamic and adaptable spatial grid model. This embodiment improves the accuracy and efficiency of simulation predictions. Through an intelligent adaptive grid division strategy, it ensures that the subsequent deep reinforcement learning model can accurately capture the diffusion trajectory of harmful gases under different diffusion stages and complex flow conditions, providing a more scientific and sophisticated decision-making support tool for emergency management and risk prevention and control.

[0086] As an improvement of the above scheme, the deep reinforcement learning model is constructed, and the initial data in each grid of the spatial grid model is used for learning and training to obtain a trained reinforcement learning model, including:

[0087] The initial data of each grid in the dynamic grid model is used to generate the environment state s t Extract and Actiona t Extraction; where the design environment state is s t =[c t ,△C t ,w t ,T t ,H t ,V t ,P t ] where c t is the grid concentration at each moment in the history of the tth grid, Δc t is the concentration change rate at each moment in the history of the tth grid, w t is the humidity of the t-th grid at each moment in history, T t is the temperature of the t-th grid at each moment in history, V t is the wind speed at each moment in the history of the tth grid, P t is the grid position information of the tth grid; where H t represents the number of historical moments of the t-th grid; the design action space is defined as the diffusion concentration of harmful gases in the grid at the historical time step, where the action is: a t , a t Represents the set of diffusion concentrations at each time step at each moment in the history of the t-th grid;

[0088] Initialize the deep neural network, the input layer is the state vector, the hidden layer combines the convolutional neural network to capture the spatial correlation between grids, the fully connected layer abstracts the features, and the output layer predicts the action vector;

[0089] Using the A3C algorithm, and based on the environmental state s t and action a t , train the deep neural network to obtain a trained reinforcement learning model; the deep neural network structure of the reinforcement learning model includes:

[0090] Input layer: receives the state vector S, which contains the gas concentration distribution data, environmental parameters and grid position of the spatial grid model;

[0091] Convolutional layer: Use multiple convolution kernels to capture the spatial correlation between each grid and its neighboring grids. The output of the convolutional layer is a spatial feature map.

[0092] Fully connected layer: converts the output of the convolutional layer into higher-level abstract features;

[0093] Output layer: predicts the expected return of each possible action a, that is, the total reward expected after taking action a in a given state. This provides the model with a basis for decision-making, guiding it on how to choose the best strategy.

[0094] Among them, the process of using the A3C algorithm to train the deep neural network is specifically as follows:

[0095] First, the deep neural network structure of the model is initialized. Then, the A3C (Asynchronous Advantage Actor-Critic) algorithm is used for training. The A3C algorithm optimizes the strategy and value function by executing multiple executors (explorers) in parallel. Each executor independently explores different parts of the environment, collects experience, and periodically updates a shared global network (critic). Among them, the training goal of the A3C algorithm is to optimize the network parameters by minimizing the loss function. The loss function usually combines the strategy loss and the value loss to ensure that the model can not only predict the best action (strategy optimization), but also accurately evaluate the value of the state (value function optimization). The more specific training process of the A3C algorithm for the model can refer to the existing technology.

[0096] As an improvement, when the A3C algorithm trains the model, this embodiment adopts a new loss function, and the function formula is:

[0097]

[0098] Among them, τ represents the trajectory of a task (or environment instance), L task is the task-specific loss, α is the meta-learning rate, and L regis a regularization term used to prevent overfitting, and λ controls the regularization strength.

[0099] By introducing a meta-learning loss term into the loss function of A3C, the model is encouraged to learn how to quickly adjust its parameters to adapt to the initial distribution changes of the new environment. And by adding task adaptability loss into the loss function, the model is encouraged to learn how to quickly adapt to new gas diffusion scenarios based on a small number of samples.

[0100] In this embodiment, by integrating the spatial grid model with deep reinforcement learning, the environmental characteristics of each grid (such as concentration, meteorological conditions, etc.) are innovatively converted into state representations, and the prediction of the harmful gas diffusion concentration of each grid at the next time step is regarded as a series of learnable actions. By designing a deep neural network architecture including a convolutional neural network, not only the complex spatial correlation between grids is captured, but also the key features are refined through the fully connected layer, and finally the optimal harmful gas diffusion concentration of each grid at the future moment is predicted. In addition, by adopting the asynchronous advantage executor-critic (A3C) algorithm for parallel training, the learning process is accelerated and the robustness and decision-making ability of the model are improved. Therefore, this embodiment constructs a model that can learn and predict the dynamic process of harmful gas diffusion through the deep fusion of deep reinforcement learning and historical data, and by using the dynamic grid model and detailed data of historical moments, the model can capture complex spatial and temporal changes, and at the same time, combined with the parallelism of the A3C algorithm, the learning speed is accelerated, so that the model can quickly adapt to environmental changes and provide immediate warnings.

[0101] It is understandable that the reinforcement learning model can also be trained using existing technology.

[0102] As an improvement of the above scheme, the future diffusion path of harmful gases in a semi-enclosed space is predicted by combining a deep reinforcement learning model and a Monte Carlo tree search algorithm based on real-time gas concentration distribution data and real-time environmental parameters, including:

[0103] A predicted action vector a is output based on the current state vector S through a deep reinforcement learning model; the current state vector includes real-time gas concentration distribution data and real-time environmental parameters;

[0104] The current state is used as the root node through the Monte Carlo tree search algorithm, and several child nodes are generated according to the action vector provided by the deep reinforcement learning model. Each child node represents the new state after taking an action.

[0105] Each child node continues to generate its child nodes through the Monte Carlo tree search algorithm until the preset termination state is reached, and the leaf node represents the predicted future state; the preset termination state includes: a set number of time steps or reaching a predetermined diffusion range;

[0106] Selection: Starting from the root node, select the next child node to explore according to the following exploration formula:

[0107]

[0108] Among them, Q(S t , a) is the average return of action a in state S; P(s, a) is the prior probability of taking action a; N(s) is the number of visits to state S; N(s, a) is the number of visits from state S t The number of visits to the substate reached after taking action a; C is a constant that balances exploration and exploitation;

[0109] Expansion: When reaching an unexplored leaf node, create a new child node based on the model;

[0110] Simulation: Starting from the current leaf node, simulate along a random path to simulate the gas diffusion process until a termination state is reached, and record the reward on this path at the end of the simulation;

[0111] Backpropagation: Backpropagate the simulated reward to all nodes along the way, and update the statistical information of all nodes on the path from the root node to the current leaf node; the statistical information includes the number of visits and the accumulated reward;

[0112] After multiple iterations, the Monte Carlo tree search algorithm is used to evaluate the expected values ​​of different paths based on the number of visits and cumulative rewards of each node, and the path with the largest expected value is selected as the predicted future diffusion path.

[0113] In this embodiment, the following examples are given:

[0114] For example, if a small gas leak occurs inside a chemical plant, the diffusion path of chlorine gas needs to be predicted to prevent possible danger. The specific process is as follows:

[0115] State initialization: The current state vector contains the real-time chlorine concentration of each monitoring point in the chemical plant (such as point A: 0.02ppm, point B: 0.005ppm) and environmental parameters (room temperature 20℃, relative humidity 70%, wind speed 1m / s). These data are used as input into the deep reinforcement learning model.

[0116] Action vector prediction: Based on the current state analysis, the model predicts a series of theoretical "actions" or strategies that represent the gas diffusion trends or patterns that may be observed in this state.

[0117] Construct a decision tree: With the current state as the root node, generate branches in the Monte Carlo tree search based on the diffusion trend output by the model (i.e., the "action" vector). Each branch represents a possible path for gas diffusion, i.e., the new distribution state of gas concentration in space after taking the "action".

[0118] Tree search and selection: By guiding the balance between exploration and utilization through the exploration formula above, the algorithm selects the most valuable branches in the decision tree for in-depth exploration, giving priority to those branches that may theoretically bring more information or are closer to the real diffusion path.

[0119] Simulation and back propagation: At the selected "leaf" node, a random simulation of gas diffusion is performed, and the simulation process proceeds according to the physical diffusion rules until the termination condition is reached (such as simulation to the next period or diffusion reaches the preset boundary). After the simulation is completed, the "reward" formed by the simulation results (such as gas concentration changes, diffusion range) is back-propagated to update the number of visits and accumulated rewards of nodes along the way.

[0120] Iteration and optimization prediction: Repeat the above simulation and feedback process. After multiple rounds of iterations, each node in the decision tree accumulates rich statistical information. Based on this, the algorithm can identify the path with the highest cumulative reward, that is, the most likely gas diffusion path in the prediction.

[0121] This embodiment first uses a deep reinforcement learning model to predict possible future gas diffusion trends based on the current gas concentration distribution and environmental parameters, and forms a decision basis for a series of potential state transitions. Subsequently, the Monte Carlo tree search conducts extensive exploration on this basis, simulating various possible diffusion scenarios by constructing a multi-level decision tree until a preset end point, such as a specific number of time steps or the gas reaches a certain diffusion range. In this process, the choice of each decision step is based on a carefully designed exploration and utilization balance formula, so as to select the most likely diffusion trajectory from many predicted paths. Through repeated simulation and feedback, the algorithm continuously optimizes the estimate of future states, and finally accurately predicts the most likely path for gas diffusion. Therefore, this embodiment can effectively predict the most likely gas diffusion path, and can assist decision makers in understanding the diffusion trend of harmful gases in advance, so as to facilitate decision makers to plan evacuation routes, deploy monitoring equipment or take other preventive measures in a timely manner, and effectively reduce potential environmental and public safety risks.

[0122] See also Figure 2 , is a schematic diagram of a structure of a prediction device for harmful gas diffusion in a semi-enclosed space provided by an embodiment of the present invention. The prediction device for harmful gas diffusion in a semi-enclosed space comprises:

[0123] The collection module 10 is used to collect initial data; the initial data includes three-dimensional structural information of the semi-enclosed space, initial environmental parameters and historical gas concentrations at each detection location;

[0124] The first construction module 11 is used to dynamically construct a spatial grid model by using a dynamic grid reconstruction algorithm based on the initial data and adjusting the grid size according to the change of gas concentration and the dynamic characteristics of the airflow;

[0125] The second construction module 12 is used to construct a deep reinforcement learning model, and perform learning and training through the initial data in each grid of the spatial grid model to obtain a trained reinforcement learning model;

[0126] An acquisition module 13 is used to acquire real-time gas concentration distribution data;

[0127] The prediction module 14 is used to predict the future diffusion path of harmful gases in the semi-enclosed space by combining the deep reinforcement learning model and the Monte Carlo tree search algorithm and based on the real-time gas concentration distribution data and real-time environmental parameters.

[0128] The embodiment of the present invention first constructs a detailed understanding of the semi-enclosed space, including its three-dimensional structure, environmental parameters and historical gas concentration profiles. Subsequently, an innovative dynamic grid reconstruction technology is used to intelligently adjust the grid layout according to the gas diffusion characteristics and gas flow mechanics to achieve accurate modeling. On this basis, a deep reinforcement learning model is used to train with rich data in the spatial grid to form a reinforcement learning model that can deeply understand the diffusion behavior. Finally, combined with real-time monitoring data and the Monte Carlo tree search algorithm, the real-time situation is quickly analyzed, the gas diffusion path is predicted, and immediate and accurate warning information is provided. From the above analysis, it can be seen that the embodiment of the present invention integrates dynamic grid reconstruction, deep reinforcement learning and Monte Carlo tree search algorithms. First, a dynamically adaptive grid model is constructed based on the initial data, and then the deep reinforcement learning model is used to learn the diffusion laws in historical and real-time data, and the prediction process is optimized through the Monte Carlo tree search strategy to achieve efficient and accurate prediction of the diffusion path of harmful gases in semi-enclosed spaces. Therefore, the embodiment of the present invention significantly improves the real-time and accuracy of harmful gas diffusion prediction, and provides strong support for early warning and response strategies for public safety.

[0129] As an improvement of the above solution, the first building block is specifically used for:

[0130] According to the spatial information collected by the laser radar and the environmental sensor network, a basic uniform grid model is generated. The initial grid set is G 0 = {g 1 , g 2 , …, g N-1 , g N} Among them, g1 ,g 2 , ..., g N-1 , g N is the set G 0 The grid elements in g 1 is the first element, g N is the Nth element, where N is the total number of grids;

[0131] For each grid g i Calculate the concentration gradient ΔC and the fluid dynamics factor Λ; Λ=α·V i +β··γ·ΔC;V i is the grid g i The average wind speed in the grid, α, β, and γ are adjustment factors, balancing the influence of wind speed and concentration gradient on grid adjustment;

[0132] According to the gas concentration change rate ΔC i and the hydrodynamic factor Λ, and based on the grid adjustment function for each grid g i Calculate an adjustment factor, the grid adjustment function is: AdjustGridDensity(g i ,ΔC,Λ)->scaleFactor; AdjustGridDensity function accepts the grid g i , concentration gradient ΔC and fluid dynamics factor Λ, return the adjustment factor scaleFactor to control the density adjustment of the grid; the value range of the adjustment factor is (0,1), where 1 means no adjustment and 0 means an extremely sparse grid; the calculation formula of the adjustment factor is: η and λ are two regularization parameters that determine the sensitivity of grid adjustment;

[0133] Update the grid size: new grid g′ i The length and width of the side are multiplied by the adjustment factor to obtain the dynamically adjusted grid size.

[0134] As an improvement of the above solution, the second building block is used for:

[0135] The initial data of each grid in the dynamic grid model is used to generate the environment state s t Extract and Actiona t Extraction; where the design environment state is s t =[c t ,△c t ,w t ,T t ,H t ,V t ,P t ], where c t is the grid concentration at each moment in the history of the tth grid, Δct is the concentration change rate at each moment in the history of the tth grid, w t is the humidity of the t-th grid at each moment in history, T t is the temperature of the t-th grid at each moment in history, V t is the wind speed at each moment in the history of the tth grid, P t is the grid position information of the tth grid; where H t represents the number of historical moments of the t-th grid; the design action space is defined as the diffusion concentration of harmful gases in the grid at the historical time step, where the action is: a t , a t Represents the set of diffusion concentrations at each time step at each moment in the history of the t-th grid;

[0136] Initialize the deep neural network, the input layer is the state vector, the hidden layer combines the convolutional neural network to capture the spatial correlation between grids, the fully connected layer abstracts the features, and the output layer predicts the action vector;

[0137] Using the A3C algorithm, and based on the environmental state s t and action a t , train the deep neural network to obtain a trained reinforcement learning model; the deep neural network structure of the reinforcement learning model includes:

[0138] Input layer: receives the state vector S, which contains the gas concentration distribution data, environmental parameters and grid position of the spatial grid model;

[0139] Convolutional layer: Use multiple convolution kernels to capture the spatial correlation between each grid and its neighboring grids. The output of the convolutional layer is a spatial feature map.

[0140] Fully connected layer: converts the output of the convolutional layer into higher-level abstract features;

[0141] Output layer: predicts the expected return of each possible action a, that is, the total reward expected after taking action a in a given state. This provides the model with a basis for decision-making, guiding it on how to choose the best strategy.

[0142] As an improvement of the above solution, the prediction module is specifically used for:

[0143] A predicted action vector a is output based on the current state vector S through a deep reinforcement learning model; the current state vector includes real-time gas concentration distribution data and real-time environmental parameters;

[0144] The current state is used as the root node through the Monte Carlo tree search algorithm, and several child nodes are generated according to the action vector provided by the deep reinforcement learning model. Each child node represents the new state after taking an action.

[0145] Each child node continues to generate its child nodes through the Monte Carlo tree search algorithm until the preset termination state is reached, and the leaf node represents the predicted future state; the preset termination state includes: a set number of time steps or reaching a predetermined diffusion range;

[0146] Selection: Starting from the root node, select the next child node to explore according to the following exploration formula:

[0147]

[0148] Among them, Q(S t ,a) is the average return of action a in state S; P(s,a) is the prior probability of taking action a; N(s) is the number of visits to state S; N(s,a) is the number of visits from state S t The number of visits to the substate reached after taking action a; C is a constant that balances exploration and exploitation;

[0149] Expansion: When reaching an unexplored leaf node, create a new child node based on the model;

[0150] Simulation: Starting from the current leaf node, simulate along a random path to simulate the gas diffusion process until a termination state is reached, and record the reward on this path at the end of the simulation;

[0151] Backpropagation: Backpropagate the simulated rewards and update the statistics of all nodes on the path from the root node to the current leaf node; the statistics include the number of visits and the accumulated rewards;

[0152] After multiple iterations, the Monte Carlo tree search algorithm is used to evaluate the expected values ​​of different paths based on the number of visits and cumulative rewards of each node, and the path with the largest expected value is selected as the predicted future diffusion path.

[0153] An embodiment of the present invention provides a prediction device for the diffusion of harmful gases in a semi-enclosed space. The prediction device for the diffusion of harmful gases in a semi-enclosed space of this embodiment includes: a processor, a memory, and a computer program stored in the memory and executable on the processor, such as a prediction program for the diffusion of harmful gases in a semi-enclosed space. When the processor executes the computer program, the steps in the above-mentioned prediction method embodiments for the diffusion of harmful gases in a semi-enclosed space are implemented. Alternatively, when the processor executes the computer program, the functions of the modules / units in the above-mentioned device embodiments are implemented.

[0154] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the prediction device for the diffusion of harmful gases in the semi-enclosed space.

[0155] The prediction device for the diffusion of harmful gases in a semi-enclosed space may be a computing device such as a desktop computer, a notebook, a PDA, and a cloud server. The prediction device for the diffusion of harmful gases in a semi-enclosed space may include, but is not limited to, a processor and a memory. A person skilled in the art may understand that the schematic diagram is only an example of a prediction device for the diffusion of harmful gases in a semi-enclosed space, and does not constitute a limitation on the prediction device for the diffusion of harmful gases in a semi-enclosed space. The prediction device may include more or fewer components than shown in the diagram, or a combination of certain components, or different components. For example, the prediction device for the diffusion of harmful gases in a semi-enclosed space may also include input and output devices, network access devices, buses, etc.

[0156] The processor 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. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the prediction device for the diffusion of harmful gases in the semi-enclosed space, and various interfaces and lines are used to connect various parts of the prediction device for the diffusion of harmful gases in the entire semi-enclosed space.

[0157] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the prediction device for the diffusion of harmful gases in the semi-enclosed space by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Med ia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0158] Wherein, if the module / unit integrated in the prediction device for the diffusion of harmful gases in the semi-enclosed space 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. Based on such an 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, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, 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, etc. The computer-readable medium can include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc. 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 practices in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practices, computer-readable media do not include electrical carrier signals and telecommunication signals.

[0159] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.

[0160] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A method for predicting the diffusion of harmful gases in a semi-enclosed space, characterized in that: include: Collect initial data; the initial data includes the three-dimensional structure information of the semi-enclosed space, initial environmental parameters and historical gas concentrations at each detection location; According to the initial data, a dynamic grid reconstruction algorithm is used to adjust the grid size according to the change of gas concentration and the dynamic characteristics of the airflow, and a spatial grid model is dynamically constructed; Construct a deep reinforcement learning model, and perform learning and training through the initial data in each grid of the spatial grid model to obtain a trained reinforcement learning model; Obtain real-time gas concentration distribution data; By combining the deep reinforcement learning model and the Monte Carlo tree search algorithm, and based on real-time gas concentration distribution data and real-time environmental parameters, the future diffusion path of harmful gases in semi-enclosed spaces can be predicted; The method of dynamically constructing a spatial grid model by using a dynamic grid reconstruction algorithm based on the initial data and adjusting the grid size according to the change in gas concentration and the dynamic characteristics of the airflow includes: According to the spatial information collected by the laser radar and the environmental sensor network, a basic uniform grid model is generated. The initial grid set is G0 = {g1, g2, ..., g N-1 , g N }; where g1, g2, ..., g N-1 , g N is a grid element in the set G0, g1 is the first element, g N is the Nth element, where N is the total number of grids; For each grid g i Calculate the concentration gradient ΔC and the fluid dynamics factor Λ; Λ=α·V i +β··γ·ΔC;V i is the grid g i The average wind speed in the grid, α, β, and γ are adjustment factors, balancing the influence of wind speed and concentration gradient on grid adjustment; According to the gas concentration change rate ΔC i and the hydrodynamic factor Λ, and based on the grid adjustment function for each grid g i Calculate an adjustment factor, the grid adjustment function is: AdjustGridDensity(g i , ΔC, Λ)->scaleFactor; AdjustGridDensity function accepts the grid g i , concentration gradient ΔC and fluid dynamics factor Λ, return the adjustment factor scaleFactor to control the density adjustment of the grid; the value range of the adjustment factor is (0,1), where 1 means no adjustment and 0 means an extremely sparse grid; the calculation formula of the adjustment factor is: η and λ are two regularization parameters that determine the sensitivity of grid adjustment; Update the grid size: new grid g′ i The length and width of the side are multiplied by the adjustment factor to obtain the dynamically adjusted grid size.

2. The method for predicting the diffusion of harmful gases in a semi-enclosed space according to claim 1, characterized in that: The deep reinforcement learning model is constructed, and the initial data in each grid of the spatial grid model is used for learning and training to obtain a trained reinforcement learning model, including: The initial data of each grid in the dynamic grid model is used to generate the environment state s t Extract and Actiona t Extraction; where the design environment state is s t =[c t , Δc t , w t , T t , H t , V t , P t ], where c t is the grid concentration at each moment in the history of the tth grid, Δc t is the concentration change rate at each moment in the history of the tth grid, w t is the humidity of the t-th grid at each moment in history, T t is the temperature of the t-th grid at each moment in history, V t is the wind speed at each moment in the history of the tth grid, P t is the grid position information of the tth grid; where H t represents the number of historical moments of the t-th grid; the design action space is defined as the diffusion concentration of harmful gases in the grid at the historical time step, where the action is: a t , a t Represents the set of diffusion concentrations at each time step at each moment in the history of the t-th grid; Initialize the deep neural network, the input layer is the state vector, the hidden layer combines the convolutional neural network to capture the spatial correlation between grids, the fully connected layer abstracts the features, and the output layer predicts the action vector; Using the A3C algorithm, and based on the environmental state s t and action a t , train the deep neural network to obtain a trained reinforcement learning model; the deep neural network structure of the reinforcement learning model includes: Input layer: receives the state vector S, which contains the gas concentration distribution data, environmental parameters and grid position of the spatial grid model; Convolutional layer: Use multiple convolution kernels to capture the spatial correlation between each grid and its neighboring grids. The output of the convolutional layer is a spatial feature map. Fully connected layer: converts the output of the convolutional layer into higher-level abstract features; Output layer: predicts the expected return for each possible action a, that is, the total reward expected after taking action a in a given state.

3. The method for predicting the diffusion of harmful gases in a semi-enclosed space according to claim 2, characterized in that: The method combines the deep reinforcement learning model and the Monte Carlo tree search algorithm, and predicts the future diffusion path of harmful gases in a semi-enclosed space based on real-time gas concentration distribution data and real-time environmental parameters, including: A predicted action vector a is output based on the current state vector S through a deep reinforcement learning model; the current state vector includes real-time gas concentration distribution data and real-time environmental parameters; The current state is used as the root node through the Monte Carlo tree search algorithm, and several child nodes are generated according to the action vector provided by the deep reinforcement learning model. Each child node represents the new state after taking an action. Each child node continues to generate its child nodes through the Monte Carlo tree search algorithm until the preset termination state is reached, and the leaf node represents the predicted future state; the preset termination state includes: a set number of time steps or reaching a predetermined diffusion range; Selection: Starting from the root node, select the next child node to explore according to the following exploration formula: Among them, Q(S t , a) is the average return of action a in state S; P(s, a) is the prior probability of taking action a; N(s) is the number of visits to state S; N(s, a) is the number of visits from state S t The number of visits to the substate reached after taking action a; C is a constant that balances exploration and exploitation; Expansion: When reaching an unexplored leaf node, create a new child node based on the model; Simulation: Starting from the current leaf node, simulate along a random path to simulate the gas diffusion process until a termination state is reached, and record the reward on this path at the end of the simulation; Backpropagation: Backpropagate the simulated rewards and update the statistics of all nodes on the path from the root node to the current leaf node; the statistics include the number of visits and the accumulated rewards; After multiple iterations, the Monte Carlo tree search algorithm is used to evaluate the expected values ​​of different paths based on the number of visits and cumulative rewards of each node, and the path with the largest expected value is selected as the predicted future diffusion path.

4. A prediction device for the diffusion of harmful gases in a semi-enclosed space, characterized in that: include: A collection module is used to collect initial data; the initial data includes three-dimensional structural information of the semi-enclosed space, initial environmental parameters and historical gas concentrations at each detection location; The first construction module is used to dynamically construct a spatial grid model by using a dynamic grid reconstruction algorithm based on the initial data and adjusting the grid size according to the change of gas concentration and the dynamic characteristics of the airflow; The second building module is used to build a deep reinforcement learning model, and perform learning and training through the initial data in each grid of the spatial grid model to obtain a trained reinforcement learning model; An acquisition module is used to obtain real-time gas concentration distribution data; The prediction module is used to predict the future diffusion path of harmful gases in a semi-enclosed space based on real-time gas concentration distribution data and real-time environmental parameters by combining the deep reinforcement learning model and the Monte Carlo tree search algorithm; The first building block is specifically used for: According to the spatial information collected by the laser radar and the environmental sensor network, a basic uniform grid model is generated. The initial grid set is G0 = {g1, g2, ..., g N-1 , g N }; where g1, g2, ..., g N-1 , g N is a grid element in the set G0, g1 is the first element, g N is the Nth element, where N is the total number of grids; For each grid g i Calculate the concentration gradient ΔC and the fluid dynamics factor Λ; Λ=α·V i +β··γ·ΔC;V i is the grid g i The average wind speed in the grid, α, β, and γ are adjustment factors, balancing the influence of wind speed and concentration gradient on grid adjustment; According to the gas concentration change rate ΔC i and the hydrodynamic factor Λ, and based on the grid adjustment function for each grid g i Calculate an adjustment factor, the grid adjustment function is: AdjustGridDensity(g i , ΔC, Λ)->scaleFactor; AdjustGridDensity function accepts the grid g i , concentration gradient ΔC and fluid dynamics factor Λ, return the adjustment factor scaleFactor to control the density adjustment of the grid; the value range of the adjustment factor is (0,1), where 1 means no adjustment and 0 means an extremely sparse grid; the calculation formula of the adjustment factor is: η and λ are two regularization parameters that determine the sensitivity of grid adjustment; Update the grid size: new grid g′ i The length and width of the side are multiplied by the adjustment factor to obtain the dynamically adjusted grid size.

5. The prediction device for the diffusion of harmful gases in a semi-enclosed space according to claim 4, characterized in that: The second building block is specifically used for: The initial data of each grid in the dynamic grid model is used to generate the environment state s t Extract and Actiona t Extraction; where the design environment state is s t =[c t , Δc t , w t , T t , H t , V t , P t ], where c t is the grid concentration at each moment in the history of the tth grid, Δc t is the concentration change rate at each moment in the history of the tth grid, w t is the humidity of the t-th grid at each moment in history, T t is the temperature of the t-th grid at each moment in history, V t is the wind speed at each moment in the history of the tth grid, P t is the grid position information of the tth grid; where H t represents the number of historical moments of the t-th grid; the design action space is defined as the diffusion concentration of harmful gases in the grid at the historical time step, where the action is: a t , a t Represents the set of diffusion concentrations at each time step at each moment in the history of the t-th grid; Initialize the deep neural network, the input layer is the state vector, the hidden layer combines the convolutional neural network to capture the spatial correlation between grids, the fully connected layer abstracts the features, and the output layer predicts the action vector; Using the A3C algorithm, and based on the environmental state s t and action a t , train the deep neural network to obtain a trained reinforcement learning model; the deep neural network structure of the reinforcement learning model includes: Input layer: receives the state vector S, which contains the gas concentration distribution data, environmental parameters and grid position of the spatial grid model; Convolutional layer: Use multiple convolution kernels to capture the spatial correlation between each grid and its neighboring grids. The output of the convolutional layer is a spatial feature map. Fully connected layer: converts the output of the convolutional layer into higher-level abstract features; Output layer: predicts the expected return for each possible action a, that is, the total reward expected after taking action a in a given state.

6. The device for predicting the diffusion of harmful gases in a semi-enclosed space according to claim 5, characterized in that: The prediction module is specifically used for: A predicted action vector a is output based on the current state vector S through a deep reinforcement learning model; the current state vector includes real-time gas concentration distribution data and real-time environmental parameters; The current state is used as the root node through the Monte Carlo tree search algorithm, and several child nodes are generated according to the action vector provided by the deep reinforcement learning model. Each child node represents the new state after taking an action. Through the Monte Carlo tree search algorithm, each child node continues to generate its child nodes until the preset terminal state is reached. The leaf node represents the predicted future state. The preset termination states include: a set number of time steps or reaching a predetermined diffusion range; Selection: Starting from the root node, select the next child node to explore according to the following exploration formula: Among them, Q(S t , a) is the average return of action a in state S; P(s, a) is the prior probability of taking action a; N(s) is the number of visits to state S; N(s, a) is the number of visits from state S t The number of visits to the substate reached after taking action a; C is a constant that balances exploration and exploitation; Expansion: When reaching an unexplored leaf node, create a new child node based on the model; Simulation: Starting from the current leaf node, simulate along a random path to simulate the gas diffusion process until a termination state is reached, and record the reward on this path at the end of the simulation; Backpropagation: Backpropagate the simulated rewards and update the statistics of all nodes on the path from the root node to the current leaf node; the statistics include the number of visits and the accumulated rewards; After multiple iterations, the Monte Carlo tree search algorithm is used to evaluate the expected values ​​of different paths based on the number of visits and cumulative rewards of each node, and the path with the largest expected value is selected as the predicted future diffusion path.

7. A prediction device for the diffusion of harmful gases in a semi-enclosed space, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the method for predicting the diffusion of harmful gases in a semi-enclosed space as claimed in any one of claims 1 to 3 is implemented.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the method for predicting the diffusion of harmful gases in a semi-enclosed space as claimed in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Factory gas pollution distribution prediction method and system, electronic equipment and storage medium

    CN115705510A

  • Super-real-time intelligent prediction method for gas leakage dangerous area of chemical industry park

    CN117034727A

  • Boiler harmful gas emission control method and system based on neural network

    CN117452828A