Natural gas pipeline network scheduling method, electronic equipment and storage medium

By constructing a linearized mathematical model for natural gas pipeline network scheduling and solving it in stages, the overall analysis problem of large-scale complex pipeline network systems was solved, achieving more efficient natural gas pipeline network scheduling optimization and outputting a better scheduling scheme.

CN121615291APending Publication Date: 2026-03-06PIPECHINA SOUTH CHINA CO +2
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-06
Publication Date
2026-03-06

AI Technical Summary

Technical Problem

Existing technologies are insufficient to effectively solve the overall analysis problem of large-scale complex natural gas pipeline systems, especially when there are large differences in flow rate and direction and many control parameters. They cannot optimize the operation scheme of the natural gas pipeline system and cannot locate the reasons for infeasibility.

Method used

A mathematical model for optimizing natural gas pipeline network scheduling is constructed, including flow constraints, pipeline constraints, non-boosting station constraints, and boosting station constraints. Nonlinear constraints are handled by linearization, and a penalized sequential linear programming algorithm is used to solve the problem by setting the search step size in stages, gradually narrowing the range of variable adjustment, and ensuring that the model matches the physical rules.

Benefits of technology

It improves the solution efficiency of natural gas pipeline network scheduling, avoids the problems of solution infeasibility and local optima, improves the convergence speed of solution, and outputs a better scheduling scheme.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121615291A_ABST
    Figure CN121615291A_ABST
Patent Text Reader

Abstract

The invention discloses a natural gas pipeline network scheduling method, electronic equipment and a storage medium, relates to the technical field of natural gas pipeline scheduling, and aims to determine a better natural gas pipeline network scheduling scheme. The method comprises the following steps: obtaining a linearized mathematical model; solving the target function based on the flow constraint and the operation flow constraint of the compressor at the supercharging node to obtain an initial optimization result; according to the first search step size, based on the initial optimization result and a penalty sequence linear programming algorithm, solving the linearized mathematical model to obtain a first optimization result; according to a second search step length, based on the first optimization result and a penalty sequence linear programming algorithm, solving the linearized mathematical model to obtain a second optimization result; based on the third search step size, the second optimization result and a penalty sequence linear programming algorithm, solving the linearized mathematical model to obtain a third optimization result; and determining a natural gas pipeline network scheduling scheme based on the third optimization result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of natural gas pipeline dispatching technology, and in particular to a natural gas pipeline network dispatching method, electronic equipment, and storage medium. Background Technology

[0002] During the natural gas pipeline planning phase, pipeline operators need to conduct a comprehensive analysis of the operational status of their natural gas pipeline network system based on forecasts of natural gas resource introduction and user demand over the next few decades. This analysis is necessary to identify bottlenecks in natural gas resource distribution and to propose pipeline construction requirements.

[0003] When the scale of the pipeline facilities in operation is small, pipeline operators can use high-precision natural gas pipeline simulation software (such as TGNET and SPS software) to perform pipeline operation condition calculations and achieve overall analysis of the pipeline network system. However, when the pipeline network is large or the structure is complex, the flow rate and direction of the entire natural gas pipeline network system vary greatly under different operating conditions because natural gas resources can be flexibly transferred between different trunk pipelines. Furthermore, due to the large number of control parameters of the entire pipeline network system, the debugging of pipeline simulation software is extremely difficult, making it impossible to achieve overall analysis of the pipeline network system.

[0004] To achieve a holistic analysis of large-scale and complex natural gas pipeline systems, pipeline operators typically need to utilize efficient operations research and optimization tools to establish mathematical optimization models of the natural gas pipeline system. They then employ operations research and optimization algorithms to solve for the key control parameters and flow direction schemes of the natural gas pipeline system. The optimization results can be directly used to evaluate the current operating status of the natural gas pipeline system or as an initial solution for further analysis in high-precision pipeline simulation software.

[0005] Currently, some solutions use piecewise linearization techniques to process the established mixed-integer nonlinear programming (MINLP) model, transforming the pipeline network into a mixed-integer programming (MILP) model for solution. Branch-and-bound algorithms are then used to solve discrete decision variables such as compressor start-up and shutdown, and valve switching in the natural gas pipeline system. However, this approach introduces a large number of binary decision variables, resulting in a massive model size. It can only verify the existence of feasible solutions in the optimization model, but cannot optimize the operation scheme of the natural gas pipeline system. Furthermore, when a given gas transmission scheme is infeasible, it cannot pinpoint the cause of its infeasibility, making it difficult to help pipeline operators determine the type and location of pipeline bottlenecks.

[0006] Therefore, a method is needed to solve the natural gas pipeline network scheduling problem and obtain a better natural gas pipeline network scheduling scheme. Summary of the Invention

[0007] The purpose of this application is to provide a natural gas pipeline network scheduling method, electronic equipment, and storage medium, relating to the field of pipeline scheduling technology, and aiming to determine a better natural gas pipeline network scheduling scheme.

[0008] To achieve the above objectives, this application adopts the following technical solution: Firstly, this application provides a natural gas pipeline network scheduling method, including: A mathematical model for optimizing natural gas pipeline network scheduling is constructed. The mathematical model includes constraints and an objective function. The constraints include flow constraints, pipeline constraints, non-boosting station constraints, and boosting station constraints. The boosting station constraints include the operating flow constraints of the compressor at the boosting node. Linearize the nonlinear constraints in the mathematical model to obtain a linearized mathematical model; Based on flow constraints and compressor operating flow constraints at the booster node, the objective function is solved to obtain initial optimization results; Set the first search step size for the flow variable of the pipe connected to the compressor component, and solve the linearized mathematical model according to the first search step size, based on the initial optimization results and the penalized sequential linear programming algorithm, to obtain the first optimization result; Set a second search step size for the flow variables of all pipes, and solve the linearized mathematical model according to the second search step size, based on the first optimization result and the penalized sequential linear programming algorithm, to obtain the second optimization result; Set the third search step size for the flow variables of all pipelines and the compressor outlet pressure variables of all booster stations, and solve the linearized mathematical model based on the third search step size, the second optimization result, and the penalized sequence linear programming algorithm to obtain the third optimization result; Based on the third optimization result, a natural gas pipeline network scheduling scheme is determined.

[0009] The natural gas pipeline network scheduling method provided in this application covers the entire physical dimension of natural gas pipeline network operation by setting flow constraints, pipeline constraints, non-boosting station constraints, and boosting station constraints. This ensures that the feasible region of the mathematical model for natural gas pipeline network scheduling optimization constructed based on this model strictly conforms to the physical rules of the natural gas pipeline network, avoiding the problem of "infeasible solution". By linearizing the nonlinear constraints in the constraints, the linearized mathematical model can be adapted to the subsequent penalized sequence linear programming algorithm, improving the solution efficiency. When solving the initial optimization results, only flow constraints and compressor operation flow constraints at boosting nodes are considered, and complex constraints such as pipeline pressure and valve mutual exclusion are not included. This quickly locks in a reasonable flow direction and a preliminary compressor start-up and shutdown scheme, providing a reliable starting point for the subsequent three-stage solution and avoiding iterative oscillations caused by the initial solution deviating significantly from the feasible region. Then, through a three-stage solution logic with progressively increasing search step size, the range of variable adjustment is gradually narrowed. The first stage restricts only the flow rate step size of the compressor-related pipe segments to control the risk of sudden flow changes and expand the feasible region. The second stage restricts the flow rate step size of all pipe segments to further narrow the feasible region and reduce the degree of constraint violation in the mathematical model. Finally, the third stage restricts the flow rate step size of the pipe segments and the compressor outlet pressure step size to lock the compressor pressure increase and avoid pressure ratio exceeding the limit. Simultaneously, a penalty sequential linear programming algorithm forces the linearized mathematical model to approach the original nonlinear constraints, ultimately converging to the optimal solution that satisfies both the full constraints and the minimum objective function. The natural gas pipeline scheduling method provided in this application avoids the problems of insufficient exploration, local optima, insufficient fine-tuning, and infeasible solutions inherent in traditional single-step-size algorithms, improving the convergence speed of the solution and ultimately producing a better optimization result.

[0010] In some embodiments, flow constraints include upload flow constraints, download flow constraints, node flow conservation constraints, and pipeline transport constraints; pipeline constraints include pipeline hydraulic constraints, pipeline pressure upper limit constraints, and pipeline pressure lower limit constraints; non-boosting station constraints include non-boosting station node and connecting pipeline pressure relationship constraints, valve shut-off and pressure regulation constraints, station pressure upper limit constraints, and station pressure lower limit constraints; boosting station constraints include boosting station node and connecting pipeline pressure relationship constraints, boosting node inlet and outlet pressure relationship constraints, boosting node pressure upper limit constraints, boosting node pressure lower limit constraints, boosting node compressor operating flow constraints, and boosting node compressor operating power constraints; the objective function is determined based on pipeline transportation costs, pipeline network operating costs, and supply-demand deviation penalties.

