Controller model matrix control script construction method and controller model matrix control method

By building a controller model matrix control script, the problem of difficulty in predicting controller response when characteristics change is solved, and online model adjustment and performance improvement are achieved.

CN120143622APending Publication Date: 2025-06-13CHINA PETROLEUM & CHEMICAL CORP +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510310063.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-17
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

Existing prediction controllers find it difficult to respond in a timely manner when the controlled object characteristics or control indicators change significantly, resulting in model-object mismatch and affecting control performance.

Method used

By building a controller model matrix control script, obtain the controller's model class and generate a model interface, map sub-models to the script framework, obtain change rules and compile scripts to achieve online model adjustment.

Benefits of technology

It realizes timely adjustment of the controller model, avoids object model mismatch, improves control performance, and ensures rapid response of the controller under different working conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120143622A_ABST
    Figure CN120143622A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of predictive control, and discloses a controller model matrix control script construction method and a controller model matrix control method, comprising the following steps: obtaining a model class of a controller, and generating a model interface of the controller; mapping each sub-model of the controller to a local variable of a preset script framework; acquiring a change rule of each sub-model of the controller; and compiling the change rule and the initial framework, and constructing to obtain a controller model matrix control script. According to the method, the model can be modified on line according to the predefined rule, an effective means is provided to realize that the controller model can be adjusted in time aiming at the current object characteristic, the control requirement is met, and the control performance is improved. Parameters of each sub-model are dynamically modified by controlling model scripts executed before the calculation control effect, and flexible configuration and visual management of the parameters are realized in combination with script modification factors, so that the functional requirements of online model adjustment are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of predictive control, and specifically relates to the construction of a controller model matrix control script and a controller model matrix control method. Background Art

[0002] Predictive control is a class of model-based optimal control algorithms directly proposed from industrial process applications. Its emergence is firstly due to the urgent needs of industrial practice and also the inspiration from in-depth observation and research on production processes and their characteristics. Its appearance has solved difficult problems such as strong coupling and large time delays in process control, adding new vitality to process control.

[0003] In related technologies, existing predictive controllers are applicable to relatively stable working conditions and are difficult to respond in a timely manner when the characteristics of the controlled object or control indicators change significantly. Usually, the MPC controller cannot be modified after being put into operation. If the object characteristics change after being put into operation, a model-object mismatch will occur, affecting the performance of the controller. Summary of the Invention

[0004] In view of this, the present invention provides a method for constructing a controller model matrix control script and a controller model matrix control method to solve the problem of how to enable the controller to make a timely and rapid response under special working conditions.

[0005] In a first aspect, the present invention provides a method for constructing a controller model matrix control script, the method comprising:

[0006] Obtaining a model class of the controller and generating a model interface of the controller;

[0007] Mapping each sub-model of the controller to local variables of a preset script framework to obtain an initial framework;

[0008] Obtaining a change rule for each sub-model of the controller, the change rule being used to modify the model of the controller;

[0009] Compiling the change rule and the initial framework to construct a controller model matrix control script.

[0010] In the present invention, for the script constructed by the method for constructing a controller model matrix control script, loading the script into the process of the controller can modify the model online according to predefined rules, providing an effective means to enable the controller model to be adjusted in a timely manner according to the current object characteristics, meet the control requirements, and improve the control performance. By dynamically modifying the parameters of each sub-model through the model script executed before the control calculation of the control action and combining with the script modification factor, flexible configuration and visual management of the parameters are realized, so as to achieve the functional requirements of online model adjustment.

[0011] In an alternative embodiment, generating a model interface for the controller includes:

[0012] Generating a class corresponding to the parameters of each sub-model and determining the parameter structure of the sub-model;

[0013] According to the parameter structure, constructing a parameter modification interface, which is used to verify the modification of the parameters of each sub-model by the controller model matrix control script;

[0014] Constructing a class corresponding to the matrix model and combining the class corresponding to the matrix model with the parameter modification interface to obtain the model interface of the controller.

[0015] In this method, by defining a class to represent the parameters of each sub-model, the parameter structure of the sub-model is defined; by defining an interface, it is realized that the parameters of each sub-model are allowed to be modified by a script; creating a class to represent the entire model matrix realizes the construction of the model interface.

[0016] In an alternative embodiment, mapping each sub-model of the controller to a local variable of a preset script framework to obtain an initial framework includes:

[0017] Using dynamic code generation technology, mapping the preset parameters of each sub-model in the model matrix to the script class parameters corresponding to the preset script framework in a readable and writable manner to obtain the initial framework.

[0018] In this method, through dynamic code generation technology, for each controller, by establishing a corresponding class, mapping the variables of the controller and its model to the variables of the class, the variables can be programmatically accessed and allowed to be modified online, realizing mapping each sub-model in the model matrix to a local variable in the script framework, facilitating script access.

[0019] In a second aspect, the present invention provides a method for controlling a controller model matrix, the method including:

[0020] Backing up the model of the controller to obtain an initial model;

[0021] Loading the controller model matrix control script into the process of the controller, where the controller model matrix control script is constructed by using the controller model matrix control script construction method according to any item of the first aspect;

[0022] Using the controller model matrix control script to modify the model of the controller to obtain a modified model;

[0023] Judging whether the modified model is legal;

[0024] When the modified model is legal, using the modified model to control the controller to perform control operations;

[0025] When the modified model is illegal, the initial model is used to control the controller to perform control operations.

