Method, device, electronic device and storage medium for constructing coal molecular structure

By combining comparative learning models with elemental analysis, organic molecules are screened and spliced, which solves the problem of low efficiency in coal molecular structure construction and achieves efficient coal molecular structure construction.

CN116825226BActive Publication Date: 2025-10-14NORTH CHINA UNIVERSITY OF SCIENCE AND TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310776616.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-28
Publication Date
2025-10-14
Estimated Expiration
2043-06-28

AI Technical Summary

Technical Problem

Existing methods for constructing coal molecular structures are inefficient and time-consuming, lack unified standards, and make it difficult to accurately construct the molecular structure of amorphous polymer organic compounds.

Method used

By obtaining the infrared spectrum of the coal sample to be tested and inputting it into a pre-trained comparative learning model, combining the elemental analysis results and the preset number of carbon atoms, organic molecules are screened and spliced, and the configuration is optimized using quantum chemical calculations to generate the coal molecular structure.

Benefits of technology

It simplifies the construction process of coal molecular structure, improves construction efficiency, shortens time, and provides guidance for the diagram analysis of amorphous macromolecular structures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116825226B_ABST
    Figure CN116825226B_ABST
Patent Text Reader

Abstract

The present application provides a kind of coal molecular structure construction method, device, electronic equipment and storage medium.The method comprises: obtaining the infrared spectrum of the coal sample to be measured;The infrared spectrum is input into the pre-trained contrast learning model, and the n organic molecules with the maximum similarity to the infrared spectrum are obtained;The elemental analysis result of the coal sample to be measured and the preset carbon atom number are obtained respectively;According to the elemental analysis result and the preset carbon atom number, the molecular formula of the coal sample to be measured is determined;According to the molecular formula, the corresponding organic molecule is screened out from the n organic molecules for splicing and configuration optimization, and the coal molecular structure is obtained.The present application can shorten the construction period of coal molecular structure, and improve the construction efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of coal structure, and particularly relates to a coal molecular structure construction method and device, electronic equipment and a storage medium. BACKGROUND

[0002] The reactivity of coal is essentially determined by its chemical structure. We can easily get characterization information according to its chemical molecular structure, but it is difficult to reverse its molecular structure according to the characterization information. Especially for coal, an amorphous high molecular organic compound, even if it is experimentally characterized, it needs a long time of research and analysis to speculate its molecular structure. Speculating the molecular structure of coal can reveal some physical and chemical properties and chemical reaction mechanisms of coal from the molecular level, which helps to develop new technologies to realize the sustainable utilization of coal. Therefore, efficient and accurate construction of the molecular structure of coal has always been the premise of in-depth understanding and continuous exploration of coal chemistry by all researchers.

[0003] There is no complete and unified standard for the method of constructing the molecular structure of coal, and the establishment of the structure of amorphous macromolecules has always been a difficult problem. So far, researchers mainly use physical and chemical methods to explore the partial structural characteristics of coal, and then integrate the obtained information to speculate the molecular structure of coal. Unlike other organic macromolecules, the chemical composition and molecular structure of coal are complex and diverse, and the molecular structure of coal requires comprehensive consideration of multiple structural information, which leads to the fact that the accurate construction of the molecular structure of coal has always been a long-cycle and heavy-task engineering. SUMMARY

[0004] The present application provides a coal molecular structure construction method, device, electronic equipment and storage medium to solve the problem of long construction cycle and low efficiency of the existing coal molecular structure.

[0005] In a first aspect, the present application provides a coal molecular structure construction method, comprising:

[0006] obtaining an infrared spectrum of a coal sample to be measured;

[0007] inputting the infrared spectrum into a pre-trained contrast learning model to obtain n organic molecules with the maximum similarity to the infrared spectrum; n is an integer greater than or equal to 1;

[0008] obtaining an elemental analysis result of the coal sample to be measured and a preset number of carbon atoms;

[0009] determining a molecular formula of the coal sample to be measured according to the elemental analysis result and the preset number of carbon atoms;

[0010] According to the molecular formula, corresponding organic molecules are selected from the n organic molecules for splicing and configuration optimization to obtain a coal molecular structure.

[0011] In a possible implementation, before inputting the infrared spectrum into a pre-trained comparative learning model to obtain n organic molecules having the greatest similarity to the infrared spectrum, the method further includes:

[0012] Acquire a sample data set; each sample in the sample data set includes an organic molecule and its corresponding infrared spectrum;

[0013] Constructing a contrastive learning model; the contrastive learning model includes: a structural feature encoder and a spectral feature encoder; the structural feature encoder is used to output a structural feature corresponding to a currently input organic molecule; the spectral feature encoder is used to output a spectral feature corresponding to a currently input infrared spectrum;

[0014] Inputting the sample data set into the contrastive learning model to obtain the spectral characteristics and structural characteristics corresponding to each sample;

[0015] Calculate the similarity between each spectral feature and each structural feature;

[0016] When the similarity between each spectral feature and its corresponding structural feature is less than or equal to the similarity between the spectral feature and other structural features, the model parameters of the comparative learning model are adjusted, and the process jumps to the step of "inputting the sample data set into the comparative learning model to obtain the spectral features and structural features corresponding to each sample" until the similarity between each spectral feature and its corresponding structural feature is greater than the similarity between the spectral feature and other structural features, thereby obtaining a trained comparative learning model.

[0017] In a possible implementation, the number of carbon atoms in the organic molecules in the sample data set is less than a first preset value;

[0018] After obtaining the sample data set, the method further includes:

[0019] receiving first organic molecules input by a user, and obtaining infrared spectra corresponding to the first organic molecules based on the first organic molecules; the number of carbon atoms in the first organic molecules is greater than the first preset value;

[0020] and / or, receiving a first organic molecule input by a user, and inputting the first organic molecule into a generative model to obtain a second organic molecule, and obtaining infrared spectra corresponding to each second organic molecule based on the second organic molecule;

[0021] and / or, inputting the organic molecules in the sample data set into a generative model to obtain third organic molecules, and obtaining infrared spectra corresponding to the third organic molecules based on the third organic molecules;

[0022] adding the first organic molecule and its corresponding infrared spectrum, and / or the second organic molecule and its corresponding infrared spectrum, and / or the third organic molecule and its corresponding infrared spectrum to the sample data set to obtain an expanded sample data set;

[0023] The step of inputting the sample data set into the contrastive learning model to obtain the spectral features and structural features corresponding to each sample includes:

[0024] The expanded sample data set is input into the contrastive learning model to obtain the spectral features and structural features corresponding to each sample.

[0025] In a possible implementation, determining the molecular formula of the coal sample to be tested based on the elemental analysis result and the preset number of carbon atoms includes:

[0026] Obtaining the proportion of each atom in the coal sample to be tested from the elemental analysis results;

[0027] The molecular formula of the coal sample to be tested is determined based on the proportions of the atoms and the preset number of carbon atoms.

[0028] In a possible implementation, the step of selecting corresponding organic molecules from the n organic molecules according to the molecular formula, performing splicing and configuration optimization to obtain a coal molecular structure includes:

[0029] Obtaining a nuclear magnetic resonance result of the coal sample to be tested, and screening out a corresponding organic molecule from the n organic molecules based on the nuclear magnetic resonance result and the molecular formula;

