A method and system for optimizing start-stop operation of a compressor at a gas pipeline compressor station

CN122899709APending Publication Date: 2026-10-13CHINA UNIV OF PETROLEUM (EAST CHINA) +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611078773.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-20
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

压缩机启停属于典型瞬态动态过程,伴随转速、压力、流量的剧烈变化,且管网、压气站与耦合管线之间存在复杂的动态耦合瞬变效应

Benefits of technology

(1)本发明将压缩机启停机理模型与Bi-MS LSTM修正网络相结合,兼顾物理规律与非线性动态补偿,有效提升了能耗预估精度;同时构建包含能耗、供气恢复、压力波动和设备冲击的多目标优化框架,并引入自适应权重机制以适应正常停机与紧急停机等不同工况,实现了启停过程经济性、安全性与稳定性的协同优化。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122899709A_ABST
    Figure CN122899709A_ABST
Patent Text Reader

Abstract

The application discloses a kind of natural gas pipe network gas compression station compressor start-stop operation optimization method and system, belong to petroleum natural gas conveying system optimization technical field.The method includes: current compressor operating parameter is input into compressor start-stop mechanism model, and the energy consumption estimate of compressor is obtained;Current compressor operating parameter, historical compressor operating parameter and the estimate are input into energy consumption correction network, and energy consumption correction value is obtained and estimation correction is completed;According to the energy consumption estimate after correction, construct start-stop multi-objective optimization function and constraint condition with the lowest energy consumption, the fastest gas supply recovery, the highest safety of pipe network system;The optimization function is solved using reinforcement learning optimization algorithm, and the optimal control scheme of compressor start-stop is obtained and control is executed.The application realizes the collaborative optimization of economy, safety and stability of compressor start-stop process by mechanism and data hybrid modeling and multi-objective reinforcement learning solution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of oil and gas transmission system optimization technology, specifically to a method and system for optimizing the start-up and shutdown operation of compressors at natural gas pipeline network compressor stations. Background Technology

[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.

[0003] The natural gas pipeline network system consists of the main pipeline network, compressor stations, and coupled pipelines. The start-up and shutdown operation of the compressors at the compressor stations is a key link in the operation and control of the pipeline network, directly affecting the economy, safety, and stability of the pipeline network. The start-up and shutdown of compressors is a typical transient dynamic process, accompanied by drastic changes in speed, pressure, and flow rate, and there are complex dynamic coupling transient effects between the pipeline network, compressor stations, and coupled pipelines.

[0004] However, existing start-stop control methods fail to fully consider the dynamic coupling feedback relationship among the three factors, and only adjust the compressor speed or outlet pressure, resulting in high start-stop energy consumption. At the same time, existing methods lack optimization algorithms adapted to start-stop transient scenarios, making it difficult to respond quickly and restore gas supply in a timely manner under sudden operating conditions such as emergency shutdown. Furthermore, the optimization accuracy is limited, and it is impossible to effectively balance the multi-objective coordination of energy consumption, stability, and equipment safety. Summary of the Invention

[0005] To address the shortcomings of existing technologies, the present invention aims to provide a method and system for optimizing the start-up and shutdown operation of compressors in natural gas pipeline network compressor stations. This invention focuses on the start-up and shutdown of compressors in compressor stations, constructs a simulation model, establishes a multi-objective optimization system, and employs an improved reinforcement learning algorithm to solve for the optimal start-up and shutdown control scheme. This achieves optimal energy consumption, stability, and safety during the start-up and shutdown process of compressor stations, thereby improving the overall operational level of the natural gas pipeline network.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: Firstly, a method for optimizing the start-up and shutdown operation of compressors at natural gas pipeline network compressor stations is provided, including: Input the current compressor operating parameters into the compressor start-stop mechanism model to obtain the compressor energy consumption estimate; The current compressor operating parameters, historical compressor operating parameters, and compressor energy consumption estimate are input into the energy consumption correction network to obtain the compressor energy consumption correction value, and the compressor energy consumption estimate is corrected based on the compressor energy consumption correction value. Based on the revised compressor energy consumption estimate, a multi-objective optimization function for start-up and shutdown and its constraints are constructed. The optimization objectives of the multi-objective optimization function for start-up and shutdown include minimizing energy consumption, maximizing gas supply recovery, and ensuring the highest safety of the pipeline system. The optimal start-stop control scheme for the compressor is obtained by solving the multi-objective optimization function of start-stop using a reinforcement learning optimization algorithm. The compressor is controlled to start and stop according to the optimal start-stop control scheme.

[0007] Secondly, a system for optimizing the start-up and shutdown operation of compressors at natural gas pipeline network compressor stations is provided, including: The mechanism model prediction module is configured to input the current compressor operating parameters into the compressor start-stop mechanism model to obtain the compressor energy consumption estimate. The energy consumption correction module is configured to: input the current compressor operating parameters, historical compressor operating parameters, and compressor energy consumption estimate into the energy consumption correction network to obtain the compressor energy consumption correction value, and correct the compressor energy consumption estimate based on the compressor energy consumption correction value; The start-stop multi-objective optimization function construction module is configured to: construct the start-stop multi-objective optimization function and constraints based on the corrected compressor energy consumption estimate; the optimization objectives of the start-stop multi-objective optimization function include minimum energy consumption, fastest gas supply recovery, and highest pipeline system safety; The optimal control strategy solution module is configured to: use a reinforcement learning optimization algorithm to solve the multi-objective optimization function for start-stop, and obtain the optimal control scheme for compressor start-stop. The start-stop control execution module is configured to control the compressor's start-stop operation according to the optimal compressor start-stop control scheme.

[0008] Thirdly, an electronic device is also provided, comprising: Memory is used to store computer-readable instructions in a non-transitory manner. Processor, for executing the computer-readable instructions, When the computer-readable instructions are executed by the processor, they perform the method described in the first aspect above.

[0009] Fourthly, a computer-readable storage medium is provided having a program stored thereon that, when executed by a processor, implements the method described in the first aspect above.

[0010] Fifthly, a computer program product is provided, employing the following technical solution: A computer program product includes software code, wherein a program in the software code performs the steps of the method described in the first aspect of the present invention.

[0011] The above technical solution has the following advantages or beneficial effects: (1) This invention combines the compressor start-up and shutdown mechanism model with the Bi-MS LSTM correction network, taking into account both physical laws and nonlinear dynamic compensation, effectively improving the accuracy of energy consumption prediction; at the same time, it constructs a multi-objective optimization framework that includes energy consumption, gas supply recovery, pressure fluctuation and equipment impact, and introduces an adaptive weight mechanism to adapt to different working conditions such as normal shutdown and emergency shutdown, realizing the coordinated optimization of economy, safety and stability of start-up and shutdown process.

[0012] (2) The present invention uses the improved DDPG reinforcement learning algorithm to solve the multi-objective optimization problem. By designing a high-dimensional state space, a refined action space, a staged reward function and multiple constraint penalties, it can quickly search for the optimal control scheme. It is especially suitable for emergency shutdown and other sudden scenarios, which significantly improves the decision response speed and gas supply recovery capability. Compared with traditional numerical or heuristic algorithms, it has stronger adaptive and online learning advantages.

[0013] (3) This invention can also verify the optimal parameters throughout the entire process by building a start-stop dynamic simulation platform, and form an iterative mechanism by correcting the network weights and optimization function coefficients through feedback iteration, which effectively ensures the engineering feasibility and field adaptability of the optimization scheme. The whole method and system have a clear structure and strong implementability, and can be applied to natural gas pipeline networks of different scales, with broad engineering application prospects. Attached Figure Description

[0014] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.

[0015] Figure 1 This is a flowchart of the method for optimizing the start-up and shutdown operation of compressors at natural gas pipeline network compressor stations in a specific embodiment of the present invention. Detailed Implementation

[0016] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0017] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments of the invention. The terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0018] In this embodiment of the invention, "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of this invention, "multiple" refers to two or more.

