A model construction method and system for adaptive correction of instrument detection deviation

CN122926231APending Publication Date: 2026-10-16JCHX MINING MANAGEMENT
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610988087.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-03
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0004]然而,基于传统最小二乘法的线性校正模型采用固定参数拟合方式,无法对采集数据进行有效性筛选与加权处理,模型易受人工标定误差、仪表瞬时故障等异常脏数据污染,同时不能跟随生产工艺变化实现自适应迭代更新,最终导致校正精度下降、抗干扰能力不足,无法长期稳定满足工业现场高精度检测与可靠校正的使用需求

Benefits of technology

[0022] Fourthly, a computer-readable storage medium is provided, including computer instructions that, when executed on an electronic device, cause the electronic device to perform a method as described in any implementation of the first aspect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122926231A_ABST
    Figure CN122926231A_ABST
Patent Text Reader

Abstract

The application provides a model construction method and system for self-adaptive correction of instrument detection deviation, and relates to the technical field of industrial automation detection. The method comprises the following steps: establishing a benchmark model based on detection data and target output data of an online detection instrument to obtain initial linear model parameters; performing data cleaning on newly obtained detection data and target output data, and iteratively updating the benchmark model by using effective data after cleaning; calculating corresponding weights according to residual errors of each data point in the benchmark model; constructing a diagonal weight matrix by using the weights, fitting to obtain final linear model parameters by using a weighted least square method, and outputting a correction result. The application can realize online, self-adaptive and robust correction of industrial instrument detection deviation by removing abnormal data through data cleaning, dynamically and iteratively tracking process changes through the benchmark model, and mainly trusting high-reliability data through the weighted least square method, and the calculation amount is controllable and suitable for a limited resource environment such as a DCS controller.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial automation testing technology, and in particular to a model construction method and system for adaptively correcting instrument detection deviations. Background Technology

[0002] In industrial automated production, online monitoring instruments serve as core equipment for process parameter monitoring and process control. Their output accuracy directly affects production stability and product quality. Affected by factors such as fluctuations in operating conditions, changes in media characteristics, differences in installation conditions, and equipment aging, there is a common deviation between the instrument's measured values ​​and the actual physical values. Such deviations can lead to inaccurate process control, distorted material measurement, and even production safety risks. How to stably and reliably correct instrument measurement deviations online has always been an important problem that needs to be solved in the field of industrial monitoring and control.

[0003] To mitigate the impact of instrument detection deviations, the industry typically employs the least squares method to construct a linear correction model. This method uses instrument detection data as input and establishes a linear relationship by fitting the slope and intercept parameters, making the model output approximate the true value. Due to its simplicity and ease of calculation, this method is widely used in deviation correction scenarios for various instruments such as flow rate, concentration, and particle size.

[0004] However, the linear calibration model based on the traditional least squares method uses a fixed parameter fitting method, which cannot perform effective screening and weighting of the collected data. The model is susceptible to contamination by abnormal dirty data such as manual calibration errors and instantaneous instrument failures. At the same time, it cannot adapt to changes in production processes and achieve adaptive iterative updates, ultimately leading to a decrease in calibration accuracy and insufficient anti-interference ability, and failing to meet the long-term stable requirements of high-precision detection and reliable calibration in industrial settings. Summary of the Invention

[0005] This invention provides a model construction method and system for adaptively correcting instrument detection deviations. By constructing a dynamically updated benchmark model and combining data cleaning and weighted least squares method, the model achieves self-iterative optimization and anti-interference capability, effectively tracks process changes, and significantly improves correction accuracy and reliability.

[0006] To achieve the above objectives, the embodiments of the present invention adopt the following technical solutions: Firstly, a method for adaptively correcting instrument detection deviations is provided. The method includes: establishing a benchmark model based on the detection data and target output data of online detection instruments to obtain initial linear model parameters; cleaning the newly acquired detection data and target output data, iteratively updating the benchmark model with the cleaned effective data to obtain updated model parameters; calculating corresponding weights based on the residuals between the model prediction values ​​of each data point in the benchmark model and the target output data; constructing a diagonal weight matrix using the weights, fitting the final linear model parameters using the weighted least squares method, and outputting correction results for the input instrument detection data based on the final linear model parameters.

[0007] The beneficial effects of this invention are as follows: The method provided by this invention, through a complete process of establishing a benchmark model, data cleaning and iterative updating, weight calculation, and weighted least squares solution, overcomes the limitation of existing fixed models that cannot adapt. The data cleaning step can effectively remove abnormal data such as human error and instrument failure, ensuring that the model is not contaminated; the dynamic iteration of the benchmark model enables the model to continuously track changes in process conditions and achieve self-updating; the weight calculation based on residuals and the use of weighted least squares method make high-reliability data contribute more to the model, significantly improving the correction accuracy. At the same time, through the data cleaning and iterative update mechanism, the operability in environments with limited resources such as DCS controllers is ensured, realizing online, adaptive, and robust correction of industrial instrument detection deviations.

[0008] In one possible implementation of the first aspect, the step of establishing a benchmark model based on the detection data of online testing instruments and the target output data to obtain initial linear model parameters includes: if there is a physical function relationship between the detection data and the target output data, then acquiring instrument detection data covering normal operating conditions, calculating the corresponding theoretical value through the physical function relationship, superimposing a normally distributed random error on each theoretical value to form an initial dataset, and fitting the initial linear model parameters using ordinary least squares; if there is no physical function relationship between the detection data and the target output data, then collecting synchronous data pairs of instrument detection data and manually calibrated data, fitting the initial model using ordinary least squares, calculating the residuals of each data point, iteratively deleting the data row with the largest residual and refitting, until the residuals of all data points are less than a preset threshold or the dataset size reaches a preset size, to obtain the initial linear model parameters.

[0009] The method provided by this invention offers two baseline model initialization approaches, applicable to different scenarios where physical relationships are clear and those where physical relationships are difficult to solve. The former utilizes physical formulas and small random errors to construct the initial dataset, ensuring the model has a physical basis from the outset; the latter purifies the dataset by iteratively removing the data rows with the largest residuals, ensuring the initial model is built on highly reliable data and avoiding contamination by outliers.

[0010] In one possible implementation of the first aspect, the step of cleaning the newly acquired detection data and target output data, and iteratively updating the benchmark model using the cleaned valid data to obtain updated model parameters, includes: calculating the predicted value and corresponding residual of the newly acquired data using the current benchmark model; determining whether the newly acquired data is an outlier based on the residual statistical distribution of the current benchmark model dataset; if determined to be valid data, adding the newly acquired data to the benchmark model dataset and refitting to update the model parameters; if determined to be an outlier, removing the newly acquired data while keeping the benchmark model unchanged; wherein, for the benchmark model established through the physical function relationship, the expanded dataset is directly refitted; for the benchmark model established through the synchronized data pair, the newly acquired data is used to replace the data row with the largest current residual in the benchmark model dataset before refitting, so that the size of the benchmark model dataset remains constant.

