Optimization modeling method and device for green ammonia production process

The ingammonia production process is modeled through the random forest model, which solves the problem of low accuracy of prediction model caused by data characteristics in the ingammonia production process, and achieves higher prediction accuracy and adaptability of ingammonia production.

CN119904087APending Publication Date: 2025-04-29CHINA HYDROELECTRIC ENGINEERING CONSULTING GROUP CHENGDU RESEARCH HYDROELECTRIC INVESTIGATION DESIGN AND INSTITUTE +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411862282.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-04-29

AI Technical Summary

Technical Problem

During the production of ingammonia, there are multi-level irregular sampling, multi-spatial time series and unreal data confounding of data, resulting in low accuracy of the ingammonia prediction model.

Method used

The chlorammonia production process is modeled using a random forest model. By obtaining process feature data, preprocessing data, dynamically adjusting feature weights, iterating the training model until the preset training stop conditions are met, the chlorammonia prediction model is obtained.

Benefits of technology

The accuracy of the ingredient prediction model is improved, and the ingredient yield can be predicted more accurately and adapt to the volatility of renewable energy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119904087A_ABST
    Figure CN119904087A_ABST
Patent Text Reader

Abstract

The invention discloses an optimized modeling method and device for a green ammonia production process, and the method comprises the steps: obtaining the process feature data of the green ammonia production; preprocessing the process feature data to obtain preprocessed data; the method comprises the following steps: modeling a green ammonia production process by using a random forest to obtain a random forest model which is used for predicting the yield of green ammonia; determining a preset proportion of data in the preprocessed data as a training set; and iteratively training a random forest model based on the training set, and dynamically adjusting the weight of each process feature in the process of iteratively training the random forest model until a preset training stop condition is met, thereby obtaining a green ammonia prediction model. The accuracy of the green ammonia prediction model can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to an optimization modeling method and device for a green ammonia production process. Background Art

[0002] As a clean and efficient hydrogen carrier, green ammonia has shown great application potential in the field of new energy. At present, an important trend in green ammonia synthesis is to synthesize ammonia by electrolyzing water to produce hydrogen, but the operation of this system is affected by the fluctuations of renewable energy and is intermittent and unstable. Therefore, all links in the system, including water electrolysis, hydrogen storage, nitrogen preparation, gas mixing and compression, synthesis, cooling and other processes, need to be deeply optimized in process design to adapt to the inherent characteristics of renewable energy. By modeling the green ammonia production process and establishing an accurate green ammonia product yield model based on the analysis of relevant important parameters, it is helpful to optimize the green ammonia production process and provide scientific guidance. However, the data of the green ammonia production process has three characteristics: multi-level irregular sampling, multi-temporal and spatial time series, and unreal data mixing, which leads to the low accuracy of the established green ammonia prediction model. Summary of the invention

[0003] The embodiments of the present application provide a method and device for optimizing modeling of a green ammonia production process, which can improve the accuracy of the green ammonia prediction model.

[0004] In a first aspect, the present application provides an optimization modeling method for a green ammonia production process, comprising:

[0005] Obtain process characteristic data for green ammonia production;

[0006] Preprocessing the process characteristic data to obtain preprocessed data;

[0007] The green ammonia production process is modeled using random forest to obtain a random forest model, wherein the random forest model is used to predict the green ammonia production;

[0008] Determine a preset proportion of data in the preprocessed data as a training set;

[0009] The random forest model is iteratively trained based on the training set, and the weights of each process feature are dynamically adjusted during the iterative training of the random forest model until the preset training stop condition is met to obtain the green ammonia prediction model.

[0010] Optionally, the process characteristic data include time series data formed by continuously recording key parameters using various sensors and instruments, and the time series data include temperature, pressure, flow, liquid level, raw material composition and product quality.

[0011] Optionally, the random forest model satisfies the following formula,

[0012]

[0013] Where n represents the number of decision trees in the random forest model; f k (X) is a single decision tree model, and its prediction output is expressed as I(·) is the characteristic function of majority voting, It is the prediction result of green ammonia production by the combined regression model of multiple decision tree models.

[0014] Optionally, preprocessing the process characteristic data to obtain preprocessed data includes:

[0015] Vectorizing the process characteristic data to obtain vectorized data;

[0016] The vectorized data is normalized to obtain preprocessed data.

[0017] Optionally, the random forest model is iteratively trained based on the training set, and the weights of each process feature are dynamically adjusted during the iterative training of the random forest model until a preset training stop condition is met to obtain a green ammonia prediction model, including:

[0018] The decision variables related to green ammonia production are regarded as antibodies of the immune system, and the objective function is regarded as antigen of the immune system;

[0019] Randomly generate multiple decision variables related to green ammonia production as initialization antibodies;

[0020] Calculate antibody affinity and antibody concentration of antibodies;

[0021] Iteratively update the antibody based on antibody affinity and antibody concentration to adjust the weights of each process feature until the preset training stop condition is met, where the preset training stop condition includes that the difference in average affinity between two adjacent iterations of antibody populations is less than 10 -4 Or the number of iterations reaches the preset number.

[0022] Optionally, the calculation formula for the antibody affinity of the antibody is as follows,

[0023]

[0024] Among them, F i The antibody affinity for each antibody, represents the output of the random forest model corresponding to the i-th antibody, Represents the average value of y, where y represents the actual green ammonia product output.

[0025] In a second aspect, the present application provides an optimization modeling device for a green ammonia production process, comprising:

[0026] An acquisition module is used to obtain process characteristic data of green ammonia production;

[0027] A preprocessing module, used for preprocessing the process characteristic data to obtain preprocessed data;

[0028] A modeling module, used to model the green ammonia production process using random forest to obtain a random forest model, wherein the random forest model is used to predict the green ammonia production;