[0019] Furthermore, to facilitate a clear description of the technical solutions of the embodiments of the present invention, the terms "first" and "second" are used in the embodiments of the present invention to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and the terms "first" and "second" are not necessarily different.

[0020] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.

[0021] All data acquisition in this embodiment is carried out in accordance with laws and regulations and with user consent, and the data is used legally.

[0022] Example 1 This embodiment provides a method for optimizing the start-up and shutdown operation of compressors at natural gas pipeline network compressor stations. The method flow is as follows: Figure 1 As shown, this embodiment uses a compressor station in a natural gas pipeline network as an application scenario. The compressor station includes two gas-driven centrifugal compressors of a certain model and one connecting coupling pipeline. The basic parameters are as follows: main pipeline diameter 1219mm, length 500km; coupling pipeline diameter 508mm, length 80km, design pressure 10MPa; gas source flow rate 500×10⁴. / d; compressor speed range 3000-6500r / min, safe pressure range 8-10MPa.

[0023] The method specifically includes the following steps: S101: Input the current compressor operating parameters into the compressor start-stop mechanism model to obtain the compressor energy consumption estimate. This step establishes a mapping relationship between energy consumption and operating parameters based on the physical mechanism of energy conservation, achieving a preliminary estimate of energy consumption during the start-stop process. Specifically, it includes: S101.1: Obtain the current operating parameters of each compressor.

[0024] In this embodiment, the compressor's operating parameters include: inlet pressure, inlet temperature, mass flow rate, speed, and start-stop time during compressor start-up and shutdown. The start-stop time includes startup time and shutdown time. Specifically, the startup time includes warm-up, idle, transition, and loading time; the shutdown time includes surge valve closing, unloading, idle, and shutdown time. In this embodiment, the inlet pressure, inlet temperature, mass flow rate, and speed corresponding to different start-stop times for each compressor are obtained.

[0025] S101.2: Based on the law of conservation of energy, a compressor start-stop mechanism model is constructed, the correlation between energy consumption and operating parameters is established, and the estimated value of compressor energy consumption is calculated.

[0026] The compressor start-stop mechanism model is as follows: In the formula, Fuel consumption ; The mass flow rate at the compressor inlet is kg / s; The actual cycle specific power of the gas turbine, kJ / kg; For the thermal efficiency of the gas turbine; The lower heating value of the fuel gas is expressed in J / kg.

[0027] fuel consumption This is the estimated energy consumption of the compressor.

[0028] The actual cycle specific power of the gas turbine in equation (1) The calculation formula is as follows: In the formula, The actual cycle specific power of the gas turbine, kJ / kg; f The fuel-air mass ratio; This is the percentage of coolant used, typically set between 4% and 12%. The specific work of turbine expansion is expressed in kJ / kg. The specific work of the air compressor is expressed in kJ / kg.

[0029] S102: Input the current compressor operating parameters, historical compressor operating parameters, and compressor energy consumption estimate into the energy consumption correction network to obtain the compressor energy consumption correction value, and correct the compressor energy consumption estimate based on the compressor energy consumption correction value.

