Residual stress measurement method based on Bayesian model

Through Bayesian model and Rietveld fitting combined with multiple peak-form functions, the problem of low residual stress measurement accuracy and reliability is solved, and the measurement accuracy and reliability are achieved, adapting to different materials and conditions is reduced, and human error and measurement period are reduced.

CN120450062APending Publication Date: 2025-08-08HUAZHONG UNIV OF SCI & TECH +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510460232.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-14
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

In the prior art, the accuracy and reliability of residual stress measurement are low, and problems such as texture and surface wear of the material lead to a large difference between the measured value and the actual value.

Method used

Using the Bayesian model-based residual stress detection method, Markov chain Monte Carlo sampling using Rietveld fitting and Metropolis-Hastings algorithm is used to optimize parameter estimation, reduce the influence of noise and peak distortion, and improve measurement accuracy and reliability.

Benefits of technology

It significantly improves the accuracy of the Prague diffraction angle measurement and the accuracy of residual stress detection, reduces artificial errors, adapts to different materials and experimental conditions, provides reliable statistical information and shorter measurement periods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120450062A_ABST
    Figure CN120450062A_ABST
Patent Text Reader

Abstract

The invention belongs to the related technical field of residual stress detection, and discloses a residual stress measurement method based on a Bayesian model, which comprises the following steps of: (1) constructing the Bayesian model based on the acquired diffraction intensity and scanning angle value of a sample, and inputting the acquired diffraction intensity and scanning angle value into the Bayesian model; the output is a Bragg diffraction angle; and (2) inputting the acquired diffraction intensity and the scanning angle value of the to-be-measured piece into a Bayesian model to obtain a Bragg diffraction angle, and further calculating to obtain a residual stress value based on the obtained Bragg diffraction angle. According to the method, Rietveld fitting is used for carrying out peak pattern fitting on the residual stress, the super-robust Bragg diffraction angle 2theta value is recognized through the Bayesian posterior model, then the residual stress value with good reliability is obtained through formula calculation, existing X-ray stress measurement is optimized, and then precision and reliability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field related to residual stress detection, and more specifically, relates to a residual stress detection method based on a Bayesian model. Background Art

[0002] Residual stress refers to the stress that remains within an object after the external load has been removed. The presence of residual stress significantly affects material properties such as fatigue strength, corrosion resistance, and dimensional stability. Accurately measuring residual stress is crucial for ensuring material quality, improving product reliability, and optimizing process operations.

[0003] X-ray diffraction is a commonly used nondestructive residual stress measurement method. Its principle is based on Bragg's law, inferring residual stress by measuring changes in interplanar spacing. To obtain more accurate residual stress measurements, X-ray diffraction requires comparative analysis and selection of test parameters, including the collimator diameter, target material, peak determination method, tube voltage and current, exposure time, and the number of angular stations for the swing angle (Ψ).

[0004] At present, Bayesian analysis is mainly used to analyze the influence of processing conditions, residual stress, etc. on deformation in terms of residual stress. However, there is still a lack of an optimization method in the process of residual stress measurement. Since the material may also have problems such as texture and surface wear, the measured value is quite different from the actual value. Summary of the Invention

[0005] In response to the above defects or improvement needs of the prior art, the present invention provides a residual stress detection method based on a Bayesian model, which aims to solve the problems of low accuracy and reliability of existing residual stress measurements.

[0006] To achieve the above object, according to one aspect of the present invention, a residual stress detection method based on a Bayesian model is provided, the method comprising the following steps:

[0007] (1) A Bayesian model is constructed based on the collected diffraction intensity and scanning angle values of the sample. The input of the Bayesian model is the collected diffraction intensity and scanning angle values; the output is the Bragg diffraction angle 2θ. Among them, the likelihood function P(D|θ) of the Bayesian model is:

[0008]

[0009] Where N is the number of data points, I calc (2θ i; θ) is the diffraction intensity of the i-th data point calculated according to the selected peak shape function, the peak shape function is selected from the Gaussian function, Lorentz function, Voigt function and Pseudo-Voigt function; θ = (A, 2θ0, σ, γ, η) is the parameter vector to be estimated;

