A method and device for polyphase structure refinement of x-ray diffraction data, and electronic device

By combining a collaborative fusion strategy with a global chemometric penalty value, the problems of manual dependence and insufficient generalization in X-ray diffraction data refinement are solved, realizing automated, stable and efficient refinement of multiphase structures, meeting the needs of unattended laboratories.

CN122201513APending Publication Date: 2026-06-12BEIJING ZHONGGUANCUN UNIVERSITY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610105056.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-26
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

Existing X-ray diffraction data refinement techniques rely on human experience, have insufficient convergence stability, limited generalization ability, and are difficult to meet the physical constraints of multiphase systems.

Method used

A synergistic fusion strategy is adopted to construct a multiphase structure refinement method. A target function is constructed by using a fully parameter-differentiable forward diffraction calculation model, combined with fitting residuals and global stoichiometric penalty values, and a three-stage step-by-step optimization is performed to ensure stoichiometric conservation.

Benefits of technology

It achieves full automation, high efficiency and high reliability of multiphase XRD refinement, avoids the local optima trap of traditional methods and the lack of physical constraints in deep learning, and provides a stable multiphase structure representation scheme.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122201513A_ABST
    Figure CN122201513A_ABST
Patent Text Reader

Abstract

The embodiment of the application relates to the field of material structure analysis, and particularly relates to a multi-phase structure refining method and device based on X-ray diffraction data and electronic equipment. The method comprises the following steps: obtaining experimental X-ray diffraction intensity data and a corresponding initial structure parameter set, independently constructing a full-parameter differentiable forward diffraction calculation model for each phase to obtain an X-ray forward diffraction model; based on the combination proportion characteristics of each phase in the experimental sample, a collaborative fusion strategy is used to weight and superimpose each X-ray forward diffraction model to generate a multi-phase fusion differentiable model; based on the experimental X-ray diffraction intensity data, a target function is constructed by fusing a fitting residual and a global stoichiometric penalty value; according to the target function, the multi-phase fusion differentiable model is subjected to three-stage step-by-step optimization, and a three-stage step-by-step optimized multi-phase structure solution and a corresponding differentiable X-ray diffraction forward model are output. The method can quickly and stably complete the refinement of key structure parameters such as cell parameters, atomic coordinates and multi-phase proportions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of material structure analysis, and in particular to a method, apparatus and electronic device for refining the multiphase structure of X-ray diffraction data. Background Technology

[0002] In the current era of deep integration between artificial intelligence technology and scientific research experiments, scientific research automation has become a core development direction in fields such as materials science and chemical engineering. The rise of fully autonomous laboratories and automated synthesis platforms urgently requires a rapid, accurate, and stable method for material structure characterization and analysis. The key to judging the quality of material synthesis, assessing impurity phase formation, and understanding reaction mechanisms lies in the precise analysis of the material's microstructure. X-ray diffraction (XRD) technology, with its high sensitivity to lattice structure, phase composition, and crystal plane arrangement, has become the core tool for the structure identification module of autonomous laboratories. Combined with Rietveld for refinement, it can further analyze microstructural details such as cell parameters, atomic coordinates, and occupancy rates, providing high-confidence data support for scientific research decisions.

[0003] To characterize the changes in peak shape of powder samples with varying instrument resolution, crystal structure, and microstructure, existing X-ray diffraction refinement techniques mainly include two core approaches: First, the traditional Rietveld refinement method based on nonlinear least squares, which minimizes the least squares difference between simulated and experimental spectra by continuously adjusting cell parameters, atomic positions, occupancy rates, and peak shape functions. However, this method essentially relies on iterative parameter tuning driven by human experience, making it prone to getting trapped in local optima in high-dimensional non-convex optimization spaces, resulting in slow convergence, poor stability, and inability to be integrated into unattended automated processes. Second, end-to-end structure prediction methods based on deep learning, which directly predict crystal structure or phase composition from diffraction patterns by training neural networks such as CNNs and GNNs. However, limited by the coverage of training data, this method lacks generalization ability for multiphase systems, mixed structures, complex peak shapes, or weak peak systems, and it is difficult to ensure that fundamental physical constraints such as stoichiometry are met, easily leading to physically meaningless results.

[0004] Therefore, how to overcome the core bottlenecks of existing technologies, such as reliance on human experience, insufficient convergence stability, limited generalization ability, and lack of physical constraints, is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] The purpose of this application is to provide at least one automated method, apparatus, and electronic device for refining the multiphase structure of X-ray diffraction data. This method can quickly and stably refine key structural parameters such as cell parameters, atomic coordinates, and multiphase ratios without human intervention, ensuring that the results strictly comply with physical constraints such as stoichiometry.

[0006] To address the aforementioned technical problems, at least one embodiment of this application provides a method for refining the multiphase structure of X-ray diffraction data, comprising: Acquire experimental X-ray diffraction intensity data and the corresponding initial structural parameter set; the initial structural parameter set includes the theoretical structural parameters corresponding to the main phase and impurity phase contained in the experimental sample; the main phase is the dominant crystalline phase in the experimental sample, and the impurity phase is the minor crystalline phase; Based on the initial structural parameter set, a fully parameterized differentiable forward diffraction calculation model is independently constructed for each phase to obtain the X-ray forward diffraction model; Based on the combination ratio characteristics of each phase in the experimental sample, a synergistic fusion strategy is adopted to weight and superimpose the X-ray forward diffraction models to generate a multiphase fused differentiable model; the synergistic fusion strategy includes multiphase normalization combination and principal phase preferential bias. Based on the experimental X-ray diffraction intensity data, an objective function is constructed by fusing the fitting residual and the global chemostometric penalty value; the global chemostometric penalty value is generated according to the soft chemostometric constraint term characterizing the actual elemental composition of each phase. The multiphase fusion differentiable model is optimized in three stages according to the objective function, and the multiphase structure solution after the three-stage optimization and the corresponding differentiable X-ray diffraction forward model are output.

[0007] In one embodiment, the step of weighting and superimposing the X-ray forward diffraction models using a synergistic fusion strategy based on the combination ratio characteristics of each phase in the experimental sample includes: The original weight parameters and scale factors of the X-ray forward diffraction model for each phase are extracted and normalized. After adding a positive offset to the normalized principal phase weight parameters, the weight parameters of each phase are then normalized to obtain the phase fraction vector. The X-ray forward diffraction models are weighted and superimposed based on the phase fraction vector and the normalized scale factor.

[0008] In one embodiment, the step of constructing an objective function based on the experimental X-ray diffraction intensity data by fusing the fitting residual and the global stoichiometric penalty value includes: Obtain the target measurement ratio specified by the user and construct a vector composed of the target elements; The actual element composition of each phase is statistically analyzed and converted into a standardized vector, which serves as the actual composition vector. Compare the actual composition vector with the target element composition vector to calculate the stoichiometric deviation value; A global stoichiometric penalty value is generated based on the stoichiometric deviation values ​​of each phase. Based on the experimental X-ray diffraction intensity data and the theoretical diffraction spectrum output by the multiphase fusion differentiable model, the fitting residual characterizing the degree of matching between the two is calculated. The objective function is constructed by integrating the global stoichiometric penalty value and the fitting residual.

[0009] In one embodiment, generating a global stoichiometric penalty value based on the stoichiometric deviation values ​​of each phase includes: Differential weights are assigned based on the role of each phase; among them, the weight of the principal phase is less than that of the heterogeneous phase. The stoichiometric deviation values ​​of each phase are weighted and integrated according to the corresponding differential weights to form the global stoichiometric penalty value.

[0010] In one embodiment, the three-stage step-by-step optimization of the multiphase fusion differentiable model based on the objective function includes: The optimizer is invoked to perform a three-stage step-by-step optimization of the multiphase fusion differentiable model based on the objective function.

[0011] In one embodiment, the invocation of the optimizer performs a three-stage step-by-step optimization of the multiphase fusion differentiable model based on the objective function, including: The optimizer is invoked to perform coarse-tuning optimization on the specified structural parameters and fitting parameters of the multiphase fusion differentiable model; If the coarse-tuned evaluation index reaches the preset range, the optimizer is invoked to fine-tune and optimize the coarse-tuned model parameters. If the fine-tuned evaluation index reaches the preset range, the optimizer is invoked to fine-tune and optimize the fine-tuned model parameters. The parameter adjustment step size of the coarse adjustment, the fine adjustment, and the fine adjustment decreases sequentially, while the number of iterations increases sequentially.