[0011] In some embodiments, the objective function is solved based on flow constraints and the operating flow constraints of the booster node compressor to obtain initial optimization results. This includes: solving the objective function based on upload flow constraints, download flow constraints, node flow conservation constraints, pipeline throughput constraints, and the operating flow constraints of the booster node compressor to obtain initial optimization results.

[0012] In some embodiments, the linearized mathematical model is solved based on a third search step size, a second optimization result, and a penalized sequential linear programming algorithm to obtain a third optimization result. This includes: for the k-th iteration, solving the linearized mathematical model based on the third search step size of the k-th iteration, the current optimization result updated in the (k-1)-th iteration, and the penalized sequential linear programming algorithm to obtain candidate optimization results for the k-th iteration; the current optimization result updated in the 0th iteration is the second optimization result; based on the current optimization result and the candidate optimization result, determining the actual decrease and the estimated decrease of the objective function during the k-th iteration; and determining whether to accept the candidate optimization result based on the actual decrease and the estimated decrease of the objective function. The process involves optimizing the results and updating the third search step size. If a candidate optimization result is accepted, the candidate optimization result of the k-th iteration is determined as the current optimization result updated in the k-th iteration. If a candidate optimization result is rejected, the current optimization result of the k-th iteration is determined as the current optimization result updated in the k-th iteration. The updated third search step size is used as the third search step size for the (k+1)-th iteration. The iteration process continues until the iteration termination condition is met. If the candidate optimization result obtained in the last iteration is accepted, the candidate optimization result obtained in the last iteration is determined as the third optimization result. Alternatively, if the last iteration yields a rejected candidate optimization result, the current optimization result of the last iteration is determined as the third optimization result.

[0013] In some embodiments, determining whether to accept a candidate optimization result and update the third search step size based on the actual decrease and the estimated decrease of the objective function includes: determining the ratio between the actual decrease and the estimated decrease of the objective function as a target ratio; if the target ratio is less than a first preset threshold, rejecting the candidate optimization result and reducing the third search step size based on the step size change coefficient; if the target ratio is greater than or equal to the first preset threshold and less than a second preset threshold, accepting the candidate optimization result and reducing the third search step size based on the step size change coefficient; if the target ratio is greater than or equal to the second preset threshold and less than or equal to the third preset threshold, accepting the candidate optimization result and keeping the third search step size unchanged; if the target ratio is greater than the third preset threshold, accepting the candidate optimization result and increasing the third search step size based on the step size change coefficient.

[0014] In some embodiments, the k-th iteration process further includes: determining the absolute value of the difference between the objective function value of the k-th iteration and the objective function value of the (k-1)-th iteration; the objective function value of the k-th iteration is used to characterize the result obtained by substituting the candidate optimization result of the k-th iteration into the objective function; if the absolute value is less than the convergence error threshold, the value of the compressor start / stop binary decision variable is kept at the current optimization result updated in the k-th iteration in the (k+1)-th iteration process and all subsequent iterations; if the absolute value is greater than or equal to the convergence error threshold, the iteration process continues.

[0015] In some embodiments, the objective function satisfies the following relationship: ; ; ; Where F is used to characterize the objective function, Used to characterize pipeline transportation costs Used to characterize pipeline network operating costs Used to characterize the penalty cost for supply and demand discrepancies. Used to characterize a set of pipe segments Used to characterize the unit freight rate of a pipeline segment Used to characterize the actual transport capacity of a pipeline segment Used to characterize the number of days the pipeline is in operation. Used to characterize pipe segment length Used to characterize the set of booster nodes Used to characterize the unit price of electricity used by compressors Used to characterize the operating power of the compressor. Used to represent the set of user download points Used to characterize the user bias penalty coefficient Used to characterize user excess demand slack variables Used to characterize slack variables for user demand shortages Used to characterize gas source collections Used to characterize the gas source deviation penalty coefficient Used to characterize the slack variable of gas source over-planning. Used to characterize the slack variable of gas source shortage.

[0016] In some embodiments, the linearized mathematical model satisfies the following relationship: ;in, The objective function used to characterize a linearized mathematical model. Used to characterize sets of nonlinear constraints Used to characterize the linearization error penalty coefficient Used to characterize the positive slack variable of linearization error Used to characterize the negative slack variable of linearization error Used to characterize constraint operators, Used to characterize integer linear constraints Used to represent integer constraint numbers The linearized form of the Taylor expansion used to characterize nonlinear constraints The variable 'x' is used to represent the nonlinear constraint number, 's' is used to represent the search step size of the k-th iteration, and 'x' is used to represent the decision variable vector. Used to characterize the solution of the (k-1)th iteration, Used to characterize trust region step size constraints.

[0017] Secondly, this application provides a natural gas pipeline network dispatching device, including a processing module. The processing module is used for: A mathematical model for optimizing natural gas pipeline network scheduling is constructed. The mathematical model includes constraints and an objective function. The constraints include flow constraints, pipeline constraints, non-boosting station constraints, and boosting station constraints. The boosting station constraints include the operating flow constraints of the compressor at the boosting node. Linearize the nonlinear constraints in the mathematical model to obtain a linearized mathematical model; Based on flow constraints and compressor operating flow constraints at the booster node, the objective function is solved to obtain initial optimization results; Set the first search step size for the flow variable of the pipe connected to the compressor component, and solve the linearized mathematical model according to the first search step size, based on the initial optimization results and the penalized sequential linear programming algorithm, to obtain the first optimization result; Set a second search step size for the flow variables of all pipes, and solve the linearized mathematical model according to the second search step size, based on the first optimization result and the penalized sequential linear programming algorithm, to obtain the second optimization result; Set the third search step size for the flow variables of all pipelines and the compressor outlet pressure variables of all booster stations, and solve the linearized mathematical model based on the third search step size, the second optimization result, and the penalized sequence linear programming algorithm to obtain the third optimization result; Based on the third optimization result, a natural gas pipeline network scheduling scheme is determined.

[0018] In some embodiments, flow constraints include upload flow constraints, download flow constraints, node flow conservation constraints, and pipeline transport constraints; pipeline constraints include pipeline hydraulic constraints, pipeline pressure upper limit constraints, and pipeline pressure lower limit constraints; non-boosting station constraints include non-boosting station node and connecting pipeline pressure relationship constraints, valve shut-off and pressure regulation constraints, station pressure upper limit constraints, and station pressure lower limit constraints; boosting station constraints include boosting station node and connecting pipeline pressure relationship constraints, boosting node inlet and outlet pressure relationship constraints, boosting node pressure upper limit constraints, boosting node pressure lower limit constraints, boosting node compressor operating flow constraints, and boosting node compressor operating power constraints; the objective function is determined based on pipeline transportation costs, pipeline network operating costs, and supply-demand deviation penalties.

[0019] In some embodiments, the processing module is specifically used to: solve the objective function based on upload flow constraints, download flow constraints, node flow conservation constraints, pipeline throughput constraints, and compressor operation flow constraints of the booster node, to obtain initial optimization results.

[0020] In some embodiments, the processing module is specifically configured to: for the k-th iteration of the solution process, based on the third search step size of the k-th iteration, the current optimization result updated in the (k-1)-th iteration, and the penalized sequential linear programming algorithm, solve the linearized mathematical model to obtain the candidate optimization result of the k-th iteration; the current optimization result updated in the 0th iteration is the second optimization result; based on the current optimization result and the candidate optimization result, determine the actual decrease and the estimated decrease of the objective function in the k-th iteration; based on the actual decrease and the estimated decrease of the objective function, determine whether to accept the candidate optimization result and update the third search step size; if the candidate optimization result is accepted... If the candidate optimization result of the k-th iteration is rejected, the current optimization result of the k-th iteration is determined as the current optimization result of the k-th iteration. If the candidate optimization result is rejected, the current optimization result of the k-th iteration is determined as the current optimization result of the k-th iteration. The updated third search step size is used as the third search step size of the (k+1)-th iteration. The iteration process is executed until the iteration termination condition is met. If the candidate optimization result obtained in the last iteration is accepted, the candidate optimization result obtained in the last iteration is determined as the third optimization result. Alternatively, if the last iteration yields a rejected candidate optimization result, the current optimization result of the last iteration is determined as the third optimization result.