[0011] The method provided in this invention designs corresponding iterative strategies for the two benchmark model establishment methods. For models established based on physical function relationships, the method of directly refitting by expanding the dataset is adopted to make full use of prior physical knowledge; for models established by data-driven methods, the method of replacing the data row with the largest residual is adopted to keep the size of the benchmark model dataset constant, avoid the infinite growth of computation, ensure the real-time performance of the control system, and at the same time, allow new high-quality process data to be continuously added while old data is automatically forgotten, so as to achieve adaptive tracking of process changes by the model.

[0012] In one possible implementation of the first aspect, the determination of whether the newly acquired data is an outlier based on the residual statistical distribution of the current benchmark model dataset adopts any of the following rules: Calculate the standard deviation σ of the residuals for all data points in the current benchmark model dataset, when |e new When |>3σ, the newly acquired data is determined to be an outlier, where e new The deviation between the model's predicted values ​​and the target output data for newly acquired data; Calculate the interquartile range (IQR) of all residuals in the current baseline model dataset, when the residuals of the newly acquired data satisfy... or When the value is Q3, it is considered an outlier, where Q3 is the upper quartile and Q1 is the lower quartile.

[0013] The method provided by this invention supports two data cleaning rules: the 3σ criterion and the IQR rule. The 3σ criterion is relatively lenient, balancing robustness with sensitivity to process changes, and is suitable for scenarios where both manual recording and instrument testing exhibit some fluctuations. The IQR rule is more sensitive to outliers and has stricter standards, making it suitable for scenarios with higher data accuracy requirements. Both rules can be flexibly selected to meet the anti-interference needs of different application scenarios.

[0014] In one possible implementation of the first aspect, the weights are negatively correlated with the residual magnitude of the corresponding data points, and the weight W(e^(i-1)) of the i-th data point in the benchmark model dataset... i The formula for calculating ) is: when hour, ; when At that time, the weight W(e) i )=0; Among them, e i σ is the residual of the i-th data point in the benchmark model dataset, σ is the standard deviation of the residuals of all data points in the benchmark model dataset, and k is a preset tuning constant.

[0015] The method provided in this invention uses Tukey's Biweight function for weight calculation. This function has the characteristic that the larger the residual, the smaller the weight, and the weight becomes zero when the residual exceeds a threshold, thus completely excluding outliers. Compared with simple inverse proportional weights, this function has good statistical robustness and can effectively reduce the impact of high residual data on the fitting results without completely eliminating marginal data.

[0016] In one possible implementation of the first aspect, the step of constructing a diagonal weight matrix using weights and fitting the final linear model parameters using weighted least squares includes: constructing a diagonal weight matrix with the weights of each data point in the benchmark model dataset as diagonal elements; constructing a design matrix and an observation vector based on the benchmark model dataset; and solving for the weighted least squares solution based on the diagonal weight matrix, the design matrix, and the observation vector to obtain the final linear model parameters.

[0017] The method provided by this invention constructs a diagonal weight matrix and uses weighted least squares for final fitting, which allows high-weight (high-reliability) data points to play a greater role in parameter solving, while suppressing the contribution of low-weight data points, thereby further improving the accuracy and robustness of model parameters at the fitting level.

[0018] In one possible implementation of the first aspect, the method further includes: comparing the final linear model parameters with a preset physical reasonable range; if the final linear model parameters fall within the physical reasonable range, the verification is deemed successful, and the current final linear model parameters are used to output a correction result for the input instrument detection data, wherein the physical reasonable range is preset according to the inherent physical characteristics of the process equipment; if the final linear model parameters exceed the physical reasonable range, the verification is deemed unsuccessful, an alarm is triggered, and the correction result is output using the model parameters that passed the verification in the last instance.

[0019] The method provided by this invention prevents the risk of meaningless parameters being output by the model due to collective data anomalies by introducing a parameter physical rationality verification and alarm mechanism. When the model parameters exceed the reasonable range set based on the inherent physical characteristics of the process equipment, the system rejects the abnormal parameters and continues to use the valid parameters that passed the verification last time. At the same time, an alarm is triggered to notify the staff to intervene and check, which increases the safety boundary of the system and avoids control chaos caused by error correction.

[0020] Secondly, the present invention provides a model building system for adaptively correcting instrument detection deviations. The system includes: a benchmark model initialization module, used to establish a benchmark model based on the detection data of online detection instruments and the target output data, and obtain initial linear model parameters; a data cleaning and iteration module, used to clean the newly acquired detection data and the target output data, and iteratively update the benchmark model using the cleaned effective data to obtain updated model parameters; a weight calculation module, used to calculate the corresponding weights based on the residuals between the model prediction values ​​of each data point in the benchmark model and the target output data; and a weighted fitting module, used to construct a diagonal weight matrix using the weights, fit the final linear model parameters using the weighted least squares method, and output correction results for the input instrument detection data based on the final linear model parameters.

[0021] Thirdly, an electronic device is provided, the electronic device including a memory and one or more processors; the memory is coupled to the processors; wherein the memory stores computer program code, the computer program code including computer instructions, which, when executed by the processor, cause the electronic device to perform the method as described in any implementation of the first aspect.

[0022] Fourthly, a computer-readable storage medium is provided, including computer instructions that, when executed on an electronic device, cause the electronic device to perform a method as described in any implementation of the first aspect.

[0023] Understandably, the beneficial effects of the system of the second aspect, the electronic device of the third aspect, and the computer-readable storage medium of the fourth aspect provided above can be referenced to the beneficial effects of the first aspect and any of its possible design embodiments, which will not be repeated here. Attached Figure Description

[0024] Figure 1 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention; Figure 2 A flowchart illustrating a model construction method for adaptively correcting instrument detection deviation provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of a model building system provided in an embodiment of the present invention. Detailed Implementation

[0025] The technical solutions of the embodiments of the present invention will be described below with reference to the accompanying drawings. In the description of the present invention, unless otherwise stated, " / " indicates that the objects before and after are in an "or" relationship. For example, A / B can represent A or B. The "or" in the present invention is merely a description of the relationship between the related objects, indicating that three relationships can exist. For example, A or B can represent: A alone, A and B simultaneously, and B alone. A and B can be singular or plural. Furthermore, in the description of the present invention, unless otherwise stated, "multiple" refers to two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items.

[0026] Furthermore, to facilitate a clear description of the technical solutions of the embodiments of the present invention, the terms "first" and "second" are used in the embodiments of the present invention to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and that the terms "first" and "second" are not necessarily different.

[0027] In this embodiment of the invention, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" or "for example" in this embodiment of the invention should not be construed as superior or more advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner for ease of understanding.