[0026] In the present invention, by using the written controller model matrix control script, loading the controller model matrix control script into the controller process, and judging the legality of the model after the script is modified, the function of introducing an online modifiable model is realized, the model can be adjusted in a timely manner according to different working conditions, object model mismatch is avoided, and control performance is improved.

[0027] In an optional implementation manner, judging whether the modified model is legal includes:

[0028] Judging whether there are corresponding associated parameters for each parameter in the modified model, and judging whether each row and each column in the modified model are all empty models, and judging whether the integral orders of all sub-models in the modified model are consistent;

[0029] When there are corresponding associated parameters for each parameter in the modified model, and each row and each column in the modified model are not all empty models, and the integral orders of all sub-models in the modified model are consistent, it is determined that the modified model is legal;

[0030] When there are parameters lacking corresponding associated parameters in the modified model, or each row and each column in the modified model are all empty models, or the integral orders of all sub-models in the modified model are inconsistent, it is determined that the modified model is illegal.

[0031] In this way, by judging whether there are corresponding associated parameters for each parameter in the modified model, and judging whether each row and each column in the modified model are all empty models, and judging whether the integral orders of all sub-models in the modified model are consistent, the legality of the modified model is judged, and the situation that the modified model is illegal and cannot be executed normally is avoided.

[0032] In a third aspect, the present invention provides a controller model matrix control script construction device, and the device includes:

[0033] A model interface definition module, configured to obtain the model class of the controller and generate the model interface of the controller;

[0034] A model mapping module, configured to map each sub-model of the controller to a local variable of a preset script framework to obtain an initial framework;

[0035] A change rule specifying module, configured to obtain the change rule of each sub-model of the controller, and the change rule is used to modify the model of the controller;

[0036] A script writing module for compiling change rules and an initial framework to construct a controller model matrix control script.

[0037] Fourthly, the present invention provides a controller model matrix control device, which includes:

[0038] A model backup module for backing up the model of the controller to obtain an initial model;

[0039] A script compilation module for loading the controller model matrix control script into the process of the controller, where the controller model matrix control script is constructed by using the controller model matrix control script construction device of the third aspect;

[0040] A model modification module for modifying the model of the controller by using the controller model matrix control script to obtain a modified model;

[0041] A legality judgment module for judging whether the modified model is legal;

[0042] A model legal module for controlling the controller to execute control operations by using the modified model when the modified model is legal;

[0043] A model illegal module for controlling the controller to execute control operations by using the initial model when the modified model is illegal.

[0044] Fifthly, the present invention provides a computer device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to execute the controller model matrix control script construction method of the first aspect or any corresponding embodiment thereof, or execute the controller model matrix control method of the second aspect or any corresponding embodiment thereof.

[0045] Sixthly, the present invention provides a computer-readable storage medium, on which computer instructions are stored. The computer instructions are used to cause a computer to execute the controller model matrix control script construction method of the first aspect or any corresponding embodiment thereof, or execute the controller model matrix control method of the second aspect or any corresponding embodiment thereof.

[0046] Seventhly, the present invention provides a computer program product, including computer instructions, which are used to cause a computer to execute the controller model matrix control script construction method of the first aspect or any corresponding embodiment thereof, or execute the controller model matrix control method of the second aspect or any corresponding embodiment thereof. Description of the Drawings

[0047] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0048] Figure 1 It is a schematic flowchart of a method for constructing a controller model matrix control script according to an embodiment of the present invention.

[0049] Figure 2 It is a schematic diagram of a predictive control principle according to an embodiment of the present invention.

[0050] Figure 3 It is a schematic structural diagram of a DMC according to an embodiment of the present invention.

[0051] Figure 4 It is a schematic diagram of an interface definition according to an embodiment of the present invention.

[0052] Figure 5 It is a schematic diagram of a sub-model editing interface in a configuration software according to an embodiment of the present invention.

[0053] Figure 6 It is a schematic diagram of model matrix editing in a configuration software according to an embodiment of the present invention.

[0054] Figure 7 It is a schematic diagram of model script editing according to an embodiment of the present invention.

[0055] Figure 8 It is a schematic diagram of security and permission management according to an embodiment of the present invention.

[0056] Figure 9 It is a schematic flowchart of a method for controlling a controller model matrix according to an embodiment of the present invention.

[0057] Figure 10 It is a schematic flowchart of the execution of a controller model matrix control script according to an embodiment of the present invention.

[0058] Figure 11 It is a block diagram of the structure of a device for constructing a controller model matrix control script according to an embodiment of the present invention.

[0059] Figure 12 It is a block diagram of the structure of a controller model matrix control device according to an embodiment of the present invention.

[0060] Figure 13 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed implementation manners

[0061] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0062] In related technologies, existing predictive controllers are applicable to relatively stable working conditions and are difficult to respond in a timely manner when the characteristics of the controlled object or control indicators change significantly. Usually, the MPC controller cannot be modified after being put into operation. If the object characteristics change after being put into operation, a model-object mismatch will occur, affecting the controller performance.

[0063] To solve the above problems, a method for constructing a controller model matrix control script and a controller model matrix control method are provided in the embodiments of the present invention for use in a computer device. It should be noted that the execution subject may be a device for constructing a controller model matrix control script and a device for controlling a controller model matrix. The device can be implemented as part or all of a computer device through software, hardware, or a combination of software and hardware. Among them, the computer device may be a terminal, a client, or a server. The server may be a single server or a server cluster composed of multiple servers. The terminal in the embodiments of the present application may be a smart phone, a personal computer, a tablet computer, or other intelligent hardware devices. In the following method embodiments, the execution subject is taken as a computer device as an example for description.