[0021] In some embodiments, the processing module is specifically configured to: determine the ratio between the actual decrease and the estimated decrease of the objective function as the target ratio; if the target ratio is less than a first preset threshold, determine to reject the candidate optimization result and reduce the third search step size based on the step size change coefficient; if the target ratio is greater than or equal to the first preset threshold and less than the second preset threshold, determine to accept the candidate optimization result and reduce the third search step size based on the step size change coefficient; if the target ratio is greater than or equal to the second preset threshold and less than or equal to the third preset threshold, determine to accept the candidate optimization result and keep the third search step size unchanged; if the target ratio is greater than the third preset threshold, determine to accept the candidate optimization result and increase the third search step size based on the step size change coefficient.

[0022] In some embodiments, the processing module is further configured to: determine the absolute value of the difference between the objective function value of the k-th iteration and the objective function value of the (k-1)-th iteration; the objective function value of the k-th iteration is used to characterize the result obtained by substituting the candidate optimization result of the k-th iteration into the objective function; if the absolute value is less than the convergence error threshold, keep the value of the compressor start / stop binary decision variable in the (k+1)-th iteration process and all subsequent iterations as the current optimization result updated in the k-th iteration; if the absolute value is greater than or equal to the convergence error threshold, then continue to execute the iteration process.

[0023] In some embodiments, the objective function satisfies the following relationship: ; ; ; Where F is used to characterize the objective function, Used to characterize pipeline transportation costs Used to characterize pipeline network operating costs Used to characterize the penalty cost for supply and demand discrepancies. Used to characterize a set of pipe segments Used to characterize the unit freight rate of a pipeline segment Used to characterize the actual transport capacity of a pipeline segment Used to characterize the number of days the pipeline is in operation. Used to characterize pipe segment length Used to characterize the set of booster nodes Used to characterize the unit price of electricity used by compressors Used to characterize the operating power of the compressor. Used to represent the set of user download points Used to characterize the user bias penalty coefficient Used to characterize user excess demand slack variables Used to characterize slack variables for user demand shortages Used to characterize gas source collections Used to characterize the gas source deviation penalty coefficient Used to characterize the slack variable of gas source over-planning. Used to characterize the slack variable of gas source shortage.

[0024] In some embodiments, the linearized mathematical model satisfies the following relationship: ;in, The objective function used to characterize a linearized mathematical model. Used to characterize sets of nonlinear constraints Used to characterize the linearization error penalty coefficient Used to characterize the positive slack variable of linearization error Used to characterize the negative slack variable of linearization error Used to characterize constraint operators, Used to characterize integer linear constraints Used to represent integer constraint numbers The linearized form of the Taylor expansion used to characterize nonlinear constraints The variable 'x' is used to represent the nonlinear constraint number, 's' is used to represent the search step size of the k-th iteration, and 'x' is used to represent the decision variable vector. Used to characterize the solution of the (k-1)th iteration, Used to characterize trust region step size constraints.

[0025] Thirdly, this application provides an electronic device, comprising: one or more processors; one or more memories; wherein the one or more memories are used to store computer program code, the computer program code including computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes any of the natural gas pipeline scheduling methods provided in the first aspect above.

[0026] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed on a computer, cause the computer to perform any of the natural gas pipeline scheduling methods provided in the first aspect above.

[0027] Fifthly, this application provides a computer program product including computer instructions that, when executed on an electronic device, cause the electronic device to perform any of the natural gas pipeline scheduling methods provided in the first aspect.

[0028] For a detailed description of the second to fifth aspects and their various implementations in this application, please refer to the detailed description in the first aspect and its various implementations; and for a detailed analysis of the beneficial effects of the second to fifth aspects and their various implementations in the first aspect and its various implementations, please refer to the beneficial effect analysis in the first aspect and its various implementations, which will not be repeated here.

[0029] These or other aspects of this application will become more readily apparent in the following description. Attached Figure Description

[0030] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0031] Figure 1 This is a schematic diagram of the structure of a computing device provided in an embodiment of this application; Figure 2 A flowchart of a natural gas pipeline network scheduling method provided in this application embodiment; Figure 3 A natural gas pipeline network scheduling flowchart is provided for embodiments of this application; Figure 4 This is a schematic diagram of the structure of a natural gas pipeline network dispatching device provided in an embodiment of this application. Detailed Implementation

[0032] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0033] In the description of this application, it should be understood that the terms "upper," "lower," "left," "right," "front," "rear," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or relative positional relationship shown in the accompanying drawings. They are used only for the convenience of describing this application and for simplification, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application. Unless otherwise specified, the above-mentioned orientational descriptions can be flexibly set in practical applications, provided that the relative positional relationships shown in the accompanying drawings are satisfied.

[0034] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.

[0035] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "installation," "connection," "linking," and "communication" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection. They can refer to a direct connection or an indirect connection through an intermediate medium, or a connection within two components. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.

[0036] In embodiments of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, article, or apparatus that includes that element.

[0037] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0038] In the description of this specification, specific features, structures, materials, or characteristics may be combined in any suitable manner in one or more embodiments or examples.

[0039] During the natural gas pipeline planning phase, pipeline operators need to conduct a comprehensive analysis of the operational status of their natural gas pipeline network system based on forecasts of natural gas resource introduction and user demand over the next few decades. This analysis is necessary to identify bottlenecks in natural gas resource distribution and to propose pipeline construction requirements.

[0040] When the scale of the pipeline facilities in operation is small, pipeline operators can use high-precision natural gas pipeline simulation software (such as TGNET and SPS software) to perform pipeline operation condition calculations and achieve overall analysis of the pipeline network system. However, when the pipeline network is large or the structure is complex, the flow rate and direction of the entire natural gas pipeline network system vary greatly under different operating conditions because natural gas resources can be flexibly transferred between different trunk pipelines. Furthermore, due to the large number of control parameters of the entire pipeline network system, the debugging of pipeline simulation software is extremely difficult, making it impossible to achieve overall analysis of the pipeline network system.

[0041] To achieve a holistic analysis of large-scale and complex natural gas pipeline systems, pipeline operators typically need to utilize efficient operations research and optimization tools to establish mathematical optimization models of the natural gas pipeline system. They then employ operations research and optimization algorithms to solve for the key control parameters and flow direction schemes of the natural gas pipeline system. The optimization results can be directly used to evaluate the current operating status of the natural gas pipeline system or as an initial solution for further analysis in high-precision pipeline simulation software.

[0042] Currently, some solutions use piecewise linearization techniques to process the established mixed-integer nonlinear programming (MINLP) model, transforming the pipeline network into a mixed-integer programming (MILP) model for solution. Branch-and-bound algorithms are then used to solve discrete decision variables such as compressor start-up and shutdown, and valve switching in the natural gas pipeline system. However, this approach introduces a large number of binary decision variables, resulting in a massive model size. It can only verify the existence of feasible solutions in the optimization model, but cannot optimize the operation scheme of the natural gas pipeline system. Furthermore, when a given gas transmission scheme is infeasible, it cannot pinpoint the cause of its infeasibility, making it difficult to help pipeline operators determine the type and location of pipeline bottlenecks.

[0043] Therefore, a method is needed to solve the natural gas pipeline network scheduling problem and obtain a better natural gas pipeline network scheduling scheme.

[0044] This application provides a natural gas pipeline network scheduling method. A mathematical model for optimizing natural gas pipeline network scheduling is constructed. The mathematical model includes constraints and an objective function. The constraints include flow constraints, pipeline constraints, non-boosting station constraints, and boosting station constraints. Boosting station constraints include the operating flow constraints of the boosting node compressor. The nonlinear constraints in the mathematical model are linearized to obtain a linearized mathematical model. Based on the flow constraints and the operating flow constraints of the boosting node compressor, the objective function is solved to obtain initial optimization results. A first search step size is set for the flow variables of the pipelines connected to the compressor components, and based on the initial optimization, the flow variables are optimized according to the first search step size. The first optimization result is obtained by solving the linearized mathematical model using the first optimization result and a penalized sequential linear programming algorithm, based on the first optimization result and the second optimization result. The second optimization result is obtained by setting a second search step size for the flow variables of all pipelines and the compressor outlet pressure variables of all booster stations, and then solving the linearized mathematical model using the second search step size, the second optimization result, and the penalized sequential linear programming algorithm. Finally, the natural gas pipeline network scheduling scheme is determined based on the third optimization result.