[0012] In one embodiment, the optimizer is a hybrid optimizer including the Adam optimizer and the L-BFGS optimizer; The optimizer is then invoked to perform coarse-tuning optimization of the specified structural parameters and fitting parameters of the multiphase fusion differentiable model. Specifically, the Adam optimizer is invoked to perform coarse-tuning optimization of the specified structural parameters and fitting parameters of the multiphase fusion differentiable model. The step of calling the optimizer to fine-tune the coarsely tuned model parameters specifically involves calling the Adam optimizer to fine-tune the coarsely tuned model parameters. The step of calling the optimizer to fine-tune the fine-tuned model parameters specifically involves calling the L-BFGS optimizer to fine-tune the fine-tuned model parameters.

[0013] In one embodiment, the multiphase structure refinement method for X-ray diffraction data further includes: According to the preset adjustment rules, adjust the structural parameters of the specified phase in the initial structural parameter set; Based on the adjusted initial structural parameters, the step of independently constructing a differentiable forward diffraction calculation model for each phase according to the initial structural parameter set is performed. The differentiable X-ray diffraction forward model output before adjustment is used as the model before adjustment, and the differentiable X-ray diffraction forward model output after adjustment is used as the model after adjustment. Calculate the comprehensive index corresponding to the model before adjustment as the pre-adjustment index, and calculate the comprehensive index corresponding to the model before adjustment as the post-adjustment index; Compare the indicators before and after the adjustment to determine whether the adjusted indicators are better. If so, accept the current modification and update the initial structural parameters according to the adjusted initial structural parameters; If not, reject the current modification and restore the structure parameters saved before the current adjustment.

[0014] At least one embodiment of this application also provides a multiphase structure refinement apparatus for X-ray diffraction data, comprising: The data acquisition unit is used to acquire experimental X-ray diffraction intensity data and the corresponding initial structural parameter set; the initial structural parameter set includes the theoretical structural parameters corresponding to the main phase and impurity phase contained in the experimental sample; the main phase is the dominant crystalline phase in the experimental sample, and the impurity phase is the minor crystalline phase; A single-phase model construction unit is used to independently construct a fully parameter-differentiable forward diffraction calculation model for each phase based on the initial structural parameter set, thereby obtaining an X-ray forward diffraction model; A multiphase model fusion unit is used to weight and superimpose the X-ray forward diffraction models based on the combination ratio characteristics of each phase in the experimental sample and adopt a collaborative fusion strategy to generate a multiphase fused differentiable model; the collaborative fusion strategy includes multiphase normalization combination and principal phase preferential bias. The objective function construction unit is used to construct an objective function based on the experimental X-ray diffraction intensity data by fusing the fitting residual and the global chemometry penalty value; the global chemometry penalty value is generated according to the soft chemometry constraint term characterizing the actual elemental composition of each phase. The objective optimization solution unit is used to perform three-stage step-by-step optimization of the multiphase fusion differentiable model according to the objective function, and output the multiphase structure solution after the three-stage step-by-step optimization and the corresponding differentiable X-ray diffraction forward model.

[0015] At least one embodiment of this application also provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the above-described method for refining the multiphase structure of X-ray diffraction data.

[0016] The multiphase structure refinement method for X-ray diffraction data provided in this application obtains experimental X-ray diffraction intensity data and an initial set of structural parameters containing theoretical structural parameters corresponding to the main phase and each impurity phase in the experimental sample. Using the verified theoretical structure as the starting point for optimization, it significantly reduces the search range in the high-dimensional parameter space, avoids blind optimization due to a lack of prior information, and constructs a fully parameterized differentiable forward diffraction calculation model for each phase. Each model can achieve gradient solution of all parameters. Based on the combination ratio characteristics of each phase in the experimental sample, a collaborative fusion strategy is used to weight and superimpose the global parameters of the independent models of each phase to restore the true diffraction response of the multiphase coexisting sample. Specifically, through... A synergistic strategy of multiphase normalization combination and principal phase preferential bias is used to achieve weighted superposition, which takes into account both the physical rationality of multiphase ratio and optimization stability. It can avoid meaningless negative ratio or ratio imbalance, and at the same time suppress the fine-tuning divergence caused by excessive expansion of impurity phase in the early stage of optimization. It ensures that the optimization direction is consistent with the actual characteristics of the sample where the principal phase is dominant and the impurity phase is secondary. The objective function is constructed by fusing the fitting residual and the global stoichiometric penalty value, which achieves dual guarantee of data fitting accuracy and physical rationality. Finally, the multiphase fusion differentiable model is optimized in three stages according to the objective function. The output multiphase structure solution and differentiable model have both physical rationality and iterability, which can meet the requirements of automated feedback.

[0017] This method achieves full automation, high efficiency, and high reliability in multiphase XRD refinement. It avoids the manual dependence and local optima trap of traditional methods, and solves the problems of insufficient generalization and lack of physical constraints in deep learning methods. It provides a stable and reliable technical solution for multiphase structure characterization in unattended laboratories and automated synthesis platforms. Attached Figure Description

[0018] One or more embodiments are illustrated by way of example with reference to the accompanying drawings, and these illustrative descriptions do not constitute a limitation on the embodiments.

[0019] Figure 1 This is a flowchart of a method for refining the multiphase structure of X-ray diffraction data, provided in one embodiment of this application; Figure 2 This is a schematic diagram of a multiphase structure refinement device for X-ray diffraction data provided in one embodiment of this application; Figure 3 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this application. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the various embodiments of this application will be described in detail below with reference to the accompanying drawings. However, those skilled in the art will understand that many technical details have been provided in the various embodiments of this application to help readers better understand this application. However, the technical solutions claimed in this application can be implemented even without these technical details and various changes and modifications based on the following embodiments. The division of the various embodiments below is for the convenience of description and should not constitute any limitation on the specific implementation of this application. The various embodiments can be combined with and referenced by each other without contradiction.

[0021] The following is a detailed description of the implementation details of the multiphase structure refinement method for X-ray diffraction data in this embodiment. The following content is only for the convenience of understanding and is not necessary for implementing this solution.

[0022] Example 1: The specific process of the multiphase structure refinement method for X-ray diffraction data in this embodiment can be described as follows: Figure 1 As shown, it includes: Step 101: Obtain experimental X-ray diffraction intensity data and the corresponding initial structural parameter set.

[0023] Two key types of fundamental information are required: first, experimental X-ray diffraction (XRD) intensity data (such as intensity sequences in 2θ–I or q–I format) reflecting the true diffraction characteristics of the experimental sample; and second, an initial set of structural parameters for constructing the diffraction simulation model. This set of parameters contains theoretical structural data of the coexisting crystal phases in the experimental sample (including the dominant main phase and the minor impurity phases). The theoretical structural data can be extracted from crystal theory information files (such as CIF files), including but not limited to: unit cell parameters (unit cell edge lengths (a, b, c) and crystal axis angles (α, β, γ)), atomic coordinates, atomic occupancy (the probability of an atom occupying a specific position in the unit cell), thermal vibration parameters, etc.

[0024] The initial structural parameter set can be specifically extracted based on the phase system configuration instructions of the user-defined refinement object system. These instructions specify the distinguishing identifiers of the main and secondary phases involved in the refinement, the acquisition paths for the crystal theory information files of each phase, and the role information used to define the primary and secondary importance of each phase in the refinement. Then, theoretical structural data is extracted from the corresponding file acquisition paths, and the extracted parameters of all phases are categorized and organized to form a structured initial structural parameter set that can be directly used for subsequent modeling. Of course, other acquisition methods can also be used; this embodiment does not limit this approach.

[0025] Experimental XRD intensity data can provide a primary reference for subsequent fitting and comparison of theoretical and experimental spectra. The theoretical structure is the inherent crystal structure verified by experiments or confirmed by theoretical calculations, possessing clear physical rationality. It provides a precise initial iterative starting point for multiphase refinement. Compared to inferring multiphase structures based on actual diffraction data, which requires blindly searching for multiphase structure combinations in a high-dimensional parameter space without any prior structural information, theoretical data can significantly narrow the optimization search space by limiting the initial structural range of each phase. This makes subsequent multiphase parameter optimization more targeted, significantly improving convergence efficiency and stability, and avoiding getting trapped in local optima or iterative divergence in a high-dimensional parameter space due to directional ambiguity.