[0030] Based on the chemical structure requirements, the screened organic molecules are spliced ​​together to obtain at least one spliced ​​coal molecular structure;

[0031] The quantum chemical calculation method is used to optimize the configuration of the spliced ​​coal molecular structure to obtain the final coal molecular structure.

[0032] In a possible implementation, after selecting corresponding organic molecules from the n organic molecules according to the molecular formula, performing splicing and configuration optimization to obtain the coal molecular structure, the method further includes:

[0033] Performing spectral simulation on the coal molecular structure to generate a simulated infrared spectrum and a simulated nuclear magnetic resonance spectrum;

[0034] The coal molecular structure is determined to be valid when the simulated infrared spectrum corresponding to at least one coal molecular structure is consistent with the infrared spectrum of the coal sample to be tested, and the simulated nuclear magnetic resonance spectrum corresponding to the coal molecular structure is consistent with the nuclear magnetic resonance spectrum of the coal sample to be tested;

[0035] The effective coal molecular structure is determined to be the coal molecular structure corresponding to the coal sample to be tested.

[0036] In a possible implementation, after performing spectral simulation on the coal molecular structure to generate a simulated infrared spectrum and a simulated nuclear magnetic resonance spectrum, the method further includes:

[0037] When the simulated infrared spectra of all coal molecular structures are inconsistent with the infrared spectrum of the coal sample to be tested, and / or the simulated nuclear magnetic resonance spectra of all coal molecular structures are inconsistent with the nuclear magnetic resonance spectrum of the coal sample to be tested, the preset number of carbon atoms is changed, and the process jumps to the step of "determining the molecular formula of the coal sample to be tested based on the elemental analysis results and the preset number of carbon atoms" until there is at least one coal molecular structure whose simulated infrared spectrum is consistent with the infrared spectrum of the coal sample to be tested, and the simulated nuclear magnetic resonance spectrum of the coal molecular structure is consistent with the nuclear magnetic resonance spectrum of the coal sample to be tested, and the coal molecular structure is determined to be valid.

[0038] In a second aspect, an embodiment of the present invention provides a device for constructing a coal molecular structure, comprising:

[0039] An acquisition module, used for acquiring an infrared spectrum of a coal sample to be tested;

[0040] A screening module is used to input the infrared spectrum into a pre-trained comparative learning model to obtain n organic molecules with the greatest similarity to the infrared spectrum; n is an integer greater than or equal to 1;

[0041] The acquisition module is also used to obtain the elemental analysis results of the coal sample to be tested and the preset carbon atom number;

[0042] A building block is used to determine the molecular formula of the coal sample to be tested based on the elemental analysis results and the preset number of carbon atoms;

[0043] The building module is also used to select corresponding organic molecules from n organic molecules according to the molecular formula, and then perform splicing and configuration optimization to obtain the coal molecular structure.

[0044] In a third aspect, an embodiment of the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the method described in the first aspect or any possible implementation of the first aspect are implemented.

[0045] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the steps of the method in the first aspect or any possible implementation manner of the first aspect.

[0046] The embodiment of the present application provides a coal molecular structure construction method and device, electronic equipment and storage medium. Through a pre-trained contrast learning model, the similarity between different infrared spectra and different organic molecules (i.e., substructures with specific functional groups) can be determined. By inputting the infrared spectrum of the coal sample to be tested into the contrast learning model, the organic molecules possibly contained in the coal sample to be tested can be determined according to the infrared spectrum. Finally, the molecular formula of the coal sample to be tested is determined according to the elemental analysis result and the preset number of carbon atoms, and the organic molecules are screened and spliced according to the molecular formula, and finally the coal molecular structure is obtained. The method does not need to perform experimental characterization on the coal sample to be tested, and does not need to use complex chemical methods such as pyrolysis, extraction and oxidation to analyze the structural characteristics of the coal sample to be tested, reduces the complex experimental operation, greatly simplifies the construction process of the coal molecular structure, shortens the construction time, and improves the construction efficiency. It has a guiding significance for the analysis of the spectrum of amorphous macromolecular structure. BRIEF DESCRIPTION OF DRAWINGS

[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0048] Figure 1 is the implementation flowchart of the coal molecular structure construction method provided by an embodiment of the present application;

[0049] Figure 2 is a schematic diagram of a user interaction interface provided by an embodiment of the present application;

[0050] Figure 3 is a training flowchart of a contrast learning model provided by an embodiment of the present application;

[0051] Figure 4 is a structure comparison diagram between the first organic molecule and the second organic molecule provided by an embodiment of the present application;

[0052] Figure 5 is a schematic diagram of a similarity matrix obtained after the training of the contrast learning model provided by an embodiment of the present application;

[0053] Figure 6is a schematic diagram of a coal molecular structure provided by an embodiment of the present application;

[0054] Figure 7 is a flowchart of a coal molecular structure construction method provided by another embodiment of the present application;

[0055] Figure 8 is a structural schematic diagram of a coal molecular structure construction device provided by an embodiment of the present application;

[0056] Figure 9 is a schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0057] In the following description, for the purpose of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc., in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application can be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.

[0058] In order to make the objects, technical solutions and advantages of the present application clearer, the following will be described by specific embodiments in conjunction with the accompanying drawings.

[0059] Figure 1 The flowchart of the coal molecular structure construction method provided by an embodiment of the present application is described in detail as follows:

[0060] Step 101: Obtain the infrared spectrum of the coal sample to be tested.

[0061] In actual application, the electronic device executing the construction method can be directly connected in communication with the infrared spectrometer, so as to obtain the infrared spectrum output by the infrared spectrometer. Alternatively, the user can obtain the infrared spectrum from the infrared spectrometer and input it into the electronic device. Exemplarily, a user interaction interface can be provided in the electronic device, for receiving the infrared spectrum input by the user. Figure 2 The user interaction interface is shown. Referring to Figure 2 The interface includes an input module 21 and an output module 22. The input module 21 is configured to receive information input by the user, including but not limited to, the infrared spectrum, the number of carbon atoms, the elemental analysis result, the nuclear magnetic resonance spectrum, the proportion of the number of saturated carbon atoms, and the proportion of the number of unsaturated carbon atoms, etc. The output module 22 is configured to display the coal molecular structure corresponding to the sample to be tested finally obtained.

[0062] Step 102: Input the infrared spectrum into a pre-trained contrast learning model to obtain n organic molecules with the greatest similarity to the infrared spectrum; n is an integer greater than or equal to 1.

[0063] Coal molecular structure is composed of multiple molecular structures, and each molecular structure is composed of multiple substructures with specific functional groups. These substructures with specific functional groups are the fundamental factors affecting the infrared spectrum. The organic molecules in the embodiments of the present application refer to the substructures with specific functional groups.

[0064] The trained contrast learning model can output n organic molecules with the highest similarity according to the input infrared spectrum. The value of n can be set by the user, and the embodiments of the present application do not make specific limitations on this.

[0065] Optionally, the contrast learning model needs to be trained in advance before step 102 is performed. Figure 3 The training flowchart of the contrast learning model is shown. Referring to Figure 3 The specific training process of the contrast learning model is as follows:

[0066] Step 201, obtaining a sample data set. Each sample in the sample data set contains an organic molecule and its corresponding infrared spectrum. The number of carbon atoms in the organic molecules in the sample data set is less than a first preset value.