[0029] A determination module, used for determining a preset proportion of data in the preprocessed data as a training set;

[0030] The training module is used to iteratively train the random forest model based on the training set, and dynamically adjust the weights of various process characteristics during the iterative training of the random forest model until the preset training stop conditions are met to obtain the green ammonia prediction model.

[0031] In a third aspect, the electronic device provided in the present application includes a memory and a processor, the memory stores a computer program, and the processor is used to run the computer program in the memory to implement the steps in the optimization modeling method of the green ammonia production process provided in the present application.

[0032] In a fourth aspect, the computer-readable storage medium provided in the present application stores a plurality of instructions, which are suitable for loading by a processor to implement the steps in the optimization modeling method for the green ammonia production process provided in the present application.

[0033] In a fifth aspect, the computer program product provided in the present application includes a computer program or instructions, which, when executed by a processor, implement the steps in the optimization modeling method for the green ammonia production process provided in the present application.

[0034] In this application, compared with the related art, the optimization modeling method of the green ammonia production process includes: obtaining process characteristic data of green ammonia production; preprocessing the process characteristic data to obtain preprocessed data; using random forest to model the green ammonia production process to obtain a random forest model, wherein the random forest model is used to predict the green ammonia production; determining a preset proportion of data in the preprocessed data as a training set; iteratively training the random forest model based on the training set, and dynamically adjusting the weights of each process characteristic during the iterative training of the random forest model until the preset training stop condition is met to obtain a green ammonia prediction model. This application can improve the accuracy of the green ammonia prediction model. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0036] Figure 1 It is a schematic diagram of a scenario of an optimization modeling system for a green ammonia production process provided in an embodiment of the present application;

[0037] Figure 2 This is a schematic flow chart of an embodiment of the optimization modeling method for the green ammonia production process provided in the embodiment of the present application;

[0038] Figure 3 It is a schematic diagram of a model convergence curve in the optimization modeling method for the green ammonia production process provided in an embodiment of the present application;

[0039] Figure 4 It is a schematic diagram of the test results of the test model of the test set Test1 in the optimization modeling method of the green ammonia production process provided in the embodiment of the present application;

[0040] Figure 5 It is a schematic diagram of the test results of the test model of the test set Test2 in the optimization modeling method of the green ammonia production process provided in the embodiment of the present application;

[0041] Figure 6 It is a schematic diagram of the test results of the test model of the test set Test3 in the optimization modeling method of the green ammonia production process provided in the embodiment of the present application;

[0042] Figure 7 It is a schematic diagram of the test results of the test model of the test set Test4 in the optimization modeling method of the green ammonia production process provided in the embodiment of the present application;

[0043] Figure 8 It is a structural schematic diagram of an embodiment of an optimization modeling device for a green ammonia production process provided in an embodiment of the present application;

[0044] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] It should be noted that the principles of the present application are illustrated by implementing them in an appropriate computing environment. The following description is based on the illustrated specific embodiments of the present application and should not be considered as limiting other specific embodiments of the present application that are not described in detail herein.

[0046] In the following description of the present application, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0047] In the following description of the present application, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.

[0048] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0049] In order to improve the effect of optimization modeling of the green ammonia production process, the embodiments of the present application provide an optimization modeling method for the green ammonia production process, an optimization modeling device for the green ammonia production process, an electronic device, a computer-readable storage medium, and a computer program product. The optimization modeling method for the green ammonia production process can be executed by the optimization modeling device for the green ammonia production process, or by an electronic device integrated with the optimization modeling device for the green ammonia production process.

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

[0051] Please refer to Figure 1 , the present application also provides an optimization modeling system for a green ammonia production process, such as Figure 1 As shown, the electronic device 100 of the optimization modeling system for the green ammonia production process is integrated with the optimization modeling device for the green ammonia production process provided by the present application.

[0052] Among them, the electronic device 100 can be any device equipped with a processor and has processing capabilities, such as mobile electronic devices with processors such as smart phones, tablet computers, PDAs, laptops, smart speakers, or fixed electronic devices with processors such as desktop computers, televisions, servers, industrial equipment, etc.

[0053] In addition, if Figure 1As shown, the optimization modeling system for the green ammonia production process may also include a memory 200 for storing raw data, intermediate data, and result data.

[0054] In the embodiment of the present application, the memory 200 can be a cloud storage. Cloud storage is a new concept extended and developed from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as the storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of different types of storage devices (storage devices are also called storage nodes) in the network through application software or application interfaces to work together and provide external data storage and business access functions.

[0055] At present, the storage method of the storage system is: create a logical volume, and when creating a logical volume, allocate physical storage space for each logical volume. The physical storage space may be composed of disks of a storage device or several storage devices. The client stores data on a logical volume, that is, stores the data on the file system. The file system divides the data into many parts, each of which is an object. The object contains not only data but also additional information such as data identification (ID, ID entity). The file system writes each object into the physical storage space of the logical volume, and the file system records the storage location information of each object, so that when the client requests to access the data, the file system can allow the client to access the data according to the storage location information of each object.

[0056] The process of the storage system allocating physical storage space to a logical volume is as follows: based on the estimated capacity of the objects stored in the logical volume (this estimate often has a large margin relative to the actual capacity of the objects to be stored) and the grouping of independent redundant disk arrays (RAID, Redundant Array of Independent Disk), the physical storage space is divided into stripes in advance. A logical volume can be understood as a stripe, thereby allocating physical storage space to the logical volume.

[0057] It should be noted that Figure 1 The scenario diagram of the optimization modeling system for the green ammonia production process shown is merely an example. The optimization modeling system and scenario for the green ammonia production process described in the embodiment of the present application are intended to more clearly illustrate the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided in the embodiment of the present application. A person of ordinary skill in the art will appreciate that, with the evolution of the optimization modeling system for the green ammonia production process and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is equally applicable to similar technical problems.