[0030] This step improves the accuracy of energy consumption calculation by correcting the nonlinear deviation of the data-driven time-series network compensation mechanism model, thereby correcting the prediction errors caused by pipeline oscillations and coupling effects. Specifically, it includes: S102.1: Construct an energy consumption correction network.

[0031] In this embodiment, an improved LSTM model, called the Bi-MSLSTM model, is specifically used as the energy consumption correction network. The Bi-MS LSTM model specifically includes a multi-scale feature extraction unit, a bidirectional temporal learning unit, and a prediction output unit connected in sequence. Using the Bi-MS LSTM model, the current compressor operating parameters, historical compressor operating parameters, and the compressor energy consumption prediction value are taken as inputs, and the compressor energy consumption correction value is taken as the output. This corrects prediction biases caused by factors such as downstream pipeline oscillations. The Bi-MS LSTM model learns and predicts the dynamic changes during the start-up and shutdown process, correcting the prediction results of the mechanistic model.

[0032] In this embodiment, the multi-scale feature extraction unit adopts a multi-scale LSTM (MS-LSTM) model, and the bidirectional temporal learning unit adopts a bidirectional long short-term memory network (Bi-LSTM).

[0033] In this embodiment, before inputting the data into the Bi-MS LSTM model, the data is preprocessed, specifically: historical compressor operating parameters at different time points are obtained from various natural gas stations; the current compressor operating parameters and historical compressor operating parameters are cleaned, outliers are detected using the 3σ criterion and the isolated forest algorithm, and linear interpolation is used to repair outliers; the data is normalized to a specific range, such as [0,1] or [-1,1], to improve the stability and convergence speed of subsequent Bi-MS LSTM model training.

[0034] After aligning the normalized current compressor operating parameters with the compressor energy consumption estimate over time, and... The normalized historical compressor operating parameters are input into the MS-LSTM of the Bi-MS LSTM model. The MS-LSTM first divides the time series data consisting of the normalized current compressor operating parameters and historical compressor operating parameters into different time scales. The data at each scale is then segmented according to the division, forming multiple input sequences and corresponding output targets.

[0035] For each time scale, an independent LSTM subunit is constructed. The short-term LSTM subunit focuses on capturing short-term fluctuations and local changes in compressor operating parameters; the medium-term LSTM subunit focuses on seasonal variations and medium-term trends in compressor operating parameters; and the long-term LSTM subunit extracts long-term trends and macroscopic features of compressor operating parameters. Each LSTM subunit receives the input sequence for its corresponding scale and progressively updates the hidden state through LSTM computation. At each time step, the LSTM subunit outputs a hidden state vector, representing the feature representation of the compressor operating parameters at that time step and the corresponding scale.

[0036] The hidden state vectors output from each LSTM subunit in the MS-LSTM are combined and input into the Bi-LSTM. The Bi-LSTM contains two independent LSTM processing directions: forward and backward. The forward LSTM processes the input feature vectors in chronological order, updating the hidden state progressively from the past to the future; the backward LSTM processes the input in reverse chronological order, updating the hidden state from the future to the past. At each time step, the bidirectional LSTM layer merges the forward and backward hidden states, resulting in the final hidden state output for that time step.

[0037] The final hidden state output of the Bi-LSTM is input to the prediction output unit to obtain the compressor energy consumption correction value. In this embodiment, the prediction output unit is a fully connected layer. The fully connected layer further processes and transforms the output of the bidirectional LSTM. The output of the fully connected layer is then processed by an activation function to obtain the final prediction result.

[0038] In this embodiment, the training, optimization, and application of the energy consumption correction network are similar to those of a conventional neural network model, and the training data and internal structure of the model need to be updated regularly to adapt to changes in the gas transmission volume data of the natural gas pipeline network and new operational requirements.

[0039] S102.2: Correct the energy consumption estimate based on the compressor energy consumption correction value.

[0040] The Particle Swarm Optimization (PSO) algorithm is used to dynamically adjust the fusion weights. The model error is used as the objective function to perform weighted fusion of the compressor energy consumption correction value and the estimated value, so as to obtain the final corrected energy consumption estimate.

[0041] S103: Based on the revised compressor energy consumption estimate, construct a multi-objective optimization function for start-up and shutdown and its constraints; the optimization objectives of the multi-objective optimization function for start-up and shutdown include the lowest energy consumption, the fastest gas supply recovery, and the highest pipeline system safety.

[0042] In actual operation, it is necessary to consider the actual engineering requirements of pipeline and compressor station coupling. The pressure transmission of pipelines has obvious dynamic characteristics, and the pressure of upstream and downstream pipelines of the compressor station will be affected by the compressor station's adjustments simultaneously. Therefore, this step focuses on the corrected energy consumption and, combined with the dynamic coupling characteristics of the pipeline network, compressor station, and coupled pipelines, constructs a complete multi-objective optimization problem, which specifically includes: S103.1: Determine the optimization objective and construct the sub-objective functions.

[0043] First, based on the specific working scenario set in this embodiment, the upper limit of the constraints is determined: compressor speed adjustment rate ≤ 50 r / min, maximum allowable flow rate of coupling pipeline 100×104 m3 / d, pipeline safety pressure range 8-10 MPa, and compressor operating point ≥ 10% away from surge zone.

[0044] The start-stop multi-objective optimization function in this embodiment is constructed using a weighted combination method to adapt to different start-stop scenarios. The optimization objectives include the lowest start-stop energy consumption, the fastest gas supply recovery, and the highest pipeline system safety. The weights of each objective can be dynamically adjusted according to normal start-stop and emergency shutdown conditions.