[0064] The computer device in this embodiment is applicable to various polymerization devices with large changes in the process object model gain, as well as the usage scenarios of complex petrochemical refining devices with strong object gain nonlinearity and large changes in the process operating point. By using the method for constructing a controller model matrix control script provided by the present invention, the script constructed through the method for constructing a controller model matrix control script is loaded into the process of the controller, and the model can be modified online according to predefined rules, providing an effective means to enable the controller model to adjust in a timely manner according to the current object characteristics, meet the control requirements, and improve the control performance. The parameters of each sub-model are dynamically modified by the model script executed before the control calculation of the control action, and the flexible configuration and visual management of the parameters are realized by combining the script modification factor, so as to meet the functional requirements of online model adjustment.

[0065] According to an embodiment of the present invention, an embodiment of a method for constructing a controller model matrix control script is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.

[0066] In this embodiment, a method for constructing a controller model matrix control script is provided, which can be used for the above computer device. Figure 1 It is a flowchart of a method for constructing a controller model matrix control script according to an embodiment of the present invention, as Figure 1 shown, the process includes the following steps:

[0067] Step S101, obtain the model class of the controller and generate the model interface of the controller.

[0068] In an alternative embodiment, step S101 includes:

[0069] Step a1, generate a class corresponding to the parameters of each sub-model and determine the parameter structure of the sub-model.

[0070] Step a2, according to the parameter structure, construct a parameter modification interface, and the parameter modification interface is used to verify the modification of the parameters of each sub-model through the controller model matrix control script.

[0071] Step a3, construct a class corresponding to the matrix model, and combine the class corresponding to the matrix model with the parameter modification interface to obtain the model interface of the controller.

[0072] In an example, an interface standard (SubModelApi class) for accessing the model is added to the software, that is, it is allowed to read and modify the model parameters in a programmable manner during the software operation. Among them, the input is the model class of the controller, and the output is the model interface class, that is, an interface for programming access to the model class is customized.

[0073] In this method, the parameter structure of the sub-model is defined by defining a class to represent the parameters of each sub-model; the modification of the parameters of each sub-model through the script is allowed by defining an interface; and the construction of the model interface is realized by creating a class to represent the entire model matrix.

[0074] Step S102, map each sub-model of the controller to a local variable of a preset script framework to obtain an initial framework.

[0075] In an alternative embodiment, step S102 includes:

[0076] Step b1: Using dynamic code generation technology, map the preset parameters of each sub-model in the model matrix to the script class parameters corresponding to the preset script framework in a readable and writable manner to obtain the initial framework.

[0077] In an example, each sub-model in the model matrix is mapped to a local variable in the script framework for easy code access. The input is a controller configuration (with a model), and the output is a script class framework. For each controller, a script class is created, and the variables of the controller and its model are mapped to the member variables of the class. These variables can all be programmatically accessed and allowed to be modified online. This class framework reserves a position where the code for modifying the model parameters can be filled in.

[0078] In this method, through dynamic code generation technology, for each controller, by creating a corresponding class, the variables of the controller and its model are mapped to the variables of the class. The variables can be programmatically accessed and allowed to be modified online, realizing the mapping of each sub-model in the model matrix to the local variables in the script framework for easy script access.

[0079] Step S103: Obtain the change rules of each sub-model of the controller.

[0080] In an example, write a script to specify the change rules of each sub-model. Here, taking the modification of the gain of a sub-model as an example, modifying the gain and the lag time are the most common modification methods. Fill in the code for modifying the model on the basis of the previously formed script class framework.

[0081] Step S104: Compile the change rules and the initial framework to construct the control script for the controller model matrix.

[0082] In an example, the class written through the above steps, after being compiled, is loaded into the controller process to obtain the interface function for accessing the model. The input is the filled script class, and the script class is no longer a framework. After the above steps, the script class already has actual functions; the output is the assembly formed after compilation. The assembly is loaded into the controller process, and the model of the controller is accessed through the assembly.

[0083] In an implementation scenario, a sub-model parameter structure is defined: In the process control industry, the model expression is an industry convention, which is a second-order transfer function that contains six parameters. Modifying the model means modifying these six parameters, mainly by modifying the gain and lag. Define a class to represent the parameters of each sub-model, including gain, pure lag, first-order coefficient of the numerator, first-order coefficient of the denominator, second-order coefficient of the denominator, integral order, and an enumeration quantity indicating whether this transfer function is for control or prediction. Among them, process control usually uses a transfer function not exceeding the second order to express the dynamic model. The main concepts of the model are gain, time constant, and lag. It can be considered an established expression method and a common practice in the control field; the combination of each parameter makes sense.

[0084] In an implementation scenario, predictive control is a class of model-based optimal control algorithms directly proposed from industrial process applications. Its emergence is first due to the urgent needs of industrial practice and also inspired by in-depth observation and research on production processes and their characteristics. Its appearance has solved the problems of strong coupling and large time delay in process control, adding new vitality to process control. Predictive control can generally be described by the following three basic characteristics:

[0085] ① Prediction model: Use the model to predict the motion law of the controlled object and the error of the controlled parameter at future moments, and use it as the basis for determining the current control action, so that the control strategy can adapt to the memory, causality, and lag of the controlled object, and the expected control effect can be obtained.

[0086] ② Feedback correction: Use measurable information to correct the predicted value of the controlled parameter at each sampling moment, and suppress the errors caused by model mismatch and interference. Use the corrected predicted value as the basis for calculating the optimal control, so that the robustness of the control system is significantly improved.