[0058] It should be noted that the serial numbers of the following embodiments are not intended to limit the preferred order of the embodiments.

[0059] Please refer to Figure 2 , Figure 2 FIG. 1 is a flow chart of an embodiment of the optimization modeling method for the green ammonia production process provided in the embodiment of the present application, such as Figure 2 As shown, the process of the optimization modeling method for the green ammonia production process provided in this application is as follows:

[0060] 201. Obtain process characteristic data for green ammonia production.

[0061] In the embodiment of the present application, the process characteristic data includes time series data formed by continuously recording key parameters using various sensors and instruments, and the time series data includes temperature, pressure, flow, liquid level, raw material composition and product quality.

[0062] In the implementation of this application, the process characteristic data of green ammonia production is comprehensively collected, including a large amount of time series data formed by continuously recording key parameters using various sensors and instruments. These data come from four sections: hydrogen production by electrolysis of water, synthesis gas compression, ammonia synthesis, and cooling and separation, including process variables such as temperature, pressure, flow, and liquid level, as well as analytical data such as raw material composition and product quality.

[0063] At the same time, according to the characteristics of green ammonia production data, it is divided into two categories: steady state and dynamic:

[0064] The steady-state category is divided into 9 categories: production load 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100%, and 110%.

[0065] Dynamic data is divided into two categories: load increase and load reduction. The load increase data includes the following 9 categories: production load 30%-40%, 40%-50%, 50%-60%, 60%-70%, 70%-80%, 80%-90%, 90%-100%, 100%-110%. The load reduction data includes: 110%-100%, 100%-90%, 90%-80%, 80%-70%, 70%-60%, 60%-50%, 50%-40%, 40%-30%.

[0066] At the same time, the variable library that affects the final product output and has potential correlation is divided as the decision variable related to the green ammonia output, specifically: the potential correlation variable library of electrolytic cell temperature, the potential correlation variable library of electrolytic cell pressure, the potential correlation variable library of synthesis tower temperature, the potential correlation variable library of synthesis tower pressure, and the potential correlation variable library of ammonia content in the gas discharged from the synthesis tower. Each library contains the following variables:

[0067] The potential variable library related to the electrolytic cell temperature contains 17 variables: electrolytic cell input power, electrolytic cell inlet flow, electrolytic cell outlet flow, electrolytic cell inlet temperature, electrolytic cell pressure, alkali solution circulation flow, supplementary alkali solution temperature, supplementary alkali solution flow, hydrogen side gas-liquid separation tower bottom outlet temperature, oxygen side gas-liquid separation tower bottom outlet temperature, hydrogen side gas-liquid separation tower bottom outlet flow, oxygen side gas-liquid separation tower bottom outlet flow, hydrogen side gas-liquid separation tower bottom outlet pressure, oxygen side gas-liquid separation tower bottom pressure, alkali solution cooler outlet temperature, circulating cooling water flow, circulating cooling water temperature;

[0068] The potential variable library of electrolytic cell pressure related variables includes 16 variables: electrolytic cell input power, electrolytic cell inlet pressure, electrolytic cell inlet flow, electrolytic cell outlet pressure, electrolytic cell outlet flow, electrolytic cell inlet temperature, electrolytic cell outlet temperature, oxygen side gas-liquid separation tower bottom outlet temperature, hydrogen side gas-liquid separation tower bottom outlet temperature, oxygen side gas-liquid separation tower bottom outlet flow, oxygen side gas-liquid separation tower bottom outlet flow, hydrogen side gas-liquid separation tower bottom outlet pressure, oxygen side gas-liquid separation tower bottom pressure, alkali liquid cooler outlet temperature, alkali liquid cooler outlet pressure;

[0069] The library of potential related variables for synthesis tower temperature includes the following 20 variables: synthesis tower inlet temperature, synthesis tower outlet temperature, synthesis tower inlet flow, synthesis tower outlet flow, hydrogen raw material flow, nitrogen raw material flow, gas-liquid separation tower top outlet pressure, gas-liquid separation tower top outlet flow, gas-liquid separation tower top outlet temperature, gas-liquid separation tower bottom outlet pressure, gas-liquid separation tower bottom outlet temperature, gas-liquid separation tower bottom outlet flow, flash tower top outlet pressure, flash tower top outlet flow, flash tower top outlet temperature, flash tower bottom outlet pressure, flash tower bottom outlet flow, flash tower bottom outlet flow, boiler steam temperature, boiler steam flow.

[0070] The library of potential related variables for synthesis tower pressure includes the following 26 variables: synthesis tower inlet pressure, synthesis tower outlet pressure, synthesis tower inlet flow, synthesis tower outlet flow, feed first stage compressor outlet temperature, feed first stage compressor outlet pressure, feed second stage compressor outlet temperature, feed second stage compressor outlet temperature, feed third stage compressor outlet pressure, feed third stage compressor outlet temperature, feed third stage compressor outlet pressure, feed third stage compressor outlet temperature, feed fourth stage compressor outlet pressure, gas-liquid separation tower top outlet pressure, gas-liquid separation tower top outlet flow, gas-liquid separation tower top outlet temperature, gas-liquid separation tower bottom outlet pressure, gas-liquid separation tower bottom outlet temperature, gas-liquid separation tower bottom outlet flow, flash tower top outlet pressure, flash tower top outlet flow, flash tower top outlet temperature, flash tower bottom outlet pressure, flash tower bottom outlet flow, flash tower bottom outlet flow.