[0010] (2) The collected diffraction intensity and scanning angle values of the test piece are input into the Bayesian model to obtain the Bragg diffraction angle, and then the residual stress value is calculated based on the obtained Bragg diffraction angle.

[0011] Furthermore, the collected discrete diffraction intensities are fitted according to the Rietveld full spectrum fitting theory to obtain a peak curve of the diffraction intensity. The expression of the peak curve is f(2θ i )for:

[0012] f(2θ i )=f b (2θ i )+I@G(2θ i )

[0013] where f b (2θ i ) is the scanning angle 2θ i The background intensity; I is the integrated intensity of the sample material, G(2θ i ) is the function after area normalization of the peak shape function.

[0014] Furthermore, using the Bayesian formula, given the measurement data D, the posterior distribution of the parameter θ is calculated by the following formula:

[0015]

[0016] Where P(θ|D) is the posterior probability of parameter θ, P(D|θ) is the likelihood function, which expresses the probability of observing data D under parameter θ; P(θ) is the prior probability, which reflects the cognition of parameter θ before the observation of data; P(D) is the evidence factor, which is used to normalize the posterior probability.

[0017] Furthermore, based on the obtained likelihood function P(D|θ) and prior distribution P(θ), the posterior distribution of parameter θ is calculated using the Bayesian formula:

[0018]

[0019] Where P(θ|D) is the posterior probability of parameter θ, P(D|θ) is the likelihood function, which expresses the probability of observing data D under parameter θ; P(θ) is the prior probability, which reflects the knowledge of parameter θ before the data is observed; P(D) is the prior distribution of the collected data, which is used to normalize the posterior probability.

[0020] Furthermore, the Bayesian model uses the Metropolis-Hastings algorithm to perform Markov chain Monte Carlo sampling to obtain samples of the posterior distribution.

[0021] Furthermore, the Bayesian model selects the proposed distribution q(θ′|θ t ), use normal distribution to generate the perturbation value of each parameter in the parameter vector, then calculate the acceptance probability α, and decide whether to accept the proposed state based on the calculated acceptance probability α. The calculation formula of the acceptance probability α is:

[0022]

[0023] Furthermore, we propose a distribution q(θ′|θ t ) is used to calculate the current state θ t Based on this, a proposed state θ′ is generated; assuming that the parameters in the parameter vector are independent of each other, the proposed distribution can be expressed as θ′~N(θ t ,∑), where ∑ is the covariance matrix and is a diagonal matrix; the diagonal elements represent the proposed step size for each parameter in the parameter vector.

[0024] Furthermore, the peak area A is a positive value, and its prior distribution is set to be a gamma distribution, and its probability density function is:

[0025]

[0026] where α A and β A are the shape parameter and rate parameter of the gamma distribution, respectively. The mean of the peak area is estimated to be approximately A mean , the variance is approximately A var , then α is calculated by the following relationship A and β A :

[0027]

[0028] Furthermore, the probability density function of the Bragg diffraction angle 2θ0 is:

[0029]

[0030] where 2θ 0,prior is the prior mean, is the prior standard deviation;

[0031] The standard deviation σ of the Gaussian peak is positive, and its probability density function is:

[0032]

[0033] where μ σand σ σ Set based on prior knowledge.

[0034] Furthermore, the collected diffraction intensity and scanning angle values are stored in an Excel table, where the first column of the Excel table records the scanning angle value, and the second column records the corresponding diffraction intensity I value.

[0035] In general, compared with the prior art, the residual stress detection method based on the Bayesian model provided by the present invention has the following beneficial effects:

[0036] 1. The present invention integrates prior knowledge (such as theoretical parameters of the material crystal structure) and observed data through a Bayesian model, significantly reducing the impact of noise and peak distortion on Bragg diffraction angle measurement, making parameter estimation closer to the true value. At the same time, the Bayesian method is used for parameter inference, making full use of prior information and reducing the influence of factors such as noise and peak distortion, thereby improving the accuracy of Bragg diffraction angle measurement, and further improving the accuracy and reliability of residual stress detection.