[0067] The contrast learning model is mainly used to learn the internal correlation between organic molecules and infrared spectra. When the sample data set is obtained, N organic molecules possibly contained in N coal molecular structures and their corresponding infrared spectra can be directly screened from the NIST ChemistryWebBook database as samples. Due to the limitation of the number of samples in the above database, the number of carbon atoms in each organic molecule directly screened from the database is generally 3-40. The number of carbon atoms is small, and the types of organic molecules are limited, which is not enough to fully reveal the structural characteristics of coal molecular structure.

[0068] In order to ensure the training quality of the contrast learning model and improve the generalization ability of the contrast learning model, sample expansion can be performed on the basis of the above sample data set.

[0069] Optionally, after step 201, it further includes:

[0070] Receiving a user-input first organic molecule, and obtaining the infrared spectrum corresponding to each first organic molecule according to the first organic molecule; the number of carbon atoms in the first organic molecule is greater than the first preset value.

[0071] The user can input the first organic molecule with a large number of carbon atoms based on actual application experience. By inputting the first organic molecule into the pre-trained Chemprop model, the infrared spectrum corresponding to the first organic molecule can be output. The number of carbon atoms in the first organic molecule can be between 40 and 70.

[0072] The Chemprop model comprises an MPNN model and a multilayer perceptron. The first organic molecule is converted into an undirected graph and input into the MPNN model to obtain a feature vector corresponding to the first organic molecule. The feature vector is input into the multilayer perceptron to obtain an infrared spectrum corresponding to the first organic molecule.

[0073] The first organic molecule comprises atomic information and bond information. Based on the principle that each node represents an atom and each edge represents a bond, the first organic molecule can be converted into an undirected graph.

[0074] The user inputs the first organic molecule with a large number of carbon atoms according to actual experience to obtain the corresponding infrared spectrum, which can expand the sample data set vertically and make up for the lack of a small number of carbon atoms in the original sample data set

[0075] And / or, receiving the first organic molecule input by the user and inputting the first organic molecule into the generative model to obtain a second organic molecule, and obtaining the infrared spectrum corresponding to each second organic molecule according to the second organic molecule.

[0076] The generative model can learn latent variables from input data and generate new data similar to the input data but not exactly the same. Common generative models include autoregressive models, variational auto-encoders (VAE), and adversarial auto-encoders. The generative model used in the embodiments of the present application is not specifically limited, and the user can choose it. Exemplarily, the VAE model is used in the embodiments of the present application.

[0077] In the embodiments of the present application, the VAE model is used to generate a new organic molecule similar to the first organic molecule but not exactly the same from the input first organic molecule. That is, the second organic molecule. The second organic molecule is an isomer of the first organic molecule. Figure 4 The structural comparison chart between the first organic molecule and the corresponding second organic molecule is shown in FIG. 1. Figure 4 , Figure 4 The difference between the first organic molecule and the second organic molecule in FIG. 1 is that the second organic molecule has one less nitrogen atom than the first organic molecule.

[0078] Before generating the isomer using the VAE model, the VAE model needs to be trained. The training process of the VAE model is too conventional and will not be repeated here. Simply put, by repeatedly calculating the reconstruction error between the input data and the output data and the difference between the latent space distribution and the prior distribution, the VAE model parameters are adjusted until the reconstruction error is minimized and the difference between the latent space distribution and the prior distribution is minimized, the training is completed, and the trained VAE model is obtained.

[0079] The second organic molecule is input into the Chemprop model to obtain an infrared spectrum corresponding to the second organic molecule.

[0080] Even if the number of carbon atoms of the organic molecules is the same, there are different structural variants. Therefore, the VAE model can be used to generate new organic molecules with the same number of carbon atoms as the original organic molecules, for lateral expansion of the sample dataset.

[0081] And / or, the organic molecules in the sample dataset are input into the generative model to obtain third organic molecules, and the infrared spectrum corresponding to each third organic molecule is obtained according to the third organic molecule.

[0082] As above, the organic molecules with fewer carbon atoms in the original sample dataset are input into the VAE model to obtain isomers of the organic molecules, i.e., third organic molecules, which are also used for lateral expansion of the sample dataset.

[0083] The first organic molecule and its corresponding infrared spectrum, and / or the second organic molecule and its corresponding infrared spectrum, and / or the third organic molecule and its corresponding infrared spectrum, are added to the sample dataset to obtain an expanded sample dataset.

[0084] Through the above method, new organic molecules that may be contained in the coal molecular structure can be obtained and added to the original sample dataset to obtain an expanded sample dataset.

[0085] The expanded sample dataset not only contains organic molecules with different numbers of carbon atoms, but also ensures that each type of organic molecule with a certain number of carbon atoms is diverse and covers isomers of various organic molecules, so that the expanded sample dataset can fully reveal the structural characteristics of the coal molecular structure, thereby ensuring the quality of subsequent model training and improving the generalization ability of the contrast learning model.

[0086] Step 202, constructing a contrast learning model.

[0087] The contrast learning model includes a structural feature encoder and a spectral feature encoder; the structural feature encoder is used to output a structural feature corresponding to the current input of an organic molecule; and the spectral feature encoder is used to output a spectral feature corresponding to the current input of an infrared spectrum.

[0088] The structural feature encoder is mainly used to learn the mapping relationship between the organic molecule and its potential structural feature, that is, to extract the structural feature of the organic molecule. The spectral feature encoder is mainly used to learn the mapping relationship between the infrared spectrum and its potential spectral feature, that is, to extract the spectral feature of the infrared spectrum.

[0089] In order to improve the efficiency of subsequent model training, the structural feature encoder can be pre-trained in advance when constructing the contrastive learning model. In the subsequent training process of the contrastive learning model, it is only necessary to fine-tune the structural feature encoder. In the embodiment of the present invention, the encoder in the VAE model can be used as the structural feature encoder. The VAE model includes an encoder and a decoder. The encoder is used to generate data features according to the input data. The decoder is used to generate new data according to the data features. In view of the fact that the VAE model has been trained when the sample data is expanded as mentioned above, the encoder therein can be directly used as the structural feature encoder here. Applied in the embodiment of the present invention, the structural feature encoder is used to generate structural features according to the input organic molecules.

[0090] This embodiment of the present invention uses a convolutional neural network as a spectral feature encoder. This convolutional neural network is used to generate spectral features based on an input infrared spectrum. Infrared spectra are typically in image format. Accordingly, the convolutional neural network is essentially used to extract image features from infrared spectrum images.

[0091] Organic molecules in sample datasets are typically formatted as SMILES strings. Because VAE models cannot guarantee that the decoded SMILES strings they output will always correspond to valid chemical structures, prior to training the contrastive learning model, we convert the organic molecules in SMILES format to SELFIES format to facilitate subsequent model training.

[0092] Step 203: Input the sample data set into the contrastive learning model to obtain the spectral features and structural features corresponding to each sample.

[0093] Based on the above-mentioned expanded sample data set, step 203 may include:

[0094] The expanded sample data set is input into the contrastive learning model to obtain the spectral features and structural features corresponding to each sample.

[0095] Here, both the spectral features and the structural features are expressed in the form of vectors, so as to facilitate the subsequent calculation of the similarity between vectors.

[0096] Step 204: Calculate the similarity between each spectral feature and each structural feature.