[0071] The library of potential related variables for ammonia content in the gas outflowing from the synthesis tower includes the following 22 variables: synthesis tower inlet temperature, synthesis tower inlet pressure, synthesis tower inlet ammonia content, gas-liquid separation tower top outlet pressure, gas-liquid separation tower top outlet flow rate, gas-liquid separation tower top outlet temperature, gas-liquid separation tower top outlet ammonia content, gas-liquid separation tower bottom outlet pressure, gas-liquid separation tower bottom outlet temperature, gas-liquid separation tower bottom outlet flow rate, gas-liquid separation tower bottom outlet ammonia content, flash tower top outlet pressure, flash tower top outlet flow rate, flash tower top outlet temperature, flash tower top outlet ammonia content, flash tower bottom outlet pressure, flash tower bottom outlet flow rate, flash tower bottom outlet flow rate, flash tower bottom outlet ammonia content, ammonia product purity, hydrogen feed flow rate, nitrogen feed flow rate.

[0072] 202. Preprocess the process characteristic data to obtain preprocessed data.

[0073] In an embodiment of the present application, the process characteristic data is preprocessed to obtain preprocessed data, including: vectorizing the process characteristic data to obtain vectorized data; and normalizing the vectorized data to obtain preprocessed data.

[0074] In the embodiment of the present application, the decision variables related to the green ammonia production are finally encoded for subsequent process evaluation.

[0075] In the embodiment of the present application, the process characteristic data is vectorized to obtain vectorized data, including: selecting different processing methods according to the characteristics of different data sets to eliminate data set noise and outliers to ensure model accuracy, such as 3σ criterion, box plot, k nearest neighbor. The jth single process characteristic variable recorded at time t is represented as Q j,t , the set of all process features is represented as the process information vector X. Therefore, the original process features collected for green ammonia production process modeling can be represented as an m×d matrix:

[0076]

[0077] Among them, m represents the number of all process features collected, and d represents the time span of each process feature data collection. For the convenience of future use, the process feature at time t is represented as a vector X t :X t =[Q 1,t ,…,Q j,t ,…,Q m,t ].

[0078] Therefore, X = [X 1 ,…,X t ,…,X d ] T .

[0079] At the same time, the actual green ammonia product output at time t is represented as yt, and the set of yt in the entire time span is represented as y. Therefore, the variables predicted by the green ammonia production model can be represented as a matrix of dimension 1×d: y = [y 1 ,…,y t ,…,y d ] T .

[0080] In the embodiment of the present application, the vectorized data is normalized to obtain preprocessed data, including: for process parameters of different types and dimensions, such as temperature, pressure, flow rate, component concentration, etc., they are normalized and mapped to a unified interval of 0 to 1 or -1 to 1 to avoid the influence of dimension differences on model weights, and the collected feature data are mapped to the same dimension using the following formula to eliminate the influence of data magnitude:

[0081] The green ammonia production process is modeled using random forest to obtain a random forest model, wherein the random forest model is used to predict the green ammonia production.

[0082] When applying the random forest model to solve the regression problem of green ammonia product output prediction, all selected process features will be used as inputs to the random forest (RF) for green ammonia production process modeling, and RF will decide the final model output through majority voting. The random forest model satisfies the following formula,

[0083]

[0084] Where n represents the number of decision trees in the random forest model; f k (X) is a single decision tree model, and its prediction output is expressed as I(·) is the characteristic function of majority voting, It is the prediction result of green ammonia production by the combined regression model.

[0085] 204. Determine a preset proportion of data in the preprocessed data as a training set.

[0086] In the embodiment of the present application, the preset ratio may be one third, 30% or other values, which may be set according to the specific circumstances.

[0087] Specifically, the collected preprocessed data is divided into three parts in proportion: one-third is used as part of the "training set" to serve the model training process, one-third is used for model evaluation, called the "test set", and one-third is used as the final verification of the model, called the "validation set". The model trained in the training set is used in the test set to evaluate the model performance, and finally the validation set is used to test the generalization ability of the model.

[0088] 205. Iteratively train the random forest model based on the training set, and dynamically adjust the weights of each process feature during the iterative training of the random forest model until the preset training stop condition is met, thereby obtaining a green ammonia prediction model.

[0089] In the embodiment of the present application, the green ammonia production process is modeled using random forest, and then the process features are selected with the help of AIGC. Through multiple rounds of iterations, the weights of each feature are dynamically adjusted to screen out the key parameters that have the greatest impact on indicators such as output and energy consumption. At the same time, each round of iteration performs a corresponding model training, and the random forest (RF) model obtained is evaluated on this basis.

[0090] In the embodiment of the present application, a random forest model is iteratively trained based on a training set, and the weights of various process features are dynamically adjusted during the iterative training of the random forest model until a preset training stop condition is met, thereby obtaining a green ammonia prediction model, including:

[0091] (1) The decision variables related to green ammonia production are regarded as antibodies of the immune system, and the objective function is regarded as antigens of the immune system.

[0092] The training process of the model proposed in this application is based on the basic mechanism of the biological immune system. It combines the concept of immunity with the genetic algorithm, and establishes a new evolutionary theory and algorithm to improve the overall performance of the algorithm. The immune algorithm constructs a dynamic and adaptive information defense system through functions similar to the biological immune system. In this application, the antigen in the immune system refers to the objective function, which is used to optimize the prediction accuracy of the output of green ammonia products. The antibody refers to the feasible solution of the objective function, that is, the decision variable. Therefore, the affinity between the antibody and the antigen is the gap between the feasible solution obtained and the actual optimal solution. The higher the affinity, the closer the feasible solution given by the algorithm is to the optimal solution of the actual problem.

[0093] (2) Randomly generate multiple decision variables related to green ammonia production as initialization antibodies.