[0045] By setting flow constraints, pipeline constraints, non-boosting station constraints, and boosting station constraints, the entire physical dimension of natural gas pipeline network operation is covered. This ensures that the feasible region of the mathematical model for natural gas pipeline network scheduling optimization strictly conforms to the physical rules of the natural gas pipeline network, avoiding the problem of "infeasible solutions." Linearizing the nonlinear constraints in the conditions allows the linearized mathematical model to be adapted to subsequent penalized sequential linear programming algorithms, improving solution efficiency. When solving the initial optimization results, only flow constraints and compressor operation flow constraints at boosting nodes are considered, temporarily excluding complex constraints such as pipeline pressure and valve mutual exclusion. This quickly identifies reasonable flow directions and preliminary compressor start-up and shutdown schemes, providing a reliable starting point for the subsequent three-stage solutions and preventing iterative oscillations caused by significant deviations of the initial solution from the feasible region. Then, through a three-stage solution logic with progressively increasing search step size, the range of variable adjustment is gradually narrowed. The first stage restricts only the flow rate step size of the compressor-related pipe segments to control the risk of sudden flow changes and expand the feasible region. The second stage restricts the flow rate step size of all pipe segments to further narrow the search range of the feasible region and reduce the degree of constraint violation in the mathematical model. Finally, the third stage restricts the step size of the pipe segment flow rate and compressor outlet pressure variables to lock the compressor pressure increase and avoid pressure ratio exceeding the limit. Simultaneously, a penalty sequential linear programming algorithm forces the linearized mathematical model to approach the original nonlinear constraints, ultimately converging to the optimal solution that satisfies all constraints and minimizes the objective function. The natural gas pipeline scheduling method provided in this application avoids the problems of insufficient exploration, local optima, insufficient fine-tuning, and infeasible solutions inherent in traditional single-step-size algorithms, improving the convergence speed of the solution and ultimately outputting a better optimization result.

[0046] The natural gas pipeline network scheduling method provided in this application can be applied to electronic devices. Specifically, the electronic devices are those capable of constructing and solving mathematical models for natural gas pipeline network scheduling optimization, such as computers and servers.

[0047] The hardware structure of electronic devices may include Figure 1 The components included in the computing device shown.

[0048] like Figure 1 As shown, the computing device may include a processor 101, a memory 102, a communication interface 103, and a bus 104. The processor 101, the memory 102, and the communication interface 103 can be connected via the bus 104.

[0049] Processor 101 is the control center of the computing device. It can be a single processor or a collective term for multiple processing elements. For example, processor 101 can be a general-purpose central processing unit (CPU) or other general-purpose processors. Among them, the general-purpose processor can be a microprocessor or any conventional processor.

[0050] As one embodiment, processor 101 may include one or more CPUs, for example Figure 1 CPU 0 and CPU 1 are shown in the diagram.

[0051] The memory 102 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), disk storage medium or other magnetic storage device, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto.

[0052] In one possible implementation, the memory 102 can exist independently of the processor 101. The memory 102 can be connected to the processor 101 via a bus 104 and is used to store instructions or program code. When the processor 101 calls and executes the instructions or program code stored in the memory 102, it can implement the natural gas pipeline scheduling method provided in this application embodiment.

[0053] In another possible implementation, the memory 102 can also be integrated with the processor 101.

[0054] The communication interface 103 is used for connecting the computing device to other devices via a communication network, which may be Ethernet, radio access network (RAN), wireless local area network (WLAN), etc. The communication interface 103 may include a receiving unit for receiving data and a transmitting unit for transmitting data.

[0055] Bus 104 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 1The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0056] It should be pointed out that, Figure 1 The structure shown does not constitute a limitation on the computing device, except Figure 1 In addition to the components shown, the computing device may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.

[0057] The embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0058] like Figure 2 As shown in the figure, this application provides a natural gas pipeline network scheduling method, which can be executed by the aforementioned electronic device. The method includes the following steps: S201. Construct a mathematical model for the optimization of natural gas pipeline network scheduling.

[0059] Natural gas pipeline networks consist of pipelines, valve chambers, and stations. Stations primarily function to distribute, pressurize, and transfer supplies between different pipelines. Therefore, based on their functions, stations can be categorized as distribution stations, compressor stations, distribution-compressor stations, and connecting stations. A station can be described as an assembly of pipelines, valve components, compressor components, and other resistance components (such as flow meters, pressure gauges, and filtration equipment). The process flow of the pipeline system can be adjusted by opening and closing the valve components within the station to achieve functions such as distribution, transfer, and bypassing. Compressor components are used to increase the transmission pressure of the pipelines to compensate for pressure losses during natural gas transmission and ensure that the pressure requirements of end users are met.

[0060] The mathematical model for natural gas pipeline network scheduling optimization includes constraints and an objective function. The constraints include flow constraints, pipeline constraints, non-boosting station constraints, and boosting station constraints. The boosting station constraints include the operating flow constraints of the boosting node compressor.

[0061] In some embodiments, flow constraints include upload flow constraints, download flow constraints, node flow conservation constraints, and pipeline transport constraints; pipeline constraints include pipeline hydraulic constraints, pipeline pressure upper limit constraints, and pipeline pressure lower limit constraints; non-boosting station constraints include non-boosting station node and connecting pipeline pressure relationship constraints, valve shut-off and pressure regulation constraints, station pressure upper limit constraints, and station pressure lower limit constraints; boosting station constraints include boosting station node and connecting pipeline pressure relationship constraints, boosting node inlet and outlet pressure relationship constraints, boosting node pressure upper limit constraints, boosting node pressure lower limit constraints, boosting node compressor operating flow constraints, and boosting node compressor operating power constraints; the objective function is determined based on pipeline transportation costs, pipeline network operating costs, and supply-demand deviation penalties.

[0062] Assume that the natural gas pipeline network system can be represented by an undirected graph. express, Represents a set of nodes. This represents the set of gas source upload points. Represents the set of user download points. Represents the set of booster nodes; This indicates a collection of pipe segments in which natural gas is transported.

[0063] Flow constraints can be characterized as: (Formula 1); (Formula 2); (Formula 3); (Formula 4); (Formula 5); Formulas 1-5 represent the upload flow constraints. In the formulas, This is the set of gas sources capable of loading natural gas onto node n; gas source Supply upload node Upload traffic; For upload node Total upload traffic; gas source Planned download volume; and For the slack variable of the upload traffic; gas source The upper limit of gas supply.

[0064] (Formula 6); (Formula 7); Formulas 6 and 7 represent download traffic constraints. In the formulas, For download points Download traffic; For download points The actual natural gas demand; and Slack variables for download traffic.

[0065] The unit for upload / download traffic is... That is, megacumbers per day.

[0066] (Formula 8); Equation 8 represents the node flow conservation constraint. In the equation, For pipelines Natural gas flow rate.

[0067] (Formula 9); (Formula 10); Formulas 9 and 10 represent pipeline throughput constraints. In the formulas, and Pipes Maximum throughput and actual task throughput.

[0068] Pipe constraints can be characterized as: (Formula 11); (Formula 12); Formulas 11 and 12 represent the hydraulic constraints on the pipeline. In the formulas, and Pipes Starting pressure and endpoint pressure The square of; For pipelines Hydraulic parameters; The coefficient of friction of the pipeline is... The formula is updated after each iteration of calculation; As a constant coefficient, when the unit of pipeline pressure is megapascals, the unit of length is kilometers, the unit of pipe diameter is meters, and the unit of flow rate is megacumbers per day, Values ; The compressibility factor of natural gas; The relative density of natural gas; This represents the average temperature of the pipeline. For pipelines The length of . Wherein, the hydraulic pressure drop formula It is a non-linear function of flow rate.

[0069] (Formula 13); (Formula 14); Formulas 13 and 14 are the upper and lower limits of pipeline pressure constraints. and These are the pipeline's highest and lowest operating pressure parameters, respectively.

[0070] The constraints of non-boosting stations can be characterized as: (Formula 15); (Formula 16); (Formula 17); (Formula 18); Formulas 15-18 are for pipes The pressure relationship constraints with nodes other than the booster node. Where, For the direction of pipeline flow, there is a binary variable. When, it indicates that the natural gas in the pipeline is from the node Flow to Node , When, it indicates that the natural gas in the pipeline is from the node Flow to Node In each calculation, The value is determined by the result of the previous iteration; Indicates the endpoint number and node The same set of pipe segments; Indicates pipeline End point and node The pressure relationship relaxes the constraints; This is the parameter for the maximum value.

[0071] Formulas 15 and 16 are the station pressure equality constraints. If the pipeline... Inland natural gas inflow station nodes Then the pressure at the end of the pipeline Must equal node pressure If the pipeline Internal natural gas outflow station node Then the pressure at the end of the pipeline is not... With node pressure Apply constraints.

[0072] Equations 17 and 18 represent valve shut-off and pressure regulation constraints. Relaxation variables. With pipeline flow Mutually exclusive nonlinear constraints must be observed. ;like , It can take any value, representing the connection of station nodes. With pipes The valve was shut off, and the pressure at the end of the pipeline... With node pressure No constraint relationship; if , Must take Value, pipeline end pressure Less than node pressure , indicating the connection of station nodes With pipes The valve underwent pressure adjustment.