[0045] The specific formula for the optimization objective of minimizing start-stop energy consumption is as follows: In the formula, F represents the total energy consumption of all compressor stations along the entire line; n represents the total number of compressor stations. Indicates the first i The compressor in the station operates at a flow rate of The pressure at the station is The temperature upon entering the station is The pressure of leaving the station is The minimum energy consumption at that time.

[0046] The optimized target formula for the fastest gas supply restoration is as follows: In the formula, Indicates the user's required gas volume. This indicates the gas output of the pipeline network, which is the flow rate of each pipe section. A function of (j represents the pipe segment number), i.e. A penalty function is used to ensure gas supply stability. ; These are weighting coefficients used to adjust the importance of gas supply stability in the objective function.

[0047] The specific formula for achieving the highest safety level in a pipeline network system is: In the formula, m represents the number of pipeline nodes; the pressure at node k is... Its target pressure is MPa; l This represents the number of pipe segments; the flow rate of pipe segment s is... Its target traffic is , The duration of the impact on the compressor station most affected is T, min; the magnitude of the impact on the compressor station most affected is A. , , These are the weighting coefficients for node pressure deviation, pipeline flow deviation, and the time the compressor station is affected.

[0048] The objective function for planned normal shutdown is:

[0049] During normal shutdowns, system operating conditions change relatively smoothly, and the decrease in gas supply to users is planned, with virtually no gas supply interruptions caused by significant fluctuations in gas supply. Because the solution speed of the multi-objective optimization function decreases significantly, conflicts may arise between different objectives. During normal shutdowns, the multi-objective optimization function prioritizes minimizing energy consumption.

[0050] Construct the objective function under emergency shutdown conditions: Calculate gas supply stability: In this formula, because emergency shutdowns place higher demands on gas supply stability, It is a relatively large weighting factor, emphasizing the importance of gas supply stability in emergency situations.

[0051] Calculate the safety of the pipeline network system: In the formula, l 6. l 7. l 8 is the corresponding weighting coefficient, which is usually larger than that for normal shutdown, to highlight the high requirements for operational stability and compressor station safety in emergency situations. Other variables are the same as for normal shutdown.

[0052] The objective function for emergency shutdown is: S103.2: Determine the constraints for starting and stopping the multi-objective optimization function.

[0053] This step demonstrates the construction of a dynamic coupling model for the start-up and shutdown of the pipeline network, compressor station, and coupled pipelines. This model characterizes the flow-pressure-energy consumption coupling relationship among the three during start-up and shutdown transients. Based on this model, four types of constraints are set: safety constraints, equipment constraints, hydraulic constraints, and start-up / shutdown timing constraints, as detailed below: (1) Thermal constraint of pipeline water Ignoring topographical variations, hydraulic constraints on the pipeline: In the formula, q v For natural gas engineering standard operating conditions ( P 0 = 0.101325 MPa T The flow rate at 0=293.15 K, Nm 3 / d; P 1 represents the starting pressure of this pipeline section, in MPa; P 2 represents the final pressure of this pipeline section, in MPa; d This is the inner diameter of the pipe section, in cm; l The hydraulic friction coefficient of the pipeline; Z Δ is the compressibility factor of natural gas; Δ is the relative density of natural gas. T The average temperature of the gas in this section of the pipeline, in K; L The length of this section of pipeline is in km.

[0054] Pipeline thermal constraints: In the formula, t x This indicates the gas temperature along the gas pipeline, in °C. t 0 indicates the soil temperature where the pipeline is buried, in °C; t 1 represents the gas temperature at the starting point of the calculated pipeline section, in °C; K This represents the overall heat transfer coefficient from gas to soil, expressed in W / (m²). 2 ·K); D This indicates the outer diameter of the gas pipeline, in meters (m). q v This indicates the flow rate of natural gas under standard operating conditions, in Nm³. 3 / d; c p The isobaric specific heat of the gas is expressed in J / (kg·K) and is calculated using the BWRS equation.

[0055] (2) Failure domain constraints of compressor station and compressor characteristic constraints In the formula, For the first i The operational feasibility domain of a compressor station; For the first i The first compressor station l The flow rate through each compressor, m 3 / s; and For the first iThe first compressor station l The lower and upper limits of the flow rate of each compressor, m 3 / s; and For the first i The first compressor station l The inlet and outlet pressures of each compressor, in MPa; , , and For the first i The first compressor station l The lower and upper limits of the inlet pressure, and the lower and upper limits of the outlet pressure of each compressor, in MPa; For the first i The first compressor station l The inlet temperature of the compressor, K; and For the first i The first compressor station l The lower and upper limits of the inlet temperature of each compressor, in K; For the first i The first compressor station l The compressor's rotational speed, in RPM; and For the first i The first compressor station l The lower and upper speed limits of each compressor, in RPM; For the first i The first compressor station l The power of the compressor, in kW; and For the first i The first compressor station l The lower and upper power limits (kW) of each compressor; For the first i The first compressor station l The outlet temperature of each compressor, in K; and For the first i The first compressor station l The lower and upper limits of the outlet temperature of each compressor, in K; For the first i The first compressor station l The energy head of each compressor, J / kg; Indicates the first i The first compressor station l The on / off status of each compressor. =0 indicates that the compressor is off. =1 indicates that the compressor is on. Indicates the first iThe first compressor station l The mass flow rate of gas passing through the compressor is kg / s; Indicates the first i The first compressor station l The operating efficiency of each compressor; This indicates the operating efficiency of the gas turbine corresponding to the compressor unit; This indicates the calorific value of natural gas, expressed in J / kg.