[0094] The main problem with the information vector of the process is that it contains some redundant or even irrelevant process features. Using these redundant or irrelevant features may reduce the accuracy of the random forest model and increase its computational complexity. In the modeling, antigens and antibodies in the immune system are identified as the objective function and feasible solutions. In this application, we use a one-dimensional integer value array to represent antibodies, which represents the decision variables related to the green ammonia production, as the initialization antibody.

[0095] The antibodies are represented by the following formula: Each antibody has N genetic factors. Each gene locus in each antibody is marked as a j .

[0096] A=[aj ],j=1,2,…,n

[0097]

[0098] Q t =[F j,t ],j=1,2,…,n

[0099] Where F represents the i-th single process feature recorded at time t; A represents the control vector; n represents the number of all collected process features; Q t Represents the process characteristics at time t. j Corresponding to the corresponding F j,t , represents the process characteristic Q at time t t The relationship between and control vector A.

[0100] At the beginning of the evolution process, a number of control vectors (set to M) are randomly generated. Each control vector is regarded as a separate "antibody", denoted by A i At this point, the antibody population initialization is complete.

[0101] (3) Calculate the antibody affinity and antibody concentration of the antibody.

[0102] In this application, after each round of model training, the random forest (RF) model obtained by the training is evaluated, and the coefficient of determination (R2) is selected as a characterization indicator of the prediction accuracy of green ammonia product output. In order to obtain the best accuracy of green ammonia product prediction, the calculation formula of the antibody affinity of the body is as follows:

[0103]

[0104] Among them, F i The antibody affinity for each antibody, represents the output of the random forest model corresponding to the i-th antibody, Represents the average value of y, which represents the actual green ammonia product output. The higher the affinity, the better the model accuracy.

[0105] Effective parent antibodies are the evolutionary basis for the next generation of offspring antibodies. First, a certain number of antibodies with high affinity are recorded. Then, the parent antibodies of the next generation are selected based on the reproduction probability. The criterion for determining the reproduction probability requires a comprehensive consideration of the affinity and concentration of the antibodies, rather than over-emphasizing a single indicator of affinity or concentration. However, most selection operations of basic genetic algorithms directly clone individuals with higher fitness to the next generation. AIGA tends to use antibodies with high affinity and low concentration to ensure the diversity and "immune balance" of parent antibodies. Then the adaptive crossover and mutation strategy is applied to the generation of new antibodies, and together with the previously recorded high-affinity antibodies, a new generation of antibody populations is formed. Then a new round of iterations continues.

[0106] In this application, antibody concentration refers to the content of antibodies carrying similar information (i.e., selected process characteristics) in all antibodies, which is evaluated using average information entropy. Antibody concentration represents the number of similar antibodies in the antibody population during each iteration, calculated by average information entropy. For a population with N antibodies and each antibody has m gene loci, which can select Z symbols, the average information entropy H(N) of antibodies is defined as:

[0107]

[0108] Among them, H i (N) is the information entropy of the ith gene, expressed as:

[0109]

[0110] P ij The probability of a specific symbol appearing in the z symbols (0 or 1 in this application) of the ith gene of "antibody":

[0111] P ij =(the total number of a specific symbol in the i-th gene) / N.

[0112] The similarity between the vth "antibody" and the wth "antibody" is given by the following formula:

[0113]

[0114] st

[0115] S v,w ∈[0,1].

[0116] H(2) is the information entropy between the two “antibodies”. When H(2) = 0, S v,w = 1. That is, all genes on these two "antibodies" are the same. The concentration of the vth "antibody" is C v It is expressed as:

[0117]

[0118] (4) Iteratively update the antibody based on the antibody affinity and antibody concentration to adjust the weights of each process feature until the preset training stop condition is met.

[0119] In a specific embodiment, antibodies with an affinity higher than a preset affinity and an antibody concentration higher than a preset concentration are taken together as a new antibody population for antibody updating.

[0120] Specifically, after the antibody population is initialized, the set of input variables used for RF process modeling is determined.

[0121] Represent the selected feature at time t as vector x t , which is determined by the following formula:

[0122]

[0123] Therefore, the screened process data will be represented as a new matrix x of dimension 1×d:

[0124] x=[x 1 ,…,x t ,…,x d ] T .

[0125] Subsequently, the determined process feature set is used as input variables of the RF algorithm to train the green ammonia process model.

[0126] The preset training stop condition includes that the difference in average affinity between two adjacent iterations of antibody populations is less than 10 -4 Or the number of iterations reaches the preset number.

[0127] The iterative generation of antibodies is used to determine the termination of the feature selection optimization process. If the evolutionary generation G is satisfied, the algorithm outputs the selected important features; otherwise, the antibodies are iteratively updated and transferred to the next link. When the difference in average affinity between two adjacent iterative generations of antibody populations is less than 10 -4 When , G is determined:

[0128] G=g+1.

[0129] st

[0130]

[0131] in, is the average affinity of the (g+1)th generation antibody, is the average affinity of the (g)th generation antibodies.

[0132] In the embodiment of the present application, each time the antibody is iteratively updated, the antibody is iteratively updated based on the antibody affinity and the antibody concentration. Antibodies with an antibody affinity higher than a preset affinity and an antibody concentration higher than a preset concentration are taken together as a new antibody population for antibody update. Specifically, the reproduction probability p is calculated based on the antibody affinity and the antibody concentration. v , the reproduction probability p v Antibodies with probability higher than the preset level form a new generation of antibody population for iterative updating of antibodies.

[0133] Parent antibodies are based on the reproduction probability p v The roulette wheel generates a new population, i.e., the next generation of antibodies. The promotion and inhibition of antibodies can improve the local search ability of the genetic algorithm. The reproduction probability p of the vth antibody v Controlled by its affinity and concentration. v It is given by the following formula:

[0134]

[0135] Among them, F v represents the affinity of the vth antibody, F w represents the affinity of the w-th antibody. r is a diversity evaluation parameter, and its value range is 0 to 1.

[0136] In addition, to avoid the exclusion of the antibody with the highest affinity value due to high concentration, the R antibodies with the highest affinity value selected in each iteration will be stored in the memory unit, and the remaining (NR) individuals will enter the p v The immune selection phase of the evaluation criteria. Antibodies are updated iteratively based on antibody affinity and antibody concentration.

[0137] Furthermore, the reproduction probability p is calculated based on the antibody affinity and antibody concentration. v , the antibody with higher affinity than the preset affinity and the reproduction probability p v Antibodies with probability higher than the preset level form a new generation of antibody population for iterative updating of antibodies.

[0138] Furthermore, a single-point crossover is performed between two randomly selected crossover parents, according to the crossover probability p c Produce offspring antibodies. And the basic mutation is based on the mutation probability p m Perform random perturbations on the selected antibodies.

[0139] In this application, a single-point crossover is performed between two randomly selected crossover parents, with a crossover probability p c Produce offspring antibodies. And the basic mutation is based on the mutation probability p m Perform random perturbations on the selected antibodies.

[0140] The combination of crossover and mutation forms a delicate balance in genetic algorithms: crossover operations prompt the algorithm to explore a large range, while mutation operations promote fine-tuning and local exploration of the algorithm at the detail level. The two work together to ensure that the algorithm can perform global optimization while focusing on local improvements, achieving a balance between search efficiency and search accuracy. This cooperative and confrontational relationship is the key to the genetic algorithm's ability to effectively solve complex optimization problems.

[0141] Therefore, the performance of the genetic algorithm mainly depends on the crossover probability p c Mutation probability p m If these two parameters are too large or too small, they will have a direct impact on the convergence and convergence speed. For different optimization problems, we use p c , p m Previously, it was determined by repeated testing. And it is difficult to find an optimal value to adapt to each problem. On this basis, an adaptive immune genetic algorithm was proposed, c , p m It can be changed and adjusted automatically. AIGA not only ensures the diversity of the population, but also ensures convergence. AIGA uses the average information entropy to calculate the similarity S(N) of the entire antibody, which is expressed as:

[0142]

[0143] st

[0144] S(N)∈[0,1].

[0145] In the initial exploration stage of the genetic algorithm, due to the large diversity among individuals in the population, that is, the fitness values ​​are widely distributed, the crossover probability (p c ) and mutation probability (p m ) to allow the algorithm to explore the solution space more freely. As the algorithm advances to the middle and late stages, individuals gradually gather near the local optimal solution, and the fitness value tends to be concentrated. In order to promote further local optimization and avoid premature stagnation, p c and p m It will be appropriately improved to promote more detailed search in the discovered better areas. By dynamically adjusting the crossover and mutation probabilities of genetic operations and selectively retaining or eliminating individuals, the genetic algorithm can achieve a good balance between exploration and utilization, effectively leading to the global or near-global optimal solution.

[0146] p c With p m Adaptively adjust according to the following formula:

[0147] p c=exp[2(S(N)-1)]

[0148] p m =0.1exp[2(S(N)-1)]

[0149] The whole evolution process is ultimately to obtain a model with the highest prediction performance. The most important issue is to select the best control vector A so that the R of the obtained random forest model is 2 maximize.

[0150] The problem of selecting the best A can be described as follows:

[0151]

[0152] After the antibody evolved for G generations, the algorithm termination condition was reached and the best antibody A was obtained. * , that is, a high-precision green ammonia production model with the best model input characteristics is obtained. Subsequently, the model is verified on the pre-divided verification test set to test the effectiveness of the model.

[0153] A green ammonia plant was used as a model to test the application and effectiveness of the AIGA-RF method. Process data of 618 process operating parameters (including equipment temperature, equipment pressure, stream flow, equipment liquid level, material analysis data, etc.) were collected. In this application, the production load was adjusted according to the load changes of 10%, 20%, and 30% to obtain the original system data. Since the system is in steady state operation under a certain load, the steady state operation data was averaged after deduplication.

[0154] The initial antibody population size N is set to 100, the memory bank capacity RR of high-affinity antibodies is set to 10, and the settings of all parameters of the AIGA-RF model are shown in Table 1. The matrix size of the preprocessed dataset is 615×2041, and the model training set and test set are divided into a ratio of 8:2. The validation set uses the processed four different amplitude load adjustment data.

[0155] Table 1 AIGA model parameter settings

[0156]

[0157] Table 2 shows the different test set parameters. Table 2 is shown in the following table.

[0158]

[0159] The convergence process of the target product, i.e., green ammonia production, is shown in Figure 3 .from Figure 3It can be seen that after 20 rounds of iterations, the model prediction accuracy can reach above 0.99, which proves the effectiveness of the model constructed in this application.

[0160] After the model is trained, the validation set is used to verify the general applicability of the model. The validation results are as follows: Figures 4 to 7 As shown in Table 3, the prediction accuracy is also measured by adding mean square error (MSE) and mean absolute error (MAE).

[0161] Table 3 shows the model prediction results of each test set. For four different green ammonia load adjustment prediction scenarios, the AIGA-RF model established in this application has good prediction accuracy. Table 3 shows the model feature numbers and simulation results for different modeling scenarios. Table 3 is shown in the following table.

[0162]