[0087] ③ Receding horizon optimization: Predictive control is an optimal control strategy. Its control goal is to minimize a certain performance index, and the predictive deviation is used to calculate the control action sequence, but only the first control action sequence is actually executed. At the next sampling moment, the control action sequence needs to be recalculated according to the predictive deviation at that time. The calculation of this control action sequence is not to calculate the optimal result at one time like optimal control, but to continuously repeat according to the sampling time, so it is called receding horizon optimization.

[0088] The above three basic characteristics of predictive control are the specific manifestations of the concepts of model, feedback control, and optimization in cybernetics. It inherits the optimal idea, improves robustness, can handle multiple objectives and various constraints, thus meeting the actual requirements of industrial processes, and has therefore developed rapidly in theory and application. So far, representative algorithms of predictive control include MAC based on the convolution model, DMC algorithm based on the step response model, generalized predictive control algorithm GPC based on the difference equation model, SFPC algorithm based on the state space model, and UPC based on the system matrix model, etc.

[0089] Figure 2 is a schematic diagram of the principle of a predictive control according to an embodiment of the present invention, as Figure 2 shown, where y S represents the set value, and y R (k) represents the expected value curve of the output. k = 0 is the current moment, and the curve to the left of the 0 moment represents the past output and control. According to the known object model, the output y M (k) (k = 1, 2,... P) of the object at the next P moments can be predicted. The predictive control algorithm is to calculate the control quantities u(k) (k = 0, 1,... L - 1) at the current and the next L moments according to their difference e(k) from the expected output y R (k), and to minimize e(k). Here, P is called the prediction horizon, and L is called the control horizon.

[0090] The dynamic matrix control (DMC) based on the step response can include: The dynamic matrix control is a predictive control algorithm based on the step response model of the object. Figure 3 is a schematic diagram of the structure of a DMC according to an embodiment of the present invention, and the DMC structure is as Figure 3 shown.

[0091] Given the unit step response curve, the amplitudes a k at the sampling moments k = 1, 2,... can be measured. The output at the k moment is caused by all the input increments before the k moment, that is:

[0092]

[0093] where Δu(k - i) = u(k - i) - u(k - i - 1) is the control increment at the k - i moment. The prediction model in DMC adopts the above step response expression. However, to distinguish it from the true expression of the object, the output of the prediction model is often denoted as:

[0094]

[0095] In the formula are the coefficients used for prediction calculation, and y M(k) is the model output, that is, the output prediction value. If a unit impulse with a width of 1 is applied to the object input end, according to the superposition principle, it is not difficult to see that the amplitude of the impulse response curve at the sampling moment should be h 1 = a 1 , h 2 = a 2 -a 1 , …, h i = a i -a i-1 , …, and there is Writing the control increment as the control quantity in Equation (1), we can get:

[0096]

[0097] For a stable object with self-balancing ability, after a certain moment N, it can be approximately considered that the amplitude of the step response no longer changes, that is, a N = a N+1 = …, so there is h N+1 = h N+2 = … = 0. At this time, the unit step response of the object can be recorded as:

[0098]

[0099] So the unit step response calculated by the model can be recorded as:

[0100]

[0101] Here, N is called the model length. In the case where the object has pure time delay, and The first few terms of are 0.

[0102] Using Equation (5) and we can get:

[0103]

[0104] Output prediction: Let the current moment be k and the prediction step length be L. If the control increment sequences at the current and future moments are Δu(k), Δu(k + 1), Δu(k + 2), …, Δu(k + L - 1), then after the Lth moment, there is Δu(k + L) = Δu(k + L + 1) = … = 0. So the output prediction value at the future moment should be:

[0105]

[0106] Denote the predicted output vector y at the k + 1 to k + P moments M and the control increment vector Δu at the k to k + L - 1 moments as

[0107] yM = [y M (k + 1), y M (k + 2), …, y M (k + P)] T (9)

[0108] Δu = [Δu(k), Δu(k + 1), …, Δu(k + L - 1)] T (10)

[0109] Then the output prediction value can be denoted as:

[0110] y M = AΔu + s (11)

[0111] where A is a P×L dimensional matrix

[0112]

[0113] A is composed of the object's dynamic response coefficients and is called the dynamic matrix. Obviously, AΔu represents the influence of the current and future control on the output, while s represents the output generated by the past control.

[0114] Feedback correction: The above model prediction does not consider the effects of model error and interference. Therefore, although appropriate control can make the predicted output y M (k + j) of the model close to the expected output value y R (k + j) at time k + j, it cannot guarantee that the actual future output y(k + j) of the system is close to y R (k + j). To better estimate the error and calculate a more accurate control quantity, the output prediction should be corrected. However, since the model error and the noise and interference at future times are generally not easy to measure, usually the deviation of the previous moment's prediction value is used for approximate correction. According to this method, the correction value of the output prediction is

[0115]

[0116] In the above formula, when calculating y C (k + j), y(k + j - 1) - y M (k + j - 1) is required, but at time k, y(k + j - 1) is an unknown quantity. To enable the calculation to proceed, the corrected predicted value y C (k + j - 1) is used to replace the measured value y(k + j - 1). After such substitution, the general expression for the corrected output prediction value can be obtained as:

[0117] y C (k + j) = y M (k + j) + [y(k) - yM (k)], j = 1, 2, …, P (14)

[0118] The deviation of the output prediction is then:

[0119] e(k + j) = y R (k + j) - y C (k + j), j = 1, 2, …, P (15)

[0120] Rolling optimization: Rolling optimization is an optimal control strategy in predictive control. It takes the reference trajectory as the optimization objective and minimizes a certain performance index within a certain future time through an optimal control algorithm. The control action sequence is calculated using the prediction deviation, but only the current control action is actually executed and repeated at the next moment.

[0121] Reference trajectory: When the setpoint undergoes a step change, if it is required that the output quickly tracks this change, a large-amplitude control quantity often needs to be applied. This is often very difficult to achieve in engineering, and even if it can be achieved, it often leads to unstable output changes. Therefore, in predictive control, a reference trajectory is generally set to make the output gradually transition from the current value to the setpoint. Let the setpoint be y S , which can be a constant or a certain time function. The commonly used reference trajectory is in the form of a first-order exponential, i.e.:

[0122] y R (k) = y(k) (16)

[0123] y R (k + j) = αy(k + j - 1) + (1 - α)y S = α j y(k) + (1 - α j )y S , j = 1, 2, …, P (17)

[0125] The reference trajectory represented by the above formula is equivalent to the step response curve of a first-order inertia link, where α = exp(-T / T f ), which is called the softening coefficient, and T is the sampling period.

[0126] Performance index: The task of the control algorithm is to calculate the implementable control quantity based on the deviation between the output prediction value y C (k + j) and the output expected value y R (k + j) so that the output of the object can approach the desired reference trajectory as much as possible. For this purpose, an index characterizing this property needs to be given. The commonly used form is:

[0127]

[0128] In the above formula, q i is the weighted coefficient of the error term, and r i is the weighted coefficient of the control term.

[0129] Exemplarily, a transfer function not higher than the second order in the following form is used as the model for each MV-CV or DV-CV pairing of the controller. The models of multiple MV, DV, and CV controllers are a matrix composed of transfer functions, and each element therein is the above transfer function. The six parameters are: gain G, integral order I, denominator quadratic constant Td2, denominator first-order constant Td1, numerator first-order constant Tn, and pure dead time τ. The model is characterized by the following formula:

[0130]

[0131] During controller simulation and online operation, the above transfer function is expanded into a step response sequence through inverse Laplace transform according to the controller execution period, which is used to generate the dynamic matrix A for model prediction and optimization solution.

[0132] Implement a parameter modification interface: Each sub-model has many parameters and functions that can be used to modify its six parameters. According to the requirements of different scenarios, there can be different modification methods. For example, if the base gain is 3, the actual gain can be directly modified to 6, or the gain multiplier can be changed to 2, because the final actual gain is 3*2 = 6. Figure 4 is a schematic diagram of an interface definition according to an embodiment of the present invention. As Figure 4 shown, an interface is defined to allow the modification of the parameters of each sub-model through a script, including the modification methods of the multiplier and increment. For the gain, numerator first-order coefficient, denominator first-order coefficient, and denominator quadratic coefficient, the numerical modification is achieved by modifying the multiplier through the script. For the pure dead time, the modification is achieved by modifying the increment through the script; the enumeration quantity of its function can also be characterized through the script. The multiplier, increment, and each final model parameter must be within the legal range to allow assignment.

[0133] Design a model matrix class: The model matrix is a matrix composed of several models. Since the controller is multi-variable, the model matrix has multiple rows and columns, and each element corresponds to one of the sub-models. Figure 5 is a schematic diagram of a sub-model editing interface in a configuration software according to an embodiment of the present invention. Figure 6 is a schematic diagram of model matrix editing in a configuration software according to an embodiment of the present invention. As Figure 5 and Figure 6As shown in the figure, create a class to represent the entire model matrix, including the parameters of each sub-model and the method for checking the legality of the matrix. After each sub-model is modified, the legality should be checked for the entire model matrix, because even if each sub-model is legal, it may become illegal when combined into a matrix.

[0134] Implement the script interface: Figure 7 This is a schematic diagram of model script editing according to an embodiment of the present invention. As Figure 7 shown, through dynamic code generation technology, the modifiable parameters of each sub-model in the model matrix are mapped into the parameters of the script class in a readable and writable manner, enabling users to write scripts to dynamically modify the parameters of the sub-models, including the logic for adjusting parameters according to working conditions and expert rules. Before each model modification, the current model needs to be backed up to enable rollback when needed. Assume that the controller model rule is: Gain = Gain0*(T / 30)^2. When the temperature changes, the model gain will change drastically. The corresponding script code is: Model_MV1_CV1.ActGain = Model_MV1_CV1.K2Gain*Math.Pow(AirTemp.Pv / 30,2);

[0135] Security and permission management: Figure 8 This is a schematic diagram of security and permission management according to an embodiment of the present invention. As Figure 8 shown, security and permission management are implemented from two aspects: The first aspect is modification permission. Permission refers to whether it is allowed to modify the model. If modification is allowed, it is only allowed to modify the gain lag, or later, or it is allowed to modify all parameters. After setting the modification permission in the global settings, unauthorized operations can be filtered out. On the other hand, in the execution process, a stage, or called phase, is assigned to each code segment of the script. It is only allowed to modify the model within the model code segment, and modifying the model elsewhere is invalid, thus preventing the model from being modified at the wrong location.

[0136] Sandboxed execution: Ensure that the script is executed in a controlled environment to prevent the execution of malicious code and avoid the exceptions in the script from affecting the operation of the controller. Permission control: Manage the editing and execution permissions of the script according to user permissions. A preset range for each parameter to be assigned a value is set. If the range is exceeded, the assignment fails and the reason is recorded in the log. For example, in the assignment, if an out-of-bounds situation occurs, the reason for the exception is recorded in the log and the new value is not accepted to ensure the safety and reliability of the new value.