[0026] Step 102: Based on the initial structural parameter set, construct a fully parameterized differentiable forward diffraction calculation model for each phase independently to obtain the X-ray forward diffraction model.

[0027] Based on the structural parameters of each phase in the initial structural parameter set, independent, fully parameter-differentiable forward diffraction calculation models are established for the main phase and each impurity phase in the refined system. These models are then integrated to form an X-ray forward diffraction model covering all key parameters such as unit cell, peak shape, and atomic structure, achieving a differentiable mapping between structural parameters and diffraction signals. Independent modeling of each phase ensures that the structural characteristics of each phase are not disturbed, while the fully parameter-differentiable design supports the implementation of subsequent multi-stage optimization and multi-phase combination strategies, providing model support for rapid and stable refinement.

[0028] This embodiment does not limit the specific model construction method and model structure. One construction method and corresponding model structure are as follows: A cell parameter transformation module is constructed, allowing cell parameters (a, b, c, α, β, γ) to participate in gradient updates in a differentiable manner; a peak shape function module, a preferred orientation module, and optional axis scattering correction physical modules are integrated. The peak shape function module can be constructed based on the TCHpseudo-Voigt model, with parameters U, V, W, X, and Y participating in optimization as differentiable parameters; the preferred orientation (PO) module can adopt the March–Dollase model, controlling the texture effect through the differentiable parameter r and the axis (hkl); optional physical modules include FCJ axis scattering correction, ... Transparency correction and sample displacement correction are implemented to ensure that relevant parameters can participate in optimization. A structure factor calculation module is built, which, based on the structure factor formula F(hkl), can differentiate atomic coordinates, occupancy, and thermal vibration parameters (Uiso / Biso). Differentiable solutions for atomic coordinates, occupancy, and thermal vibration parameters are achieved based on the structure factor formula. Finally, the independent differentiable calculation modules of each phase are integrated to form a unified fully parameterized differentiable XRD forward simulation model. The final model can perform fully differentiable gradient solutions for: cell parameters, atomic coordinates, peak shape parameters, preferred orientation, mixing and occupancy, scale, and multiphase fraction frac, ensuring that all key structures and fitting parameters can be optimized under a unified gradient framework. Of course, other model construction methods and model structures can be used for other analytical backgrounds. The above is just an example. Other construction methods and model structures can refer to the description in this embodiment and will not be elaborated here.

[0029] Step 103: Based on the combination ratio characteristics of each phase in the experimental sample, a synergistic fusion strategy is adopted to weight and superimpose each X-ray forward diffraction model to generate a multiphase fused differentiable model.

[0030] A single-phase forward simulation model reflects the diffraction characteristics of that phase alone. In order to match the real diffraction signal of multiphase superposition in the experimental data, this step is based on the actual combination ratio of each phase in the experimental sample (such as global fitting parameters such as mixing weight and scale factor). Through a synergistic fusion strategy of multiphase normalization combination + principal phase preferential bias, the independent X-ray diffraction forward simulation models of each phase are weighted and fused according to the corresponding proportional parameters (such as weight and scale) to form a unified multiphase fusion differentiable model that can accurately characterize the diffraction characteristics of multiphase coexisting samples. It can restore the overall diffraction response under the synergistic effect of multiphases and provide core model support for subsequent comparison and optimization based on the overall fitting curve and experimental spectrum.

[0031] In the multiphase fusion process, common parameters such as global background and zero-point drift, which are independent of specific phases, can be integrated. These parameters, along with the background and zero-point drift, are then added to correct the superimposed diffraction curve, ultimately generating a total fitting curve that can be directly compared with experimental data. Furthermore, the differentiability of the model is maintained throughout the process, ensuring that the fused parameters can still participate in gradient optimization. Of course, this correction step can be omitted; this embodiment does not impose any limitations on this.

[0032] In this embodiment, the specific type of phase proportion feature selected is not limited. For example, the mixing weight of each phase (used to define the relative contribution ratio of different phases in the total diffraction signal), scale factor (used to adjust the overall amplitude of the diffraction intensity of each phase), normalized phase fraction (the phase proportion parameter whose sum is fixed to one after unified standardization processing), phase intensity proportion coefficient (the proportion feature derived based on the ratio of the diffraction intensity of a single phase to the total diffraction intensity of all phases), etc., can all be used as phase proportion features in this step as long as they can quantify the relative proportion relationship of each phase in the multiphase system and adapt to the differentiable optimization requirements of the multiphase fusion model.

[0033] The collaborative fusion strategy employed when weighting and superimposing various X-ray forward diffraction models mainly includes multiphase normalization combination and principal phase preferential bias. Multiphase normalization combination refers to transforming the proportion parameters of all phases using a differentiable mapping function (such as the softmax function) to ensure that the phase fractions of each phase satisfy the physical constraints of non-negativity and a sum of one. Principal phase preferential bias refers to adding a fixed positive offset to the original weight parameters of the dominant principal phase in the sample, artificially strengthening the weight advantage of the principal phase and preventing excessive expansion of impurity phase parameters that could lead to misallocation of the principal phase intensity. This prevents divergence in the refinement process and ensures that the optimization direction closely matches the actual physical characteristics of the sample, where the principal phase is dominant and impurity phases are secondary. The collaborative fusion strategy ensures the physical rationality of the multiphase proportions while preventing divergence in the optimization process, ultimately generating a multiphase fused differentiable model that accurately reflects the actual phase composition of the sample. It should be noted that, in addition to multiphase normalization combination and principal phase priority bias, other processing rules can be further configured in the collaborative fusion strategy for different data processing purposes. This embodiment only uses the above two processing rules as examples for introduction. The implementation of other rules can refer to the introduction of this embodiment, and will not be elaborated here.

[0034] Step 104: Based on experimental X-ray diffraction intensity data, construct an objective function by fusing the fitting residuals and the global stoichiometric penalty value.

[0035] The degree of matching between experimental X-ray diffraction intensity data and theoretical diffraction spectra (quantified by fitting residuals) and the stoichiometric compliance of the elemental composition of the multiphase system (quantified by global stoichiometric penalty values) are integrated to construct an objective function. This function is used to guide the iterative update of parameters of the multiphase fusion differentiable model, so that the subsequent optimization process can both pursue the accurate fit between theoretical spectra and experimental data and avoid structural solutions with no physical meaning such as stoichiometric imbalance.

[0036] Among them, the fitting residual refers to the quantitative index obtained by standardized calculation (such as weighted spectral residual factor Rwp) based on the theoretical diffraction spectrum output by the experimental X-ray diffraction intensity data and the multiphase fusion differentiable model. It is used to accurately reflect the degree of difference between the two in core dimensions such as peak shape, intensity, and peak position. The greater the difference, the higher the fitting residual, which means that the theoretical model fits the experimental facts worse.

[0037] The global stoichiometric penalty value is generated based on soft stoichiometric constraints that characterize the actual elemental composition of each phase. Soft stoichiometric constraints are flexible constraints that quantify the deviation between the elemental composition of each phase and the target stoichiometry and convert it into a penalty signal. Through flexible quantification, the elemental composition of the multiphase system is guided to gradually approach the target stoichiometric ratio specified by the user. It does not rigidly restrict parameter values ​​but allows for small, reasonable deviations in elemental composition. Simultaneously, through mathematical deviation calculations and weight adjustments, it ensures that the optimization process does not deviate from the fundamental law of stoichiometric conservation. This avoids the excessive restriction of parameter optimization flexibility by rigid constraints and eliminates meaningless refinement results such as abnormal atomic occupancy rates and imbalances in the molar ratios of multiphase elements from the source.

[0038] To deepen understanding, specifically, a soft stoichiometric constraint term is as follows:

[0039]

[0040] in, It is a weighted residual, used to guide local spectral matching. This is the stoichiometric offset term. This represents the proportion of global elements obtained from the phase fraction and occupancy rate. For the target measurement ratio, Weights that distinguish between the main phase and the impurity phase. Other soft chemostometric constraints. It should be noted that this embodiment only uses the above soft chemostometric constraints as an example. Other types of soft chemostometric constraints driving model parameters are not limited in this embodiment and can all refer to the description in this embodiment.