[0028] In industrial automated production, online monitoring instruments serve as core equipment for process parameter monitoring and process control. Their output accuracy directly affects production stability and product quality. Affected by factors such as fluctuations in operating conditions, changes in media characteristics, differences in installation conditions, and equipment aging, there is a common deviation between the instrument's measured values ​​and the actual physical values. Such deviations can lead to inaccurate process control, distorted material measurement, and even production safety risks. How to stably and reliably correct instrument measurement deviations online has always been an important problem that needs to be solved in the field of industrial monitoring and control.

[0029] To mitigate the impact of instrument detection deviations, the industry typically employs the least squares method to construct a linear correction model. This method uses instrument detection data as input and establishes a linear relationship by fitting the slope and intercept parameters, making the model output approximate the true value. Due to its simplicity and ease of calculation, this method is widely used in deviation correction scenarios for various instruments such as flow rate, concentration, and particle size.

[0030] However, the linear calibration model based on the traditional least squares method uses a fixed parameter fitting method, which cannot perform effective screening and weighting of the collected data. The model is susceptible to contamination by abnormal dirty data such as manual calibration errors and instantaneous instrument failures. At the same time, it cannot adapt to changes in production processes and achieve adaptive iterative updates, ultimately leading to a decrease in calibration accuracy and insufficient anti-interference ability, and failing to meet the long-term stable requirements of high-precision detection and reliable calibration in industrial settings.

[0031] In view of this, embodiments of the present invention provide a model construction method and system for adaptively correcting instrument detection deviations. This method, by constructing a dynamically updated benchmark model and combining data cleaning with weighted least squares, achieves self-iterative optimization and anti-interference capabilities, effectively tracks process changes, and significantly improves correction accuracy and reliability.

[0032] In some embodiments, the adaptive correction instrument detection deviation model building method provided by the present invention can be executed by an adaptive correction instrument detection deviation model building system (hereinafter referred to as model building system 100).

[0033] As an example, the model building system 100 can be any electronic device with data processing capabilities, such as a DCS (Distributed Control System) controller, a general-purpose computer, a personal computer, a laptop computer, an industrial control computer, or a tablet computer. The specific implementation method of the model building system is not limited here.

[0034] Figure 1 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention is shown. The electronic device 200 includes a processor 210, a memory 220, and a communication interface 230.

[0035] Processor 210 may include one or more processing cores. Processor 210 connects to various parts within electronic device 200 using various interfaces and lines, and performs various functions and processes data of electronic device 200 by running or executing instructions, programs, code sets, or instruction sets stored in memory 220, and by calling data stored in memory 220. Optionally, processor 210 may be implemented using at least one of the following hardware forms: Central Processing Unit (CPU), Graphics Processing Unit (GPU), Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA).

[0036] The memory 220 may include random access memory (RAM) or read-only memory (ROM). Optionally, the memory 220 may include a non-transitory computer-readable storage medium. The memory 220 may be used to store instructions, programs, code, code sets, or instruction sets. The memory 220 may include a program storage area. This program storage area may store instructions for implementing an operating system, instructions for implementing at least one function, instructions for implementing the various method embodiments described above, etc.

[0037] Communication interface 230 is used to communicate with other devices, equipment or communication networks, such as data storage devices, image processing devices or Ethernet, wireless access network (RAN), wireless local area network (WLAN), etc.

[0038] In terms of physical implementation, the aforementioned devices (such as processor 210, memory 220, and communication interface 230) can each be devices within the same device (such as a laptop computer). Alternatively, at least two of these devices can be located within the same device, i.e., as different devices within the same device, similar to the deployment of devices or components in a distributed system.

[0039] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 200. In other embodiments of the present invention, the electronic device 200 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0040] The following description, in conjunction with the accompanying drawings, illustrates a model construction method for adaptively correcting instrument detection deviations provided by an embodiment of the present invention.

[0041] Figure 2 A flowchart illustrating a model construction method for adaptively correcting instrument detection deviations, provided in an embodiment of the present invention. The method includes the following steps: S1. Establish a benchmark model based on the detection data and target output data of the online detection instrument to obtain the initial linear model parameters.

[0042] In some embodiments, S1 above initializes the baseline model in one of two ways, depending on whether there is a physical function relationship between the detection data and the target output data.

[0043] Method 1: If there is a physical function relationship between the detection data and the target output data, then obtain instrument detection data covering normal working conditions, calculate the corresponding theoretical value through the physical function relationship, and superimpose a normally distributed random error on each theoretical value to form an initial dataset. Use ordinary least squares method to fit and obtain the initial linear model parameters. Specifically, online monitoring instruments continuously output measured values ​​during the production process, which constitute the monitoring data. Monitoring data can be a vector consisting of one or more related measured values. For example, for a particle size analyzer, monitoring data includes the average particle size and standard deviation; for flow calibration, monitoring data includes the cumulative flow rate and average concentration. Target output data refers to the process parameters that are expected to be closer to the physical reality, such as -200 mesh content or dry ore quantity. In practical applications, the clarity of the relationship between the monitoring data and the target output data determines the initialization method of the baseline model.

[0044] When a physical function relationship exists between the detected data and the target output data, it indicates that the quantitative relationship between the two can be directly expressed by physical laws. Using this physical function relationship, the corresponding theoretical values ​​are calculated for each piece of instrument detection data covering normal operating conditions. To simulate unavoidable measurement noise and minor disturbances in the real environment, a small random error following a normal distribution N(0,σ) is superimposed on each theoretical value, thus constructing an initial dataset that more closely resembles actual operating conditions. Subsequently, based on this initial dataset, the initial linear model parameters are fitted using ordinary least squares. The essence of this initialization method is to use existing physical prior knowledge to provide a physically interpretable starting point for the model, ensuring that the model is built on physical principles from the outset, rather than blindly exploring from scratch. When establishing the baseline model, a set of manually recorded actual material consumption data from the work group can be selected from historical data as the target output data, and the corresponding cumulative values ​​calculated by the DCS system based on online flow, concentration, and specific gravity can be used as the detection data. A simplified linear model Y=kX is used, and the initial proportionality coefficient k=mean(Y) / mean(X) is calculated to complete the initialization of the baseline model.

[0045] Method 2: If there is no physical function relationship between the detection data and the target output data, then collect synchronous data pairs of instrument detection data and manual calibration data, use ordinary least squares method to fit the initial model, calculate the residual of each data point, iteratively delete the data row with the largest residual and refit until the residual of all data points is less than the preset threshold or the dataset size reaches the preset size, and obtain the initial linear model parameters.

[0046] Specifically, when there is no physical functional relationship between the detection data and the target output data, it indicates that the quantitative relationship between the two is difficult to solve directly using physical laws. In this case, it is necessary to rely on actually collected data pairs to build the model, namely, synchronous data pairs of instrument detection data and manually calibrated data. The instrument detection data consists of the output values ​​of online instruments at various times, while the manually calibrated data consists of the actual process parameter values ​​at the corresponding times obtained through manual sampling, screening, or chemical testing. Based on these synchronous data pairs, an initial model is first fitted using ordinary least squares. Then, the residual for each data point is calculated, which is the deviation between the model's predicted value and the target output data. To eliminate outlier data that may be introduced by human detection errors or momentary instrument malfunctions, the data rows with the largest residuals are iteratively deleted, and the model is refitted until the residuals of all data points are less than a preset threshold, or the dataset size reaches a preset size, such as stabilizing between 30 and 50 rows. At this point, the final initial linear model parameters are obtained. The essence of this initialization method is to repeatedly purify the dataset to ensure that the initial model is built on highly reliable data, avoiding contamination of the initial model by outliers.