[0037] 2. By comprehensively considering multiple peak shape functions, the method can more accurately describe the shape of the diffraction peak. Using the Markov Chain Monte Carlo (MCMC) method to traverse the parameter space, it effectively avoids the problem of traditional optimization algorithms easily falling into local optimality and ensures the global optimality of parameter estimation. Furthermore, the samples of the posterior distribution obtained through MCMC sampling can be used to assess the uncertainty of the parameter estimation, providing more reliable statistical information for the measurement results.

[0038] 3. The present invention provides support for multiple peak shape functions such as Gaussian, Lorentz, Voigt and Pseudo-Voigt, which can adapt to the diffraction peak characteristics of different materials (such as metals, ceramics, composite materials) and different experimental conditions (such as different instrument broadening, crystal defects). The most appropriate peak shape function can be selected according to different experimental data and material properties, enhancing the adaptability of the model to specific application scenarios.

[0039] 4. Automatically searching for optimal parameters through Bayesian models and MCMC sampling reduces the need for operator experience to adjust parameters in traditional methods and reduces human error. Storing diffraction intensity and angle data in Excel facilitates data management and processing and can be easily integrated with other data analysis software, improving experimental efficiency and shortening measurement cycles.

[0040] 5. Accurate Bragg diffraction angle measurements provide more reliable basic data for crystal structure refinement (such as lattice parameter calculation and atomic coordinate optimization), helping to reveal the microstructural characteristics of materials (such as grain size and stress distribution). For complex materials with broadened and overlapping peaks (such as nanomaterials and amorphous materials), this method can achieve more refined peak decomposition and parameter extraction through multi-peak shape functions and Bayesian inference. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 This is a flow chart of a residual stress measurement method based on a Bayesian model provided by the present invention;

[0042] Figure 2 A flowchart of the steps for constructing the Bayesian model in the present invention;

[0043] Figure 3 Flowchart of MCMC sampling steps in the present invention;

[0044] Figure 4 A visualization of the measurement data;

[0045] Figure 5 is the peak curve obtained by fitting with Gaussian function;

[0046] Figure 6 The joint posterior probability distribution diagram of the Bragg diffraction angle and half-height width of the Bayesian model when the pendulum angle is 4°;

[0047] Figure 7 is the sin using Gaussian function 2 Ψ-2θ fitting straight line plot. DETAILED DESCRIPTION

[0048] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.

[0049] See also Figure 1 、 Figure 2 and Figure 3The present invention provides a residual stress measurement method based on a Bayesian model. The measurement method uses Rietveld fitting to perform peak fitting on the residual stress, identifies the ultra-robust Bragg diffraction angle 2θ value through the Bayesian posterior model, and then obtains a relatively reliable residual stress value through formula calculation, thereby optimizing the existing X-ray stress measurement. Among them, the Bayesian method is a data analysis method based on probability statistics. It can make full use of prior information and perform probabilistic inference on model parameters, thereby obtaining more reasonable parameter estimation and uncertainty assessment. In X-ray diffraction analysis, Rietveld fitting is a commonly used calculation method for extracting crystal structure information from diffraction data.

[0050] The measuring method mainly comprises the following steps:

[0051] Step 1: Collect the diffraction intensity and scanning angle values of the sample.

[0052] Before data collection, the instrument parameters need to be set, including the selection of the collimator tube diameter, the target material, the peak determination method, the tube voltage and current, the exposure time, the number of swing angle Ψ stations, etc., and appropriate parameters are selected. The collected diffraction intensity and scanning angle values are stored in an Excel table. The first column of the Excel table records the scanning angle value, and the second column records the corresponding diffraction intensity I value.

