A soft measurement optimization control method for refining production quality control indexes and related equipment
By constructing a data-driven model combined with a refining and chemical process knowledge base and differential evolution algorithm, the control parameters of refining and chemical production quality control indicators are optimized, solving the problem of conflict between the combination of control variables and actual operating conditions in existing technologies, and realizing the reliable execution of control commands and the improvement of prediction accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING ZHONGYAN INFORMATION TECH CO LTD
- Filing Date
- 2026-06-03
- Publication Date
- 2026-07-10
AI Technical Summary
In refining and chemical production, quality control indicators are difficult to detect in real time, and the combination of control variables generated by existing soft measurement models is prone to conflict with actual equipment operating conditions, making it difficult to implement adjustment schemes.
A data-driven model is constructed in conjunction with a refining and chemical process knowledge base. Control parameters are optimized through differential evolution algorithms. A large language model is used to transform process knowledge into constraint code. The code is tested in a sandbox environment, and on-site interactive feedback is introduced to update the model.
It improves the matching degree between the control scheme and the multivariable physical coordination conditions, ensures the reliable execution of the generated control commands, and improves the prediction accuracy and stability.
Smart Images

Figure CN122362890A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of advanced control technology, and in particular to a soft measurement optimization control method and related equipment for quality control indicators in refining and chemical production. Background Technology
[0002] In refining and chemical production, some quality control indicators are difficult to detect physically in real time, resulting in significant lag. To address this issue, existing technologies typically employ soft measurement models. Specifically, this involves collecting historical state data of the control system's tag parameters to train a machine learning model. During actual production, real-time state data is input into the model for forward prediction, thereby obtaining the current quality control indicators.
[0003] In the methods described above, when the predicted results of the output quality control indicators deviate from the process requirements, it is difficult to guide on-site personnel on how to specifically adjust the control tag parameters to correct the deviation. To address this issue, existing technologies have proposed an improved scheme that combines a heuristic search algorithm. This scheme generates a large number of tag combinations within the set upper and lower limits of parameter values, inputs these parameter combinations into the prediction model to obtain predicted values, and approximates the target through the algorithm's own optimization and iteration mechanism. Finally, the set of tag parameters whose predicted results are closest to the desired indicators is output to the terminal as the adjustment scheme.
[0004] However, because the optimization mechanism of this technology relies solely on set upper and lower limits as constraints for parameter search, and there are complex physical coupling relationships between the control parameters of different sections in a real refining unit, when the algorithm searches only with the goal of reducing the target prediction error, it is prone to generating variable combinations where each individual parameter is within the allowable range, but the overall combination does not conform to the actual physical coordination conditions. Such mathematically optimal solutions, which do not consider the real physical relationships of multiple variables, are easily applied directly to actual field conditions, resulting in control commands that are difficult to implement, ultimately making it difficult to execute the output adjustment scheme at the control terminal. Summary of the Invention
[0005] This application provides a soft measurement optimization control method and related equipment for quality control indicators in refining and chemical production, which can alleviate the technical problem that the generated combination of control variables is prone to conflict with the actual equipment operating conditions, and improve the matching degree between the adjustment scheme and the multivariate physical coordination conditions.
[0006] Firstly, this application provides a soft-sensor optimization control method for quality control indicators in refining and chemical production, applied to the control processing unit of control equipment. The method includes: acquiring historical state data of the refining and chemical production process and preprocessing it to obtain a training dataset; acquiring a refining and chemical process knowledge base, wherein the historical state data includes control system tag parameters and corresponding quality control indicators; the refining and chemical process knowledge base is expressed in natural language and includes at least equipment operating safety limits and process parameter association logic; training a data-driven model for predicting quality control indicators based on the training dataset; calling a preset large language model to convert the refining and chemical process knowledge base into condition constraint code, and classifying the condition constraint code into hard constraints, soft constraints, and search-guided conditions according to constraint logic type; responding to the received target quality control indicator instruction, acquiring the real-time control system tag parameters under the current operating condition, and using the real-time control system... The position parameter is used as the initial population center to initialize the candidate population of the pre-defined differential evolution algorithm. The candidate population includes multiple combinations of candidate position parameters. In each iteration of the differential evolution algorithm, hard constraints are applied to limit the operational boundaries of the candidate population to obtain the effective candidate population. The effective candidate population is input into the data-driven model to obtain the corresponding predicted quality control index. Based on the deviation between the predicted quality control index and the target quality control index in the target quality control index instruction, as well as the soft constraints, the fitness of each candidate position parameter combination in the effective candidate population is calculated. Using the fitness as the evaluation basis, iterative optimization is performed under the constraints of the search guidance conditions on the candidate position parameter combinations until the differential evolution algorithm converges, obtaining the operational optimization scheme of the position parameter of the real-time control system. Based on the operational optimization scheme, control instructions are generated to drive the control mechanism of the refining and chemical production process to adjust the corresponding physical parameters.
[0007] By adopting the above technical solution, the control processing unit first constructs and trains a data-driven model for predicting quality control indicators based on historical state data of the refining and chemical production process. Then, the control processing unit converts the natural language form of the refining and chemical process knowledge base into conditional constraint codes containing hard constraints, soft constraints, and search guidance conditions through a large language model, and combines these codes with the data-driven model to construct a dual-driven optimization foundation based on data patterns and process rules. Next, after initializing the candidate population of the differential evolution algorithm using the real-time control system tag parameters, the control processing unit, in each iteration, not only calls hard constraints to limit the operational boundaries to eliminate over-limit tag parameter combinations that violate equipment operating safety limits, but also inputs the selected effective candidate population into the data-driven model to obtain the corresponding predicted quality control indicators. Finally, the control processing unit uses the deviation between the predicted quality control indicators and the target quality control indicators, along with the soft constraints, as the evaluation basis for fitness, and drives the differential evolution algorithm for iterative optimization under the definition of search guidance conditions. This process allows the algorithm to reduce prediction bias and approach the target quality control indicators, while its parameter search trajectory and combined evaluation system are both controlled by the physical synergistic correlation logic of real multivariate variables. The control processing unit continues until the algorithm converges to obtain the operation optimization scheme and generates control commands. This method alleviates the technical problem that the generated combination of control variables is prone to conflict with the actual equipment operating conditions, and improves the matching degree between the adjustment scheme and the multivariate physical synergistic conditions.
[0008] In conjunction with some embodiments of the first aspect, in some embodiments, a data-driven model for predicting quality control indicators is trained based on a training dataset. Specifically, this includes: constructing an initial data-driven model for predicting quality control indicators using a gradient boosting tree algorithm as a framework; determining the hyperparameter space to be optimized for the initial data-driven model, wherein the hyperparameter space to be optimized includes at least the learning rate, tree depth, number of trees, and regularization parameter; optimizing the hyperparameter space to be optimized to obtain the optimal hyperparameter combination; and training the initial data-driven model based on the optimal hyperparameter combination and the training dataset to obtain a fully trained data-driven model.
[0009] By adopting the above technical solution, the control processing unit constructs an initial model using the gradient boosting tree algorithm, adapting to the nonlinear correlation between parameters and quality control indicators in refining and chemical production. The optimal hyperparameter combination is obtained through optimization, and then the model is trained using the training dataset. This method alleviates the problem of insufficient or overfitting model fitting caused by manually setting hyperparameters, and improves the prediction accuracy of data-driven models for the nonlinear mapping relationships of complex refining and chemical processes.
[0010] In conjunction with some embodiments of the first aspect, in some embodiments, after obtaining the trained data-driven model, the method further includes: extracting the sum of feature information gains generated by the data-driven model during training; sorting the reference parameters of each control system in the training dataset in descending order according to the magnitude of the sum of feature information gains to obtain a feature contribution ranking sequence; and outputting the feature contribution ranking sequence to a preset monitoring interaction interface to generate an impact factor correlation map of refining quality control indicators.
[0011] By adopting the above technical solution, the control processing unit extracts the sum of feature information gains to quantify the impact of each parameter on quality control indicators, generates a feature contribution ranking sequence and visualizes it, thus clarifying the importance of each control parameter. This method alleviates the barrier caused by data-driven models relying on internal black-box reasoning, which makes the results difficult to interpret. It helps on-site operators more intuitively identify and understand the actual transmission impact of key control variables on quality control indicators.
[0012] In conjunction with some embodiments of the first aspect, in some embodiments, a preset large language model is invoked to convert the refining and chemical process knowledge base into conditional constraint code. Specifically, this includes: invoking the preset large language model, using the large language model to parse the refining and chemical process knowledge base to obtain semantic feature text; extracting the equipment operation safety limits and process parameter association logic corresponding to the control system tag number parameters from the semantic feature text to obtain structured constraint text; based on the principle that local constraints take precedence over global constraints, removing logical conflict items from the structured constraint text to obtain conflict-free constraint text; and invoking the preset large language model to convert the conflict-free constraint text into conditional constraint code in the target programming language.
[0013] By adopting the above technical solution, the control processing unit parses, structures, and converts the natural language process knowledge base into executable condition constraint code through a large language model, eliminating logical conflicts to ensure the rationality of constraints, and realizing the engineering transformation of process knowledge. This method alleviates the problem that directly translating process text as a whole using a large model can easily lead to contradictions in safety constraint instructions or deadlock logic, ensuring the accuracy and consistency of the final generated condition constraint code in describing physical operating limits.
[0014] In conjunction with some embodiments of the first aspect, in some embodiments, after the step of converting the refining process knowledge base into conditional constraint code, the method further includes: extracting historical state data under steady-state production conditions from the training dataset to obtain a test dataset, and constructing a sandbox execution environment isolated from the real-time production control loop; running the conditional constraint code in the sandbox execution environment, and sequentially inputting the various control system tag parameters in the test dataset into the running conditional constraint code to obtain a code execution feedback log including parameter judgment results; when there are runtime syntax errors in the code execution feedback log, or when the amount of data in the test dataset judged to violate the constraint conditions is greater than a first preset data amount threshold, extracting abnormal feature information from the code execution feedback log; generating modification prompt words based on the abnormal feature information, and inputting the modification prompt words into a large language model for iterative code reconstruction to obtain reconstructed conditional constraint code; performing iterative testing on the reconstructed conditional constraint code until a new conditional constraint code that does not generate abnormal feature information is obtained, and replacing the original conditional constraint code with the new conditional constraint code.
[0015] By adopting the above technical solution, the control processing unit tests the constraint code in an isolated sandbox environment, identifies code defects through feedback logs, iteratively reconstructs the code using a large language model, and repeatedly tests it until the code no longer produces exceptions before replacing the original code. This method mitigates the risk of exception code with syntax defects or logical overreach driving the underlying physical device, ensuring the stability and safety control baseline of the code in real-world application environments.
[0016] In conjunction with some embodiments of the first aspect, in some embodiments, control instructions are generated based on an operation optimization scheme to drive the control mechanism of the refining and chemical production process to adjust the corresponding physical parameters. Specifically, this includes: outputting the operation optimization scheme and the corresponding predicted quality control indicators to a preset operation terminal and displaying them visually; receiving a control confirmation instruction and a corresponding operation reason text fed back by the operation terminal based on the operation optimization scheme, wherein the control confirmation instruction includes an allow execution instruction and a refuse execution instruction; and in response to the control confirmation instruction being an allow execution instruction, generating control instructions based on the operation optimization scheme to drive the control mechanism of the refining and chemical production process to adjust the corresponding physical parameters.
[0017] By adopting the above technical solution, the control processing unit first visualizes the optimized solution and receives confirmation instructions from the operator. Then, the control processing unit strictly triggers the control commands for the corresponding underlying physical parameters of the refining process only when it receives a permission to execute instruction. This method introduces a manual verification step, mitigating the risk of physical collisions to equipment caused by the algorithm forcibly executing aggressive deviation solutions when encountering occasional abnormal operating conditions, thus improving the stability of actual scheduling and control operations.
[0018] In conjunction with some embodiments of the first aspect, in some embodiments, after generating control instructions based on the operation optimization scheme to drive the control mechanism of the refining and chemical production process to adjust the corresponding physical parameters, the method further includes: associating and concatenating the real-time control system tag parameters, operation optimization scheme, control confirmation instructions, and operation reason text to obtain context data, and storing the context data in a structured manner to obtain interactive feedback records; when the amount of data in the interactive feedback records including the refusal to execute instructions is greater than or equal to a second preset data amount threshold, obtaining the actual tag parameter data of the refining and chemical production process in the corresponding cycle; after a preset delay period, obtaining the actual quality control indicators generated by the refining and chemical production process; using the actual tag parameter data as input features, and pairing and associating the features with the actual quality control indicators to obtain incremental training samples; performing incremental model training on the data-driven model based on the incremental training samples to obtain an updated data-driven model to execute the refining and chemical quality control indicator prediction and operation optimization for the next cycle; and storing the operation reason text in the refining and chemical process knowledge base to supplement hard constraints, soft constraints, and search guidance conditions.
[0019] By adopting the above technical solution, when the number of rejected instructions reaches the second preset data threshold, it indicates that the current data-driven model is no longer suitable for the current operating conditions. At this time, the control processing unit acquires the actual tag parameter data generated during the production process and the actual quality control indicators after the delay period, regardless of whether the actual state conforms to the original optimization scheme. Since the input and output features contain a mapping relationship that conforms to the current physical production reality, the control processing unit uses the field data as incremental samples to update the model, which can effectively mine and learn the correct operating condition trajectory under human intervention. At the same time, the control processing unit converts the operation reason text into constraints in the knowledge base, realizing the safe solidification of the system boundary. This method alleviates the prediction distortion problem caused by natural wear and tear or operating condition drift in the long-term operation of refining and chemical physical equipment, and improves the prediction accuracy.
[0020] In a second aspect, this application provides a control processing unit, including one or more processors and a memory; the memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, and the one or more processors calling the computer instructions to cause the control processing unit to perform the method described in the first aspect and any possible implementation thereof.
[0021] Thirdly, this application provides a computer-readable storage medium including computer instructions that, when executed on a control processing unit, cause the control processing unit to perform the method described in the first aspect and any possible implementation thereof.
[0022] Fourthly, this application provides a computer program product, including a computer program / instructions that, when executed on a control processing unit, cause the control processing unit to perform the method described in the first aspect and any possible implementation thereof.
[0023] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages: 1. By adopting a technical approach that transforms natural language process knowledge into hierarchical constraint code based on a refining process knowledge base and incorporates differential evolution algorithm for constraint optimization, the technical problem of generating parameter combinations that conflict with the actual physical coupling relationship by using only upper and lower limits of parameters as constraints is effectively alleviated. This achieves the technical effect of matching the operation optimization scheme with the actual working conditions and enabling the control commands to be executed directly.
[0024] 2. By employing closed-loop testing of the constraint code in a sandbox execution environment and using iterative reconstruction and optimization with a large language model, the technical problems of syntax errors, logical conflicts, or inconsistencies with actual processes in the constraint code are effectively alleviated. This results in accurate and reliable constraint code, providing stable constraint support for the optimization process.
[0025] 3. By adopting the technical means of constructing incremental samples based on on-site interactive feedback records and actual quality control indicators, and incrementally training the data-driven model, the problem of mismatch between the data-driven model and real-time working conditions and the decline in prediction accuracy are effectively alleviated. Thus, the technical effect of the data-driven model adapting to changes in working conditions and continuously improving prediction accuracy is achieved. Attached Figure Description
[0026] Figure 1 This is a flowchart illustrating a soft measurement optimization control method for refining and chemical production quality control indicators in this application embodiment; Figure 2 This is another flowchart illustrating the soft measurement optimization control method for refining and chemical production quality control indicators in this application embodiment; Figure 3 This is a schematic diagram of the physical device structure of a control processing unit in an embodiment of this application. Detailed Implementation
[0027] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to any or all possible combinations that include one or more of the listed items.
[0028] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0029] In this embodiment, the control device refers to computing hardware (such as an industrial server, edge computing node, or industrial control computer) that runs soft measurement and optimization control algorithms, and contains a control processing unit that performs core calculations. The control system refers to the underlying control network (such as a distributed control system, DCS) used in the refining and chemical production site to directly control the underlying physical equipment. In practical applications, the control device interfaces with the control system via an industrial communication protocol to read the control system tag parameters from the control system.
[0030] The following describes the process of the method provided in this implementation. Please refer to [link / reference]. Figure 1 This is a flowchart illustrating a soft measurement optimization control method for refining and chemical production quality control indicators in this application embodiment.
[0031] 101. Obtain historical status data of the refining and chemical production process and preprocess it to obtain a training dataset. Obtain a refining and chemical process knowledge base. The historical status data includes control system tag parameters and corresponding quality control indicators. The refining and chemical process knowledge base is expressed in natural language and includes at least equipment operating safety limits and process parameter correlation logic.
[0032] The refining and chemical production process refers to the abstract expression of the physical processes of petrochemical and other refining and chemical plants during actual product production; historical state data refers to various monitoring and operational data recorded during the operation of the refining and chemical plants over a pre-set period of time, such as temperature and pressure data collected by the control processing unit from sensors over the past year; training dataset refers to a high-quality dataset used to train machine learning models after the control processing unit has preprocessed the historical state data, such as cleaning and alignment; the refining and chemical process knowledge base refers to a set of experiences and rules on how to operate and control refining and chemical plants, summarized and recorded by domain experts and written in natural language used by humans in daily life; control system tag parameters Numbers refer to the variable names and values that identify specific equipment or instrument readings in a distributed control system (DCS), such as the tag number and current opening degree of a temperature regulating valve in an atmospheric and vacuum distillation unit; quality control indicators are LIMS quality control indicators, which refer to parameters used to measure whether refined chemical products meet the specified quality standards, such as the freezing point index of aviation kerosene; equipment operating safety limits refer to the extreme operating range that machinery and equipment can withstand physically or technologically, such as the maximum temperature that a reactor can withstand not exceeding 500 degrees Celsius; process parameter correlation logic refers to the physical or chemical mutual influence relationships between different control parameters, such as increasing the feed flow rate often leading to a corresponding decrease in reaction temperature.
[0033] Specifically, the control processing unit first extracts historical state data containing massive operating conditions from the underlying control system or historical database through industrial communication protocols or database access interfaces. The control processing unit not only extracts numerical fluctuation records corresponding to each control system tag number, but also simultaneously extracts quality control index data entered by the laboratory at the same time segment, even considering delays. After extracting the above data, the control processing unit performs preprocessing operations such as outlier removal, missing value imputation, and multi-source data timestamp alignment, thereby transforming the messy industrial noise data into a uniformly formatted and reliable training dataset. Simultaneously, the control processing unit also connects to the enterprise's internal expert knowledge management system, retrieving a refining process knowledge base recorded in natural language. This knowledge base details the operational safety limits of equipment under various operating conditions, as well as the process parameter correlation logic where adjusting a certain tag parameter inevitably or usually causes changes in other parameters. This information lays the knowledge foundation for the control processing unit to subsequently construct a constraint system that conforms to the logic of physical reality.
[0034] In some embodiments, the control processing unit can acquire and preprocess historical state data of the refining and chemical production process to obtain a training dataset in the following specific manner: First, the control processing unit accurately locates and exports high-dimensional data records within the specified time period by reading the exact storage addresses of the Distributed Control System (DCS) tag number and the laboratory quality inspection results of the Laboratory Information Management System (LIMS) in the underlying industrial real-time database and relational database, thereby completing the initial acquisition of historical state data. Then, the control processing unit performs a serialization preprocessing method on the acquired massive amount of data. This preprocessing method specifically includes several rigorous data cleaning steps such as outlier removal, missing value imputation, data smoothing, and timestamp alignment. Specifically, in the outlier removal stage, the control processing unit first uses the 3σ criterion based on statistical process control to calculate the mean and standard deviation of the data sequences of each control system tag number, and directly removes isolated noise points that exceed the range of plus or minus three standard deviations of the mean and seriously deviate from the normal distribution. Simultaneously, the control processing unit uses a first-order differential drop detection algorithm to calculate the difference between data at adjacent sampling time points. If a sudden change in the difference is detected and the subsequent value remains unchanged for a long time, it is judged as an instrument malfunction, thus removing these instrument dead values that have no reference value. In the missing value filling stage, the control processing unit uses the Lagrange interpolation method, constructing an interpolation basis function using the effective data before and after the missing position, and performs polynomial calculations to fill the scattered missing data caused by network fluctuations or short equipment shutdowns. The data is filled with smooth, physically consistent numerical values. During the data smoothing phase, the control processing unit employs a weighted average algorithm with a dynamic window length. This algorithm adjusts the time window size in real-time based on the volatility of the current operating conditions and assigns different mathematical weights to different time points to filter out high-frequency measurement noise induced by complex electromagnetic environments. During the timestamp alignment phase, considering that DCS systems often perform high-frequency sampling at the second level, while LIMS test data is entered at a low frequency at the hour level, the control processing unit uses the NumPy-based pandas data analysis framework and its provided time-series processing tools to force resampling of all key production process data, strictly aligning them to the same standard time axis. This eliminates feature misalignment caused by inconsistent sampling frequencies. Finally, the control processing unit solidifies the preprocessed two-dimensional matrix data into a training dataset and stores it in a database table for subsequent input into a machine learning algorithm framework for model training.
[0035] 102. Based on the training dataset, a data-driven model for predicting quality control indicators is trained.
[0036] A data-driven model refers to a mathematical model automatically trained by the control processing unit based on statistical patterns or mapping relationships of a large amount of historical data. It does not completely rely on pure physical and chemical mechanism formulas. For example, a gradient boosting tree model trained by the control processing unit to predict the freezing point of jet fuel. Predictive quality control indicators refer to the possible values of product quality under the current conditions calculated by the control processing unit using the trained data-driven model after inputting the current operating condition tag number parameters.
[0037] Specifically, the control processing unit uses preprocessed multidimensional features as input and the quality inspection results as the ground truth label. The control processing unit then initiates an iterative training process for the data-driven model. Within its internal computational core, the control processing unit continuously adjusts the nonlinear mapping weights in the model, gradually reducing the error between the model's output quality control indicators and the historical true quality control indicators. Ultimately, the control processing unit solidifies this into a predictive engine capable of responding to real-time operating condition inputs.
[0038] In some embodiments, the control processing unit uses a gradient boosting tree algorithm as a framework to construct an initial data-driven model for predicting quality control indicators. The control processing unit first selects a forward stepwise addition framework such as XGBoost to configure an initial decision tree structure, aiming to leverage its powerful nonlinear fitting capabilities to capture complex industrial parameter relationships. Next, the control processing unit determines the hyperparameter space to be optimized for this initial data-driven model. The control processing unit specifies that the hyperparameter space must include the learning rate to control the contribution weight of each tree, the tree depth to limit model complexity and avoid overfitting, the number of trees to determine the number of iterations, and a regularization parameter to constrain the weights of leaf nodes. The control processing unit defines reasonable search boundaries for these parameters. Subsequently, the control processing unit optimizes the hyperparameter space to obtain the optimal hyperparameter combination. The control processing unit can use metaheuristic algorithms such as sparrow search or grid search to map the hyperparameters to position vectors in the space. In each iteration, the control processing unit evaluates the impact of the hyperparameter combination on the prediction error of the validation set, continuously updating the positions until the hyperparameter combination with the highest prediction accuracy is found. Finally, the control processing unit trains the initial data-driven model based on the optimal hyperparameter combination and the training dataset. The control processing unit substitutes the optimized hyperparameters into the gradient boosting tree framework, inputs the entire training dataset, and fits the residuals through successive gradient descent steps until the loss function converges, thus obtaining the fully trained data-driven model.
[0039] 103. Call the preset large language model to convert the refining process knowledge base into condition constraint code, and divide the condition constraint code into hard constraint conditions, soft constraint conditions and search guidance conditions according to the constraint logic type.
[0040] Large language models refer to deep neural networks with powerful natural language understanding and code generation capabilities, such as pre-trained Transformer models that can understand complex chemical instructions; conditional constraint code refers to programming language segments or configuration file streams that can be executed by a computer; hard constraints refer to the untouchable operational red lines set by the control processing unit, such as the valve opening degree not exceeding 80%; soft constraints refer to the rules set by the control processing unit that should be followed as much as possible under non-extreme conditions, but can be compromised under algorithmic penalties, such as the main air volume and temperature should be kept positively correlated as much as possible; search guidance conditions refer to the strategic restrictions set to narrow the optimization range and guide the algorithm to explore in the direction of expert habits, such as "a certain position number is slightly adjusted based on the current operating conditions".
[0041] Specifically, the control processing unit connects to and activates the large language model deployed on the inference nodes, reading the lengthy and potentially ambiguous natural language processing knowledge base. The control processing unit utilizes the large model's word segmentation and attention mechanisms to capture key entities in the documents related to specific system references, numerical limits, and operational sequences. Then, the control processing unit controls the large language model to generate computer code or configuration file streams corresponding to the target programming protocol, translating human experience into numerical rules. Next, the control processing unit further uses configuration scripts to functionally strip and categorize these constraint codes. Clear boundaries are categorized as hard constraints, priorities and linkage penalty mechanisms as soft constraints, and experience-based rules for narrowing down the search starting position and step size are categorized as search guiding conditions, facilitating hierarchical invocation of the differential evolution algorithm when calculating fitness.
[0042] In some embodiments, the control processing unit invokes a preset large language model to parse the refining process knowledge base and obtain semantic feature text. The control processing unit inputs prompt words containing operating condition descriptions into the large language model and extracts a semantic outline containing the causal relationships and limitations of the operating conditions. Next, the control processing unit extracts the equipment operation safety limits and process parameter association logic corresponding to the control system tag number parameters from the semantic feature text to obtain structured constraint text. The control processing unit performs regular expression matching and extraction on the tag names and specific numerical values in the natural language, converting them into structured text such as tables or JSON. Then, based on the principle that local constraints take precedence over global constraints, the control processing unit removes logically conflicting items from the structured constraint text to obtain conflict-free constraint text. When the control processing unit identifies a contradiction between a general rule and a special rule for a specific grade, it automatically retains the special rule with more specific preconditions, eliminating logical conflicts that could lead to deadlocks in subsequent algorithms. Finally, the control processing unit invokes a pre-defined large language model to convert the conflict-free constraint text into conditional constraint code in the target programming language. The control processing unit then uses the large model to write the structured rules into conditional decision statements in Python code. The conditional constraint code here is not limited to Python; it can also be in other target programming languages such as Java, C, or C++.
[0043] Furthermore, in some embodiments, the control processing unit can classify the condition constraint code into hard constraints, soft constraints, and search guidance conditions according to the constraint logic type in the following ways: The control processing unit identifies threshold judgment statements in the code and encapsulates them as hard constraints, which are used to directly eliminate out-of-bounds candidate parameter solutions before algorithm evaluation; The control processing unit identifies logical judgments in the code that reflect the adjustment of priority and the positive and negative correlation of multiple parameters, and transforms them into penalty functions in soft constraints, which are used to add penalty values to parameter solutions that do not conform to the physical linkage law when calculating fitness; The control processing unit identifies operational experience codes such as "smooth transition from the current working condition" and "small multiple times", packages them as search guidance conditions, and uses these conditions to control the values of mutation scaling factor and crossover probability in the differential evolution algorithm, guiding the candidate population to always perform smooth optimization within the neighborhood of the current stable working point.
[0044] Using a large language model as the engine for knowledge parsing and code conversion is only a preferred implementation method. In practical industrial applications, those skilled in the art should understand that the large language model can be equivalently replaced by other knowledge parsing engines, expert systems, or rule translation modules built on natural language processing (NLP) and knowledge graphs that have the ability to generate natural language and structured rules.
[0045] 104. In response to the received target quality control index command, obtain the real-time control system tag number parameters under the current working condition, and use the real-time control system tag number parameters as the initial population center to initialize the preset differential evolution algorithm candidate population, which includes multiple candidate tag number parameter combinations.
[0046] Target quality control index instructions refer to electronic commands automatically issued by refining and chemical production scheduling operators or upper-level optimization software, containing target values for the desired product quality. For example, an intervention instruction to set the upper limit of the freezing point of a specific batch of aviation kerosene to -47 degrees Celsius. Real-time control system tag parameters refer to sensor readings that the control processing unit instantly collects from the field distributed control system, reflecting the current steady-state environment of the physical equipment, such as the current set temperature of the reaction tower. Initial population center refers to the coordinates of the starting reference point for the algorithm's outward expansion and mutation in the multidimensional parameter optimization mathematical space. Differential evolution algorithm refers to the control processing unit initiating a global heuristic optimization strategy based on swarm intelligence, which searches for the optimal control solution with the minimum prediction error by simulating the mutation, crossover, and selection processes in biological evolution. Candidate population refers to the collection of all individuals participating in optimization and mutual information exchange in each generation of the genetic evolution algorithm. Candidate tag parameter combination refers to each specific, independent individual in the population, which represents a hypothetical operating scheme for jointly adjusting various control valves or setpoints of the field equipment.
[0047] Specifically, when operators input desired quality control and inspection indicators on the human-machine interface or when the formula system automatically issues a requirement to switch to a new grade, the control processing unit obtains real-time data from the actual refining unit at various highly relevant control nodes via the internal industrial network gateway. Considering that changes in industrial production parameters should follow a smooth transition, the control processing unit cannot blindly and randomly distribute parameter seeds across the entire operable range. Instead, it precisely uses this set of real-time operating data extracted from the real physical system as a divergence reference point, i.e., the initial population center. Subsequently, based on the size of the mutation operator fixed in the algorithm, the control processing unit generates multiple sets of control parameters with slight numerical perturbations within a specific neighborhood range near this reference center point. This is akin to distributing multiple selectable exploratory adjustment schemes in a multi-dimensional space with the current operating conditions as the core, thus forming the first generation of candidate populations for the differential evolution algorithm, ready for subsequent iterative testing.
[0048] In some embodiments, the control processing unit can initialize a candidate population for a preset differential evolution algorithm by using the real-time control system tag parameters as the initial population center in the following manner: The control processing unit expands and constructs the initial population based on a random perturbation mechanism of a normal Gaussian distribution. First, the control processing unit extracts the set of real-time control system tag parameters returned by physical instruments and uses it as the mean starting point vector in a multi-dimensional high-dimensional coordinate system. Second, the control processing unit reads the maximum allowable variance boundary value for a single stable adjustment that is allowed to be performed by the process operator, defined by preset search guidance conditions, and constructs the corresponding mathematical covariance diagonal matrix within the algorithm based on this value, for example, limiting a single temperature fluctuation to a variance of no more than 2 degrees. Finally, the control processing unit calls a Gaussian distribution random number generation function of a pseudo-random environment to generate dozens or hundreds of multi-dimensional random bias vectors that conform to the normal distribution attribute of the center and directly adds them to the center mean point, thereby forming a diverse set of candidate tag parameter combinations that are densely distributed near the current operating condition and sparsely distributed far away.
[0049] 105. In each iteration of the differential evolution algorithm, hard constraints are applied to limit the operational boundaries of the candidate population to obtain an effective candidate population.
[0050] Operational boundaries refer to the boundaries within a mathematical selection space containing numerous parameters, constructed using the maximum and minimum values defined by the attributes of each control system tag itself, that support the algorithm in reasonably attempting legal attempts. Valid candidate population refers to the set of qualified strategies that, after the control processing unit has performed boundary checks and filtering on each of the multiple candidate tag parameter combinations in the newly generated candidate population, ultimately retains the strategies that conform to all safe operation definitions.
[0051] Specifically, because the differential evolution algorithm explores the parameter space randomly based on a multi-dimensional vector addition mechanism during mutation and crossover steps, this mechanism can easily lead to some candidate position parameter combinations in the newly generated candidate population exceeding the mechanical operating limits of the underlying equipment or the safety allowable range of the refining process. To prevent illegal candidate position parameter combinations from entering the subsequent model evaluation stage or even being distributed to the actual control loop, the control processing unit initiates a boundary review procedure for the entire candidate population after each population evolution iteration. The control processing unit calls the hard constraint code pre-converted by the large language model, using this hard constraint as the legality judgment node for the continued transmission of control system position parameters. Subsequently, the control processing unit traverses and reads the data structure of each candidate position parameter combination in the candidate population, parses and extracts the values of each control system position parameter contained therein, and compares the extracted values of each control system position parameter with the upper and lower limit operation boundary thresholds defined in the hard constraint. If the control processing unit determines that a candidate position parameter combination contains a position parameter that exceeds the safe interval threshold, the control processing unit triggers an operation boundary restriction mechanism for that candidate position parameter combination. For example, the control processing unit directly destroys and removes the candidate position parameter combination carrying the record of exceeding the limit. The control processing unit continues to execute the above data traversal and restriction processing instructions until it is confirmed that all candidate position parameter combinations in the candidate population generated in this iteration meet the hard constraints. Finally, the control processing unit saves the parameter set after the boundary restriction processing is completed, obtains the valid candidate population, and outputs it to the next calculation process.
[0052] 106. Input the effective candidate population into the data to drive the model and obtain the corresponding prediction quality control indicators.
[0053] Predictive quality control indicators refer to the numerical values output by a data-driven model after receiving input data and performing forward inference calculations. These values represent the final quality parameters of the refining products that the refining system is expected to generate under this specific combination of candidate position parameters.
[0054] Specifically, due to the complex physical and chemical synergistic coupling between the tag parameters of different control systems, the control processing unit cannot infer the product quality trend after parameter adjustment using simple linear formulas. Therefore, the control processing unit relies on a data-driven model for computation. First, the control processing unit reads the effective candidate population from memory, converts the data format of each dispersed candidate tag parameter combination, and reorganizes it into a data structure that meets the feature structure requirements of the input layer of the data-driven model, such as a fixed-length feature vector. Next, the control processing unit sends the formatted effective candidate population data in batches to the receiving tensor node of the data-driven model through an internal application programming interface or function call instructions. After receiving the input data, the data-driven model uses its internal node weight allocation, decision tree branch structure, and mapping logic, which are fixed in the system during the training phase, to perform conditional judgments and numerical calculations on each of the input tag parameter features layer by layer. Finally, the control processing unit receives the floating-point values returned by the model deduction calculation from the output layer of the data-driven model, and establishes a memory mapping relationship between these values and the candidate tag parameter combinations of the source input, thereby obtaining the corresponding predicted quality control indicators.
[0055] 107. Based on the deviation between the predicted quality control index and the target quality control index in the instruction, as well as the soft constraints, calculate the fitness of each candidate position parameter combination in the effective candidate population.
[0056] The target quality control index refers to the quality benchmark value that the product needs to ultimately achieve, as explicitly set in the target quality control index instruction, such as the target freezing point value of -47 degrees Celsius; the deviation refers to the degree of difference between the predicted quality control index and the target quality control index, used to measure the gap between the current candidate solution and the ideal state; the fitness is a mathematical score used to comprehensively evaluate the merits of the candidate position parameter combination. This fitness score not only considers the indicator prediction deviation, but also includes the penalty value for violating operational experience.
[0057] Specifically, the control processing unit first extracts the predicted quality control index of a specific candidate tag parameter combination and performs mathematical operations such as subtraction with the target quality control index input by the operator to calculate the deviation of the combination purely in the product quality dimension. Next, the control processing unit performs a deep logical judgment on the internal parameter relationships of the candidate tag parameter combination, invoking preset soft constraints. The control processing unit determines whether the changing trends of multiple control system tag parameters within the combination conform to the positive and negative correlations specified in the process, or whether the order of their adjustment variables conforms to the set adjustment priority. If the control processing unit finds that although the predicted index deviation of the combination is very low, but it has performed operations that violate process linkage rules, such as "simultaneously increasing the reaction temperature and decreasing the main air volume," the control processing unit will calculate a corresponding penalty value. Finally, the control processing unit combines the deviation value with the accumulated penalty values for violating constraints through a weighted sum to generate the final fitness value of the candidate tag parameter combination. The better the fitness value, the greater the probability that the combination will survive and be selected in the next generation of the differential evolution algorithm.
[0058] In some embodiments, the process of calculating the fitness of each candidate position parameter combination in the effective candidate population based on the deviation between the predicted quality control index and the target quality control index in the instruction, as well as soft constraints, can be implemented in the following way: First, the control processing unit extracts the predicted quality control index and the target quality control index of the candidate position parameter combination, and calculates the absolute value of the difference between the two as the basic deviation score; Second, the control processing unit iterates through the compliance of the candidate position parameter combination with all preset soft constraints. Whenever a violation of a position linkage relationship or priority rule is detected, the control processing unit accumulates the fixed static penalty weight value of the rule preset in the configuration file into the total penalty score; Finally, the control processing unit linearly adds the basic deviation score and the total penalty score to obtain the final comprehensive fitness of the combination. The smaller the fitness score, the higher the fit between the combination and the business requirements and process logic.
[0059] 108. Using fitness as the evaluation criterion, iterative optimization is performed under the constraints of the candidate position parameter combination under the search guidance conditions until the differential evolution algorithm converges, thereby obtaining the operation optimization scheme of the position parameter of the real-time control system. Based on the operation optimization scheme, control commands are generated to drive the control mechanism of the refining and chemical production process to adjust the corresponding physical parameters.
[0060] Iterative optimization refers to the cyclical trial-and-error process in which the control processing unit repeatedly utilizes the characteristic genes of excellent individuals in the population to generate a new generation of solution sets through mathematical mutation and crossover; convergence of the differential evolution algorithm refers to the system's stable state after multiple iterations, where the optimal fitness in the population no longer decreases significantly within several consecutive cycles or reaches the set maximum number of generations; the operation optimization scheme refers to the selected optimal candidate combination of position parameters, representing the theoretically best operation strategy; control commands refer to the electrical communication data packets that convert the operation optimization scheme into data packets that can be directly recognized and executed by the underlying equipment; the control mechanism refers to the physical equipment that specifically performs actions at the refining and chemical production site, such as regulating valves or variable frequency motors; physical parameters refer to the readings of the objective environment directly changed by the controlled mechanism, such as the actual pressure or temperature in a pipeline.
[0061] Specifically, the control processing unit not only uses fitness as an evaluation criterion but also directly maps the pre-refined search guidance conditions to the underlying mathematical constraints of the control evolution framework. To fundamentally eliminate the jumps in control parameters and unpredictable physical conflicts caused by traditional optimization, the control processing unit, according to the constraints of the search guidance conditions, strictly limits the mutation scaling factor and crossover probability of the differential evolution algorithm to an adaptively shrinking numerical range dynamically defined by these conditions. This mechanism ensures that each combination of candidate position parameters generated from parent hybridization is forcibly locked onto a safe and smooth transitional process-physical co-evolution trajectory, eliminating the possibility of large-scale data mutations. After each generation of the population is generated, the control processing unit uses fitness to retain the best-performing individuals and eliminates poorly performing individuals. The control processing unit determines that the algorithm has reached convergence by monitoring the fitness change curve of the optimal individual or when the preset maximum number of generations is reached. Once convergence is confirmed, the control processing unit terminates the iterative loop and extracts the candidate bit parameter combination with the best fitness performance in the population at this point, which is ranked first, as the final operational optimization scheme for the bit parameter of the real-time control system. Finally, the control processing unit converts the theoretically numerical operational optimization scheme into a standard executable control command through a specific communication protocol format at the industrial level, and sends it to the industrial network to drive the specified control motor or regulating valve to perform actions, thereby causing changes in the physical parameters of refining and chemical production.
[0062] The soft-sensor optimization control method for refining and chemical production quality control indicators in this embodiment first trains a data-driven model based on historical refining and chemical status data. Then, the control processing unit converts a natural language process knowledge base into hierarchical constraint code, establishing a dual-driven optimization foundation based on data patterns and process rules. Next, the control processing unit initializes the algorithm population with real-time tag parameters, eliminating out-of-limit combinations through hard constraints to ensure the safety of parameter operations. Finally, the control processing unit combines the quality control indicator deviation with the fitness of soft constraints, iteratively optimizing under search-guided conditions, ensuring that the algorithm's optimization trajectory aligns with the physical coordination logic of the actual process. This method alleviates the technical problem of conflicts between control variable combinations and actual operating conditions, allowing the optimized scheme to be transformed into implementable control commands.
[0063] The following provides a more detailed description of the process of the method provided in this implementation. Please refer to [link / reference]. Figure 2 This is another flowchart illustrating the soft measurement optimization control method for refining and chemical production quality control indicators in this application embodiment.
[0064] 201. Obtain historical status data of the refining and chemical production process and preprocess it to obtain a training dataset. Acquire a refining and chemical process knowledge base. The historical status data includes control system tag parameters and corresponding quality control indicators. The refining and chemical process knowledge base is expressed in natural language and includes at least equipment operating safety limits and process parameter correlation logic. (Refer to the execution process of step 101) 202. Based on the training dataset, train a data-driven model for predicting quality control indicators. (Refer to the execution process of step 102) Following step 202, the following steps are also performed: extract the sum of feature information gains generated by the data-driven model during training; sort the reference parameters of each control system in the training dataset in descending order according to the magnitude of the sum of feature information gains to obtain the feature contribution ranking sequence; output the feature contribution ranking sequence to the preset monitoring interaction interface to generate the influence factor correlation map of refining quality control indicators.
[0065] The sum of feature information gain represents the cumulative value of information gain generated by the control processing unit for each control system tag parameter when it is a split node in all decision trees during the data-driven model training process. This value quantifies the contribution of the control system tag parameter to the prediction of quality control indicators. For example, the cumulative information gain contributed by the temperature tag TI-1149 when it splits in all tree nodes of the gradient boosting tree is 0.35. The feature contribution ranking sequence refers to the ordered list formed by the control processing unit after arranging all control system tag parameters in the training dataset from largest to smallest according to the sum of feature information gain. The influence factor correlation graph is a visualization chart generated by the control processing unit based on the feature contribution ranking sequence. This graph presents the correlation strength between each control system tag parameter and the refining quality control indicators in the form of a bar chart or heat map.
[0066] Specifically, the control processing unit accesses the tree structure information stored internally in the data-driven model and traverses all decision trees constructed by the gradient boosting tree algorithm. For each control system tag parameter, the control processing unit identifies all positions where the parameter appears as a splitting feature in each tree node, extracts the information gain value brought by the parameter at each splitting node, and then sums the information gain values of the same control system tag parameter in all trees and all nodes to extract the feature information gain sum of the control system tag parameter.
[0067] The control processing unit repeatedly performs the above traversal and cumulative calculations for each control system tag parameter in the training dataset, ultimately obtaining a set of summed feature information gains for each tag parameter. Subsequently, the control processing unit uses these summed feature information gains as sorting keys to sort the control system tag parameters in the training dataset in descending order. The control processing unit places the tag parameter with the largest summed feature information gain at the top of the sequence, and arranges the parameters in descending order of value, resulting in a feature contribution ranking sequence. Finally, the control processing unit calls a data visualization interface program to convert the control system tag parameter names and corresponding summed feature information gains in the feature contribution ranking sequence into a graphical representation, generating a bar chart to display the importance ranking of each tag parameter. The control processing unit outputs the generated graphical data to a preset monitoring interactive interface via industrial Ethernet. This interface generates an influence factor correlation graph of refining quality control indicators, enabling on-site operators to intuitively identify which control system tag parameters have a decisive impact on quality control indicators.
[0068] The generated correlation graph is not merely a simple data visualization rule; its data output interface maintains a hard connection with the physical instrumentation and maintenance control center of the underlying control system. Specifically, considering that the data-driven model absorbs new samples for periodic incremental self-training in practical applications, the correlation graph is also dynamically refreshed with the model weights. Based on this, the method can be extended at this stage to implement a physical mechanism anomaly detection mechanism: when the monitoring system compares the feature contribution ranking sequence before and after the model incremental update and finds an abnormal drop in the feature contribution value of a certain item's label parameter (e.g., a drop exceeding a preset drop threshold), the control processing unit will directly generate alarm information based on the graph weight change and automatically trigger a mandatory self-verification or investigation command for the corresponding control mechanism (such as physical pipeline valves or sensor layers). This method applies changes in the model inference rules of the digital domain to maintain the reliable operation of the underlying physical equipment, improving the safety level of refining and chemical production.
[0069] In some embodiments, the quantification and visualization of feature contributions can be achieved as follows: The control processing unit first employs a feature importance extraction method based on the XGBoost data-driven model, then calls the built-in `get_score` interface function of the XGBoost data-driven model. This function returns a dictionary data structure, where the keys are the names of the control system position parameters, and the values are the sum of information gains of that parameter across all trees. Next, the control processing unit uses Python's `sorted` function to sort the key-value pairs in the dictionary in descending order of their numerical values, and then encapsulates the sorted control system position parameter names and their corresponding sums of feature information gains into a feature contribution ranking sequence. Finally, the control processing unit calls the matplotlib or echarts visualization library to render the sequence data into an interactive bar chart. The horizontal axis of the chart labels the control system position parameter names, and the vertical axis labels the sum of feature information gains. The control processing unit pushes the chart to the monitoring interactive interface via a web service.
[0070] 203. Invoke the preset large language model to convert the refining process knowledge base into conditional constraint code. (Refer to the execution process of step 103) In some embodiments, after the control processing unit calls the large language model to generate condition constraint code, it can classify the condition constraint code into hard constraints, soft constraints, and search-guided conditions according to the constraint logic type. Since the classification of constraint logic is based on the parsing and categorizing of the syntax and operational attributes of the initially generated code itself, and has no absolute sequential dependence on whether the code has undergone iterative error correction in the sandbox, it is feasible to classify it here.
[0071] 204. Extract historical state data under steady-state production conditions from the training dataset to obtain the test dataset, and build a sandbox execution environment isolated from the real-time production control loop.
[0072] Steady-state production refers to the relatively stable operating state of various process parameters during refining and chemical production over a relatively long period of time. Under this state, the control system tag parameters fluctuate little and show no significant trend changes. Historical state data refers to the monitoring and operation data of the refining and chemical unit recorded in the training dataset during a past period of operation. Test dataset refers to the subset of steady-state historical data selected by the control processing unit from the training dataset to verify the effectiveness of the condition constraint code. Sandbox execution environment refers to a virtual test environment built by the control processing unit that is completely isolated from the real-time production control loop. This environment can safely run and test the condition constraint code without affecting the actual production system.
[0073] As a preferred scheduling sequence, the aforementioned graph generation stage and the code closed-loop verification stages from steps 204 to 208 together constitute an offline logic safety verification and initialization phase independent of the online real-time control loop. The control processing unit executes this logic phase asynchronously during initial deployment or non-core production periods in the factory, thereby avoiding the blockage of the second- or millisecond-level online real-time control loop of the underlying control mechanism by complex code refactoring and large language model inference processes.
[0074] Specifically, after completing the initial conversion of the conditional constraint code, the control processing unit initiates a code quality verification program to ensure the reliability and security of the code. The control processing unit first performs time-series analysis on the training dataset, calculating the standard deviation and coefficient of variation of each control system tag parameter to identify time periods in the data where the fluctuation range of process parameters is less than a preset threshold. These time periods represent the refining unit in a stable operating state. The control processing unit further employs a sliding window statistical method to perform continuity checks on the historical state data within the identified stable time periods, eliminating data segments with abnormal jumps or instrument malfunctions to ensure the extracted data has good representativeness. After the above screening process, the control processing unit summarizes the historical state data that conforms to steady-state characteristics to obtain the test dataset. Simultaneously, the control processing unit creates an independent virtual operating environment within its computing resources. This environment, through multiple technical means such as network isolation, process isolation, and file system isolation, ensures complete separation from the real-time production control loop, constructing a sandbox execution environment to provide a reliable experimental platform for subsequent code security testing.
[0075] 205. Run the condition constraint code in the sandbox execution environment, and input the tag number parameters of each control system in the test dataset into the running condition constraint code in sequence to obtain the code execution feedback log including the parameter determination results.
[0076] The parameter determination result refers to the evaluation conclusion output by the condition constraint code after performing logical judgment on the input control system tag parameters, including whether the constraint condition is violated, which constraint is violated, and the detailed process of constraint checking; the code execution feedback log refers to the complete log file of the condition constraint code running process recorded in the sandbox execution environment. This log contains detailed information such as code execution status, input and output data, error messages, and performance statistics.
[0077] Specifically, the control processing unit deploys and starts the condition constraint code in the pre-built sandbox execution environment, loading the code module and completing initialization through a Python interpreter or other appropriate code execution engine. The control processing unit enables logging, configuring a logging system to capture all critical information during code execution, including function call trajectories, variable state changes, conditional decision branches, and exception handling. Subsequently, following a predetermined testing strategy, the control processing unit extracts control system tag number parameter data from the test dataset for each time segment, formats each set of parameter data into the input format required by the condition constraint code, and then passes the parameter data to the running condition constraint code through a function call interface. After receiving the input data, the condition constraint code first performs hard constraint checks and soft constraint evaluations on the static historical parameters in sequence. Furthermore, to verify the search guidance conditions regarding the dynamic optimization step size of the differential evolution algorithm in the code, the control processing unit, in a sandbox execution environment, applies a simulated dynamic Gaussian perturbation vector to the current input steady-state control system tag parameters using a pseudo-random function. This simulates the neighborhood variation characteristics generated during real iterations. Subsequently, the simulated perturbation parameter sequence carrying the risk of exceeding limits is fed into the search guidance conditions for boundary definition and step size interception verification. Through the above dynamic and static combined testing process, the condition constraint code performs a comprehensive constraint check on each input control system tag parameter, generating a comprehensive parameter determination result. The control processing unit completely records the input parameters, determination process, output results, and execution time of each code execution in a log file, obtaining a code execution feedback log including the parameter determination results.
[0078] 206. When there are runtime syntax errors in the code execution feedback log, or when the amount of data in the test dataset that is determined to violate constraints exceeds the first preset data amount threshold, extract the abnormal feature information from the code execution feedback log.
[0079] Runtime syntax errors refer to syntax errors, runtime exceptions, or logical errors that occur when conditional constraint code runs in the sandbox execution environment, such as undefined variables, function call failures, or array out-of-bounds errors. Violation of constraints means that the control system tag number parameters in the test dataset are determined by the conditional constraint code to not meet preset process safety limits or operating specifications. The first preset data volume threshold is a benchmark value for determining whether the conditional constraint code has logical defects. When the amount of data violating constraints exceeds this threshold, it indicates that the code may have overly strict or unreasonable constraint settings. Anomaly characteristic information refers to key information about code defects identified and extracted by the control processing unit from the code execution feedback log, including error type, error location, error cause, and related input / output data.
[0080] Specifically, the control processing unit performs comprehensive quality analysis and anomaly detection on the code execution feedback log. First, the control processing unit uses log parsing tools to perform structured analysis of the code execution feedback log, identifying error messages, anomaly records, and warnings in the log through methods such as regular expression matching and keyword retrieval. The control processing unit statistically analyzes the frequency and distribution of various runtime syntax errors appearing in the log, including different error types such as syntax parsing errors, variable reference errors, and function call anomalies. Simultaneously, the control processing unit statistically analyzes the number of data records in the test dataset that are judged to violate constraint conditions by the conditional constraint code, calculating the proportion of data violating constraint conditions to the total test dataset. When the control processing unit detects any form of runtime syntax error in the code execution feedback log, or finds that the amount of data judged to violate constraint conditions exceeds a first preset data volume threshold, the control processing unit further analyzes the relevant log entries, extracting specific contextual information at the time of the error, including the line number of the erroneous code, the names and values of the involved variables, the function call stack, and the characteristics of the input data that caused the error. The control processing unit organizes and summarizes this key information to form structured anomaly feature information.
[0081] 207. Generate modification prompts based on abnormal feature information, and input the modification prompts into a large language model for iterative code reconstruction to obtain the reconstructed condition constraint code.
[0082] Modification prompts refer to structured natural language instructions generated by the control processing unit based on anomaly characteristic information to guide the large language model in code repair. These prompts contain key elements such as error descriptions, modification suggestions, and expected results. Iterative code refactoring refers to the process by which the control processing unit uses the code generation capabilities of the large language model to gradually modify and optimize defective conditional constraint code. Post-refactoring conditional constraint code refers to the improved version of code generated after refactoring by the large language model, which has fixed the original defects. This code is more complete and reliable in terms of logical structure and functional implementation compared to the original code.
[0083] Specifically, the control processing unit first performs in-depth analysis and structured processing of the abnormal feature information, classifying and sorting different types of abnormalities according to error severity and repair priority, identifying different problem categories such as syntax errors, logical errors, and unreasonable constraint settings. For each type of abnormality, the control processing unit calls the built-in prompt word template generation engine to fill the predefined prompt word framework with key information such as error type, error location, related variables, and expected behavior from the abnormal feature information, forming specific and detailed modification guidance. When generating modification prompt words, the control processing unit not only describes the specific manifestation of the problem, but also provides modification suggestions based on professional knowledge of refining and chemical processes, such as "adjust the upper limit of temperature from 450 degrees to 500 degrees to meet the actual process requirements" or "fix the spelling error of variable TI_1149 to TI-1149". Subsequently, the control processing unit inputs the generated modification prompt words along with the original condition constraint code into the preset large language model. Through the model's code understanding and generation capabilities, the large language model refactors the code according to the specific guidance in the modification prompt words. After receiving modification prompts, the large language model analyzes the problems in the code and makes targeted modifications according to the requirements of the prompts, including correcting syntax errors, adjusting constraint parameters, optimizing logical structure, and improving exception handling mechanisms. Finally, it outputs the refactored condition constraint code that has been repaired and improved.
[0084] 208. Iteratively test the refactored condition constraint code until a new condition constraint code that does not generate abnormal characteristic information is obtained, and replace the original condition constraint code with the new condition constraint code.
[0085] Iterative testing refers to the testing process in which the control processing unit repeatedly executes steps 204-206 on the refactored condition constraint code, verifying the stability and correctness of the code through multiple rounds of testing; not generating abnormal characteristic information means that when the new condition constraint code runs in the sandbox execution environment, neither running syntax errors occur nor too much test data is judged as violating the constraints, indicating that the code has reached an acceptable quality standard.
[0086] Specifically, the control processing unit redeploys the refactored conditional constraint code to the sandbox execution environment, repeats the previous testing process, and performs comprehensive functional and stability testing on the new code using the same test dataset. The control processing unit monitors whether the refactored conditional constraint code still contains syntax errors, runtime exceptions, or logical defects during execution, and simultaneously counts the amount of data in the test dataset that is judged to violate constraints by the new code, evaluating the rationality of the constraint settings. If the control processing unit finds that the refactored conditional constraint code still has abnormal characteristics during testing, including new runtime errors or unreasonable constraint judgment results, the control processing unit will restart the abnormal feature extraction program, generate modification prompts for the new problems, and call the large language model again to refactor the code. The control processing unit continues to execute this iterative optimization cycle, performing complete testing and verification on the refactored code each time, gradually eliminating various defects and problems in the code. When the control processing unit confirms that the refactored conditional constraint code can run stably in the sandbox environment without generating any abnormal characteristics, and that the constraint judgment results on the test data meet expectations, the control processing unit determines that the code quality has met the deployment standards and identifies the newly generated refactored conditional constraint code as the new conditional constraint code. Finally, the control processing unit performs a code version replacement operation, deploying the fully verified new condition constraint code to the actual production environment, completely replacing the original defective condition constraint code, and ensuring that the subsequent refining and chemical production optimization control process can be based on reliable constraint logic.
[0087] 209. Divide the condition constraint code into hard constraints, soft constraints, and search-guided conditions according to the constraint logic type. (Refer to the execution process of step 103) It should be noted that, as described in step 203, the timing of the constraint logic partitioning step is flexible. If the control processing unit has not yet partitioned the constraint logic in step 203, then in this step, the new condition constraint code obtained through iterative testing in the sandbox execution environment will be classified.
[0088] If classification is performed after sandbox iteration and error correction, it ensures that the classified code rules have eliminated syntax errors and logical violations. This avoids redundant computational consumption caused by early classification label shifts or invalidations due to code reconstruction in step 207 of the large language model, thus requiring repeated partitioning. This provides a stable and reliable code structure for subsequent steps. If partitioning has been completed in advance after step 203, this step can be regarded as the synchronous reuse and structural confirmation of the classification features of the new conditional constraints.
[0089] 210. In response to the received target quality control index command, obtain the real-time control system tag number parameters under the current operating condition, and use the real-time control system tag number parameters as the initial population center to initialize the preset candidate population of the differential evolution algorithm. The candidate population includes multiple candidate tag number parameter combinations. (Refer to the execution process of step 104) 211. In each iteration of the differential evolution algorithm, hard constraints are applied to limit the operational boundaries of the candidate population, thus obtaining a valid candidate population. (Refer to the execution process of step 105) 212. Input the effective candidate population into the data-driven model to obtain the corresponding prediction quality control indicators. (Refer to the execution process of step 106) 213. Based on the deviation between the predicted quality control index and the target quality control index in the instruction, as well as the soft constraints, calculate the fitness of each candidate position parameter combination in the effective candidate population. (Refer to the execution process of step 107) 214. Using fitness as the evaluation criterion, perform iterative optimization under the constraints of the search guidance conditions on the candidate bit parameter combinations until the differential evolution algorithm converges, thus obtaining the operational optimization scheme for the bit parameters of the real-time control system. (Refer to the execution process of step 108) 215. Generate control commands based on the operation optimization scheme to drive the control mechanism of the refining and chemical production process to adjust the corresponding physical parameters.
[0090] This step specifically includes the following steps: outputting the operation optimization plan and corresponding predicted quality control indicators to the preset operation terminal and displaying them visually; receiving the control confirmation instruction and corresponding operation reason text fed back by the operation terminal based on the operation optimization plan, the control confirmation instruction includes an execution permission instruction and an execution rejection instruction; in response to the control confirmation instruction being an execution permission instruction, generating control instructions based on the operation optimization plan to drive the control mechanism of the refining and chemical production process to adjust the corresponding physical parameters.
[0091] The operation optimization scheme refers to the optimal candidate tag parameter combination obtained by the control processing unit after convergence through the differential evolution algorithm. This combination includes specific adjustment value suggestions for the tag parameters of each control system in the refining and chemical production process. The operation terminal refers to the human-machine interaction device used by operators at the refining and chemical production site. This device is usually an industrial computer or touch screen terminal deployed at the operator station. The control confirmation instruction refers to the execution decision instruction made by the operator on the operation terminal for the operation optimization scheme. This instruction includes two types: allow execution instruction and reject execution instruction. The allow execution instruction indicates that the operator adopts the system suggestion, and the reject execution instruction indicates that the operator rejects the scheme. The operation reason text refers to the natural language description of the decision basis entered by the operator through the text box on the operation terminal, such as "The current reaction temperature is close to the upper limit, and the TI1149 temperature increase is not accepted."
[0092] Specifically, the control processing unit first encapsulates the adjustment values of various control system tag parameters and corresponding predicted quality control indicators included in the operation optimization plan into a structured data packet. The control processing unit designs a UI interface program and outputs this data packet to a preset operation terminal via industrial Ethernet. On the operation terminal's display interface, the control processing unit calls visualization components to integrate and push the data packet to the operator station monitoring interface in the form of visual charts. The control processing unit intuitively displays the operation optimization plan and predicted quality control indicators in the form of tables, graphs, or dashboards, providing operators with an intuitive understanding of the operating conditions. After reviewing the system suggestions, the operator reviews the displayed operation optimization plan on the operation terminal. Based on the current actual operating conditions and their own process experience, the operator can make a decision to adopt or reject the plan. The operator provides control confirmation commands to the control processing unit by clicking on convenient interactive controls provided on the operation terminal interface. When making a decision, the operator can selectively input brief justifications and enter the operation reason text in the text box.
[0093] Due to the complexity of actual industrial physical conditions, if the operator believes that the adjustment given by the operation optimization plan is correct in the opposite direction but the adjustment range is too extreme, the operator can manually fine-tune the optimal recommended values of some predicted tag parameters on the visual interface of the operation terminal (for example, changing the system-suggested exhaust valve opening of +5% to +3%) before confirming and issuing the change. In this case, the operation terminal will feed back the execution plan, which has been fine-tuned by the operator, as a generalized permission to execute to the control processing unit. The underlying physical control commands generated based on the permission to execute, as well as the target context data used for incremental training of the data-driven model in the feedback link, are all recorded in association with this actual confirmed plan, which includes human prior adjustments.
[0094] In equivalent implementation scenarios for fully automated closed-loop control architectures in industries, the aforementioned operating terminals are not limited to physical human-machine interfaces, but also include high-level safety monitoring agents (AI agents) virtual terminals deployed at system edge nodes. Correspondingly, the execution instructions and operational justification texts can be automatically generated and instantly fed back by the safety monitoring agent based on its built-in verification rules. Therefore, the aforementioned execution instructions and justification texts can also be automatically generated by local edge AI agents to adapt to fully automated closed-loop control architectures.
[0095] The control processing unit receives control confirmation commands and operation reason texts from the operation terminal and determines the type of the received control confirmation commands. When the control processing unit recognizes that the control confirmation command is an executeable command, it encodes and converts the adjustment values of each control system tag number parameter in the operation optimization scheme according to the communication protocol format such as Modbus or OPC required by the distributed control system, generating a control command data frame containing information such as the target tag number address, set value, and timestamp. The control processing unit sends the generated control command to the underlying control network of the refining and chemical production process through the fieldbus. The control command is received and parsed by the PLC or DCS controller of the corresponding control mechanism. The control mechanism executes physical adjustment actions according to the set values in the control command, such as adjusting the valve opening from 60% to 65%, thereby driving the corresponding physical parameters in the refining and chemical production process to change, such as the reaction temperature rising from 480 degrees Celsius to 485 degrees Celsius, ultimately achieving optimized control of the refining and chemical production process.
[0096] Following step 215, the following steps are performed: The real-time control system tag number parameters, operation optimization scheme, control confirmation command, and operation reason text are associated and concatenated to obtain context data; the context data is then structured and stored to obtain interactive feedback records; when the amount of interactive feedback records including the refusal to execute command is greater than or equal to a second preset data amount threshold, the actual tag number parameter data of the refining and chemical production process within the corresponding cycle is obtained; after a preset delay period, the actual quality control indicators generated by the refining and chemical production process are obtained; the actual tag number parameter data is used as input features, and the input features are paired and associated with the actual quality control indicators to obtain incremental training samples; the data-driven model is trained incrementally based on the incremental training samples to obtain an updated data-driven model, which is used to perform the next cycle's refining and chemical quality control indicator prediction and operation optimization; the operation reason text is stored in the refining and chemical process knowledge base to supplement hard constraints, soft constraints, and search guidance conditions.
[0097] Context data refers to the complete data record formed by the control processing unit after associating and combining all key information in a human-machine interaction process. This data record includes full operating condition data at the time of interaction, i.e., real-time control system tag parameters, XGBoost model predictions, differential evolution algorithm operation suggestions, i.e., operation optimization schemes, operator's final decision, i.e., control confirmation instructions, and operator's input text reasons, i.e., operation reason text. Interaction feedback record refers to the historical database formed by the control processing unit after structuring and storing the context data generated by multiple human-machine interactions. The second preset data volume threshold refers to the minimum number of interaction feedback records required to start incremental model training. The preset delay period is the time interval required for the impact of the actual operating condition parameters after their establishment to be transmitted to the refining and chemical quality control indicators. The actual quality control indicators refer to the product quality parameter values actually measured by LIMS testing or online analyzers after the impact of the operating condition parameters after their establishment has been transmitted to the refining and chemical quality control indicators. Input features are the set of independent variables used to train the data-driven model, which in the incremental training scenario are the actual tag parameter data of the refining and chemical production process in the corresponding period. Incremental training samples refer to the new training data formed after establishing a mapping relationship between the actual tag parameter data and the actual quality control indicators.
[0098] Specifically, after each human-computer interaction and control command issuance, the control processing unit initiates an interaction data recording program. The UI program fully records the context data of each interaction. The control processing unit sequentially extracts five key types of information involved in this interaction: full-scale operating data at the time of interaction (i.e., real-time control system tag parameters), the predicted value of the XGBoost model (i.e., predicted quality control indicators), the operational suggestions of the differential evolution algorithm (i.e., operational optimization schemes), the operator's final decision (i.e., control confirmation commands), and the textual reasons entered by the operator (i.e., operational reason text). The control processing unit associates and concatenates these five types of data according to a predefined JSON or XML data structure to form context data containing complete interaction context information. This data undergoes programmed structured processing. The control processing unit adds unique interaction identifiers, timestamps, and other metadata fields to the context data and stores the processed context data in the human feedback database, thus obtaining interaction feedback records. As interaction feedback records continue to accumulate, when the feedback data reaches a certain scale—specifically, when the number of rejected execution command records in the interaction feedback record database is greater than or equal to a second preset data volume threshold—the control processing unit initiates an incremental training preparation program. At this point, the accumulated amount acts as a trigger for the model mismatch with the current operating conditions, and the control processing unit acquires the actual tag parameter data of the refining and chemical production process during the corresponding cycle in which these rejection records were generated. These actual DCS readings, which reflect human intervention or real physical constraints, constitute the basic data set used for correction.
[0099] The control processing unit initiates a timed monitoring task for each record in the target context data set. After the interaction record occurs (i.e., the time the operating parameters are established), it waits for a preset delay period. This delay period ensures sufficient time for changes in refining and chemical production indicators to be reflected in the quality control indicators. After the delay period ends, the control processing unit accesses the LIMS database or the online analyzer's OPC interface to obtain the actual quality control indicator values (i.e., LIMS test results or online analyzer results) generated by the refining and chemical production process during the actual cycle. The control processing unit extracts the obtained actual tag parameter data as an input feature vector and uses the obtained actual quality control indicators as output labels. Since the actual DCS input features and LIMS output labels necessarily contain objective laws consistent with the current physical production reality, the control processing unit establishes an implicit mapping relationship between the actual tag parameter data and the actual quality control indicators, forming new training sample pairs. Multiple such sample pairs are then aggregated to obtain an incremental training sample set, which is returned to the data-driven model training process as incremental training samples. The control processing unit loads the currently used XGBoost data-driven model and inputs the incremental training sample set into the model training interface for incremental training of the XGBoost model. The control processing unit uses incremental learning algorithms, such as XGBoost's `xgb_model` parameter, to specify the existing model for continued training. It locally updates the internal tree structure and node weights of the data-driven model, and through multiple rounds of iterative optimization, enables the data-driven model to learn data patterns under new operating conditions, achieving continuous closed-loop evolution. Finally, an updated data-driven model is obtained to execute the next cycle of refining quality control indicator prediction and operational optimization.
[0100] The actual tag number parameter data extracted above has the same feature dimension as the control system tag number parameters in the initial training dataset, thus satisfying the feature consistency requirement of the incremental training API.
[0101] The soft-sensor optimization control method for quality control indicators in refining and chemical production, as described in this application, involves a control processing unit that first preprocesses historical data and trains a data-driven model. It extracts feature information gains to generate an influencing factor correlation graph, clarifying the weight of the tag parameters on the quality control indicators. Next, the control processing unit converts the process knowledge base into conditional constraint code, iteratively tests and reconstructs the code in a sandbox environment, eliminating syntax and logical defects and improving the reliability of the constraint code. Then, the control processing unit initializes the algorithm population with real-time parameters, performs iterative optimization through hierarchical constraint screening and fitness calculation, and generates control commands based on manual verification, reducing the equipment operation risks caused by aggressive algorithm schemes. Finally, the control processing unit stores interactive feedback records and constructs incremental training samples to incrementally train the data-driven model, allowing the model to adapt to changes in production conditions and maintain prediction accuracy. This method alleviates the problems of conflicts between control variable combinations and actual operating conditions, and the drift of model prediction accuracy with operating conditions, improving the implementability of adjustment schemes and the sustainability of quality control.
[0102] The methods provided in the above embodiments can be executed by a control processing unit. The control processing unit in the embodiments of this invention is described below from a hardware processing perspective; please refer to [link to relevant documentation]. Figure 3 This is a schematic diagram of the physical device structure of the control processing unit in the embodiments of this application.
[0103] It should be noted that, Figure 3 The structure of the control processing unit shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0104] like Figure 3 As shown, the control processing unit includes a Central Processing Unit (CPU) 301, which can perform various appropriate actions and processes based on a program stored in Read-Only Memory (ROM) 302 or a program loaded from storage portion 308 into Random Access Memory (RAM) 303, such as executing the methods described in the above embodiments. The RAM 303 also stores various programs and data required for system operation. The CPU 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0105] The following components are connected to I / O interface 305: input section 306 including audio input devices, push-button switches, etc.; output section 307 including a liquid crystal display (LCD) and audio output devices, indicator lights, etc.; storage section 308 including a hard disk, etc.; and communication section 309 including a network interface card such as a LAN (Local Area Network) card, modem, etc. Communication section 309 performs communication processing via a network such as the Internet. Drive 310 is also connected to I / O interface 305 as needed. Removable media 311, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 310 as needed so that computer programs read from them can be installed into storage section 308 as needed.
[0106] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing computer programs for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 309, and / or installed from removable medium 311. When the computer program is executed by central processing unit (CPU) 301, it performs the various functions defined in the present invention.
[0107] It should be noted that specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0108] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. Each block in a flowchart or block diagram may represent a module, program segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those shown in the drawings.
[0109] Specifically, the control processing unit in this embodiment includes a processor and a memory. The memory stores a computer program. When the computer program is executed by the processor, it implements the soft measurement optimization control method for refining and chemical production quality control indicators provided in the above embodiment.
[0110] In another aspect, the present invention also provides a computer-readable storage medium, which may be included in the control processing unit described in the above embodiments; or it may exist independently and not assembled into the control processing unit. The storage medium carries one or more computer programs that, when executed by a processor of the control processing unit, cause the control processing unit to implement the soft measurement optimization control method for refining and chemical production quality control indicators provided in the above embodiments.
[0111] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
[0112] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as meaning "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as meaning "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".
[0113] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. 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 processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.
[0114] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A soft measurement optimization control method for quality control indicators in refining and chemical production, applied to the control processing unit of control equipment, characterized in that, The method includes: Historical state data of the refining and chemical production process is acquired and preprocessed to obtain a training dataset and a refining and chemical process knowledge base. The historical state data includes control system tag parameters and corresponding quality control indicators. The refining and chemical process knowledge base is expressed in natural language and includes at least equipment operating safety limits and process parameter correlation logic. Based on the training dataset, a data-driven model for predicting quality control indicators is trained. The pre-defined large language model is invoked to convert the refining process knowledge base into condition constraint code, and the condition constraint code is divided into hard constraint conditions, soft constraint conditions and search guidance conditions according to the constraint logic type. In response to the received target quality control index instruction, the real-time control system tag number parameter under the current working condition is obtained, and the real-time control system tag number parameter is used as the initial population center to initialize the candidate population of the preset differential evolution algorithm. The candidate population includes multiple combinations of candidate tag number parameters. In each iteration of the differential evolution algorithm, the hard constraints are invoked to limit the operational boundaries of the candidate population, thereby obtaining an effective candidate population; The effective candidate population is input into the data-driven model to obtain the corresponding prediction quality control index; Based on the deviation between the predicted quality control index and the target quality control index in the target quality control index instruction, and the soft constraint conditions, calculate the fitness of each candidate position parameter combination in the effective candidate population. Based on the fitness as the evaluation criterion, iterative optimization is performed under the constraints of the search guidance conditions on the candidate position parameter combinations until the differential evolution algorithm converges, thereby obtaining the operation optimization scheme of the position parameter of the real-time control system. Based on the operation optimization scheme, control commands are generated to drive the control mechanism of the refining and chemical production process to adjust the corresponding physical parameters.
2. The method according to claim 1, characterized in that, Based on the training dataset, a data-driven model for predicting quality control indicators is trained, specifically including: Using the gradient boosting tree algorithm as a framework, an initial data-driven model for predicting quality control indicators is constructed. Determine the hyperparameter space to be optimized for the initial data-driven model, wherein the hyperparameter space to be optimized includes at least the learning rate, tree depth, number of trees, and regularization parameter; The optimal hyperparameter combination is obtained by searching the hyperparameter space to be optimized. Based on the optimal hyperparameter combination and the training dataset, the initial data-driven model is trained to obtain the trained data-driven model.
3. The method according to claim 2, characterized in that, After obtaining the trained data-driven model, the method further includes: Extract the sum of feature information gains generated by the data-driven model during training; Based on the magnitude of the sum of the feature information gains, the position parameters of each control system in the training dataset are sorted in descending order to obtain the feature contribution ranking sequence. The feature contribution ranking sequence is output to a preset monitoring interaction interface to generate an impact factor correlation map of refining and chemical quality control indicators.
4. The method according to claim 1, characterized in that, The pre-defined large language model is invoked to convert the refining and chemical process knowledge base into conditional constraint code, specifically including: The preset large language model is invoked, and the large language model is used to parse the refining process knowledge base to obtain semantic feature text; Extract the equipment operation safety limit and the process parameter association logic corresponding to the control system tag number parameter from the semantic feature text to obtain the structured constraint text; Based on the principle that local constraints take precedence over global constraints, logically conflicting items in the structured constraint text are removed to obtain conflict-free constraint text. The preset large language model is invoked to convert the conflict-free constraint text into the condition constraint code of the target programming language.
5. The method according to claim 1, characterized in that, After the step of converting the refining process knowledge base into condition constraint code, the method further includes: Historical state data under steady-state production conditions are extracted from the training dataset to obtain the test dataset, and a sandbox execution environment isolated from the real-time production control loop is constructed. Run the condition constraint code in the sandbox execution environment, and input each of the control system tag number parameters in the test dataset into the running condition constraint code in sequence to obtain a code execution feedback log including parameter determination results; When there is a runtime syntax error in the code execution feedback log, or when the amount of data in the test dataset that is determined to violate the constraints is greater than the first preset data amount threshold, abnormal feature information is extracted from the code execution feedback log. Based on the abnormal feature information, modification prompt words are generated, and the modification prompt words are input into the large language model for iterative code reconstruction to obtain the reconstructed condition constraint code; The reconstructed condition constraint code is iteratively tested until a new condition constraint code that does not generate abnormal feature information is obtained, and the original condition constraint code is replaced with the new condition constraint code.
6. The method according to claim 1, characterized in that, Based on the aforementioned operation optimization scheme, control commands are generated to drive the control mechanism of the refining and chemical production process to adjust the corresponding physical parameters, specifically including: The operation optimization scheme and the corresponding predicted quality control indicators are output to a preset operation terminal and displayed visually. The system receives a control confirmation instruction and a corresponding operation reason text from the operation terminal based on the operation optimization scheme. The control confirmation instruction includes an allow execution instruction and a refuse execution instruction. In response to the control confirmation instruction being the permission to execute instruction, the control instruction is generated based on the operation optimization scheme to drive the control mechanism of the refining and chemical production process to adjust the corresponding physical parameters.
7. The method according to claim 6, characterized in that, After generating the control command based on the operation optimization scheme to drive the control mechanism of the refining and chemical production process to adjust the corresponding physical parameters, the method further includes: The real-time control system tag number parameters, the operation optimization scheme, the control confirmation command, and the operation reason text are associated and concatenated to obtain context data, and the context data is stored in a structured manner to obtain an interaction feedback record. When the amount of data in the interactive feedback record including the refused execution instruction is greater than or equal to the second preset data amount threshold, the actual tag parameter data of the refining and chemical production process in the corresponding cycle is obtained. After a preset delay period, the actual quality control indicators generated by the refining and chemical production process are obtained; The actual tag number parameter data is used as input features, and the input features are paired and associated with the actual quality control indicators to obtain incremental training samples; Based on the incremental training samples, the data-driven model is trained incrementally to obtain an updated data-driven model, which is then used to predict refining and chemical quality control indicators and optimize operations in the next cycle. The text explaining the reasons for the operation is stored in the refining and chemical process knowledge base to supplement the hard constraints, soft constraints, and search guidance conditions.
8. A control processing unit, characterized in that, Includes one or more processors and memory; The memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the control processing unit to perform the method as described in any one of claims 1-7.
9. A computer-readable storage medium comprising computer instructions, characterized in that, When the computer instructions are executed on the control processing unit, the control processing unit performs the method as described in any one of claims 1-7.
10. A computer program product, comprising a computer program / instructions, characterized in that, When the computer program / instructions are run on the control processing unit, the control processing unit performs the method as described in any one of claims 1-7.