[0056] (3) Pipeline topology constraints 1) Node upper and lower limit constraints In a natural gas pipeline network, the flow rate and pressure at each node must meet the minimum and maximum constraints of that node: In the formula, For the first i Pressure at each node, MPa; and For the first i Minimum and maximum allowable pressures of each node, in MPa; For the first i The traffic of each node, m 3 / s; and For the first i Minimum and maximum throughput of each node, m 3 / s.

[0057] 2) Flow balance constraints Within a natural gas pipeline network, each node must ensure that the flow rate flowing into the node is equal to the flow rate flowing out of the node. In the formula, To and i The set of adjacent nodes of a node; From i Node flow j The node's traffic, m 3 / s; The coefficient is +1 when flowing into a node and -1 when flowing out of a node; Indicates the first i The traffic exchanged between each node and the outside world, m 3 / s.

[0058] S103.3: Construct a start-stop multi-objective optimization function based on the optimization objectives of the start-stop multi-objective optimization function, and set the weight coefficients of the optimization objectives according to different start-stop scenarios:

[0059] During normal shutdown scenarios: Energy consumption weight =0.6, pressure stability weight =0.2, Equipment Impact Weight =0.2; In emergency shutdown scenarios: energy consumption weighting =0.5, pressure stability weight =0.3, Equipment Impact Weight =0.2.

[0060] S104: The multi-objective optimization function for compressor start-stop is solved by using a reinforcement learning optimization algorithm to obtain the optimal start-stop control scheme for the compressor.

[0061] This embodiment uses the DDPG reinforcement learning algorithm to solve a multi-objective optimization problem. By designing a state space, action space, and staged reward function adapted to the start-stop scenario, and combining an experience replay mechanism, the optimal control scheme is iteratively solved. The specific steps are as follows: S104.1: Design state space and action space.

[0062] The natural gas pipeline network system is treated as a reinforcement learning environment. The agent outputs control actions based on the environment's state, and the environment returns feedback based on these actions. The optimal start-up and shutdown strategy is obtained through iterative learning. The state space includes pipeline network state variables and compressor state variables. Pipeline network state variables include pressure at each node, flow rate at each pipeline segment, user gas supply demand, and the percentage of start-up and shutdown time. Compressor state variables include the on / off status, speed, inlet and outlet pressures, cumulative runtime, and estimated start / stop duration for each compressor. The action space includes compressor on / off actions (0 for shutdown, 1 for start) and compressor speed adjustment actions, enabling joint control of discrete start-up and shutdown commands and continuous speed regulation.

[0063] In this embodiment, the specific design process of the state space is as follows: Design network state variables: Node pressure: using This represents the pressure value at each node in the pipeline network; Pipe flow rate: using It indicates the flow rate of a pipeline segment; the flow rate of a pipeline segment is related to the pressure at each node, and together they describe the flow state of natural gas within the pipeline network; Gas supply demand: ; Time: Represents the estimated total duration of time relative to the start time (t). Through the ratio of the two It can reflect the current stage of the start-up and shutdown process, and make reasonable decisions based on the characteristics of different stages.

[0064] Design compressor state variables: Operating compressor state matrix: For each compressor i in the pipeline network, its state vector is: in Indicates the switch status (1 indicates on, 0 indicates off); It refers to rotational speed, in RPM; and These are the inlet and outlet pressures, in MPa. It is the cumulative running time. It is the cumulative idle time. This is the estimated time required for this launch. This is the estimated downtime, in minutes. Combine the state vectors of all compressors into a single matrix: In the formula, c represents the total number of compressors.

[0065] In this embodiment, the action space includes compressor switching action and compressor speed adjustment action.

[0066] In this embodiment, the specific design process of the state space is as follows: Compressor switch operation: In the formula, Indicates the first i The on / off operation of a compressor (with a value of 0 or 1) determines whether a compressor should be stopped or started.

[0067] Compressor speed adjustment action: In the formula, c represents the total number of compressors; Indicates the first i The speed adjustment of the compressor.

[0068] Overall motion vector Based on the current state s, it outputs action a to operate the compressor and interact with the pipeline environment.

[0069] S104.2: Construct a phased reward function.

[0070] The reward function consists of positive reward terms that guide the agent to converge toward the optimization goal. Specifically, these include: Energy consumption reward: the lower the energy consumption, the higher the reward value, guiding the agent to learn the optimal energy consumption control strategy; Gas supply stability reward: the closer the gas output of the pipeline is to the user's demand, the higher the reward, prompting the system to maintain a stable gas supply and accelerating the gas supply recovery in emergency scenarios.

[0071] The energy consumption reward is as follows: In the formula, It is an energy consumption weighting coefficient. The higher the reward, the lower the energy consumption, thus guiding the learning of the strategy with the lowest energy consumption.

[0072] The specific details of the gas supply stability incentive are as follows:

[0073] In the formula, the user's required gas volume is Actual gas output from the pipeline network , ; As a weighting coefficient, it promotes the maintenance of a stable gas supply state, so that the gas output of the pipeline network is close to the gas demand of users.

[0074] S104.3: Set up a constraint and penalty mechanism.

