Natural gas conveying flow dynamic optimization control method and system
By constructing a pressure covariance propagation graph and using a CNN-LSTM model to predict gas demand, and combining this with sequential quadratic programming to optimize flow allocation, the shortcomings of natural gas pipeline networks in demand forecasting and regulation have been addressed, achieving global optimization and low-carbon operation.
Patent Information
- Application Number
- CN202511852015.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-09
- Publication Date
- 2026-03-17
AI Technical Summary
The existing natural gas pipeline network lacks foresight and precision in demand forecasting, making it difficult to achieve global optimization in operation and control. Furthermore, it lags in response to rapid load changes, resulting in high energy consumption and unstable gas supply quality.
By constructing a pressure covariance propagation graph and combining it with a CNN-LSTM model to predict gas demand, false demand signals are decoupled and corrected. Furthermore, flow allocation is optimized through a sequential quadratic programming algorithm, and the operation of valves and compressors is dynamically controlled.
It improved the predictability and responsiveness of demand forecasting, reduced energy consumption, enhanced gas supply quality and equipment lifespan, and achieved overall optimization and low-carbon operation of the pipeline network.
Smart Images

Figure CN121676883A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of flow optimization control, in particular to a natural gas delivery flow dynamic optimization control method and system. BACKGROUND
[0002] With the proposal of the "double carbon" target and the optimization of energy structure, natural gas as a clean energy is increasingly important in urban energy supply. As the key infrastructure connecting gas sources and users, the refinement and intelligence level of natural gas pipeline network operation is directly related to the reliability, economy and safety of gas supply. At present, China's natural gas pipeline network has high operation reliability and can guarantee stable gas use of users. However, with the expansion of pipeline network scale and the increasing diversification of gas use scenarios (such as distributed energy, natural gas vehicles, seasonal peak shaving, etc.), pipeline network operation faces new challenges and higher optimization needs.
[0003] Firstly, in terms of demand prediction, traditional prediction models rely on statistical analysis of historical gas consumption data, which can meet the scheduling needs under normal and stable conditions, but in response to short-term and sudden load fluctuations caused by factors such as holidays, extreme weather or social activities, the prediction foresight and refinement still have room for improvement. How to more sensitively capture and quantify the impact of these nonlinear factors on gas demand and achieve more predictive scheduling is the key to improving pipeline network operation efficiency.
[0004] Secondly, in terms of operation control, existing pipeline networks mainly adjust pressure and flow through valves at gas transmission stations, and operation strategies are mostly based on experience or fixed pressure set values, which ensure the safety and stability of gas supply. However, at the system level, this local and passive adjustment method cannot achieve global optimization. For example, to ensure end pressure, upstream stations may maintain high outlet pressure, which will cause unnecessary pressure loss and energy dissipation (mainly manifested as throttling loss) in some periods. Therefore, how to further tap the energy-saving potential of the system by coordinating the control of each node while ensuring the safety margin of gas supply, and reducing the total energy consumption in the transmission and distribution process, is an important issue for realizing low-carbon economic operation of pipeline networks.
[0005] In addition, natural gas pipeline network itself is a dynamic system, and the propagation of pressure and flow in the pipeline has time lag. When the load changes rapidly, the response of traditional control strategies may have a certain lag, and more advanced control methods are needed to realize rapid and smooth transition of pipeline network state, avoid unnecessary pressure fluctuations, improve gas supply quality, and help prolong the service life of valves and other equipment.
[0006] In summary, how to further improve the pre-perception ability of demand prediction, realize the global collaborative optimization and dynamic fine regulation of pipeline operation, and achieve higher operation efficiency, economy and low carbon level by integrating physical mechanism and data-driven advanced technology on the basis of stable and reliable pipeline operation has become an important direction for technology upgrading in the natural gas industry. SUMMARY
[0007] The purpose of the present application is to provide a natural gas delivery flow dynamic optimization control method and system, aiming to solve the technical problems of how to further improve the foresight and fineness of demand prediction, realize the collaborative optimization of system energy efficiency, and enhance the smooth and rapid response capability to dynamic load on the basis of stable operation in the prior art.
[0008] To achieve the above-mentioned purpose, the present application aims to provide a natural gas delivery flow dynamic optimization control method, comprising:
[0009] S1, collecting the operation parameters of the natural gas pipeline, the historical gas consumption quantity of the user end and the weather forecast data;
[0010] S2, based on the historical gas consumption quantity and the weather forecast data, predicting the natural gas consumption demand of the user end in multiple future time periods through a long short-term memory model;
[0011] S3, based on the prediction result, constructing a multi-node gas flow distribution optimization model, and solving the multi-node gas flow distribution optimization model through a sequential quadratic programming algorithm to obtain an optimized flow distribution strategy;
[0012] S4, analyzing the flow distribution strategy to generate control parameters, and downlinking the control parameters to a control center for controlling the compressor operation strategy and adjusting the valve opening degree.
[0013] As a further improvement of the present technical solution, in S2, the natural gas consumption demand of the user end in multiple future time periods is predicted through a long short-term memory model, comprising the following steps:
[0014] S2.1, based on the historical gas consumption quantity and the weather forecast data of the corresponding time period, constructing a feature variable matrix and a target variable, collecting high-frequency pressure signals, recording pipeline physical parameters, and at the same time, constructing a pressure covariance propagation diagram;
[0015] S2.2, using a sliding window method to generate a gas consumption sequence of the past n time periods as a historical sequence feature, and extracting a time periodicity feature as a current sequence feature to reflect the time sequence rule of gas consumption behavior;
[0016] S2.3, considering the hysteresis effect of temperature, constructing a combination variable of wind-chill index;
[0017] S2.4, divide the historical gas consumption amount, weather forecast data and high-frequency pressure data collected in the corresponding time period into a training set, a validation set and a test set in chronological order;
[0018] S2.5, training the demand pre-perception model based on pressure covariance propagation using the training set to capture the time sequence dependent characteristics of gas consumption changes;
[0019] S2.6, after training, decoupling and correcting the gas demand prediction value sequence output by the demand pre-perception model based on physical pressure conduction;
[0020] S2.7, according to the set prediction period, input the historical sequence characteristics, current sequence characteristics, combined variables and corresponding pressure covariance propagation graph into the trained demand pre-perception model, and output the gas demand prediction value sequence of each prediction period in the future.
[0021] As a further improvement of the technical solution, in S2.1, the pressure covariance propagation graph is constructed, including the following steps:
[0022] S2.11, divide the high-frequency collected pressure sequence into time windows according to a unified prediction period, and pre-process the pressure sequence in each time window to obtain the pressure change sequence of each node in the period;
[0023] S2.12, calculate the pressure change covariance between all node pairs (i, j) using the pressure change sequence of each node in each time window to form a covariance matrix;
[0024] S2.13, based on the pipeline structure parameters and the sound speed of the gas, calculate the pressure wave propagation delay from node i to j;
[0025] S2.14, delay compensation for the covariance matrix, align the pressure change sequence with the pressure wave propagation delay using the sliding window technology, and construct the delay-aligned covariance propagation graph;
[0026] S2.15, convert the delay-aligned covariance propagation graph into a gray-scale graph format to form a spatial two-dimensional feature map.
[0027] As a further improvement of the technical solution, in S2.14, the delay compensation for the covariance matrix, the pressure change sequence with the propagation delay is aligned using the sliding window technology, and the delay-aligned covariance propagation graph is constructed, including the following steps:
[0028] S2.141, real-time collect pressure change sequence from multiple pipe network nodes to construct an original time sequence matrix;
[0029] S2.142, set the length of the sliding window, the sliding step, and define the maximum propagation delay;
[0030] S2.143, for any two nodes i, j, extract the corresponding local time series in each sliding window, calculate the cross-correlation function of its pressure change sequence, take the lag time corresponding to the maximum cross-correlation as the propagation delay estimate, and construct the propagation delay matrix;
[0031] S2.144, in each sliding window, adjust the time series of j for each pair of nodes i, j to delay alignment;
[0032] S2.145, in each sliding window, recalculate the inter-node covariance matrix for the set of delay-aligned time series;
[0033] S2.146, consider the covariance matrix as the adjacency matrix of the graph at the sliding window time, and construct the time series graph, i.e. the covariance propagation graph.
[0034] As a further improvement of the technical solution, in S2.5, the demand pre-perception model based on pressure covariance propagation is trained using the training set, including the following steps:
[0035] S2.51, align the constructed two-dimensional spatial feature map with the time periodicity feature and splice it into a joint input set;
[0036] S2.52, construct a demand pre-perception model based on CNN-LSTM structure;
[0037] Wherein, the CNN module is used to extract the spatial correlation features in the two-dimensional spatial feature map, the LSTM module is used to model the time features, capture the trend and periodicity of the gas consumption over time, the multi-modal fusion layer integrates the spatial correlation features and time features extracted by the CNN module and the LSTM module to form a unified high-dimensional representation, and the output layer adopts a fully connected network to output the gas demand prediction value in the future multiple time periods;
[0038] S2.53, send the joint input set in the training set into the demand pre-perception model for training.
[0039] As a further improvement of the technical solution, in S2.6, the gas demand prediction value sequence output by the demand pre-perception model is decoupled and corrected based on physical pressure conduction, including the following steps:
[0040] S2.61, extract the gas consumption prediction value in the future K time periods from the demand pre-perception model output;
[0041] S2.62, for each downstream node, in each prediction period, deduct the false demand component conducted by the upstream node;
[0042] S2.63, output the corrected gas consumption prediction value as the final future gas consumption prediction result.
[0043] As a further improvement of the technical solution, in S3, a multi-node gas flow distribution optimization model is constructed, including the following steps:
[0044] S3.1, minimize system energy consumption, suppress node pressure fluctuation, maximize gas demand satisfaction under supply-demand balance constraints, and maximize dynamic energy consumption of friction-flow rate as optimization target;
[0045] S3.2, integrate the above optimization targets into a comprehensive objective function through multi-objective weighting, and introduce a flow rate-dependent weight function to dynamically adjust the proportion of friction energy consumption in the target;
[0046] S3.3, construct the constraint conditions of the optimization target, including flow conservation constraint, pipeline flow physical constraint, and node pressure constraint;
[0047] S3.4, form a multi-node gas flow distribution optimization model according to the optimization target and constraint conditions.
[0048] As a further improvement of the technical solution, in S3, the multi-node gas flow distribution optimization model is solved by sequential quadratic programming algorithm to obtain the optimized flow distribution strategy and control parameters, including the following steps:
[0049] S3.5, set the initial optimization variables and corresponding flow rates, calculate the initial friction coefficient μ (0) based on the initial flow rate, and set the iteration counter, convergence threshold c, and maximum iteration number k max , wherein the optimization variables include flow distribution Y (0) , node pressure P (0) ;
[0050] S3.6, based on the current iteration point (including Y (k) , P (k) ), linearize and approximate the comprehensive objective function to construct the SQP subproblem of this round;
[0051] S3.7, use a quadratic programming solver to solve the SQP subproblem of the current iteration to obtain the optimization variables under the current iteration, calculate the corresponding flow rate v (k+1) , and update the friction coefficient μ (k+1) , wherein k is the iteration number;
[0052] S3.8, judge whether the optimization variables converge based on the convergence threshold c;
[0053] S3.9, returning the final converged optimization variables, wherein the final converged optimization variables include optimized flow distribution and node pressure.
[0054] As a further improvement of the technical solution, in the S4, the flow distribution strategy is parsed to generate control parameters, and the control parameters are issued to the control center, including the following steps:
[0055] S4.1, receiving the optimization variables and parsing the key control parameters;
[0056] S4.2, generating a compressor operation scheduling scheme according to the node pressure setting and the corresponding pressure difference requirement, and issuing the power target and control instruction of each compressor;
[0057] S4.3, based on the target flow of each pipe section and the predicted pressure drop, calculating the required opening of each regulating valve and issuing the calculated opening instruction to the control center;
[0058] S4.4, setting the regulation strategy update period according to the gas demand change frequency and the equipment response ability.
[0059] On the other hand, the present application provides a natural gas transmission flow dynamic optimization control system, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to realize the natural gas transmission flow dynamic optimization control method of any one of the above.
[0060] Compared with the prior art, the present application has the following advantages:
[0061] 1、The present application constructs a pressure covariance propagation diagram, which integrates the physical propagation characteristics of high-frequency pressure fluctuations in the pipe network into the demand prediction model. Through the delay alignment technology, the model can capture the pressure wave signals that propagate in the reverse direction along the pipe network due to the changes in downstream gas behavior, so as to "pre-perceive" the demand before the flow change occurs. Combined with the deep mining of spatiotemporal characteristics by the CNN-LSTM multi-modal structure, and the decoupling correction mechanism after prediction, this method can effectively distinguish between real demand fluctuations and pressure conduction artifacts. Compared with traditional statistical models that rely on historical data, it has stronger predictability and robustness when dealing with load mutations, providing a longer time window and higher quality data input for scheduling decisions.
[0062] 2、The application breaks through the traditional control mode based on fixed pressure setting or local optimization, and establishes a global optimization model containing system energy consumption, pressure stability, supply-demand balance and other multi-dimensional. In particular, the model introduces a flow rate dependent weight function to dynamically evaluate and optimize the pipe friction energy consumption, and efficiently solves the complex nonlinear problem through the sequential quadratic programming (SQP) algorithm. This method can intelligently coordinate and control the valve opening under the premise of ensuring the safety of the whole network pressure and meeting the user's demand, and find the operation strategy with the minimum total energy consumption. This not only directly reduces the transmission and distribution cost, meets the low-carbon operation requirement under the "double carbon" target, but also improves the gas supply quality and equipment operation life by suppressing unnecessary pressure fluctuations, and realizes the refinement and economy of the pipe network operation. BRIEF DESCRIPTION OF DRAWINGS
[0063] Figure 1 The overall method flowchart of the application. DETAILED DESCRIPTION
[0064] The technical solutions in the embodiments of the application will be clearly and completely described below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are only part of the embodiments of the application, not all embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the application.
[0065] Embodiment 1: Please refer to Figure 1 The embodiment provides a natural gas conveying flow dynamic optimization control method, which comprises the following steps:
[0066] S1, collecting the operation parameters (including pressure, flow, temperature, compressor power) of the natural gas pipeline, the historical gas consumption quantity (by hour / day) of the user end and the weather forecast data (temperature, humidity, wind speed), and performing missing value filling, outlier elimination and time alignment and other preprocessing operations on the above data to ensure data quality;
[0067] S2, based on the historical gas consumption quantity and the weather forecast data, predicting the natural gas consumption demand of the user end in the future multiple time periods through a long short-term memory (LSTM) model;
[0068] In this embodiment, the long short-term memory (LSTM) model is used to predict the natural gas consumption demand of the user end in the future multiple time periods, which comprises the following steps:
[0069] S2.1, construct a feature variable matrix and a target variable (i.e., the natural gas consumption in each period in the future) based on historical gas consumption and weather forecast data corresponding to the period, and collect high-frequency pressure signals (second / minute level), record pipeline physical parameters (gas composition, temperature, pipe material), at the same time, construct a pressure covariance propagation graph to depict the coupling strength and conduction path of pressure changes between nodes;
[0070] Wherein, in the natural gas transmission and distribution pipeline network, the pressure wave propagation has significant space-time delay effect, which causes the pressure changes of different nodes to be coupled with each other, forming a false demand signal. The traditional prediction model only relies on historical gas consumption data and static meteorological factors, and cannot capture the dynamic propagation characteristics of the pressure wave in the pipeline network (such as the pressure wave conduction path, the coupling strength between nodes, and the time delay effect). Especially in a multi-node complex pipeline network, the pressure fluctuation of the downstream node contains the interference of the upstream conduction, rather than the real gas demand change, which causes the predicted value to deviate from the actual load demand, affecting the accuracy of the optimization control. This problem is particularly prominent under load mutation or extreme weather, which exacerbates the risk of supply and demand imbalance and the instability of system regulation; by constructing a delay-aligned covariance propagation graph (S2.14) through high-frequency pressure signals, calculating the pressure wave propagation time delay (S2.13) combined with the sound velocity and topological structure of the pipeline, and dynamically estimating the lag time between nodes (S2.143) using the cross-correlation function, the problem of ignoring the physical law of pressure conduction in the traditional model is solved; the sliding window technology is used to dynamically align the node pressure sequence (S2.144), eliminating the space-time misalignment caused by propagation delay, so that the covariance matrix more truly reflects the physical propagation path of the pressure wave (S2.145); the covariance graph is converted into a two-dimensional spatial feature graph (S2.15), which is input into the CNN-LSTM model (S2.52) after being spliced with the time series features, to simultaneously capture the spatial correlation of the pipeline network and the time sequence law of the gas consumption behavior, breaking through the limitations of a single data modality;
[0071] The pressure covariance propagation graph is constructed, including the following steps:
[0072] S2.11, divide the high-frequency collected pressure sequence into time windows according to a unified prediction period (such as every 15 minutes), and pre-process the pressure sequence in each time window (normalization and smoothing processing, and eliminate incidental measurement noise) to obtain the pressure change sequence of each node in the period;
[0073] S2.12, calculate the pressure change covariance between all node pairs (i, j) (node j is the downstream node of node i) using the pressure change sequence of each node in each time window, to form a covariance matrix;
[0074] The covariance matrix Cov(i, j) is (this matrix reflects the pressure linkage strength between nodes, and is a preliminary quantification basis for pressure conduction direction and influence):
[0075]
[0076] where t is time, T is the total number of time steps (sample length) within a certain time window, is the pressure change of node i at time t, ΔP i (t) = P i (t) - P i (t-1), is the mean of pressure change sequence of node i within the window, ΔP j (t) is the pressure change of node j at time t, ΔP j (t) = P j (t) - P j (t-1), is the mean of pressure change sequence of node j within the window (here the mean is the mean before alignment);
[0077] S2.13, based on pipeline structure parameters and gas sound speed, calculate the pressure wave propagation delay τ from node i to j ij where c1 is the sound speed in gas, d ij is the physical distance from node i to j (according to the pipeline topology);
[0078] S2.14, delay compensation for the covariance matrix, align the pressure change sequence with pressure wave propagation delay using sliding window technology, so as to improve the spatio-temporal consistency of the covariance, and construct the delay-aligned covariance propagation graph, which more truly reflects the physical propagation path and sequence of the pressure wave;
[0079] Further, delay compensation for the covariance matrix, align the pressure change sequence with propagation delay using sliding window technology, and construct the delay-aligned covariance propagation graph, including the following steps:
[0080] S2.141, real-time acquisition of pressure change sequence from multiple pipe network nodes, construction of original time sequence matrix R(t), R(t) = [P1(t), P2(t), …, P N (t)] TL , where P a (t) is the pressure value of the a-th node at time t, N is the total number of pipe network nodes, and TL is the transpose operation;
[0081] S2.142, set the sliding window length T w , the sliding step Δt, and define the maximum propagation delay L;
[0082] S2.143、for any two nodes i, j, extract the corresponding local time series within each sliding window Calculate the cross-correlation function of its pressure change series, take the maximum cross-correlation corresponding to the lag time As the propagation delay estimate value And build a propagation delay matrix E,
[0083] Where the cross-correlation function is:
[0084]
[0085] In the formula, E ij (τ) is the cross-correlation function value of the pressure change series of nodes i, j at lag τ, τ is the pressure wave propagation delay, unit is time step; ΔP i (t) is the pressure change amount of node i at time t, is the mean value of the pressure change series of node i within the window.
[0086] S2.144, in each sliding window, for each pair of nodes i, j, adjust the pressure change time series of j to be delay-aligned;
[0087] The delay alignment is specifically:
[0088]
[0089] In the formula, is the pressure change amount of node j at time After alignment value;
[0090] S2.145, in each sliding window, recalculate the inter-node covariance matrix for the delay-aligned pressure change time series set;
[0091] The recalculated inter-node covariance matrix is:
[0092]
[0093] In the formula, is the mean value of the aligned pressure change series of node j, Cov ali (i, j) is the delay-aligned covariance matrix;
[0094] The delay-aligned covariance matrix C kv is:
[0095] Ckv = [Cov ali (i, j)] N×N ;
[0096] In the formula, kv is the index of the sliding window;
[0097] S2.146. Treat the covariance matrix as the adjacency matrix of the graph at the sliding window time, and construct the time series graph G, i.e., the covariance propagation graph. The nodes in the diagram represent network nodes, and the edge weights represent the aligned covariance values. In the formula, K... cov The length of the covariance matrix sequence;
[0098] S2.15. Convert the delayed-aligned covariance propagation map into a grayscale image format to form a spatial two-dimensional feature map (each pixel (i, j) represents the covariance value between node i and j).
[0099] S2.2 Use the sliding window method to generate gas consumption sequences for the past n time periods as historical sequence features, and extract time periodic features (including hours, days, workdays / holidays, solar terms, seasons, etc.) as current sequence features to reflect the temporal pattern of gas consumption behavior;
[0100] S2.3. Considering the lag effect of temperature (characterizing the average value of the first 3 hours), construct a combination variable of wind chill index (feeling temperature);
[0101] S2.4 Divide historical gas consumption data, weather forecast data, and high-frequency pressure data collected within the corresponding time period into training set, validation set, and test set in chronological order. The training set, validation set, and test set are divided in a ratio of 7:2:1 to ensure the model's generalization ability in the time dimension.
[0102] S2.5. Use the training set to train the demand pre-sensing model based on pressure covariance propagation in order to capture the time-dependent features of gas consumption changes.
[0103] The training of the demand pre-perception model based on pressure covariance propagation using the training set includes the following steps:
[0104] S2.51 Align the constructed spatial two-dimensional feature map (i.e., the covariance propagation map grayscale sequence) with the time periodic features and concatenate them into a joint input set;
[0105] S2.52, Construct a demand pre-perception model based on CNN-LSTM structure;
[0106] The demand pre-awareness model includes a CNN module, an LSTM module, a multimodal fusion layer, and a fully connected output layer.
[0107] The CNN module is used to extract spatial correlation features in a spatial two-dimensional feature map, the LSTM module is used to model time features, capture the trend and periodic change of gas consumption over time, the multi-modal fusion layer integrates the spatial correlation features and time features extracted by the CNN module and the LSTM module to form a unified high-dimensional representation, and the full connection output layer adopts a full connection network to output gas consumption prediction values in future time periods;
[0108] Specifically, the spatial features output by the CNN are spliced with the time features output by the LSTM, and are mapped to a 256-dimensional high-dimensional representation through a full connection layer;
[0109] The output layer is a full connection regression layer, and the gas consumption prediction values in future K (such as 6 or 24) time periods are output;
[0110] The model adopts an Adam optimizer (learning rate 0.001), the loss function is mean square error (MSE), the batch size is 64, and the training is performed for 200 rounds;
[0111] S2.53, the joint input set in the training set is sent into the demand pre-perception model for training;
[0112] S2.6, after the training is completed, the gas demand prediction value sequence output by the demand pre-perception model is decoupled and corrected based on physical pressure conduction;
[0113] Further, in the operation of the natural gas pipeline network, the pressure fluctuation of the downstream node often contains false demand signals (such as pressure wave propagation caused by compressor start-stop and valve adjustment) conducted from the upstream, causing the prediction model to misjudge the physical conduction noise as real gas demand change. Traditional prediction methods (such as pure LSTM models) lack the ability to analyze the physical coupling mechanism of the pipeline network, and cannot distinguish between local real demand and upstream conduction interference, especially in multi-node and long-distance transmission and distribution scenarios. The false demand component will significantly distort the prediction results (such as the pressure fluctuation of the upstream being amplified as a surge in downstream demand during a cold wave), and further cause a chain deviation in optimization control, resulting in over-regulation of compressors, frequent operation of valves, and imbalance between supply and demand risks. The decoupling correction mechanism directly addresses the core pain point of the distortion of real demand caused by pipeline pressure conduction interference, and through the cooperation of physical rules and data prediction, it quantifies and removes the implicit coupling noise in traditional models. Its core value lies in building a “prediction-correction” closed loop, which not only corrects the output deviation of the demand pre-perception model, but also provides physically reliable input for subsequent multi-objective optimization (S3);
[0114] Physical pressure conduction refers to the physical phenomenon that pressure disturbances caused by local pressure changes (such as compressor start-stop, valve adjustment or user gas fluctuation) propagate along the pipeline in the form of pressure waves in a closed pipeline system. Its essence is the process of gas molecular momentum transfer and energy diffusion: when a node experiences a sudden pressure change, the adjacent gas layer is compressed to form a high-pressure area, which pushes the downstream gas to move, and the disturbance spreads to other nodes of the pipeline network at the speed of sound, causing the passive change of the pressure value of the non-disturbance source node. This conduction can mask the real demand of the node (such as the decrease of downstream pressure caused by the closing of upstream valve, rather than the increase of local gas consumption), which is the core physical feature of the multi-node coupled operation of the pipeline network;
[0115] Based on the physical pressure conduction, the gas demand prediction value sequence output by the demand pre-perception model is decoupled and corrected, including the following steps:
[0116] S2.61, extracting the gas consumption prediction value of the future K time periods from the demand pre-perception model output In the formula, is the gas consumption prediction value of node j;
[0117] S2.62, for each downstream node, in each prediction period, deduct the false demand component conducted by the upstream node;
[0118] The calculation formula for deducting the false demand component conducted by the upstream node is:
[0119]
[0120] In the formula, is the corrected gas consumption prediction value, Up(j) is the set of upstream nodes that have a direct connection (physical or scheduling transmission path) with node j, is the original prediction of the upstream node, k ij is the conduction coefficient (conduction correction coefficient obtained by training historical operation data and pipeline network simulation model), Var(ΔP i ) represents the variance of the historical pressure change ΔP i of node i;
[0121] S2.63, output the corrected gas consumption prediction value as the final future gas consumption prediction result.
[0122] S2.7, according to the set prediction period (future 6 hours / 24 hours), input the historical sequence features, current sequence features, combined variables and corresponding pressure covariance propagation diagram into the trained demand pre-perception model, and output the gas demand prediction value sequence of each prediction period in the future (the gas demand prediction value sequence of each prediction period in the future is decoupled and corrected).
[0123] S3, based on the prediction result, constructing a multi-node gas flow distribution optimization model, and solving the multi-node gas flow distribution optimization model by a sequential quadratic programming algorithm to obtain an optimized flow distribution strategy;
[0124] In this embodiment, the multi-node gas flow distribution optimization model is constructed, including the following steps:
[0125] S3.1, minimizing the system energy consumption, suppressing the node pressure fluctuation, maximizing the gas demand satisfaction degree under the supply-demand balance constraint, and taking the dynamic friction-flow energy consumption as the optimization target;
[0126] S3.2, integrating the above optimization targets into a comprehensive objective function by a multi-objective weighting method, and introducing a flow rate dependent weight function to dynamically adjust the proportion of friction energy consumption in the target;
[0127] The comprehensive objective function is:
[0128] minJ = δ1J1 + δ2J2 - δ3J3 + δ4J4;
[0129]
[0130]
[0131] In the formula, J represents the comprehensive objective function of the entire optimization problem, J1 is the system energy consumption minimization target item, J2 is the node pressure fluctuation suppression target item, J3 is the gas demand satisfaction degree target item (maximization), J4 is the dynamic friction-flow energy consumption item, ΔP ij is the pressure difference between the two ends of the pipe section, Q ij is the gas flow from node i to node j (unit: time), P j (t) is the actual pressure value of node j at time t, G ij is the dimensionless correction coefficient, M is the set of pipe network nodes, is the actual gas demand satisfied by node j at time t, f ij (v ij ) is the flow rate dependent weight function (reflecting the importance of friction), which changes with Reynolds number based on the Darcy-Weisbach formula, U is the pipe length, H is the pipe diameter (unit: m), A is the pipe cross-sectional area, unit: m 2 , ρ is the density of natural gas, unit: kg / m 3 , δ1 is the weight coefficient of total gas energy consumption, δ2 is the weight coefficient of pressure fluctuation suppression, δ3 is the weight coefficient of supply-demand satisfaction degree (maximization), δ4 is the weight coefficient of dynamic friction energy consumption, is the average pressure value of node j in the entire cycle, L maxis a set of all pipe segments.
[0132] S3.3, constraints of the optimization objective are constructed, including flow conservation constraint (inflow-outflow of a node = its net gas consumption (i.e. gas used-gas supplied); that is, to ensure the mass conservation of gas in the pipe network, to meet the basic physical requirements of supply and demand balance), pipe flow physical constraint (there is a nonlinear physical relationship between the flow and pressure of gas in the pipe, which contains the dynamic friction effect in the process of fluid flow. The model requires that the flow and pressure on all pipe segments meet this nonlinear relationship, in addition, in order to ensure the safety and efficiency of gas transmission, the flow rate of gas in the pipe needs to be maintained within a reasonable preset range to avoid safety hazards or increased energy consumption caused by excessively high or low flow rate), node pressure constraint (the pressure changes due to the friction caused by the gas flow in the pipe, the model dynamically adjusts the upper and lower limits of the pressure of each node. By considering the pressure drop change caused by friction, the allowed range of node pressure is corrected in real time to prevent abnormal fluctuation of pressure and ensure the stable operation of the system and the safety and reliability of equipment);
[0133] S3.4, a multi-node gas transmission flow distribution optimization model is formed according to the optimization objective and the constraint condition.
[0134] Further, the natural gas pipe network flow distribution needs to coordinate the strong nonlinear friction effect (pressure drop and flow rate are in square relationship) and the multi-objective conflict (minimization of energy consumption vs. suppression of pressure fluctuation). Due to the fixed friction coefficient assumption (ignoring the dynamic influence of flow rate change on friction) and static weight distribution, the traditional SQP algorithm leads to two problems: when the flow rate is high, the nonlinear friction is intensified, the fixed linearization point makes the iteration deviate from the true physical constraint, causing pressure overrun or convergence failure; when the flow rate is low, the friction energy consumption is excessively optimized and the pressure stability is ignored, and when the flow rate is high, the reverse deviation occurs, making it difficult to dynamically balance the system safety and economy;
[0135] The sequence quadratic programming algorithm recalculates the friction coefficient based on the current flow rate in each iteration, which replaces the traditional fixed linearization model (such as Darcy-Weisbach formula) to real-time fit the physical reality; through the closed-loop update of flow rate to friction coefficient to constraint linearization (S3.7), the model drift problem caused by static approximation in traditional SQP is solved;
[0136] The optimized flow distribution strategy and control parameters are obtained by solving the multi-node gas transmission flow distribution optimization model through the sequence quadratic programming algorithm, including the following steps:
[0137] S3.5, set the initial optimization variables and the corresponding flow rate, calculate the initial friction coefficient μ based on the initial flow rate (0) , and set the iteration counter, convergence threshold c, and maximum iteration number k max , wherein the optimization variables include flow distribution Y (0), node pressure P (0) ;
[0138] S3.6, linearize the integrated objective function (using Darcy-Weisbach formula) based on the current iteration point (including Y (k) , P (k) ), and construct the SQP sub-problem of this round, which includes: taking the current flow and pressure as the linearization point, using first-order Taylor expansion or other linear approximation techniques to locally linearize the nonlinear terms (such as the relationship between pressure drop and flow square); further converting the originally nonlinear constraints into approximately linear form as the constraint conditions of the current SQP sub-problem, ensuring that the problem can be processed by the quadratic programming solver under the current iteration, and this linearized sub-problem is used to solve the flow and pressure update values of the current step to provide input for the next iteration;
[0139] S3.7, solve the SQP sub-problem of the current iteration using a quadratic programming (QP) solver to obtain the optimized variables (including flow distribution Y (k+1) , node pressure P (k+1) ) of the current iteration, and calculate the corresponding flow rate v (k+1) , update the friction coefficient μ (k+1 ), where k is the iteration number. In each iteration, first calculate the flow rate of each pipe segment based on the current flow distribution, and update the friction coefficient according to the flow rate, Reynolds number, and pipe wall roughness, etc. to ensure that it reflects the latest physical state; then, substitute the updated friction coefficient into the linearized model of the pressure-flow nonlinear constraint to construct the current SQP sub-problem, and obtain the search direction of the optimized variables through the quadratic programming solver; then perform line search to determine the appropriate step size to ensure that the objective function is descending and the constraints are satisfied; finally, update the flow distribution and node pressure to enter the next iteration, thereby ensuring that each step of optimization is based on accurate friction characteristics, improving the solution accuracy and convergence stability;
[0140] S3.8, judge whether the optimized variables converge based on the convergence threshold c, specifically: after each iteration is completed, compare the change amplitude of the current optimized variables (including flow distribution and node pressure) with the previous round results, calculate the norm of the change, if the change amplitude is less than the preset convergence threshold c, it is considered that the optimization process has converged, terminate the iteration and output the final optimization result; otherwise, if the maximum iteration number has not been reached, continue the next iteration, update the variables and repeat the above judgment until the iteration number k max ;
[0141] S3.9, return the final converged optimized variables, wherein the final converged optimized variables include the optimized flow distribution and node pressure.
[0142] S4, analyze the flow distribution strategy to generate control parameters, and distribute the control parameters to the control center for controlling the compressor operation strategy and adjusting the valve opening to realize dynamic adjustment of the natural gas transmission process;
[0143] In this embodiment, the control parameters generated by analyzing the flow distribution strategy are distributed to the control center, including the following steps:
[0144] S4.1, receive the optimization variables and analyze the key control parameters, including the set pressure difference of each compressor, the target opening of each regulating valve, and the target flow rate of each gas transmission main;
[0145] S4.2, generate a compressor operation scheduling scheme according to the node pressure setting and the corresponding pressure difference requirement (distinguish the pipe sections that need to maintain constant pressure control or constant flow control, select the corresponding control mode, for the constant pressure mode, distribute the working pressure difference of each compressor and calculate the target power according to the pressure targets of the upstream and downstream nodes, for the constant flow mode, calculate the pressure gain required by the compressor according to the target flow rate), and distribute the power target and control instruction of each compressor;
[0146] S4.3, based on the target flow rate of each pipe section and the predicted pressure drop, calculate the required opening of each regulating valve and distribute the calculated opening instruction to the control center (i.e. the regulating valve control module), and the control center adjusts the valve opening in real time to prioritize the stability of gas supply to high-priority nodes;
[0147] S4.4, set the control strategy update period according to the gas demand change frequency and the equipment response capability, i.e. the hourly scheduling: update the optimization and distribution once an hour.
[0148] Embodiment 2: The natural gas transmission flow dynamic optimization control system provided in this embodiment includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the computer program to realize the natural gas transmission flow dynamic optimization control method described in any one of the above embodiments.
[0149] The above shows and describes the basic principles, main features and advantages of the present application. Those skilled in the art should understand that the present application is not limited to the above embodiments, and the above embodiments and descriptions in the specification are only preferred examples of the present application and are not intended to limit the present application. Without departing from the spirit and scope of the present application, various changes and improvements can be made to the present application, and these changes and improvements all fall within the scope of the claimed present application.
Claims
1. A method for dynamic optimization control of natural gas delivery flow, the method comprising: The method comprises the following steps: S1, collecting the operating parameters of the natural gas pipeline, the historical gas consumption quantity of the user end and the weather forecast data; S2, based on the historical gas consumption quantity and the weather forecast data, predicting the natural gas consumption demand of the user end in multiple future time periods through a long short-term memory model; S3, based on the prediction result, constructing a multi-node gas flow distribution optimization model, and solving the multi-node gas flow distribution optimization model through a sequential quadratic programming algorithm to obtain an optimized flow distribution strategy; S4, analyzing the flow distribution strategy to generate control parameters, and issuing the control parameters to a control center for controlling the compressor operation strategy and the valve opening degree.
2. The natural gas delivery flow dynamic optimization control method of claim 1, wherein: In the S2, the natural gas consumption demand of the user end in multiple future time periods is predicted through a long short-term memory model, which comprises the following steps: S2.1, based on the historical gas consumption quantity and the weather forecast data of the corresponding time period, constructing a feature variable matrix and a target variable, collecting high-frequency pressure signals, recording pipeline physical parameters, and constructing a pressure covariance propagation diagram; S2.2, using a sliding window method to generate a gas consumption sequence of n past time periods as a historical sequence feature, and extracting a time periodicity feature as a current sequence feature to reflect the time sequence rule of the gas consumption behavior; S2.3, considering the hysteresis effect of temperature, constructing a combination variable of wind and cold; S2.4, dividing the historical gas consumption quantity, the weather forecast data and the high-frequency pressure data collected in the corresponding time period into a training set, a validation set and a test set in chronological order; S2.5, using the training set to train the demand pre-perception model based on the pressure covariance propagation to capture the time sequence dependence feature of the gas consumption change; S2.6, after the training is completed, decoupling and correcting the gas consumption demand prediction value sequence output by the demand pre-perception model based on the physical pressure conduction; S2.7, according to the set prediction period, inputting the historical sequence feature, the current sequence feature, the combination variable and the corresponding pressure covariance propagation diagram into the trained demand pre-perception model to output the gas consumption demand prediction value sequence of each prediction time period in the future.
3. The natural gas delivery flow dynamic optimization control method of claim 2, wherein: In the S2.1, the pressure covariance propagation diagram is constructed, which comprises the following steps: S2.11, dividing the high-frequency collected pressure sequence into time windows according to a unified prediction period, preprocessing the pressure sequence in each time window to obtain the pressure change sequence of each node in the period; S2.12, using the pressure change sequence of each node in each time window, calculating the pressure change covariance between all node pairs (i, j) to form a covariance matrix; S2.13, based on the pipeline structure parameters and the sound speed of the gas, calculating the pressure wave propagation delay from node i to j; S2.14, compensating the covariance matrix for delay, aligning the pressure change sequence with the pressure wave propagation delay by using the sliding window technology, and constructing the delay-aligned covariance propagation diagram; S2.15, converting the delay-aligned covariance propagation diagram into a grayscale format to form a spatial two-dimensional feature map.
4. The natural gas delivery flow dynamic optimization control method of claim 3, wherein: In S2.14, the covariance matrix is compensated for delay, the pressure change sequence with propagation delay is aligned using the sliding window technique, and the delay-aligned covariance propagation graph is constructed, including the following steps: S2.141, real-time acquisition of pressure change sequence from multiple pipe network nodes, construction of original time series matrix; S2.142, set the sliding window length, sliding step, and define the maximum propagation delay; S2.143, for any two nodes i, j, extract the corresponding local time series in each sliding window, calculate the cross-correlation function of the pressure change sequence, take the lag time corresponding to the maximum cross-correlation as the propagation delay estimate, and construct the propagation delay matrix; S2.144, in each sliding window, adjust the time series of j to be delay-aligned for each pair of nodes i, j; S2.145, in each sliding window, recalculate the inter-node covariance matrix for the delay-aligned time series set; S2.146, consider the covariance matrix as the adjacency matrix of the graph at the sliding window time, and construct the time series graph, i.e. the covariance propagation graph.
5. The natural gas delivery flow dynamic optimization control method of claim 2, wherein: In S2.5, the demand pre-perception model based on pressure covariance propagation is trained using the training set, including the following steps: S2.51, align the constructed two-dimensional spatial feature map with the time periodicity feature, and splice it into a joint input set; S2.52, construct a demand pre-perception model based on CNN-LSTM structure; Wherein, the CNN module is used to extract the spatial correlation features in the two-dimensional spatial feature map, the LSTM module is used to model the time features, capture the trend and periodicity of the gas consumption over time, the multi-modal fusion layer integrates the spatial correlation features and time features extracted by the CNN module and the LSTM module to form a unified high-dimensional representation, and the output layer adopts a fully connected network to output the gas demand prediction value in the future multiple time periods; S2.53, input the joint input set in the training set into the demand pre-perception model for training.
6. The natural gas delivery flow dynamic optimization control method of claim 2, wherein: In S2.6, the gas demand prediction value sequence output by the demand pre-perception model is decoupled and corrected based on physical pressure conduction, including the following steps: S2.61, extract the gas consumption prediction value in the future K periods from the demand pre-perception model output; S2.62, for each downstream node, deduct the false demand component conducted by the upstream node in each prediction period; S2.63, output the corrected gas consumption prediction value as the final future gas consumption prediction result.
7. The natural gas delivery flow dynamic optimization control method of claim 1, wherein: In S3, a multi-node gas flow distribution optimization model is constructed, including the following steps: S3.1, minimize system energy consumption, maximize gas demand satisfaction under node pressure fluctuation suppression and supply-demand balance constraints, and set the dynamic energy consumption of friction-flow rate as the optimization target; S3.2, integrate the above optimization targets into a comprehensive objective function through multi-objective weighting, and introduce a flow rate-dependent weight function to dynamically adjust the proportion of friction energy consumption in the target; S3.3, construct the constraint conditions of the optimization target, including flow conservation constraint, pipe flow physical constraint, and node pressure constraint; S3.4, forming a multi-node gas flow distribution optimization model according to the optimization target and the constraint condition.
8. The natural gas delivery flow dynamic optimization control method of claim 1, wherein: In the S3, the multi-node gas flow distribution optimization model is solved by a sequential quadratic programming algorithm to obtain an optimized flow distribution strategy and control parameters, including the following steps: S3.5, set initial optimization variables and corresponding flow rates, calculate initial friction factor μ according to initial flow rates (0) , and set iteration counter, convergence threshold c, maximum iteration number k max , wherein the optimization variables include flow distribution Y (0) , node pressure P (0) ; S3.6, linearizing and approximating the comprehensive objective function based on the current iteration point to construct an SQP sub-problem of this round; S3.7, solve the SQP sub-problem of the current iteration by using a quadratic programming solver to obtain the optimized variables of the current iteration, and calculate the corresponding flow rate v (k+1) , update the friction coefficient μ (k+1) , where k is the iteration number; S3.8, judging whether the optimization variables converge based on a convergence threshold c; S3.9, returning the finally converged optimization variables, wherein the finally converged optimization variables include the optimized flow distribution and node pressure.
9. The natural gas delivery flow dynamic optimization control method of claim 1, wherein: In the S4, the flow distribution strategy is analyzed to generate control parameters, and the control parameters are issued to a control center, including the following steps: S4.1, receiving the optimization variables and analyzing key control parameters; S4.2, generating a compressor operation scheduling scheme according to the node pressure setting and the corresponding differential pressure requirement, issuing the power target and control instruction of each compressor; S4.3, calculating the required opening of each regulating valve based on the target flow of each pipe section and the predicted pressure drop, and issuing the calculated opening instruction to the control center; S4.4, setting a regulation strategy update period according to the gas demand change frequency and the equipment response capability.
10. A dynamic optimization control system for natural gas transmission flow, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: The processor executes a computer program to implement the natural gas transportation flow dynamic optimization control method of any one of claims 1-9.