[0073] (Formula 19); (Formula 20); (Formula 21); (Formula 22); Formula 19-22 is for pipes The pressure relationship constraints with nodes other than the booster node. Where, Indicates the starting point number and node A set of identical pipe segments.

[0074] (Formula 23); (Formula 24); Formulas 23 and 24 are the upper and lower limits of pressure at the station. and These are the station's highest and lowest operating pressure parameters, respectively.

[0075] The constraints of booster station sites can be characterized as follows: (Formula 25); (Formula 26); (Formula 27); (Formula 28); (Formula 29); (Formula 30); (Formula 31); (Formula 32); Formulas 25-32 are for pipes Constraints on the pressure relationship between the booster node and connected pipelines. Among them, and These are booster nodes. The compressor's inlet and outlet pressures.

[0076] (Formula 33); (Formula 34); (Formula 35); (Formula 36); Formulas 33-36 represent the constraints on the inlet and outlet pressure relationship at the booster node. In the formulas, and These are the compressor's highest and lowest operating pressure ratios, respectively. For the compressor switching at the booster node, a binary variable, if The compressor is on; if The compressor is in a stopped state.

[0077] (Formula 37); (Formula 38); (Formula 39); Formulas 37 and 39 represent the upper and lower pressure limits for the booster node. In the formulas, and These are the maximum and minimum operating pressure parameters for the booster node, respectively. If... The compressor at the booster node is in the start-up state, and the compressor inlet pressure is variable. It should also meet the minimum import operating pressure ( )limit.

[0078] (Formula 40); (Formula 41); Formulas 40 and 41 represent the flow constraints for the compressor operating at the booster node. Where, The natural gas density parameter for the booster node; This refers to the maximum operating flow rate parameter of the compressor at the booster node. If... The booster compressor is in the start-up state, and the compressor operating flow rate is... The maximum operating flow rate should be met. Restrictions; if When the booster node compressor is in a stopped state, the compressor's operating flow rate is not restricted and is automatically balanced according to the hydraulic system of the pipeline network.

[0079] (Formula 42); (Formula 43); (Formula 44); (Formula 45); (Formula 46); Formulas 42-46 represent the operating power constraints for the compressor at the booster node. If... The booster compressor is in the start-up state, and the compressor's operating power is... The maximum operating power should be met. Restrictions; if The compressor at the booster node is in a stopped state, and the compressor's operating power is... It should be limited to 0. and It is a constant and can be updated during the iteration process.

[0080] The objective function satisfies the following relationship: (Formula 47); (Formula 47-1); (Formula 47-2); (Formula 47-3); Where F is used to characterize the objective function. Used to characterize pipeline transportation costs Used to characterize pipeline network operating costs Used to characterize the penalty cost for supply and demand discrepancies. Used to characterize a set of pipe segments Used to characterize the unit freight rate of a pipeline segment Used to characterize the actual transport capacity of a pipeline segment Used to characterize the number of days the pipeline is in operation. Used to characterize pipe segment length Used to characterize the set of booster nodes Used to characterize the unit price of electricity used by compressors Used to characterize the operating power of the compressor. Used to represent the set of user download points Used to characterize the user bias penalty coefficient Used to characterize user excess demand slack variables Used to characterize slack variables for user demand shortages Used to characterize gas source collections Used to characterize the gas source deviation penalty coefficient Used to characterize the slack variable of gas source over-planning. Used to characterize the slack variable of gas source shortage.

[0081] The mathematical model for optimizing natural gas pipeline network scheduling can be characterized as follows: (Formula 48); In the formula, and These are the sets of numbers for integer linear constraints and nonlinear constraints, respectively.

[0082] S202. Linearize the nonlinear constraints in the mathematical model to obtain a linearized mathematical model.

[0083] Based on the mathematical model for natural gas pipeline network scheduling optimization established above, the problem to be solved is a mixed integer nonlinear programming problem, which can be solved using a sequential linear programming algorithm.

[0084] In each iteration In the middle, through the first The first-order Taylor expansion at the next iteration point replaces the nonlinear constraint: (Formula 49); Its expansion is as follows: (Formula 50); In the formula, and These are the slack variables for the linearized nonlinear constraints.

[0085] The final linearized mathematical model satisfies the following relationship: (Formula 51); in, The objective function used to characterize a linearized mathematical model. Used to characterize sets of nonlinear constraints Used to characterize the linearization error penalty coefficient Used to characterize the positive slack variable of linearization error Used to characterize the negative slack variable of linearization error Used to characterize constraint operators, Used to characterize integer linear constraints Used to represent integer constraint numbers The linearized form of the Taylor expansion used to characterize nonlinear constraints The variable 'x' is used to represent the nonlinear constraint number, 's' is used to represent the search step size of the k-th iteration, and 'x' is used to represent the decision variable vector. Used to characterize the solution of the (k-1)th iteration, Used to characterize trust region step size constraints.

[0086] S203. Based on flow constraints and compressor operation flow constraints at the booster node, the objective function is solved to obtain the initial optimization results.

[0087] In some embodiments, step S203 can be specifically implemented as follows: based on the upload flow constraint, download flow constraint, node flow conservation constraint, pipeline throughput constraint, pressure upper limit constraint of booster node and compressor operation flow constraint of booster node, the objective function is solved to obtain the initial optimization result.

[0088] Based on the operational characteristics of the pipeline network, when the pressure regulating element in the regional pipeline network is not in a loop, the pipeline flow has a unique solution, meaning the regional sub-optimization problem is a convex optimization problem. Therefore, if the upstream and downstream flow values ​​of the overall pipeline system are determined, the flow variables only need to optimize the flow through the pressure regulating element in the loop. Furthermore, since the pressure drop loss at the pipeline's inlet and outlet is also fixed when the pipeline flow is fixed, in the regional pipeline network, the pressure values ​​at the network system nodes are only related to the outlet control pressure of the pressure regulating element. Therefore, the decision variables for the optimization problem can be considered as the flow through the pressure regulating element and the outlet pressure control variables.

[0089] Based on this, this application only considers the mathematical model for solving the natural gas pipeline network scheduling optimization under flow-related constraints: (Formula 52); To obtain the initial solution for the flow rate of the optimization problem, the minimum and maximum operating pressures of the nodes are used as the initial solutions (initial optimization results) for the inlet and outlet pressures of the pressure regulating element (i.e., the compressor element).

[0090] S204. Set the first search step size for the flow variable of the pipe connected to the compressor component, and solve the linearized mathematical model according to the first search step size, based on the initial optimization results and the penalized sequential linear programming algorithm, to obtain the first optimization result.

[0091] However, due to the interconnection between different pipelines, flexible transfer of supply is possible, and the operating state of the natural gas pipeline network may deviate greatly from the design conditions. The above-mentioned method can obtain a relatively reliable initial solution by considering factors such as pipeline design capacity and compressor flow limit, but there is still a possibility that it will be significantly different from the optimal solution. Furthermore, considering that the discrete decision variables in the mathematical model are mainly binary variables of compressor on / off states, changes in compressor state will lead to drastic changes in pipeline pressure.

[0092] Therefore, in the first stage of iteration, the search step size is only for the flow variables of the pipes connected to the compressor components. Restrictions are imposed to broaden the feasible domain of the optimization problem. This allows for significant changes in pipeline flow direction and compressor start-up and shutdown. While maintaining optimality, the degree of constraint violation is minimized, thus achieving a process of correcting the initial solution.

[0093] S205. Set the second search step size for the flow variables of all pipes, and solve the linearized mathematical model according to the second search step size, based on the first optimization result and the penalized sequence linear programming algorithm, to obtain the second optimization result.

[0094] In the second phase of iteration, the search step size of the pipeline flow variables other than the flow rate of the compressor component connecting pipes is further restricted to narrow the search range of the feasible region, further reduce the degree of model constraint violation, and initially determine the approximate flow direction of the pipeline network and the compressor start-up scheme.

[0095] S206. Set the third search step size for the flow variables of all pipelines and the compressor outlet pressure variables of all booster stations. Based on the third search step size, the second optimization result, and the penalized sequence linear programming algorithm, solve the linearized mathematical model to obtain the third optimization result.