[0075] To ensure that the optimization results satisfy all constraints, a constraint penalty term is introduced into the reward function. A penalty value is applied when an action triggers a constraint violation. Specifically, penalties include speed penalty, inlet / outlet pressure penalty, power penalty, node pressure penalty, pipe segment flow penalty, switching frequency penalty, and regulation speed penalty. These penalty values ​​are incorporated into the reward function. During the constraint process, there is no positive reward; the overall reward function is the positive reward term minus all constraint penalty terms.

[0076] S104.3.1: The specific speed penalty is as follows: When the compressor speed ri exceeds the allowable range ( ≤ ≤ )hour: This is the weighting coefficient for the speed constraint penalty.

[0077] S104.3.2: The specific penalties for import and export pressure are as follows: Compressor inlet and outlet pressure range ( ≤ ≤ , ≤ ≤ ): This is the pressure constraint penalty weight coefficient.

[0078] S104.3.3: The power penalty is as follows: When the compressor power Exceeding rated power : It is the power constraint penalty weight coefficient.

[0079] S104.3.4: The node stress penalty is as follows: When node pressure Exceeding the permitted range ( ≤ ≤ ): It is the node pressure constraint penalty weight coefficient.

[0080] S104.3.5: The specific flow penalty for pipe sections is as follows: For pipe segment flow rate Qs exceeding the limit ( ≤ ≤ ): It is the weighting coefficient of the flow constraint penalty for the pipeline segment.

[0081] S104.3.6: The specific penalty for the number of compressor on / off cycles is as follows: Number of times the compressor is switched on and off Exceeding the maximum allowed number of switching operations : It is the penalty weight coefficient for the number of times the switch is turned on and off.

[0082] S104.3.7: The specific speed penalty adjustment is as follows: If the compressor speed adjustment speed Exceeding the maximum allowable adjustment rate : It is the adjustment speed constraint penalty weight coefficient.

[0083] The comprehensive reward function of the DDPG optimization algorithm is:

[0084] In this embodiment, under normal shutdown conditions: the compressor speed adjustment rate is 40 r / min, the outlet pressure gradually decreases to 8.5 MPa, the anti-surge valve opening is 0.8, and the flow distribution ratio of the coupling pipeline is 3:2.

[0085] In this embodiment, under emergency shutdown: the compressor speed adjustment rate is 50 r / min, the outlet pressure drops rapidly to 8.2 MPa, the anti-surge valve opening is 0.7, the flow distribution ratio of the coupling pipeline is 2:3, and the standby compressor is activated to supply auxiliary gas.

[0086] S104.4: Based on the state space and action space constructed above, and the stage reward function, the DDPG algorithm is adopted, and an experience replay mechanism is introduced to iteratively solve for the optimal control scheme. The specific process is as follows: Constructing the DDPG algorithm network: Set up the actor network: the number of input layer nodes corresponds to the dimension of the state space, and the received state space vector is used. S , dimension d S The hidden layers extract features and perform nonlinear transformations on the input state information. A multi-layer fully connected neural network is used, with the number of neurons in each layer decreasing. The ReLU activation function is used to enhance the network's nonlinear expressive power and accelerate convergence. The number of nodes in the output layer corresponds to the dimension of the action space, and the output is the action that the agent decides to take based on the current state. Setting up the critic network: Construct a multi-layer neural network as the critic network. Its input is a concatenation of the state vector and the action vector. After feature extraction and transformation in the hidden layers, it outputs a scalar value representing the value estimate of performing the action in the current state. This value is used to evaluate the quality of the agent's action in the current state. The hidden layers use the ReLU activation function, and the output layer directly outputs the value estimate. Set up target networks: Create target actor networks and target critic networks, with identical structures to their corresponding actor and critic networks. Copy the parameters of the target networks to the parameters of the current networks. During training, use a soft update mechanism to gradually bring the parameters of the target networks closer to those of the current networks.

[0087] An experience replay mechanism is set up: the experience replay buffer consists of a quadruple of state, action, reward, and next state for each step. During training, a batch of samples is randomly drawn from the buffer. Considering the dynamic changes in the compressor shutdown and startup process and the characteristics of different stages, the samples can be reasonably classified or weighted based on information such as timestamps, so that the agent can more effectively learn optimization strategies for different stages from past experiences.

[0088] Setting up target network updates: Using target actor and target critic networks, the parameters of the actor and critic networks are periodically copied to the target network to reduce training volatility. Parameter copying is performed at regular intervals between training steps. The target network is used to calculate the target value, assisting in updating the current network's parameters and improving learning stability and convergence speed. When dealing with compressor shutdown and startup issues, the frequency of parameter copying needs to be adjusted according to the situation. For example, the update frequency can be appropriately increased during critical shutdown and startup phases to better adapt to rapid environmental changes.

[0089] Update network parameters: Critics network loss calculation: The loss of the critic network is calculated based on the time difference error (TD-error).

[0090] In the formula, c It is a discount factor; Q' and π' These are the outputs of the target critic network and the target actor network, respectively; the loss function for the critic network uses mean squared error loss. By minimizing this loss through optimization algorithms (such as Adam), the critic network can accurately assess value.

[0091] Actor Network Loss Calculation: The loss function of the actor network aims to maximize the value estimate of its output action by the critic network, and can be expressed as: Similarly, the parameters of the actor network are updated using optimization algorithms, so that the actions output by the actor network can obtain a higher value estimate in the current state, and achieve the best effect in reasonably controlling the compressor shutdown and startup time and adjusting the operating parameters.

[0092] S105: Control the compressor to start and stop according to the optimal compressor start-stop control scheme.