[0097] The contrastive learning model can not only obtain the spectral features and structural features corresponding to each sample, but also calculate the similarity between each spectral feature and each structural feature.

[0098] As for the calculation method of the similarity, embodiments of the present application do not make specific limitations thereon, and the user can select it by himself / herself. Commonly used similarity calculation methods include: calculating the Jaccard similarity coefficient to represent the similarity; or calculating the Euclidean distance or Manhattan distance to represent the similarity; or calculating the Pearson correlation coefficient to represent the similarity.

[0099] Exemplarily, embodiments of the present application are used to represent the similarity between each spectrum feature and each structure feature by calculating the Pearson correlation coefficient between each spectrum feature and each structure feature.

[0100] By performing step 204, the similarity between all spectrum features and all structure features in the sample data set can be obtained. For the convenience of display and processing, it can be set in the form of a matrix. Exemplarily, when the sample data set contains 10 samples, a 10x10 similarity matrix can be finally obtained.

[0101] Step 205: When the similarity between each spectrum feature and the structure feature corresponding thereto is less than or equal to the similarity between the spectrum feature and other structure features, the model parameters of the contrast learning model are adjusted, and step 203 is executed until the similarity between each spectrum feature and the structure feature corresponding thereto is greater than the similarity between the spectrum feature and other structure features, and a trained contrast learning model is obtained.

[0102] The organic molecules in the sample data set correspond one-to-one to the infrared spectrum. Correspondingly, the spectrum features and the structure features also correspond one-to-one. It can be understood that among all the structure features, the similarity between each spectrum feature and the structure feature corresponding thereto should be the largest. When the similarity between each spectrum feature and the structure feature corresponding thereto is less than or equal to the similarity between the spectrum feature and other structure features, it indicates that the contrast learning model at this time has not been trained, and needs to be continuously trained. Until the similarity between each spectrum feature and the structure feature corresponding thereto is greater than the similarity between the spectrum feature and other structure features, the training is completed. Here, the "other structure features" refer to the remaining structure features among all the structure features, except for the structure feature corresponding to the current spectrum feature.

[0103] Figure 5 A schematic diagram of a similarity matrix obtained after the training of a contrast learning model is shown. Exemplarily, refer to FIG. 2. Figure 5, when the element values at the positions of the main diagonal line in the similarity matrix are all 1, the training is completed, and a trained contrast learning model is obtained. It can be understood that the element values at the positions of the main diagonal line in the similarity matrix are all 1, which belongs to an ideal state, and it is difficult to achieve in actual training. Therefore, in the embodiment of the present application, as long as the similarity between each spectrum feature and the structure feature corresponding thereto is greater than the similarity between the spectrum feature and other structure features, that is, the element value at the position of the main diagonal line is the maximum value in all element values in the row and column where the element value is located, it is considered that the training is completed.

[0104] In actual application, after the infrared spectrum of the coal sample to be tested is input into the contrast learning model, the contrast learning model generates corresponding spectrum features, and according to the spectrum features, n structure features with the greatest similarity to the spectrum features are found, and finally n organic molecules are output according to the n structure features.

[0105] In step 103, the element analysis result of the coal sample to be tested and the preset number of carbon atoms are obtained respectively.

[0106] In actual application, the electronic device executing the construction method can be directly connected in communication with the element analyzer, so as to obtain the element analysis result output by the element analyzer. The element analysis result can also be obtained by the user from the element analyzer and input into the electronic device. Referring to Figure 2 The user can input the element analysis result into the user interaction interface. Correspondingly, the preset number of carbon atoms can be pre-set by the user and saved in the electronic device, or input into the electronic device in real time through the user interaction interface.

[0107] In step 104, the molecular formula of the coal sample to be tested is determined according to the element analysis result and the preset number of carbon atoms.

[0108] Optionally, step 104 can include:

[0109] From the element analysis result, the proportion of each atom in the coal sample to be tested is obtained.

[0110] Elemental analysis is mainly used for studying the element composition of organic compounds, and is for qualitative and quantitative analysis. The former is used to identify which elements are contained in the organic compound; the latter is used to determine the percentage content of each element in the organic compound. Correspondingly, the element analysis result mainly includes the atomic species and the proportion of each atom. For coal structure, it mainly includes C, H, O, N and S five atoms. According to the element analysis result, the proportion of each atom in the coal sample to be tested can be obtained.

[0111] According to the proportion of each atom and the preset number of carbon atoms, the molecular formula of the coal sample to be tested is determined.

[0112] Exemplarily, the user pre-sets the number of carbon atoms as A, the proportion of carbon atoms as B%, the proportion of oxygen atoms as C%, the proportion of hydrogen atoms as D%, the proportion of nitrogen atoms as E%, and the proportion of sulfur atoms as F%. Wherein, B% + C% + D% + E% + F% = 100%.

[0113] Thus, the number of all atoms in the coal sample to be measured can be calculated as A / B%, the number of oxygen atoms as AC% / B%, the number of hydrogen atoms as AD% / B%, the number of nitrogen atoms as AE% / B%, and the number of sulfur atoms as AF% / B%. When the above number values are all integers, the molecular formula of the coal sample to be measured is obtained as C A H AD% / B% O AC% / B% N AE% / B% S AF% / B% When any of the number values is not an integer, rounding off the number value is needed, so as to obtain a reasonable number value, and further determine the molecular formula of the coal sample to be measured.

[0114] In step 105, the corresponding organic molecules are screened from the n organic molecules according to the molecular formula, and the coal molecular structure is obtained by splicing and configuration optimization.

[0115] Optionally, step 105 can include:

[0116] The nuclear magnetic resonance result of the coal sample to be measured is obtained, and the corresponding organic molecules are screened from the n organic molecules according to the nuclear magnetic resonance result and the molecular formula.

[0117] The nuclear magnetic resonance technology is used to study the absorption of atomic nucleus to radio frequency radiation. It is one of the most powerful tools for qualitative analysis and quantitative analysis of the composition and structure of various organic and inorganic substances. Carbon element is the main element in coal structure. The form of carbon element in coal molecular structure can be saturated carbon atom or unsaturated carbon atom. The nuclear magnetic resonance spectrum of the coal sample to be measured can be obtained by means of nuclear magnetic resonance technology, and then the proportion of the number of saturated carbon atoms and the proportion of the number of unsaturated carbon atoms in the coal sample to be measured are obtained through the nuclear magnetic resonance spectrum.

[0118] Saturated carbon atom refers to carbon atom with 4 single bonds. Conversely, if a carbon atom has double bond or triple bond, the carbon atom is unsaturated carbon atom. The proportion of the number of saturated carbon atoms refers to the ratio between the number of saturated carbon atoms and the total number of all atoms in the coal sample to be measured. The proportion of the number of unsaturated carbon atoms refers to the ratio between the number of unsaturated carbon atoms and the total number of all atoms in the coal sample to be measured.

[0119] The nuclear magnetic resonance result in the embodiment of the present application can be a nuclear magnetic resonance spectrum, or the proportion of the number of saturated carbon atoms and the proportion of the number of unsaturated carbon atoms in the coal sample to be measured.