[0137] Running logs and monitoring: Log recording: Record the detailed logs of each script execution, including input data, modified parameters, and output results. Add digital watermarks to the log information for each cycle. Monitoring interface: Provide a real-time monitoring interface to display the current script execution status and historical records.

[0138] The controller model matrix control script construction method provided in this embodiment, through the script constructed by the controller model matrix control script construction method, loads the script into the process of the controller, can modify the model online according to predefined rules, provides an effective means to enable the controller model to be adjusted in a timely manner according to the characteristics of the current object, meet the control requirements, and improve the control performance. Dynamically modify the parameters of each sub-model by executing the model script before the control calculation control action, and combine the script modification factor to achieve flexible configuration and visual management of the parameters, so as to meet the functional requirements of online model adjustment.

[0139] In this embodiment, a controller model matrix control method is provided, which can be used for the above computer device. Figure 9 It is a flowchart of a controller model matrix control method according to an embodiment of the present invention, as Figure 9 shown, the process includes the following steps:

[0140] Step S901, back up the model of the controller to obtain the initial model.

[0141] Step S902, load the controller model matrix control script into the process of the controller.

[0142] In the embodiment of the present invention, the controller model matrix control script is constructed by using the above-mentioned controller model matrix control script construction method.

[0143] Step S903, use the controller model matrix control script to modify the model of the controller to obtain the modified model.

[0144] Step S904, determine whether the modified model is legal.

[0145] Specifically, the above step S904 includes:

[0146] Step c1, determine whether there are corresponding associated parameters for each parameter in the modified model, and, determine whether each row and each column in the modified model are all empty models, and, determine whether the integral orders of all sub-models in the modified model are the same.

[0147] Step c2, when there are corresponding associated parameters for each parameter in the modified model, and, each row and each column in the modified model are not all empty models, and, the integral orders of all sub-models in the modified model are the same, determine that the modified model is legal.

[0148] Step c3, when there are parameters lacking corresponding associated parameters in the modified model, or, each row and each column in the modified model are all empty models, or, the integral orders of all sub-models in the modified model are inconsistent, determine that the modified model is illegal.

[0149] In one example, before using the model matrix each time, a legality check is performed to ensure the validity of the model matrix structure and parameters. The requirements for the legality of the model matrix are as follows: each CV needs to have an associated MV, each MV needs to have an associated CV, each row and each column cannot be all empty models, and all sub-models of one CV are of the same integral order. If the model check fails after this modification, the modification is abandoned, the model matrix is restored to the state before being modified, and the reason for the error is prompted in the log. At the same time, this information is displayed on the interface.

[0150] Exemplarily, the CV is the top tower temperature, and the MV is the top tower reflux flow. The control of the top temperature of the distillation column needs to be based on the model relationship between the two. Assume that this model will change with the atmospheric temperature. The actual change rule will be more complex, generally being a multi-input single-output non-linear function. The partial derivatives of each input are calculated at the operating point as the gains of each independent variable (MV, DV) with respect to the dependent variable (CV).

[0151] In this method, by judging whether there are corresponding associated parameters for each parameter in the modified model, and judging whether each row and each column in the modified model are all empty models, and judging whether the integral orders of all sub-models in the modified model are the same, the legality of the modified model is judged, avoiding the situation where the modified model is illegal and cannot be executed normally.

[0152] Step S905, when the modified model is legal, use the modified model to control the controller to perform control operations.

[0153] Step S906, when the modified model is illegal, use the initial model to control the controller to perform control operations.

[0154] In one implementation scenario Figure 10 is a schematic flowchart of the execution of a controller model matrix control script according to an embodiment of the present invention. As Figure 10 shown, at the beginning of each cycle, the model is backed up for abnormal rollback; the DCS values are read to update the controller variables and auxiliary variables; the controller model matrix control script is executed, and each sub-model parameter is modified according to the predefined rules, and the modification results are recorded; it is checked whether the modified model matrix is legal; when the modified model matrix is legal, the new model is applied to the control operation and the control operation is executed; when the modified model matrix is illegal, the initial state of the model is restored and the control operation is executed; the control operation results are output to the DCS, and the cycle ends.

[0155] In addition, if the sub-model specified by the user does not exist, the program will not error due to an exception, but will automatically locate to an invalid sub-model and prompt the user of the sub-model error.

[0156] In another implementation scenario, during the execution of the controller, the above transfer function is subjected to inverse Laplace transform according to the sampling time to obtain its step response sequence, which serves as the internal dynamic characteristic expression for final prediction and control. During actual operation, after each modification of the model, the legality of the model is checked. For each parameter, there are upper and lower limits for its range values. Secondly, the order of the numerator cannot be higher than or equal to the order of the denominator, the first-order coefficient of the denominator cannot be equal to 0, and the denominator is not allowed to have positive real part roots or pure imaginary roots.

[0157] The controller model matrix control method provided in this embodiment realizes the function of introducing online model modification by using the written controller model matrix control script, loading the controller model matrix control script into the controller process, and judging the legality of the model after script modification. It adjusts the model in a timely manner according to different working conditions, avoids object model mismatch, and improves control performance.