[0093] The optimal control scheme obtained from the solution is sent to the compressor station control system, which executes the compressor start-up and shutdown operations and parameter adjustments according to the preset timing sequence to achieve optimized operation of the start-up and shutdown process. Specifically, the optimal control scheme involves regulating the compressor's start-up and shutdown timing, sequence, and speed.

[0094] In this embodiment, the optimized control scheme for the start-up and shutdown of the compressors across the entire line is shown in Table 1 below: Compared with the initial scheme, the new operating scheme starts one compressor at station #1, shuts down one compressor at station #4, normally shuts down one compressor at station #8, and starts one compressor at station #18. At station #8, due to the shutdown, the inlet pressure increases and the outlet pressure decreases.

[0095] Table 1. Adjustment Scheme for Optimal Control of Compressor Start-Stop

[0096] Experimental results verification (1) Energy consumption optimization effect In the initial stage of shutdown, the energy consumption of the target compressor will decrease, but some compressors will operate under suboptimal conditions, leading to an increase in overall energy consumption. At this time, system energy consumption changes erratically, potentially rising initially and then falling, or fluctuating significantly. As the shutdown process progresses, the energy consumption of the target compressor continues to decrease, but other compressors struggle to adapt quickly to changing pressure and flow conditions within the pipeline network, resulting in increased energy consumption. Fluctuations in pipeline pressure and flow may cause increased pipeline resistance and localized pressure losses, further increasing system energy consumption. During this stage, total energy consumption may fluctuate repeatedly or show an upward trend. After the compressors are completely shut down, the system stabilizes under new operating conditions. However, the energy consumption under these new conditions is not at its lowest; some compressors and the pipeline system deviate from their optimal state, resulting in a higher energy consumption level after stabilization.

[0097] Table 2 Comparison of total pipeline energy consumption before and after optimization during a period of normal downtime at a certain station.

[0098] As shown in Table 2, after a brief increase, the optimized system energy consumption gradually transitioned to an energy-saving state. Although there were slight fluctuations in energy consumption, the overall trend was downward, and the rate of decrease was stable with no sudden peaks. The compressors at each station consistently operated near their optimal conditions, resulting in a continuous reduction in energy consumption. When the compressors were completely shut down, the energy consumption curve quickly stabilized at a level lower than before optimization and remained stable.

[0099] (2) Gas supply stability and pipeline operation safety After optimization, the fluctuations in pipeline pressure and flow during start-up and shutdown are controlled within the constraints, ensuring continuous and stable gas supply to users without interruption or quality fluctuations; the pipeline pressure remains within the safe range, and the compressor operating point is kept in a safe area far away from the surge zone, effectively ensuring the safe operation of equipment and pipeline.

[0100] In some embodiments, a start-stop dynamic simulation platform can be built based on the optimal control scheme. The optimal control scheme is then substituted to simulate the entire process of normal start-stop and emergency shutdown of the compressor. If the start-stop energy consumption, pressure fluctuation, gas supply recovery time, and equipment impact exceed the preset threshold, the weight coefficients of the energy consumption correction network and the weights of the optimization function are reversed and iteratively optimized until the requirements for safe, economical, and stable operation are met.

[0101] Example 2 This embodiment provides a natural gas pipeline compressor station compressor start-up and shutdown optimization system, including: The mechanism model prediction module is configured to input the current compressor operating parameters into the compressor start-stop mechanism model to obtain the compressor energy consumption estimate. The energy consumption correction module is configured to: input the current compressor operating parameters, historical compressor operating parameters, and compressor energy consumption estimate into the energy consumption correction network to obtain the compressor energy consumption correction value, and correct the compressor energy consumption estimate based on the compressor energy consumption correction value; The start-stop multi-objective optimization function construction module is configured to: construct the start-stop multi-objective optimization function and constraints based on the corrected compressor energy consumption estimate; the optimization objectives of the start-stop multi-objective optimization function include minimum energy consumption, fastest gas supply recovery, and highest pipeline system safety; The optimal control strategy solution module is configured to: use a reinforcement learning optimization algorithm to solve the multi-objective optimization function for start-stop, and obtain the optimal control scheme for compressor start-stop. The start-stop control execution module is configured to control the compressor's start-stop operation according to the optimal compressor start-stop control scheme.

[0102] It should be noted that the aforementioned mechanism model prediction module, energy consumption correction module, start-stop multi-objective optimization function construction module, optimal control strategy solution module, and start-stop control execution module correspond to steps S101 to S105 in Embodiment 1. The examples and application scenarios implemented by these modules and their corresponding steps are the same, but they are not limited to the content disclosed in Embodiment 1. It should be noted that these modules, as part of the system, can be executed in a computer system such as a set of computer-executable instructions.

[0103] The descriptions of each embodiment in the above embodiments have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0104] The proposed system can be implemented in other ways. For example, the system embodiments described above are merely illustrative, and the division of modules described above is only a logical functional division. In actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed.

[0105] Example 3 This embodiment also provides an electronic device, including: one or more processors, one or more memories, and one or more computer programs; wherein, the processor is connected to the memory, and the one or more computer programs are stored in the memory. When the electronic device is running, the processor executes the one or more computer programs stored in the memory to cause the electronic device to perform the method described in Embodiment 1.

[0106] It should be understood that in this embodiment, the processor can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.

[0107] Memory may include read-only memory and random access memory, and provides instructions and data to the processor. A portion of memory may also include non-volatile random access memory. For example, memory may also store information about the device type.

[0108] In the implementation process, each step of the above method can be completed by the integrated logic circuits in the processor hardware or by software instructions.