[0120] The electronic device performing the construction method can be directly connected in communication with the nuclear magnetic resonance spectrometer, thereby obtaining the nuclear magnetic resonance spectrum of the coal sample to be measured. Referring to Figure 2 , the user can also obtain the nuclear magnetic resonance spectrum by himself and input it into the user interaction interface. Alternatively, the user can also determine the number of saturated carbon atoms and the number of unsaturated carbon atoms according to the nuclear magnetic resonance spectrum, thereby determining the ratio between the number of unsaturated carbon atoms and the number of saturated carbon atoms, i.e. C ar / C al Ratio, and input it into the user interaction interface.

[0121] According to the molecular formula, the proportion of the number of saturated carbon atoms and the proportion of the number of unsaturated carbon atoms, the types and quantities of functional groups that may exist in the coal sample to be measured can be known. Based on this information, the organic molecules that also contain the above-mentioned possible functional groups can be screened from the above-mentioned n organic molecules with the largest similarity. It can be understood that the same organic molecule can be reused in the subsequent splicing process. Exemplarily, the coal sample to be measured may contain m functional groups a, and accordingly, the molecular structure containing the functional group a can be reused m times.

[0122] Based on the chemical structure requirements, the screened organic molecules are spliced to obtain at least one spliced coal molecular structure.

[0123] In the splicing process, it is necessary to ensure that the newly generated spliced coal molecular structure meets the chemical structure requirements, such as reasonable valence electron structure and absence of unstable chemical bonds. Based on these chemical structure requirements, the screened organic molecules are spliced to obtain at least one spliced coal molecular structure.

[0124] It can be understood that on the basis of meeting the chemical structure requirements, there can be different splicing methods, thereby obtaining different spliced coal molecular structures.

[0125] The spliced coal molecular structure is a two-dimensional structure, and for the convenience of subsequent conformation optimization, the two-dimensional structure can be converted into a three-dimensional structure in advance. As described previously, in order to adapt to the contrast learning model, the organic molecules in the sample data set are represented in the format of SELFIES string. Correspondingly, the coal molecular structure after splicing is also in the format of SELFIES string. However, limited by the format, the format of SELFIES string cannot be directly converted into a three-dimensional structure. Therefore, it can be first converted into the format of SMILES string, and then the SMILES string is converted into a three-dimensional structure.

[0126] The quantum chemical calculation method is used to optimize the configuration of the spliced ​​coal molecular structure and obtain the final coal molecular structure.

[0127] When performing configuration optimization, the three-dimensional spliced ​​coal molecular structure can be directly input into the development package psi4 that uses quantum chemical calculations to obtain the coal molecular structure after configuration optimization, which is the final coal molecular structure.

[0128] To ensure the accuracy of the coal molecular structure, optionally, after step 105, the following steps are further included:

[0129] The spectral simulation of the coal molecular structure is performed to generate simulated infrared spectrum and simulated nuclear magnetic resonance spectrum.

[0130] When spectrally simulating the molecular structure of coal, density functional theory or semi-empirical methods can be used. These methods can be used to calculate the vibration modes and frequencies of the molecular structure of coal, thereby simulating the infrared spectrum and nuclear magnetic resonance spectrum of the molecular structure of coal.

[0131] When there is at least one coal molecular structure whose simulated infrared spectrum is consistent with the infrared spectrum of the coal sample to be tested, and the simulated nuclear magnetic resonance spectrum of the coal molecular structure is consistent with the nuclear magnetic resonance spectrum of the coal sample to be tested, the coal molecular structure is determined to be valid.

[0132] The effective coal molecular structure is determined to be the coal molecular structure corresponding to the coal sample to be tested.

[0133] As mentioned above, the number of coal molecular structures obtained through configuration optimization is at least one. At this point, it is necessary to verify the obtained coal molecular structure using the infrared spectrum and nuclear magnetic resonance spectrum of the coal sample to be tested. Only when the simulated spectrum of the coal molecular structure is consistent with the infrared spectrum of the coal sample to be tested, and the simulated spectrum of the coal molecular structure is consistent with the nuclear magnetic resonance spectrum of the coal sample to be tested, is the coal molecular structure determined to be valid. Using the above verification method, all coal molecular structures after configuration optimization are verified separately, and finally a valid coal molecular structure is obtained. The valid coal molecular structure is determined to be the coal molecular structure corresponding to the coal sample to be tested.

[0134] Coal's molecular structure is amorphous, macromolecular. This means that a single coal sample can correspond to multiple coal molecular structures. As long as the simulated infrared spectrum and simulated nuclear magnetic resonance spectrum of the coal molecular structure match those of the sample, the coal molecular structure can be confirmed as corresponding to the sample. A single coal sample can correspond to multiple coal molecular structures.

[0135] When all the simulated infrared spectra of the coal molecular structures are inconsistent with the infrared spectrum of the coal sample to be tested, and / or all the simulated nuclear magnetic resonance spectra of the coal molecular structures are inconsistent with the nuclear magnetic resonance spectrum of the coal sample to be tested, the preset number of carbon atoms is changed, and the step of "determining the molecular formula of the coal sample to be tested according to the elemental analysis result and the preset number of carbon atoms" is executed until at least one simulated infrared spectrum of the coal molecular structure is consistent with the infrared spectrum of the coal sample to be tested, and the simulated nuclear magnetic resonance spectrum of the coal molecular structure is consistent with the nuclear magnetic resonance spectrum of the coal sample to be tested, and the coal molecular structure is determined to be effective.

[0136] When all the simulated infrared spectra of the coal molecular structures are inconsistent with the infrared spectrum of the coal sample to be tested, and / or all the simulated nuclear magnetic resonance spectra of the coal molecular structures are inconsistent with the nuclear magnetic resonance spectrum of the coal sample to be tested, the preset number of carbon atoms is changed, and the step of "determining the molecular formula of the coal sample to be tested according to the elemental analysis result and the preset number of carbon atoms" is executed until at least one simulated infrared spectrum of the coal molecular structure is consistent with the infrared spectrum of the coal sample to be tested, and the simulated nuclear magnetic resonance spectrum of the coal molecular structure is consistent with the nuclear magnetic resonance spectrum of the coal sample to be tested, and the coal molecular structure is determined to be effective.

[0137] When the number of samples in the sample data set is sufficient, the infrared spectrum and the organic molecule in the sample data set can effectively reveal the structural characteristics of the coal molecular structure. That is, the organic molecules in the sample data set can include all possible organic molecules in the coal molecular structure. At this time, if there is no coal molecular structure whose simulated infrared spectrum is consistent with the infrared spectrum of the coal sample to be tested and whose simulated nuclear magnetic resonance spectrum is consistent with the nuclear magnetic resonance spectrum of the coal sample to be tested, only the preset number of carbon atoms needs to be changed, a new molecular formula is generated, and the subsequent steps are continued until a new coal molecular structure whose simulated infrared spectrum is consistent with the infrared spectrum of the coal sample to be tested and whose simulated nuclear magnetic resonance spectrum is consistent with the nuclear magnetic resonance spectrum of the coal sample to be tested appears. The coal molecular structure is determined to be an effective coal molecular structure.

[0138] There is a special case when the user continuously changes the preset number of carbon atoms until the preset number of changes is reached, and still no effective coal molecular structure is obtained. At this time, there may be a problem that the number of samples in the sample data set is not sufficient. It is necessary to continue to expand the sample data set, retrain the contrast learning model according to the new sample data set, and continue to execute the subsequent steps until an effective coal molecular structure is obtained.