[0158] In this embodiment, a controller model matrix control script construction device is also provided. This device is used to implement the above embodiments and preferred implementation manners, and those that have been described will not be repeated here. As used hereinafter, the term "module" can be a combination of software and / or hardware that realizes a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0159] This embodiment provides a controller model matrix control script construction device, as Figure 11 shown, including:

[0160] A model interface definition module 1101, which is used to obtain the model class of the controller and generate the model interface of the controller. For details, please refer to Figure 1 step S101 of the embodiment shown here, which will not be repeated here.

[0161] A model mapping module 1102, which is used to map each sub-model of the controller to local variables of a preset script framework to obtain an initial framework. For details, please refer to Figure 1 step S102 of the embodiment shown here, which will not be repeated here.

[0162] A change rule specifying module 1103, which is used to obtain the change rules of each sub-model of the controller. The change rules are used to modify the model of the controller. For details, please refer to Figure 1 step S103 of the embodiment shown here, which will not be repeated here.

[0163] A script writing module 1104, which is used to compile the change rules and the initial framework to construct a controller model matrix control script. For details, please refer to Figure 1 step S104 of the embodiment shown here, which will not be repeated here.

[0164] In some alternative embodiments, the model interface definition module 1101 includes:

[0165] A parameter structure determination unit, configured to generate a class corresponding to the parameters of each sub-model and determine the parameter structure of the sub-model.

[0166] A parameter modification interface construction unit, configured to construct a parameter modification interface according to the parameter structure, where the parameter modification interface is used to verify the modification of the parameters of each sub-model by a controller model matrix control script.

[0167] A model interface construction unit, configured to construct a class corresponding to the matrix model, and combine the class corresponding to the matrix model with the parameter modification interface to obtain the model interface of the controller.

[0168] In some alternative embodiments, the model mapping module 1102 includes:

[0169] A model mapping unit, configured to use dynamic code generation technology to map the preset parameters of each sub-model in the model matrix to the script class parameters corresponding to a preset script framework in a readable and writable manner, to obtain an initial framework.

[0170] The further function descriptions of the above-mentioned modules and units are the same as those in the corresponding foregoing embodiments, and will not be elaborated herein.

[0171] The controller model matrix control script construction device in this embodiment is presented in the form of functional units. Here, the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and a memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0172] In this embodiment, a controller model matrix control device is further provided. This device is used to implement the above-mentioned embodiments and preferred implementation manners, and those that have been described will not be elaborated herein. As used hereinafter, the term "module" may be a combination of software and / or hardware that can implement a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0173] This embodiment provides a controller model matrix control device, as Figure 12 shown, including:

[0174] A model backup module 1201, configured to back up the model of the controller to obtain an initial model. For details, please refer to Figure 9 step S901 of the embodiment shown, which will not be elaborated herein.

[0175] A script compilation module 1202, configured to load a controller model matrix control script into a process of a controller, where the controller model matrix control script is constructed by using the above-mentioned controller model matrix control script construction device. For details, please refer to Figure 9 step S902 of the embodiment shown, which will not be elaborated here.

[0176] A model modification module 1203, configured to modify a model of the controller by using the controller model matrix control script to obtain a modified model. For details, please refer to Figure 9 step S903 of the embodiment shown, which will not be elaborated here.

[0177] A legality judgment module 1204, configured to judge whether the modified model is legal. For details, please refer to Figure 9 step S904 of the embodiment shown, which will not be elaborated here.

[0178] A model legal module 1205, configured to, when the modified model is legal, use the modified model to control the controller to perform control operations. For details, please refer to Figure 9 step S905 of the embodiment shown, which will not be elaborated here.

[0179] A model illegal module 1206, configured to, when the modified model is illegal, use the initial model to control the controller to perform control operations. For details, please refer to Figure 9 step S906 of the embodiment shown, which will not be elaborated here.

[0180] In some optional embodiments, the legality judgment module 1204 includes:

[0181] A legality judgment unit, configured to judge whether there are corresponding associated parameters for each parameter in the modified model, and judge whether each row and each column in the modified model are all empty models, and judge whether the integral orders of all sub-models in the modified model are consistent.

[0182] A model legality determination unit, configured to determine that the modified model is legal when there are corresponding associated parameters for each parameter in the modified model, and each row and each column in the modified model are not all empty models, and the integral orders of all sub-models in the modified model are consistent.

[0183] A model illegal determination unit, configured to determine that the modified model is illegal when there are parameters lacking corresponding associated parameters in the modified model, or each row and each column in the modified model are all empty models, or the integral orders of all sub-models in the modified model are inconsistent.

[0184] The further function descriptions of the above-mentioned modules and units are the same as those in the corresponding embodiments above, and will not be elaborated here.

[0185] The controller model matrix control device in this embodiment is presented in the form of functional units. Here, the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and a memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0186] An embodiment of the present invention also provides a computer device having the above Figure 11 shown controller model matrix control script construction device and Figure 12 shown controller model matrix control device.

[0187] Please refer to Figure 13 , Figure 13 which is a schematic structural diagram of a computer device provided by an alternative embodiment of the present invention. As Figure 13 shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Each component communicates with each other using different buses and can be installed on a common motherboard or installed in other ways as needed. The processor can process instructions executed within the computer device, including instructions stored in the memory or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some alternative embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a set of blade servers, or a multi-processor system). Figure 13 One processor 10 is taken as an example in

[0188] The processor 10 can be a central processor, a network processor, or a combination thereof. Among them, the processor 10 can further include a hardware chip. The above hardware chip can be an application specific integrated circuit, a programmable logic device, or a combination thereof. The above programmable logic device can be a complex programmable logic device, a field programmable gate array, a general array logic, or any combination thereof.

