The invention provides a
grating preparation on-line monitoring method and
system. The method comprises the following steps that a j.i matrix is formed by equal-interval
grating array data collected in one scanning period, wherein the row of the matrix represents
wavelength steps, and the column represents sampling points, j is the total number of the
wavelength steps, and i is the number of all the sampling points;
peak finding is carried out on the j.i matrix column by column, and the actual position of the
grating is obtained; according to the space position information of m gratings, the mcolumns of data in the corresponding positions in the equal-interval grating array
data matrix are taken out to obtain a j-m matrix; each column of data is accumulated to obtain a new 1*i matrix [n1,n2, until ni], wherein ni is composed of j data points, and for each ni, [
lambda]1-i until [
lambda]j-i are compared in sequence to obtain the maximum values [x1, x2 until xi] of each column; assumingthat the initial
wavelength of a scanning
light source is set to be [
lambda] 0, the wavelengths of the gratings to be measured are [lambda 1, lambda 2, until lambda i], wherein [lambda] i is equal to[lambda] 0+ xi / 1000; the weighted average value of the wavelengths of the gratings to be measured is taken to obtain an average wavelength value, and the difference value between the wavelengths of the gratings to be measured and the average wavelength is further obtained; and the wavelength difference value is compared with a standard difference value [
delta] in sequence, wherein if the wavelength difference value is larger than the standard deviation value, the grating wavelength is abnormal.