[0139] Based on practical application experience, when the number of carbon atoms in the organic molecules in the sample data set is 3-70, the structural characteristics of the coal molecular structure can be fully revealed, and there is no need to continue to expand.

[0140] Figure 6 A schematic diagram of the construction of the coal molecular structure is shown. Figure 7 An implementation flowchart of the construction method of the coal molecular structure is shown. See Figure 6 and Figure 7 When the construction method is executed, the sample data set is constructed in advance, and the sample data set is expanded.

[0141] The structural feature encoder in the contrastive learning model is pre-trained. After the structural feature encoder is pre-trained, the contrastive learning model is trained as a whole based on the expanded sample dataset until the similarity between the spectral features and structural features in the contrastive learning model reaches the preset requirement, completing the training.

[0142] The infrared spectrum of the coal sample to be tested is input into a trained comparative learning model to obtain the top n organic molecules with the greatest similarity to the infrared spectrum. These n organic molecules are converted into SMILES strings. Based on a preset carbon atom count, elemental analysis results, and nuclear magnetic resonance (NMR) results, the corresponding organic molecules are selected from the n organic molecules and spliced ​​together to obtain the spliced ​​coal molecular structure. This spliced ​​coal molecular structure is then converted into a three-dimensional structure and optimized using quantum chemical calculations to obtain the coal molecular structure.

[0143] Perform spectral simulation on the coal molecular structure to verify its validity. If at least one valid coal molecular structure exists, output it. Otherwise, change the preset number of carbon atoms, regenerate a new molecular formula, and continue executing the subsequent steps until at least one valid coal molecular structure is generated.

[0144] When the number of times the step of "changing the preset number of carbon atoms" is executed reaches the preset number of changes and no valid coal molecular structure is obtained, the sample data set is expanded again, and the comparative learning model is trained based on the new sample data set, and subsequent steps are continued until at least one valid coal molecular structure is generated.

[0145] Compared with the prior art, the embodiments of the present invention have the following advantages:

[0146] By constructing a pre-trained comparative learning model, the similarity between different infrared spectra and different organic molecules (i.e., substructures with specific functional groups) can be determined. By inputting the infrared spectrum of the coal sample to be tested into the comparative learning model, the organic molecules that may be contained in the coal sample to be tested can be determined based on its infrared spectrum. Finally, based on the elemental analysis results of the coal sample to be tested and the preset number of carbon atoms, its molecular formula is determined, and the organic molecules are screened and spliced ​​according to the molecular formula to finally obtain the coal molecular structure. This method does not require experimental characterization of the coal sample to be tested, nor does it require the use of tedious chemical methods such as pyrolysis, extraction, and oxidation to analyze the structural characteristics of the coal sample to be tested. It reduces tedious experimental operations, greatly simplifies the construction process of the coal molecular structure, shortens the construction time, improves the construction efficiency, and plays a guiding role in the chromatographic analysis of amorphous macromolecular structures.

[0147] Furthermore, before training the contrastive learning model, the present invention leverages user experience and a generative model to expand the sample dataset, ensuring that the organic molecules in the sample dataset encompass all possible organic molecules in the coal molecular structure. This improves the quality of the contrastive learning model's output and enhances its generalization capabilities. Furthermore, after obtaining the coal molecular structure, spectral simulation can be performed to verify its validity, thereby ensuring its accuracy.

[0148] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0149] The following are device embodiments of the present invention. For details not fully described therein, reference may be made to the corresponding method embodiments described above.

[0150] Figure 8 A schematic diagram of the structure of a device for constructing a coal molecular structure according to an embodiment of the present invention is shown. For ease of explanation, only the portion related to the embodiment of the present invention is shown, which is described in detail as follows:

[0151] like Figure 8 As shown, the coal molecular structure construction device 8 includes: an acquisition module 81 , a screening module 82 and a construction module 83 .

[0152] The acquisition module 81 is used to acquire the infrared spectrum of the coal sample to be tested.

[0153] The screening module 82 is used to input the infrared spectrum into a pre-trained comparative learning model to obtain n organic molecules with the greatest similarity to the infrared spectrum; n is an integer greater than or equal to 1.

[0154] The acquisition module 81 is further used to respectively obtain the element analysis results and the preset carbon atom number of the coal sample to be tested.

[0155] The construction module 83 is used to determine the molecular formula of the coal sample to be tested based on the elemental analysis results and the preset number of carbon atoms.

[0156] The construction module 83 is also used to select corresponding organic molecules from n organic molecules according to the molecular formula, perform splicing and configuration optimization, and obtain the coal molecular structure.

[0157] In a possible implementation, the screening module 82 is configured to obtain a sample data set; each sample in the sample data set includes an organic molecule and its corresponding infrared spectrum.

[0158] The screening module 82 is also used to construct a contrastive learning model; the contrastive learning model includes: a structural feature encoder and a spectral feature encoder; the structural feature encoder is used to output a structural feature corresponding to a currently input organic molecule; the spectral feature encoder is used to output a spectral feature corresponding to a currently input infrared spectrum.

[0159] The screening module 82 is further used to input the sample data set into the contrastive learning model to obtain the spectral characteristics and structural characteristics corresponding to each sample.

[0160] The screening module 82 is further configured to calculate the similarity between each spectral feature and each structural feature.

[0161] The screening module 82 is also used to adjust the model parameters of the comparative learning model when the similarity between each spectral feature and the corresponding structural feature is less than or equal to the similarity between the spectral feature and other structural features, and jump to the step of "inputting the sample data set into the comparative learning model to obtain the spectral features and structural features corresponding to each sample" until the similarity between each spectral feature and the corresponding structural feature is greater than the similarity between the spectral feature and other structural features, thereby obtaining a trained comparative learning model.

[0162] In a possible implementation, the number of carbon atoms in the organic molecules in the sample data set is less than a first preset value.

[0163] The screening module 82 is configured to receive first organic molecules input by a user and obtain infrared spectra corresponding to the first organic molecules according to the first organic molecules; the number of carbon atoms in the first organic molecules is greater than a first preset value.

[0164] And / or, the screening module 82 is further configured to receive a first organic molecule input by a user, input the first organic molecule into the generative model to obtain a second organic molecule, and obtain infrared spectra corresponding to each second organic molecule based on the second organic molecule.

[0165] And / or, the screening module 82 is further configured to input the organic molecules in the sample data set into the generative model to obtain third organic molecules, and obtain infrared spectra corresponding to the third organic molecules based on the third organic molecules.

[0166] The screening module 82 is further configured to add the first organic molecule and its corresponding infrared spectrum, and / or the second organic molecule and its corresponding infrared spectrum, and / or the third organic molecule and its corresponding infrared spectrum to the sample dataset to obtain an expanded sample dataset.

[0167] The screening module 82 is further configured to input the expanded sample data set into the contrastive learning model to obtain the spectral features and structural features corresponding to each sample.

[0168] In a possible implementation, the module 83 is constructed to obtain the proportion of each atom in the coal sample to be tested from the elemental analysis result;

[0169] The construction module 83 is further used to determine the molecular formula of the coal sample to be tested according to the proportion of each atom and the preset number of carbon atoms.