[0047] With the above two initialization methods, regardless of whether there is a physical functional relationship between the detection data and the target output data, a set of initial linear model parameters with sufficient statistical significance can be obtained, laying a reliable foundation for subsequent data cleaning, iterative updates and weighted regression.

[0048] S2. Perform data cleaning on the newly acquired detection data and target output data, and iteratively update the benchmark model using the cleaned effective data to obtain the updated model parameters.

[0049] In some embodiments, the above-mentioned S2 specifically includes: The predicted values ​​and corresponding residuals of the newly acquired data are calculated using the current benchmark model. Based on the residual statistical distribution of the current benchmark model dataset, it is determined whether the newly acquired data is an outlier. If it is determined to be valid data, the newly acquired data is added to the benchmark model dataset, and the model is refitted to update the model parameters. If it is determined to be an outlier, the newly acquired data is removed. In this case, no data replacement operation is performed, and the benchmark model remains unchanged. Specifically, for the benchmark model established through the physical function relationship, the expanded dataset is directly refitted. For the benchmark model established through the synchronized data pair, the newly acquired data is used to replace the data row with the largest current residual in the benchmark model dataset before refitting, so that the size of the benchmark model dataset remains constant.

[0050] Specifically, data cleaning refers to the process of validating newly added data according to specific statistical rules to determine whether to include it in the baseline model. During production operation, whenever a new set of detection data and target output data is obtained, the current baseline model is first used to calculate a predicted value for the newly acquired detection data. This involves performing a linear operation between the current model parameters and the detection data to obtain the model's predicted output. This predicted value is then compared with the newly acquired target output data to obtain the corresponding residual. The residual reflects the degree of deviation of the current baseline model from the new data. A larger residual indicates that the new data deviates further from the current model's pattern, and is more likely to be abnormal data caused by factors such as measurement errors, instrument malfunctions, or operational abnormalities.

[0051] Subsequently, a statistical distribution is constructed based on the residuals of all data points in the current benchmark model dataset. A statistic reflecting the overall dispersion of the dataset is calculated, and an outlier determination boundary is set accordingly. If the residuals of newly acquired data fall within the determination boundary, the data is considered to be consistent with the data distribution of the current benchmark model and is determined to be valid data; if the residuals of newly acquired data exceed the determination boundary, the data is considered to deviate significantly from the normal range in a statistical sense and is determined to be an outlier.

[0052] If the newly acquired data is deemed valid, it is formally incorporated into the baseline model dataset, and then refitted to update the model parameters, allowing the model to absorb the new process information. If the data is deemed an outlier, it is discarded and not included in the baseline model. The baseline model's dataset and parameters remain unchanged, thus preventing outlier data from contaminating the model.

[0053] It should be noted that different iterative strategies are employed when refitting to update model parameters, depending on the initialization method of the baseline model. If the baseline model is established through physical functional relationships, the newly acquired data, after cleaning, is directly appended to the existing baseline model dataset. The expanded dataset is then used to refit the linear model using ordinary least squares, updating the model parameters. This approach fully utilizes prior physical knowledge, and as effective data accumulates, the model parameters are gradually optimized under physical constraints.

[0054] It should be understood that if the baseline model is built using synchronized data pairs, the old data row with the largest residual in the baseline model dataset is replaced with newly acquired data that has been cleaned. The updated dataset is then used to refit the model parameters, thus completing one model iteration. Since the replacement operation keeps the total number of rows in the dataset constant, the size of the baseline model dataset remains constant. This constant-size design is based on the actual constraints of the DCS controller's memory and computing power. Fixing the baseline model dataset size to a preset value, such as 50 sets, ensures sufficient statistical significance of the model while avoiding large-scale matrix operations caused by the infinite growth of the dataset, thus ensuring the real-time performance of the control system. Under the replacement strategy, the old data with the largest residual is discarded, while new, high-quality process data is continuously added, fundamentally realizing a first-in, first-out (FIFO) data management mechanism. Outdated data that may represent the old process state is automatically forgotten, while new data reflecting the current process state continuously enters, enabling the baseline model to continuously track and adapt to the long-term, slow changes in the production process.

[0055] In one possible implementation, the determination of whether the newly acquired data is an outlier based on the residual statistical distribution of the current benchmark model dataset is made using any of the following rules: Calculate the standard deviation σ of the residuals for all data points in the current benchmark model dataset, when |e new When |>3σ, the newly acquired data is determined to be an outlier, where e new The deviation between the model's predicted values ​​and the target output data for newly acquired data; Calculate the interquartile range (IQR) of all residuals in the current baseline model dataset, when the residuals of the newly acquired data satisfy... or When the value is Q3, it is considered an outlier, where Q3 is the upper quartile and Q1 is the lower quartile.

[0056] Specifically, residuals are defined as the deviation between the model's predicted values ​​and the target output data, that is, the algebraic difference between the model's calculated value and the actual calibration value for the i-th data set. During data cleaning, it is necessary to first calculate the statistical distribution characteristics of the residuals for all data points in the current benchmark model dataset, including the standard deviation σ, which reflects the overall dispersion of the data, and the upper and lower quartiles Q3 and Q1, which reflect the location of the data distribution.

[0057] The statistical basis of the 3σ criterion is that, assuming the data approximately follows a normal distribution, the probability of the absolute value of the residual exceeding three standard deviations is extremely low. Therefore, when the absolute value of the residual of newly acquired data exceeds this threshold, there is sufficient reason to believe that the data does not belong to the category of normal random fluctuations, but is caused by some systematic abnormal factor, thus classifying it as an outlier. The judgment range of this 3σ criterion is relatively lenient, taking into account both robustness and sensitivity to process changes. In actual industrial production scenarios, when both manual recording and instrument detection have certain fluctuations, using the 3σ criterion can avoid frequently discarding valid data due to normal measurement fluctuations, while at the same time identifying truly abnormal data that deviates from the normal range.

[0058] The IQR rule uses the interquartile range (IQR), the difference between the upper and lower quartiles, as the basic measure of data dispersion. The upper and lower decision boundaries are set as Q3 plus 1.5 times the IQR and Q1 minus 1.5 times the IQR, respectively. Compared to the 3σ criterion, the IQR rule has a more compact upper and lower limit range, is more sensitive to outliers, and has stricter decision criteria, making it suitable for scenarios with higher data accuracy requirements.