[0041] The global stoichiometric penalty value is generated based on the soft stoichiometric constraint term. This penalty value reflects the degree of deviation of the entire multiphase system from the target in terms of stoichiometry. The global stoichiometric penalty value is combined with the fitting residuals characterizing the matching degree between theoretical and experimental diffraction spectra to form the objective function. During optimization, a smaller penalty value indicates a more reasonable stoichiometry in the multiphase system, and the objective function value will decrease accordingly. This drives the model parameters (phase fraction, scale factor, atom occupancy rate, etc.) to iterate towards the dual optimum of stoichiometry and fitting accuracy, ultimately achieving the practical implementation of the soft constraint.

[0042] In the constructed multiphase fusion differentiable model, a smoothed soft stoichiometric constraint term is embedded. First, the actual elemental composition is statistically analyzed based on the current crystal structure parameters of each phase (such as atom types and occupancy rates) and compared with the target stoichiometric ratio specified by the user. Combining the phase role weight, the current phase fraction, and the scale factor, the stoichiometric deviation of each phase is quantified and weighted to obtain a global stoichiometric penalty value. Then, this penalty value is combined with the fitting residual characterizing the matching degree between the theoretical diffraction spectrum and the experimental diffraction spectrum to form a complete objective function, so that the gradient optimization is guided by both the signal matching degree and the rationality of the chemical composition.

[0043] In this embodiment, the specific calculation algorithms for fitting residuals and global stoichiometric penalty values ​​are not limited. For example, the fitting residuals can be calculated using algorithms such as weighted spectral residual factor (Rwp), sum of squared residuals (SSE), normalized sum of squared residuals (NRSS), or peak matching residuals, as long as the differences between experimental X-ray diffraction intensity data and theoretical diffraction spectra in terms of peak shape, intensity, and peak position can be quantified to effectively assess the matching degree between the two. The global stoichiometric penalty values ​​can be calculated using algorithms such as L1 norm weighted sum, L2 norm weighted sum, weighted Euclidean distance, or deviation index weighted integration, as long as the deviation between the actual elemental composition of each phase and the target stoichiometric ratio, combined with phase role weights, current phase fractions, and scale factors, can achieve flexible constraints on the stoichiometric compliance of multiphase systems.

[0044] It should be noted that, before constructing the objective function, the experimental X-ray diffraction intensity data can be preprocessed to eliminate noise interference in the original data and improve data quality and reliability. This preprocessing can include, but is not limited to, normalization, background subtraction, and coarse zero-point drift assessment.

[0045] Step 105: Perform three-stage step-by-step optimization on the multiphase fusion differentiable model according to the objective function, and output the multiphase structure solution after three-stage step-by-step optimization and the corresponding differentiable X-ray diffraction forward model.

[0046] Based on the full parameter differentiability of the multiphase fusion differentiable model, a progressive three-stage optimization strategy is carried out using the objective function to systematically iterate and update all key parameters of the multiphase fusion differentiable model (including structural parameters of each phase, multiphase proportional parameters, fitting auxiliary parameters, etc.) so that the theoretical fitting results gradually approach the experimental data, that is, the difference between the theoretical fitting spectrum and the experimental spectrum is minimized. Finally, the multiphase structure solution after parameter optimization and the corresponding differentiable XRD forward model are output.

[0047] The three-stage step-by-step optimization refers to three stages: coarse adjustment, fine adjustment, and fine adjustment. The open range of parameters, optimization step size, and number of iterations are adjusted in each stage to steadily approach the optimal solution under the drive of the objective function. There are no restrictions on the specific parameter types and optimization step sizes for the coarse, fine, and fine adjustment stages; these can be set according to the needs of the actual application scenario. For example, for samples with a very low impurity phase ratio, the phase fraction of the impurity phase can be fixed in the fine adjustment stage, optimizing only the core parameters of the main phase; for systems with complex peak shapes, the step size of the peak shape parameters can be increased in the coarse adjustment stage to quickly match the peak shape profile; for systems with high stoichiometry sensitivity, the number of iterations can be increased in the fine adjustment stage to strengthen constraint adaptation, etc. Compared with a single optimization process, the three-stage progressive optimization has better convergence stability and can effectively avoid iterative oscillations or divergences caused by parameter coupling.

[0048] Multiphase structure solution refers to the set of core parameters that can accurately, comprehensively and physically describe the crystal structure characteristics of multiphase coexisting samples. Its core content includes two aspects: the optimized crystal structure parameters of each phase and the parameters of the ratio and synergy between the multiple phases.

[0049] For the main phase and each impurity phase in the refined system, key crystallographic parameters optimized by gradient iteration are provided, specifically covering unit cell parameters (a, b, c, α, β, γ), atomic three-dimensional coordinates, atomic occupancy and mixing ratio, isotropic thermal vibration parameters (Uiso), preferred orientation (PO) parameters and corresponding axial information, peak shape related optimization parameters, etc., which can accurately reconstruct the microstructure state of a single phase. The proportion and synergistic rationality parameters among the multiphases clarify the relative proportions of each phase in the multiphase system, including the normalized phase fraction, the scale factor of each phase (controlling the diffraction intensity amplitude of each phase), and key information reflecting the rationality of multiphase synergistic coexistence. This embodiment does not limit the specific information types included in the multiphase structure solution; the above is just an example. Appropriate settings can be made according to the needs of actual data analysis, and will not be elaborated further here.

[0050] Based on the above introduction, the multiphase structure refinement method for X-ray diffraction data provided in this embodiment obtains experimental X-ray diffraction intensity data and an initial set of structural parameters containing the theoretical structural parameters corresponding to the main phase and each impurity phase in the experimental sample. Using the verified theoretical structure as the starting point for optimization, it significantly narrows the search range in the high-dimensional parameter space, avoids blind optimization due to a lack of prior information, and constructs a fully parameterized differentiable forward diffraction calculation model for each phase. Each model can achieve gradient solution for all parameters. Based on the combination ratio characteristics of each phase in the experimental sample, a collaborative fusion strategy is used to weight and superimpose the global parameters of the independent models of each phase, restoring the true diffraction response of the multiphase coexisting sample. By employing a synergistic strategy of multiphase normalization combination and principal phase preferential bias to achieve weighted superposition, the physical rationality of multiphase ratios and optimization stability are balanced. This avoids meaningless negative ratios or ratio imbalances, while suppressing refinement divergence caused by excessive expansion of impurity phases in the early stages of optimization. This ensures that the optimization direction aligns with the actual characteristics of the sample where the principal phase dominates and the impurity phases are secondary. The objective function is constructed by fusing the fitting residuals and global stoichiometric penalty values, achieving a dual guarantee of data fitting accuracy and physical rationality. Finally, the multiphase fusion differentiable model is optimized in three stages according to the objective function. The output multiphase structure solution and differentiable model possess both physical rationality and iterability, meeting the requirements for automated feedback.

[0051] This method achieves full automation, high efficiency, and high reliability in multiphase XRD refinement. It avoids the manual dependence and local optima trap of traditional methods, and solves the problems of insufficient generalization and lack of physical constraints in deep learning methods. It provides a stable and reliable technical solution for multiphase structure characterization in unattended laboratories and automated synthesis platforms.

[0052] Example 2: In existing multiphase XRD refinement techniques, when multiphase fusion is directly superimposed based on the original weights and scale factors, physical inconsistencies such as phase fraction exceeding limits (e.g., negative fractions) and non-conservation of the summation are prone to occur. Furthermore, the principal phase is not specifically protected in the early stages of optimization, and impurity phases may over-expand due to parameter fluctuations, leading to the masking of the principal phase signal and divergence in the refinement process, severely affecting the accuracy and stability of the multiphase structural solution. To address these issues, this embodiment proposes a multiphase fusion method. Through a progressive strategy of standardization and normalization, principal phase bias calibration, and finally weighted superposition, this method strictly ensures the non-negativity of phase fractions and the conservation of the summation, while suppressing excessive expansion of impurity phases through a targeted principal phase protection mechanism. Ultimately, a physically reasonable, stable, and controllable multiphase fusion differentiable model is constructed.

[0053] Specifically, step 103, based on the combination ratio characteristics of each phase in the experimental sample, employs a collaborative fusion strategy to weight and superimpose the various X-ray forward diffraction models, which can be performed according to the following steps: Step 31: Extract the original weight parameters and scale factors of the X-ray forward diffraction model for each phase, and perform normalization processing.

[0054] First, two types of key parameters are extracted from the independent differentiable model of each phase: one is the original weight parameter used to characterize the relative contribution of each phase in the multiphase system, and the other is the scale factor used to adjust the overall amplitude of the diffraction intensity of each phase. Then, these two types of parameters are processed by a standardization and normalization algorithm to ensure that the initial proportional parameters are in a range that is numerically stable and easy to optimize, thus avoiding the risk of parameters going out of bounds from the source.