[0053] Read the diffraction intensity and scanning angle value data from the Excel spreadsheet: First, draw a scatter plot or line graph based on the collected diffraction intensity and scanning angle values to intuitively display the distribution of the collected data and preliminarily determine whether there are obvious outliers. According to the statistical characteristics of the collected data (such as mean, standard deviation), the data points whose difference from the mean is greater than k times the standard deviation (k is usually 2 or 3) are marked as outliers. Clean the collected data to remove outliers and noise. For each data point, consider the statistical characteristics of the data in its neighborhood. If the difference between the data point and the data in the neighborhood is too large (that is, the data point is more than twice the average value of the data points in the neighborhood), it is also determined to be an outlier. Remove the detected outliers from the collected data set. You can directly delete the corresponding rows, or use interpolation and other methods to replace the outliers.

[0054] To smooth the data after removing outliers, you can use a moving average filter to calculate the average of each data point and its neighboring data points, and then replace the corresponding data point with the calculated average. The size of the neighborhood can be adjusted according to the characteristics and needs of the data. Alternatively, you can use a median filter to take the median of the neighboring data points for each removed data point as the new value of the removed outlier.

[0055] Step 2: A Bayesian model is constructed based on the collected diffraction intensity and scanning angle values. The input of the Bayesian model is the collected diffraction intensity and scanning angle values; the output is the Bragg diffraction angle 2θ.

[0056] The collected discrete diffraction intensities are fitted according to the Rietveld full spectrum fitting theory to obtain the peak curve of the diffraction intensity. The expression of the peak curve is f(2θ i )for:

[0057] f(2θ i )=f b (2θ i )+I@G(2θ i )

[0058] where f b (2θ i ) is the scanning angle 2θ i The background intensity (i = 1, 2, 3 ...); I is the integrated intensity of the sample material, which can be determined by the crystal structure parameters of the sample material; G (2θ i ) is a function after area normalization of the peak shape function. Wherein, the peak shape function class is constructed as shown in Table 1.

[0059] Table 1 Model classes and peak shape functions

[0060]

[0061] In Table 1, G i is the scanning point 2θ i β is the diffraction intensity at 2θ; 2θ is the Bragg diffraction angle; H is the peak width at half the maximum intensity of the diffraction peak, also known as the half-height width (FWHM); L and β G is the integral width of the Lorentz component and Gaussian component in the Voigt function; η is the fraction of the Lorentz component in the Pseudo-Voigt function; Ω is the composite error function; Re is the real part of the function.

[0062] Obtain the likelihood function P(D|θ) of the Bayesian model; the likelihood function P(D|θ) describes the probability of observing the collected data D given the parameter vector θ. In the embodiment of the present invention, it is assumed that the observed diffraction intensity I obs (2θ) and the diffraction intensity I calculated by the expression of the peak curve calc The error between (2θ) follows a normal distribution Then the likelihood function P(D|θ) can be expressed as:

[0063]

[0064] Where N is the number of data points, I calc (2θ i ; θ) is the diffraction intensity of the i-th data point calculated according to the selected peak shape function, and the peak shape function is selected from the Gaussian function, Lorentz function, Voigt function and Pseudo-Voigt function; θ = (A, 2θ0, σ, γ, η) is the parameter vector to be estimated.

[0065] Among them, the peak area A is usually a positive value, and its prior distribution can be set as a gamma distribution, and its probability density function is:

[0066]

[0067] where α A and β A are the shape parameter and rate parameter of the gamma distribution, respectively, which can be selected based on prior knowledge or experience. The mean of the peak area is estimated to be approximately A mean , the variance is approximately A var , then α can be calculated by the following relationship A and β A :

[0068]

[0069] The Bragg diffraction angle 2θ0 can usually be set to have a normal distribution as its prior distribution, and its probability density function is:

[0070]

[0071] where 2θ 0,prior is the a priori mean, which can be obtained based on the theoretical structure of the crystal; is the prior standard deviation, which reflects the degree of uncertainty about the prior mean.

[0072] The standard deviation σ of the Gaussian peak is positive, so its prior distribution can be set as a lognormal distribution, and its probability density function is:

[0073]

[0074] where μ σ and σ σ It can be set based on prior knowledge.

[0075] The half width at half maximum of the Lorentz peak, γ, and the standard deviation of the Gaussian peak, σ, can be set similarly. The value range of the Pseudo-Voigt mixing parameter η is between [0,1]. Its prior distribution can be set to Beta distribution, and its probability density function is:

[0076]

[0077] where α η and β η is the shape parameter of the Beta distribution and can be chosen based on a priori judgments about the relative importance of the Gaussian and Lorentzian components.

[0078] Using the Bayesian formula, given the measurement data D, the posterior distribution of the parameter θ can be calculated as follows:

[0079]

[0080] Where P(θ|D) is the posterior probability of parameter θ, P(D|θ) is the likelihood function, which expresses the probability of observing data D under parameter θ; P(θ) is the prior probability, which reflects the cognition of parameter θ before the observation of data; P(D) is the evidence factor, which is used to normalize the posterior probability.

[0081] Based on the obtained likelihood function P(D|θ) and prior distribution P(θ), the posterior distribution of parameter θ is calculated using the Bayesian formula:

[0082]

[0083] Where P(θ|D) is the posterior probability of parameter θ, P(D|θ) is the likelihood function, which expresses the probability of observing data D under parameter θ; P(θ) is the prior probability, which reflects the knowledge of parameter θ before the data is observed; P(D) is the prior distribution of the collected data, which is used to normalize the posterior probability.

[0084] The Bayesian model uses the Metropolis-Hastings algorithm for Markov Chain Monte Carlo (MCMC) sampling to obtain samples of the posterior distribution. The parameter vector is given an initial value θ0, and the initial value of the peak area A can be set to the average value of historical data. The initial value of the Bragg angle 2θ0 is based on theoretical values or preliminary experimental results. The initial values of other parameters (σ, γ, η) can be set to empirical values (e.g., σ = 1°, γ = 0.5v, η = 0.5).

[0085] Bayesian model selection proposes a distribution q(θ′|θ t ): Proposed distribution q(θ′|θ t ) is used to calculate the current state θ t Based on θ, a proposed state θ′ is generated; the commonly used proposed distribution is the normal distribution. Assuming that the parameters in the parameter vector are independent of each other, the proposed distribution can be expressed as θ′~N(θ t ,∑), where ∑ is the covariance matrix and is a diagonal matrix; the diagonal elements represent the proposed step size of each parameter in the parameter vector. For example, for parameter A, its proposed step size is set to A, then from the current value A t The method for generating the proposed value A′ is

[0086] Generate a candidate parameter vector θ′ based on the proposed distribution. Use a normal distribution to generate the perturbation value of each parameter in the parameter vector, and ensure that each parameter in the parameter vector is within a reasonable range (for example, η is truncated in [0,1]). Then calculate the acceptance probability α, and decide whether to accept the proposed state based on the calculated acceptance probability α. The calculation formula for the acceptance probability α is:

[0087]

[0088] Next, generate a uniform random number u∈[0,1] and compare the uniform random number with α. If u<α, accept the proposed state, θ t+1 =θ′; otherwise, keep the current state θ t+1 =θ t .

[0089] A fixed number of iterations (e.g., 5000) is recommended to ensure that the Markov chain of the posterior parameters in the Bayesian model converges to a stationary distribution. The decision to terminate sampling is made by checking the stability of the posterior distribution of the parameters (e.g., Gelman-Rubin diagnostics) or observing the fluctuations in the parameter estimates.

[0090] The Bayesian model first discards the first N samples obtained by iteration burn samples (such as the first 1000 iterations) to eliminate the influence of the initial value; then perform statistical analysis on the remaining samples, and use the mean as the point estimate of each parameter in the parameter vector; the standard deviation / confidence interval as the uncertainty of each parameter in the parameter vector; finally, draw a histogram or kernel density estimate of each parameter in the parameter vector to intuitively display the probability distribution of the parameter.

