Online self-checking diagnosis method and system of ultraviolet, visible and near-infrared spectrophotometer
By preprocessing and feature extraction of the instrument monitoring data of the UV-Vis-NIR spectrophotometer, anomalies in the grating switching process are identified, solving the problem of wavelength mismatch that is difficult to identify during grating switching. This enables earlier anomaly detection and accurate anomaly type determination, improving the instrument's operational stability and detection efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TIANJIN TUOPU INSTR
- Filing Date
- 2026-04-17
- Publication Date
- 2026-05-15
AI Technical Summary
Existing technologies are unable to effectively identify the effective wavelength mismatch during the grating switching process of ultraviolet-visible-near-infrared spectrophotometers, resulting in inaccurate determination of abnormal switching cycles and a lack of reliable criteria for identifying abnormal types.
By periodically acquiring instrument monitoring data, performing cyclic redundancy check, outlier removal, moving average filtering, and range normalization, grating switching influence window data is generated. The wavelength value at the center position of the spectral response and the effective wavelength mismatch characteristic value are calculated to construct a band switching mismatch feature set, quantify the grating switching deviation level, determine the abnormal switching cycle, and construct anomaly type matching values to determine the anomaly type.
Early identification of effective wavelength shift caused by grating switching, distinguishing between mechanical switching deviations and factors such as light source fluctuations and environmental disturbances, providing targeted abnormal mechanism conclusions, improving the accuracy and interpretability of diagnostic results, reducing manual investigation workload, and improving detection efficiency and stability.
Smart Images