[0059] Taking historical data from a mechanically clamped online particle size analyzer in a mineral processing plant as an example, two cleaning rules were applied to compare and verify 50 sets of data from the same batch. Under the existing technical model, the average residual of the dataset was 4.482 and the standard deviation of the residual was 3.513. The upper limit of cleaning obtained by using the 3σ criterion was 6.752 and the lower limit of cleaning was -14.324, which could only detect abnormal data of the particle size analyzer detection type. The upper limit of cleaning obtained by using the IQR rule was 3.083 and the lower limit of cleaning was -11.464, which could additionally detect manual input errors. After iterative optimization of the baseline model of the method of this invention, the average residual of the dataset decreased to 0.757 and the standard deviation of the residual decreased to 1.036, significantly reducing the overall dispersion of the data. The upper limit of cleaning obtained by the 3σ criterion was 3.182 and the lower limit of cleaning was -3.036, which can simultaneously detect anomalies in particle size analyzer detection and manual input errors. The upper limit of cleaning obtained by the IQR rule was 2.617 and the lower limit of cleaning was -2.485. Since the upper and lower limit intervals are the most compact, it can further detect result deviations caused by non-standard screening processes. This comparative verification shows that after the accuracy of the baseline model is improved, the residual distribution of the dataset is more concentrated, the judgment intervals of both cleaning rules are correspondingly narrowed, the data cleaning discrimination ability is significantly enhanced, and the IQR rule is always stricter than the 3σ criterion, which can identify more subtle abnormal data.

[0060] S3. Calculate the corresponding weights based on the residuals between the model prediction values ​​of each data point in the benchmark model and the target output data.

[0061] In one possible implementation, the weights are negatively correlated with the residual magnitude of the corresponding data points, and the weight W(e^(i-1)) of the i-th data point in the benchmark model dataset is... i The formula for calculating ) is: when hour, ; when At that time, the weight W(e) i )=0; Among them, e i σ is the residual of the i-th data point in the benchmark model dataset, σ is the standard deviation of the residuals of all data points in the benchmark model dataset, and k is a preset tuning constant.

[0062] Specifically, a weight is a value between 0 and 1 used in weighted least squares to characterize the reliability of each data point. A higher weight indicates a more reliable data point and a greater impact on the model, while a lower weight indicates a smaller impact on the model. The core principle of weight calculation is that the smaller the residual, the greater the weight; that is, data points whose model predictions are closer to the target output should be assigned higher confidence.

[0063] Tukey's Biweight function is the preferred solution for implementing this principle. Its mathematical properties determine that: when the absolute value of the residual of a data point is small and falls within the range of the product of the tuning constant k and the standard deviation σ, the data point is considered normal and reliable data, and the weight is calculated according to a smooth decreasing curve; the closer the residual is to zero, the closer the weight is to 1. When the absolute value of the residual of a data point gradually increases but does not exceed the threshold, the weight is smoothly reduced by a squared decrease, without a sudden truncation effect. When the absolute value of the residual of a data point exceeds the threshold, the data point is considered an outlier, and the weight is directly reduced to zero, thus being completely excluded in the subsequent weighted least squares fitting. This design of smooth decreasing and zero threshold has better robustness in statistics than simple inverse proportional weights or direct hard deletion, that is, it effectively reduces the impact of truly high residual data on the fitting results without excessively removing suspicious data on the edge of normal fluctuations. The tuning constant k is usually set to 4.685. This value comes from the efficiency analysis of Tukey's Biweight function in robust statistics, which allows the weight function to achieve an asymptotic efficiency of about 95% when the data follows a normal distribution.

[0064] S4. Construct a diagonal weight matrix using the weights, and use the weighted least squares method to fit the final linear model parameters. Then, output the correction result to the input instrument detection data based on the final linear model parameters.

[0065] In one possible implementation, the step of constructing a diagonal weight matrix using weights and fitting the final linear model parameters using weighted least squares includes: constructing a diagonal weight matrix with the weights of each data point in the benchmark model dataset as diagonal elements; constructing a design matrix and an observation vector based on the benchmark model dataset; and solving for the weighted least squares solution based on the diagonal weight matrix, the design matrix, and the observation vector to obtain the final linear model parameters.

[0066] Specifically, after calculating the weights, a diagonal weight matrix W is constructed using the weights of each data point in the benchmark model dataset as diagonal elements. That is, the element in the i-th row and i-th column of the matrix represents the weight of the i-th data point, and all other off-diagonal elements are zero. Simultaneously, a design matrix X and an observation vector Y are constructed based on the benchmark model dataset. For linear models, each row of the design matrix X corresponds to the detection data of one data point, and each row of the observation vector Y corresponds to the target output data of that data point.

[0067] For example, in a flowmeter calibration scenario, the design matrix X is an n×2 matrix, with the first column representing the DCS cumulative value and the second column consisting entirely of 1s corresponding to the intercept term; the observation vector Y represents manually recorded data synchronized with the DCS cumulative value. In a particle size analyzer calibration scenario, the columns of the design matrix X are the average particle size, the constant term 1, the standard deviation of particle size, and the reciprocal of the average particle size; the observation vector Y represents the manual sieving results synchronized with the detection data. According to the weighted least squares theory, the sum of squared residuals is weighted using a diagonal weight matrix W, i.e., the objective function is minimized as the sum of the squared residuals of each data point multiplied by their corresponding weights. The weighted least squares solution obtained by solving this optimization problem is the final linear model parameter.

[0068] Because the residuals of high-weight data points are amplified in the objective function, while the residuals of low-weight or zero-weight data points are reduced or ignored, the solution process automatically tends to fit high-reliability data and suppress the interference of low-reliability data. The resulting linear model parameters can be directly applied to online detection. For a new input instrument detection data X_input, the corrected output is a linear combination of the final linear model parameters and X_input: Y_corrected = k_final * X_input + b_final. This corrected value is closer to the physical truth represented by the target output data than the original instrument detection value.

[0069] As can be seen from S1-S4 above, the method provided by this embodiment of the invention overcomes the limitation of existing fixed models that cannot adapt by establishing a benchmark model, data cleaning and iterative updating, weight calculation, and weighted least squares solution. The data cleaning step can effectively remove abnormal data such as human error and instrument failure, ensuring that the model is not contaminated; the dynamic iteration of the benchmark model enables the model to continuously track changes in process conditions and achieve self-updating; the weight calculation based on residuals and the use of weighted least squares method make high-reliability data contribute more to the model, significantly improving the correction accuracy. At the same time, through the data cleaning and iterative update mechanism, the operability in environments with limited resources such as DCS controllers is ensured, realizing online, adaptive, and robust correction of industrial instrument detection deviations.

[0070] In some embodiments, the method provided by the present invention further includes: comparing the final linear model parameters with a preset physical reasonable range; if the final linear model parameters fall within the physical reasonable range, the verification is deemed successful, and the current final linear model parameters are used to output a correction result for the input instrument detection data, wherein the physical reasonable range is preset according to the inherent physical characteristics of the process equipment; if the final linear model parameters exceed the physical reasonable range, the verification is deemed unsuccessful, an alarm is triggered, and the correction result is output using the model parameters that passed the verification in the last instance.

