A method and device for confirming corrosion inhibitor
By optimizing the selection of corrosion inhibitors using conditional adversarial generative networks and the backward gradient propagation algorithm, the problem of low efficiency in corrosion inhibitor selection is solved, and fast and efficient corrosion inhibitor selection is achieved.
Patent Information
- Application Number
- CN202410617464.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-17
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2044-05-17
AI Technical Summary
Existing technologies are inefficient in selecting corrosion inhibitors, requiring extensive experiments, which leads to low efficiency in selecting corrosion inhibitors.
A conditional adversarial generative network is used for training with the SMILES format of corrosion inhibitor molecular structures and related data. The back gradient propagation algorithm of the generator and discriminator optimizes the corrosion inhibitor selection process and expands the corrosion inhibitor sample data to improve selection efficiency.
By expanding the training samples with limited corrosion inhibition data, and using a generator to quickly select the corrosion inhibitor with the highest corrosion inhibition efficiency, the selection efficiency of corrosion inhibitors is improved.
Smart Images

Figure CN118553320B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method and device for confirming a corrosion inhibitor. Background Art
[0002] Corrosion is one of the main causes of damage to metal materials and structures, causing huge economic losses worldwide. Corrosion inhibitors are an effective way to inhibit metal corrosion, with the advantages of low cost, simple operation and high efficiency. At present, a large number of experiments are required when selecting corrosion inhibitors, resulting in relatively low efficiency in the selection of corrosion inhibitors. Summary of the invention
[0003] In view of this, an embodiment of the present application provides a method and device for confirming a corrosion inhibitor to improve the selection efficiency when selecting a corrosion inhibitor.
[0004] In a first aspect, an embodiment of the present application provides a method for confirming a corrosion inhibitor, the method comprising:
[0005] After obtaining the corrosion inhibition data of several corrosion inhibitors, for each corrosion inhibition data, according to the corrosion inhibitor molecular structure SMILES format in the corrosion inhibition data, each non-hydrogen atom included in the corrosion inhibitor molecular structure SMILES format is used as the start of reading, and the molecular connection relationship included in the corrosion inhibitor molecular structure SMILES format is read to obtain multiple enhanced SMILES formats, wherein the enhanced SMILES format and the corrosion inhibitor molecular structure SMILES format are different SMILES formats of the same corrosion inhibitor molecule, and the corrosion inhibition data also includes: corrosive medium data, inhibited metal, corrosion inhibition temperature, corrosion inhibition efficiency and corrosion inhibitor concentration;
[0006] For any enhanced SMILES format, the enhanced SMILES format is combined with other data in the corrosion inhibition data to obtain extended data, so as to use the extended data and the corrosion inhibition data as corrosion inhibition sample data;
[0007] After obtaining the corrosion inhibition sample data corresponding to all the corrosion inhibition data, for each corrosion inhibition sample data, the feature vector corresponding to the corrosion inhibition sample data and the noise vector used to keep all the corrosion inhibition sample data in normal distribution are input into the generator in the conditional adversarial generation network to obtain the first feature vector corresponding to the first corrosion inhibitor molecular structure SMILES format, wherein the noise vector corresponding to each corrosion inhibition sample data is randomly generated;
[0008] The first feature vector and the second feature vector corresponding to the second corrosion inhibitor molecular structure SMILES format included in the corrosion inhibition sample data are input into the discriminator in the conditional adversarial generation network, and the objective function value is calculated using the following formula:
[0009]
[0010] Among them, G represents the generator, D represents the discriminator, L cGAN To combat the loss, L Lc is the Morgan similarity between the first eigenvector and the second eigenvector, and λ is L Lc The preset coefficient of
[0011] Determine whether the objective function value is less than a set function value set for the objective function value; if the objective function value is greater than or equal to the set function value, adjust the adjustable parameters in the generator according to the reverse gradient propagation algorithm until the obtained objective function value is less than the set function value, wherein the set function value corresponding to the objective function value obtained for the first time is a preset initial function value, and the set function value corresponding to the objective function value obtained after the first time is the objective function value obtained last time;
[0012] After obtaining the trained generator, the target data is input into the trained generator to obtain the third eigenvector corresponding to the third corrosion inhibitor molecular structure in SMILES format, so that the corrosion inhibitor corresponding to the third eigenvector is used as the corrosion inhibitor with the highest corrosion inhibition efficiency, wherein the target data includes: target corrosive medium data, target inhibited metal, target corrosion inhibition temperature, target corrosion inhibition efficiency and target corrosion inhibitor concentration.
[0013] In a feasible embodiment, the corrosive medium data includes: corrosive medium, type of corrosive medium and concentration of corrosive medium;
[0014] Corrosive media include: sulfuric acid, hydrogen chloride or sodium chloride;
[0015] Types of corrosive media include: acids, alkalis or salts.
[0016] In one feasible embodiment, the method further comprises:
[0017] After obtaining the corrosion inhibition sample data corresponding to all the corrosion inhibition data, for each corrosion inhibition sample data, the corrosion inhibitor molecular structure SMILES format in the corrosion inhibition sample data is subjected to Morgan fingerprint conversion according to the set fingerprint radius to obtain a Morgan fingerprint vector;
[0018] The numerical data in the corrosion inhibition sample data is normalized to obtain a normalized feature vector, wherein the value range of the normalized feature vector is [0,1];
[0019] For other data in the corrosion inhibition sample data, assign values to data attributes of the other data to obtain an assignment vector;
[0020] The Morgan fingerprint vector, the corresponding normalized feature vector and the assignment vector are spliced together to obtain a spliced vector, so that the spliced vector is used as the feature vector corresponding to the corrosion inhibition sample data.
[0021] In a feasible implementation scheme, L is obtained using the following formula: cGAN (G,D):
[0022] L cGAN (G,D)=E x,y [logD(x,y)+E x,z [log(1-D(x,G(x,z)))];
[0023] Wherein, E represents averaging, x is the second eigenvector, y is the first eigenvector, and z is the noise vector.
[0024] In a feasible implementation scheme, L is obtained using the following formula: Lc (G):
[0025]
[0026] Among them, “&” represents the AND operation, and “|” represents the OR operation.
[0027] In a feasible implementation scheme, after obtaining the corrosion inhibition sample data corresponding to all the corrosion inhibition data, the corrosion inhibition sample data input into the generator is selected by temperature sampling.
[0028] In a second aspect, an embodiment of the present application provides a device for confirming a corrosion inhibitor, the device comprising:
[0029] The enhancement unit is used for, after obtaining the corrosion inhibition data of several corrosion inhibitors, for each corrosion inhibition data, according to the corrosion inhibitor molecular structure SMILES format in the corrosion inhibition data, taking each non-hydrogen atom included in the corrosion inhibitor molecular structure SMILES format as the start of reading, reading according to the molecular connection relationship included in the corrosion inhibitor molecular structure SMILES format, and obtaining multiple enhanced SMILES formats, wherein the enhanced SMILES format and the corrosion inhibitor molecular structure SMILES format are different SMILES formats of the same corrosion inhibitor molecule, and the corrosion inhibition data also includes: corrosion medium data, inhibited metal, corrosion inhibition temperature, corrosion inhibition efficiency and corrosion inhibitor concentration;
[0030] A combining unit, for combining any enhanced SMILES format with other data in the corrosion inhibition data to obtain extended data, so as to use the extended data and the corrosion inhibition data as corrosion inhibition sample data;
[0031] A generating unit is used for, after obtaining the corrosion inhibition sample data corresponding to all the corrosion inhibition data, inputting, for each corrosion inhibition sample data, a feature vector corresponding to the corrosion inhibition sample data and a noise vector for keeping all the corrosion inhibition sample data in a normal distribution into a generator in a conditional adversarial generation network, to obtain a first feature vector corresponding to the first corrosion inhibitor molecular structure in a SMILES format, wherein the noise vector corresponding to each corrosion inhibition sample data is randomly generated;
[0032] A calculation unit is used to input the first feature vector and the second feature vector corresponding to the second corrosion inhibitor molecular structure SMILES format included in the corrosion inhibition sample data into the discriminator in the conditional adversarial generation network, and calculate the objective function value using the following formula:
[0033]
[0034] Among them, G represents the generator, D represents the discriminator, L cGAN To combat the loss, L Lc is the Morgan similarity between the first eigenvector and the second eigenvector, and λ is L Lc The preset coefficient of
[0035] A training unit, used to determine whether the objective function value is less than a set function value set for the objective function value; if the objective function value is greater than or equal to the set function value, adjusting the adjustable parameters in the generator according to the reverse gradient propagation algorithm until the obtained objective function value is less than the set function value, wherein the set function value corresponding to the objective function value obtained for the first time is a preset initial function value, and the set function value corresponding to the objective function value obtained after the first time is the objective function value obtained last time;
[0036] A generating unit is used to input the target data into the trained generator after obtaining the trained generator, so as to obtain a third eigenvector corresponding to the third corrosion inhibitor molecular structure in SMILES format, so as to use the corrosion inhibitor corresponding to the third eigenvector as the corrosion inhibitor with the highest corrosion inhibition efficiency, wherein the target data includes: target corrosive medium data, target inhibited metal, target corrosion inhibition temperature, target corrosion inhibition efficiency and target corrosion inhibitor concentration.
[0037] In a feasible embodiment, the corrosive medium data includes: corrosive medium, type of corrosive medium and concentration of corrosive medium;
[0038] Corrosive media include: sulfuric acid, hydrogen chloride or sodium chloride;
[0039] Types of corrosive media include: acids, alkalis or salts.
[0040] In a feasible embodiment, the device further comprises:
[0041] A processing unit is used for, after obtaining the corrosion sample data corresponding to all the corrosion data, performing Morgan fingerprint conversion on the molecular structure of the corrosion inhibitor in the SMILES format of each corrosion sample data according to the set fingerprint radius to obtain a Morgan fingerprint vector; and, for normalizing the numerical data in the corrosion sample data to obtain a normalized feature vector, wherein the value range of the normalized feature vector is [0,1]; and, for assigning values to the data attributes of other data in the corrosion sample data to obtain an assignment vector; and, for splicing the Morgan fingerprint vector, the normalized feature vector and the assignment vector together to obtain a splicing vector, so as to use the splicing vector as the feature vector corresponding to the corrosion sample data.
[0042] In a feasible implementation scheme, the calculation unit obtains L using the following formula: cGAN (G,D):
[0043] L cGAN (G,D)=E x,y [logD(x,y)+E x,z [log(1-D(x,G(x,z)))];
[0044] Wherein, E represents averaging, x is the second eigenvector, y is the first eigenvector, and z is the noise vector.
[0045] In a feasible implementation scheme, the calculation unit obtains L using the following formula: Lc (G):
[0046]
[0047] Among them, “&” represents the AND operation, and “|” represents the OR operation.
[0048] In a feasible implementation scheme, after obtaining the corrosion inhibition sample data corresponding to all the corrosion inhibition data, the corrosion inhibition sample data input into the generator is selected by temperature sampling.
[0049] The technical solution provided by the embodiments of the present application may have the following beneficial effects:
[0050] In the present application, a limited number of corrosion inhibition data are first expanded into corrosion inhibition sample data that meets the training quantity requirements, and then the reverse gradient propagation algorithm is used to train the generator using the corrosion inhibition sample data. After the generator is trained, the set target data can be used to obtain the corrosion inhibitor. The above method is beneficial to improving the efficiency of corrosion inhibitor selection when using the set target data to select the corrosion inhibitor.
[0051] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0053] Figure 1 A schematic flow chart of a method for confirming a corrosion inhibitor provided in an embodiment of the present application;
[0054] Figure 2 A schematic diagram of the structure of a corrosion inhibitor confirmation device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0056] Figure 1 A schematic diagram of a method for confirming a corrosion inhibitor provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method comprises the following steps:
[0057] Step 101, after obtaining the corrosion inhibition data of several corrosion inhibitors, for each corrosion inhibition data, according to the corrosion inhibitor molecular structure SMILES (Simplified molecular input line entry system) format in the corrosion inhibition data, each non-hydrogen atom included in the corrosion inhibitor molecular structure SMILES format is used as the starting point for reading, and the molecular connection relationship included in the corrosion inhibitor molecular structure SMILES format is read to obtain multiple enhanced SMILES formats, the enhanced SMILES format and the corrosion inhibitor molecular structure SMILES format are different SMILES formats of the same corrosion inhibitor molecule, and the corrosion inhibition data also includes: corrosive medium data, inhibited metal, corrosion temperature, corrosion efficiency and corrosion inhibitor concentration.
[0058] Step 102: For any enhanced SMILES format, combine the enhanced SMILES format with other data in the corrosion inhibition data to obtain extended data, so as to use the extended data and the corrosion inhibition data as corrosion inhibition sample data.
[0059] Step 103. After obtaining the corrosion inhibition sample data corresponding to all the corrosion inhibition data, for each corrosion inhibition sample data, the feature vector corresponding to the corrosion inhibition sample data and the noise vector used to keep all the corrosion inhibition sample data in a normal distribution are input into the generator in the conditional adversarial generative network to obtain the first feature vector corresponding to the first corrosion inhibitor molecular structure SMILES format, wherein the noise vector corresponding to each corrosion inhibition sample data is randomly generated.
[0060] Step 104: input the first feature vector and the second feature vector corresponding to the second corrosion inhibitor molecular structure SMILES format included in the corrosion inhibition sample data into the discriminator in the conditional adversarial generation network, and calculate the objective function value using the following formula 1:
[0061]
[0062] Among them, G represents the generator, D represents the discriminator, L cGAN To combat the loss, L Lc is the Morgan similarity between the first eigenvector and the second eigenvector, and λ is L Lc The preset coefficient of .
[0063] Step 105, determine whether the objective function value is less than the set function value set for the objective function value; if the objective function value is greater than or equal to the set function value, adjust the adjustable parameters in the generator according to the reverse gradient propagation algorithm until the obtained objective function value is less than the set function value, wherein the set function value corresponding to the objective function value obtained for the first time is the preset initial function value, and the set function value corresponding to the objective function value obtained after the first time is the objective function value obtained last time.
[0064] Step 106. After obtaining the trained generator, input the target data into the trained generator to obtain a third eigenvector corresponding to the third corrosion inhibitor molecular structure in SMILES format, so as to use the corrosion inhibitor corresponding to the third eigenvector as the corrosion inhibitor with the highest corrosion inhibition efficiency, wherein the target data includes: target corrosive medium data, target inhibited metal, target corrosion inhibition temperature, target corrosion inhibition efficiency and target corrosion inhibitor concentration.
[0065] Specifically, corrosion data of several corrosion inhibitors can be collected from literature or generated through experiments, and the obtained corrosion data include different corrosion data corresponding to different corrosion inhibitors. That is to say, for a corrosion inhibitor, the corresponding corrosion data under the corrosion inhibitor include multiple ones, and each corrosion data includes: corrosion inhibitor molecular structure SMILES format, corrosive medium data, corroded metal, corrosion temperature, corrosion efficiency and corrosion inhibitor concentration, wherein the corrosive medium data includes corrosive medium, corrosive medium type and corrosive medium concentration, and the corrosive medium includes: H2SO4 (sulfuric acid), HCl (hydrogen chloride), NaCl (sodium chloride), and the types of corrosive media include: acid, alkali or salt, that is: one can be selected from H2SO4, HCl, NaCl as the corrosive medium, and the corresponding corrosive medium type can be selected from acid, alkali or salt according to the selected corrosive medium.
[0066] After obtaining multiple corrosion inhibition data, in order to be able to train the generator, it is necessary to expand the number of corrosion inhibition data based on the obtained corrosion inhibition data. For any corrosion inhibition data, the SMILES format of the corrosion inhibitor molecular structure in the corrosion inhibition data can be transformed to complete the expansion of the corrosion inhibition data. For a molecular graph corresponding to the SMILES format of the corrosion inhibitor molecular structure, it can be read from any non-hydrogen atom. When reading, it is necessary to read according to the molecular connection relationship between molecules. For the same molecular graph, different positions of the non-hydrogen atoms read at the beginning will result in different SMILES formats of the corrosion inhibitor molecular structure finally read. Therefore, the above method can be used to A corrosion inhibitor molecular structure SMILES format is transformed into multiple corrosion inhibitor molecular structure SMILES formats (i.e., enhanced SMILES format), and then the original corrosion inhibitor molecular structure SMILES and enhanced SMILES formats are used to combine with other data in the corrosion inhibition data to obtain extended data. For example, for a corrosion inhibition data, when the corrosion inhibitor molecular structure SMILES format in the corrosion inhibition data can be transformed into 5 enhanced SMILES formats, then 5 groups of extended data can be obtained. In this way, five groups of extended data are added to the basis of one corrosion inhibition data. At this time, 6 groups of data can be obtained, so that a sufficient number of samples can be obtained to train the generator.
[0067] After obtaining the corrosion sample data corresponding to all corrosion inhibition data, any corrosion inhibition sample data can be used as input and input into the generator in the conditional adversarial generative network. In order to enable the generator to obtain the first feature vector corresponding to the first corrosion inhibitor molecular structure SMILES format that is relatively consistent with the actual situation, a noise vector is also required when inputting the corrosion inhibition sample data. The noise vector needs to satisfy the requirement of keeping all corrosion inhibition sample data normally distributed. Moreover, the noise vector corresponding to each corrosion inhibition sample data is randomly generated, that is, the noise vector corresponding to each corrosion inhibition sample data may be different.
[0068] After obtaining the first eigenvector, it is necessary to input the first eigenvector and the second eigenvector corresponding to the second corrosion inhibitor molecular structure SMILES format included in the corrosion inhibition sample data into the discriminator in the adversarial generative network, so as to obtain the objective function value using formula 1. After obtaining the objective function value, it is necessary to determine whether the currently obtained objective function value is less than the set function value set for the currently obtained objective function value. If the objective function value is less than the corresponding set function value, the adjustable parameters in the generator are adjusted according to the reverse gradient propagation algorithm. After the adjustment is completed, other corrosion inhibition sample data and the corresponding noise vector are continued to be input into the generator after the adjustment is completed, and then Then, the third eigenvector corresponding to the third corrosion inhibitor molecular structure SMILES format output by the generator is obtained, and then the third eigenvector and the fourth eigenvector corresponding to the fourth corrosion inhibitor molecular structure SMILES format included in other corrosion inhibition sample data are input into the discriminator, and the objective function value is calculated using Formula 1. After obtaining the current objective function value, the set function value set for the current objective function value is compared with the current objective function value to determine whether the current objective function value is less than the set function value. If it is greater than or equal to, continue to adjust the adjustable parameters in the generator until the objective function value is less than the set function value set for the current objective function value.
[0069] Before the corrosion inhibition sample data is input into the generator, the initial function value can be set in advance, for example, the initial function value can be set to 0. After the first corrosion inhibition sample data is input into the conditional adversarial generation network, the first objective function value corresponding to the first corrosion inhibition sample data can be obtained. The first objective function value is compared with 0. Assuming that the first objective function value is greater than 0, the first objective function value is used as the set function value, and then the adjustable parameters in the generator are adjusted according to the reverse gradient propagation algorithm. After the adjustment is completed, the second corrosion inhibition sample data is input into the conditional adversarial generation network, and the second objective function value corresponding to the second corrosion inhibition sample data can be obtained. The second objective function value is compared with the set function value with the first objective function value. Assuming that the second objective function value is greater than the first objective function value, the adjustable parameters in the generator continue to be adjusted according to the reverse gradient propagation algorithm. After the adjustment is completed, the third corrosion inhibition sample data is input into the conditional adversarial generation network, and so on, until the current objective function value is less than the set function value set for the current objective function value.
[0070] After the generator is trained, the generator can be used to quickly obtain a corrosion inhibitor that meets the requirements. Specifically, the target data including the target corrosive medium data, the target inhibited metal, the target corrosion inhibition temperature, the target corrosion inhibition efficiency and the target corrosion inhibitor concentration can be input into the trained generator. At this time, the generator can output the third eigenvector corresponding to the third corrosion inhibitor molecular structure in SMILES format. The corrosion inhibitor corresponding to the third eigenvector can be used as the corrosion inhibitor with the highest corrosion inhibition efficiency. At this time, the output target data includes: target corrosive medium data, target inhibited metal, target corrosion inhibition temperature, target corrosion inhibition efficiency and target corrosion inhibitor concentration. That is to say, based on the set corrosive medium data, inhibited metal, corrosion inhibition temperature, corrosion inhibition efficiency and corrosion inhibitor concentration, the corrosion inhibitor with the highest corrosion inhibition efficiency is determined, that is, the corrosion rate of the metal is slowest, ensuring that the metal can use the corrosion inhibitor for a longer time.
[0071] In a feasible implementation scheme, when a feature vector corresponding to a certain corrosion inhibition sample data is obtained, after the corrosion inhibition sample data corresponding to all the corrosion inhibition data are obtained, for each corrosion inhibition sample data, the corrosion inhibitor molecular structure SMILES format in the corrosion inhibition sample data is subjected to Morgan fingerprint conversion according to a set fingerprint radius to obtain a Morgan fingerprint vector, so as to convert the corrosion inhibitor molecular structure SMILES format into a vector with a coding length of 1024 and only including 0 and 1; the numerical data in the corrosion inhibition sample data (such as: corrosion inhibitor concentration, corrosive medium concentration, corrosion inhibition temperature, slow release efficiency) is normalized to obtain a normalized feature vector, wherein the value range of the normalized feature vector is [0,1]; for other Data (such as corrosive medium, type of corrosive medium, and metal to be inhibited), the data attributes of the other data are assigned to obtain an assignment vector, for example: for the metal to be inhibited (including carbon steel, stainless steel, and other materials), corrosive medium (including H2SO4, HCl, NaCl, and others), and corrosive medium type (including acid, alkali, and salt), they are respectively converted into the attributes "inhibited metal-carbon steel", "inhibited metal-stainless steel", "inhibited metal-other", "corrosive medium-H2SO4", "corrosive medium-HCl", "corrosive medium-NaCl", "corrosive medium-other", "corrosive medium type-acid", "corrosive medium type-alkali", and "corrosive medium type-salt", and the corresponding attributes are assigned 1, otherwise they are assigned 0. After obtaining the above-mentioned Morgan fingerprint vector, normalized feature vector, and assignment vector, the Morgan fingerprint vector, the corresponding normalized feature vector, and the assignment vector are spliced together to obtain a splicing vector, so that the splicing vector is used as the feature vector corresponding to the corrosion inhibition sample data, and the length of the obtained feature vector is a vector of 14.
[0072] In a feasible implementation scheme, L in Formula 1 cGAN (G,D) can be obtained by the following formula 2:
[0073] L cGAN (G,D)=E x,y [logD(x,y)+E x,z [log(1-D(x,G(x,z)))]; (Formula 2)
[0074] Wherein, E represents averaging, x is the second eigenvector, y is the first eigenvector, and z is the noise vector.
[0075] In a feasible implementation scheme, the formula in formula 1 can be obtained by the following formula 3:
[0076]
[0077] Among them, “&” represents the AND operation, and “|” represents the OR operation.
[0078] In a feasible implementation scheme, after obtaining the corrosion sample data corresponding to all the corrosion resistance data, the corrosion sample data input into the generator is selected by temperature sampling to increase the probability of sample data with less data volume of a certain molecule being selected and reduce the probability of sample data with more data volume of a certain molecule being selected.
[0079] After obtaining the corrosion inhibitor with the highest corrosion inhibition efficiency, the corrosion inhibitor can also be evaluated in the following way. The specific evaluation method can be determined according to actual needs and is not specifically limited here.
[0080] Figure 2 A schematic diagram of a corrosion inhibitor confirmation device provided in an embodiment of the present application, such as Figure 2 As shown, the device comprises:
[0081] The enhancement unit 21 is used for, after obtaining the corrosion inhibition data of several corrosion inhibitors, for each corrosion inhibition data, according to the corrosion inhibitor molecular structure SMILES format in the corrosion inhibition data, taking each non-hydrogen atom included in the corrosion inhibitor molecular structure SMILES format as the start of reading, reading according to the molecular connection relationship included in the corrosion inhibitor molecular structure SMILES format, and obtaining multiple enhanced SMILES formats, wherein the enhanced SMILES format and the corrosion inhibitor molecular structure SMILES format are different SMILES formats of the same corrosion inhibitor molecule, and the corrosion inhibition data also includes: corrosive medium data, inhibited metal, corrosion inhibition temperature, corrosion inhibition efficiency and corrosion inhibitor concentration;
[0082] A combining unit 22 is used for combining any enhanced SMILES format with other data in the corrosion inhibition data to obtain extended data, so as to use the extended data and the corrosion inhibition data as corrosion inhibition sample data;
[0083] A generating unit 23 is used for, after obtaining the corrosion sample data corresponding to all the corrosion data, inputting, for each corrosion sample data, a feature vector corresponding to the corrosion sample data and a noise vector for keeping all the corrosion sample data in a normal distribution into a generator in a conditional adversarial generation network to obtain a first feature vector corresponding to the first corrosion inhibitor molecular structure in a SMILES format, wherein the noise vector corresponding to each corrosion sample data is randomly generated;
[0084] The calculation unit 24 is used to input the first feature vector and the second feature vector corresponding to the second corrosion inhibitor molecular structure SMILES format included in the corrosion inhibition sample data into the discriminator in the conditional adversarial generation network, and calculate the objective function value using the following formula:
[0085]
[0086] Among them, G represents the generator, D represents the discriminator, L cGAN To combat the loss, L Lc is the Morgan similarity between the first eigenvector and the second eigenvector, and λ is L Lc The preset coefficient of
[0087] A training unit 25 is used to determine whether the objective function value is less than a set function value set for the objective function value; if the objective function value is greater than or equal to the set function value, the adjustable parameters in the generator are adjusted according to the reverse gradient propagation algorithm until the obtained objective function value is less than the set function value, wherein the set function value corresponding to the objective function value obtained for the first time is a preset initial function value, and the set function value corresponding to the objective function value obtained after the first time is the objective function value obtained last time;
[0088] The generation unit 26 is used to input the target data into the trained generator after obtaining the trained generator, so as to obtain the third eigenvector corresponding to the third corrosion inhibitor molecular structure in SMILES format, so as to use the corrosion inhibitor corresponding to the third eigenvector as the corrosion inhibitor with the highest corrosion inhibition efficiency, wherein the target data includes: target corrosive medium data, target inhibited metal, target corrosion inhibition temperature, target corrosion inhibition efficiency and target corrosion inhibitor concentration.
[0089] In a feasible embodiment, the corrosive medium data includes: corrosive medium, type of corrosive medium and concentration of corrosive medium;
[0090] Corrosive media include: sulfuric acid, hydrogen chloride or sodium chloride;
[0091] Types of corrosive media include: acids, alkalis or salts.
[0092] In a feasible embodiment, the device further comprises:
[0093] A processing unit is used for, after obtaining the corrosion sample data corresponding to all the corrosion data, performing Morgan fingerprint conversion on the molecular structure of the corrosion inhibitor in the SMILES format of each corrosion sample data according to the set fingerprint radius to obtain a Morgan fingerprint vector; and, for normalizing the numerical data in the corrosion sample data to obtain a normalized feature vector, wherein the value range of the normalized feature vector is [0,1]; and, for assigning values to the data attributes of other data in the corrosion sample data to obtain an assignment vector; and, for splicing the Morgan fingerprint vector, the normalized feature vector and the assignment vector together to obtain a splicing vector, so as to use the splicing vector as the feature vector corresponding to the corrosion sample data.
[0094] In a feasible implementation scheme, the calculation unit obtains L using the following formula: cGAN (G,D):
[0095] L cGAN (G,D)=E x,y [logD(x,y)+E x,z [log(1-D(x,G(x,z)))];
[0096] Wherein, E represents averaging, x is the second eigenvector, y is the first eigenvector, and z is the noise vector.
[0097] In a feasible implementation scheme, the calculation unit obtains L using the following formula: Lc (G):
[0098]
[0099] Among them, “&” represents the AND operation, and “|” represents the OR operation.
[0100] In a feasible implementation scheme, after obtaining the corrosion inhibition sample data corresponding to all the corrosion inhibition data, the corrosion inhibition sample data input into the generator is selected by temperature sampling.
[0101] about Figure 2 The implementation principle of the corresponding device can be referred to Figure 1 The detailed description of the corresponding method will not be given here.
[0102] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0103] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0104] In addition, each functional unit in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0105] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0106] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.
[0107] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application. They should all be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for confirming a corrosion inhibitor, characterized in that: The method comprises: After obtaining the corrosion inhibition data of several corrosion inhibitors, for each corrosion inhibition data, according to the corrosion inhibitor molecular structure SMILES format in the corrosion inhibition data, each non-hydrogen atom included in the corrosion inhibitor molecular structure SMILES format is used as the start of reading, and the molecular connection relationship included in the corrosion inhibitor molecular structure SMILES format is read to obtain multiple enhanced SMILES formats, wherein the enhanced SMILES format and the corrosion inhibitor molecular structure SMILES format are different SMILES formats of the same corrosion inhibitor molecule, and the corrosion inhibition data also includes: corrosive medium data, inhibited metal, corrosion inhibition temperature, corrosion inhibition efficiency and corrosion inhibitor concentration; For any enhanced SMILES format, the enhanced SMILES format is combined with other data in the corrosion inhibition data to obtain extended data, so as to use the extended data and the corrosion inhibition data as corrosion inhibition sample data; After obtaining the corrosion inhibition sample data corresponding to all the corrosion inhibition data, for each corrosion inhibition sample data, the feature vector corresponding to the corrosion inhibition sample data and the noise vector used to keep all the corrosion inhibition sample data in normal distribution are input into the generator in the conditional adversarial generation network to obtain the first feature vector corresponding to the first corrosion inhibitor molecular structure SMILES format, wherein the noise vector corresponding to each corrosion inhibition sample data is randomly generated; The first feature vector and the second feature vector corresponding to the second corrosion inhibitor molecular structure SMILES format included in the corrosion inhibition sample data are input into the discriminator in the conditional adversarial generation network, and the objective function value is calculated using the following formula: ; in, G represents the generator, D represents the discriminator, To combat losses, is the Morgan similarity between the first eigenvector and the second eigenvector, for The preset coefficient of Determine whether the objective function value is less than a set function value set for the objective function value; if the objective function value is greater than or equal to the set function value, adjust the adjustable parameters in the generator according to the reverse gradient propagation algorithm until the obtained objective function value is less than the set function value, wherein the set function value corresponding to the objective function value obtained for the first time is a preset initial function value, and the set function value corresponding to the objective function value obtained after the first time is the objective function value obtained last time; After obtaining the trained generator, the target data is input into the trained generator to obtain the third eigenvector corresponding to the third corrosion inhibitor molecular structure in SMILES format, so that the corrosion inhibitor corresponding to the third eigenvector is used as the corrosion inhibitor with the highest corrosion inhibition efficiency, wherein the target data includes: target corrosive medium data, target inhibited metal, target corrosion inhibition temperature, target corrosion inhibition efficiency and target corrosion inhibitor concentration.
2. The method for confirming a corrosion inhibitor as claimed in claim 1, characterized in that: The corrosive medium data include: corrosive medium, type of corrosive medium and concentration of corrosive medium; Corrosive media include: sulfuric acid, hydrogen chloride or sodium chloride; Types of corrosive media include: acids, alkalis or salts.
3. The method for confirming a corrosion inhibitor according to claim 1, characterized in that: The method further comprises: After obtaining the corrosion inhibition sample data corresponding to all the corrosion inhibition data, for each corrosion inhibition sample data, the corrosion inhibitor molecular structure SMILES format in the corrosion inhibition sample data is subjected to Morgan fingerprint conversion according to the set fingerprint radius to obtain a Morgan fingerprint vector; The numerical data in the corrosion inhibition sample data is normalized to obtain a normalized feature vector, wherein the value range of the normalized feature vector is [0,1]; For other data in the corrosion inhibition sample data, assign values to data attributes of the other data to obtain an assignment vector; The Morgan fingerprint vector, the corresponding normalized feature vector and the assignment vector are spliced together to obtain a spliced vector, so that the spliced vector is used as the feature vector corresponding to the corrosion inhibition sample data.
4. The method for confirming a corrosion inhibitor according to claim 1, characterized in that: Use the following formula to get : ; in, E It means to find the average value, is the second eigenvector, is the first eigenvector, is the noise vector.
5. The method for confirming a corrosion inhibitor according to claim 4, characterized in that: Use the following formula to get : ; in," " represents the AND operation, and "|" represents the OR operation.
6. The method for confirming a corrosion inhibitor according to claim 1, characterized in that: After obtaining the corrosion inhibition sample data corresponding to all the corrosion inhibition data, the corrosion inhibition sample data input into the generator is selected by using the temperature sampling method.
7. A corrosion inhibitor confirmation device, characterized in that: The device comprises: The enhancement unit is used for, after obtaining the corrosion inhibition data of several corrosion inhibitors, for each corrosion inhibition data, according to the corrosion inhibitor molecular structure SMILES format in the corrosion inhibition data, taking each non-hydrogen atom included in the corrosion inhibitor molecular structure SMILES format as the start of reading, reading according to the molecular connection relationship included in the corrosion inhibitor molecular structure SMILES format, and obtaining multiple enhanced SMILES formats, wherein the enhanced SMILES format and the corrosion inhibitor molecular structure SMILES format are different SMILES formats of the same corrosion inhibitor molecule, and the corrosion inhibition data also includes: corrosive medium data, inhibited metal, corrosion inhibition temperature, corrosion inhibition efficiency and corrosion inhibitor concentration; A combining unit, for combining any enhanced SMILES format with other data in the corrosion inhibition data to obtain extended data, so as to use the extended data and the corrosion inhibition data as corrosion inhibition sample data; A generating unit is used for, after obtaining the corrosion inhibition sample data corresponding to all the corrosion inhibition data, inputting, for each corrosion inhibition sample data, a feature vector corresponding to the corrosion inhibition sample data and a noise vector for keeping all the corrosion inhibition sample data in a normal distribution into a generator in a conditional adversarial generation network, to obtain a first feature vector corresponding to the first corrosion inhibitor molecular structure in a SMILES format, wherein the noise vector corresponding to each corrosion inhibition sample data is randomly generated; A calculation unit is used to input the first feature vector and the second feature vector corresponding to the second corrosion inhibitor molecular structure SMILES format included in the corrosion inhibition sample data into the discriminator in the conditional adversarial generation network, and calculate the objective function value using the following formula: ; in, G represents the generator, D represents the discriminator, To combat losses, is the Morgan similarity between the first eigenvector and the second eigenvector, for The preset coefficient of A training unit, used to determine whether the objective function value is less than a set function value set for the objective function value; if the objective function value is greater than or equal to the set function value, adjusting the adjustable parameters in the generator according to the reverse gradient propagation algorithm until the obtained objective function value is less than the set function value, wherein the set function value corresponding to the objective function value obtained for the first time is a preset initial function value, and the set function value corresponding to the objective function value obtained after the first time is the objective function value obtained last time; A generating unit is used to input the target data into the trained generator after obtaining the trained generator, so as to obtain a third eigenvector corresponding to the third corrosion inhibitor molecular structure in SMILES format, so as to use the corrosion inhibitor corresponding to the third eigenvector as the corrosion inhibitor with the highest corrosion inhibition efficiency, wherein the target data includes: target corrosive medium data, target inhibited metal, target corrosion inhibition temperature, target corrosion inhibition efficiency and target corrosion inhibitor concentration.
8. The corrosion inhibitor confirmation device as claimed in claim 7, characterized in that: The corrosive medium data include: corrosive medium, type of corrosive medium and concentration of corrosive medium; Corrosive media include: sulfuric acid, hydrogen chloride or sodium chloride; Types of corrosive media include: acids, alkalis or salts.
9. The corrosion inhibitor confirmation device according to claim 7, characterized in that: The device also includes: A processing unit is used for, after obtaining the corrosion sample data corresponding to all the corrosion data, performing Morgan fingerprint conversion on the molecular structure of the corrosion inhibitor in the SMILES format of each corrosion sample data according to the set fingerprint radius to obtain a Morgan fingerprint vector; and, for normalizing the numerical data in the corrosion sample data to obtain a normalized feature vector, wherein the value range of the normalized feature vector is [0,1]; and, for assigning values to the data attributes of other data in the corrosion sample data to obtain an assignment vector; and, for splicing the Morgan fingerprint vector, the normalized feature vector and the assignment vector together to obtain a splicing vector, so as to use the splicing vector as the feature vector corresponding to the corrosion sample data.
10. The corrosion inhibitor confirmation device according to claim 7, characterized in that: The calculation unit uses the following formula to obtain : ; in, E It means to find the average value, is the second eigenvector, is the first eigenvector, is the noise vector.
Citation Information
Patent Citations
Structured data generation model training method and device, equipment and storage medium
CN116150125A
Equipment corrosion rate verification method and device, equipment and storage medium
CN117571589A