[0170] In a possible implementation, the module 83 is constructed to obtain a nuclear magnetic resonance result of the coal sample to be tested, and to screen out a corresponding organic molecule from n organic molecules based on the nuclear magnetic resonance result and the molecular formula.

[0171] The construction module 83 is further used to splice the screened organic molecules based on chemical structure requirements to obtain at least one spliced ​​coal molecular structure.

[0172] The construction module 83 is also used to optimize the configuration of the spliced ​​coal molecular structure using a quantum chemical calculation method to obtain the final coal molecular structure.

[0173] In one possible implementation, the construction module 83 is used to perform spectral simulation on the coal molecular structure to generate a simulated infrared spectrum and a simulated nuclear magnetic resonance spectrum;

[0174] The construction module 83 is further configured to determine that the coal molecular structure is valid when at least one simulated infrared spectrum corresponding to the coal molecular structure is consistent with the infrared spectrum of the coal sample to be tested, and the simulated nuclear magnetic resonance spectrum corresponding to the coal molecular structure is consistent with the nuclear magnetic resonance spectrum of the coal sample to be tested;

[0175] The construction module 83 is further used to determine the effective coal molecular structure as the coal molecular structure corresponding to the coal sample to be tested.

[0176] In one possible implementation, module 83 is constructed to change the preset number of carbon atoms when the simulated infrared spectra of all coal molecular structures are inconsistent with the infrared spectrum of the coal sample to be tested, and / or the simulated nuclear magnetic resonance spectra of all coal molecular structures are inconsistent with the nuclear magnetic resonance spectrum of the coal sample to be tested, and jump to the step of "determining the molecular formula of the coal sample to be tested based on the elemental analysis results and the preset number of carbon atoms" until there is at least one coal molecular structure whose simulated infrared spectrum is consistent with the infrared spectrum of the coal sample to be tested, and whose simulated nuclear magnetic resonance spectrum is consistent with the nuclear magnetic resonance spectrum of the coal sample to be tested, and it is determined that the coal molecular structure is valid.

[0177] Compared with the prior art, the beneficial effect of the embodiment of the present invention is that the screening module 82 can determine the similarity between different infrared spectra and different organic molecules (i.e., substructures with specific functional groups) by pre-building a trained comparative learning model. The screening module 82 inputs the infrared spectrum of the coal sample to be tested into the comparative learning model, and can determine the organic molecules that may be contained in the coal sample to be tested based on its infrared spectrum. The construction module 83 determines the molecular formula of the coal sample to be tested based on the elemental analysis results of the coal sample to be tested and the preset number of carbon atoms, and screens and splices the organic molecules based on the molecular formula to finally obtain the coal molecular structure. This device does not require experimental characterization of the coal sample to be tested, nor does it require the use of cumbersome chemical methods such as pyrolysis, extraction, and oxidation to analyze the structural characteristics of the coal sample to be tested, which reduces cumbersome experimental operations, greatly simplifies the construction process of the coal molecular structure, shortens the construction time, improves the construction efficiency, and plays a guiding role in the atlas analysis of amorphous macromolecular structures.

[0178] Furthermore, before training the comparative learning model, the screening module 82 leverages user experience and the generative model to expand the sample dataset, ensuring that the organic molecules in the sample dataset encompass all possible organic molecules in the coal molecular structure. This improves the quality of the comparative learning model's output and enhances its generalization capabilities. Furthermore, after obtaining the coal molecular structure, the construction module 83 performs spectral simulations on it to verify its validity, thereby ensuring its accuracy.

[0179] Figure 9 Schematic diagram of an electronic device provided by an embodiment of the present invention. Figure 9 As shown, the electronic device 9 of this embodiment includes: a processor 90, a memory 91, and a computer program 92 stored in the memory 91 and executable on the processor 90. When the processor 90 executes the computer program 92, the steps in the above-mentioned method for constructing the coal molecular structure are implemented, for example Figure 1 Alternatively, when the processor 90 executes the computer program 92, the functions of the modules / units in the above-mentioned device embodiments are realized, for example, Figure 8 Functions of modules 81 to 83 are shown.

[0180] For example, the computer program 92 can be divided into one or more modules / units, which are stored in the memory 91 and executed by the processor 90 to complete the present application. The one or more modules / units can be a series of computer program instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program 92 in the electronic device 9. For example, the computer program 92 can be divided into Figure 8 the modules 81 to 83 shown.

[0181] The electronic device 9 can be a desktop computer, a notebook computer, a palm computer, a cloud server and the like. The electronic device 9 can include, but is not limited to, the processor 90 and the memory 91. Those skilled in the art can understand that the electronic device 9 can include more or fewer components than those shown, or combine some components, or include different components, for example, the electronic device can also include an input / output device, a network access device, a bus and the like. Figure 9 The electronic device 9 shown is only an example and does not constitute a limitation on the electronic device 9, and can include more or fewer components than those shown, or combine some components, or different components, for example, the electronic device can also include an input / output device, a network access device, a bus and the like.

[0182] The processor 90 can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.

[0183] The memory 91 can be an internal storage unit of the electronic device 9, such as a hard disk or a memory of the electronic device 9. The memory 91 can also be an external storage device of the electronic device 9, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card and the like equipped on the electronic device 9. Further, the memory 91 can include both the internal storage unit and the external storage device of the electronic device 9. The memory 91 is used to store the computer program and other programs and data required by the electronic device. The memory 91 can also be used to temporarily store data that has been output or will be output.

[0184] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0185] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.

[0186] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.

[0187] In the embodiments provided by the present invention, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely schematic. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0188] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0189] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0190] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, it can implement the steps of the above-mentioned each coal molecular structure construction method embodiment. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included in the scope of protection of the present invention.

Claims

1. A method for constructing a coal molecular structure, characterized in that: include: Obtaining an infrared spectrum of the coal sample to be tested; Inputting the infrared spectrum into a pre-trained comparative learning model to obtain n organic molecules with the greatest similarity to the infrared spectrum; n is an integer greater than or equal to 1; Obtaining elemental analysis results and a preset carbon atom number of the coal sample to be tested respectively; Determining the molecular formula of the coal sample to be tested according to the elemental analysis result and the preset number of carbon atoms; According to the molecular formula, corresponding organic molecules are selected from the n organic molecules for splicing and configuration optimization to obtain a coal molecular structure; Before inputting the infrared spectrum into a pre-trained comparative learning model to obtain n organic molecules having the greatest similarity to the infrared spectrum, the method further includes: Acquire a sample data set; each sample in the sample data set includes an organic molecule and its corresponding infrared spectrum; Constructing a contrastive learning model; the contrastive learning model includes: a structural feature encoder and a spectral feature encoder; the structural feature encoder is used to output a structural feature corresponding to a currently input organic molecule; the spectral feature encoder is used to output a spectral feature corresponding to a currently input infrared spectrum; Inputting the sample data set into the contrastive learning model to obtain the spectral characteristics and structural characteristics corresponding to each sample; Calculate the similarity between each spectral feature and each structural feature; When the similarity between each spectral feature and its corresponding structural feature is less than or equal to the similarity between the spectral feature and other structural features, the model parameters of the contrastive learning model are adjusted, and the process jumps to the step of "inputting the sample data set into the contrastive learning model to obtain the spectral features and structural features corresponding to each sample" until the similarity between each spectral feature and its corresponding structural feature is greater than the similarity between the spectral feature and other structural features, thereby obtaining a trained contrastive learning model; According to the molecular formula, corresponding organic molecules are selected from the n organic molecules for splicing and configuration optimization to obtain a coal molecular structure, including: Obtaining a nuclear magnetic resonance result of the coal sample to be tested, and screening out a corresponding organic molecule from the n organic molecules based on the nuclear magnetic resonance result and the molecular formula; Based on the chemical structure requirements, the screened organic molecules are spliced ​​together to obtain at least one spliced ​​coal molecular structure; Using quantum chemical calculation methods, the configuration of the spliced ​​coal molecular structure is optimized to obtain the final coal molecular structure; After selecting corresponding organic molecules from the n organic molecules according to the molecular formula, splicing and optimizing the configuration to obtain the coal molecular structure, the method further includes: Performing spectral simulation on the coal molecular structure to generate a simulated infrared spectrum and a simulated nuclear magnetic resonance spectrum; The coal molecular structure is determined to be valid when the simulated infrared spectrum corresponding to at least one coal molecular structure is consistent with the infrared spectrum of the coal sample to be tested, and the simulated nuclear magnetic resonance spectrum corresponding to the coal molecular structure is consistent with the nuclear magnetic resonance spectrum of the coal sample to be tested; The effective coal molecular structure is determined to be the coal molecular structure corresponding to the coal sample to be tested.

