A method and device for solving a crude oil plant scheduling model
By designing a piecewise linear approximation model and evaluating its confidence level, the problem of low solution efficiency in the MINLP model is solved, and a crude oil inflow scheduling system that is efficient, feasible, and of high solution quality is achieved under complex conditions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- RICHFIT INFORMATION TECH
- Filing Date
- 2026-01-19
- Publication Date
- 2026-05-29
AI Technical Summary
Existing technologies suffer from low solution efficiency and difficulty in meeting the real-time scheduling needs of industrial applications in crude oil inbound scheduling. In particular, under the complex background of multiple varieties, multiple tank farms, and nonlinear physical properties, the mixed integer nonlinear programming (MINLP) model is not efficient enough to provide an efficient global optimal solution.
By constructing the original MINLP model, identifying key nonlinear terms and performing piecewise linear approximation design, an approximate MINLP model is constructed, and its solution is used as the initial solution. Combined with confidence assessment and online correction strategies, the solution efficiency and solution quality are improved.
It significantly improves the solution speed, reduces the burden of nonlinear calculations, increases the ratio of solution time reduction, enhances the solver's search space utilization and global optimal solution hit rate, and adapts to the needs of complex scenarios.
Smart Images

Figure CN122114450A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of refinery production scheduling optimization technology, and in particular to a method and apparatus for solving a crude oil inflow scheduling model. Background Technology
[0002] In the production and operation system of oil refining enterprises, crude oil inbound scheduling is a core link connecting upstream resource supply and downstream production and processing. The scientific nature and timeliness of its scheduling plan directly determine the enterprise's production efficiency, cost control, and safety stability. As the refining industry develops towards multi-variety, highly flexible, and refined operations, crude oil inbound scheduling scenarios are becoming increasingly complex. Traditional scheduling methods are no longer suitable for actual industrial needs. While mixed-integer nonlinear programming (MINLP) models provide a theoretical framework for problem modeling, they face a prominent contradiction between solution efficiency and real-time scheduling requirements.
[0003] The complexity of crude oil delivery scheduling stems primarily from the interplay of multiple constraints. From the resource perspective, refining plants typically receive crude oils of various types from different origins and with different properties. These crude oils exhibit significant differences in key physical properties such as density, sulfur content, and acid value, and these properties are coupled in a complex nonlinear manner. From the facility perspective, tank farm systems contain multiple crude oil storage tanks, each with constraints such as volume limits, safe liquid levels, and mixing restrictions. Furthermore, the connections between these tanks, unloading terminals, and pipelines form a complex logistics network, further increasing the variables in scheduling decisions. In addition, the scheduling process must also meet the dynamic demands of production plans on crude oil types and quantities, as well as the uncertainty of unloading vessel arrival times, resulting in a highly nonlinear and multi-coupled constraint space for the scheduling problem.
[0004] To accurately characterize the aforementioned complex problems, Mixed-Integer Nonlinear Programming (MINLP) models are commonly used. Theoretically, MINLP models can achieve global optima for scheduling schemes. However, in practical industrial scenarios, their solution process faces severe computational efficiency bottlenecks. On one hand, the nonlinear equations of the physical properties of various crude oil varieties increase the nonlinearity of the MINLP model, leading to enhanced nonconvexity of the Hessian matrix of the objective function and constraints, making the solver prone to getting trapped in local optima. On the other hand, the presence of a large number of binary variables causes the combinatorial optimization space to grow exponentially. Traditional solvers often require hours or even days to obtain a feasible solution, far exceeding the real-time or near-real-time scheduling requirements of industrial production (typically requiring minute-level response). Therefore, while the crude oil inbound scheduling problem can be accurately modeled using MINLP models in the complex context of multiple varieties, multiple tank farms, and nonlinear physical properties, the low efficiency of MINLP model solutions makes it difficult to meet the real-time scheduling needs of industry. Summary of the Invention
[0005] In view of the above problems, the present invention is proposed to provide a method and apparatus for solving a crude oil inflow scheduling model that overcomes or at least partially solves the above problems.
[0006] In a first aspect, embodiments of the present invention provide a method for solving a crude oil inflow scheduling model, including:
[0007] A primitive mixed-integer nonlinear programming (MINLP) model for crude oil inbound scheduling is constructed, and key nonlinear terms in the primitive MINLP model are identified. The primitive MINLP model includes continuous variables, binary variables, and key nonlinear terms. The key nonlinear terms include the nonlinear mapping between the physical properties of crude oil components after mixing and the proportion of each component.
[0008] Based on the identified key nonlinear terms, a piecewise linear approximation design is performed on the key nonlinear terms; based on the results of the piecewise linear approximation design, an approximate MINLP model is constructed, and the solution of the approximate MINLP model is used as the initial solution of the original MINLP model;
[0009] Based on the initial solution, the original MINLP model is solved to obtain the final solution of the original MINLP model.
[0010] In one embodiment, the method described above, wherein identifying key nonlinear terms in the original MINLP model includes:
[0011] The expression of the original MINLP model is parsed using a computing library, and the expression string of the original MINLP model is converted into a symbolic expression of the computing library;
[0012] Based on the parsing results of the original MINLP model expression, the original MINLP model expression is split into multiple independent terms;
[0013] Identify nonlinear terms among the plurality of independent terms; the nonlinear terms include terms with a total degree greater than 1, transcendental functions, and nonpolynomial terms.
[0014] In one embodiment, the above method, wherein the piecewise linear approximation design of the key nonlinear term includes:
[0015] The domain of the nonlinear function corresponding to the key nonlinear term is divided into multiple segments according to preset segmentation nodes;
[0016] The nonlinear function of each domain segment is approximated by a first-order linear function, and the upper and lower bound errors between the nonlinear function of each domain segment and the corresponding first-order linear function are recorded.
[0017] Based on the upper and lower bound errors, the distances of the segmented nodes and the first-order linear function that is approximated are readjusted until the upper and lower bound errors are within the preset error range.
[0018] In one embodiment, the above method, wherein the piecewise linear approximation design of the key nonlinear term further includes:
[0019] Determine whether the nonlinear term is a product of variables or a ratio of variables. If so, introduce a replacement variable to replace the nonlinear term, and limit the local value range of the replacement variable by linear slicing.
[0020] In one embodiment, the above method, before using the solution of the approximate MINLP model as the initial solution of the original MINLP model, further includes:
[0021] Determine whether a historical solution sample library exists. If it does, select a historical solution sample from the historical solution sample library as the initial solution of the MINLP model. If not, use the solution of the approximate MINLP model as the initial solution of the MINLP model.
[0022] In one embodiment, after obtaining the initial solution, the method further includes: using a preset solver to evaluate the confidence level of the initial solution, and correcting the initial solution based on the confidence level evaluation result.
[0023] In one embodiment, the above method, wherein the step of using a preset solver to evaluate the confidence level of the initial solution and correcting the initial solution based on the confidence level evaluation result, includes:
[0024] Identify the binary variables and continuous variables affecting the feasibility of constraints in the initial solution, and use a preset solver to evaluate the confidence level of the binary variables and continuous variables affecting the feasibility of constraints in the initial solution.
[0025] For binary variables with a confidence level lower than a preset threshold, a correction strategy is adopted to either set the binary variable to not execute or to set it to a nearby historical value.
[0026] For continuous variables whose confidence level is lower than a preset threshold that affect the feasibility of the constraint, a correction strategy of adjusting the value range of the continuous variables is adopted.
[0027] In one embodiment, the above method, wherein the confidence assessment of the binary variables and continuous variables affecting the feasibility of the constraints in the initial solution includes:
[0028] For the binary variables in the initial solution, the confidence level of the binary variables is evaluated by calculating the degree of violation between the values of the binary variables and the preset association constraints.
[0029] For the continuous variables in the initial solution, the confidence level of the continuous variables is evaluated by calculating the linear constraint relaxation of the continuous variables.
[0030] In one embodiment, the above method, wherein solving the original MINLP model based on the initial solution to obtain the final solution of the original MINLP model, includes:
[0031] The initial solution is input into the pre-set master solver, and the initial values of the variables of the master solver are set; the original MINLP model is then solved.
[0032] During the solution process, the master solver monitors violations of physical constraints, engineering constraints, and accuracy constraints, as well as the search progress of the master solver, in real time.
[0033] Once the solution is complete, the master solver outputs the final solution of the original MINLP model.
[0034] In one embodiment, the above method further includes, during the solution process:
[0035] If violations of the physical constraints, engineering constraints, and precision constraints are detected, or if an anomaly is detected in the search progress of the master solver, the master solver will trigger an online re-correction strategy based on the type of constraint violation and the search progress status.
[0036] Secondly, embodiments of the present invention provide a crude oil inbound scheduling model solving device, comprising:
[0037] The original MINLP model construction module is used to construct the original MINLP model for crude oil inbound scheduling and identify key nonlinear terms in the original MINLP model. The original MINLP model includes continuous variables, binary variables, and key nonlinear terms. The key nonlinear terms include the nonlinear mapping between the physical properties of crude oil components after mixing and the proportion of each component.
[0038] An approximate MINLP model construction module is used to perform piecewise linear approximation design on the identified key nonlinear terms; construct an approximate MINLP model based on the piecewise linear approximation design results; and use the solution of the approximate MINLP model as the initial solution of the original MINLP model.
[0039] The solver module is used to solve the original MINLP model based on the initial solution to obtain the final solution of the original MINLP model.
[0040] Thirdly, embodiments of the present invention provide a server, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the aforementioned method for solving the crude oil inflow scheduling model.
[0041] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the aforementioned method for solving the crude oil inflow scheduling model.
[0042] Fifthly, embodiments of the present invention provide a computer program product, the computer program product including a computer program, which, when executed by a processor, implements the aforementioned method for solving the crude oil inflow scheduling model.
[0043] The beneficial effects of the above-described technical solutions provided in the embodiments of the present invention include at least the following:
[0044] The crude oil inflow scheduling model solution method provided in this invention retains the structural information of key constraints and constructs an approximate MINLP model by piecewise linearizing the nonlinear variables in the original MINLP model. This not only ensures the feasibility of the original MINLP model but also significantly reduces the nonlinear computational burden, effectively improving the solution speed. Under the premise of ensuring feasibility and solution quality, a large proportion of the solution time is shortened. Coupled with the hot-start mechanism of the solver, the approximate MINLP model provides a high-quality initial solution, which can effectively reduce the search space and iteration number of the branch and bound tree.
[0045] Furthermore, the crude oil inflow scheduling model solution method provided in this embodiment of the invention can avoid invalid searches in the main solver's solution process by evaluating the confidence of the initial solution and using an online correction strategy. This can effectively improve the solution efficiency, shorten the convergence time and iteration steps, and increase the global optimal solution hit rate. It can also effectively reduce the divergence risk, improve robustness, and adapt to complex scenario requirements.
[0046] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings.
[0047] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0048] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0049] Figure 1 This is a schematic diagram of the crude oil inlet scheduling model solution method in an embodiment of the present invention;
[0050] Figure 2 This is a schematic diagram illustrating the process of identifying key nonlinear terms in the original MINLP model in an embodiment of the present invention;
[0051] Figure 3 This is a schematic diagram of the piecewise linear approximation design process for key nonlinear terms in an embodiment of the present invention;
[0052] Figure 4 This is a schematic diagram illustrating the process of obtaining the final solution of the original MINLP model in an embodiment of the present invention;
[0053] Figure 5 This is a schematic diagram illustrating the input of table data in an example of an embodiment of the present invention;
[0054] Figure 6 This is a schematic diagram of the output data in an example of an embodiment of the present invention;
[0055] Figure 7 This is a comparison chart of the effects of a warm start and a non-warm start on the MINLP model in this embodiment of the invention;
[0056] Figure 8 This is a schematic diagram of the structure of the crude oil inlet scheduling model solving device in an embodiment of the present invention. Detailed Implementation
[0057] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0058] The inventors of this invention have discovered that existing technologies often accelerate the solution process through methods such as model simplification, which involves linearizing or discarding nonlinear terms to approximate the original MINLP model into a Mixed Integer Linear Programming (MILP) model. For example, Taylor expansion is used to extract the linear principal term from the nonlinear correlation of mixed crude oil properties, or less influential nonlinear constraints are omitted. While this approach can significantly shorten computation time by leveraging the efficiency of the MILP model solver, it loses crucial nonlinear property information. Linearization may deviate from the actual laws governing crude oil mixing, and ignoring nonlinear terms may violate real production constraints such as tank capacity limits and mixing restrictions. Ultimately, the resulting scheduling scheme either conflicts in actual implementation or deviates significantly from the true optimal value in terms of cost control, energy consumption optimization, and other objectives.
[0059] Another approach is to employ an initial solution-guided strategy, which utilizes historical scheduling experience to build a rule base or trains machine learning models such as neural networks or gradient boosting trees to predict initial scheduling schemes, providing a "hot start" for the solver to reduce the number of iterations. However, if this strategy relies on a purely black-box model for prediction, it is susceptible to dynamic changes in operating conditions. For example, historical experience may not cover special scenarios such as ships arriving early or sudden tank farm failures, and the machine learning model may output infeasible solutions that violate safety constraints. Even if the initial solution is feasible, model bias may guide the solver to a local optimum, failing to achieve globally optimal scheduling and making it difficult to guarantee the optimization quality of the scheduling scheme. Both strategies struggle to balance solution speed with the feasibility and optimality of the solution, failing to meet the stringent requirements of industrial scenarios. Therefore, how to retain the influence of key nonlinear physical properties while providing the solver with a high-quality, controllable initial solution is an urgent problem to be solved.
[0060] To address the aforementioned issues, this invention provides a method and apparatus for solving a crude oil inflow scheduling model.
[0061] First, the method for solving the crude oil inflow scheduling model provided in the embodiments of the present invention will be described, referring to... Figure 1 As shown, the crude oil inflow scheduling model solution method provided in this embodiment of the invention includes the following process:
[0062] S11. Construct the original mixed integer nonlinear programming (MINLP) model for the original crude oil inbound scheduling, and identify the key nonlinear terms in the original MINLP model; the original MINLP model includes continuous variables, binary variables, and key nonlinear terms; the key nonlinear terms include the nonlinear mapping between the physical properties of crude oil components after mixing and the proportion of each component;
[0063] S12. Based on the identified key nonlinear terms, perform piecewise linear approximation design on the key nonlinear terms; based on the piecewise linear approximation design results, construct an approximate MINLP model, and use the solution of the approximate MINLP model as the initial solution of the original MINLP model;
[0064] S13. Solve the original MINLP model based on the initial solution to obtain the final solution of the original MINLP model.
[0065] The crude oil inflow scheduling model solution method provided in this invention retains the structural information of key constraints and constructs an approximate MINLP model by piecewise linearizing the nonlinear variables in the original MINLP model. This not only ensures the feasibility of the original MINLP model but also significantly reduces the nonlinear computational burden, effectively improving the solution speed. Under the premise of ensuring feasibility and solution quality, a large proportion of the solution time is shortened. Coupled with the hot-start mechanism of the solver, the approximate MINLP model provides a high-quality initial solution, which can effectively reduce the search space and iteration number of the branch and bound tree.
[0066] In one embodiment, the continuous variables in the original MINLP model described above may include tank inventory, path flow, product output, physical property values, etc., specifically:
[0067] Can inventory: refers to the inventory of each can at each time point (inv, inventory).
[0068] Path flow: refers to the flow of crude oil from one tank or dock to another tank or unit at a given moment. It is divided into different flow variables depending on the pipeline connection. For example, pipeline L01 connects the dock to the dock tank, and the path flow is denoted as x. Pipeline L02 connects the plant tank to the blending tank, and the path flow is denoted as y.
[0069] Product output: refers to the target amount of crude oil entering the plant, that is, the amount of crude oil sent to the atmospheric and vacuum distillation unit, and also the path flow from the blending tank area to the atmospheric and vacuum distillation unit, denoted by z;
[0070] Physical properties (prop): mainly include the sulfur content (Sul), density (SPG), and acidity (TAN) of crude oil.
[0071] The binary variables in the original MINLP model mentioned above include the tank's state variables, rule selection, loading and unloading decisions, etc., specifically:
[0072] The tank's state variables can be categorized into three states: receiving oil, dispensing oil, and settling.
[0073] Rule selection: Based on business requirements, set a binary variable to indicate whether the rule is enabled;
[0074] Loading and unloading decision: refers to the crude oil loading and unloading plan, and whether to load or unload at a certain time.
[0075] The objective function in the original MINLP model can be cost minimization, which may include costs such as crude oil transportation, tank storage occupancy costs, tank switching costs, and volatility costs.
[0076] In one embodiment, in step S11 above, key nonlinear terms in the original MINLP model are identified, referring to... Figure 2 As shown, the process may include the following:
[0077] S21. Use a computing library to parse the expression of the original MINLP model and convert the expression string of the original MINLP model into a symbolic expression of the computing library;
[0078] S22. Based on the parsing result of the expression of the original MINLP model, the expression of the original MINLP model is split into multiple independent terms;
[0079] S23. Identify nonlinear terms among the plurality of independent terms; the nonlinear terms include terms with a total degree greater than 1, transcendental functions, and nonpolynomial terms.
[0080] In one embodiment, in step S23 above, terms with a total degree greater than 1, such as x² and x*y, are nonlinear terms; terms with transcendental functions such as sin(x) and e^x are nonlinear terms; and terms without polynomials such as 1 / x and sqrt(x) are nonlinear terms. Key nonlinear relationships in the model are identified by identifying nonlinear terms.
[0081] In practical implementation, the key nonlinear terms in the MINLP model can be nonlinearly mapped to the physical properties of the components after mixing and the proportion of each component. For example, if there are many components in a tank of crude oil, nonlinear constraints are needed to control the proportion of each component, such as the form y1=k*y2, where y1 and y2 are the proportions of two different components, and k is the proportional relationship between the two components.
[0082] For example, physical property calculations and flow inflow / outflow measurements both involve nonlinear terms, as well as nonlinear product terms between tank state variables and path flow rates, and nonlinear functions used in physical property calculations, such as lnx and e. x In the form of.
[0083] In one embodiment, in step S12 above, a piecewise linear approximation design is performed on the key nonlinear term, referring to... Figure 3 As shown, the specific process includes the following:
[0084] S31. Divide the domain of the nonlinear function corresponding to the key nonlinear term into multiple segments according to preset segmentation nodes;
[0085] S32. Use a first-order linear function to approximate the nonlinear function of each domain segment, and record the upper and lower bound errors between the nonlinear function of each domain segment and the corresponding first-order linear function.
[0086] S33. Based on the upper and lower bound errors, readjust the distance between the segmented nodes and the first-order linear function that is approximated until the upper and lower bound errors are within the preset error range.
[0087] In one embodiment, the above-described piecewise linear approximation design of the key nonlinear term further includes:
[0088] If the nonlinear term is a product of variables or a ratio of variables, a replacement variable is introduced to replace the nonlinear term, and the local range of values of the replacement variable is limited by linear slicing. In specific implementation, Big-M Logical Constraints or McCormick Envelope Constraints can be applied to the replacement variable to achieve linearized expression.
[0089] In one embodiment, before using the solution of the approximate MINLP model as the initial solution of the original MINLP model in step S12 above, the method further includes:
[0090] Determine whether a historical solution sample library exists. If it does, select a historical solution sample from the historical solution sample library as the initial solution of the MINLP model. If not, use the solution of the approximate MINLP model as the initial solution of the MINLP model.
[0091] In specific implementations of this invention, modeling tools such as the open-source Python optimization modeling tool (Pyomo, Python Optimization Modeling Objects) can be used, or the modeling functions built into solvers such as Gurobi and Copt can be employed. The initial conditions, decision variables and their ranges, objective function, and constraints of crude oil inflow scheduling are constructed into an optimization problem, resulting in an approximate MINLP model for crude oil inflow scheduling. The approximate MINLP model is then solved using solvers such as Gurobi and Copt to obtain an initial solution.
[0092] In one embodiment, after obtaining the initial solution, step S12 further includes: using a preset solver to evaluate the confidence level of the initial solution, and correcting the initial solution based on the confidence level evaluation result.
[0093] In solving the MINLP model, the quality of the initial solution is the key factor that determines the convergence efficiency. If the initial solution deviates too far from the feasible region, violates the core constraints, or gets trapped in a local optimum neighborhood, it will directly mislead the solver's search direction, causing the convergence speed to drop sharply, the iteration to diverge, or even the inability to find the global optimum.
[0094] In one embodiment, the above-mentioned confidence assessment of the initial solution using a preset solver, and the correction of the initial solution based on the confidence assessment result, specifically includes:
[0095] Identify the binary variables and continuous variables affecting the feasibility of constraints in the initial solution, and use a preset solver to evaluate the confidence level of the binary variables and continuous variables affecting the feasibility of constraints in the initial solution; for binary variables with confidence levels below a preset threshold, use a correction strategy of setting the binary variables to not be executed or setting them to nearby historical values; for continuous variables affecting the feasibility of constraints with confidence levels below a preset threshold, use a correction strategy of adjusting the value range of the continuous variables.
[0096] In one embodiment, the confidence assessment of the binary variables and continuous variables affecting the feasibility of the constraints in the initial solution specifically includes:
[0097] For the binary variables in the initial solution, the confidence level of the binary variables is evaluated by calculating the violation degree between the values of the binary variables and the preset association constraints; for the continuous variables in the initial solution, the confidence level of the continuous variables is evaluated by calculating the linear constraint relaxation degree of the continuous variables.
[0098] In one embodiment, in step S13 above, the original MINLP model is solved based on the initial solution to obtain the final solution of the original MINLP model, referring to... Figure 4 As shown, the process includes the following:
[0099] S41. Input the initial solution into the pre-set master solver and set the initial values of the variables of the master solver; solve the original MINLP model;
[0100] S42. During the solution process, the master solver monitors in real time the violations of physical constraints, engineering constraints and accuracy constraints and the search progress of the master solver.
[0101] S43. After the solution is completed, the main solver outputs the final solution of the original MINLP model.
[0102] In one embodiment, the method further includes the following steps during the solution process:
[0103] If violations of the physical constraints, engineering constraints, and precision constraints are detected, or if an anomaly is detected in the search progress of the master solver, the master solver will trigger an online re-correction strategy based on the type of constraint violation and the search progress status.
[0104] If the master solver determines that the physical constraints, engineering constraints, and accuracy constraints are violated, then
[0105] If the master solver determines that the search progress is abnormal, it reduces the weight of some variables in the original MINLP model or clears the initial values of some variables in the original MINLP model so that the master solver can search again.
[0106] The crude oil inflow scheduling model solution method provided in this invention can avoid invalid searches in the main solver's solution process by evaluating the confidence of the initial solution and using an online correction strategy. This can effectively improve the solution efficiency, shorten the convergence time and iteration steps, and increase the global optimal solution hit rate. It can also effectively reduce the risk of divergence, improve robustness, and adapt to complex scenario requirements.
[0107] The following specific example illustrates the implementation process of the crude oil inflow scheduling model solution method provided in this embodiment of the invention.
[0108] (1) Establish the original MINLP model for the original crude oil inlet scheduling. The original MINLP model includes continuous variables such as the inventory of each type of oil in each tank, the flow rate of each path, and the output of products; binary variables such as the tank state variables, loading and unloading decisions, and rule selection; the objective function of the original MINLP model is usually cost minimization or profit maximization, including crude oil transportation, tank storage cost, tank switching cost, and fluctuation cost.
[0109] When constructing the original MINLP model, business tables are used as input data. These business tables include production scheduling data, node types, crude oil tank farms, initial inventory, oil type ratios, processing plans, sea-transported crude oil plans, land-transported crude oil plans, processing nature control, general rules, and crude oil delivery costs.
[0110] Using modeling tools such as Pyomo, the initial conditions, decision variables and variable ranges, objective function, and constraints of crude oil inflow scheduling are constructed into an optimization problem, namely the initial MINLP model of crude oil inflow scheduling.
[0111] The following is the inventory balance constraint in the original MINLP model. Specifically, it means that the current inventory of a tank equals the previous inventory plus the crude oil received minus the crude oil issued, along with important constraints related to physical properties. In this example, the important constraint refers to the changes in physical properties during the oil receiving and issuing process. The expression for this inventory balance constraint is:
[0112] ;
[0113] ;
[0114] in, express Can Total inventory at the current moment; express Inventory property values of the tank at time t-1; This indicates the flow rate of oil being unloaded from the terminal to the terminal tanks; Indicates the flow rate between tanks; Indicates the flow rate between the tank and the device; express Can Inventory properties at any given time The value; Indicates the type of oil to be unloaded physical properties The value; , Indicates the tank number; Represents a collection of crude oil tank farms; This represents the collection of tank areas and blending tank areas within the plant; Indicates the type of oil; This represents the set of all oil types used in the business. Indicates the name of the processing equipment; It represents the collection of all processing devices; Indexes representing physical properties; Indicates the time.
[0115] This example uses the SymPy (Symbolic Python) computation library to parse expressions and analyze their structure, converting the input expression string into a symbolic expression in SymPy, and splitting the expression into independent terms based on addition.
[0116] (2) Perform piecewise linear approximation design, construct an approximate MINLP model by linearizing the original MINLP model, specifically:
[0117] The segmented nodes of the function's domain can be determined by equidistant or adaptive partitioning based on error sensitivity. Each segment's nonlinear function is approximated by a first-order linear function. If the nonlinear term involves variable products or ratios, substitution variables and linear slices are used. The following is the linearization formula between inventory and physical properties:
[0118] ;
[0119] ;
[0120] ;
[0121] ;
[0122] in, This represents crude oil inventory levels; the relationship between physical property inventory levels and crude oil inventory levels can be represented by a non-linear term:
[0123] ;
[0124] in, Indicates average physical properties, Indicates the tank number. Indicates the properties of a substance. Indicates the time.
[0125] The nonlinear term of the product of two continuous variables can be determined using McCormick constraints. An example of a McCormick constraint is shown below:
[0126] Let the range of values for variables x and y be: x∈[x... L ,x U ], y∈[y L ,y U If z = x * y, then z = x * y can be expressed using the following constraints:
[0127] ;
[0128] ;
[0129] ;
[0130] In order to ensure the feasibility and conservatism of the approximate MINLP model, this example can add conservative biases to the piecewise constraints. For example, the lower bound of the demand constraint can be approximated conservatively to avoid the approximate MINLP model giving a solution that is not feasible in the original MINLP model.
[0131] Where, x L This represents the lower boundary of the values x can take. UThis represents the upper boundary of the possible values of x;
[0132] y L This represents the lower boundary of the possible values of y. U This represents the upper boundary of the possible values of y.
[0133] (3) Solve the approximate MINLP model and output the initial solution, specifically:
[0134] The approximate MINLP model was solved using the Gurobi solver.
[0135] Since there is no historical solution sample library in this example, the solution of approximate MINLP is used as the initial solution of the initial MINLP model and output.
[0136] (4) Evaluate and correct the confidence level of the initial solution;
[0137] For key variables in the initial solution, the preferred binary variables and continuous variables affecting the feasibility of constraints are evaluated for confidence levels. Binary variables and continuous variables affecting the feasibility of constraints with confidence levels lower than preset values are corrected.
[0138] The corrected initial solution is used as input for the warm-start of the master solver.
[0139] (5) Solve the original MINLP model using the master solver, specifically:
[0140] Set the initial values of the variables according to the format required by the master solver;
[0141] During the solution process, monitor violations of key constraints and search progress, and trigger online re-correction when necessary: if the initial solution is found to have a negative impact on the search direction, its weight can be reduced or the initial values of some variables can be cleared to allow the solver to search again;
[0142] Finally, all the set decision variables are solved, and the output is processed by a function to provide the intuitive results required by the user, such as a result table, which includes crude oil tank receiving and payment arrangements, atmospheric and vacuum distillation feed arrangements, and changes in crude oil tank inventory.
[0143] (6) Experimental verification and performance indicators, specifically:
[0144] The following example uses crude oil inflow scheduling at a refinery. The input data should include: a scheduling plan (including scheduling cycle, time scale, processing plan, and unloading plan); a basic topology (pipeline connections, terminal distribution, tank farm distribution, unit distribution, maximum and minimum transmission capacity, and maximum and minimum safety stock); initial state (initial tank inventory, oil type, proportion, and properties); required scheduling rules (processing property control, crude oil unloading rules, crude oil transfer rules, crude oil transmission rules, and general rules); and cost items (transportation costs, inventory costs, unloading costs, fluctuation costs, and excess costs). The output decision variables include path flow, inventory levels, physical property values, and state variables at each time point. See the attached document for details. Figure 5 As shown.
[0145] The final, intuitive results output to the user include crude oil delivery schedules, crude oil tank receiving and disbursement schedules, crude oil tank dynamic inventory, crude oil tank average properties, pipeline movement, processing schedules, and the composition of the processed components, such as... Figure 6 As shown.
[0146] Practical verification shows that the output scheduling scheme is feasible and optimal. (Refer to...) Figure 7 As shown, there are three reference lines: 1%, 0.6%, and 0.5%. The smaller the value of the reference line, the shorter the solution time and the better the solution performance.
[0147] The blue curve represents the performance analysis curve of the MINLP model solution without using a warm start, i.e., without using the crude oil inflow scheduling model solution method provided in this embodiment of the invention. The orange curve represents the performance analysis curve of the MINLP model solution using a warm start, i.e., using the crude oil inflow scheduling model solution method provided in this embodiment of the invention. It can be observed that the orange curve is basically close to the 0.5% reference line, indicating that the solution obtained by the crude oil inflow scheduling model solution method provided in this embodiment of the invention is better and has a significant improvement in solution time. It retains the accuracy of the nonlinear model and improves the speed through linearization of the model, significantly reducing the total running time of the main solver. The confidence correction mechanism can minimize the risk of approximation misleading, thus having an advantage in solution quality compared with traditional approximation methods.
[0148] Based on the same inventive concept, this embodiment of the invention also provides a crude oil inflow scheduling model solving device. Since the principle of solving the problem by these devices and clients is similar to the aforementioned crude oil inflow scheduling model solving method, the implementation of the device and client can refer to the implementation of the aforementioned method, and the repeated parts will not be described again.
[0149] Reference Figure 8 As shown, the crude oil inflow scheduling model solving device provided in this embodiment of the invention includes:
[0150] The original MINLP model construction module 81 is used to construct the original MINLP model for crude oil inbound scheduling and identify key nonlinear terms in the original MINLP model; the original MINLP model includes continuous variables, binary variables and key nonlinear terms;
[0151] The approximate MINLP model construction module 82 is used to perform piecewise linear approximation design on the identified key nonlinear terms; construct an approximate MINLP model based on the piecewise linear approximation design results; and use the solution of the approximate MINLP model as the initial solution of the original MINLP model.
[0152] The solver module 83 is used to solve the original MINLP model based on the initial solution to obtain the final solution of the original MINLP model.
[0153] This invention also provides a server, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the crude oil inflow scheduling model solution method as described above.
[0154] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the crude oil inflow scheduling model solution method as described above.
[0155] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the crude oil inflow scheduling model solution method described above.
[0156] Regarding the crude oil inlet scheduling model solving device in the above embodiments, the specific methods of each module's operation have been described in detail in the embodiments related to the method, and will not be elaborated here.
[0157] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0158] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.
[0159] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0160] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0161] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0162] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for solving a crude oil inflow scheduling model, characterized in that, include: Construct a primitive mixed-integer nonlinear programming (MINLP) model for crude oil inbound scheduling, and identify the key nonlinear terms in the primitive MINLP model; The original MINLP model includes continuous variables, binary variables, and key nonlinear terms; the key nonlinear terms include the nonlinear mapping between the physical properties of crude oil components after mixing and the proportion of each component. Based on the identified key nonlinear terms, a piecewise linear approximation design is performed on the key nonlinear terms; based on the results of the piecewise linear approximation design, an approximate MINLP model is constructed, and the solution of the approximate MINLP model is used as the initial solution of the original MINLP model; Based on the initial solution, the original MINLP model is solved to obtain the final solution of the original MINLP model.
2. The method as described in claim 1, characterized in that, The identification of key nonlinear terms in the original MINLP model includes: The expression of the original MINLP model is parsed using a computing library, and the expression string of the original MINLP model is converted into a symbolic expression of the computing library; Based on the parsing results of the original MINLP model expression, the original MINLP model expression is split into multiple independent terms; Identify nonlinear terms among the plurality of independent terms; the nonlinear terms include terms with a total degree greater than 1, transcendental functions, and nonpolynomial terms.
3. The method as described in claim 1, characterized in that, The piecewise linear approximation design of the key nonlinear term includes: The domain of the nonlinear function corresponding to the key nonlinear term is divided into multiple segments according to preset segmentation nodes; The nonlinear function of each domain segment is approximated by a first-order linear function, and the upper and lower bound errors between the nonlinear function of each domain segment and the corresponding first-order linear function are recorded. Based on the upper and lower bound errors, the distances of the segmented nodes and the first-order linear function that is approximated are readjusted until the upper and lower bound errors are within the preset error range.
4. The method as described in claim 1, characterized in that, The piecewise linear approximation design of the key nonlinear term further includes: Determine whether the nonlinear term is a product of variables or a ratio of variables. If so, introduce a replacement variable to replace the nonlinear term, and limit the local value range of the replacement variable by linear slicing.
5. The method as described in claim 1, characterized in that, Before using the solution of the approximate MINLP model as the initial solution of the original MINLP model, the method further includes: Determine whether a historical solution sample library exists. If it does, select a historical solution sample from the historical solution sample library as the initial solution of the MINLP model. If not, use the solution of the approximate MINLP model as the initial solution of the MINLP model.
6. The method as described in claim 1, characterized in that, After obtaining the initial solution, the method further includes: using a preset solver to evaluate the confidence level of the initial solution, and correcting the initial solution based on the confidence level evaluation result.
7. The method as described in claim 6, characterized in that, The step of evaluating the confidence level of the initial solution using a preset solver and correcting the initial solution based on the confidence level evaluation result includes: Identify the binary variables and continuous variables affecting the feasibility of constraints in the initial solution, and use a preset solver to evaluate the confidence level of the binary variables and continuous variables affecting the feasibility of constraints in the initial solution. For binary variables with a confidence level lower than a preset threshold, a correction strategy is adopted to either set the binary variable to not execute or to set it to a nearby historical value. For continuous variables whose confidence level is lower than a preset threshold that affect the feasibility of the constraint, a correction strategy of adjusting the value range of the continuous variables is adopted.
8. The method as described in claim 7, characterized in that, The confidence assessment of the binary variables and continuous variables affecting the feasibility of the constraints in the initial solution includes: For the binary variables in the initial solution, the confidence level of the binary variables is evaluated by calculating the degree of violation between the values of the binary variables and the preset association constraints. For the continuous variables in the initial solution, the confidence level of the continuous variables is evaluated by calculating the linear constraint relaxation of the continuous variables.
9. The method according to any one of claims 1-8, characterized in that, The step of solving the original MINLP model based on the initial solution to obtain the final solution of the original MINLP model includes: The initial solution is input into the pre-set master solver, and the initial values of the variables of the master solver are set; the original MINLP model is then solved. During the solution process, the master solver monitors violations of physical constraints, engineering constraints, and accuracy constraints, as well as the search progress of the master solver, in real time. Once the solution is complete, the master solver outputs the final solution of the original MINLP model.
10. The method as described in claim 9, characterized in that, The method further includes the following steps during the solution process: If violations of the physical constraints, engineering constraints, and precision constraints are detected, or if an anomaly is detected in the search progress of the master solver, the master solver will trigger an online re-correction strategy based on the type of constraint violation and the search progress status.
11. A device for solving a crude oil inflow scheduling model, characterized in that, include: The original MINLP model construction module is used to construct the original MINLP model for crude oil inbound scheduling and identify key nonlinear terms in the original MINLP model. The original MINLP model includes continuous variables, binary variables, and key nonlinear terms. The key nonlinear terms include the nonlinear mapping between the physical properties of crude oil components after mixing and the proportion of each component. An approximate MINLP model construction module is used to perform piecewise linear approximation design on the identified key nonlinear terms; construct an approximate MINLP model based on the piecewise linear approximation design results; and use the solution of the approximate MINLP model as the initial solution of the original MINLP model. The solver module is used to solve the original MINLP model based on the initial solution to obtain the final solution of the original MINLP model.
12. A server, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the crude oil inflow scheduling model solution method according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the crude oil inflow scheduling model solution method according to any one of claims 1 to 10.
14. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the crude oil inflow scheduling model solution method according to any one of claims 1 to 10.