[0091] Taking into account the estimated value and uncertainty assessment results of each parameter in the parameter vector, the estimated value of each parameter in the parameter vector (such as the mean estimated value) is used as the final output result of the Bragg diffraction angle. At the same time, its uncertainty information (such as standard deviation or confidence interval) is given to fully describe the reliability of the output result.

[0092] Step three: input the collected diffraction intensity and scanning angle value of the test piece into the Bayesian model to obtain the Bragg diffraction angle, and then calculate the residual stress value based on the obtained Bragg diffraction angle.

[0093] According to the Bragg theorem and elasticity theory, the formula for calculating residual stress can be derived. Substituting the known parameters into the residual stress value can be calculated. The calculation formula for residual stress is:

[0094]

[0095] The present invention is further described in detail below with reference to specific embodiments.

[0096] See also Figure 4 、 Figure 5 、 Figure 6 and Figure 7 In this embodiment, an AEST XL-460 X-ray diffractometer is used to measure the sample. The test sample is a camera frame part made of aluminum alloy 6060-T6. The stress concentration point is selected for measurement. The specific operation steps are as follows:

[0097] Step 1: Sample Preparation and Instrument Preparation. A camera frame part was produced by CNC machine. The surface residual stress was measured using an AEST XL-460 X-ray diffractometer. The tube voltage was set to 25 kV, the tube current was 6.0 mA, a CrKα target was used for X-ray excitation, and the sampling time was 12 seconds. The experimental results showed a Poisson's ratio of 0.33, a Young's modulus of 68.26 GPa, an initial diffraction angle of 139.31°, and a diffraction plane of {311}. The stress constant was calculated to be -166.071 MPa based on the formula. The number of Ψ-stations of the pendulum angle was set to 8.

[0098] Step 2: Perform data acquisition. Set the scanning range to 135°-145°, the scanning speed to 2° / min, and the step size to 0.02°. Fix the sample to the sample stage, ensuring that the measurement point is at the intersection of the three lines of the goniometer, which is also the center of the swinging sphere. Perform a θ-2θ linkage scan on each selected crystal plane and record the diffraction intensity data; measure and obtain eight sets of data pairs regarding the angle 2θ and the number of swing angle Ψ angle stations, and store them in an Excel table. The first column of the table records the value of the scanning angle, and the second column records the corresponding diffraction intensity I value.

[0099] Step 3: Parameter optimization based on the Bayesian model. The prior mean of the Bragg diffraction angle 2θ0 was set to the measured peak position of 139.31°, with a standard deviation of 1°. The prior mean of the peak area A was set to 10,000 cps, with a standard deviation of 2,000. The prior mean of the full width at half maximum (H) was set to 0.5°, with a standard deviation of 0.2°. The MCMC sampling iterations were set to 5,000, the combustion period was 1,000, the proposed distribution was a normal distribution, and the step size was set to 0.1° for the Bragg diffraction angle, 500 cps for the peak area, and 0.05° for the full width at half maximum.

[0100] Step 4: Fit a Bayesian model function to each diffraction peak, extracting peak positions and full width at half maximum (FWHM). Calculate the posterior mean and 95% confidence interval for 2θ0, plot a posterior distribution histogram, and verify parameter convergence. Output the stress values along the principal stress directions to generate a color-coded stress contour map, noting high-stress areas (e.g., the edge of the frame).

[0101] Step 4: Calculate the optimized residual stress value according to the residual stress calculation formula, which can be used as the stress field for workpiece deformation prediction.

[0102] It will be easily understood by those skilled in the art that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A residual stress detection method based on a Bayesian model, characterized in that: The method comprises the following steps: (1) A Bayesian model is constructed based on the collected diffraction intensity and scanning angle values of the sample. The input of the Bayesian model is the collected diffraction intensity and scanning angle values; the output is the Bragg diffraction angle. Among them, the likelihood function P(D|θ) of the Bayesian model is: Where N is the number of data points, I calc (2θ i ; θ) is the diffraction intensity of the i-th data point calculated according to the selected peak shape function, the peak shape function is selected from the Gaussian function, Lorentz function, Voigt function and Pseudo-Voigt function; θ = (A, 2θ0, σ, γ, η) is the parameter vector to be estimated; (2) The collected diffraction intensity and scanning angle values of the test piece are input into the Bayesian model to obtain the Bragg diffraction angle, and then the residual stress value is calculated based on the obtained Bragg diffraction angle.