2. The method for constructing the coal molecular structure according to claim 1, characterized in that: The number of carbon atoms in the organic molecules in the sample data set is less than a first preset value; After obtaining the sample data set, the method further includes: receiving first organic molecules input by a user, and obtaining infrared spectra corresponding to the first organic molecules based on the first organic molecules; the number of carbon atoms in the first organic molecules is greater than the first preset value; and / or, receiving a first organic molecule input by a user, and inputting the first organic molecule into a generative model to obtain a second organic molecule, and obtaining infrared spectra corresponding to each second organic molecule based on the second organic molecule; and / or, inputting the organic molecules in the sample data set into a generative model to obtain third organic molecules, and obtaining infrared spectra corresponding to the third organic molecules based on the third organic molecules; adding the first organic molecule and its corresponding infrared spectrum, and / or the second organic molecule and its corresponding infrared spectrum, and / or the third organic molecule and its corresponding infrared spectrum to the sample data set to obtain an expanded sample data set; The step of inputting the sample data set into the contrastive learning model to obtain the spectral features and structural features corresponding to each sample includes: The expanded sample data set is input into the contrastive learning model to obtain the spectral features and structural features corresponding to each sample.

3. The method for constructing the coal molecular structure according to claim 1, characterized in that: Determining the molecular formula of the coal sample to be tested based on the elemental analysis result and the preset number of carbon atoms includes: Obtaining the proportion of each atom in the coal sample to be tested from the elemental analysis results; The molecular formula of the coal sample to be tested is determined based on the proportions of the atoms and the preset number of carbon atoms.

4. The method for constructing the coal molecular structure according to claim 1, characterized in that: After performing spectrum simulation on the coal molecular structure to generate a simulated infrared spectrum and a simulated nuclear magnetic resonance spectrum, the method further includes: When the simulated infrared spectra of all coal molecular structures are inconsistent with the infrared spectrum of the coal sample to be tested, and / or the simulated nuclear magnetic resonance spectra of all coal molecular structures are inconsistent with the nuclear magnetic resonance spectrum of the coal sample to be tested, the preset number of carbon atoms is changed, and the process jumps to the step of "determining the molecular formula of the coal sample to be tested based on the elemental analysis results and the preset number of carbon atoms" until there is at least one coal molecular structure whose simulated infrared spectrum is consistent with the infrared spectrum of the coal sample to be tested, and whose simulated nuclear magnetic resonance spectrum is consistent with the nuclear magnetic resonance spectrum of the coal sample to be tested, and the coal molecular structure is determined to be valid.

5. A device for constructing a coal molecular structure, characterized in that: include: An acquisition module, used for acquiring an infrared spectrum of a coal sample to be tested; A screening module is used to input the infrared spectrum into a pre-trained comparative learning model to obtain n organic molecules with the greatest similarity to the infrared spectrum; n is an integer greater than or equal to 1; The acquisition module is also used to obtain the elemental analysis results of the coal sample to be tested and the preset carbon atom number; A building block is used to determine the molecular formula of the coal sample to be tested based on the elemental analysis results and the preset number of carbon atoms; The building module is also used to select corresponding organic molecules from n organic molecules according to the molecular formula, perform splicing and configuration optimization, and obtain the coal molecular structure; Before inputting the infrared spectrum into a pre-trained comparative learning model to obtain n organic molecules having the greatest similarity to the infrared spectrum, the method further includes: Acquire a sample data set; each sample in the sample data set includes an organic molecule and its corresponding infrared spectrum; Constructing a contrastive learning model; the contrastive learning model includes: a structural feature encoder and a spectral feature encoder; the structural feature encoder is used to output a structural feature corresponding to a currently input organic molecule; the spectral feature encoder is used to output a spectral feature corresponding to a currently input infrared spectrum; Inputting the sample data set into the contrastive learning model to obtain the spectral characteristics and structural characteristics corresponding to each sample; Calculate the similarity between each spectral feature and each structural feature; When the similarity between each spectral feature and its corresponding structural feature is less than or equal to the similarity between the spectral feature and other structural features, the model parameters of the contrastive learning model are adjusted, and the process jumps to the step of "inputting the sample data set into the contrastive learning model to obtain the spectral features and structural features corresponding to each sample" until the similarity between each spectral feature and its corresponding structural feature is greater than the similarity between the spectral feature and other structural features, thereby obtaining a trained contrastive learning model; According to the molecular formula, corresponding organic molecules are selected from the n organic molecules for splicing and configuration optimization to obtain a coal molecular structure, including: Obtaining a nuclear magnetic resonance result of the coal sample to be tested, and screening out a corresponding organic molecule from the n organic molecules based on the nuclear magnetic resonance result and the molecular formula; Based on the chemical structure requirements, the screened organic molecules are spliced ​​together to obtain at least one spliced ​​coal molecular structure; Using quantum chemical calculation methods, the configuration of the spliced ​​coal molecular structure is optimized to obtain the final coal molecular structure; After selecting corresponding organic molecules from the n organic molecules according to the molecular formula, splicing and optimizing the configuration to obtain the coal molecular structure, the method further includes: Performing spectral simulation on the coal molecular structure to generate a simulated infrared spectrum and a simulated nuclear magnetic resonance spectrum; The coal molecular structure is determined to be valid when the simulated infrared spectrum corresponding to at least one coal molecular structure is consistent with the infrared spectrum of the coal sample to be tested, and the simulated nuclear magnetic resonance spectrum corresponding to the coal molecular structure is consistent with the nuclear magnetic resonance spectrum of the coal sample to be tested; The effective coal molecular structure is determined to be the coal molecular structure corresponding to the coal sample to be tested.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method for constructing the coal molecular structure as described in any one of claims 1 to 4 are implemented.

7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method for constructing the coal molecular structure as described in any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Molecular graph comparison learning method based on chemical element knowledge graph

    CN113990408A

  • Method and system for determining structure of organic compound by using spectrum data

    CN115966262A