[0071] Specifically, after obtaining the final linear model parameters using the weighted least squares method, a physical rationality-based verification layer is added to increase the system's safety boundary and prevent meaningless parameters from being output due to collective data anomalies. The physical rationality range is a pre-defined range of parameter values ​​based on the inherent physical characteristics of the process equipment, determined by the physical constraints of the equipment under normal operating conditions. For example, in a flowmeter calibration scenario, based on the physical basis of the cross-sectional area ratio of the main pipeline to the flowmeter (known as 0.66), and considering the influence of operating conditions such as slurry flow rate and concentration fluctuations, the empirically reasonable range for the slope is set to 0.65 to 0.80. The rationality verification of the intercept is determined based on the percentage of material consumption under normal operating conditions. For example, when the fluctuation of material consumption under normal operating conditions does not exceed 5%, the upper limit of the absolute value of the intercept is set to 7.5 to avoid physically unreasonable deviations in the model. In actual operation, after each new model parameter is obtained using the weighted least squares method, the parameters are immediately compared with the pre-defined physical rationality range. If the parameters fall within the physically reasonable range, it indicates that the model parameters are physically reasonable, the verification is passed, and the current final linear model parameters are used to calculate the correction results for subsequent input instrument detection data. If the parameters exceed the physically reasonable range, for example, if the slope is below 0.65 or above 0.80, it indicates that the model parameters are physically unreasonable, the verification is failed, and an alarm is triggered in the DCS system, indicating abnormal flow correction model parameters or similar warning information. At the same time, the previously verified model parameters are used for correction output instead of the currently abnormal model parameters. This mechanism avoids control chaos caused by erroneous correction and promptly notifies personnel to intervene for inspection and handling through alarms. The method of setting the physically reasonable range varies for different process equipment and different model forms, but the common principle is to pre-set it based on the inherent physical characteristics of the process equipment before operation, thus embedding a physical hard constraint in the model self-learning process. This ensures that the model parameters can be continuously optimized through data-driven processes without deviating from basic physical laws.

[0072] To facilitate understanding of this solution, the following two examples will be used to further explain and illustrate the method provided in the embodiments of the present invention.

[0073] In one example, the problem of correcting the detection deviation of the feed flow meter in the roasting process of a copper smelter is addressed.

[0074] The technical background is as follows: Flow meters used to detect feed flow rate have pipe diameters larger than the actual process pipelines, resulting in consistently significantly higher detected flow rates than the actual flow rate. Existing technologies attempt to use linear regression methods, fitting manually recorded actual material consumption by the shift as target output data (Y) with cumulative values ​​calculated by the DCS system based on online flow rate, concentration, and specific gravity as detection data (X). However, this approach suffers from problems such as unreliable data sources, fixed models that cannot adapt to changes, sensitivity to abnormal data, and a lack of effective monitoring.

[0075] The specific implementation method of this embodiment is as follows, and the overall process is implemented through programming within the DCS system: I. Initialization Phase: Establishing a baseline model.

[0076] A set of manually generated data vectors Y and corresponding DCS cumulative value vectors X are selected from historical data. Based on the physical principle that flow rate is proportional to cross-sectional area, a simplified linear model Y=kX is adopted, and the initial proportionality coefficient k=mean(Y) / mean(X) is calculated. The absolute deviation e_i=|k*X_i-Y_i| for each data point in this batch of historical data is calculated, and the 50 data sets (X,Y) with the smallest absolute deviations are selected to form the initial baseline model dataset. This dataset will serve as a reliable basis for subsequent model corrections.

[0077] II. Operation Phase: Online Data Cleaning and Adaptive Update of the Benchmark Model.

[0078] Whenever new manual data (X_new, Y_new) enters the system, the following process is executed: The new data is added to the baseline model dataset. The scaling factor k_temp and the deviation e_i of all data points (including the new data) are recalculated, and the standard deviation σ of these deviations is calculated. Data cleaning is performed using the 3σ criterion. The standard deviation σ of the residuals of all data points in the current baseline model dataset is calculated, and it is checked whether the residual e_new of the new data satisfies |e_new|≤3σ. Given the inherent fluctuations in both manual recording and DCS accumulation, a relatively lenient 3σ criterion is chosen to ensure robustness while maintaining the model's sensitivity to process changes. If the check passes, the new data is valid and is formally added to the baseline model. Simultaneously, the old data set with the largest current deviation is deleted from the dataset, thus maintaining a constant total size of 50 sets for the baseline model. If the check fails, the new data is considered an outlier and is removed; the baseline model remains unchanged.

[0079] III. Weight Calculation and Weighted Regression.

[0080] The final model predictions are performed using the updated baseline model dataset. Weights are assigned to each data point in the dataset using Tukey's Biweight function, where the weight is negatively correlated with the magnitude of the bias at that data point. A diagonal weight matrix W is constructed using these weights. A design matrix X (an n×2 matrix, where the first column is the DCS cumulative value x, and the second column is all 1s) and an observation vector Y (corresponding to the manual data) are then constructed. The weighted least squares solution is solved to obtain (k_final, b_final) as the latest model parameters.

[0081] IV. Security verification and alarm for prediction results.

[0082] Based on the physical principle of the cross-sectional area ratio of the main pipeline to the flow meter (0.66), and considering the influence of slurry flow rate and concentration fluctuations, the empirically reasonable range for the slope k is set to [0.65, 0.80], and the upper limit of the absolute value of the intercept b is 7.5 (determined based on the percentage of material consumption <5% under normal operating conditions). Verify the calculated k_final and b_final: if the parameters are normal, use the newly calculated (k_final, b_final) as the flow correction model; if the parameters are abnormal (e.g., the slope exceeds the range), immediately trigger an alarm in the DCS system, indicating "flow correction model parameters are abnormal," and continue using the previously verified model parameters for flow correction.

[0083] V. Small flow intercept correction.

[0084] If the DCS detection value x is less than the shutdown / low flow threshold x0, then the correction model y=c*x passing through the origin is activated, where the parameter c makes the correction value continuous at x0, i.e., y0=c*x0=k*x0+b, thus c=k+b / x0. This step ensures the physical rationality of the correction value under low flow and shutdown conditions, and solves the intercept paradox problem in traditional methods.

[0085] Experimental Data and Performance Verification: Using the mean absolute error (MAE) as the evaluation metric, the comparative test results are as follows: the MAE using the least squares method directly is 5.35%; the MAE using the ordinary least squares method after data cleaning is 3.27%; and the MAE using the weighted least squares method after data cleaning is 2.38%. Experimental data demonstrates that the method of this invention significantly reduces prediction error through data cleaning and weighted regression. Simultaneously, the parameter safety verification mechanism effectively intercepts model parameter out-of-bounds errors caused by data anomalies during testing, and the alarm function promptly notifies operators to intervene, verifying the system's safety and reliability.