[0055] Among them, softmax(logits) can be used to normalize and combine the scale / frac of all phases to satisfy requirements such as differentiability, total conservation, no out-of-bounds, and no negative fractions.

[0056] Step 32: After adding a positive offset to the normalized principal phase weight parameters, the weight parameters of each phase are normalized to obtain the phase fraction vector.

[0057] Based on the weight parameters after normalization in step 31, a fixed positive offset is added to the corresponding weight parameters (logits) of the principal phase specified in the phase system configuration instruction. This strengthens the contribution weight of the principal phase in the early stage of optimization and avoids excessive expansion of impurity phases leading to fine-tuning divergence. Subsequently, a second normalization process is performed on all phase weight parameters, including the weight of the principal phase after biasing, to ensure that the final phase fraction vector satisfies the physical constraints that each element is non-negative and the sum is one, accurately reflecting the relative proportion of each phase in the multiphase system.

[0058] In this embodiment, the specific value of the positive offset is not limited. It can be a relative proportional coefficient of 10%–30% of the initial weight after the principal phase is normalized, a fixed absolute value in the range of 0.1–0.5, or a small positive value dynamically adapted according to the number of impurity phases to be refined (e.g., the offset is moderately adjusted in the range of 0.05–0.2 for each additional impurity phase). As long as the value can achieve a moderate weight enhancement of the principal phase in the early stage of optimization, avoid excessive expansion of impurity phases crowding out the principal phase signal, and prevent the principal phase weight ratio from becoming unbalanced due to excessive offset, thus affecting the reasonable allocation of the multi-phase ratio, and ensure that the phase fraction vector meets the physical constraints through subsequent secondary normalization, all of these are acceptable methods for determining the positive offset value in this embodiment.

[0059] Step 33: Based on the phase fraction vector and the normalized scale factor, perform weighted superposition of each X-ray forward diffraction model.

[0060] Based on the phase fraction vector obtained in step 32 (defining the relative proportion of each phase) and the normalized scale factor in step 31 (adjusting the intensity amplitude of each phase), the theoretical diffraction intensity curves output by the X-ray forward diffraction model of all phases are weighted and superimposed to complete the construction of the multiphase fusion differentiable model.

[0061] This fusion method employs dual normalization to strictly ensure the physical constraints of phase fractions, guaranteeing that the multiphase ratios always conform to the fundamental laws governing the coexistence of phases in actual samples. Furthermore, the method introduces a positive principal phase offset to explicitly enhance the contribution of the principal phase in the early stages of optimization, preventing excessive interference from impurity phases that could over-compete for diffraction signal weights and cause fine-tuning divergence. This provides a stable initial multiphase structural framework for subsequent gradient optimization. This method not only solves the problems of unconstrained proportional parameters and numerical instability in traditional multiphase fusion but also precisely avoids the risk of phase confusion in multiphase coupling optimization through a principal phase bias strategy. This allows the multiphase fusion model to retain the differentiability of all parameters while possessing stronger anti-interference capabilities and convergence stability.

[0062] Example 3: In existing XRD multiphase structure refinement techniques, traditional methods often focus solely on fitting residuals as the core optimization objective. While this can achieve a high degree of fit between theoretical diffraction spectra and experimental data, it is prone to problems such as deviations in elemental composition from stoichiometry in multiphase systems. For example, impurity phases may adapt experimental peak shapes through extreme elemental ratios, rendering the structural solutions physically meaningless. To effectively guide multiphase systems towards physically reasonable convergence, this embodiment proposes a method for constructing a global stoichiometric penalty value based on soft stoichiometric constraints. This method quantifies the stoichiometric deviation of multiphase systems through standardized vector transformation, precise deviation calculation, and differentiated weight integration, taking into account the different constraint requirements of the main phase and impurity phases.

[0063] Specifically, step 104, based on experimental X-ray diffraction intensity data, constructs an objective function by fusing the fitting residual and the global stoichiometric penalty value, which can be performed according to the following steps: Step 41: Obtain the target measurement ratio specified by the user and construct a vector composed of target elements.

[0064] By receiving the user's pre-set target metrological ratio (i.e. the ideal elemental composition ratio that the sample should meet), it is transformed into a standardized target elemental composition vector, so that the proportion of different elements is presented in a unified mathematical form, providing a consistent and comparable reference benchmark for subsequent comparison of the actual composition of each phase with the target composition.

[0065] Step 42: Calculate the actual element composition of each phase and convert it into a standardized vector as the actual composition vector.

[0066] For each independent phase in the multiphase fusion differentiable model, the actual elemental composition corresponding to its current crystal structure (including key parameters such as atom type and atom occupancy rate) is statistically analyzed. Then, the composition is converted into vector form through unified standardization processing to ensure that the elemental composition data format of different phases is consistent and to eliminate the problem of calculation distortion caused by differences in dimensions or numerical ranges.

[0067] Step 43: Compare the actual composition vector with the target element composition vector and calculate the stoichiometric deviation value.

[0068] By comparing the actual composition vector of each phase with the target elemental composition vector, a separate stoichiometric deviation value for each phase is obtained. This value intuitively reflects the magnitude of the deviation of a single phase from the ideal target in terms of elemental composition.

[0069] The specific algorithm for calculating the deviation is not limited in this embodiment. It can be achieved by vector difference, norm calculation, etc. Please refer to the introduction of relevant technologies. It will not be elaborated here.

[0070] Step 44: Generate a global stoichiometric penalty value based on the stoichiometric deviation values ​​of each phase.

[0071] The stoichiometric deviations of all phases are summed to generate a global stoichiometric penalty value, which comprehensively reflects the overall degree of deviation of the entire multiphase system from the target in terms of stoichiometry.

[0072] In this method, the stoichiometric deviations of all phases are superimposed, and differentiated weights are assigned to each phase based on its role. Then, the stoichiometric deviations of each phase are weighted and integrated according to their respective differentiated weights to form a global stoichiometric penalty value. The weight of the main phase is less than that of the impurity phase. This method incorporates phase role differentiation considerations during generation. By assigning smaller weights to the main phase and larger weights to the impurity phase, it allows for small, reasonable deviations in the main phase to suit the actual synthesis scenario, while effectively suppressing the unreasonable phenomenon of impurity phases preempting the main phase signal through extreme stoichiometry. This ensures that the constraint strength of the penalty value is highly matched to the compositional characteristics of the multiphase system, avoiding constraint imbalances caused by equal weighting. Of course, in addition to phase role weights, other weight settings can be set, such as based on the current phase fraction and scale factor. This example only illustrates the above method; other methods can be referred to in this embodiment and are not limited here.

[0073] Step 45: Based on the experimental X-ray diffraction intensity data and the theoretical diffraction spectrum output by the multiphase fusion differentiable model, calculate the fitting residual characterizing the matching degree between the two.

[0074] The fitting residual is calculated based on the difference between the actual experimental signal and the model-simulated signal. The fitting residual is used to measure the accuracy of the data fitting. Subsequent optimization will focus on minimizing the fitting residual, continuously adjusting structural parameters, phase fractions, peak shape parameters, etc., in the model to make the theoretical diffraction spectrum increasingly approximate the experimental data. This ensures that the refined result conforms to both physical constraints and the actual diffraction patterns of the sample. The magnitude of the fitting residual directly reflects the degree of matching; the smaller the residual value, the better the theoretical diffraction spectrum matches the core characteristics of the experimental data, such as peak shape, intensity, and peak position. Conversely, the larger the residual value, the more significant the deviation between the model simulation results and the actual diffraction characteristics of the sample.

[0075] The specific algorithm for calculating the fitting residual is not limited in this embodiment. For better understanding, the following method is used as an example: First, the coordinate grid of the experimental X-ray diffraction intensity data is aligned with that of the theoretical diffraction spectrum to avoid misjudgment due to dimensional mismatch. Then, a preset quantization algorithm (such as the weighted spectral residual factor Rwp, residual sum of squares, etc. commonly used in XRD refinement) is used to calculate the intensity difference between the experimental data and the theoretical spectrum at corresponding positions point by point. Then, the influence of data magnitude is eliminated through standardization integration (such as weighting and normalization processing) to finally obtain a single fitting residual value.

[0076] Step 46: Integrate the global stoichiometric penalty value and the fitting residual to construct the objective function.