[0096] In some embodiments, the linearized mathematical model is solved based on the third search step size, the second optimization result, and the penalized sequential linear programming algorithm to obtain the third optimization result. Specifically, this can be implemented as follows: For the k-th iteration, the linearized mathematical model is solved based on the third search step size of the k-th iteration, the current optimization result updated in the (k-1)-th iteration, and the penalized sequential linear programming algorithm to obtain the candidate optimization result for the k-th iteration; the current optimization result updated in the 0th iteration is the second optimization result; based on the current optimization result and the candidate optimization result, the actual decrease and the estimated decrease of the objective function during the k-th iteration are determined; based on the actual decrease and the estimated decrease of the objective function, it is determined whether to accept the result. The process involves considering candidate optimization results and updating the third search step size. If a candidate optimization result is accepted, the candidate optimization result of the k-th iteration is determined as the current optimization result updated in the k-th iteration. If a candidate optimization result is rejected, the current optimization result of the k-th iteration is determined as the current optimization result updated in the k-th iteration. The updated third search step size is used as the third search step size for the (k+1)-th iteration. The iteration process continues until the iteration termination condition is met. If the candidate optimization result obtained in the last iteration is accepted, the candidate optimization result obtained in the last iteration is determined as the third optimization result. Alternatively, if the last iteration yields a rejected candidate optimization result, the current optimization result of the last iteration is determined as the third optimization result.

[0097] In some embodiments, determining whether to accept a candidate optimization result and update the third search step size based on the actual decrease and the estimated decrease of the objective function can be specifically implemented as follows: The ratio between the actual decrease and the estimated decrease of the objective function is determined as the target ratio; if the target ratio is less than a first preset threshold, the candidate optimization result is rejected, and the third search step size is reduced based on the step size change coefficient; if the target ratio is greater than or equal to the first preset threshold and less than a second preset threshold, the candidate optimization result is accepted, and the third search step size is reduced based on the step size change coefficient; if the target ratio is greater than or equal to the second preset threshold and less than or equal to the third preset threshold, the candidate optimization result is accepted, and the third search step size remains unchanged; if the target ratio is greater than the third preset threshold, the candidate optimization result is accepted, and the third search step size is increased based on the step size change coefficient.

[0098] In some embodiments, the k-th iteration process further includes: determining the absolute value of the difference between the objective function value of the k-th iteration and the objective function value of the (k-1)-th iteration; the objective function value of the k-th iteration is used to characterize the result obtained by substituting the candidate optimization result of the k-th iteration into the objective function; if the absolute value is less than the convergence error threshold, the value of the compressor start / stop binary decision variable is kept at the current optimization result updated in the k-th iteration in the (k+1)-th iteration process and all subsequent iterations; if the absolute value is greater than or equal to the convergence error threshold, the iteration process continues.

[0099] Because the mathematical model contains a large number of binary decision variables, the algorithm typically fails to converge in the second-stage iteration. When the change in the objective function value of the mathematical model is less than a given threshold, the algorithm enters the third-stage iteration process. This involves further restricting the search step size of the compressor component outlet pressure variable. When the change in the model's objective function value again falls below the given threshold, the binary decision variables describing the compressor's on / off state are fixed until the model reaches its maximum iteration count or the model error is less than the given threshold. If the model reaches its maximum iteration count, the algorithm has not found a feasible solution to the optimized model; if the model error is less than the given threshold, the algorithm has successfully found a feasible solution.

[0100] According to the trust region-based PSLP algorithm, the optimization problem needs to be calculated in each iteration. The actual decrease and the estimated decrease The traditional PSLP algorithm iterative calculation process is as follows: It selects whether to accept a new solution based on set rules and updates the search step size. 1: Solve the optimization problem (Equation 52) to obtain the initial solution. Initialization parameters , , , , Algorithm convergence error Let the number of iterations be... .

[0101] 2: Solving optimization problems .make To optimize the problem The optimal solution.

[0102] 3: Calculation and ; 4: if then; 5: Stop iteration and return the optimal solution. .

[0103] 6: else: 7: Calculation .

[0104] 8: end if; 9: If ; 10: and ; 11: ; 12: and ; 13: end if; 14: Order ,make Proceed to step 2.

[0105] The PSLP iterative calculation process based on the above three stages in this application is as follows: 1: Solve the optimization problem (Equation 52) to obtain the initial solution. .

[0106] 2: First stage: 3: Let the initial solution be... Search step size ; 4: The PSLP algorithm is used to solve the optimization problem (Equation 51). In each iteration, a new solution is accepted and the search step size is not updated. 5: Order This represents the results of the first phase of optimization.

[0107] 6: Second stage: 7: Let the initial solution be... Search step size ; 8: The PSLP algorithm is used to solve the optimization problem (Equation 51). In each iteration, a new solution is accepted and the search step size is not updated. 9: Order This is the result of the second phase of optimization.

[0108] 10: Third Stage: 11: Let the initial solution be... Search step size ; 12: The PSLP algorithm is used to solve the optimization problem (51). According to the rules described in Algorithm 1, a new solution is selected and the search step size is updated. 13: if then; 14: Fixed binary decision variables: Continue iterating; 15: else: 16: Iterate until the maximum number of iterations is reached, or the model error is less than a given threshold.

[0109] 17: end if; 17: Return the final optimization result .

[0110] For example, assume a natural gas pipeline network system comprising 2027 pipeline segments and 1825 stations (including 164 compressor stations), with given upload and download volumes for each station, allowable pressure ratio range for compressor stations, minimum distribution pressure, and maximum operating pressure of the pipeline. The natural gas pipeline network scheduling process based on the scheme provided in this application is as follows: Figure 3 As shown: First, load the basic data for the natural gas pipeline; Load the specified schedule for the upload / download point day; Solve the optimization problem (Equation 52) to obtain the initial solution. ); Initialize model parameters ( , , , , , ); Initialize search step size: ; The optimization problem is solved using the PSLP algorithm (Equation 51); Initialize search step size: ; The optimization problem is solved using the PSLP algorithm (Equation 51); Initialize search step size: ; The optimization problem is solved using the PSLP algorithm (Equation 51); Output the optimization results.

[0111] based on Figure 3 The results obtained from the process shown are compared with the results of the two solution schemes shown in the table below, as shown in Table 1:

[0112] Table 1

[0113]

[0114] As can be seen, the software GANESO TM The modeling approach used in this example introduced too many binary variables, causing the model's solution time to exceed the set implementation limit (1 hour), leading to the conclusion that the model had no solution. To ensure the reasonableness of the comparison, GANESO was further... TM The 2-step PSLP algorithm is used to solve the mathematical model for natural gas pipeline network scheduling optimization established in this application.

[0115] Because the 2-step PSLP uses a trust-region-less PSLP algorithm to solve the optimization model in the first stage, if there are many loops in the target natural gas pipeline system, there may be continuous abrupt changes in pipeline flow within the loops, making the first-stage model solution difficult. Furthermore, the fixed binary variables in the second stage model are infeasible. The results show that the 2-step PSLP algorithm converges after 54 iterations, with a computation time of 1149.97 seconds. The monthly planned operating cost is 8.999 billion yuan, the daily specified deviation of the upload point is 166.1434 million cubic meters / day, the daily specified deviation of the download point is 10.9036 million cubic meters / day, and the number of pipe segments with errors exceeding the given threshold is 2. Although this number is small, it still indicates that the algorithm converges to an infeasible solution.

[0116] In comparison, the solution method proposed in this application converges after 55 iterations, which is not much different from the 2-step PSLP algorithm. However, the computation time is 475.20 seconds, which is 58.68% lower than the convergence time required by the 2-step PSLP algorithm. The monthly planned operating cost is 9.402 billion yuan, which is 403 million yuan higher than the 2-step PSLP algorithm. However, the daily specified deviation of the upload point is 121.4568 million cubic meters / day, and the daily specified deviation of the download point is 5.8622 million cubic meters / day, both of which are lower than the solution results of the 2-step PSLP algorithm. The number of pipe segments with errors exceeding the given threshold is 0, indicating that the model has converged to a feasible solution.

[0117] Therefore, the natural gas pipeline network scheduling method provided in this application utilizes a mutual exclusion constraint modeling method to eliminate the binary decision variables required for valve modeling. Each iteration fully utilizes the information from the previous iteration, reducing the binary decision variables required to describe the pre- and post-station transfer, valve pressure regulation relationships, and compressor flow rates, thus lowering the mathematical model solution complexity for natural gas pipeline network scheduling optimization. It also utilizes local model closure solution information to reduce the dimensionality of trust region variables, gradually narrowing the feasible region search range during iteration, thereby improving the algorithm's global search capability. By eliminating the binary decision variables required for valve modeling and reducing the mathematical model solution complexity for natural gas pipeline network scheduling optimization, and by fully utilizing heuristic information from pipeline network operation and conducting targeted searches of specific feasible regions, the algorithm's global search capability is enhanced. This enables pipeline operators to achieve rapid and reliable calculations for various gas transmission scenarios, significantly improving both calculation speed and solution quality. It greatly enhances the efficiency of operating condition calculations in pipeline operation and planning, helping pipeline operators operate pipeline systems more efficiently and providing strong support for natural gas pipeline planning and construction.