2. The residual stress detection method based on the Bayesian model according to claim 1, characterized in that: The collected discrete diffraction intensities are fitted according to the Rietveld full spectrum fitting theory to obtain the peak curve of the diffraction intensity. The expression of the peak curve is f(2θ i )for: f(2θ i )=f b (2θ i )+I·G(2θ i ) where f b (2θ i ) is the scanning angle 2θ i The background intensity; I is the integrated intensity of the sample material, G(2θ i ) is the function after area normalization of the peak shape function.

3. The residual stress detection method based on the Bayesian model according to claim 1, characterized in that: Using the Bayesian formula, given the measurement data D, the posterior distribution of the parameter θ is calculated as follows: Where P(θ|D) is the posterior probability of parameter θ, P(D|θ) is the likelihood function, which expresses the probability of observing data D under parameter θ; P(θ) is the prior probability, which reflects the cognition of parameter θ before the observation of data; P(D) is the evidence factor, which is used to normalize the posterior probability.

4. The residual stress detection method based on the Bayesian model according to claim 1, characterized in that: Based on the obtained likelihood function P(D|θ) and prior distribution P(θ), the posterior distribution of parameter θ is calculated using the Bayesian formula: Where P(θ|D) is the posterior probability of parameter θ, P(D|θ) is the likelihood function, which expresses the probability of observing data D under parameter θ; P(θ) is the prior probability, which reflects the knowledge of parameter θ before the data is observed; P(D) is the prior distribution of the collected data, which is used to normalize the posterior probability.

5. The residual stress detection method based on the Bayesian model according to claim 1, characterized in that: The Bayesian model uses the Metropolis-Hastings algorithm to perform Markov chain Monte Carlo sampling to obtain samples of the posterior distribution.

6. The residual stress detection method based on the Bayesian model according to claim 1, characterized in that: Bayesian model selection proposes a distribution q(θ′|θ t ), use normal distribution to generate the perturbation value of each parameter in the parameter vector, then calculate the acceptance probability α, and decide whether to accept the proposed state based on the calculated acceptance probability α. The calculation formula of the acceptance probability α is:

7. The residual stress detection method based on the Bayesian model according to claim 6, characterized in that: Proposal distribution q(θ′|θ t ) is used to calculate the current state θ t Based on this, a proposed state θ′ is generated; assuming that the parameters in the parameter vector are independent of each other, the proposed distribution can be expressed as θ′~N(θ t ,∑), where ∑ is the covariance matrix and is a diagonal matrix; the diagonal elements represent the proposed step size for each parameter in the parameter vector.

8. The residual stress detection method based on the Bayesian model according to any one of claims 1 to 7, characterized in that: The peak area A is a positive value, and its prior distribution is set to be a gamma distribution, and its probability density function is: where α A and β A are the shape parameter and rate parameter of the gamma distribution, respectively. The mean of the peak area is estimated to be approximately A mean , the variance is approximately A var , then α is calculated by the following relationship A and β A :

9. The residual stress detection method based on the Bayesian model according to any one of claims 1 to 7, characterized in that: The probability density function of the Bragg diffraction angle 2θ0 is: where 2θ 0,prior is the prior mean, is the prior standard deviation; The standard deviation σ of the Gaussian peak is positive, and its probability density function is: where μ σ and σ σ Set based on prior knowledge.

10. The residual stress detection method based on the Bayesian model according to any one of claims 1 to 7, characterized in that: The collected diffraction intensity and scanning angle values are stored in an Excel table, where the first column of the Excel table records the scanning angle value, and the second column records the corresponding diffraction intensity I value.