Product oil blending scheduling optimization method and device
By combining genetic algorithms with mathematical programming solvers, a hybrid solution framework was developed to address the nonlinear and multivariate coupling issues in refined oil blending and scheduling, thereby improving the efficiency and feasibility of scheduling schemes and optimizing economic efficiency and stability.
Patent Information
- Application Number
- CN202511625894.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-07
- Publication Date
- 2026-03-03
AI Technical Summary
Traditional refined oil blending and scheduling methods cannot fully reflect the nonlinear physical property changes, multidimensional temporal coupling, and equipment operation constraints of the blending system. As a result, the optimization scheme cannot take into account both economic benefits and production stability, which affects the refinery's operating efficiency and market responsiveness.
A hybrid solution framework combining genetic algorithm and mathematical programming solver is adopted. By analyzing the constraint relationship between refined oil, component oil type, component ratio and time period information, a one-dimensional chromosome vector is generated to construct an initial population. Crossover and recombination and perturbation operations are performed until the preset termination condition is reached. Finally, a fine solution is performed to output the solution result of the blending and scheduling model.
It significantly improves the solution efficiency of large-scale coordination and scheduling problems, optimizes the objective function value of the scheduling scheme, enhances the feasibility and stability of the solution, maximizes the economy and stable operation of the whole process scheduling scheme, and reduces production costs.
Smart Images