[0118] S207. Based on the third optimization result, determine the natural gas pipeline network scheduling scheme.

[0119] The third optimization result only represents the operating status of each node in the natural gas pipeline network. The actual scheduling plan can be determined based on the third optimization result and finally executed.

[0120] Figure 2The technical solution presented offers at least the following benefits: By setting flow constraints, pipeline constraints, non-boosting station constraints, and boosting station constraints, it covers the entire physical dimension of natural gas pipeline network operation. This ensures that the feasible region of the mathematical model for natural gas pipeline network scheduling optimization strictly conforms to the physical rules of the natural gas pipeline network, avoiding the problem of "infeasible solutions." By linearizing the nonlinear constraints in the conditions, the linearized mathematical model can be adapted to the subsequent penalized sequence linear programming algorithm, improving the solution efficiency. When solving the initial optimization results, only flow constraints and compressor operation flow constraints at boosting nodes are considered, temporarily excluding complex constraints such as pipeline pressure and valve mutual exclusion. This quickly locks in reasonable flow directions and preliminary compressor start-up and shutdown schemes, providing a reliable starting point for the subsequent three-stage solution and avoiding iterative oscillations caused by the initial solution deviating significantly from the feasible region. Then, through a three-stage solution logic with progressively increasing search step size, the range of variable adjustment is gradually narrowed. The first stage restricts only the flow rate step size of the compressor-related pipe segments to control the risk of sudden flow changes and expand the feasible region. The second stage restricts the flow rate step size of all pipe segments to further narrow the feasible region and reduce the degree of constraint violation in the mathematical model. Finally, the third stage restricts the flow rate step size of the pipe segments and the compressor outlet pressure step size to lock the compressor pressure increase and avoid pressure ratio exceeding the limit. Simultaneously, a penalty sequential linear programming algorithm forces the linearized mathematical model to approach the original nonlinear constraints, ultimately converging to the optimal solution that satisfies both the full constraints and the minimum objective function. The natural gas pipeline scheduling method provided in this application avoids the problems of insufficient exploration, local optima, insufficient fine-tuning, and infeasible solutions inherent in traditional single-step-size algorithms, improving the convergence speed of the solution and ultimately producing a better optimization result.

[0121] The foregoing primarily describes the solutions provided by the embodiments of this application from a methodological perspective. To achieve the aforementioned functions, it includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0122] like Figure 4 As shown in the figure, this application embodiment also provides a natural gas pipeline network scheduling device for executing the natural gas pipeline network scheduling method shown in the above method embodiment. The natural gas pipeline network scheduling device 300 includes: a processing module 301.

[0123] The processing module 301 is used to: construct a mathematical model for natural gas pipeline network scheduling optimization, which includes constraints and an objective function. The constraints include flow constraints, pipeline constraints, non-boosting station constraints, and boosting station constraints. The boosting station constraints include the operating flow constraints of the boosting node compressor. The nonlinear constraints in the mathematical model are linearized to obtain a linearized mathematical model. Based on the flow constraints and the operating flow constraints of the boosting node compressor, the objective function is solved to obtain initial optimization results. A first search step size is set for the flow variables of the pipelines connected to the compressor components, and based on the initial optimization results, the initial optimization results are calculated according to the first search step size. The linearized mathematical model is solved using a penalized sequential linear programming algorithm to obtain the first optimization result. A second search step size is set for the flow variables of all pipelines, and the linearized mathematical model is solved using the first optimization result and the penalized sequential linear programming algorithm according to the second search step size to obtain the second optimization result. A third search step size is set for the flow variables of all pipelines and the compressor outlet pressure variables of all booster stations, and the linearized mathematical model is solved using the third search step size, the second optimization result, and the penalized sequential linear programming algorithm to obtain the third optimization result. Based on the third optimization result, a natural gas pipeline network scheduling scheme is determined.

[0124] In one possible implementation, flow constraints include upload flow constraints, download flow constraints, node flow conservation constraints, and pipeline transport constraints; pipeline constraints include pipeline hydraulic constraints, pipeline pressure upper limit constraints, and pipeline pressure lower limit constraints; non-boosting station constraints include non-boosting station node and connecting pipeline pressure relationship constraints, valve shut-off and pressure regulation constraints, station pressure upper limit constraints, and station pressure lower limit constraints; boosting station constraints include boosting station node and connecting pipeline pressure relationship constraints, boosting node inlet and outlet pressure relationship constraints, boosting node pressure upper limit constraints, boosting node pressure lower limit constraints, boosting node compressor operating flow constraints, and boosting node compressor operating power constraints; the objective function is determined based on pipeline transportation costs, pipeline network operating costs, and supply-demand deviation penalties.

[0125] In one possible implementation, the processing module 301 is specifically used to: solve the objective function based on the upload flow constraint, download flow constraint, node flow conservation constraint, pipeline throughput constraint, pressure upper limit constraint of booster node, and compressor operation flow constraint of booster node, to obtain the initial optimization result.

[0126] In one possible implementation, the processing module 301 is specifically used for: for the k-th iteration of the solution process, based on the third search step size of the k-th iteration, the current optimization result updated in the (k-1)-th iteration, and the penalized sequential linear programming algorithm, to solve the linearized mathematical model and obtain the candidate optimization result of the k-th iteration; the current optimization result updated in the 0th iteration is the second optimization result; based on the current optimization result and the candidate optimization result, to determine the actual decrease and the estimated decrease of the objective function in the k-th iteration process; based on the actual decrease and the estimated decrease of the objective function, to determine whether to accept the candidate optimization result and to update the third search step size; if the candidate optimization result is accepted... If a candidate optimization result is selected, the candidate optimization result of the k-th iteration is determined as the current optimization result updated in the k-th iteration. If a candidate optimization result is rejected, the current optimization result of the k-th iteration is determined as the current optimization result updated in the k-th iteration. The updated third search step size is used as the third search step size for the (k+1)-th iteration. The iteration process is executed until the iteration termination condition is met. If the candidate optimization result obtained in the last iteration is accepted, the candidate optimization result obtained in the last iteration is determined as the third optimization result. Alternatively, if the last iteration yields a rejected candidate optimization result, the current optimization result of the last iteration is determined as the third optimization result.

[0127] In one possible implementation, the processing module 301 is specifically configured to: determine the ratio between the actual decrease and the estimated decrease of the objective function as the target ratio; if the target ratio is less than a first preset threshold, determine to reject the candidate optimization result and reduce the third search step size based on the step size change coefficient; if the target ratio is greater than or equal to the first preset threshold and less than the second preset threshold, determine to accept the candidate optimization result and reduce the third search step size based on the step size change coefficient; if the target ratio is greater than or equal to the second preset threshold and less than or equal to the third preset threshold, determine to accept the candidate optimization result and keep the third search step size unchanged; if the target ratio is greater than the third preset threshold, determine to accept the candidate optimization result and increase the third search step size based on the step size change coefficient.

[0128] In one possible implementation, the processing module 301 is further configured to: determine the absolute value of the difference between the objective function value of the k-th iteration and the objective function value of the (k-1)-th iteration; the objective function value of the k-th iteration is used to characterize the result obtained by substituting the candidate optimization result of the k-th iteration into the objective function; if the absolute value is less than the convergence error threshold, keep the value of the compressor start / stop binary decision variable in the (k+1)-th iteration and all subsequent iterations as the current optimization result updated in the k-th iteration; if the absolute value is greater than or equal to the convergence error threshold, then continue to execute the iteration process.

[0129] In one possible implementation, the objective function satisfies the following relationship: ; ; ; Where F is used to characterize the objective function, Used to characterize pipeline transportation costs Used to characterize pipeline network operating costs Used to characterize the penalty cost for supply and demand discrepancies. Used to characterize a set of pipe segments Used to characterize the unit freight rate of a pipeline segment Used to characterize the actual transport capacity of a pipeline segment Used to characterize the number of days the pipeline is in operation. Used to characterize pipe segment length Used to characterize the set of booster nodes Used to characterize the unit price of electricity used by compressors Used to characterize the operating power of the compressor. Used to represent the set of user download points Used to characterize the user bias penalty coefficient Used to characterize user excess demand slack variables Used to characterize slack variables for user demand shortages Used to characterize gas source collections Used to characterize the gas source deviation penalty coefficient Used to characterize the slack variable of gas source over-planning. Used to characterize the slack variable of gas source shortage.