[0163] In order to further study the effectiveness of the AIGA-RF model, this case also used several other process feature selection and process modeling methods to compare the model results. The other three process feature selection methods include: immune genetic algorithm (IGA) based on convolutional process feature selection, basic genetic algorithm (GA) and principal component analysis (PCA) based on filtering process feature selection; the three process modeling methods include: back propagation neural network (BPNN) and support vector machine regression (SVR) algorithm. In order to further characterize the model prediction accuracy, the mean square error (MSE) is also added to the accuracy measurement of the model prediction results. The results are shown in Table 4.

[0164] Table 4 shows the R 2 The comparison with MSE,Table 4 is shown in the following table,

[0165]

[0166] As can be seen from Table 4, 2In terms of model accuracy characterized by MSE, the AIGA-RF method proposed in this application is superior to other methods. From the first three model prediction scenarios, the random forest model has a higher model accuracy. This is because the random sampling and voting method of the random forest (RF) model avoids model overfitting and reduces noise interference. Therefore, the above prediction results show that RF may be more suitable for industrial data than BPNN and SVR, and it has better anti-interference ability. When and only when RF, relatively accurate results can be obtained in most cases, and the model accuracy is further improved by feature selection. In addition, for different models, the number of features and feature types selected by the algorithm are also different. For the AIGA-RF model, the number of features selected is 308, while the number of features selected by AIGA-BPNN is 293.

[0167] For the comparative study of feature selection methods, it can be concluded from the first, fourth, fifth and sixth rows of the table that the process features selected by AICG can better reflect the actual operating status of the green ammonia production process system, and thus can obtain better product output prediction results. From the perspective of feature selection, the AIGA-RF model selected the reactor outlet pressure feature, while the AIGA-BPNN model did not select this feature, but selected the reactor outlet temperature feature. From the perspective of the reaction principle, synthetic ammonia is an exothermic reaction with reduced volume. Increasing the temperature is conducive to increasing the reaction rate, but not to the reaction equilibrium. The higher the pressure, the more conducive it is to increasing the reaction rate and the reaction equilibrium. The reactor outlet pressure directly characterizes the synthetic ammonia reaction pressure, that is, the reaction pressure is an important feature that affects the green ammonia product output and has a significant impact on the green ammonia production model. The quality of feature selection directly affects the model accuracy.

[0168] For different load adjustment scenarios, the verification test results of each model are shown in Table 5:

[0169] Table 5 Comparison of R2, MSE and MAE of each model in the validation set. Table 5 is shown below.

[0170]

[0171]

[0172]

[0173] As can be seen from Table 5, the AIGA-RF model has good performance in R in different test sets, that is, different load adjustment scenarios. 2Compared with the model accuracy represented by MSE and MAE, they all have high prediction accuracy. The prediction accuracy of IGA-RF and RF models also performs well in the four prediction scenarios. However, the performance of other models in different prediction scenarios is sometimes good and sometimes poor. This shows that the AIGA-RF model proposed in this application has good versatility in different scenarios, while the other models have poor applicability and cannot be well adapted to this dynamic.

[0174] Compared with the related art, the optimization modeling method of the green ammonia production process includes: obtaining process characteristic data of green ammonia production; preprocessing the process characteristic data to obtain preprocessed data; using random forest to model the green ammonia production process to obtain a random forest model, wherein the random forest model is used to predict the green ammonia production; determining a preset proportion of data in the preprocessed data as a training set; iteratively training the random forest model based on the training set, and dynamically adjusting the weights of each process characteristic during the iterative training of the random forest model until the preset training stop condition is met to obtain a green ammonia prediction model. The present application can improve the accuracy of the green ammonia prediction model.

[0175] In order to facilitate better implementation of the optimization modeling method for the green ammonia production process provided in the embodiment of the present application, the embodiment of the present application also provides an optimization modeling device for the green ammonia production process based on the optimization modeling method for the green ammonia production process. The meanings of the terms are the same as those in the optimization modeling method for the green ammonia production process. For specific implementation details, please refer to the description in the above method embodiment.

[0176] Please refer to Figure 8 , Figure 8 1 is a schematic diagram of the structure of an embodiment of an optimization modeling device for a green ammonia production process provided in an embodiment of the present application. The optimization modeling device for a green ammonia production process may include:

[0177] An acquisition module 701 is used to acquire process characteristic data of green ammonia production;

[0178] A preprocessing module 702 is used to preprocess the process characteristic data to obtain preprocessed data;

[0179] A modeling module 703 is used to model the green ammonia production process using random forest to obtain a random forest model, wherein the random forest model is used to predict the green ammonia production;

[0180] A determination module 704 is used to determine a preset proportion of data in the preprocessed data as a training set;

[0181] The training module 705 is used to iteratively train the random forest model based on the training set, and dynamically adjust the weights of various process characteristics during the iterative training of the random forest model until a preset training stop condition is met to obtain a green ammonia prediction model.

[0182] The specific implementation of each of the above modules can be found in the previous embodiments and will not be described in detail here.

[0183] Please refer to Fig. 9 , Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0184] The electronic device may include components such as a processor 101 with one or more processing cores, a memory 102 with one or more computer-readable storage media, a power supply 103, and an input unit 104. Those skilled in the art will appreciate that the electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:

[0185] The processor 101 is the control center of the electronic device, which uses various interfaces and lines to connect various parts of the entire electronic device, and executes various functions of the electronic device and processes data by running or executing software programs and / or modules stored in the memory 102, and calling data stored in the memory 102. Optionally, the processor 101 may include one or more processing cores; optionally, the processor 101 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 101.

[0186] The memory 102 can be used to store software programs and modules. The processor 101 executes various functional applications and optimization modeling of the green ammonia production process by running the software programs and modules stored in the memory 102. The memory 102 may mainly include a program storage area and a data storage area, wherein the program storage area may 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 may store data created according to the use of the electronic device, etc. In addition, the memory 102 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 102 may also include a memory controller to provide the processor 101 with access to the memory 102.