Figure CN121601063A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent optimization scheduling technology in the petrochemical industry, and in particular to a method and apparatus for optimizing the blending and scheduling of refined oil products. Background Technology
[0002] Refined oil blending and scheduling, as an indispensable core link in the refining production chain, is responsible for scientifically blending various component oils from different refining units, supply channels, and batches into gasoline, diesel, and other refined oil products that meet strict quality standards and regulatory requirements. This process involves not only complex calculations of multi-component oil mixing ratios but also dynamic coordination at multiple levels, from production planning and raw material supply coordination to storage tank inventory management, blending unit scheduling, logistics route optimization, and equipment operation sequence arrangement. Especially under the complex conditions of multiple tank areas, multiple process units, and multiple production periods within a refinery, blending and scheduling must ensure that physical properties such as octane number, density, and sulfur content meet standards while simultaneously satisfying multiple constraints on production volume, inventory safety, and equipment operation.
[0003] With the continuous expansion of production scale in the refining and chemical industry, the constant advancement of process technology, and the increasingly stringent standards for refined oil quality and environmental protection, traditional methods relying on empirical rules and simple linear programming models have gradually revealed their limitations. These methods struggle to fully reflect the nonlinear property changes, multidimensional temporal coupling, and complexities of equipment operation constraints in blending systems. Consequently, optimization schemes often fail to balance economic benefits and production stability in practical applications, impacting the overall operational efficiency and market responsiveness of refineries. Summary of the Invention
[0004] In view of the above problems, the present invention is proposed to provide a method and apparatus for optimizing the blending and scheduling of refined oil products to overcome or at least partially solve the above problems.
[0005] In a first aspect, embodiments of the present invention provide a method for optimizing the blending and scheduling of refined oil products, comprising:
[0006] By analyzing the constraint relationship of the component ratio decision variables, which contain information on refined oil, the types of component oils in refined oil, the component ratio of refined oil, and the time period, the constraint information data corresponding to the component ratio decision variables is extracted.
[0007] Based on the constraint information data, multiple component ratio vectors corresponding to multiple time periods are generated for each type of refined oil component ratio; based on the multiple component ratio vectors, the element values of all component ratio vectors are flattened to obtain a one-dimensional chromosome vector; an initial population is constructed using the obtained multiple one-dimensional chromosome vectors.
[0008] Based on the initial population, the fitness value of each element in the one-dimensional chromosome vector is calculated iteratively. Elements whose fitness values do not meet the preset conditions are removed. Crossover and recombination operations and perturbation operations are performed on some elements in the one-dimensional chromosome vector until a new population that meets the preset termination conditions is returned.
[0009] Based on the new population, the preset refined oil blending and scheduling model is solved in detail to output the corresponding refined oil blending and scheduling model solution results.
[0010] In one embodiment, the above method extracts constraint information data corresponding to the component ratio decision variables by parsing the constraint relationship of the component ratio decision variables, which include information on the refined oil, the types of component oils in the refined oil, the component ratio of the refined oil, and the time period. This includes:
[0011] The lower bound constraint information of the extracted component ratio decision variables, which contain information on the refined oil, the types of component oils in the refined oil, the component ratio of the refined oil, and the time period, is stored in a dictionary. The upper bound constraint information of the extracted component ratio decision variables, which contain information on the finished oil, the types of component oils, the component ratios of the finished oil, and the time period, is stored in a dictionary. middle;
[0012] The constraint relationship of the component ratio decision variables, which include information on the refined oil, the types of component oils in the refined oil, the component ratio of the refined oil, and the time period, is as follows:
[0013] ;
[0014] ;
[0015] in, Indicates refined oil products; This indicates the types of component oils in the finished oil product. Indicates the component ratio of the refined oil; Indicates a time period; Represents the group allocation ratio decision variable;
[0016] This represents the minimum value of the group allocation decision variable;
[0017] This indicates the maximum value of the group allocation decision variable;
[0018] Describe the lower bound of the group allocation decision variable. Describe the upper bound of the group allocation decision variable.
[0019] In one embodiment, the above method, based on the plurality of group allocation ratio vectors, flattens the element values of all group allocation ratio vectors to obtain a one-dimensional chromosome vector, including:
[0020] Based on the multiple grouping ratio vectors, determine whether the sum of the element values of each grouping ratio vector is 1. If so, flatten the element values of all grouping ratio vectors to obtain a one-dimensional chromosome vector.
[0021] In one embodiment, the above method determines whether the sum of the element values of each group allocation ratio vector is 1. If not, the group allocation ratio vectors whose element value sum is not equal to 1 are reassigned according to a preset calculation rule until the sum of the element values equals 1. The preset calculation rule is as follows:
[0022] ;
[0023] in, ;
[0024] ;
[0025] ;
[0026] ;
[0027] Indicates the number of component oil types in the finished oil product; Indicates the component oil index; Time period The corresponding group allocation ratio vector; Indicates the first Time period, number The component ratio variable of the oil components, i.e., the time period. The elements of the corresponding group distribution ratio vector;
[0028] The sum of all elements in the component oil proportion vector is given, where ;
[0029] It is the difference between the value 1 and the sum of all elements in the component oil ratio vector;
[0030] Represents element Within the range of values Random sampling is performed within the area based on a uniform distribution. They represent The lower and upper bounds.
[0031] In one embodiment, the calculation process of the fitness value of each element in the one-dimensional chromosome vector in the above method includes:
[0032] Each one-dimensional chromosome vector in the initial population is fed in parallel to multiple pre-set process evaluation modules. For each process evaluation module, the data planning solver environment is initialized.
[0033] Based on the initialization data planning solver environment, the upper and lower bounds of the group allocation decision variable are fixed as the corresponding element values in the one-dimensional chromosome vector to obtain fixed variables;
[0034] Based on the fixed variables, the remaining free variables are optimized according to the set objective function of the harmonic scheduling model to obtain the variable values among the remaining free variables that minimize the objective function of the harmonic scheduling model.
[0035] In one embodiment, the above method removes elements whose fitness values do not meet preset conditions, including:
[0036] Sort all elements by fitness value from smallest to largest;
[0037] According to the sorting, a set number of elements are selected to generate the optimized population for this iteration.
[0038] In one embodiment, the above method, which performs crossover recombination operations on a subset of elements of the one-dimensional chromosome vector, includes:
[0039] Time period Corresponding group allocation ratio vector , Perform a set of uniform crosses according to the following formula.
[0040] ;
[0041] in The numbers are uniformly distributed random numbers; ; This indicates that the new grouping ratio vector is formed after splicing.
[0042] In one embodiment, the above method, which perturbs a portion of the elements of the one-dimensional chromosome vector, includes:
[0043] By setting a probability In the new group allocation ratio vector, a time period is randomly selected. The new group is allocated to the elements in the ratio vector. A perturbation operation is performed, and the formula for performing the perturbation operation is:
[0044] ;
[0045] in, Indicates time period The elements of the corresponding new group allocation vector; Index representing a time period This represents the j-th element in the new group allocation ratio vector; This represents a uniformly distributed disturbance. The value of is randomly selected on the interval [−δ,δ]. This indicates uniform random sampling from the interval [−δ,δ]. This represents the hyperparameter that controls the amplitude of the disturbance.
[0046] In one embodiment, the above method, until a new population that meets a preset termination condition is returned, includes:
[0047] Determine whether the number of iterations has reached the first number of iterations. If so, continue to iterate the new population for a second number of iterations. During the execution of the second number of iterations, calculate the fitness value of the elements in the new population in each iteration. If the fitness value of the elements in the new population fluctuates within a set range in each iteration, the iteration terminates and the new population is returned.
[0048] In one embodiment, the above method, based on the new population, performs a refined solution to a preset refined oil blending and scheduling model to output the corresponding refined oil blending and scheduling model solution result, including:
[0049] A one-dimensional chromosome is selected from the new population to perform a fine solution to the refined oil blending and scheduling model;
[0050] Using a mathematical programming solver, the upper and lower bounds of the continuous variables of the one-dimensional chromosome used for fine-grained solution are compressed to a preset suggested value range, and the value range of the preset binary harmonic path variables is fixed.
[0051] Determine whether the mathematical programming solver returns a feasible refined solution. If yes, output the refined solution as the solution result of the refined oil blending and scheduling model; otherwise, output the one-dimensional chromosome used for refined solution as an approximate solution.
[0052] Secondly, embodiments of the present invention provide a refined oil blending and scheduling optimization device, comprising:
[0053] The extraction module is used to extract the constraint information data corresponding to the component ratio decision variables by parsing the constraint relationship of the component ratio decision variables, which contain information on the finished oil, the types of component oils in the finished oil, the component ratio of the finished oil, and the time period.
[0054] The initial population acquisition module is used to generate multiple grouping ratio vectors corresponding to multiple time periods for each type of refined oil based on the constraint information data; flatten the element values of all grouping ratio vectors to obtain a one-dimensional chromosome vector; and construct an initial population using the acquired multiple one-dimensional chromosome vectors.
[0055] The optimization iteration module is used to iteratively calculate the fitness value of individuals within the one-dimensional chromosome vector based on the initial population, remove elements whose fitness values do not meet the preset conditions, and perform crossover and recombination operations and perturbation operations on some elements of the one-dimensional chromosome vector until a new population that meets the preset termination conditions is returned.
[0056] The solution module is used to perform a fine solution to the refined oil blending and scheduling model based on the new population, so as to output the corresponding solution results of the refined oil blending and scheduling model.
[0057] 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 refined oil blending and scheduling optimization method.
[0058] 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 refined oil blending and scheduling optimization method.
[0059] 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 refined oil blending and scheduling optimization method.
[0060] The beneficial effects of the above-described technical solutions provided in the embodiments of the present invention include at least the following:
[0061] The refined oil blending and scheduling optimization method provided in this invention is based on extracting upper and lower bound information of the component ratio decision variables, which include refined oil, the types of component oils in the refined oil, the component ratio of the refined oil, and time period information. A set of component ratio vectors for the refined oil formula is randomly generated in each time period as the encoding unit of a one-dimensional chromosome vector. After the component ratios of all component oils are independently and uniformly sampled within an allowable interval, all obtained component ratio vectors are normalized. The entire one-dimensional chromosome vector is composed of multiple time period component ratio vectors, representing a complete blending path scheme. The initial population consists of multiple such one-dimensional chromosomes, ensuring the basic feasibility and diversity of individuals. Therefore, the refined oil blending and scheduling optimization method provided in this invention, with its hybrid solution framework combining genetic algorithms and mathematical programming solvers, significantly improves the solution efficiency of large-scale blending and scheduling problems, optimizes the objective function value of the scheduling scheme, and enhances the feasibility and stability of the obtained solution.
[0062] Furthermore, the blending and scheduling optimization method provided by this invention constructs a component ratio decision variable for refined oil products and incorporates multiple costs such as inventory costs, refined oil component types and equipment switching costs, and tank farm operation costs into an objective function. This can effectively maximize the economy and ensure stable operation of the entire process scheduling scheme, effectively save production raw materials, and reduce costs.
[0063] Furthermore, the refined oil blending and scheduling optimization device provided in this embodiment of the invention, through a hybrid optimization strategy that integrates genetic algorithm and mathematical programming solver, maintains the search breadth of heuristic algorithm while utilizing the rigorous local optimization capability of mathematical programming solver, thereby achieving efficient solution of complex nonlinear and multivariate coupled blending and scheduling problems, and can effectively improve the solution speed, solution accuracy and feasibility.
[0064] Other features and advantages of the invention will be set forth in the following description, 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.
[0065] 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
[0066] 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:
[0067] Figure 1 This is a schematic diagram of the process for optimizing the blending and scheduling of refined oil products in an embodiment of the present invention;
[0068] Figure 2 This is a schematic diagram illustrating the process of a mathematical programming solver performing a fine-grained solution on a refined oil blending and scheduling model in an embodiment of the present invention.
[0069] Figure 3 This is a schematic diagram of the refined oil blending and scheduling optimization device module in an embodiment of the present invention;
[0070] Figure 4 This is a schematic diagram of the genetic algorithm for optimizing the blending and scheduling of refined oil products in an embodiment of the present invention. Detailed Implementation
[0071] 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.
[0072] The inventors of this invention discovered that using a Mixed-Integer Nonlinear Programming (MINLP) model as the mathematical framework for blending scheduling, the MINLP model can accurately characterize the nonlinear, multivariate coupling, and dynamic changes of a blending system by unifying the modeling of various process and resource constraints such as blending ratios, inventory dynamics of component oils and finished oils, equipment on / off states, and logistics flow paths. However, due to the large scale of the MINLP model, the numerous variables, including a large number of mixed-integer decision variables, and the complex nonlinear constraints within the MINLP model, traditional mathematical programming solvers face significant computational challenges when dealing with large-scale MINLP problems. Specifically, this manifests as long solution times, difficulty in quickly obtaining high-quality initial solutions, a tendency to get trapped in local optima, and even situations where no feasible solution exists.
[0073] The computational bottlenecks and insufficient feasibility of solutions faced by traditional deterministic mathematical programming solvers in the MINLP model harmonic scheduling problem are challenges that urgently need to be addressed.
[0074] To address the aforementioned issues, this invention provides a method and apparatus for optimizing the blending and scheduling of refined oil products.
[0075] First, the method for optimizing the blending and scheduling of refined oil products provided in the embodiments of the present invention will be described, referring to... Figure 1 As shown, the optimized method for blending and scheduling of refined oil products specifically includes the following steps:
[0076] S11. By analyzing the constraint relationship of the component ratio decision variable, which contains information on the finished oil, the types of component oils in the finished oil, the component ratio of the finished oil, and the time period, the constraint information data corresponding to the component ratio decision variable is extracted.
[0077] S12. Based on the constraint information data, generate multiple component ratio vectors corresponding to multiple time periods for each type of refined oil; flatten the element values of all component ratio vectors to obtain a one-dimensional chromosome vector; construct an initial population using the obtained multiple one-dimensional chromosome vectors.
[0078] S13. Based on the initial population, iteratively calculate the fitness value of each element in the one-dimensional chromosome vector, remove elements whose fitness values do not meet the preset conditions, and perform crossover and recombination operations and perturbation operations on some elements of the one-dimensional chromosome vector until a new population that meets the preset termination conditions is returned.
[0079] S14. Based on the new population, perform a fine solution on the preset refined oil blending and scheduling model to output the corresponding refined oil blending and scheduling model solution results.
[0080] Heuristic methods, such as genetic algorithms and population optimization, are widely used in intelligent optimization algorithms. These heuristic algorithms possess powerful global search capabilities, quickly discovering potential high-quality solutions within a vast solution space, thus providing high-quality initial solutions or local search starting points for mathematical programming solvers. This invention employs a genetic algorithm to solve a refined oil blending and scheduling model.
[0081] The refined oil blending and scheduling optimization method provided in this invention is based on extracting upper and lower bound information of the component ratio decision variables, which include refined oil, the types of component oils in the refined oil, the component ratio of the refined oil, and time period information. A set of component ratio vectors for the refined oil is randomly generated in each time period as the encoding unit of a one-dimensional chromosome vector. After independent and uniform sampling of the component ratios of all component oils within an allowable interval, all obtained component ratio vectors are normalized. The entire one-dimensional chromosome vector is composed of multiple time period component ratio vectors, representing a complete blending path scheme. The initial population consists of multiple such one-dimensional chromosomes, ensuring the basic feasibility and diversity of individuals. Therefore, the refined oil blending and scheduling optimization method provided in this invention, with its hybrid solution framework combining genetic algorithms and mathematical programming solvers, significantly improves the solution efficiency of large-scale blending and scheduling problems, optimizes the objective function value of the scheduling scheme, and enhances the feasibility and stability of the obtained solution.
[0082] In one embodiment, in step S11 above, by parsing the constraint relationship of the component ratio decision variable, which includes information on the refined oil, the types of component oils in the refined oil, the component ratio of the refined oil, and the time period, the constraint information data corresponding to the component ratio decision variable is extracted. Specifically, this may include:
[0083] The lower bound constraint information of the extracted component ratio decision variables, which contain information on the refined oil, the types of component oils in the refined oil, the component ratio of the refined oil, and the time period, is stored in a dictionary. The upper bound constraint information of the extracted component ratio decision variables, which contain information on the finished oil, the types of component oils, the component ratios of the finished oil, and the time period, is stored in a dictionary. middle;
[0084] The constraint relationship of the component ratio decision variables, which include information on the refined oil, the types of component oils in the refined oil, the component ratio of the refined oil, and the time period, is as follows:
[0085] ;
[0086] ;
[0087] in, Indicates refined oil products; This indicates the types of component oils in the finished oil product. Indicates the component ratio of the refined oil; Indicates a time period. Represents the group allocation ratio decision variable;
[0088] This represents the minimum value of the group allocation decision variable;
[0089] This indicates the maximum value of the group allocation decision variable;
[0090] Describe the lower bound of the group allocation decision variable. Describe the upper bound of the group allocation decision variable.
[0091] In practical implementation, for example, within a silently running mathematical optimization solver (Gurobi Optimizer, Gurobi) environment, a pre-built refined oil blending and scheduling model is loaded. Regular expressions are used to automatically parse the data containing group allocation ratio decision variables and constraint information within the refined oil blending and scheduling model. The upper and lower bounds of all group allocation ratio decision variables are extracted and stored in a structured dictionary, forming a feasible region mapping indexed by time period. For example, the parsed constraint information can be stored in a four-level nested dictionary structure, with the following structure:
[0092] bounds_dict = {
[0093] p: {
[0094] r: {
[0095] c: {
[0096] t: {"L": "U": } for t in time_period
[0097] } for c in components
[0098] } for r in recipes
[0099] } for p in products
[0100] }
[0101] In the above structure, the key-value hierarchy corresponds sequentially to the refined oil product p, the component oil type r, the component ratio c, and the time period t. The innermost dictionary stores the lower and upper bounds of the corresponding component ratio decision variables using the fields "L" and "U," respectively. This four-layer nested dictionary fully records the feasible domain boundaries under the four dimensions of prct, providing a fast and structured constraint retrieval capability for subsequent genetic algorithms.
[0102] In one embodiment, step S12 above, generating multiple component ratio vectors corresponding to multiple time periods, includes: for each time period, generating a corresponding component ratio vector based on the types of refined oil components and the proportion of each component oil.
[0103] In one embodiment, step S12 above, which flattens the element values of all group ratio vectors to obtain a one-dimensional chromosome vector, may specifically include: determining whether the sum of the element values of each group ratio vector is 1; if so, flattening the element values of all group ratio vectors to obtain a one-dimensional chromosome vector.
[0104] In one embodiment, in step S12 above, it is determined whether the sum of the element values of each group allocation ratio vector is 1. If not, the group allocation ratio vectors whose element values are not equal to 1 are reassigned according to a preset calculation rule until the sum of the element values of the group allocation ratio vectors whose element values are not equal to 1 is equal to 1. The preset calculation rule is:
[0105] ;
[0106] in, ;
[0107] ;
[0108] ;
[0109] ;
[0110] Indicates the number of component oil types in the finished oil product; Indicates the component oil index; Time period The corresponding group allocation ratio vector; Indicates the first Time period, number The component ratio variable of the oil components, i.e., the time period. The elements of the corresponding group distribution ratio vector;
[0111] The sum of all element variables within the component oil ratio vector, where ;
[0112] It is the difference between the value 1 and the sum of all element variables in the component oil ratio vector;
[0113] Represents element Within the range of values Random sampling is performed within the area based on a uniform distribution. They represent The lower and upper bounds.
[0114] The chromosome vector is sequentially concatenated and flattened into a one-dimensional chromosome vector: X ,in , representing the total number of elements in a one-dimensional chromosome vector, i.e., the total gene length of a one-dimensional chromosome; This represents the k-th element of the flattened one-dimensional chromosome vector, which is the k-th gene locus of the flattened chromosome.
[0115] In one embodiment, the calculation process of the fitness value of each element in each one-dimensional chromosome vector in step S13 above specifically includes:
[0116] Each one-dimensional chromosome vector in the initial population is fed in parallel to multiple pre-set process evaluation modules. For each process evaluation module, the data planning solver environment is initialized.
[0117] Based on the initialization data planning solver environment, the upper and lower bounds of the group allocation ratio decision variable are set to the element values of the corresponding group allocation ratio vector within the one-dimensional chromosome vector, thus obtaining fixed variables;
[0118] Based on the fixed variables, the remaining free variables are optimized according to the set harmonic scheduling model to obtain the variable values among the remaining free variables that minimize the objective function of the harmonic scheduling model.
[0119] The objective function expression of the above-mentioned coordination and scheduling model is as follows:
[0120]
[0121] Where X represents the one-dimensional chromosome vector; y represents the set of remaining free variables; This represents the objective function of the coordination and scheduling model; This means finding a function in the variable y that makes the function... The variable value that has reached its minimum value.
[0122] In practical implementation, the upper and lower bounds of each element variable mentioned above are fixed to the corresponding element value, that is:
[0123] ;
[0124] in, and Let represent the lower and upper bounds of the allocation ratio decision variable for the k-th group, respectively.
[0125] After fixing the variables, the solver optimizes the remaining free variables with the goal of solving the following problem:
[0126]
[0127] Where X represents the decision variables for each refined oil product p, the component oil types r, the component ratio c, and the corresponding component ratio at time period t; y represents the set of remaining free variables. When the solution process reaches the global optimum, the optimal objective value is returned, i.e.:
[0128]
[0129] in, This represents the optimal solution for the free variables.
[0130] In the above solution process, if the solution fails to reach the optimal value due to time constraints or complexity, but a feasible solution has been found, then the fitness of the element is the target value of the current feasible solution; if no feasible solution is found, then the fitness of the element is recorded as infinity.
[0131] In practical implementation, for example, a comprehensive scheduling simulation model can be constructed that covers multiple aspects such as the production plan, storage and supply process of component oils, as well as the component ratio, inventory management, shipment scheduling and outbound management of refined oils. The comprehensive scheduling simulation model incorporates the key process constraints, equipment operation restrictions, upper and lower limits of inventory, and multi-dimensional cost structures encountered by refineries in the production and logistics process. It constructs an objective function that covers multiple costs such as inventory costs, refined oil component ratio, equipment switching costs, and tank farm operation costs. Among them, the component ratio of a certain component oil in the refined oil is used as the decision variable, and the others, such as inventory costs, equipment switching costs, and tank farm operation costs, are used as residual free variables. These data can cover component oil production scheduling and capacity upper and lower limits, initial state and capacity limits of tank farm inventory, refined oil inventory and allocation time windows, blending formula and corresponding quality index upper and lower limits, and refined oil shipment plans and time windows, which can effectively and comprehensively support the multi-dimensional scheduling optimization needs of the model.
[0132] The blending and scheduling optimization method provided by this invention constructs a component ratio decision variable for refined oil products and incorporates multiple costs such as inventory cost, refined oil component types and equipment switching cost, and tank farm operation cost into an objective function. This method can effectively maximize the economy and ensure stable operation of the entire process scheduling scheme, effectively save production raw materials, and reduce costs.
[0133] In one embodiment, removing elements whose fitness values do not meet the preset conditions in step S13 above may specifically include:
[0134] Sort all elements by fitness value from smallest to largest;
[0135] According to the sorting, a set number of elements are selected to generate the optimized population for this iteration.
[0136] In practice, the fitness value of each element is calculated, for example:
[0137] First, the elements (individuals) in the iterative population are sorted according to their fitness values, and individuals with higher fitness values are eliminated. Specifically, the top num individuals with the best fitness (num is a hyperparameter of the genetic algorithm) are retained, and all other individuals are eliminated. Individuals with a fitness value of infinity are directly eliminated. In this way, it is ensured that the evolutionary process gradually converges towards a better solution space.
[0138] In one embodiment, step S13 above, which involves performing a crossover recombination operation on a subset of elements of the one-dimensional chromosome vector, includes:
[0139] Time period Corresponding group allocation ratio vector , Perform a set of uniform crosses according to the following formula.
[0140] ;
[0141] in The numbers are uniformly distributed random numbers; ; This indicates that the new grouping ratio vector is formed after splicing.
[0142] In one embodiment, the perturbation operation on some elements of the one-dimensional chromosome vector in step S13 above may specifically include:
[0143] By setting a probability In the new group allocation ratio vector, a time period is randomly selected. The new group is allocated to the elements in the ratio vector. A perturbation operation is performed, and the formula for performing the perturbation operation is:
[0144] ;
[0145] in, Indicates time period The elements of the corresponding new group allocation vector; Index representing a time period The first group in the new group allocation ratio vector represents the... One element; This represents a uniformly distributed disturbance. The value of is randomly selected on the interval [−δ,δ]. This indicates uniform random sampling from the interval [−δ,δ]. This represents the hyperparameter that controls the amplitude of the disturbance.
[0146] Subsequently, the population after crossover and mutation operations is normalized again, i.e.:
[0147] Using constraints, Normalization is performed.
[0148] .
[0149] in, Indicates time period The elements of the corresponding new group allocation vector; Index representing a time period The first group in the new group allocation ratio vector represents the... One element; This indicates the number of component oil types.
[0150] In one embodiment, step S13 above, until a new population that meets the preset termination condition is returned, specifically includes:
[0151] Determine whether the number of iterations has reached the first number of iterations. If so, continue to iterate the new population for a second number of iterations. During the execution of the second number of iterations, calculate the fitness value of the elements in the new population in each iteration. If the fitness value of the elements in the new population fluctuates within a set range in each iteration, the iteration terminates and returns a new population that has reached the preset termination condition.
[0152] In practical implementation, the termination condition for determining whether the iteration meets the conditions can be set as follows: the first iteration number can be the maximum number of iterations, 100 generations; the second iteration number can be the number of iterations when the optimal fitness of the population has not improved significantly for 5 consecutive generations, or the calculation time exceeds 3 minutes, then the algorithm will terminate; otherwise, the one-dimensional chromosome (i.e., the individual) that does not meet the conditions will enter the next round of iteration to perform selection, crossover and mutation operations, etc.
[0153] In one embodiment, in step S14 above, based on the new population, a hot-start mathematical programming solver is used to perform a refined solution on the refined oil blending and scheduling model, so as to output the corresponding solution result of the refined oil blending and scheduling model, referring to... Figure 2 As shown, the specific steps may include the following:
[0154] S21. Select a one-dimensional chromosome from the new population to perform a fine solution to the refined oil blending and scheduling model;
[0155] S22. Using a mathematical programming solver, the upper and lower bounds of the one-dimensional chromosome used for fine solving are compressed to a preset suggested value range, and the value range of the preset binary harmonic path variable is fixed.
[0156] S23. Determine whether the mathematical programming solver returns a feasible refined solution. If yes, output the refined solution as the solution result of the refined oil blending and scheduling model. If no, output the one-dimensional chromosome used for refined solution as an approximate solution.
[0157] For example, the one-dimensional chromosome that optimizes the objective function value is selected from the new population and used as the one-dimensional chromosome for fine-grained solution. To initiate a warm-start scheme, the code is submitted to the mathematical programming solver for a fine-grained solution phase.
[0158] ;
[0159] in, This represents the set of group distribution ratio vectors for a total of T time periods; This represents the group allocation ratio vector for the k-th time period; where, Indicates time period The elements of the corresponding new group allocation vector; Index representing a time period The first group in the new group allocation ratio vector represents the... One element; This indicates the number of component oil types.
[0160] During the warm-start process, the optimal proportional solution is embedded into the variable structure of the original mixed-integer nonlinear programming (MINLP) model. The specific method is as follows:
[0161] Will Tighten the upper and lower bounds to their suggested values:
[0162] ;
[0163] in, This represents the fixed group allocation decision variables in the hot-start solution, namely time period t, the first group, and the second group. The proportions of the component oils, Indicates time period The elements of the corresponding new group allocation vector; Index representing a time period The first group in the new group allocation ratio vector represents the... One element; This represents a uniformly distributed disturbance. The value of is a decimal that is much less than 1.
[0164] The above processing makes the solution space contain elements that are... By performing local perturbations centered on the solution, the mathematical programming solver can be significantly accelerated to converge to a high-quality solution.
[0165] If we want the mathematical programming solver to eventually return a feasible and optimal refined solution... If the solution fails or takes too long to complete, the algorithm retains the result. The corresponding approximate solution is used as an alternative, thus balancing the robustness and efficiency of the algorithm.
[0166] Based on the same inventive concept, this embodiment of the invention also provides a refined oil blending and scheduling optimization device. Since the principle of solving the problem by these devices and clients is similar to that of the aforementioned refined oil blending and scheduling optimization method, the implementation of this device and client can refer to the implementation of the aforementioned method, and the repeated parts will not be described again.
[0167] Reference Figure 3 As shown, the refined oil blending and scheduling optimization device provided in this embodiment of the invention specifically includes:
[0168] Extraction module 31 is used to extract constraint information data corresponding to the component ratio decision variables by parsing the constraint relationship of the component ratio decision variables containing information on finished oil, component oil types, component ratio and time period of finished oil.
[0169] The initial population acquisition module 32 is used to generate multiple grouping ratio vectors corresponding to multiple time periods for each type of refined oil based on the constraint information data; flatten the element values of all grouping ratio vectors to obtain a one-dimensional chromosome vector; and construct an initial population using the acquired multiple one-dimensional chromosome vectors.
[0170] The optimization iteration module 33 is used to iteratively calculate the fitness value of each individual in the one-dimensional chromosome vector according to the initial population, remove elements whose fitness values do not meet the preset conditions, and perform crossover and recombination operations and perturbation operations on some elements of the one-dimensional chromosome vector until a new population that meets the preset termination conditions is returned.
[0171] The solution module 34 is used to perform a fine solution on the preset refined oil blending and scheduling model based on the new population, so as to output the corresponding refined oil blending and scheduling model solution results.
[0172] The refined oil blending and scheduling optimization device provided in this embodiment of the invention uses a hybrid optimization strategy that integrates genetic algorithm and mathematical programming solver. This strategy maintains the search breadth of the heuristic algorithm while utilizing the rigorous local optimization capability of the mathematical programming solver, enabling efficient solutions to complex nonlinear and multivariate coupled blending and scheduling problems. It can effectively improve the solution speed, solution accuracy, and feasibility.
[0173] Reference Figure 4The following diagram illustrates the execution process of the refined oil blending and scheduling optimization method and apparatus provided in this embodiment of the invention:
[0174] The structural analyzer is used to extract the constraint information corresponding to the refined oil product from the blending and scheduling model, that is, to extract the component ratio vectors of the refined oil product formula under multiple time periods.
[0175] Specifically, for a certain type of refined oil, which contains seven types of component oils, the following are the component ratios of these seven component oils at 20 different time periods. A one-dimensional chromosome vector is constructed using these component ratios at 20 different time periods:
[0176] [0.1795, 0.1422, 0.1754, 0.1448, 0.2299, 0.0694, 0.0587,
[0177] 0.1695, 0.1621, 0.1709, 0.1704, 0.2353, 0.0364, 0.0554,
[0178] 0.2007, 0.1448, 0.1375, 0.1341, 0.2453, 0.0737, 0.0640,
[0179] 0.1982, 0.1491, 0.1556, 0.1581, 0.2592, 0.0360, 0.0439,
[0180] 0.1552, 0.1694, 0.1556, 0.1742, 0.2551, 0.0510, 0.0395,
[0181] 0.1502, 0.1443, 0.1293, 0.1774, 0.2674, 0.0763, 0.0550,
[0182] 0.1623, 0.1133, 0.2164, 0.1777, 0.2355, 0.0152, 0.0797,
[0183] 0.2030, 0.1639, 0.1391, 0.1348, 0.2716, 0.0337, 0.0539,
[0184] 0.1821, 0.1498, 0.2220, 0.1592, 0.2315, 0.0440, 0.0113,
[0185] 0.1622, 0.1783, 0.1694, 0.1715, 0.2235, 0.0308, 0.0642,
[0186] 0.1791, 0.1323, 0.1908, 0.1566, 0.2883, 0.0398, 0.0131,
[0187] 0.2040, 0.1538, 0.1339, 0.1457, 0.2257, 0.0590, 0.0779,
[0188] 0.1552, 0.1486, 0.1740, 0.1534, 0.2633, 0.0341, 0.0715,
[0189] 0.1593, 0.1580, 0.1922, 0.1699, 0.2381, 0.0447, 0.0378,
[0190] 0.1411, 0.1394, 0.2026, 0.1606, 0.2510, 0.0492, 0.0561,
[0191] 0.1867, 0.1633, 0.1925, 0.1235, 0.2542, 0.0700, 0.0098,
[0192] 0.1847, 0.1369, 0.1846, 0.1525, 0.2560, 0.0228, 0.0625,
[0193] 0.1751, 0.1497, 0.1780, 0.1374, 0.2708, 0.0494, 0.0396,
[0194] 0.1921, 0.1497, 0.1827, 0.1563, 0.2684, 0.0219, 0.0289,
[0195] [0.1533, 0.1445, 0.1646, 0.1694, 0.2570, 0.0517, 0.0595]
[0196] Based on the constructed multiple one-dimensional chromosomes, an initial population for a genetic algorithm that satisfies normalization and upper and lower bound constraints is built.
[0197] Iteratively perform selection, crossover, and mutation operations on each one-dimensional chromosome as described above; evaluate the individual fitness of the genetic algorithm population chromosomes after selection, crossover, and mutation operations in parallel; and determine whether the genetic algorithm population chromosomes after selection, crossover, and mutation operations have reached the termination condition. If not, continue iterating on the genetic algorithm population chromosomes, performing selection, crossover, and mutation operations, and evaluating individual fitness operations; if satisfied, select the optimal solution and use a hot-start mathematical programming solver for fine-grained solution.
[0198] This invention 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 aforementioned refined oil blending and scheduling optimization method.
[0199] This invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned refined oil blending and scheduling optimization method.
[0200] This invention provides a computer program product, which includes a computer program that, when executed by a processor, implements the aforementioned refined oil blending and scheduling optimization method.
[0201] Regarding the refined oil blending and scheduling optimization 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.
[0202] 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.
[0203] 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.
[0204] 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.
[0205] 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.
[0206] 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.
[0207] 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 optimizing the blending and scheduling of refined oil products, characterized in that, include: By analyzing the constraint relationship of the component ratio decision variables, which contain information on refined oil, the types of component oils in refined oil, the component ratio of refined oil, and the time period, the constraint information data corresponding to the component ratio decision variables is extracted. Based on the constraint information data, multiple component ratio vectors corresponding to multiple time periods are generated for each type of refined oil component ratio; based on the multiple component ratio vectors, the element values of all component ratio vectors are flattened to obtain a one-dimensional chromosome vector; an initial population is constructed using the obtained multiple one-dimensional chromosome vectors. Based on the initial population, the fitness value of each element in the one-dimensional chromosome vector is calculated iteratively. Elements whose fitness values do not meet the preset conditions are removed. Crossover and recombination operations and perturbation operations are performed on some elements in the one-dimensional chromosome vector until a new population that meets the preset termination conditions is returned. Based on the new population, the preset refined oil blending and scheduling model is solved in detail to output the corresponding refined oil blending and scheduling model solution results.
2. The method as described in claim 1, characterized in that, By analyzing the constraint relationships of the component ratio decision variables, which contain information on refined oil products, their component types, component ratios, and time periods, the constraint information data corresponding to these component ratio decision variables is extracted, including: The lower bound constraint information of the extracted component ratio decision variables, which contain information on the refined oil, the types of component oils in the refined oil, the component ratio of the refined oil, and the time period, is stored in a dictionary. In the middle, the upper bound constraint information of the extracted component ratio decision variables of the refined oil, the component types of the refined oil, the component ratio of the refined oil, and the time period information is stored in a dictionary. middle; The constraint relationship of the component ratio decision variables, which include information on the refined oil, the types of component oils in the refined oil, the component ratio of the refined oil, and the time period, is as follows: ; ; in, Indicates refined oil. This indicates the types of component oils in the finished oil product. This indicates the component ratio of the refined oil. Indicates a time period. Represents the group allocation ratio decision variable; This represents the minimum value of the group allocation decision variable; This indicates the maximum value of the group allocation decision variable; Describe the lower bound of the group allocation decision variable. Describe the upper bound of the group allocation decision variable.
3. The method as described in claim 1, characterized in that, Based on the multiple grouping ratio vectors, flatten the element values of all grouping ratio vectors to obtain a one-dimensional chromosome vector, including: Based on the multiple grouping ratio vectors, determine whether the sum of the element values of each grouping ratio vector is 1. If so, flatten the element values of all grouping ratio vectors to obtain a one-dimensional chromosome vector.
4. The method as described in claim 3, characterized in that, Determine whether the sum of the element values of each group allocation ratio vector is 1. If not, reassign values to the group allocation ratio vectors whose sum of element values is not equal to 1 according to a preset calculation rule until the sum of the element values equals 1. The preset calculation rule is as follows: ; in, ; ; ; ; Indicates the number of component oil types in the finished oil product; Indicates the component oil index; Time period The corresponding group allocation ratio vector; Indicates the first Time period, number The component ratio variable of the oil components, i.e., the time period. The elements of the corresponding group distribution ratio vector; The sum of all elements in the component oil proportion vector is given, where ; It is the difference between the value 1 and the sum of all elements in the component oil ratio vector; Represents element Within the range of values Random sampling is performed within the area based on a uniform distribution. They represent The lower and upper bounds.
5. The method as described in claim 1, characterized in that, The calculation process for the fitness value of each element in each one-dimensional chromosome vector includes: Each one-dimensional chromosome vector in the initial population is fed in parallel to multiple pre-set process evaluation modules. For each process evaluation module, the data planning solver environment is initialized. Based on the initialization data planning solver environment, the upper and lower bounds of the group allocation ratio decision variable are set to the element values of the corresponding group allocation ratio vector within the one-dimensional chromosome vector, thus obtaining fixed variables; Based on the fixed variables, the remaining free variables are optimized according to the set objective function of the harmonic scheduling model to obtain the variable values among the remaining free variables that minimize the objective function of the harmonic scheduling model.
6. The method as described in claim 1, characterized in that, Remove elements whose fitness values do not meet the preset conditions, including: Sort all elements by fitness value from smallest to largest; According to the sorting, a set number of elements are selected to generate the optimized population for this iteration.
7. The method as described in claim 1, characterized in that, Performing a crossover and recombination operation on a subset of elements of the one-dimensional chromosome vector includes: Time period The corresponding group allocation ratio vector , Perform a set of uniform crosses according to the following formula. ; in The numbers are uniformly distributed random numbers; ; This indicates that the new grouping ratio vector is formed after splicing.
8. The method as described in claim 7, characterized in that, Perturbation operations are performed on a subset of elements of the one-dimensional chromosome vector, including: By setting a probability In the new group allocation ratio vector, a time period is randomly selected. The new group is allocated to the elements in the ratio vector. A perturbation operation is performed, and the formula for performing the perturbation operation is: ; in, Indicates time period The elements of the corresponding new group allocation vector; Index representing a time period This represents the j-th element in the new group allocation ratio vector; This represents a uniformly distributed disturbance. The value of is randomly selected on the interval [−δ,δ]. This indicates uniform random sampling from the interval [−δ,δ]. This represents the hyperparameter that controls the amplitude of the disturbance.
9. The method as described in claim 8, characterized in that, Until a new population that meets the preset termination conditions is returned, including: Determine whether the number of iterations has reached the first number of iterations. If so, continue to iterate the new population for a second number of iterations. During the execution of the second number of iterations, calculate the fitness value of the elements in the new population in each iteration. If the fitness value of the elements in the new population fluctuates within a set range in each iteration, the iteration terminates and the new population is returned.
10. The method as described in claim 1, characterized in that, Based on the new population, a refined solution is performed on the preset refined oil blending and scheduling model to output the corresponding refined oil blending and scheduling model solution results, including: A one-dimensional chromosome is selected from the new population to perform a fine solution to the refined oil blending and scheduling model; Using a mathematical programming solver, the upper and lower bounds of the one-dimensional chromosome used for fine-grained solving are narrowed down to a preset suggested value range, and the value range of the preset binary harmonic path variable is fixed. Determine whether the mathematical programming solver returns a feasible refined solution. If yes, output the refined solution as the solution result of the refined oil blending and scheduling model; otherwise, output the one-dimensional chromosome used for refined solution as an approximate solution.
11. A refined oil blending and scheduling optimization device, characterized in that, include: The extraction module is used to extract the constraint information data corresponding to the component ratio decision variables by parsing the constraint relationship of the component ratio decision variables, which contain information on the finished oil, the types of component oils in the finished oil, the component ratio of the finished oil, and the time period. The initial population acquisition module is used to generate multiple grouping ratio vectors corresponding to multiple time periods for each type of refined oil based on the constraint information data; flatten the element values of all grouping ratio vectors to obtain a one-dimensional chromosome vector; and construct an initial population using the acquired multiple one-dimensional chromosome vectors. The optimization iteration module is used to iteratively calculate the fitness value of individuals within the one-dimensional chromosome vector based on the initial population, remove elements whose fitness values do not meet the preset conditions, and perform crossover and recombination operations and perturbation operations on some elements of the one-dimensional chromosome vector until a new population that meets the preset termination conditions is returned. The solution module is used to perform a fine solution to the preset refined oil blending and scheduling model based on the new population, so as to output the corresponding refined oil blending and scheduling model solution results.
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 refined oil blending and scheduling optimization method according to any one of claims 1-10.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the refined oil blending and scheduling optimization 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 refined oil blending and scheduling optimization method according to any one of claims 1 to 10.