[0077] By combining the global stoichiometric penalty value with the fitting residual characterizing the matching degree between theoretical and experimental diffraction spectra, a complete objective function is formed. This allows the gradient optimization process to be guided by both signal matching improvement and stoichiometric rationality constraints, ensuring that the refinement results have both high fitting accuracy and reliable physical consistency.

[0078] This method ensures the uniformity and accuracy of deviation assessment under systems composed of different phases and elements through standardized vector transformation and deviation calculation procedures.

[0079] This method provides a unified benchmark for stoichiometric constraints through standardized vector construction and deviation calculation processes, ensuring that deviation assessment is accurate and feasible. Specifically, it assigns differentiated weights according to phase roles, with smaller weights for the main phase to retain optimization flexibility and larger weights for impurity phases to effectively constrain extreme deviations and avoid constraint imbalance. This makes the global stoichiometric penalty value more consistent with the reality of multiphase systems, ultimately improving the credibility and stability of the refinement results.

[0080] Example 4: The process of gradient optimization of a multiphase fusion differentiable model based on the objective function is traditionally hampered by a single optimization algorithm. Methods such as pure nonlinear least squares or simple gradient descent are ill-suited to the high-dimensional, non-convex parameter space characteristics of multiphase fusion differentiable models, failing to meet the speed requirements of automated experimental platforms. Furthermore, single optimization algorithms are difficult to deeply adapt to fully parameterized differentiable models, easily leading to gradient propagation distortion and parameter update oscillations, causing the optimization process to diverge and ultimately failing to support the efficient operation of unattended experimental procedures. To address this critical execution bottleneck, step 105, which involves a three-stage step-by-step optimization of the multiphase fusion differentiable model based on the objective function, can be implemented by calling an optimizer. This involves transforming the objective function into a stable gradient update action for all model parameters through standardized optimizer call logic.

[0081] Three-stage step-by-step optimization based on optimizers can reduce the optimization complexity of high-dimensional non-convex parameter spaces through a progressive strategy. However, the above embodiments do not limit the specific calling logic of the optimizer, parameter adjustment rules, and stage connection conditions. In order to solve the problems of blind optimization process, insufficient convergence stability, and difficulty in adapting to automated refinement process caused by fuzzy rules, and to further enhance the feasibility and reliability of three-stage optimization, this embodiment proposes a specific implementation path for calling optimizers to perform three-stage step-by-step optimization. This can achieve standardized scheduling of the optimization process, accurate implementation of the objectives of each stage, and take into account both exploration efficiency and fitting accuracy.

[0082] Specifically, the optimizer is invoked to perform a three-stage step-by-step optimization of the multiphase fusion differentiable model based on the objective function. This can be done as follows: the optimizer is invoked to perform coarse-tuning optimization of the specified structural parameters and fitting parameters of the multiphase fusion differentiable model; if the evaluation index after coarse-tuning reaches the preset range, the optimizer is invoked to perform fine-tuning optimization of the coarse-tuned model parameters; if the evaluation index after fine-tuning reaches the preset range, the optimizer is invoked to perform fine-tuning optimization of the fine-tuned model parameters; wherein, the parameter adjustment step size of coarse-tuning, fine-tuning and fine-tuning decreases in sequence, and the number of iterations increases in sequence.

[0083] The coarse-tuning stage is characterized by a large step size and a small number of iterations, aiming to quickly break through the limitations of the theoretical initial parameters, extensively explore the reasonable parameter space, and initially reduce the evaluation indicators (such as the combined indicator of fitting residuals and stoichiometric penalty values) to avoid getting trapped in local optima due to excessively small step sizes. The fine-tuning stage, based on the effectiveness of the coarse-tuning, refines the parameter values ​​with a moderate step size and a moderate number of iterations, further reducing the deviation between the parameters and the true values, while ensuring that the optimization direction does not deviate through the verification of evaluation indicators. The fine-tuning stage uses the smallest step size and the most iterations to achieve precise convergence of parameters and maximize the accuracy of the initial structural parameters. The parameters for coarse, fine, and precise tuning can be configured differently according to actual needs. For example, coarse tuning can adjust all parameters including cell, peak shape, PO, frac / scale, atomic position, occupation, and Uiso, with a large step size, few iterations, and rapid reduction of Rwp. Fine tuning can adjust all parameters including cell, peak shape, PO, frac / scale, atomic position, and some Uiso to refine the structure and ensure that it does not go out of the global reasonableness. Precise tuning can adjust all parameters including cell, peak shape, PO, coordinates, occupation, occupancy, and Uiso, with a small step size to refine the final Rwp.

[0084] In this embodiment, the setting of the preset range is not limited. For example, it can be set to a weighted spectral residual factor (Rwp) ≤ 15% and a global chemimetric penalty value ≤ 0.4 in the comprehensive index, or only Rwp ≤ 12%, or a global chemimetric penalty value ≤ 0.3 and a diffraction peak shape matching degree ≥ 85%, etc. The preset range after coarse adjustment, the preset range after fine adjustment, and the preset range at which the adjustment is terminated after fine adjustment can be set to the same preset range, or they can be set to corresponding preset ranges separately. In this embodiment, setting the same preset range is used as an example. The implementation method of setting the preset range corresponding to each adjustment stage can be referred to the description in this embodiment, and will not be repeated here.

[0085] This implementation path uses clear stage triggering conditions and parameter scheduling rules to enable the coarse adjustment stage to quickly move away from unreasonable parameter regions by relying on large step sizes, the fine adjustment stage to refine parameter values ​​with medium step sizes, and the fine adjustment stage to achieve high-precision fitting through multiple iterations with small step sizes.

[0086] In the three-stage stepwise optimization of XRD multiphase structure refinement, the selection of the optimizer directly determines the exploration efficiency and convergence accuracy of the high-dimensional non-convex parameter space. Traditional single optimizers are difficult to adapt to the progressive requirements of the three stages: exploration, refinement, and precision. In order to overcome the performance limitations of single optimizers and achieve a precise match between optimizer characteristics and the three-stage optimization objectives, a hybrid solver of Adam (adaptive matrix estimation) + L-BFGS (finite-memory quasi-Newton method) can be adopted. The Adam optimizer is used for early exploratory convergence and parameter optimization in the coarse and fine-tuning stages to quickly traverse the parameter space and initially reduce the objective function value. The L-BFGS optimizer is used for high-precision fitting and second-order accelerated convergence in the later stage to accurately approximate the global optimum.

[0087] The phased allocation of the hybrid optimizer solves the problems of insufficient accuracy of the single Adam optimizer and inefficient exploration of the single L-BFGS optimizer, achieving synergistic effects of efficient exploration in the early stage and accurate fitting in the later stage. The continuous use of the Adam optimizer in the coarse and fine-tuning stages ensures the continuity and stability of parameter updates and avoids iterative oscillations caused by switching between different optimizers. The intervention of the L-BFGS optimizer in the fine-tuning stage significantly improves the fitting accuracy of structural parameters (such as atomic coordinates and unit cell parameters), further enhancing the matching degree between theoretical diffraction patterns and experimental data. Fourth, the deep adaptation of optimizer selection to the three-stage process eliminates the need for manual intervention to adjust the optimization strategy, perfectly meeting the unattended requirements of automated fine-tuning and significantly improving the convergence speed and reliability of results in the fine-tuning of multiphase high-dimensional parameter systems.

[0088] In addition to using the combination of Adam and L-BFGS, other combinations of first-order and second-order optimization algorithms can also be used, such as RMS Prop, momentum SGD, other quasi-Newton methods or trust region algorithms, etc. This embodiment is not limited to these, as long as stable gradient optimization can be achieved on the differentiable XRD forward model.

[0089] This method deeply adapts the standardized optimizer invocation mechanism to the fully parameter differentiable characteristics of the multiphase fusion differentiable model. Through the gradient calculation and iteration strategy of the optimizer, it breaks through the limitations of the traditional single optimizer, avoids the local optimum trap, and adapts to the complex characteristics of the high-dimensional non-convex parameter space. It ensures that all key structural parameters and scaling parameters can be updated end-to-end through a unified gradient framework, avoiding optimization instability caused by asynchronous parameter updates. Secondly, the optimizer can accurately locate the parameter adjustment direction based on the gradient signal of the objective function. Compared with the traditional manually driven optimization method, it significantly improves the convergence speed and stability in the high-dimensional non-convex space and effectively shortens the refinement cycle.