[0187] The electronic device also includes a power supply 103 for supplying power to each component. Optionally, the power supply 103 can be logically connected to the processor 101 through a power management system, so as to manage charging, discharging, power consumption and other functions through the power management system. The power supply 103 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.

[0188] The electronic device may further include an input unit 104, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0189] Although not shown, the electronic device may also include a display unit, an image acquisition element, etc., which will not be described in detail here. Specifically in this embodiment, the processor 101 in the electronic device will load the executable code corresponding to one or more computer programs into the memory 102 according to the following instructions, and the processor 101 will execute the steps in the optimization modeling method of the green ammonia production process provided in this application, such as:

[0190] The process characteristic data of green ammonia production is obtained; the process characteristic data is preprocessed to obtain preprocessed data; the green ammonia production process is modeled using random forest to obtain a random forest model, wherein the random forest model is used to predict the green ammonia production; a preset proportion of data in the preprocessed data is determined as a training set; the random forest model is iteratively trained based on the training set, and the weights of each process characteristic are dynamically adjusted during the iterative training of the random forest model until a preset training stop condition is met, thereby obtaining a green ammonia prediction model.

[0191] It should be noted that the electronic device provided in the embodiment of the present application and the optimization modeling method of the green ammonia production process in the above embodiment belong to the same concept, and its specific implementation process is detailed in the above related embodiments and will not be repeated here.

[0192] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program stored therein is executed on a processor of an electronic device provided in an embodiment of the present application, the processor of the electronic device executes the steps in the optimization modeling method for the green ammonia production process provided in the present application. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0193] The present application also provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes various optional implementations of the above-mentioned optimization modeling method for the green ammonia production process.

[0194] The above is a detailed introduction to the optimization modeling method and device for the green ammonia production process provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application; at the same time, for technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

[0195] It should be noted that when the above embodiments of the present application are applied to specific products or technologies, the relevant data of the user is involved, and the user's permission or consent is required, and the collection, use and processing of the relevant data need to comply with the relevant laws, regulations and standards of the relevant region.

Claims

1. An optimization modeling method for a green ammonia production process, characterized in that: The optimization modeling method of the green ammonia production process includes: Obtain process characteristic data for green ammonia production; Preprocessing the process characteristic data to obtain preprocessed data; The green ammonia production process is modeled using random forest to obtain a random forest model, wherein the random forest model is used to predict the green ammonia production; Determine a preset proportion of data in the preprocessed data as a training set; The random forest model is iteratively trained based on the training set, and the weights of each process feature are dynamically adjusted during the iterative training of the random forest model until the preset training stop condition is met to obtain the green ammonia prediction model.

2. The optimization modeling method for the green ammonia production process according to claim 1, characterized in that: The process characteristic data include time series data formed by continuously recording key parameters using various sensors and instruments, and the time series data include temperature, pressure, flow, liquid level, raw material composition and product quality.

3. The optimization modeling method for the green ammonia production process according to claim 1, characterized in that: The random forest model satisfies the following formula: Where n represents the number of decision trees in the random forest model; f k (X) is a single decision tree model, and its prediction output is expressed as I(·) is the characteristic function of majority voting, It is the prediction result of green ammonia production by the combined regression model of multiple decision tree models.

4. The optimization modeling method for the green ammonia production process according to claim 3, characterized in that: The preprocessing of the process characteristic data to obtain preprocessed data includes: Vectorizing the process characteristic data to obtain vectorized data; The vectorized data is normalized to obtain preprocessed data.

5. The optimization modeling method for the green ammonia production process according to claim 4, characterized in that: The random forest model is iteratively trained based on the training set, and the weights of each process feature are dynamically adjusted during the iterative training of the random forest model until a preset training stop condition is met to obtain a green ammonia prediction model, including: The decision variables related to green ammonia production are regarded as antibodies of the immune system, and the objective function is regarded as antigen of the immune system; Randomly generate multiple decision variables related to green ammonia production as initialization antibodies; Calculate antibody affinity and antibody concentration of antibodies; Iteratively update the antibody based on antibody affinity and antibody concentration to adjust the weights of each process feature until the preset training stop condition is met, where the preset training stop condition includes that the difference in average affinity between two adjacent iterations of antibody populations is less than 10 -4 Or the number of iterations reaches the preset number.

6. The optimization modeling method for the green ammonia production process according to claim 5, characterized in that: The calculation formula of the antibody affinity of the antibody is as follows, Among them, F i The antibody affinity for each antibody, represents the output of the random forest model corresponding to the i-th antibody, Represents the average value of y, where y represents the actual green ammonia product output.

7. An optimization modeling device for a green ammonia production process, characterized in that: The optimization modeling device of the green ammonia production process comprises: An acquisition module is used to obtain process characteristic data of green ammonia production; A preprocessing module, used for preprocessing the process characteristic data to obtain preprocessed data; A modeling module, used to model the green ammonia production process using random forest to obtain a random forest model, wherein the random forest model is used to predict the green ammonia production; A determination module, used for determining a preset proportion of data in the preprocessed data as a training set; The training module is used to iteratively train the random forest model based on the training set, and dynamically adjust the weights of various process characteristics during the iterative training of the random forest model until the preset training stop conditions are met to obtain the green ammonia prediction model.

8. An electronic device, characterized in that: It comprises a memory and a processor, wherein the memory stores a computer program, and the processor is used to run the computer program in the memory to execute the steps in the optimization modeling method for the green ammonia production process according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, which are suitable for loading by a processor to execute the steps in the optimization modeling method for the green ammonia production process according to any one of claims 1 to 6.

10. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps in the optimization modeling method for the green ammonia production process described in any one of claims 1 to 6 are implemented.