[0130] In one possible implementation, the linearized mathematical model satisfies the following relationship: ;in, The objective function used to characterize a linearized mathematical model. Used to characterize sets of nonlinear constraints Used to characterize the linearization error penalty coefficient Used to characterize the positive slack variable of linearization error Used to characterize the negative slack variable of linearization error Used to characterize constraint operators, Used to characterize integer linear constraints Used to represent integer constraint numbers The linearized form of the Taylor expansion used to characterize nonlinear constraints The variable 'x' is used to represent the nonlinear constraint number, 's' is used to represent the search step size of the k-th iteration, and 'x' is used to represent the decision variable vector. Used to characterize the solution of the (k-1)th iteration, Used to characterize trust region step size constraints.

[0131] It should be noted that, Figure 4The module division shown is illustrative and represents only one logical functional division; in actual implementation, other division methods are possible. For example, two or more functions can be integrated into a single processing module. These integrated modules can be implemented either in hardware or as software functional modules.

[0132] Another embodiment of this application provides an electronic device, including: one or more processors; one or more memories; wherein the one or more memories are used to store computer program code, the computer program code including computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes any of the natural gas pipeline scheduling methods provided in the above embodiments.

[0133] Another embodiment of this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed on a computer, cause the computer to perform any of the natural gas pipeline scheduling methods provided in the above embodiments.

[0134] Another embodiment of this application provides a computer program product, which includes computer instructions that, when executed on an electronic device, cause the electronic device to perform any of the natural gas pipeline scheduling methods provided in the above embodiments.

[0135] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method of scheduling a natural gas pipeline network, characterized by, The method comprises the following steps: a mathematical model of natural gas pipeline network scheduling optimization is constructed, the mathematical model comprises constraint conditions and an objective function, the constraint conditions comprise flow constraints, pipeline constraints, non-pressurized station field constraints and pressurized station field constraints, the pressurized station field constraints comprise pressurized node compressor operating flow constraints; nonlinear constraints in the constraint conditions of the mathematical model are linearized to obtain a linearized mathematical model; the objective function is solved based on the flow constraints and the pressurized node compressor operating flow constraints to obtain an initial optimization result; a first search step of flow variables of pipelines connected with compressor elements is set, and the linearized mathematical model is solved based on the initial optimization result and a penalty sequence linear programming algorithm according to the first search step to obtain a first optimization result; a second search step of flow variables of all pipelines is set, and the linearized mathematical model is solved based on the first optimization result and the penalty sequence linear programming algorithm according to the second search step to obtain a second optimization result; a third search step of flow variables of all pipelines and compressor outlet pressure variables of all pressurized station fields is set, and the linearized mathematical model is solved based on the third search step, the second optimization result and the penalty sequence linear programming algorithm to obtain a third optimization result; a natural gas pipeline network scheduling scheme is determined based on the third optimization result.

2. The method of claim 1, wherein, The flow constraints comprise upload flow constraints, download flow constraints, node flow conservation constraints and pipeline throughput constraints; the pipeline constraints comprise pipeline hydraulic constraints, pipeline pressure upper limit constraints and pipeline pressure lower limit constraints; the non-pressurized station field constraints comprise non-pressurized station field node and connected pipeline pressure relationship constraints, valve cutoff and pressure regulating constraints, station field pressure upper limit constraints and station field pressure lower limit constraints; the pressurized station field constraints comprise pressurized station field node and connected pipeline pressure relationship constraints, pressurized node import and export pressure relationship constraints, pressurized node pressure upper limit constraints, pressurized node pressure lower limit constraints, pressurized node compressor operating flow constraints and pressurized node compressor operating power constraints; the objective function is determined based on pipeline transportation costs, pipeline network operation costs and supply and demand deviation penalties.

3. The method of claim 2, wherein, The solving of the objective function based on the flow constraints and the pressurized node compressor operating flow constraints to obtain an initial optimization result comprises: the solving of the objective function based on the upload flow constraints, the download flow constraints, the node flow conservation constraints, the pipeline throughput constraints and the pressurized node compressor operating flow constraints to obtain an initial optimization result.

4. The method according to claim 2, wherein the solving of the linearized mathematical model based on the third search step, the second optimization result and the penalty sequence linear programming algorithm to obtain a third optimization result comprises: solving the linearized mathematical model based on the third search step length of the kth iteration, the current optimization result updated in the (k-1)th iteration, and the penalty sequence linear programming algorithm to obtain a candidate optimization result of the kth iteration; the current optimization result updated in the 0th iteration is the second optimization result; determining an actual decrease amount and an estimated decrease amount of the objective function in the kth iteration process based on the current optimization result and the candidate optimization result; determining whether to accept the candidate optimization result and updating the third search step length according to the actual decrease amount and the estimated decrease amount of the objective function; if the candidate optimization result is accepted, determining the candidate optimization result of the kth iteration as the current optimization result updated in the kth iteration; if the candidate optimization result is rejected, determining the current optimization result of the kth iteration as the current optimization result updated in the kth iteration; taking the updated third search step length as the third search step length of the (k+1)th iteration; performing the iteration process until an iteration termination condition is met; if the candidate optimization result obtained in the last iteration process is accepted, determining the candidate optimization result obtained in the last iteration process as the third optimization result; or if the candidate optimization result obtained in the last iteration process is rejected, determining the current optimization result of the last iteration process as the third optimization result.

5. The method of claim 4, wherein, The determining whether to accept the candidate optimization result and updating the third search step length according to the actual decrease amount and the estimated decrease amount of the objective function comprises: determining a target ratio between the actual decrease amount and the estimated decrease amount of the objective function as a target ratio; if the target ratio is less than a first preset threshold, determining to reject the candidate optimization result and reducing the third search step length based on a step length change coefficient; if the target ratio is greater than or equal to the first preset threshold and less than a second preset threshold, determining to accept the candidate optimization result and reducing the third search step length based on the step length change coefficient; if the target ratio is greater than or equal to the second preset threshold and less than or equal to a third preset threshold, determining to accept the candidate optimization result and keeping the third search step length unchanged; if the target ratio is greater than the third preset threshold, determining to accept the candidate optimization result and expanding the third search step length based on the step length change coefficient.

6. The method of claim 4, wherein, The kth iteration process further comprises: determining an absolute value of a difference between a target function value of the kth iteration and a target function value of the (k-1)th iteration; the target function value of the kth iteration is used to represent a result obtained by bringing the candidate optimization result of the kth iteration into the objective function; if the absolute value is less than a convergence error threshold, keeping the compressor start-stop binary decision variable unchanged in the (k+1)th iteration process and all subsequent iteration processes; if the absolute value is greater than or equal to the convergence error threshold, continuing to perform the iteration process.

7. The method according to any one of claims 1 to 6, characterized in that, The objective function satisfies the following relationship: ; ; ; ; F, wherein F is used to represent the objective function, used to represent the pipe transportation cost, used to represent the pipe network operation cost, used to represent the supply-demand deviation penalty cost, used to represent the pipe segment set, used to represent the pipe segment unit transportation rate, used to represent the pipe segment actual transportation volume, used to represent the pipe operation days, used to represent the pipe segment length, used to represent the booster node set, used to represent the compressor electricity unit price, used to represent the compressor operation power, used to represent the user download point set, used to represent the user deviation penalty coefficient, used to represent the user over-demand volume relaxation variable, used to represent the user under-demand volume relaxation variable, used to represent the gas source set, used to represent the gas source deviation penalty coefficient, used to represent the gas source over-planning volume relaxation variable, used to represent the gas source under-planning volume relaxation variable.

8. The method of claim 7, wherein, The linearized mathematical model satisfies the following relationship: ; wherein, a target function for characterizing a linearized mathematical model, for characterizing a set of nonlinear constraints, for characterizing a linearization error penalty coefficient, for characterizing a linearization error positive slack variable, for characterizing a linearization error negative slack variable, for characterizing a constraint operator, for characterizing an integer linear constraint, for characterizing an integer constraint number, for characterizing a Taylor expansion linearized form of a nonlinear constraint, for characterizing a nonlinear constraint number, s for characterizing a search step size of the kth iteration, x for characterizing a decision variable vector, for characterizing a solution of the k-1th iteration, for characterizing a trust region step size constraint.

9. An electronic device, comprising: The electronic device comprises a memory and a processor; The memory and the processor are coupled; The memory is configured to store computer program code, the computer program code comprising computer instructions; When the processor executes the computer instructions, the electronic device is caused to perform the method as claimed in any one of claims 1-8.

10. A computer-readable storage medium, characterized in that, Computer instructions, when run on a computer, cause the computer to perform the method as claimed in any one of claims 1-8.