[0086] In another example, the problem of detection deviation correction for a mechanical "clamping" type online particle size analyzer in a mineral processing plant is addressed.

[0087] The technical background is as follows: Particle size analyzers measure 120 times per minute, outputting the average (Ave) and standard deviation (Sd) of the slurry particle size as detection data. Existing technology uses the least squares method, based on the simultaneously obtained manual sieving results (taking -200 mesh content as an example, i.e., the mass percentage of particles smaller than 74 micrometers) as the target output data, and fits the empirical model F200=a*Ave+b+c*Sd+d / Ave, with a prediction accuracy of approximately ±3%, and cannot adapt to changes in process conditions.

[0088] The specific implementation method of this embodiment is as follows: I. Baseline Model Initialization.

[0089] Fifty sets of historical data were collected, namely, synchronously recorded (Ave, Sd) and manually screened F200_actual. Since there is no physical function relationship between (Ave, Sd) and the -200 mesh content, the above data-driven approach was used to establish a baseline model. Ordinary least squares was used to fit the initial model parameters [a0, b0, c0, d0], and the residual e_i for each data set was calculated. The data rows with the largest residuals were iteratively deleted, and the model was refitted until the dataset size stabilized at 50 rows, resulting in the final initial baseline model.

[0090] II. Data Cleaning and Model Iteration.

[0091] When a new set of detection data (Ave_new, Sd_new, F200_actual_new) is obtained, the predicted value F200_pred_new and the residual e_new are calculated using the current baseline model. The IQR (Independent Quality Reduction) method is used to clean and verify e_new. Compared to the 3σ criterion, the IQR method is more sensitive to outliers and has stricter standards, effectively removing outliers introduced by human screening errors, momentary instrument malfunctions, or improper screening processes. If the new data passes the verification, it replaces the row with the largest residual in the current baseline model dataset, thus completing the dataset renewal and maintaining a constant baseline model dataset size of 50 rows. Subsequently, based on the updated dataset, ordinary least squares is used again for fitting, updating the baseline model parameters.

[0092] III. Weight Calculation and Final Output.

[0093] We calculate the weights for each row of data in the baseline model dataset using Tukey's Biweight function. The inputs for the weighted least squares method are constructed as follows: a design matrix X (columns Ave, 1, Sd, 1 / Ave), an observation vector Y (corresponding to the manual screening results), and a diagonal weight matrix W (diagonal elements representing the weights of each data point). Solving for the weighted least squares solution yields β = (a, b, c, d)^T as the latest model parameters. Applying this parameter set to online detection yields the corrected predicted -200 mesh content.

[0094] IV. For predictions of other particle size contents (such as -120 mesh, -150 mesh) and slurry concentration, repeat steps one to three above.

[0095] Experimental Data and Performance Verification: After applying the method of this invention, the prediction accuracy (mean absolute error) of the model improved from ±3% to within ±1%. Comparing the prediction residuals for the -200 mesh content of the newly added 12 sets of data: the average absolute residual of the existing model was 4.997, and the standard deviation of the residuals was 5.441; the average absolute residual of the weighted model of this invention was 1.057, and the standard deviation of the residuals was 1.097. The data shows that after processing with the weighted least squares method, the prediction residuals and standard deviations are significantly reduced, and the model accuracy is greatly improved.

[0096] Furthermore, this embodiment implements a first-in, first-out (FIFO) data management mechanism by maintaining a data queue with a fixed capacity (50 rows). New, high-quality process data is continuously added, while outdated data representing older processes is automatically forgotten, enabling the model to continuously track and adapt to changes in production processes. A rigorous data cleaning process (IQR rule) effectively eliminates outlier data, ensuring the robustness of the model.

[0097] It should be noted that in existing technologies, the measurement principle of mechanically clamped particle size analyzers involves a mechanical probe contacting ore particles during a single detection process. What is directly detected is essentially the diameter of the largest ore particle in that single detection; smaller particle diameters are not detected. Therefore, there is no clear mathematical and physical correspondence between the distribution of coarse particles and the distribution of fine particles down to -200 mesh. The effective information from mechanically clamped measurements is mainly concentrated in the vicinity of particle sizes close to its measurement scale, i.e., the average particle size. For particle sizes deviating from this scale, such as the content of -200 mesh, the prediction is essentially an extrapolation estimate with relatively limited reliability. Furthermore, in the empirical models of existing technologies, changes in the average particle size and standard deviation contribute very little to the model's predicted values. The model output mainly depends on the constant term b and the correction term d / Ave. This means that existing models essentially only output a moving average of the manual sieving results, rather than tracking and reflecting the fluctuations in the true particle size distribution. The ability of the model to reflect real fluctuations is sacrificed in pursuit of static accuracy. The method of this invention introduces a dynamic iterative update mechanism for the benchmark model and a weighted least squares fitting based on residuals. This allows new process data to be continuously incorporated into the model while old data is automatically eliminated. At the same time, by calculating weights, the dominant parameters of high-reliability data are solved, which alleviates the limitations of the above-mentioned extrapolation estimation to a certain extent and enables the model to more closely track the changes in the actual process.

[0098] It should be noted that the above two examples are merely illustrative, and the embodiments of the present invention do not impose any special limitations on specific application scenarios.

[0099] The foregoing mainly describes the solutions of the embodiments of the present invention from a methodological perspective. It is understood that, in order to achieve the above-mentioned functions, the model building system 100 includes at least one of the hardware structures and software modules corresponding to the execution of each function. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments disclosed herein, the embodiments of the present invention can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of the present invention.

[0100] In this embodiment of the invention, the model building system 100 can be divided into functional units according to the above method example. For example, the model building system 100 can be divided into functional units corresponding to various functions, or two or more functions can be integrated into one processing unit. The integrated unit can be implemented in hardware or as a software functional unit. It should be noted that the unit division in this embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.

[0101] For example, Figure 3 This diagram illustrates the hardware structure of a model building system according to an embodiment of the present invention. The model building system 100 includes: a baseline model initialization module 110, used to establish a baseline model based on the detection data and target output data of an online detection instrument, obtaining initial linear model parameters; a data cleaning and iteration module 120, used to clean the newly acquired detection data and target output data, iteratively updating the baseline model using the cleaned effective data, obtaining updated model parameters; a weight calculation module 130, used to calculate corresponding weights based on the residuals between the model prediction values ​​of each data point in the baseline model and the target output data; and a weighted fitting module 140, used to construct a diagonal weight matrix using the weights, fit the final linear model parameters using the weighted least squares method, and output correction results for the input instrument detection data based on the final linear model parameters.

[0102] It should be understood that specific descriptions of the above-mentioned optional methods can be found in the foregoing method embodiments, and will not be repeated here. Furthermore, explanations of any of the model construction systems 100 provided above, as well as descriptions of their beneficial effects, can be found in the corresponding method embodiments described above, and will not be repeated here.