[0090] Example 5: The initial structural parameters are directly extracted from the theoretical crystal information file. However, these theoretical parameters often have inherent deviations from the actual structure of the synthesized sample. To make the structural solution gradually approach the deviations from the actual material properties and meet the requirements of high-precision characterization, the following steps can be further performed based on the above embodiments: Step 106: Adjust the structural parameters of the specified phase in the initial structural parameter set according to the preset adjustment rules.

[0091] According to the preset adjustment rules, the specified phase (usually the main phase or the impurity phase that has a key impact on the refinement result) in the initial structural parameter set is accurately located, and its core structural parameters are adjusted in a targeted manner to provide a parameter starting point that is more in line with the real sample for subsequent model construction.

[0092] In this embodiment, no specific adjustment rules are limited. For example, small perturbation rules for key parameters such as cell parameters, atomic occupancy rate, and thermal vibration parameters, or directional adjustment logic based on structural rationality are not limited. The adjustment direction and adjustment step size are also not limited. They can be set according to the actual application scenario. For example, try to add a small increment or subtraction to a certain structural parameter, such as fine-tuning the cell constant or a set of atomic coordinates.

[0093] Step 107: Based on the adjusted initial structural parameters, proceed to step 103.

[0094] Using the initial structural parameters adjusted in step 106 as input, re-execute step 103 to independently construct differentiable forward diffraction calculation models for each phase and the subsequent complete process (steps 104 and 105). The execution process can refer to the description in the above embodiment to generate a fully parameterized differentiable X-ray diffraction forward simulation model that matches the adjusted parameters.

[0095] Step 108: Use the differentiable X-ray diffraction forward model output before adjustment as the model before adjustment, and use the differentiable X-ray diffraction forward model output after adjustment as the model after adjustment.

[0096] The differentiable X-ray diffraction forward simulation model constructed based on the current pre-adjustment structural parameters is defined as the pre-adjustment model, and the model reconstructed in step 107 based on the current post-adjustment parameters is defined as the post-adjustment model.

[0097] Step 109: Calculate the comprehensive index corresponding to the model before adjustment as the pre-adjustment index, and calculate the comprehensive index corresponding to the model before adjustment as the post-adjustment index.

[0098] The comprehensive indicators corresponding to the model before and after adjustment are calculated separately, and the calculation results are defined as the indicators before and after adjustment, respectively, to provide a quantifiable comparison standard for subsequent judgment of superiority or inferiority.

[0099] The comprehensive index refers to a quantitative evaluation standard that integrates the model fitting accuracy and the physical rationality of the structure. It is used to comprehensively measure the degree of adaptation of the differentiable XRD forward model to experimental diffraction data, as well as the physical compliance of the model output structural parameters (such as phase fraction, occupancy rate, elemental composition, etc.). This embodiment does not limit the specific evaluation indicators. For example, weighted spectral residual factor (Rwp), global stoichiometry penalty value, diffraction peak shape matching degree, phase fraction normalization deviation, atomic occupancy rate rationality, and cell parameter stability error can all be used as components of the comprehensive index or independent evaluation dimensions, as long as the model fitting effect and physical consistency can be numerically quantified.

[0100] Step 110: Compare the indicators before and after the adjustment to determine whether the adjusted indicators are better. If so, accept the current modification and update the initial structural parameters according to the adjusted initial structural parameters. If not, reject the current modification and restore the structural parameters saved before the current adjustment.

[0101] Comparing the pre-adjustment and post-adjustment indices, if the post-adjustment indices are better (i.e., the fitting accuracy is higher and the stoichiometry is more reasonable), then the parameter adjustment is accepted, and the structure parameter set is updated with the adjusted initial structure parameters; if the post-adjustment indices are not better than the pre-adjustment indices, then the modification is rejected, and the original initial structure parameters saved before the adjustment are restored.

[0102] This method effectively corrects the deviation between theoretical parameters and actual samples by continuously and directionally adjusting the core structural parameters of a specified phase (main phase or key impurity phase). This provides a parameter starting point that is more in line with the real structure for subsequent multiphase fusion and gradient optimization. The method monitors the comprehensive index in real time during the adjustment to ensure the effectiveness and physical rationality of the parameter adjustment. If the comprehensive index indicates a decrease in performance, the method immediately reverts to the structural parameters before the adjustment, thus preventing problems such as abnormal atom occupancy and phase fraction imbalance caused by blind adjustment. Only parameter modifications that improve the overall performance of the model are retained, while invalid or harmful adjustments are rejected. This allows the initial structural parameter set to continuously converge to a reasonable range, significantly reducing the probability of subsequent refinement instability.

[0103] Example 6: This embodiment relates to a multiphase structure refinement device for X-ray diffraction data. A schematic diagram of the multiphase structure refinement device for X-ray diffraction data in this embodiment is shown below. Figure 2 As shown, it includes: a data acquisition unit 201, a single-phase model construction unit 202, a multi-phase model fusion unit 203, an objective function construction unit 204, and an objective optimization solution unit 205.

[0104] The data acquisition unit 201 is used to acquire experimental X-ray diffraction intensity data and the corresponding initial structural parameter set. The initial structural parameter set includes the theoretical structural parameters corresponding to the main phase and impurity phase contained in the experimental sample. The main phase is the dominant crystalline phase in the experimental sample, and the impurity phase is the minor crystalline phase. The single-phase model building unit 202 is used to independently build a fully parameter-differentiable forward diffraction calculation model for each phase based on the initial structural parameter set, so as to obtain the X-ray forward diffraction model; The multiphase model fusion unit 203 is used to weight and superimpose each X-ray forward diffraction model based on the combination ratio characteristics of each phase in the experimental sample and adopt a collaborative fusion strategy to generate a multiphase fused differentiable model. The collaborative fusion strategy includes multiphase normalization combination and principal phase preferential bias. Objective function construction unit 204 is used to construct an objective function based on experimental X-ray diffraction intensity data, by fusing the fitting residual and the global stoichiometric penalty value; the global stoichiometric penalty value is generated based on the soft stoichiometric constraint term characterizing the actual elemental composition of each phase. The objective optimization solution unit 205 is used to perform three-stage step-by-step optimization of the multiphase fusion differentiable model according to the objective function, and output the multiphase structure solution after three-stage step-by-step optimization and the corresponding differentiable X-ray diffraction forward model.

[0105] The data acquisition unit in this device accurately acquires experimental X-ray diffraction intensity data and initial structural parameter sets that distinguish between the main phase and impurity phases, providing an objective data benchmark and a precise theoretical starting point for subsequent refinement. The single-phase model construction unit, based on the initial structural parameter sets, independently constructs fully parameter-differentiable forward diffraction calculation models for each phase, achieving targeted characterization of a precise model for each phase. Independent modeling avoids initial coupling interference of multiphase parameters and fully preserves the inherent diffraction characteristics of each phase. Fully parameter-differentiable design breaks the fragmentation of traditional parameter optimization, allowing key parameters such as cell parameters, atomic coordinates, peak shape parameters, and thermal vibration parameters to be solved within a unified gradient framework. The multiphase model fusion unit, relying on a synergistic fusion strategy of multiphase normalization combination and primary phase preferential bias, weightedly superimposes each single-phase model to generate a multiphase fused differentiable model. Multiphase normalization ensures that the phase fractions always satisfy the physical constraints of non-negativity and a sum of one, avoiding meaningless proportional imbalances. The principal phase preferential bias, by applying a positive offset to the principal phase weights before normalization, effectively suppresses the refinement divergence caused by excessive expansion of impurity phases in the early stages of optimization, ensuring that the model closely matches the actual characteristics of the sample where the principal phase is dominant and the impurity phases are secondary, accurately reproducing the diffraction signal generation mechanism of the multiphase interaction. The objective function construction unit integrates the fitting residuals and global stoichiometric penalty values ​​to construct a unified objective function, achieving dual assurance of data fitting accuracy and physical rationality. The objective optimization solution unit solves the multiphase fusion differentiable model through a three-stage step-by-step optimization strategy, balancing optimization efficiency and fitting accuracy.

[0106] Furthermore, it should be noted that all modules involved in this embodiment are logical modules. In practical applications, a logical unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. In addition, to highlight the innovative aspects of this application, this embodiment does not introduce units that are not closely related to solving the technical problems proposed in this application; however, this does not mean that other units do not exist in this embodiment.