Figure CN122042579A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of instrument control technology, specifically to an online self-testing diagnostic method and system for ultraviolet-visible-near-infrared spectrophotometers. Background Technology
[0002] Against the backdrop of the continuous development of modern analytical instruments towards higher precision, higher throughput, automation, and online connectivity, related technologies for instrument operation self-checking, anomaly diagnosis, and fault early warning are also constantly being refined. Especially for optical analytical equipment that integrates multiple collaborative processes such as light source switching, grating switching, band linkage, and signal acquisition, how to monitor key actuators and critical switching processes online during equipment operation, and promptly identify abnormal states based on monitoring results, has become an important technical direction for improving instrument operational stability, detection consistency, and maintenance timeliness. Regarding online self-checking, output status feedback, fault logic judgment, and diagnostic knowledge construction, existing technologies have proposed several representative self-checking and diagnostic schemes.
[0003] For example, application CN106292633B discloses a self-test system for digital output channels based on an FPGA, including an FPGA and multiple digital output channels. Each channel includes an opto-isolator, a drive switch, and a loopback acquisition circuit. The FPGA acts as the main processor, communicating with a host computer to send and receive commands and data, and to implement control and self-test logic for each channel. The opto-isolator provides electrical isolation between the output and control signals. The drive switch drives the output points. The loopback acquisition circuit samples the output signals for self-diagnosis. The drive switch and the loopback acquisition circuit are connected, and the FPGA is connected to both the drive switch and the loopback acquisition circuit via opto-isolators to form a self-test channel.
[0004] For example, application CN104793609B discloses a self-testing and fault diagnosis expert system for an adaptive optics electronic control system. This invention, based on fault tree analysis of the adaptive optics system's electronic control system, establishes a self-testing and fault diagnosis expert system, which mainly includes a human-machine interface module, a database module, an inference engine module, and an interpretation module. The system fault tree is designed and generated based on fault analysis of the adaptive optics system's electronic control system. A knowledge base for the fault diagnosis expert system is then generated using the fault tree knowledge. Fault diagnosis inference is then performed based on the knowledge base generated from the fault tree, ultimately realizing the functions of the optical system, the electronic control system, and the fault diagnosis expert system.
[0005] The aforementioned existing technologies have achieved equipment self-testing and fault diagnosis from the perspectives of digital output retrieval self-testing, fault tree modeling, and expert knowledge reasoning, and have certain reference value in related technical fields. However, the above solutions are more focused on general electronic control output circuits or expert knowledge diagnosis scenarios, and have not yet established a dedicated diagnostic mechanism for the transient behavior of grating switching processes involved in the actual online operation of UV-Vis-NIR spectrophotometers. For such instruments, the grating switching process not only involves continuous characteristic changes such as wavelength shift at the center position of the spectral response, effective wavelength mismatch, and fluctuations in the stable recovery length after switching, but may also be accompanied by complex anomalies such as switching spectral line breakage and enhanced perturbation coupling. Existing technologies are unable to form an integrated processing path that takes into account online acquisition, feature construction, deviation diagnosis, and anomaly mechanism classification for such switching anomalies.
[0006] Therefore, in response to the above problems, there is an urgent need for an online self-diagnostic method and system for ultraviolet-visible-near-infrared spectrophotometers. Summary of the Invention
[0007] To address the shortcomings of existing technologies, this invention provides an online self-diagnostic method and system for ultraviolet-visible-near-infrared spectrophotometers. This solves the problem that existing ultraviolet-visible-near-infrared spectrophotometers have difficulty in timely identifying effective wavelength mismatch during grating switching, leading to inaccurate determination of abnormal switching cycles and a lack of reliable criteria for identifying abnormal types.
[0008] To achieve the above objectives, the present invention provides the following technical solution: an online self-diagnostic method for an ultraviolet-visible-near-infrared spectrophotometer, comprising: S1, periodically acquiring instrument monitoring data, and performing cyclic redundancy check, outlier removal, moving average filtering, and range normalization on the instrument monitoring data, and outputting preprocessed instrument monitoring data; S2, generating grating switching influence window data based on the preprocessed instrument monitoring data, calculating the wavelength value at the center position of the spectral line response, the effective wavelength mismatch characteristic value, the grating switching stable recovery length value, the switching spectral line breakage amount, and the disturbance constraint amount, and constructing a band switching mismatch... Feature set; S3, quantify the grating switching deviation level based on the band switching mismatch feature set to obtain the grating switching deviation diagnostic value, and determine whether the current sampling period is an abnormal switching period based on the grating switching deviation diagnostic value; S4, construct a switching anomaly judgment vector and a real-time switching mechanism relationship matrix based on the band switching mismatch feature set of the abnormal switching period; construct a historical training vector set and an anomaly mechanism prototype library based on the historical band switching mismatch feature set; calculate the vector deviation value and matrix relationship difference value respectively to generate anomaly type matching value; determine the anomaly type label based on the anomaly type matching value and issue self-check and self-correction instructions.
[0009] Furthermore, the specific steps for periodically acquiring instrument monitoring data and performing cyclic redundancy check, outlier removal, moving average filtering, and range normalization on the preprocessed instrument monitoring data are as follows: Control the UV-Vis-NIR spectrophotometer to perform online initialization. After initialization, set a fixed-duration sliding time window as one sampling period and periodically acquire instrument monitoring data from the UV-Vis-NIR spectrophotometer. The instrument monitoring data includes sampling period identifier, spectral transmittance value, spectral absorbance value, spectral reflectance value, deuterium lamp output power value, tungsten lamp output power value, grating position wavelength value, and monochromator... The system monitors the following data: grating switching status, sample chamber temperature, sample chamber humidity, high voltage level, detector gain level, sample chamber optical path obstruction status, and USB communication status. For the acquired instrument monitoring data, a cyclic redundancy check algorithm is used to perform integrity and transmission error checks on the data messages. A box plot outlier detection algorithm is used to identify and remove outliers from the instrument monitoring data. A moving average filtering algorithm is used to suppress and smooth continuous variations in the instrument monitoring data. A range normalization algorithm is used to standardize the instrument monitoring data to a uniform scale, outputting the pre-processed instrument monitoring data.
[0010] Furthermore, the specific steps for generating grating switching influence window data based on preprocessed instrument monitoring data are as follows: group the preprocessed instrument monitoring data according to the sampling period identifier; when the monochromator grating switching state changes, extract the instrument monitoring data of N consecutive sampling points before and after the corresponding sampling point as the center to generate grating switching influence window data.
[0011] Further, the specific steps for calculating the wavelength value at the center position of the spectral response, the effective wavelength mismatch characteristic value, the grating switching stable recovery length value, the switching spectral line breakage amount, and the perturbation constraint amount, and constructing the band switching mismatch feature set are as follows: Perform differential calculation on the wavelength values of adjacent grating positions in the grating switching influence window data to obtain a wavelength step sequence; calculate the wavelength step value of the M adjacent sampling points before the switching state change sampling point, and take the median of the M wavelength step values to obtain the step reference value; extract continuous sampling points in the wavelength step sequence whose absolute value of the difference from the step reference value is not greater than a preset difference range, and set the switching state... The number of sampling points between the changing sampling point and the starting point of the continuous sampling point is determined as the grating switching stable recovery length value; in the grating switching influence window data, the spectral transmittance value, spectral absorbance value, and spectral reflectance value are compared point by point for each of the three adjacent sampling points, and candidate feature points whose values at the middle sampling point are greater than or less than the values of the two adjacent sampling points are extracted; the sum of the absolute values of the numerical differences between each candidate feature point and the two adjacent sampling points is calculated, and the grating position wavelength value corresponding to the candidate feature point with the largest sum of absolute values of numerical differences is determined as the wavelength value of the spectral line response center position; the wavelength value of the spectral line response center position is compared with the switching state The difference between the wavelength values of the grating positions at the sampling points of the switching state change is calculated, and the absolute value is taken to obtain the preliminary effective wavelength mismatch value. The square root of the grating switching stable recovery length value is multiplied by the recovery influence coefficient to obtain the recovery mismatch gain term. The preliminary effective wavelength mismatch value is added to the recovery mismatch gain term to obtain the effective wavelength mismatch characteristic value. The grating switching influence window data is divided into a pre-switching data segment and a post-switching data segment, with the sampling points of the switching state change as the boundary. The absolute values of the differences in the mean spectral transmittance, the mean spectral absorbance, and the mean spectral reflectance of the pre-switching and post-switching data segments are calculated respectively, and the average of the three is taken to obtain the switching spectrum. The breakdown amount is calculated by: Calculating the absolute values of the differences between the current sampling point's deuterium lamp output power, tungsten lamp output power, high voltage level, detector gain level, sample chamber temperature, and sample chamber humidity and the corresponding mean values in the grating switching influence window data; converting the sample chamber optical path obstruction state and USB communication state values into binary correction values and averaging them with the absolute values of the differences to obtain the disturbance constraint amount; encapsulating and storing the sampling period identifier, spectral response center position wavelength value, effective wavelength mismatch characteristic value, grating switching stable recovery length value, switching spectral line breakdown amount, and disturbance constraint amount to output the band switching mismatch characteristic set.
[0012] Further, the specific steps for quantifying the grating switching deviation level based on the band switching mismatch feature set and obtaining the grating switching deviation diagnostic value are as follows: Read the band switching mismatch feature set; add the square root of the grating switching stable recovery length value to the effective wavelength mismatch feature value to obtain the switching mismatch amplification term; add the switching spectral line breakage amount to the natural constant e to obtain the first intermediate quantity; divide the perturbation constraint amount by the first intermediate quantity to obtain the first ratio; add the first ratio to 1 and take the natural logarithm to obtain the logarithmic result; add the logarithmic result, the natural constant e, and 1 to obtain the perturbation suppression term; divide the switching mismatch amplification term by the perturbation suppression term and take the arctangent function value to obtain the main evaluation term of the switching deviation; add the perturbation constraint amount to the natural constant e to obtain the second intermediate quantity; divide the switching spectral line breakage amount by the second intermediate quantity to obtain the second ratio; take the square root of the second ratio to obtain the spectral line breakage compensation term; add the main evaluation term of the switching deviation and the spectral line breakage compensation term to obtain the grating switching deviation diagnostic value.
[0013] Furthermore, the specific steps for determining whether the current sampling period is an abnormal switching period based on the grating switching deviation diagnostic value are as follows: compare the grating switching deviation diagnostic value with the deviation threshold. When the grating switching deviation diagnostic value is greater than or equal to the deviation threshold, mark the sampling period of the switching state change sampling point as an abnormal switching period; when the grating switching deviation diagnostic value is less than the deviation threshold, mark the sampling period of the switching state change sampling point as a normal switching period.
[0014] Furthermore, the specific steps for constructing the switching anomaly determination vector and the real-time switching mechanism relationship matrix based on the band switching mismatch feature set of the abnormal switching cycle are as follows: extract the effective wavelength mismatch feature value, grating switching stable recovery length value, switching spectral line breakage amount, disturbance constraint amount and grating switching deviation diagnosis value corresponding to the abnormal switching cycle, and concatenate them in a fixed field order to construct the switching anomaly determination vector; and construct the real-time switching mechanism relationship matrix based on the ratio and difference relationship between any two feature values in the switching anomaly determination vector.
[0015] Further, the specific steps for constructing a historical training vector set and anomaly mechanism prototype library based on the historical band switching mismatch feature set are as follows: Read the most recent K historical band switching mismatch feature sets and corresponding anomaly type labels from the grating switching diagnostic database, and construct a historical training vector set based on the historical band switching mismatch feature sets; the anomaly type labels include mechanical hysteresis anomalies, response hysteresis anomalies, spectral line breakage anomalies, and perturbation coupling anomalies; group the historical training vectors according to the anomaly type labels, calculate the training vector center corresponding to each anomaly type, and obtain the prototype vectors for mechanical hysteresis anomalies, response hysteresis anomalies, spectral line breakage anomalies, and perturbation coupling anomalies; then, based on the ratio and difference relationships between any two feature quantities in the historical training vectors corresponding to each anomaly type, construct mechanical hysteresis relationship matrix templates, response hysteresis relationship matrix templates, spectral line breakage relationship matrix templates, and perturbation coupling relationship matrix templates to form the anomaly mechanism prototype library.
[0016] Further, the vector deviation value and matrix relationship difference value are calculated separately to generate anomaly type matching values. The specific steps for determining the anomaly type marker based on the anomaly type matching value and issuing self-check and self-correction instructions are as follows: Calculate the vector deviation value between the real-time switching anomaly judgment vector and each anomaly prototype vector, and the matrix relationship difference value between the real-time switching mechanism relationship matrix and each relationship matrix template; Add the vector deviation value corresponding to each anomaly prototype vector to the matrix relationship difference value of the corresponding relationship matrix template to obtain mechanical hysteresis matching values, response hysteresis matching values, spectral line breakage matching values, and disturbance coupling matching values; Compare the mechanical hysteresis matching values, response hysteresis matching values, spectral line breakage matching values, and disturbance coupling matching values, and take the anomaly type corresponding to the minimum value as the anomaly type marker for the current anomaly switching cycle, and generate self-check and self-correction instructions to be issued to the instrument for execution; Encapsulate the current anomaly switching cycle identifier, grating switching deviation diagnostic value, anomaly type marker, and corresponding matching value, output grating switching diagnostic result data, and write it back to the grating switching diagnostic database.
[0017] The second aspect of this invention provides an online self-diagnostic system for an ultraviolet-visible-near-infrared spectrophotometer, comprising: a data acquisition and processing module, a switching feature construction module, a grating switching diagnosis module, and a grating anomaly classification module, wherein: the data acquisition and processing module is used to periodically acquire instrument monitoring data and perform cyclic redundancy check, outlier removal, moving average filtering, and range normalization on the instrument monitoring data, and output preprocessed instrument monitoring data; the switching feature construction module is used to generate grating switching influence window data based on the preprocessed instrument monitoring data, and calculate the wavelength value at the center position of the spectral response, the effective wavelength mismatch characteristic value, the grating switching stable recovery length value, the switching spectral line breakage amount, and the disturbance approximation. The system includes a beamwidth measurement module and a band switching mismatch feature set. A grating switching diagnosis module quantifies the grating switching deviation level based on the band switching mismatch feature set, obtains a grating switching deviation diagnosis value, and determines whether the current sampling period is an abnormal switching period based on the grating switching deviation diagnosis value. A grating anomaly classification module constructs a switching anomaly judgment vector and a real-time switching mechanism relationship matrix based on the band switching mismatch feature set of the abnormal switching period. It also constructs a historical training vector set and an anomaly mechanism prototype library based on the historical band switching mismatch feature set. Vector deviation values and matrix relationship difference values are calculated respectively to generate anomaly type matching values. Anomaly type markers are determined based on the anomaly type matching values, and self-check and self-correction instructions are issued.
[0018] The present invention has the following beneficial effects:
[0019] (1) Online self-testing diagnostic method and system for ultraviolet-visible-near-infrared spectrophotometers: By jointly analyzing the wavelength step change, spectral response center position and spectral continuity before and after switching within the grating switching influence window, mismatch characteristics can be extracted from the band switching process itself. Compared with the traditional method of judging abnormalities based on a single measurement result or manual retest, it can identify the effective wavelength shift caused by grating switching earlier and improve the timeliness of switching abnormality detection.
[0020] (2) Online self-testing diagnostic method and system for ultraviolet-visible-near-infrared spectrophotometers. It constructs multi-dimensional features such as effective wavelength mismatch characteristic value, grating switching stable recovery length value, switching spectral line breakage amount and disturbance constraint amount, and further forms grating switching deviation diagnostic value. It can distinguish mechanical switching deviation from non-switching factors such as light source fluctuation, environmental disturbance, and communication abnormality, reduce the interference of external disturbance on abnormality judgment, and improve the accuracy and reliability of diagnostic results.
[0021] (3) The online self-testing diagnostic method and system for ultraviolet-visible-near-infrared spectrophotometer, after completing the screening of abnormal switching cycles, further performs abnormality type matching based on the switching abnormality judgment vector, the real-time switching mechanism relationship matrix and the abnormal mechanism prototype library. It can classify abnormalities into mechanical hysteresis type abnormalities, response hysteresis type abnormalities, spectral line breakage type abnormalities and disturbance coupling type abnormalities. Compared with the method of only outputting abnormal alarm results, it can give more targeted abnormality mechanism conclusions and enhance the interpretability of diagnostic results.
[0022] (4) The online self-testing and diagnostic method and system for ultraviolet-visible-near-infrared spectrophotometers has formed a complete online diagnostic link from instrument monitoring data acquisition and preprocessing, band switching mismatch feature construction, grating switching deviation diagnosis to abnormal mechanism classification output. It can complete automated abnormal identification and result output without relying on repeated comparison with standard samples, which is conducive to reducing the workload of manual investigation and improving the continuous detection efficiency and operational stability of spectrophotometers in band switching scenarios. Attached Figure Description
[0023] Figure 1 Flowchart of the online self-test diagnostic method for ultraviolet-visible-near-infrared spectrophotometer;
[0024] Figure 2 This is a structural diagram of the online self-test diagnostic system for an ultraviolet-visible-near-infrared spectrophotometer;
[0025] Figure 3 This is a multi-feature coupling evolution diagram of grating switching deviation diagnostic values and mismatch feature quantities;
[0026] Figure 4 This is a flowchart for grating anomaly classification. Detailed Implementation
[0027] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0028] Please see Figures 1-4This invention provides a technical solution: an online self-diagnostic method for an ultraviolet-visible-near-infrared spectrophotometer, comprising: S1, periodically acquiring instrument monitoring data, and performing cyclic redundancy check, outlier removal, moving average filtering, and range normalization on the instrument monitoring data, and outputting preprocessed instrument monitoring data; S2, generating grating switching influence window data based on the preprocessed instrument monitoring data, calculating the wavelength value at the center position of the spectral line response, the effective wavelength mismatch characteristic value, the grating switching stable recovery length value, the switching spectral line breakage amount, and the disturbance constraint amount, and constructing a band switching mismatch feature set; S3. Quantize the grating switching deviation level based on the band switching mismatch feature set to obtain the grating switching deviation diagnostic value. Determine whether the current sampling period is an abnormal switching period based on the grating switching deviation diagnostic value. S4. Construct a switching anomaly judgment vector and a real-time switching mechanism relationship matrix based on the band switching mismatch feature set of the abnormal switching period. Construct a historical training vector set and an anomaly mechanism prototype library based on the historical band switching mismatch feature set. Calculate the vector deviation value and matrix relationship difference value respectively to generate anomaly type matching value. Determine the anomaly type label based on the anomaly type matching value and issue self-check and self-correction instructions.
[0029] Specifically, the steps for periodically collecting instrument monitoring data and performing cyclic redundancy check, outlier removal, moving average filtering, and range normalization on the preprocessed instrument monitoring data are as follows: Control the UV-Vis-NIR spectrophotometer to perform online initialization. The initialization process includes establishing a communication connection between the host computer and the instrument's main control unit, reading the instrument's current operating status, verifying the availability of the acquisition channels, confirming that the light source driver is in the allowed acquisition state, confirming that the monochromator is in the switchable state, and confirming that the detector is in the normal response state. After initialization, a fixed-duration sliding time window is set as one sampling period, with the fixed-duration sliding time window ranging from 2 seconds to 8 seconds. Overlapping sampling intervals are retained at the beginning and end of the sampling period to ensure continuous and traceable data before and after grating switching. Instrument monitoring data from the UV-Vis-NIR spectrophotometer are periodically acquired, with each channel's monitoring values read synchronously according to a unified sampling rhythm to avoid distortion of the switching correlation caused by inconsistent sampling order across different channels. Instrument monitoring data includes sampling period indicator, spectral transmittance, spectral absorbance, spectral reflectance, deuterium lamp output power, tungsten lamp output power, grating position wavelength, monochromator grating switching status, sample chamber temperature, sample chamber humidity, high voltage setting, detector gain setting, sample chamber optical path obstruction status, and USB communication status. The sampling period indicator... The system identifies the data belonging to the current sliding time window, ensuring accurate location of sampling records before and after the switch in the subsequent grating switching impact window data extraction process. Spectral transmittance values characterize the transmission response intensity of the sample after light transmission, spectral absorbance values characterize the absorption intensity of the sample to incident radiation energy, and spectral reflectance values characterize the reflection intensity of the sample surface to incident radiation energy. These three spectral response values are used together to extract the wavelength value at the center position of the spectral line response and the amount of spectral line breakage during switching. The deuterium lamp output power value characterizes the real-time radiation output level of the ultraviolet light source, and the tungsten lamp output power value characterizes the real-time radiation output level of the visible and near-infrared light source. Both are used together to determine the light source's position. The impact of source disturbance on band switching mismatch; the grating position wavelength value is used to characterize the current working wavelength position of the monochromator's beam splitting component, and is the basic data for calculating the wavelength step sequence, the wavelength value of the spectral response center position, and the effective wavelength mismatch characteristic value; the monochromator grating switching state is used to characterize whether a grating switching action has occurred at the current sampling time, and subsequently, the sampling points where the monochromator grating switching state changes are used as the switching state change sampling points to extract the grating switching influence window data; the sample chamber temperature value is used to characterize the current thermal environment state of the optical path space, and the sample chamber humidity value is used to characterize the current humid environment state of the optical path space. Both are used together to form the disturbance constraint quantity and suppress the interference of environmental disturbance on the deviation diagnosis results;The high-voltage level value characterizes the discrete level state of the detector's high-voltage drive intensity, and the detector gain level value characterizes the discrete level state of the detector signal amplification level. Both are used together to describe the changes in the working state of the detection response link. The sample chamber optical path obstruction status characterizes whether the internal optical path of the sample chamber is obstructed, and the USB communication status value characterizes whether the data transmission between the host computer and the instrument is normal. Both are used together to identify abnormal fluctuations caused by reasons other than grating switching. For the acquired instrument monitoring data, a cyclic redundancy check algorithm is used to perform integrity and transmission error checks on the instrument monitoring data packets. Specifically, for each frame of instrument monitoring data packets, a redundancy check code is calculated according to a preset generator polynomial, and then the calculation result is compared with the packet... The system performs frame-by-frame comparison with the verification field. If the verification results are inconsistent, the corresponding message is marked as invalid and discarded. The technical principle of the Cyclic Redundancy Check (CRC) algorithm lies in using redundant coding comparison to detect bit flips, truncation, and misalignment anomalies during transmission, ensuring the integrity of data entering subsequent processing from the source. A box plot outlier detection algorithm is used to identify and remove anomalies in the instrument monitoring data. Specifically, the lower quartile, upper quartile, and interquartile range are calculated for spectral transmittance, spectral absorbance, spectral reflectance, deuterium lamp output power, tungsten lamp output power, grating position wavelength, sample chamber temperature, and sample chamber humidity. The lower threshold is then formed by subtracting a preset multiple of the interquartile range from the lower quartile. An upper threshold is formed by adding a preset multiple of the interquartile range to the upper quartile range. Data points below the lower threshold and above the upper threshold are marked as outliers and removed. The technical principle of the box plot outlier detection algorithm is to identify isolated values that deviate from the main distribution range based on the median statistical characteristics of the sample distribution, avoiding extreme outlier sampling from skewing the calculation results of subsequent wavelength step sequences and mismatched feature values. A moving average filtering algorithm is used to perform random noise suppression and smoothing on the continuous changes in the instrument monitoring data. The continuous changes include spectral transmittance, spectral absorbance, spectral reflectance, deuterium lamp output power, tungsten lamp output power, grating position wavelength, sample chamber temperature, and sample chamber humidity. Specifically, at each continuous sampling position... A fixed-length sampling subsequence is extracted, and the average result of each sampled value within the sampling subsequence is calculated. The average result is then used to replace the original value at the current sampling position. The technical principle of the moving average filtering algorithm is to use the mean of multiple points in the local time neighborhood to weaken the random fluctuation component and retain the dominant information with a continuous trend of change before and after the band switching. The range normalization algorithm is used to perform uniform scale standardization processing on the instrument monitoring data. Specifically, the minimum and maximum values of spectral transmittance, spectral absorbance, spectral reflectance, deuterium lamp output power, tungsten lamp output power, grating position wavelength, sample chamber temperature, and sample chamber humidity are respectively counted within the continuous sampling period. Then, the minimum value is subtracted from the current value and divided by the difference between the maximum and minimum values to obtain the standardization result.For high-voltage level values, detector gain level values, sample chamber optical path obstruction status, USB communication status values, and monochromator grating switching status, the values are first converted into corresponding numerical codes according to a preset status mapping table, and then enter a unified scale standardization processing flow. The technical principle of the range normalization algorithm is to compress data with different dimensions and numerical ranges into a unified numerical interval, reducing the dominant effect of a single large-scale variable in the subsequent calculation of switching spectral line breakage, disturbance constraint, and grating switching deviation diagnostic values. After completing cyclic redundancy check, outlier removal, moving average filtering, and range normalization processing, the preprocessed instrument monitoring data is output. In the output results, the sampling period identifier and the spectral transmittance value, spectral absorbance value, spectral reflectance value, deuterium lamp output power value, tungsten lamp output power value, grating position wavelength value, monochromator grating switching status, sample chamber temperature value, sample chamber humidity value, high-voltage level value, detector gain level value, sample chamber optical path obstruction status, and USB communication status value are maintained in a one-to-one correspondence, so that the grating switching influence window data can be directly generated and the band switching mismatch feature set can be constructed. ;
[0030] In this implementation plan, by integrating constraints on the data acquisition start point, sampling cycle, time window connection, data validity screening rules, numerical smoothing method, and unified scale processing method of instrument monitoring data, the data attribution corresponding to the sampling cycle identifier can be made clearer, and the instrument monitoring data can maintain a stable mapping relationship within the same sampling cycle. This provides a continuous, reliable, and comparable data foundation for subsequent extraction of grating switching influence window data, identification of wavelength step change characteristics, determination of spectral response center position wavelength value, effective wavelength mismatch characteristic value, switching spectral line breakage amount, and disturbance constraint amount, thereby improving the stability of abnormal switching cycle identification results.
[0031] Specifically, the steps for generating grating switching influence window data based on preprocessed instrument monitoring data are as follows: The preprocessed instrument monitoring data are grouped according to the sampling period identifier. The grouping process uses the sampling period identifier as a unique identifier, grouping instrument monitoring data with the same sampling period identifier into the same data set. After grouping, the data is arranged according to the order of acquisition to ensure that the spectral transmittance, spectral absorbance, spectral reflectance, deuterium lamp output power, tungsten lamp output power, grating position wavelength, monochromator grating switching status, sample chamber temperature, sample chamber humidity, high voltage level, and detector parameters are accurately represented. Gain level, sample chamber optical path obstruction status, and USB communication status maintain a temporal correspondence under the same sampling period identifier. When the monochromator grating switching status changes, instrument monitoring data from N consecutive sampling points before and after the corresponding sampling point are extracted to generate grating switching influence window data. A change in monochromator grating switching status is defined as a discrepancy between the current sampling point's monochromator grating switching status and the previous sampling point's value. The corresponding sampling point is defined as the current sampling point. N is an integer from 3 to 12. N consecutive sampling points are extracted before the current sampling point. N consecutive sampling points are extracted after the current sampling point, and then the current sampling point is incorporated into the window to form a raster switching influence window data with a total length of 2N+1. When the corresponding sampling point is near the beginning of the sampling period, resulting in insufficient sampling points in front, all currently available sampling points in front are used to construct the window. When the corresponding sampling point is near the end of the sampling period, resulting in insufficient sampling points behind, all currently available sampling points behind are used to construct the window. The actual number of extracted points is retained in the window record for subsequent interpretation of the window coverage. The technical principle of this method for extracting raster switching influence window data is as follows: The wavelength position shift, spectral response abrupt change, light source disturbance transmission, and detection state change caused by grating switching do not only occur at a single sampling point, but will continuously propagate in the adjacent interval before switching and the recovery interval after switching. By extracting continuous sampling records before and after the corresponding sampling point, the baseline state before switching, the instantaneous state during switching, and the recovery state after switching can be included in the same analysis scope. This provides a continuous data basis for subsequent identification of wavelength step sequence changes, determination of grating switching stable recovery length value, extraction of wavelength value at the center position of spectral response, calculation of effective wavelength mismatch characteristic value, switching spectral line breakage amount, and disturbance constraint amount.
[0032] In this implementation scheme, by constructing a grating switching influence window data with a continuous coverage relationship around the sampling points of the monochromator grating switching state change, the baseline features before switching, the instantaneous fluctuation features during switching, and the recovery features after switching can be included in the same analysis scope. This makes the data segments corresponding to the sampling period identifier have more complete temporal continuity, thereby enhancing the correlation expression ability of the grating position wavelength value change trajectory, spectral transmittance value change trajectory, spectral absorbance value change trajectory, and spectral reflectance value change trajectory within the switching region. This provides more stable data support for subsequently determining the grating switching stable recovery length value, spectral line response center position wavelength value, effective wavelength mismatch feature value, switching spectral line breakage amount, and disturbance constraint amount, thereby improving the reliability of the abnormal switching cycle identification results.
[0033] Specifically, the steps for calculating the wavelength value at the center position of the spectral response, the effective wavelength mismatch characteristic value, the grating switching stable recovery length value, the switching spectral line breakage amount, and the perturbation constraint amount, and constructing the band switching mismatch characteristic set are as follows: Differential calculation is performed on the wavelength values of adjacent grating positions in the grating switching influence window data to obtain a wavelength step sequence. The differential calculation subtracts the wavelength value of the previous sampling point from the wavelength value of the grating position at the next sampling point to obtain the single-step wavelength change. The wavelength step sequence is used to characterize the continuity of the wavelength advancement trajectory before and after monochromator grating switching. The wavelength step values of the M adjacent sampling points before the switching state change sampling point are calculated, where M is an integer from 3 to 10. The median of these M wavelength step values is taken to obtain the step reference value. To mitigate the impact of local abnormal stepping on the reference benchmark, ensuring the stepping reference value reflects the dominant stepping level of the stable operating range before switching, continuous sampling points with an absolute difference from the stepping reference value not exceeding a preset difference range (0.01 to 0.15) are extracted from the wavelength stepping sequence. The number of sampling points between the switching state change sampling point and the starting point of this continuous sampling point is determined as the grating switching stabilization recovery length value. This value quantifies the recovery length experienced from the instantaneous switching state back to the stable wavelength advancement state; a larger value indicates a longer duration of switching disturbance. In the grating switching influence window data, the spectral transmittance, spectral absorbance, and spectral reflectance values are sampled point-by-point from three adjacent sampling points. By comparison, candidate feature points are extracted where the values of the intermediate sampling points are higher or lower than those of the adjacent sampling points on both sides. These candidate feature points are used to characterize the local peak and valley features of the spectral line. The sum of the absolute values of the numerical differences between each candidate feature point and its adjacent sampling points is calculated, and the grating position wavelength value corresponding to the candidate feature point with the largest sum of absolute values of numerical differences is determined as the wavelength value of the spectral line response center. The principle of this processing is to characterize the dominant response center of the spectral line within the current switching window by using the position with the most significant local amplitude change, thus avoiding weak fluctuation points from entering the center positioning result. The difference between the wavelength value of the spectral line response center position and the grating position wavelength value of the sampling point with the switching state change is taken as the absolute value to obtain the preliminary effective wavelength mismatch value. The mismatch value is used to characterize the degree of direct deviation of the actual spectral line main response position from the switching set position. The square root of the grating switching stable recovery length value is multiplied by the recovery influence coefficient value to obtain the recovery mismatch gain term. The recovery influence coefficient value ranges from 0.05 to 0.50. The recovery influence coefficient value is obtained by extracting the wavelength step values of P adjacent sampling points after the switching state change sampling point, where P is an integer from 2 to 6. The absolute value of the difference between each of these P wavelength step values and the step reference value is calculated, and then the average of these P absolute values is obtained to obtain the recovery perturbation mean value. The recovery perturbation mean value is converted into a recovery influence coefficient value according to a preset mapping interval. When the recovery perturbation mean value is less than 0.01, it is taken as 0.05; when the recovery perturbation mean value is greater than 0.15, it is taken as 0.50. When the mean value of the recovery perturbation is within the range of 0.01 to 0.15, the recovery influence coefficient value is calculated in the range of 0.05 to 0.50 using a linear mapping method. The square root processing is used to keep the gain amplitude expanding smoothly when the recovery length increases, avoiding excessive amplification of the effective wavelength mismatch characteristic value by a single variable due to an excessively large recovery length. The initial effective wavelength mismatch value is added to the recovery mismatch gain term to obtain the effective wavelength mismatch characteristic value, which is used to simultaneously characterize the degree of instantaneous position offset and the degree of influence of switching recovery tail. Taking the sampling point of switching state change as the boundary, the grating switching influence window data is divided into a pre-switching data segment and a post-switching data segment. The pre-switching data segment is used to characterize the switching effect. The stable spectral state before the switch is used, and the data segment after the switch is used to characterize the recovered spectral state after the switch. The absolute values of the differences in the mean values of spectral transmittance, spectral absorbance, and spectral reflectance between the data segments before and after the switch are calculated, and the average of the three is calculated to obtain the switching spectral line breakage. The switching spectral line breakage is used to quantify the degree of change in the overall continuity of the spectral lines before and after the switch. The larger the value, the less smooth the connection of the main spectral lines before and after the switch. The absolute values of the differences between the deuterium lamp output power, tungsten lamp output power, high voltage level, detector gain level, sample chamber temperature, sample chamber humidity and the corresponding mean values in the grating switching influence window data at the current sampling point are calculated, and the optical path of the sample chamber is blocked. The status and USB communication status values are converted into binary correction values and then averaged with the absolute value of the difference to obtain the disturbance constraint value. The conversion process for the sample chamber optical path occlusion status is as follows: read the sample chamber optical path occlusion status field corresponding to the current sampling point; when the status field is unoccluded, it is recorded as 0; when the status field is occluded, it is recorded as 1; when the status field is an invalid acquisition marker, it is replaced by the status field of the previous valid sampling point before assigning 0 or 1. The conversion process for the USB communication status value is as follows: read the USB communication status value corresponding to the current sampling point; when the USB communication status value indicates normal communication, it is recorded as 0; when the USB communication status value indicates abnormal communication, it is recorded as 1; when the USB communication status value indicates... When the current frame has not returned, the most recent valid communication state value from the adjacent valid sampling points is read, overwritten, and then assigned 0 and 1 values. The technical principle of the binary correction quantity is to transform discrete state information into a unified correction variable that can participate in numerical calculations, so that occlusion disturbances and communication disturbances can directly participate in the construction of disturbance constraint quantities. The sampling period identifier, the wavelength value of the spectral line response center position, the effective wavelength mismatch characteristic value, the grating switching stable recovery length value, the switching spectral line breakage amount, and the disturbance constraint quantity are encapsulated and stored, and the band switching mismatch feature set is output. Each feature value in the encapsulation result maintains a one-to-one correspondence with the sampling period identifier, which is used to subsequently determine the grating switching deviation diagnostic value, abnormal switching period, and abnormal type marker.
[0034] The specific formula for calculating the effective wavelength mismatch characteristic value is as follows:
[0035] ;
[0036] In the formula, This represents the effective wavelength mismatch characteristic value. This indicates the wavelength value at the center position of the spectral line response. The wavelength value of the grating position at the sampling point indicates the state change during switching. Indicates the recovery impact coefficient. This indicates the grating switching stable recovery length value.
[0037] In this implementation scheme, by uniformly constraining the wavelength advancement features, spectral main response features, spectral continuity features before and after switching, environmental disturbance features, and communication disturbance features in the grating switching influence window data, an intrinsically related data expression structure can be formed among the wavelength values at the center position of the spectral response, the effective wavelength mismatch feature values, the grating switching stable recovery length values, the amount of switching spectral line breakage, and the disturbance constraint quantities. This improves the ability of the band switching mismatch feature set to characterize real grating switching anomalies, makes the subsequent determination process of grating switching deviation diagnostic values more stable, makes the abnormal switching cycle identification results more reliable, and makes the basis for the discrimination of anomaly type marking more sufficient.
[0038] Specifically, the steps for quantifying the grating switching deviation level based on the band switching mismatch feature set and obtaining the grating switching deviation diagnostic value are as follows: Read the band switching mismatch feature set, using the sampling period identifier as the search key. Load the effective wavelength mismatch feature value, grating switching stable recovery length value, switching spectral line breakage, and perturbation constraint value corresponding to the same sampling period identifier into the current diagnostic calculation sequence, ensuring that a single diagnostic operation is only performed on feature data within the same abnormal candidate interval. Add the square root of the grating switching stable recovery length value to the effective wavelength mismatch feature value to obtain the switching mismatch amplification term, where the effective wavelength mismatch feature value is used to characterize the spectral line response center. The overall deviation of the position from the switching set position, the grating switching stable recovery length value is used to characterize the recovery span experienced by the wavelength advancement to return to a stable state after switching, and the square root processing is used to perform a gradual increase and compression on the recovery span so that the influence of the switching mismatch amplification term when the recovery length is large keeps its growth gradual, avoiding the single recovery span from excessively dominating the diagnostic results; the switching spectral line breakage amount is added to the natural constant e to obtain the first intermediate amount; the perturbation constraint amount is divided by the first intermediate amount to obtain the first ratio; the first ratio is added to 1 and the natural logarithm is taken to obtain the logarithmic result; the logarithmic result, the natural constant e, and 1 are added to obtain the perturbation suppression term; where the natural constant e is taken as 2.7182818, the switching spectral line breakage amount is used to characterize the degree of disruption to the spectral line continuity between the data segment before and after the switch. The perturbation constraint amount is used to characterize the background interference level caused by the deuterium lamp output power value, tungsten lamp output power value, high voltage level value, detector gain level value, sample chamber temperature value, sample chamber humidity value, sample chamber optical path obstruction status, and USB communication status value on the switching determination. The perturbation constraint amount is placed in the numerator position, and the sum of the switching spectral line breakage amount and the natural constant e is placed in the denominator position. The technical principle is to constrain the background perturbation through the breakage characterization, so that anomalies truly caused by spectral line discontinuities will not be obscured. Pure background fluctuation masking; after completing the ratio calculation, add 1 and then take the natural logarithm. The technical principle is to compress the numerical growth rate within the large fluctuation range, so that the disturbance suppression term remains monotonically increasing without excessive expansion when the disturbance constraint is high. Then add it to the natural constant e and 1 to form a stable denominator that is greater than zero, ensuring that the values of subsequent division operations are bounded. Divide the switching mismatch amplification term by the disturbance suppression term and take the arctangent function value to obtain the main evaluation term of the switching deviation. The technical principle of the arctangent function is to compress the continuously increasing quotient value into a finite range, so that even when the effective wavelength mismatch characteristic value is large and the grating switching stable recovery length value is large, it can still be masked. To maintain the continuous monotonic change of the main evaluation value and avoid abrupt jumps in diagnostic results due to extreme large values, the perturbation constraint is added to the natural constant e to obtain the second intermediate value. The switching spectral line breakage is divided by the second intermediate value to obtain the second ratio. The square root of the second ratio is taken to obtain the spectral line breakage compensation term. Here, the switching spectral line breakage is placed in the numerator to highlight the direct contribution of spectral line continuity disruption to the diagnostic results, and the sum of the perturbation constraint and the natural constant e is placed in the denominator to weaken the non-target effects caused by simple environmental fluctuations, communication fluctuations, and light source fluctuations. The square root treatment is used to suppress compensation when the switching spectral line breakage is large. The growth slope of the term makes the compensation process smoother. The main evaluation term for switching deviation is added to the spectral line breakage compensation term to obtain the grating switching deviation diagnostic value. This value comprehensively characterizes the deviation of the set position, the degree of recovery tailing, the degree of spectral line connection disruption, and the background disturbance suppression results during band switching. A higher value indicates a higher probability of grating switching anomalies within the current sampling period. After generating the grating switching deviation diagnostic value, a one-to-one correspondence is established between the sampling period identifier and the grating switching deviation diagnostic value, and written into the diagnostic record sequence for subsequent execution of abnormal switching period determination, anomaly type matching value generation, and anomaly type label determination.
[0039] The specific formula for calculating the raster switching deviation diagnostic value is as follows:
[0040] ;
[0041] In the formula, This indicates the diagnostic value for raster switching deviation. This represents the effective wavelength mismatch characteristic value. This indicates the grating switching stable recovery length value. This indicates the amount of spectral line breakage during switching. This represents the disturbance constraint quantity.
[0042] In this implementation scheme, by incorporating the effective wavelength mismatch characteristic value, grating switching stable recovery length value, switching spectral line breakage amount, and perturbation constraint amount into the same diagnostic expression framework, the grating switching deviation diagnostic value can simultaneously reflect the degree of switching position deviation, recovery tailing degree, spectral line continuity disruption degree, and background perturbation influence degree. This makes the characterization result of the grating switching deviation level more consistent with the actual switching state, thereby enhancing the completeness of the basis for judging abnormal switching cycles and providing stronger discriminative support for the subsequent determination process of abnormal type marking.
[0043] Specifically, the steps for determining whether the current sampling period is an abnormal switching period based on the grating switching deviation diagnostic value are as follows: The grating switching deviation diagnostic value is compared with the deviation threshold. Before comparison, the grating switching deviation diagnostic value corresponding to the current sampling period identifier is read, and then the pre-written deviation threshold is read from the diagnostic parameter area. The deviation threshold is written using a fixed threshold method to maintain the stability of the diagnostic boundary. When the grating switching deviation diagnostic value reaches the deviation threshold, the sampling period identifier of the switching state change sampling point is marked as an abnormal switching period. At this time, an abnormal switching period marker is written to the diagnostic record area. The written content includes the current sampling period identifier, the current grating switching deviation diagnostic value, the current deviation threshold, and the marker generation time. When the grating switching deviation... When the diagnostic value is lower than the deviation threshold, the sampling period of the switching state change sampling point is marked as a normal switching period. At this time, the normal switching period mark is written into the diagnostic record area. The written content includes the current sampling period mark, the current grating switching deviation diagnostic value, the current deviation threshold, and the mark generation time. The technical principle of this judgment method is that the grating switching deviation diagnostic value is used as a unified characterization of the degree of switching abnormality in the current sampling period, and the deviation threshold is used as the abnormal boundary. The effective wavelength mismatch characteristic value, grating switching stable recovery length value, switching spectral line breakage amount, and disturbance constraint amount are aggregated by the previous diagnosis to form a single-value judgment basis, so that the abnormal judgment result of the current sampling period has a clear boundary that can be directly executed.
[0044] In this implementation scheme, by fixing the correspondence between the grating switching deviation diagnostic value and the deviation threshold as a unified judgment boundary, the abnormal attribution result of the current sampling period can have a clear judgment standard, and a stable distinguishing relationship can be formed between the abnormal switching period and the normal switching period, thereby improving the consistency of the abnormal switching period marking result and providing a reliable preliminary basis for the subsequent abnormal type marking determination process.
[0045] In this embodiment, Table 1 is a data table of grating switching deviation diagnostic values, listing the specific data of effective wavelength mismatch characteristic value, grating switching stable recovery length value, switching spectral line breakage, perturbation constraint, and grating switching deviation diagnostic value for five sampling periods. The instrument monitoring data in the table have all been normalized, and the characteristic values of the instrument monitoring data are dimensionless. Specifically: Sampling period 1: Effective wavelength mismatch characteristic value is 0.18, grating switching stable recovery length value is 4, switching spectral line breakage is 0.06, perturbation constraint is 0.22, and grating switching deviation diagnostic value is 0.6644. Sampling period 2: Effective wavelength mismatch characteristic value F is 0.31, grating switching stable recovery length value is 6, switching spectral line breakage is 0.09, perturbation constraint is 0.27, and grating switching deviation diagnostic value is 0.8004. Sampling period 3: Effective wavelength mismatch characteristic value is 0.47, grating switching stable recovery length is 9, switching spectral line breakage is 0.14, perturbation constraint is 0.33, and grating switching deviation diagnostic value is 0.9507. Sampling period 4: Effective wavelength mismatch characteristic value is 0.62, grating switching stable recovery length is 11, switching spectral line breakage is 0.08, perturbation constraint is 0.41, and grating switching deviation diagnostic value is 1.0363. Sampling period 5: Effective wavelength mismatch characteristic value is 0.79, grating switching stable recovery length is 15, switching spectral line breakage is 0.24, perturbation constraint is 0.52, and grating switching deviation diagnostic value is 1.1490.
[0046] Table 1. Diagnostic Values for Raster Switching Deviation
[0047]
[0048] like Figure 3 As shown in the figure, the effective wavelength mismatch characteristic values are displayed over five sampling periods. , raster switching stable recovery length value Switching the amount of spectral line breakage Disturbance constraint Diagnostic value of raster switching deviation The graph illustrates the coupling relationship between the sampling period and the grating switching deviation. The horizontal axis represents the sampling period identifier, the left vertical axis represents the normalized effective wavelength mismatch characteristic value, the grating switching stable recovery length value, the switching spectral line breakage, and the perturbation constraint, and the right vertical axis represents the grating switching deviation diagnostic value. The blue dashed line in the graph represents the deviation threshold, used to determine whether the current sampling period is an abnormal switching period; the blue shaded area represents the abnormal switching period interval corresponding to the grating switching deviation diagnostic value exceeding the deviation threshold; the abnormal marker indicates that the corresponding sampling period has been determined to be an abnormal switching period. As can be seen from the graph, as the sampling period progresses, the effective wavelength mismatch characteristic value, the grating switching stable recovery length value, the switching spectral line breakage, and the perturbation constraint generally show an upward trend, and the grating switching deviation diagnostic value increases synchronously. This graph intuitively reflects the process by which this invention identifies abnormal switching periods by constructing a band switching mismatch characteristic set and quantifying the grating switching deviation level, and also demonstrates the comprehensive effect of each mismatch characteristic value on the grating switching deviation diagnostic value.
[0049] Specifically, the steps for constructing a switching anomaly determination vector and a real-time switching mechanism relationship matrix based on the band switching mismatch feature set of abnormal switching cycles are as follows: Extract the effective wavelength mismatch feature values, grating switching stable recovery length values, switching spectral line breakage, disturbance constraint, and grating switching deviation diagnostic values corresponding to the abnormal switching cycle. The extraction process uses the abnormal switching cycle marking results as the filtering basis. Locate the data record corresponding to the current abnormal switching cycle from the band switching mismatch feature set, and then read the corresponding effective wavelength mismatch feature values, grating switching stable recovery length values, switching spectral line breakage, disturbance constraint, and grating switching deviation diagnostic values according to the sampling cycle identifier, ensuring that the data involved in the determination originate from the same abnormal switching cycle; concatenate the data according to a fixed field order. A switching anomaly determination vector is constructed, with fixed field order: effective wavelength mismatch feature value, grating switching stable recovery length value, switching spectral line breakage, perturbation constraint value, and grating switching deviation diagnostic value. These are then concatenated to form a five-dimensional switching anomaly determination vector, with the fixed field order remaining unchanged. This ensures that the data from the current abnormal switching cycle has a consistent positional meaning in subsequent anomaly mechanism matching processes, preventing distortion of matching results due to changes in the arrangement of the same feature in different determination vectors. Furthermore, based on the ratio and difference relationships between any two feature quantities in the switching anomaly determination vector, a real-time switching mechanism relationship matrix is constructed. This real-time switching mechanism relationship matrix adopts a five-row, five-column matrix structure, with matrix row and column labels based on the effective wavelength mismatch feature value, grating switching stable recovery length value, switching spectral line breakage, perturbation constraint value, and grating switching deviation diagnostic value. The fields for grating switching stable recovery length, switching spectral line breakage, perturbation constraint, and grating switching deviation diagnostic value are arranged in sequence. When the row number is less than the column number, the ratio relationship matrix element is obtained by dividing the corresponding row feature value by the corresponding column feature value. To avoid the denominator being zero, a natural constant e is added to the denominator. When the row number is greater than the column number, the difference relationship matrix element is obtained by subtracting the corresponding column feature value from the corresponding row feature value. When the row number is equal to the column number, the current matrix element is assigned a value of 0. By simultaneously retaining the ratio relationship matrix element and the difference relationship matrix element within the same matrix, the relative proportional offset feature and absolute amplitude offset feature between each feature quantity can be expressed in a single structure. Among them, the ratio relationship is used to characterize the effective wavelength mismatch feature value relative to the grating switching. The proportional amplification relationship of stable recovery length value, switching spectral line breakage, perturbation constraint, and grating switching deviation diagnostic value, and the difference relationship are used to characterize the absolute deviation between each feature quantity. The technical principle of this construction method is that using the switching anomaly judgment vector alone can only characterize the discrete feature value of the current anomaly switching cycle, and cannot fully reveal the inherent linkage mode between different feature quantities. By further constructing a real-time switching mechanism relationship matrix, the relative coupling features between effective wavelength mismatch feature value, grating switching stable recovery length value, switching spectral line breakage, perturbation constraint, and grating switching deviation diagnostic value can be explicitly expressed, thereby providing a structured basis that can be directly compared for subsequent anomaly mechanism prototype library matching and anomaly type labeling determination.
[0050] In this implementation scheme, by organizing the effective wavelength mismatch characteristic value, grating switching stable recovery length value, switching spectral line breakage amount, disturbance constraint amount, and grating switching deviation diagnostic value into a switching anomaly judgment vector, and further forming a real-time switching mechanism relationship matrix, the feature expression corresponding to the abnormal switching cycle can be improved from a single set of numerical values to a discrimination criterion with an inherent correlation structure. This enhances the ability to distinguish between different anomaly types, makes the basis for generating subsequent anomaly type matching values more sufficient, and makes the anomaly type marking results more consistent with the real grating switching state.
[0051] Specifically, the steps for constructing a historical training vector set and anomaly mechanism prototype library based on historical band switching mismatch feature sets are as follows: The most recent K historical band switching mismatch feature sets and corresponding anomaly type markers are read from the grating switching diagnostic database. This grating switching diagnostic database is a repository of diagnostic results continuously accumulated during online operation, designed to store information such as the band switching mismatch feature set, grating switching deviation diagnostic value, anomaly type marker, and its matching value for each sampling period. The data in the grating switching diagnostic database mainly comes from the diagnostic results written back during the aforementioned diagnostic process. These results include: band switching mismatch feature sets such as the wavelength value at the center position of the spectral response, effective wavelength mismatch feature value, grating switching stable recovery length value, switching spectral line breakage amount, and disturbance constraint amount calculated using grating switching influence window data; furthermore, the grating switching deviation diagnostic value is calculated through deviation quantization of the band switching mismatch feature set, and the anomaly type marker and its matching value are derived from the analysis and classification of the anomaly type matching results. By storing and sorting these diagnostic results according to the sampling period identifier and the time the diagnostic results are written, the raster switching diagnostic database can clearly record the abnormal characteristics of historical raster switching, providing subsequent abnormal mechanism analysis and historical sample reference. During reading, the diagnostic results are extracted in order of recent to distant writing time, with K being an integer between 20 and 200. Then, the effective wavelength mismatch feature value, grating switching stable recovery length value, switching spectral line breakage, perturbation constraint, and grating switching deviation diagnostic value from the historical records are loaded one by one using the sampling period identifier as the association key. Based on the historical band switching mismatch feature set, a historical training vector set is constructed. The construction method uses fixed field order concatenation, with the fixed field order set as effective wavelength mismatch feature value, grating switching stable recovery length value, switching spectral line breakage, perturbation constraint, and grating switching deviation diagnostic value, so that each historical record is converted into a five-dimensional historical training vector. Anomaly type marking includes mechanical hysteresis anomaly, response hysteresis anomaly, spectral line breakage anomaly, and perturbation coupling anomaly. The scope of anomaly type marking is limited to the abnormal switching period corresponding to the change of monochromator grating switching state. Anomaly type marking is used to characterize the dominant anomaly mechanism in the grating switching process, and is not used to characterize lamp source attenuation faults, detector drift faults, and temperature control faults that exist independently of the grating switching process.Among them, mechanical hysteresis anomalies are used to characterize the abnormal state of grating position wavelength values after switching, such as back-off offset, repeated positioning offset leading to larger effective wavelength mismatch characteristic values, and larger grating switching stable recovery length values. Response hysteresis anomalies are used to characterize the abnormal state of slow wavelength step sequence recovery and continuously increasing grating switching stable recovery length values after the monochromator grating switching state changes. Spectral line breakage anomalies are used to characterize the abnormal state of significant disruption of the continuity of spectral transmittance, spectral absorbance, and spectral reflectance values between the data segments before and after switching, and larger amounts of spectral line breakage during switching. Perturbation coupling anomalies are used to characterize the output power values of deuterium lamps and tungsten lamps. An abnormal state is characterized by the simultaneous fluctuation of high-voltage level, detector gain level, sample chamber temperature, sample chamber humidity, sample chamber optical path obstruction status, and USB communication status near the change in grating switching status, which superimposes on the switching determination result. Historical training vectors are grouped according to their abnormality type. After grouping, the number of historical training vectors corresponding to each abnormality type is counted. If the number of historical training vectors corresponding to any abnormality type is less than 3, it is not included in the current prototype update. If the number of historical training vectors corresponding to any abnormality type is 3 or more, the arithmetic mean of each dimension of the vector corresponding to that abnormality type is calculated based on its position. The training vectors corresponding to each abnormality type are then calculated. By training vector centers, prototype vectors for mechanical backlash anomalies, response hysteresis anomalies, spectral line breakage anomalies, and perturbation coupling anomalies are obtained. The technical principle of training vector centers lies in expressing the stable center characteristics of this type of anomaly by using the average position of historical samples of the same type of anomaly, thereby weakening the offset influence of individual discrete samples on the prototype representation. Then, based on the ratio and difference relationship between any two feature quantities in the historical training vectors corresponding to each anomaly type, relational matrix templates for mechanical backlash, response hysteresis, spectral line breakage, and perturbation coupling are constructed. The construction process adopts a five-row, five-column matrix structure. Both the sequence number and the column sequence number are arranged according to the effective wavelength mismatch characteristic value, the grating switching stable recovery length value, the switching spectral line breakage amount, the perturbation constraint amount, and the grating switching deviation diagnostic value. When the row number is less than the column number, the ratio relationship matrix element is obtained by dividing the current row characteristic value by the current column characteristic value. To avoid the denominator having a zero value, the natural constant e is added to the denominator position. When the row number is greater than the column number, the difference relationship matrix element is obtained by subtracting the current column characteristic value from the current row characteristic value. When the row number and the column number are the same, the current matrix element is assigned a value of 0. The arithmetic mean of the matrix elements at the corresponding positions of all historical training vectors under the same anomaly type is calculated to form the relationship matrix template corresponding to that anomaly type.The technical principle behind this construction method lies in the fact that anomaly prototype vectors are used to represent the central position of each anomaly type in the single-valued feature space, and relation matrix templates are used to represent the coupling structure between the features within each anomaly type. This allows the anomaly mechanism prototype library to simultaneously possess amplitude and structural reference capabilities, ultimately forming an anomaly mechanism prototype library. This library includes mechanical hysteresis anomaly prototype vectors, response hysteresis anomaly prototype vectors, spectral line breakage anomaly prototype vectors, and perturbation coupling anomaly prototype vectors, as well as mechanical hysteresis relation matrix templates, response hysteresis relation matrix templates, spectral line breakage relation matrix templates, and perturbation coupling relation matrix templates, which are used for subsequent generation of anomaly type matching values and determination of anomaly type labels.
[0052] In this implementation scheme, by limiting the historical band switching mismatch feature set to the range of grating switching-related anomalies, and then constructing anomaly prototype vectors and relation matrix templates using effective wavelength mismatch feature values, grating switching stable recovery length values, switching spectral line breakage amounts, perturbation constraint amounts, and grating switching deviation diagnostic values, a clear mechanism reference system can be formed between mechanical hysteresis anomalies, response hysteresis anomalies, spectral line breakage anomalies, and perturbation coupling anomalies. This improves the coverage of the anomaly mechanism prototype library with real anomaly switching states, makes the basis for subsequent anomaly type matching value discrimination more stable, and makes the anomaly type labeling results more consistent with the actual anomaly distribution characteristics in the grating switching process.
[0053] Specifically, the vector deviation value and matrix relationship difference value are calculated separately to generate anomaly type matching values. The specific steps for determining the anomaly type label based on the anomaly type matching value and issuing self-check and self-correction instructions are as follows: The vector deviation value between the real-time switching anomaly judgment vector and each anomaly prototype vector, and the matrix relationship difference value between the real-time switching mechanism relationship matrix and each relationship matrix template are calculated separately. The vector deviation value is calculated by summing the absolute values of the differences between corresponding elements. Specifically, each element in the real-time switching anomaly judgment vector is subtracted from the corresponding element in the anomaly prototype vector to obtain the element difference. The absolute values of all element differences are then summed to obtain the vector deviation value. The matrix relationship difference value is calculated by summing the absolute values of the differences between corresponding elements. The summation of the absolute values of the differences between matrix elements is specifically achieved by subtracting the corresponding matrix element in the relation matrix template from each matrix element in the real-time switching mechanism relation matrix, obtaining the difference between matrix elements, and then summing the absolute values of all matrix element differences to obtain the matrix relation difference value. Among these, the vector deviation value characterizes the magnitude deviation of the real-time switching anomaly judgment vector relative to the anomaly prototype vector, and the matrix relation difference value characterizes the structural deviation of the real-time switching mechanism relation matrix relative to the relation matrix template. The vector deviation value corresponding to each anomaly prototype vector is added to the matrix relation difference value of the corresponding relation matrix template to obtain the mechanical hysteresis matching value, response hysteresis matching value, spectral line breakage matching value, and perturbation coupling matching value. The summation is then performed... The underlying technical principle is to incorporate the amplitude deviation in the single-value feature space and the coupling deviation in the relational structure space into the same matching scale, so that the anomaly type matching value can simultaneously reflect amplitude mismatch characteristics and structural mismatch characteristics. It compares mechanical hysteresis matching values, response hysteresis matching values, spectral line breakage matching values, and perturbation coupling matching values, and takes the anomaly type corresponding to the minimum value as the anomaly type label for the current anomaly switching cycle. The current anomaly type labels include mechanical hysteresis anomalies, response hysteresis anomalies, spectral line breakage anomalies, and perturbation coupling anomalies. The technical principle of taking the minimum value corresponding to the anomaly type is that the smaller the matching value, the closer the real-time switching anomaly judgment vector and the real-time switching mechanism relation matrix are to the anomaly type corresponding to that anomaly. The system generates anomaly prototype vectors and relation matrix templates to demonstrate that the current anomaly switching cycle better matches the historical mechanism distribution characteristics of this anomaly type. It also generates self-test and self-calibration commands to be issued to the instrument for execution. Specifically, when the anomaly type is marked as mechanical hysteresis, the self-test and self-calibration commands include grating zero-position repositioning, grating switching execution position reset, and wavelength calibration. When the anomaly type is marked as response hysteresis, the self-test and self-calibration commands include grating switching drive timing resetting, grating switching waiting time reset, and wavelength stability confirmation. When the anomaly type is marked as spectral line breakage, the self-test and self-calibration commands include reference spectral line resampling, wavelength calibration, and switching interval rescanning.When the anomaly type is marked as a disturbance coupling anomaly, the self-test and self-calibration commands executed include the light source status retest command, the detector gain reset command, the high voltage level verification command, and the USB communication reconnection command. The self-test and self-calibration commands corresponding to each anomaly type are written into the action field of the control message, and then executed sequentially by the instrument control terminal according to the content of the action field, so that the anomaly type mark can correspond to the specific calibration action range, thereby forming a closed-loop processing link between the anomaly identification result and the calibration execution action. The current abnormal switching cycle identifier, grating switching deviation diagnostic value, abnormality type marker, and corresponding matching value are encapsulated to output grating switching diagnostic result data, which is then written back to the grating switching diagnostic database. The encapsulated content includes the current abnormal switching cycle identifier, grating switching deviation diagnostic value, abnormality type marker, mechanical hysteresis matching value, response hysteresis matching value, spectral line breakage matching value, perturbation coupling matching value, command generation time, and command issuance status marker. During the write-back process, the current abnormal switching cycle identifier is used as the index key to write to the grating switching diagnostic database for subsequent updates to historical band switching mismatch feature sets, abnormal mechanism prototype libraries, and tracking of self-check and self-correction execution results.
[0054] In this implementation scheme, by establishing a unified matching criterion between the real-time switching anomaly determination vector, the real-time switching mechanism relationship matrix, the anomaly prototype vector, and the relationship matrix template, and then directly mapping the anomaly type label to the execution of self-check and self-correction instructions, the anomaly identification results can be extended from the feature discrimination stage to the correction execution stage. This allows mechanical hysteresis anomalies, response hysteresis anomalies, spectral line breakage anomalies, and disturbance coupling anomalies to correspond to clear handling directions, thereby improving the executability of grating switching diagnostic results and giving the grating switching diagnostic result data a more complete closed-loop handling value.
[0055] like Figure 2As shown, the second aspect of the present invention provides an online self-diagnostic system for an ultraviolet-visible-near-infrared spectrophotometer, comprising: a data acquisition and processing module, a switching feature construction module, a grating switching diagnosis module, and a grating anomaly classification module, wherein: the data acquisition and processing module is used to periodically acquire instrument monitoring data, and perform cyclic redundancy check, outlier removal, moving average filtering, and range normalization processing on the instrument monitoring data, and output preprocessed instrument monitoring data; the switching feature construction module is used to generate grating switching influence window data based on the preprocessed instrument monitoring data, calculate the wavelength value at the center position of the spectral line response, the effective wavelength mismatch characteristic value, the grating switching stable recovery length value, the switching spectral line breakage amount, and the perturbation constraint amount, and construct the wave... The system comprises: a band switching mismatch feature set; a grating switching diagnosis module, used to quantify the grating switching deviation level based on the band switching mismatch feature set, obtain the grating switching deviation diagnosis value, and determine whether the current sampling period is an abnormal switching period based on the grating switching deviation diagnosis value; and a grating anomaly classification module, used to construct a switching anomaly judgment vector and a real-time switching mechanism relationship matrix based on the band switching mismatch feature set of the abnormal switching period; construct a historical training vector set and an anomaly mechanism prototype library based on the historical band switching mismatch feature set; calculate the vector deviation value and matrix relationship difference value respectively to generate anomaly type matching value; determine the anomaly type label based on the anomaly type matching value and issue self-check and self-correction instructions; the specific process of the grating anomaly classification module is as follows: Figure 4 As shown.
[0056] In this implementation plan, by incorporating instrument monitoring data processing, band switching mismatch feature set construction, grating switching deviation diagnostic value determination, anomaly type marking discrimination, and self-test and self-calibration command issuance into the same technical link, the effective wavelength mismatch feature value, grating switching stable recovery length value, switching spectral line breakage amount, and disturbance constraint amount can be continuously utilized. This enhances the connection between the abnormal switching cycle identification result and the anomaly type marking result, giving the grating switching diagnostic process a higher level of automation, and enabling the online diagnostic results to directly serve the instrument's operational status recovery.
[0057] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0058] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.
Claims
1. A self-test diagnostic method for an online ultraviolet-visible-near-infrared spectrophotometer, characterized in that: Includes the following steps: S1 periodically collects instrument monitoring data and performs cyclic redundancy check, outlier removal, moving average filtering and range normalization on the instrument monitoring data, and outputs the preprocessed instrument monitoring data. S2, based on the preprocessed instrument monitoring data, generate grating switching influence window data, calculate the wavelength value at the center position of the spectral response, the effective wavelength mismatch characteristic value, the grating switching stable recovery length value, the switching spectral line breakage amount and the disturbance constraint amount, and construct a band switching mismatch feature set; S3, quantize the grating switching deviation level based on the band switching mismatch feature set to obtain the grating switching deviation diagnostic value, and determine whether the current sampling period is an abnormal switching period based on the grating switching deviation diagnostic value; S4, construct a handover anomaly determination vector and a real-time handover mechanism relationship matrix based on the band handover mismatch feature set of abnormal handover period; Based on the historical band switching mismatch feature set, a historical training vector set and an anomaly mechanism prototype library are constructed; the vector deviation value and matrix relationship difference value are calculated respectively to generate anomaly type matching value; based on the anomaly type matching value, the anomaly type label is determined and the self-check and self-correction instructions are issued.
2. The online self-test diagnostic method for ultraviolet-visible-near-infrared spectrophotometer according to claim 1, characterized in that: The specific steps for periodically collecting instrument monitoring data and performing cyclic redundancy check, outlier removal, moving average filtering, and range normalization on the instrument monitoring data, and outputting the preprocessed instrument monitoring data are as follows: The system controls the UV-Vis-NIR spectrophotometer to perform online initialization. After initialization, a fixed-duration sliding time window is set as a sampling period to periodically collect instrument monitoring data from the UV-Vis-NIR spectrophotometer. The instrument monitoring data includes sampling period identifier, spectral transmittance value, spectral absorbance value, spectral reflectance value, deuterium lamp output power value, tungsten lamp output power value, grating position wavelength value, monochromator grating switching status, sample chamber temperature value, sample chamber humidity value, high voltage level value, detector gain level value, sample chamber optical path obstruction status, and USB communication status value. For the collected instrument monitoring data, the cyclic redundancy check algorithm is used to perform integrity and transmission error checks on the instrument monitoring data messages; the box plot outlier detection algorithm is used to perform outlier identification and removal processing on the instrument monitoring data; the moving average filtering algorithm is used to perform random noise suppression and smoothing processing on the continuous changes in the instrument monitoring data; and the range normalization algorithm is used to perform uniform scale standardization processing on the instrument monitoring data, outputting the preprocessed instrument monitoring data.
3. The online self-test diagnostic method for ultraviolet-visible-near-infrared spectrophotometer according to claim 2, characterized in that: The specific steps for generating raster switching influence window data based on preprocessed instrument monitoring data are as follows: The preprocessed instrument monitoring data are grouped according to the sampling period identifier; when the monochromator grating switching state changes, the instrument monitoring data of N consecutive sampling points before and after the corresponding sampling point are extracted to generate grating switching influence window data.
4. The online self-test diagnostic method for ultraviolet-visible-near-infrared spectrophotometer according to claim 2, characterized in that: The specific steps for calculating the wavelength value at the center position of the spectral line response, the effective wavelength mismatch characteristic value, the grating switching stable recovery length value, the switching spectral line breakage amount, and the perturbation constraint amount, and constructing the band switching mismatch characteristic set are as follows: The wavelength values of adjacent grating positions in the grating switching influence window data are differentially calculated to obtain a wavelength step sequence; the wavelength step values of M adjacent sampling points before the switching state change sampling point are calculated, and the median of the M wavelength step values is taken to obtain a step reference value; continuous sampling points with an absolute value of the difference from the step reference value not greater than a preset difference range are extracted from the wavelength step sequence, and the number of sampling points between the switching state change sampling point and the starting point of the continuous sampling points is determined as the grating switching stable recovery length value. In the grating switching influence window data, the spectral transmittance, spectral absorbance and spectral reflectance values are compared point by point for three adjacent sampling points. Candidate feature points whose values at the middle sampling point are greater than or less than the values of the two adjacent sampling points are extracted. The sum of the absolute values of the numerical differences between each candidate feature point and the two adjacent sampling points is calculated. The grating position wavelength value corresponding to the candidate feature point with the largest sum of absolute values of numerical differences is determined as the wavelength value of the center position of the spectral line response. The initial effective wavelength mismatch value is obtained by subtracting the wavelength value at the center position of the spectral response from the wavelength value at the sampling point of the switching state change and taking the absolute value; the square root of the grating switching stable recovery length value is multiplied by the recovery influence coefficient to obtain the recovery mismatch gain term; the initial effective wavelength mismatch value is added to the recovery mismatch gain term to obtain the effective wavelength mismatch characteristic value. Using the sampling points of the switching state change as the boundary, the data of the grating switching influence window is divided into the data segment before switching and the data segment after switching; the absolute values of the difference between the mean values of spectral transmittance, spectral absorbance, and spectral reflectance of the data segments before and after switching are calculated respectively, and the average of the three is obtained to obtain the amount of switching spectral line breakage. Calculate the absolute values of the differences between the deuterium lamp output power, tungsten lamp output power, high voltage level, detector gain level, sample chamber temperature, and sample chamber humidity at the current sampling point and the corresponding mean values in the grating switching influence window data. Then, convert the sample chamber optical path occlusion state and USB communication state values into binary correction values and average them with the absolute values of the differences to obtain the disturbance constraint value. The sampling period identifier, wavelength value at the center position of the spectral line response, effective wavelength mismatch characteristic value, grating switching stable recovery length value, switching spectral line breakage amount and disturbance constraint amount are encapsulated and stored, and the band switching mismatch characteristic set is output.
5. The online self-test diagnostic method for ultraviolet-visible-near-infrared spectrophotometer according to claim 1, characterized in that: The specific steps for quantizing the grating switching deviation level based on the band switching mismatch feature set to obtain the grating switching deviation diagnostic value are as follows: Read the band switching mismatch feature set, add the square root of the grating switching stable recovery length value to the effective wavelength mismatch feature value to obtain the switching mismatch amplification term; add the switching spectral line breakage amount to the natural constant e to obtain the first intermediate value; divide the perturbation constraint amount by the first intermediate value to obtain the first ratio; add the first ratio to 1 and take the natural logarithm to obtain the logarithmic result; add the logarithmic result, the natural constant e, and 1 to obtain the perturbation suppression term; divide the switching mismatch amplification term by the perturbation suppression term and take the arctangent function value to obtain the main evaluation term of the switching deviation; add the perturbation constraint amount to the natural constant e to obtain the second intermediate value; divide the switching spectral line breakage amount by the second intermediate value to obtain the second ratio; take the square root of the second ratio to obtain the spectral line breakage compensation term; add the main evaluation term of the switching deviation and the spectral line breakage compensation term to obtain the grating switching deviation diagnostic value.
6. The online self-test diagnostic method for an ultraviolet-visible-near-infrared spectrophotometer according to claim 2, characterized in that: The specific steps for determining whether the current sampling period is an abnormal switching period based on the grating switching deviation diagnostic value are as follows: The diagnostic value of the grating switching deviation is compared with the deviation threshold. When the diagnostic value of the grating switching deviation is greater than or equal to the deviation threshold, the sampling period of the sampling point of the switching state change is marked as an abnormal switching period; when the diagnostic value of the grating switching deviation is less than the deviation threshold, the sampling period of the sampling point of the switching state change is marked as a normal switching period.
7. The online self-test diagnostic method for an ultraviolet-visible-near-infrared spectrophotometer according to claim 1, characterized in that: The specific steps for constructing the handover anomaly determination vector and the real-time handover mechanism relationship matrix based on the band handover mismatch feature set of the abnormal handover period are as follows: The effective wavelength mismatch feature value, grating switching stable recovery length value, switching spectral line breakage amount, disturbance constraint amount and grating switching deviation diagnostic value corresponding to the abnormal switching cycle are extracted and concatenated in a fixed field order to construct a switching anomaly judgment vector; and a real-time switching mechanism relationship matrix is constructed based on the ratio and difference relationship between any two feature values in the switching anomaly judgment vector.
8. The online self-test diagnostic method for ultraviolet-visible-near-infrared spectrophotometer according to claim 1, characterized in that: The specific steps for constructing a historical training vector set and anomaly mechanism prototype library based on the historical band switching mismatch feature set are as follows: The K most recent historical band switching mismatch feature sets and corresponding anomaly type labels are read from the grating switching diagnostic database, and a historical training vector set is constructed based on the historical band switching mismatch feature sets. The anomaly type labels include mechanical backlash anomalies, response hysteresis anomalies, spectral line breakage anomalies, and perturbation coupling anomalies. The historical training vectors are grouped according to the anomaly type labels, and the training vector center corresponding to each anomaly type is calculated to obtain the prototype vectors of mechanical backlash anomalies, response hysteresis anomalies, spectral line breakage anomalies, and perturbation coupling anomalies. Then, based on the ratio and difference relationship between any two feature quantities in the historical training vectors corresponding to each anomaly type, mechanical backlash relationship matrix templates, response hysteresis relationship matrix templates, spectral line breakage relationship matrix templates, and perturbation coupling relationship matrix templates are constructed to form an anomaly mechanism prototype library.
9. The online self-test diagnostic method for an ultraviolet-visible-near-infrared spectrophotometer according to claim 8, characterized in that: The specific steps for calculating vector deviation values and matrix relationship difference values to generate anomaly type matching values, determining anomaly type markers based on anomaly type matching values, and issuing self-check and self-correction instructions are as follows: Calculate the vector deviation between the real-time switching anomaly judgment vector and each anomaly prototype vector, and the matrix relationship difference between the real-time switching mechanism relationship matrix and each relationship matrix template. Add the vector deviation corresponding to each anomaly prototype vector to the matrix relationship difference of the corresponding relationship matrix template to obtain the mechanical backlash matching value, the response hysteresis matching value, the spectral line breakage matching value, and the disturbance coupling matching value. Compare the mechanical hysteresis matching value, response hysteresis matching value, spectral line breakage matching value, and disturbance coupling matching value, take the anomaly type corresponding to the minimum value as the anomaly type mark of the current anomaly switching cycle, and generate and send self-test and self-calibration instructions to the instrument for execution; The current abnormal switching cycle identifier, raster switching deviation diagnostic value, abnormal type marker, and corresponding matching value are encapsulated, and the raster switching diagnostic result data is output and written back to the raster switching diagnostic database.
10. An online self-diagnostic system for ultraviolet-visible-near-infrared spectrophotometers, characterized in that: include: The module comprises a data acquisition and processing module, a switching feature construction module, a grating switching diagnosis module, and a grating anomaly classification module, among which: The data acquisition and processing module is used to periodically acquire instrument monitoring data, and perform cyclic redundancy check, outlier removal, moving average filtering and range normalization on the instrument monitoring data, and output the preprocessed instrument monitoring data. The switching feature construction module is used to generate grating switching influence window data based on preprocessed instrument monitoring data, calculate the wavelength value at the center position of the spectral response, the effective wavelength mismatch feature value, the grating switching stable recovery length value, the switching spectral line breakage amount and the disturbance constraint amount, and construct a band switching mismatch feature set. The grating switching diagnostic module is used to quantify the grating switching deviation level based on the band switching mismatch feature set, obtain the grating switching deviation diagnostic value, and determine whether the current sampling period is an abnormal switching period based on the grating switching deviation diagnostic value. The grating anomaly classification module is used to construct a switching anomaly determination vector and a real-time switching mechanism relationship matrix based on the band switching mismatch feature set of the anomaly switching period; Based on the historical band switching mismatch feature set, a historical training vector set and an anomaly mechanism prototype library are constructed; the vector deviation value and matrix relationship difference value are calculated respectively to generate anomaly type matching value; based on the anomaly type matching value, the anomaly type label is determined and the self-check and self-correction instructions are issued.