[0189] Among them, the memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiments.

[0190] The memory 20 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created according to the use of the computer device and the like. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some alternative embodiments, the memory 20 may optionally include a memory remotely disposed relative to the processor 10, and these remote memories may be connected to the computer device through a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0191] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk, or a solid-state drive; the memory 20 may further include a combination of the above types of memories.

[0192] The computer device further includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30, and the output device 40 may be connected through a bus or other means, Figure 13 Taking connection through a bus as an example.

[0193] The input device 30 can receive input digital or character information, and generate key signal inputs related to the user settings and function controls of the computer device, such as a touch screen, a keypad, a mouse, a trackpad, a touchpad, a pointing stick, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (such as an LED), and a haptic feedback device (such as a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light-emitting diode, a display, and a plasma display. In some alternative embodiments, the display device may be a touch screen.

[0194] Embodiments of the present invention also provide a computer-readable storage medium. The method according to the embodiments of the present invention can be implemented in hardware, firmware, or be implemented as computer code that can be recorded on a storage medium, or be implemented as computer code that is originally stored in a remote storage medium or a non-transitory machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid-state drive, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code, and when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the method shown in the above embodiments is implemented.

[0195] A part of the present invention can be applied as a computer program product, for example, computer program instructions, which when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the forms of existence of computer program instructions in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executes the instructions, or the computer compiles the instructions and then executes the corresponding compiled program, or the computer reads and executes the instructions, or the computer reads and installs the instructions and then executes the corresponding installed program. Herein, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.

[0196] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A controller model matrix control script construction method, characterized in that: The method comprises: Obtain the model class of the controller and generate the model interface of the controller; Mapping each sub-model of the controller to a local variable of a preset script framework to obtain an initial framework; Acquire a change rule for each sub-model of the controller, wherein the change rule is used to modify the model of the controller; The change rules and the initial framework are compiled to construct a controller model matrix control script.

2. The method according to claim 1, characterized in that The generating of the model interface of the controller comprises: Generate a class corresponding to the parameters of each sub-model and determine the parameter structure of the sub-model; According to the parameter structure, a parameter modification interface is constructed, wherein the parameter modification interface is used to verify the parameters of each sub-model modified by the controller model matrix control script; A matrix model corresponding class is constructed, and the matrix model corresponding class is combined with the parameter modification interface to obtain a model interface of the controller.

3. The method according to claim 2, characterized in that Mapping each sub-model of the controller to a local variable of a preset script framework to obtain an initial framework includes: By using dynamic code generation technology, the preset parameters of each sub-model in the model matrix are mapped to the script class parameters corresponding to the preset script framework in a readable and writable manner to obtain the initial framework.

4. A controller model matrix control method, characterized in that: The method comprises: Back up the controller model to obtain the initial model; A process of loading a controller model matrix control script into the controller, wherein the controller model matrix control script is constructed using the controller model matrix control script construction method according to any one of claims 1 to 3; Modifying the model of the controller using a controller model matrix control script to obtain a modified model; Determining whether the modified model is legal; When the modified model is legal, using the modified model to control the controller to perform a control operation; When the modified model is illegal, the controller is controlled to perform control operations using the initial model.

5. The method according to claim 4, characterized in that The determining whether the modified model is legal includes: Determine whether each parameter in the modified model has a corresponding associated parameter, and determine whether each row and column in the modified model are all empty models, and determine whether the integral orders of all sub-models in the modified model are consistent; When each parameter in the modified model has a corresponding associated parameter, each row and each column in the modified model are not all empty models, and the integral orders of all sub-models in the modified model are consistent, the modified model is determined to be legal; When there are parameters in the modified model that lack corresponding associated parameters, or when each row and column in the modified model are all empty models, or when the integration orders of all sub-models in the modified model are inconsistent, the modified model is determined to be illegal.

6. A controller model matrix control script construction device, characterized in that: The device comprises: A model interface definition module, used to obtain the model class of the controller and generate the model interface of the controller; A model mapping module, used for mapping each sub-model of the controller to a local variable of a preset script framework to obtain an initial framework; A change rule specifying module, used for obtaining a change rule for each sub-model of the controller, wherein the change rule is used for modifying the model of the controller; The script writing module is used to compile the change rules and the initial framework to construct a controller model matrix control script.

7. A controller model matrix control device, characterized in that: The device comprises: The model backup module is used to back up the model of the controller to obtain the initial model; A script compiling module, used for loading a controller model matrix control script into the process of the controller, wherein the controller model matrix control script is constructed by using the controller model matrix control script construction device according to claim 6; A model modification module, used to modify the model of the controller using a controller model matrix control script to obtain a modified model; A legality judgment module, used to judge whether the modified model is legal; A model legality module, used to control the controller to perform control operations using the modified model when the modified model is legal; The model illegal module is used to control the controller to perform control operations using the initial model when the modified model is illegal.

8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the controller model matrix control script construction method described in any one of claims 1 to 3 or the controller model matrix control method described in any one of claims 4 to 5 by executing the computer instructions.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, which are used to enable a computer to execute the controller model matrix control script construction method described in any one of claims 1 to 3 or the controller model matrix control method described in any one of claims 4 to 5.

10. A computer program product, characterized in that It comprises computer instructions, and the computer instructions are used to make a computer execute the controller model matrix control script construction method described in any one of claims 1 to 3 or execute the controller model matrix control method described in any one of claims 4 to 5.