[0109] The method in Embodiment 1 can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor. The software modules can reside in readily available storage media in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method. To avoid repetition, a detailed description is not provided here.

[0110] Those skilled in the art will recognize that the units and algorithm steps described in connection with the various examples of this embodiment can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this invention.

[0111] Example 4 Embodiment 4 of the present invention provides a computer-readable storage medium.

[0112] A computer-readable storage medium having a program stored thereon that, when executed by a processor, implements the steps of the method as described in Embodiment 1 of the present invention.

[0113] The detailed steps are the same as those provided in Example 1, and will not be repeated here.

[0114] Example 5 Embodiment 5 of the present invention provides a computer program product.

[0115] A computer program product includes software code, wherein the program in the software code performs the steps described in Embodiment 1 of the present invention.

[0116] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for optimizing the start-up and shutdown operation of compressors at natural gas pipeline network compressor stations, characterized in that, include: Input the current compressor operating parameters into the compressor start-stop mechanism model to obtain the compressor energy consumption estimate; The current compressor operating parameters, historical compressor operating parameters, and compressor energy consumption estimate are input into the energy consumption correction network to obtain the compressor energy consumption correction value, and the compressor energy consumption estimate is corrected based on the compressor energy consumption correction value. Based on the revised compressor energy consumption estimate, a multi-objective optimization function for start-stop and constraints is constructed. The optimization objectives of the start-stop multi-objective optimization function include the lowest energy consumption, the fastest gas supply recovery, and the highest pipeline system safety. The optimal start-stop control scheme for the compressor is obtained by solving the multi-objective optimization function of the start-stop system using a reinforcement learning optimization algorithm. The compressor is controlled to start and stop according to the optimal compressor start-stop control scheme.

2. The method for optimizing the start-up and shutdown operation of compressors at natural gas pipeline network compressor stations as described in claim 1, characterized in that, The energy consumption correction network specifically adopts the Bi-MS LSTM model; the Bi-MS LSTM model includes a multi-scale feature extraction unit, a bidirectional temporal learning unit, and a prediction output unit connected in sequence; the multi-scale feature extraction unit adopts the MS-LSTM model; the bidirectional temporal learning unit adopts the Bi-LSTM model; the prediction output unit includes a fully connected layer and an activation function.

3. The method for optimizing the start-up and shutdown operation of compressors at natural gas pipeline network compressor stations as described in claim 1, characterized in that, The method of correcting the compressor energy consumption estimate based on the compressor energy consumption correction value is as follows: the particle swarm optimization algorithm is used to dynamically adjust the fusion weights, and the model error is used as the objective function to perform weighted fusion of the compressor energy consumption estimate and the compressor energy consumption correction value to obtain the final corrected energy consumption estimate.

4. The method for optimizing the start-up and shutdown operation of compressors at natural gas pipeline network compressor stations as described in claim 1, characterized in that, The start-stop multi-objective optimization function is constructed by a weighted combination of three sub-objectives: lowest energy consumption, fastest gas supply recovery, and highest pipeline system safety. The weight coefficients are dynamically adjusted according to different scenarios of normal shutdown and emergency shutdown. The constraints of the start-stop multi-objective optimization function include: pipeline hydrothermal constraints, compressor station and compressor characteristic constraints, pipeline topology constraints, and start-stop timing constraints.

5. The method for optimizing the start-up and shutdown operation of compressors at natural gas pipeline network compressor stations as described in claim 1, characterized in that, To address the solution process of the multi-objective optimization function for start-stop, the DDPG algorithm is adopted. A state space including the pipeline state and compressor state is designed, and an action space including compressor switching action and speed adjustment action is designed. A staged reward function is constructed, and a constraint penalty mechanism and an experience playback mechanism are introduced to iteratively solve the optimal control scheme.

6. The method for optimizing the start-up and shutdown operation of compressors at natural gas pipeline network compressor stations as described in claim 1, characterized in that, The optimal control scheme specifically involves controlling the start-up and stop times, start-up and stop sequences, and speed of the compressor.

7. A system for optimizing the start-up and shutdown operation of a compressor at a natural gas pipeline network compressor station, characterized in that, include: The mechanism model prediction module is configured to input the current compressor operating parameters into the compressor start-stop mechanism model to obtain the compressor energy consumption estimate. The energy consumption correction module is configured to: input the current compressor operating parameters, historical compressor operating parameters, and compressor energy consumption estimate into the energy consumption correction network to obtain the compressor energy consumption correction value, and correct the compressor energy consumption estimate based on the compressor energy consumption correction value; The start-stop multi-objective optimization function construction module is configured to: construct a start-stop multi-objective optimization function and constraints based on the corrected compressor energy consumption estimate; the optimization objectives of the start-stop multi-objective optimization function include minimum energy consumption, fastest gas supply recovery, and highest pipeline system safety; The optimal control strategy solution module is configured to: use a reinforcement learning optimization algorithm to solve the start-stop multi-objective optimization function to obtain the optimal control scheme for compressor start-stop; The start-stop control execution module is configured to control the compressor to start and stop according to the compressor start-stop optimal control scheme.

8. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps in the method for optimizing the start-up and shutdown operation of a compressor at a natural gas pipeline compressor station as described in any one of claims 1-6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps in the method for optimizing the start-up and shutdown operation of the compressor at the natural gas pipeline compressor station as described in any one of claims 1-6.

10. A computer program product, comprising software code, characterized in that, The program in the software code executes the steps in the method for optimizing the start-up and shutdown operation of the compressor at the natural gas pipeline compressor station as described in any one of claims 1-6.