[0107] Example 7: Another embodiment of this application relates to an electronic device, such as... Figure 3 As shown, it includes: at least one processor 301; and a memory 302 communicatively connected to at least one processor 301; wherein the memory 302 stores instructions executable by at least one processor 301, the instructions being executed by at least one processor 301 to enable at least one processor 301 to perform the steps of the multiphase structure refinement method for X-ray diffraction data in the above embodiments.

[0108] The memory and processor are connected via a bus, which can include any number of interconnecting buses and bridges, connecting various circuits of one or more processors and memories. The bus can also connect various other circuits, such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and will not be described further herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by the processor is transmitted over the wireless medium via an antenna, which further receives data and transmits it to the processor.

[0109] The processor manages the bus and general processing, and also provides various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory, on the other hand, is used to store data used by the processor during operation.

[0110] Those skilled in the art will understand that the above embodiments are specific embodiments for implementing this application, and in practical applications, various changes can be made to them in form and detail without departing from the spirit and scope of this application.

Claims

1. A method for refining the multiphase structure of X-ray diffraction data, characterized in that, include: Acquire experimental X-ray diffraction intensity data and the corresponding initial structural parameter set; the initial structural parameter set includes the theoretical structural parameters corresponding to the main phase and impurity phase contained in the experimental sample; the main phase is the dominant crystalline phase in the experimental sample, and the impurity phase is the minor crystalline phase; Based on the initial structural parameter set, a fully parameterized differentiable forward diffraction calculation model is independently constructed for each phase to obtain the X-ray forward diffraction model; Based on the combination ratio characteristics of each phase in the experimental sample, a synergistic fusion strategy is adopted to weight and superimpose the X-ray forward diffraction models to generate a multiphase fused differentiable model; the synergistic fusion strategy includes multiphase normalization combination and principal phase preferential bias. Based on the experimental X-ray diffraction intensity data, an objective function is constructed by fusing the fitting residual and the global stoichiometric penalty value. The global stoichiometric penalty value is generated based on the soft stoichiometric constraint term that characterizes the actual elemental composition of each phase. The multiphase fusion differentiable model is optimized in three stages according to the objective function, and the multiphase structure solution after the three-stage optimization and the corresponding differentiable X-ray diffraction forward model are output.

2. The method for refining the multiphase structure of X-ray diffraction data according to claim 1, characterized in that, Based on the combination ratio characteristics of each phase in the experimental sample, a synergistic fusion strategy is used to weight and superimpose the X-ray forward diffraction models, including: The original weight parameters and scale factors of the X-ray forward diffraction model for each phase are extracted and normalized. After adding a positive offset to the normalized principal phase weight parameters, the weight parameters of each phase are then normalized to obtain the phase fraction vector. The X-ray forward diffraction models are weighted and superimposed based on the phase fraction vector and the normalized scale factor.

3. The method for refining the multiphase structure of X-ray diffraction data according to claim 1, characterized in that, The objective function constructed based on the experimental X-ray diffraction intensity data, by fusing the fitting residual and the global stoichiometric penalty value, includes: Obtain the target measurement ratio specified by the user and construct a vector composed of the target elements; The actual element composition of each phase is statistically analyzed and converted into a standardized vector, which serves as the actual composition vector. Compare the actual composition vector with the target element composition vector to calculate the stoichiometric deviation value; A global stoichiometric penalty value is generated based on the stoichiometric deviation values ​​of each phase. Based on the experimental X-ray diffraction intensity data and the theoretical diffraction spectrum output by the multiphase fusion differentiable model, the fitting residual characterizing the degree of matching between the two is calculated. The objective function is constructed by integrating the global stoichiometric penalty value and the fitting residual.

4. The method for refining the multiphase structure of X-ray diffraction data according to claim 3, characterized in that, The step of generating a global stoichiometric penalty value based on the stoichiometric deviation values ​​of each phase includes: Differential weights are assigned based on the role of each phase; among them, the weight of the principal phase is less than that of the heterogeneous phase. The stoichiometric deviation values ​​of each phase are weighted and integrated according to the corresponding differential weights to form the global stoichiometric penalty value.

5. The method for refining the multiphase structure of X-ray diffraction data according to claim 1, characterized in that, The three-stage step-by-step optimization of the multiphase fusion differentiable model based on the objective function includes: The optimizer is invoked to perform a three-stage step-by-step optimization of the multiphase fusion differentiable model based on the objective function.

6. The method for refining the multiphase structure of X-ray diffraction data according to claim 5, characterized in that, The invoke optimizer performs a three-stage step-by-step optimization of the multiphase fusion differentiable model based on the objective function, including: The optimizer is invoked to perform coarse-tuning optimization on the specified structural parameters and fitting parameters of the multiphase fusion differentiable model; If the coarse-tuned evaluation index reaches the preset range, the optimizer is invoked to fine-tune and optimize the coarse-tuned model parameters. If the fine-tuned evaluation index reaches the preset range, the optimizer is invoked to fine-tune and optimize the fine-tuned model parameters. The parameter adjustment step size of the coarse adjustment, the fine adjustment, and the fine adjustment decreases sequentially, while the number of iterations increases sequentially.

7. The method for refining the multiphase structure of X-ray diffraction data according to claim 6, characterized in that, The optimizer is a hybrid optimizer that includes the Adam optimizer and the L-BFGS optimizer; The optimizer is then invoked to perform coarse-tuning optimization of the specified structural parameters and fitting parameters of the multiphase fusion differentiable model. Specifically, the Adam optimizer is invoked to perform coarse-tuning optimization of the specified structural parameters and fitting parameters of the multiphase fusion differentiable model. The step of calling the optimizer to fine-tune the coarsely tuned model parameters specifically involves calling the Adam optimizer to fine-tune the coarsely tuned model parameters. The step of calling the optimizer to fine-tune the fine-tuned model parameters specifically involves calling the L-BFGS optimizer to fine-tune the fine-tuned model parameters.

8. The method for refining the multiphase structure of X-ray diffraction data according to any one of claims 1 to 6, characterized in that, Also includes: According to the preset adjustment rules, adjust the structural parameters of the specified phase in the initial structural parameter set; Based on the adjusted initial structural parameters, the step of independently constructing a differentiable forward diffraction calculation model for each phase according to the initial structural parameter set is performed. The differentiable X-ray diffraction forward model output before adjustment is used as the model before adjustment, and the differentiable X-ray diffraction forward model output after adjustment is used as the model after adjustment. Calculate the comprehensive index corresponding to the model before adjustment as the pre-adjustment index, and calculate the comprehensive index corresponding to the model before adjustment as the post-adjustment index; Compare the indicators before and after the adjustment to determine whether the adjusted indicators are better. If so, accept the current modification and update the initial structural parameters according to the adjusted initial structural parameters; If not, reject the current modification and restore the structure parameters saved before the current adjustment.

9. A multiphase structure refinement device for X-ray diffraction data, characterized in that, include: The data acquisition unit is used to acquire experimental X-ray diffraction intensity data and the corresponding initial structural parameter set; the initial structural parameter set includes the theoretical structural parameters corresponding to the main phase and impurity phase contained in the experimental sample; the main phase is the dominant crystalline phase in the experimental sample, and the impurity phase is the minor crystalline phase; A single-phase model construction unit is used to independently construct a fully parameter-differentiable forward diffraction calculation model for each phase based on the initial structural parameter set, thereby obtaining an X-ray forward diffraction model; A multiphase model fusion unit is used to weight and superimpose the X-ray forward diffraction models based on the combination ratio characteristics of each phase in the experimental sample and adopt a collaborative fusion strategy to generate a multiphase fused differentiable model; the collaborative fusion strategy includes multiphase normalization combination and principal phase preferential bias. The objective function construction unit is used to construct an objective function based on the experimental X-ray diffraction intensity data by fusing the fitting residual and the global stoichiometric penalty value. The global stoichiometric penalty value is generated based on the soft stoichiometric constraint term that characterizes the actual elemental composition of each phase. The objective optimization solution unit is used to perform three-stage step-by-step optimization of the multiphase fusion differentiable model according to the objective function, and output the multiphase structure solution after the three-stage step-by-step optimization and the corresponding differentiable X-ray diffraction forward model.

10. An electronic device, characterized in that, include: At least one processor; And, a memory communicatively connected to the at least one processor; The memory stores instructions executable by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform the multiphase structure refinement method for X-ray diffraction data as described in any one of claims 1 to 8.