[0103] This invention also provides a computer-readable storage medium storing at least one computer instruction, which is loaded and executed by a processor to implement the methods of the various embodiments described above. Explanations of the relevant content and descriptions of the beneficial effects of any of the computer-readable storage media provided above can be found in the corresponding embodiments described above, and will not be repeated here.

[0104] In this embodiment, the adaptive model parameter calculation program is deployed on a standalone computer. The computer's memory stores the program code, and the processor executes the program code to implement the above method. After the operator manually enters the manually screened data, they click the calculation button. The program outputs the updated model parameters and transmits them to the particle size analyzer via the communication interface. Simultaneously, the update time and the model parameters before and after the update are recorded in the computer.

[0105] Those skilled in the art will understand that the program for implementing all or part of the steps of the above embodiments, which can be executed by a program instructing related hardware, can be stored in a computer-readable storage medium. The storage medium mentioned above can be a read-only memory, a random access memory, etc. The processing unit or processor mentioned above can be a central processing unit, a general-purpose processor, an application-specific integrated circuit (ASIC), a microprocessor (DSP), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof.

[0106] This invention also provides a computer program product containing instructions that, when executed on a computer, cause the computer to perform any of the methods described in the above embodiments. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this invention is generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions may be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., SSD), etc.

[0107] It should be noted that the devices for storing computer instructions or computer programs provided in the embodiments of the present invention, such as, but not limited to, the aforementioned memory, computer-readable storage medium, and communication chip, are all non-transitory. Those skilled in the art should recognize that the functions described in the embodiments of the present invention in one or more of the above examples can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable storage medium or transmitted as one or more instructions or code on a computer-readable storage medium. Computer-readable storage media include computer storage media and communication media, wherein communication media include any medium that facilitates the transmission of computer programs from one place to another. Storage media can be any available medium accessible to general-purpose or special-purpose computers.

[0108] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A method for constructing a model for adaptively correcting instrument detection deviation, characterized in that, include: A baseline model is established based on the detection data and target output data of the online detection instrument to obtain the initial linear model parameters; The newly acquired detection data and target output data are cleaned, and the baseline model is iteratively updated using the cleaned effective data to obtain the updated model parameters. Calculate the corresponding weights based on the residuals between the model prediction values ​​of each data point in the benchmark model and the target output data. A diagonal weight matrix is ​​constructed using the weights, and the final linear model parameters are obtained by fitting using the weighted least squares method. The final linear model parameters are then used to output correction results for the input instrument detection data.

2. The method according to claim 1, characterized in that, The baseline model is established based on the detection data and target output data of the online detection instrument to obtain the initial linear model parameters, including: If there is a physical function relationship between the detection data and the target output data, then instrument detection data covering normal operating conditions is obtained, the corresponding theoretical value is calculated through the physical function relationship, and a random error following a normal distribution is superimposed on each theoretical value to form an initial dataset. The initial linear model parameters are obtained by fitting the data using the ordinary least squares method. If there is no physical function relationship between the detection data and the target output data, then the synchronous data pairs of the instrument detection data and the manual calibration data are collected, and the initial model is fitted using the ordinary least squares method. The residuals of each data point are calculated, the data row with the largest residual is iteratively deleted and refitted until the residuals of all data points are less than the preset threshold or the dataset size reaches the preset size, and the initial linear model parameters are obtained.

3. The method according to claim 2, characterized in that, The process involves cleaning the newly acquired detection data and target output data, and iteratively updating the baseline model using the cleaned, effective data to obtain updated model parameters, including: Calculate the predicted values ​​and corresponding residuals for the newly acquired data using the current benchmark model; Based on the residual statistical distribution of the current benchmark model dataset, determine whether the newly acquired data is an outlier; If the newly acquired data is determined to be valid, it is added to the baseline model dataset and refitted to update the model parameters; if it is determined to be an outlier, the newly acquired data is removed and the baseline model remains unchanged. Specifically, for the benchmark model established through the physical function relationship, the expanded dataset is directly refitted; for the benchmark model established through the synchronized data pair, the newly acquired data is used to replace the data row with the largest current residual in the benchmark model dataset before refitting, so that the size of the benchmark model dataset remains constant.

4. The method according to claim 3, characterized in that, The determination of whether the newly acquired data is an outlier based on the residual statistical distribution of the current benchmark model dataset is made using any of the following rules: Calculate the standard deviation σ of the residuals for all data points in the current benchmark model dataset, when |e new When |>3σ, the newly acquired data is determined to be an outlier, where e new The deviation between the model's predicted values ​​and the target output data for newly acquired data; Calculate the interquartile range (IQR) of all residuals in the current baseline model dataset, when the residuals of the newly acquired data satisfy... or When the value is Q3, it is considered an outlier, where Q3 is the upper quartile and Q1 is the lower quartile.

5. The method according to claim 1, characterized in that, The weights are negatively correlated with the residual magnitude of the corresponding data points, and the weight W(e) of the i-th data point in the benchmark model dataset is... i The formula for calculating ) is: when hour, ; when At that time, the weight W(e) i )=0; Among them, e i σ is the residual of the i-th data point in the benchmark model dataset, σ is the standard deviation of the residuals of all data points in the benchmark model dataset, and k is a preset tuning constant.

6. The method according to claim 1, characterized in that, The process of constructing a diagonal weight matrix using weights and fitting the final linear model parameters using weighted least squares includes: Construct a diagonal weight matrix using the weights of each data point in the baseline model dataset as diagonal elements; Construct a design matrix and observation vector based on the benchmark model dataset; Based on the diagonal weight matrix, design matrix, and observation vector, the weighted least squares solution is obtained to get the final linear model parameters.

7. The method according to claim 1, characterized in that, The method further includes: The final linear model parameters are compared with the preset physical reasonable range; If the final linear model parameters fall within the physical reasonable range, the verification is deemed successful, and the current final linear model parameters are used to output the correction result for the input instrument detection data. The physical reasonable range is preset according to the inherent physical characteristics of the process equipment. If the final linear model parameters exceed the physical reasonable range, the verification is deemed to have failed, an alarm is triggered, and the corrected results are output using the model parameters that passed the previous verification.

8. A model construction system for adaptively correcting instrument detection deviation, characterized in that, include: The baseline model initialization module is used to establish a baseline model based on the detection data and target output data of the online detection instrument, and obtain the initial linear model parameters. The data cleaning and iteration module is used to clean the newly acquired detection data and target output data, and iteratively update the benchmark model using the cleaned effective data to obtain the updated model parameters. The weight calculation module is used to calculate the corresponding weights based on the residuals between the model prediction values ​​of each data point in the benchmark model and the target output data. The weighted fitting module is used to construct a diagonal weight matrix using the weights, fit the final linear model parameters using the weighted least squares method, and output correction results to the input instrument detection data based on the final linear model parameters.

9. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the model building method for adaptive correction of instrument detection deviation as described in any one of claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the model construction method for adaptive correction of instrument detection deviation as described in any one of claims 1-7.