Online abnormity early warning and unbalance calculation method and system for gas pipe network

By collecting and preprocessing time-series data in the chemical gas pipeline network system, and using mechanistic models and multi-model early warning mechanisms for anomaly detection, the problems of missing flow meters and complex calculations have been solved, achieving efficient pipeline network monitoring and control.

CN121474497APending Publication Date: 2026-02-06SUPCON TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511640281.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-11
Publication Date
2026-02-06

AI Technical Summary

Technical Problem

Existing technologies in chemical gas pipeline systems suffer from problems such as distorted measurement results due to the lack of flow meters, complex calculations that cannot meet real-time requirements, delayed early warnings, and lack of feedback correction, resulting in low pipeline monitoring accuracy and control efficiency.

Method used

By collecting time-series data from the production and consumption ends of the gas pipeline network system, preprocessing the data, calculating the pipeline capacity time-series data using a mechanistic model, and combining trend prediction models and statistical methods for anomaly detection, early warning information and imbalance quantities are generated, and open-loop correction and closed-loop control are introduced.

Benefits of technology

It enables rapid calculation of pipe capacity and imbalance, integrates a multi-model early warning mechanism, overcomes the problems of missing flow meters, complex calculations and delayed early warning, and significantly improves the accuracy of pipeline network monitoring and control efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121474497A_ABST
    Figure CN121474497A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of early warning, in particular to an online abnormity early warning and unbalance calculation method and system for a gas pipe network, and the method comprises the steps: collecting time sequence data of the production end and the consumption end of a gas pipe network system, and carrying out the preprocessing; calculating the preprocessed time sequence data based on a pre-constructed mechanism model to obtain pipe capacity time sequence data of the pipe network system, and calculating the amount of unbalance of the pipe network system based on the pipe capacity time sequence data; and on the basis of a pre-constructed trend prediction model and a statistical method, performing anomaly detection on the pipe capacity time sequence data to obtain an anomaly detection result, generating early warning information according to the anomaly detection result, outputting an unbalance amount, and regulating and controlling the gas pipe network system. According to the method, the pipe capacity and the unbalance amount are rapidly calculated through the mechanism model, a multi-model early warning mechanism is fused, open-loop correction and closed-loop control are introduced, the problems of flowmeter deficiency, calculation complexity, early warning lag and no feedback correction are effectively solved, and the pipe network monitoring precision and the regulation and control efficiency are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of early warning, and in particular to an online abnormal early warning and imbalance quantity calculation method and system for a gas pipe network. BACKGROUND

[0002] In a modern chemical gas pipe network system, real-time and accurate calculation of pipe storage and imbalance quantity is the key to ensuring stable pressure and safe production of the pipe network. However, the existing technical solutions have obvious limitations: first, the traditional imbalance quantity calculation relies heavily on the cumulative data of flow meters at all nodes on the production and consumption ends, but in actual complex pipe networks, the absence of key data due to the absence of flow meters in some branches or temporary instrument failures can cause the calculation results to be distorted. Second, the use of differential equations or partial differential equations to calculate pipe storage not only has a complex model and a large amount of calculation, but also is prone to failure in solving rigid equations due to differences in pipe working conditions, making it difficult to meet real-time requirements. Third, the existing abnormal early warning methods mostly use static threshold methods, which cannot adapt to the dynamic changes in pipe storage caused by load fluctuations in the chemical production process, resulting in delayed early warning or false alarms. In addition, most systems only have an alarm function and lack direct closed-loop connection with the control system, relying on manual transmission and execution of scheduling schemes, which is slow in response and lacks a mechanism for correcting calculation deviations using operator experience feedback, resulting in a disconnect between theoretical calculation and actual working conditions.

[0003] Therefore, there is an urgent need to provide a technical solution to solve the above problems. SUMMARY

[0004] To solve the above technical problems, the present application provides an online abnormal early warning and imbalance quantity calculation method and system for a gas pipe network.

[0005] In a first aspect, the present application provides an online abnormal early warning and imbalance quantity calculation method for a gas pipe network, and the technical solution of the method is as follows: Collecting time series data at the production end and the consumption end of the gas pipe network system and preprocessing the time series data; Based on a pre-constructed mechanism model, calculating the preprocessed time series data to obtain pipe capacity time series data of the pipe network system, and based on the pipe capacity time series data, calculating the imbalance quantity of the pipe network system; Based on a pre-constructed trend prediction model and statistical methods, performing abnormal detection on the pipe capacity time series data to obtain an abnormal detection result, generating early warning information according to the abnormal detection result, and outputting the imbalance quantity for regulating and controlling the gas pipe network system.

[0006] The online abnormal early warning and imbalance quantity calculation method for a gas pipe network has the following beneficial effects: The method of the application quickly calculates pipe volume and imbalance through a mechanism model, fuses a multi-model early warning mechanism, and introduces open-loop correction and closed-loop control, thereby effectively overcoming problems of missing flow meters, complex calculation, early warning lag and no feedback correction, and significantly improving pipe network monitoring precision and regulation efficiency.

[0007] On the basis of the above-mentioned scheme, the online abnormal early warning and imbalance calculation method of the gas pipe network can be further improved as follows.

[0008] In an optional manner, the step of preprocessing the time series data includes abnormal value cleaning and missing value processing.

[0009] In the above-mentioned optional manner, the step of preprocessing the time series data includes abnormal value cleaning and missing value processing, which has the beneficial effect of effectively improving the quality and integrity of the original data through data cleaning and filling, providing a reliable data basis for subsequent pipe volume calculation and abnormality detection, and avoiding misjudgment and calculation deviation caused by data quality problems.

[0010] In an optional manner, based on the pre-constructed mechanism model, the step of calculating the pipe volume time series data of the pipe network system based on the pre-processed time series data includes: calculating the pipe volume time series data based on the weighted average temperature and the weighted average pressure of the production end and the consumption end according to the pre-processed time series data.

[0011] In the above-mentioned optional manner, the pipe volume time series data is calculated based on the weighted average temperature and pressure of the production and consumption ends, which has the beneficial effect of comprehensively reflecting the overall state of the pipe network through the weighted average method, overcoming the limitation that single-point measurement is not representative, making the pipe volume calculation more in line with the actual working condition, and improving the accuracy and reliability of the calculation.

[0012] In an optional manner, the step of calculating the imbalance of the pipe network system includes: linear fitting of the pipe volume time series data within a preset time window, and taking the slope obtained by the fitting as the imbalance.

[0013] In the above-mentioned optional manner, the imbalance is obtained by linear fitting of the pipe volume time series data, which has the beneficial effect of converting complex dynamic calculation into simple slope solving, avoiding the calculation complexity and rigidity problem of solving differential equations, significantly improving the calculation efficiency and meeting the real-time requirement.

[0014] In an optional manner, the step of detecting the abnormality of the pipe volume time series data based on the pre-constructed trend prediction model and statistical method includes: The following at least two different types of abnormality detection methods are executed in parallel: Residual anomaly detection based on multiple different principle trend prediction models. statistical anomaly detection based on sliding standard deviation; statistical anomaly detection based on sliding median.

[0015] In the optional manner described above, a plurality of anomaly detection methods are executed in parallel, which has the beneficial effect of combining the detection advantages of different principles, complementing and verifying each other, effectively overcoming the poor adaptability of a single detection method, and significantly improving the comprehensiveness and reliability of anomaly identification.

[0016] In an optional manner, residual anomaly detection based on a plurality of trend prediction models of different principles includes: Using pre-constructed ARIMA, GRU and TCN models, the pipe inventory time series data is predicted to obtain the predicted values of each model; The predicted values of each model are subtracted from the corresponding true values in the pipe inventory time series data to obtain the prediction residuals of each model; The prediction residuals of each model are respectively subjected to unsupervised classification to identify abnormal points as preliminary anomaly information of the corresponding residual anomaly detection method.

[0017] In the optional manner described above, ARIMA, GRU and TCN models are used for residual anomaly detection, which has the beneficial effect of comprehensively utilizing the advantages of statistical learning and deep learning methods in different time series characteristics, accurately capturing various abnormal patterns through residual analysis and unsupervised classification, and greatly improving the detection sensitivity.

[0018] In an optional manner, statistical anomaly detection based on sliding standard deviation and statistical anomaly detection based on sliding median includes: For the pipe inventory time series data, sliding standard deviation and sliding median are calculated respectively, and the sliding standard deviation sequence and the sliding median sequence calculated are respectively used to find outliers as abnormal values using the quartile method as preliminary anomaly information of the corresponding statistical anomaly detection method.

[0019] In the optional manner described above, sliding standard deviation and sliding median are combined with the quartile method for statistical anomaly detection, which has the beneficial effect of cross-verification from two dimensions of data volatility and distribution position, which can identify sudden abnormal fluctuations and find gradual offset anomalies, thereby enhancing the detection capability for complex abnormal patterns.

[0020] In an optional manner, the step of determining the anomaly detection result includes: The preliminary anomaly information obtained by each type of anomaly detection method is integrated based on a voting mechanism to determine the final anomaly detection result.

[0021] In the optional mode, the preliminary results of various anomaly detection methods are integrated through a voting mechanism, which has the beneficial effect of reducing the false alarm and missed alarm risk of a single model through multi-model decision fusion, improving the accuracy and robustness of the final anomaly judgment through collective decision, and avoiding system misjudgment due to failure of individual models.

[0022] In an optional mode, the step of outputting the imbalance quantity comprises: Performing an open-loop test mode or a closed-loop control mode; The open-loop test mode is based on the actual adjustment value fed back by the operator, and the imbalance quantity is corrected through a pre-built regression model to optimize the calculation accuracy, and the corrected imbalance quantity is written into the control terminal as a scheduling quantity for regulation; the closed-loop control mode is that the imbalance quantity is directly written into the control terminal as a scheduling quantity to realize automatic control.

[0023] In the optional mode, both open-loop test and closed-loop control modes are provided, which has the beneficial effect of retaining the learning ability of the model optimized by human experience, and realizing automatic execution under precise control, perfectly combining human experience and automation advantages, so that the system has both learning evolution ability and efficient execution ability.

[0024] In a second aspect, the application provides an online anomaly early warning and imbalance quantity calculation system for a gas pipe network, and the technical scheme of the system is as follows: The online anomaly early warning and imbalance quantity calculation system for the gas pipe network comprises: A data preprocessing module is configured to collect time series data at the production end and the consumption end of the gas pipe network system, and to preprocess the time series data; An imbalance quantity calculation module is configured to calculate the time series data of the pipe volume based on a pre-built mechanism model, and to calculate the imbalance quantity of the pipe network system based on the time series data of the pipe volume; A detection result generation module is configured to perform anomaly detection on the time series data of the pipe volume based on a pre-built trend prediction model and a statistical method, to obtain an anomaly detection result, to generate early warning information according to the anomaly detection result, and to output the imbalance quantity for regulating the gas pipe network system.

[0025] The online anomaly early warning and imbalance quantity calculation system for the gas pipe network has the following beneficial effects: The system of the application quickly calculates the pipe volume and the imbalance quantity through a mechanism model, integrates a multi-model early warning mechanism, and introduces open-loop correction and closed-loop control, effectively overcoming the problems of missing flow meters, complex calculation, early warning lag, and no feedback correction, and significantly improving the pipe network monitoring accuracy and regulation efficiency.

[0026] In a third aspect, a technical solution of an electronic device of the present application is as follows: comprising a memory, a processor, and a program stored in the memory and running on the processor, and the processor implements the steps of the online abnormality early warning and imbalance quantity calculation method of the gas pipe network of the present application when running the program.

[0027] In a fourth aspect, a technical solution of a computer readable storage medium provided by the present application is as follows: The computer readable storage medium stores instructions, and when the computer readable storage medium reads the instructions, the computer readable storage medium executes the steps of the online abnormality early warning and imbalance quantity calculation method of the gas pipe network of the present application.

[0028] The above description is only a summary of the technical solutions of the present application. In order to more clearly understand the technical means of the present application, the following specific embodiments of the present application can be implemented according to the content of the description, and in order to make the above and other purposes, characteristics and advantages of the present application more obvious and easy to understand, the following specific embodiments of the present application are described. BRIEF DESCRIPTION OF DRAWINGS

[0029] The accompanying drawings are only used to show the embodiments and are not considered as limitations of the present application. Moreover, the same reference signs are used to represent the same parts throughout the drawings. In the drawings: Figure 1 It is a flowchart of an online abnormality early warning and imbalance quantity calculation method of a gas pipe network of the present application; Figure 2 It is a structural schematic diagram of an online abnormality early warning and imbalance quantity calculation system of a gas pipe network of the present application; Figure 3 It is a processing flowchart of an online abnormality early warning and imbalance quantity calculation system of a gas pipe network of the present application; Figure 4 It is a structural schematic diagram of an electronic device of the present application. DETAILED DESCRIPTION

[0030] Exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein.

[0031] Figure 1 A flowchart of an embodiment of an online abnormality early warning and imbalance quantity calculation method of a gas pipe network provided by the present application is shown as follows: Figure 1 As shown, the method comprises the following steps: S1, collecting time series data at the production end and consumption end of the gas pipe network system, and preprocessing the time series data, in S1: 1) Time series data refers to temperature and pressure parameter sequences arranged in chronological order, which are used to reflect the dynamic change characteristics of the pipe network operation.

[0032] 2) Outlier cleaning refers to identifying and processing error data that deviates significantly from the normal range based on the 3σ principle, which ensures data quality and avoids interference with subsequent analysis.

[0033] 3) Missing value processing refers to filling in gaps in data collection or transmission through linear interpolation, which ensures data continuity to support continuous calculation.

[0034] Specifically, first, real-time collection of temperature and pressure time series data at the production end and consumption end, then identification and processing of abnormal data points using the 3σ principle, and finally filling in missing data through linear interpolation to obtain complete and reliable preprocessed data for subsequent steps.

[0035] S2, based on the pre-constructed mechanism model, the pre-processed time series data is calculated to obtain the pipe capacity time series data of the pipe network system, and based on the pipe capacity time series data, the imbalance of the pipe network system is calculated, in S2: 1) The mechanism model is a physical model based on the gas state equation and the structural characteristics of the pipe network, which converts temperature and pressure data into pipe capacity data.

[0036] 2) Pipe capacity time series data refers to the time series of the total amount of gas stored in the pipe network in real time, which is used to reflect the inventory state of the pipe network.

[0037] 3) Imbalance refers to the difference between the total amount of gas input and output in the pipe network per unit time, which is represented by the pipe capacity change rate, and its function is to reflect the balance of supply and demand in the pipe network.

[0038] Specifically, first, based on the weighted average temperature and pressure of the production end and consumption end, the real-time pipe capacity value of the pipe network system is calculated through the mechanism model and forms a time series, then the pipe capacity data of the recent time window is selected, and the slope of the pipe capacity change trend in this period is obtained through linear fitting, which is taken as the imbalance at the current time.

[0039] S3, based on the pre-constructed trend prediction model and statistical method, the pipe capacity time series data is subjected to anomaly detection to obtain an anomaly detection result, according to which a warning information is generated and the imbalance is output for the regulation and control of the gas pipe network system, in S3: 1) The trend prediction model includes ARIMA, GRU and TCN, three different types of time series analysis models, which are used to predict the normal change trend of pipe capacity from different angles.

[0040] 2) The sliding standard deviation is used to detect abnormal changes in data volatility, which is used to identify anomalies in the stability of the pipe network operation.

[0041] 3) Median of sliding is used to detect abnormal deviation of data distribution position, which is used to find abnormal deviation of operation reference of pipe network.

[0042] 4) Quartile method is a method for identifying outliers based on statistical distribution, which is used to define the boundary between normal and abnormal data through IQR range.

[0043] 5) Voting mechanism is used to determine the final abnormality through the comprehensive judgment of multiple methods, which is used to improve the accuracy and reliability of abnormality detection.

[0044] It should be noted that in the technical solution of the present application, three core entities are involved: The gas pipe network system refers to the physical equipment set composed of pipes, valves, buffer tanks, etc. in the chemical plant, which is used to transport gas medium (such as synthesis gas, steam, etc.), and is the object of state monitoring and control of the present application.

[0045] The control system refers to the existing basic automation system in the plant, such as distributed control system (DCS) or programmable logic controller (PLC), which is used to receive instructions and directly control the actuators (such as regulating valve) on the gas pipe network system, and is the execution unit of the instructions.

[0046] The online abnormality early warning and imbalance quantity calculation system of gas pipe network (hereinafter referred to as "the present system" or "the present invention system") is the upper application system protected by the present application, which collects data from the sensors of the gas pipe network system through the data interface, performs calculation, analysis and decision, and generates early warning information and scheduling quantity (imbalance quantity) through the interface to the control system, and the control system completes the final action execution. The present system and the control system work together to realize closed-loop monitoring and intelligent control of the gas pipe network system.

[0047] In specific application scenarios, in modern chemical production process, gas medium (such as synthesis gas, steam, inert protective gas, etc.) as a key production raw material or auxiliary medium, the stable operation of its pipe network system directly determines the continuity of the production process, and the gas pipe network system usually has a complex topology structure. For example, in the hydrogen system of a certain chemical plant, there are devices such as ammonia synthesis consuming hydrogen, and the production end is the PSA of the gasification device. The production and consumption devices are connected through a complex pipe network, and the pipe network itself is composed of main pipes, multiple branch pipes, valves and buffer tanks, etc., forming a network-shaped pressure vessel system with multiple input sources and multiple consumption points. Time series data is collected through pressure and temperature sensors deployed at key nodes on both ends of production and consumption.

[0048] Specifically, first, multiple anomaly detection methods are executed in parallel, three trend prediction models respectively predict the pipe volume and identify abnormal points through residual analysis, and the sliding standard deviation and sliding median of the pipe volume data are calculated, and the abnormal values are identified through the quartile method; then the preliminary anomaly information obtained by each method is comprehensively judged through the voting mechanism, and when a preset number of methods show anomalies, a warning information is generated, and the current imbalance is output as the basis for operation adjustment.

[0049] The technical scheme of the embodiment quickly calculates the pipe volume and imbalance through a mechanism model, fuses a multi-model early warning mechanism, and introduces open-loop correction and closed-loop control, effectively overcoming the problems of missing flow meters, complex calculation, early warning lag, and no feedback correction, and significantly improving the pipe network monitoring accuracy and regulation efficiency.

[0050] In an optional manner, the step of pre-processing the time series data includes: abnormal value cleaning and missing value processing.

[0051] In the embodiment, the pre-processing process first synchronously collects temperature and pressure time series data from sensor nodes deployed at the production end and the consumption end to form an original data set; then performs abnormal value cleaning, calculates the deviation of each data point from the mean value, and determines and removes data points outside the range of 3 times the standard deviation as abnormal values; Then, the missing value processing is performed, the missing positions in the data sequence due to abnormal value removal or interruption in sampling are calculated and filled by linear interpolation of the effective data before and after; finally, complete and standardized pre-processed time series data is output, providing a high-quality data basis for subsequent pipe volume calculation. Through the above pre-processing operation, the quality and reliability of the original data are effectively improved, and the pipe volume calculation deviation and false alarm problems caused by data anomalies or missing are avoided.

[0052] In an optional manner, based on the pre-constructed mechanism model, the step of calculating the pre-processed time series data to obtain the pipe volume time series data of the pipe network system includes: calculating the pipe volume time series data based on the pre-processed time series data, the weighted average temperature and the weighted average pressure of the production end and the consumption end.

[0053] In the embodiment, firstly, the pretreated temperature and pressure time series data of the production end and the consumption end are acquired, and the weight of each gas using point is initialized as 1 / N, wherein N is the number of the gas using points of the corresponding end (the production end or the consumption end); then the weighted average temperature and the weighted average pressure of the production end and the consumption end are respectively calculated, and the characteristic parameters capable of representing the overall state of the pipe network are obtained through the weighted calculation; then the gas compression factor is calculated based on the weighted average temperature and the weighted average pressure, and the real-time pipe volume value of the pipe network system is calculated through the gas state equation in the mechanism model combined with the geometric volume of the pipeline; the above calculation process is continuously executed to form complete pipe volume time series data, which provides accurate basic data for subsequent imbalance calculation. Through the above implementation, the limitation that single-point measurement is not representative is effectively overcome, and the overall state of the pipe network is accurately calculated based on the multi-node data.

[0054] It should be noted that the mechanism model is a physical calculation model constructed based on the gas state equation and the structural characteristics of the pipe network, and its function is to convert the collected temperature and pressure parameters into pipe volume data reflecting the inventory state of the pipe network; The weighted average temperature refers to the comprehensive temperature value of the production end or the consumption end calculated based on the weight value of each gas using point, and is calculated through the following formula: ; Among them, represents the characteristic temperature or pressure of the gas using point of the production end or the consumption end; represents the weight of each gas using point, which is an optimizable parameter, and is optimized according to the imbalance quantity fed back by the operator; is the weighted average value, which represents the weighted average temperature or the weighted average pressure of all gas using points of the production end or the consumption end.

[0055] After obtaining the weighted average temperature and the weighted average pressure of the production end and the consumption end, the average pressure of the pipeline is calculated according to the average pressure values of the production end and the consumption end, and the formula is as follows: ; Among them, is the inlet pressure of the pipeline, with the unit of Pa; is the outlet pressure of the pipeline, with the unit of Pa; is the average pressure of the pipeline, with the unit of Pa.

[0056] At the same time, the average temperature of the pipeline is calculated, and the formula is as follows: ; Among them, is the inlet temperature of the pipeline, with the unit of K; is the outlet temperature of the pipeline, with the unit of K; is the average pressure of the pipeline, with the unit of K; Finally, based on the gas state equation in the mechanism model, the pipe volume time series data of the pipe network system, i.e., the real-time pipe volume value, is calculated, and the formula is as follows: ; wherein, is the gas pipe inventory, with the unit of m 3 ; is the pipe geometric volume, with the unit of m 3 ; is the gas compressibility factor under the engineering standard condition; is the gas compressibility factor under the average pressure and average temperature of the pipe; is the temperature under the engineering standard condition, taking 293.15 K; is the pressure under the engineering standard condition, taking 100.315 kPa; is an adjustable coefficient, which is corrected according to the feedback result of the operator.

[0057] In an alternative manner, the step of calculating the imbalance of the pipe network system comprises: performing linear fitting on the pipe volume time series data within a preset time window, and taking the slope obtained by the fitting as the imbalance.

[0058] It should be noted that the imbalance refers to the difference between the total amount of input gas and the total amount of output gas in a unit of time, which essentially corresponds to the change rate of the pipe inventory, i.e., the derivative of the pipe inventory with respect to time, and its function is to reflect the balance state of the pipe network supply and demand and serve as a key basis for abnormality judgment. The preset time window refers to a fixed time length data interception interval set according to the characteristics of the gas pipe network system, and its function is to limit the effective data range for calculating the imbalance. Linear fitting refers to the process of performing linear fitting on the pipe volume time series data by the least square method, and its function is to extract a stable change trend from the dynamically changing pipe volume data. The slope refers to the inclination of the straight line obtained by linear fitting, and its numerical value and sign respectively represent the rate and direction of the change of the pipe volume.

[0059] In this embodiment, first, the complete pipe volume time series data calculated by the mechanism model is obtained; Then, according to the medium characteristics and process requirements of the pipe network system, a suitable preset time window length is set. For example: for a synthesis gas pipe network, the time window is set to 15 minutes due to frequent pressure fluctuations and high response speed requirements; for an inert protective gas pipe network, the time window is set to 30 minutes based on the characteristics of high pressure stability requirements.

[0060] Then, the data segment of the last time window length is cut from the pipe volume time series data as an analysis sample. For example, assuming that the sampling interval is 1 minute, if the synthesis gas pipe network is 15 minutes (window 15 minutes), the last 15 data points are cut; if the inert protective gas pipe network is 30 minutes (window 30 minutes), the last 30 data points are cut.

[0061] Based on the least square method, the data segment is linearly fitted to obtain the best fitting straight line (such as y=ax+b), and the slope value a is the pipe volume change rate; finally, the slope value of the fitting straight line is taken as the pipe network system imbalance at the current time, and the unit is m 3 / min, a positive value indicates an increase in pipe volume, and a negative value indicates a decrease in pipe volume.

[0062] Through the above specific embodiments, the characteristics of different medium pipe networks are considered, and the accuracy and timeliness of the imbalance calculation are ensured. At the same time, the complex dynamic calculation is converted into a simple linear fitting problem, avoiding the calculation complexity and rigidity of solving differential equations, significantly improving the calculation efficiency and meeting the real-time requirements, and providing accurate and timely imbalance data support for subsequent abnormal early warning and control decision-making.

[0063] In an optional manner, based on the pre-constructed trend prediction model and statistical method, the step of detecting the abnormality of the pipe volume time series data comprises: Parallelly executing at least two different types of abnormality detection methods: Residual anomaly detection based on multiple trend prediction models of different principles; Statistical anomaly detection based on sliding standard deviation; Statistical anomaly detection based on sliding median.

[0064] In an optional manner, the residual anomaly detection based on multiple trend prediction models of different principles comprises: Using pre-constructed ARIMA, GRU and TCN models to predict the pipe volume time series data to obtain the prediction values of each model; Subtracting the prediction values of each model from the corresponding true values in the pipe volume time series data to obtain the prediction residuals of each model; Respectively performing unsupervised classification on the prediction residuals of each model to identify abnormal points as preliminary abnormal information of the corresponding residual anomaly detection method.

[0065] It should be noted that because only one model has a higher risk of misjudgment, the aggregation of multiple model results can reduce accidental errors, and the fusion of different model advantages can help improve the accuracy and stability of prediction and judgment, enhance the adaptability to complex scenarios, and reduce the probability of model failure.

[0066] Trend prediction models are machine learning models that predict future trends based on historical data. Their function is to identify anomalies by comparing the deviation between predicted and actual values. Statistical methods are anomaly detection methods based on the statistical characteristics of data. Their function is to identify anomalies from the perspective of data distribution characteristics. Parallel execution refers to the simultaneous and independent operation of multiple detection methods, which aims to improve the comprehensiveness and reliability of anomaly detection. In the following description, the variable symbols used in the formulas (such as...) ) are conventional representations within the mathematical expression system of their respective models. They refer to the output of the model itself and are independent of each other.

[0067] In this embodiment, when anomaly detection is performed on pipeline capacity time series data based on multiple trend prediction models with different principles, the pre-built ARIMA, GRU and TCN models are first used to train and predict historical pipeline capacity time series data respectively, so as to obtain the prediction values ​​of each model in the selected recent period.

[0068] The ARIMA model is an autoregressive integral moving average model, which consists of three core parts: autoregression (AR), differencing (I), and moving average (MA). The autoregressive part (AR(p)) assumes that the current value depends on the values ​​of the past p time steps, and the formula is as follows: ; in, for The sequence value at time t, i.e., the tube capacity time series data at time t. The value; (Right now , ... ) represents the autoregressive coefficient; For constant terms; This is white noise error.

[0069] The difference part (I(d)) transforms the non-stationary sequence into a stationary sequence through d-order differences. The first-order difference is defined as: ; in, This represents the difference operator; Indicates at a point in time The sequence value (i.e., the tube capacity value at the previous moment). This represents the sequence value after first-order difference.

[0070] Higher-order differences can be recursively represented as: ; in, Indicates the order of the difference (e.g., d=2 is the second-order difference, d=3 is the third-order difference, etc.); Indicates the process The sequence values ​​after order difference; Indicates the process The sequence value after order difference.

[0071] The moving average portion (MA(q)) is then corrected using the past q error terms, as shown in the formula: ; in, Right now( ... () represents the moving average coefficient. This unified mathematical expression calculates... This is the ARIMA model's prediction of the pipe capacity time series data at time t. The ARIMA model obtains its prediction of the pipe capacity time series data through the above process. The advantage of ARIMA lies in its efficient modeling of linear, short-term stationary time series with low computational cost.

[0072] The GRU model is a gated recurrent unit, a simplified recurrent neural network that updates the gate ( ) and reset door ( The gating mechanism dynamically controls the transmission of timing information.

[0073] The updated gate formula is: ; The formula for resetting the door is: ; Among them, the update gate determines how much historical information is retained; the reset gate determines how much historical information is ignored. Use the Sigmoid activation function; , This is the weight matrix; , For bias, The state was hidden in the previous moment; This is the current input.

[0074] Based on two gating, candidate hidden state Defined as: ; Final hidden state Integrating historical and current information: ; in, This represents the Hadamard product (element-wise multiplication), used to filter memories from the previous time step. Forget the irrelevant parts; This means connecting the filtered past memories with the current input; tanh(...) means mapping the above combined information to a new, temporary memory state, i.e., a candidate hidden state, through an activation function; This indicates the parts of old memories that need to be preserved; This represents the portion of new memories (candidate states) to be absorbed; adding the two portions yields the final hidden state, which integrates the old and new information. If the update gate is close to 1, the new memories (candidate states) are primarily adopted; if it is close to 0, the old memories are primarily retained. This final hidden state... The calculation is then performed through an output layer (e.g., a linear transformation layer), and the resulting output is denoted as... This is the prediction value of the GRU model for the pipe capacity time series data at time t. The GRU model calculates the prediction value for the pipe capacity time series data through the above-mentioned gating mechanism.

[0075] In the anomaly detection of this invention, the GRU model, through a "candidate-final" state mechanism, can dynamically learn long-term patterns in pipeline capacity time-series data. When an abnormal operating condition occurs, the actual pipeline capacity time-series data will deviate significantly from the value predicted by the model based on historical patterns (calculated from the final hidden state) (i.e., residual). This residual will be captured by the subsequent DBSCAN algorithm, thereby identifying the anomaly. Furthermore, GRU differs from the traditional LSTM method in that it has a simpler structure, faster training, and can effectively capture the long-short-term dependencies of nonlinear time series.

[0076] The TCN model is a temporal convolutional network that processes time-series data based on causal convolution and dilated convolution. Causal convolution ensures that predictions rely only on past information. The output at any given time is: ; Where K is the kernel size; These are the convolution weights; for Input at any given moment. Dilated convolution captures long-range dependencies by expanding the receptive field, when the dilation rate is... hour: ; Calculated through causal convolution and dilation convolution. This is the predicted value of the pipe capacity time series data at time t by the TCN model. The TCN model obtains its predicted value of the pipe capacity time series data through the above convolution operation.

[0077] In the anomaly detection of this invention, the TCN model's advantage lies in its ability to process the entire sequence in parallel, resulting in high computational efficiency. It can simultaneously and sensitively capture patterns at different time scales in the pipeline data, whether it be brief, sharp fluctuations (local anomalies) or persistent trend shifts (global anomalies). When a sudden pressure drop or instantaneous sensor failure occurs in the pipeline network, TCN can quickly respond to such local abrupt changes; simultaneously, it can also identify slow trend anomalies caused by long-term changes in system load. This ability to detect both local and global anomalies makes the prediction residuals of the TCN model a crucial signal revealing various anomalies in the pipeline system. Therefore, by stacking multiple layers of dilated convolutions, TCN can efficiently process extremely long sequences, possesses strong parallel computing capabilities, and can simultaneously capture both local fluctuations and global trends.

[0078] After each model completes its prediction, the difference between the recent actual pipe capacity time-series data and the predicted values ​​of each model is calculated to obtain the prediction residuals for each model. Due to differences in prediction performance among different models, to reduce the risk of misclassification by a single model, the prediction residuals of each model are subjected to unsupervised classification using the DBSCAN algorithm to identify outliers. DBSCAN is a density-based unsupervised clustering algorithm. Its core idea is to group densely connected samples into the same cluster, while classifying samples with excessively low density as noise. Neighborhood distance is typically calculated using Euclidean distance, as shown in the formula: ; in, Representing data points and The Euclidean distance between them measures their straight-line distance in space. In DBSCAN, this distance is used to determine whether two points are close enough to decide whether to classify them into the same cluster. and These are two data points whose distance needs to be calculated. In the specific application of this invention, each data point typically represents a prediction residual. For example, It could be the residual between the predicted value of a certain model (such as ARIMA) and the actual pipe capacity at time point i; It is the residual at another time point j; n represents the dimension or number of features of the data points. In the application described in this embodiment, that is, when clustering the prediction residual sequence generated by each model directly, each data point is a single residual value at a point in time. Therefore, the prediction residual data is univariate, and n=1. Those skilled in the art will understand that feature engineering can also be used to construct a feature vector containing multiple statistics for the residuals at each point in time. In this case, n>1, which is also an equivalent transformation within the scope of protection of this invention. and respectively represent the value of the kth feature of the data point and the value of the kth feature of the data point , for example, when n = 1, is the residual value of the data point itself; is the residual value of the data point itself.

[0079] By performing DBSCAN clustering on the prediction residuals of each model, the points identified as noise points or independent small clusters are determined as the abnormal points corresponding to the model. These abnormal points detected by the ARIMA, GRU and TCN models respectively constitute the preliminary abnormal information based on the residual anomaly detection method of the trend prediction model.

[0080] For further illustration, an example with specific numerical values is given below. Suppose there are two time point ARIMA model prediction residuals, which constitute two one-dimensional data points: Point (residual at time point T1), with a value of 5; Point (residual at time point T2), with a value of 2; When n = 1, the calculation process of the Euclidean distance is: ; This means that the two residual points differ by 3 units in value. The DBSCAN algorithm will use this calculated distance to compare with a preset neighborhood radius parameter. When the distance is less than or equal to the preset neighborhood radius parameter, the two points are considered to be density-connected neighbors.

[0081] Through the above process, the residual anomaly detection results of each model are used as preliminary abnormal information for subsequent multi-method voting to determine system abnormalities.

[0082] In an optional manner, the statistical anomaly detection based on sliding standard deviation and the statistical anomaly detection based on sliding median include: For pipe container time series data, sliding standard deviation and sliding median are calculated respectively, and the calculated sliding standard deviation sequence and sliding median sequence are used to find outliers as abnormal values using the quartile method as the preliminary abnormal information of the corresponding statistical anomaly detection method.

[0083] It should be noted that the statistical anomaly detection based on sliding standard deviation and the statistical anomaly detection based on sliding median are performed in parallel to identify abnormal patterns in pipe container time series data from two different dimensions of data volatility and position deviation. The two methods generate sliding standard deviation sequence and sliding median sequence respectively, and make abnormality judgments based on this.

[0084] In this embodiment, the statistical anomaly detection based on sliding standard deviation aims to capture the abnormal changes in data volatility. The process is as follows: A fixed-length sliding window is set for the pipe volume time series data, and the standard deviation of the data in each window is calculated in time sequence to form a sliding standard deviation sequence.

[0085] Under normal operating conditions, the pipe volume fluctuation of the pipe network system is relatively stable, and its standard deviation sequence will remain within a reasonable range. If the standard deviation calculated for a window is significantly higher than the historical normal fluctuation level, it indicates that the pipe network has experienced a severe disturbance or instability; on the contrary, if the standard deviation is significantly reduced or even close to zero, it implies a sensor failure or data freezing.

[0086] To objectively identify these abnormal fluctuations, the sliding standard deviation sequence calculated is itself used to find outliers in it as abnormal values using the quartile method. The quartile method is a statistical distribution-based anomaly detection method, and its core is to define the normal range of data through the "interquartile range (IQR)". The specific steps are as follows: first, calculate the first quartile (Q1) and the third quartile (Q3) of the sequence, then calculate IQR = Q3-Q1, and finally determine the normal range as [Q1-1.5×IQR, Q3+1.5×IQR], samples outside this range are determined as outliers. These identified outliers are the preliminary abnormal information of the statistical anomaly detection method based on sliding standard deviation.

[0087] The statistical anomaly detection based on sliding median focuses on finding significant deviations of data from their typical positions. The process is as follows: Similarly, a fixed-length sliding window is set for the pipe volume time series data, and the median of the data in each window is calculated in time sequence to form a sliding median sequence. This sequence reflects the moving track of the center of the pipe volume data.

[0088] At each time point, the actual pipe volume value is compared with the sliding median of the sliding window corresponding to that time. Under stable operating conditions, the actual value will fluctuate slightly around the median. If the deviation of the actual value at a certain time from the sliding median exceeds a pre-set reasonable threshold, it indicates that the data may have experienced a sudden and significant deviation.

[0089] To automatically identify such deviations, the sliding median sequence calculated is also subjected to the quartile method to find outliers in the sequence. The judgment logic is similar to that of the standard deviation sequence, and the normal fluctuation band of the sliding median is determined through IQR, and points falling outside the band are determined as abnormal. These identified outliers are the preliminary abnormal information of the statistical anomaly detection method based on sliding median.

[0090] To further illustrate, the following provides an embodiment combined with specific numerical values. Assume that there is a piece of pipe volume time series data, a sliding window size of 5 is selected, and a sliding standard deviation sequence is calculated, and the sequence segment is [1.2, 1.5, 1.1, 5.6, 1.3, 1.4].

[0091] The quartile method is applied to the sequence: Q1 = 1.175, Q3 = 1.45, IQR = 0.275, and the upper limit of the normal range is 1.45 + 1.5 * 0.275 = 1.86. Obviously, the value 5.6 is much larger than 1.86, and is therefore determined as an outlier. The original pipe volume data time period corresponding to the point is considered abnormal, and this conclusion is used as a preliminary abnormal information.

[0092] At the same time, the sliding median sequence of the same piece of data is calculated, and the sequence segment is [101, 102, 103, 115, 104, 102].

[0093] The quartile method is applied: Q1 = 101.5, Q3 = 104.5, IQR = 3.0, and the upper limit of the normal range is 104.5 + 1.5 * 3.0 = 109.0. The value 115 exceeds 109.0, and is also determined as an outlier, and a preliminary abnormal information is also generated.

[0094] In the above manner, two statistical methods complete preliminary identification of the anomaly from two independent perspectives of volatility and center position.

[0095] In an optional manner, the step of determining the anomaly detection result comprises: The preliminary abnormal information obtained by each type of anomaly detection method is integrated based on a voting mechanism to determine the final anomaly detection result.

[0096] It should be noted that the step of determining the anomaly detection result is realized by information fusion and comprehensive decision-making on the preliminary abnormal information obtained by each type of anomaly detection method, that is, a comprehensive decision-making strategy based on a voting mechanism is adopted. The voting mechanism refers to regarding each independent anomaly detection method as a voter, regarding the preliminary abnormal information (i.e. the opinion of determining a time period or time point as abnormal) output by each voter as a vote, and finally determining the final anomaly detection result according to the collective opinion of all voters.

[0097] In the embodiment, the five types of anomaly detection methods include three residual anomaly detection methods composed of the ARIMA, GRU and TCN three trend prediction models, and two statistical anomaly detection methods based on sliding standard deviation and sliding median. For the pipe volume state of the same time period or the same time point, the five methods make independent judgments based on their respective calculation logic and data, and respectively generate corresponding preliminary anomaly information. The decision rule of the voting mechanism is: when at least three of the five methods indicate that a target (such as a certain time point) is an anomaly point, the final anomaly detection result determines that the system is in an abnormal state at the target.

[0098] To further illustrate the working process of the voting mechanism, an embodiment combined with specific numerical values is provided below. Assuming that for a certain monitoring time point T, the preliminary anomaly information generated by the five anomaly detection methods after independent work is as follows: ARIMA model residual anomaly detection: determined to be abnormal; GRU model residual anomaly detection: determined to be normal; TCN model residual anomaly detection: determined to be abnormal; Statistical anomaly detection based on sliding standard deviation: determined to be abnormal; Statistical anomaly detection based on sliding median: determined to be normal.

[0099] According to the above voting result, at time point T, there are three methods (ARIMA, TCN and sliding standard deviation detection) that cast an abnormal vote, reaching the preset decision threshold of "at least three methods determined to be abnormal". Therefore, through the voting mechanism for comprehensive, the final anomaly detection result determines that the system is abnormal at time point T, thereby completing the anomaly detection result determination process. Once the anomaly detection result is confirmed, a warning information will be automatically generated, and the current calculated imbalance will be returned as a reference for adjustment scheme or directly written into the control system as a dispatch amount according to the system operation mode to complete the closed-loop control, thereby realizing the rapid response and disposal of the pipe network anomaly.

[0100] In an optional manner, the step of outputting the imbalance amount comprises: executing an open-loop test mode or a closed-loop control mode; The open-loop test mode is: based on the actual adjustment value fed back by the operator, the imbalance amount is corrected through a pre-constructed regression model to optimize the calculation accuracy, and the corrected imbalance amount is written into the control terminal as a dispatch amount for regulation and control; the closed-loop control mode is: the imbalance amount is directly written into the control terminal as a dispatch amount to realize automatic control.

[0101] It should be noted that, in order to further improve the accuracy of the imbalance calculation value and make it more in line with the actual production conditions, the present application introduces a correction mechanism based on operator feedback in the open-loop test phase. Specifically, the system records the theoretical imbalance value calculated by the mechanism model within a certain period of time, and at the same time records the actual adjustment value of the pipe network based on the experience of the operator. These pairs of data (theoretical value, actual value) constitute the data set of the correction model. Based on this data set, a regression model is constructed to learn the mapping relationship between the theoretical calculation value and the experience adjustment value. The goal of this regression model is to output a corrected imbalance that is closer to the operator's decision when a new theoretical imbalance value is input.

[0102] Those skilled in the art can understand that the regression model can have multiple specific implementations, such as but not limited to: Linear regression model: y=ax+b; where x is the theoretical imbalance, y is the corrected imbalance, and parameters a and b are fitted by least squares.

[0103] Polynomial regression model: y=a0+a1x+a2x 2 +...; to capture more complex non-linear correction relationships.

[0104] Decision tree-based regression model (such as random forest or gradient boosting tree) can automatically learn feature interaction and non-linear relationship.

[0105] The output of the regression model is closely related to the optimization of the adjustable parameters in the mechanism model. The systematic deviation revealed by the trained regression model is used to guide the update of the adjustable parameters in the mechanism model, such as the weights used to calculate the weighted average and the adjustable coefficients in the pipe storage formula. By correcting the imbalance calculation value through the regression model, the deviation between the theoretical calculation and the actual working condition can be dynamically reduced. After a period of learning and correction, the imbalance calculated by the system will tend to be reliable and accurate, laying the foundation for subsequent switching to closed-loop automatic control.

[0106] The step of outputting the imbalance is specifically implemented by executing the open-loop test mode or the closed-loop control mode. The open-loop test mode is mainly used in the initial deployment or optimization phase of the system, and its core purpose is to calibrate the calculated imbalance using actual operating experience to improve its accuracy and reliability in actual application. In this mode, the initial imbalance calculated based on the mechanism model is first provided as a recommended scheduling value to the operator for reference. The operator may take different actual adjustment values than the system recommended value to regulate the pipe network based on his professional experience and actual working conditions. The system will continuously record the deviation data between the actual adjustment value fed back by the operator and the imbalance calculated by the system itself.

[0107] Based on the accumulated deviation data, a pre-constructed regression model is used to learn and fit the deviations. The regression model is used to establish a correction relationship between the system initial calculation value and the operator's experience value, and the goal is to find a mapping function so that the corrected calculation value can be closest to the operator's actual adjustment value. The regression process drives the optimization of key adjustable parameters in the mechanism model. Specifically, in the mechanism model of pipe volume calculation, parameters such as weights in the production and consumption two-end weighted average calculation, and adjustable coefficients in the pipe storage calculation formula are involved. After initialization, these parameters are iteratively optimized using regression analysis techniques based on feedback data collected in open-loop test mode, thereby correcting the imbalance. After a period of continuous learning and parameter adjustment, the imbalance calculated by the system will be more and more close to the actual working condition, and the calculation accuracy can be significantly optimized. Finally, the system will use the corrected imbalance as the scheduling quantity for pipe network regulation, and write it to the control terminal to guide production operation.

[0108] To further illustrate this process, an example with specific numerical values is provided below. Assume that during a certain period, the imbalance calculated by the system according to the mechanism model is +50m 3 / h (indicating that the gas volume in the pipe network is continuously increasing), and this value is recommended to the operator, and the operator's adjustment amount should be -50m 3 / h. The operator judges that the actual adjustment amount required should be -60m 3 / h according to the site pressure and load conditions, and makes a manual adjustment accordingly, and this value is recorded as the actual adjustment value. The system records the deviation of this time as -10m 3 / h. After multiple rounds of data accumulation, the regression model analysis finds that the current adjustable coefficient setting causes the system to continuously underestimate the imbalance. Therefore, the model starts the parameter optimization process, for example, gradually adjusts the adjustable coefficient from the initial 1.0 to 1.05. Using the new adjustable coefficient value to recalculate the pipe volume and imbalance makes the subsequent calculation results closer to the operator's actual adjustment value. When the open-loop test mode runs stably and the calculation error converges to an acceptable range, the system can switch to closed-loop control mode. In this mode, the system will fully trust the verified and optimized calculation model, and directly write the real-time calculated imbalance as the scheduling quantity to the control terminal, which is automatically executed by the control system to achieve automatic control, thereby reducing manual intervention, improving response speed and control efficiency.

[0109] Figure 2 An embodiment of the structure of a gas pipe network online abnormal early warning and imbalance calculation system 200 provided by the present application is shown. As Figure 2 shown, the system 200 includes: The data preprocessing module 210 is configured to collect time series data at the production end and the consumption end of the gas pipe network system, and to preprocess the time series data. The imbalance amount calculation module 220 is configured to calculate the preprocessed time series data based on a pre-constructed mechanism model, to obtain pipe volume time series data of the pipe network system, and to calculate an imbalance amount of the pipe network system based on the pipe volume time series data. The detection result generation module 230 is configured to perform anomaly detection on the pipe volume time series data based on a pre-constructed trend prediction model and a statistical method, to obtain an anomaly detection result, to generate early warning information according to the anomaly detection result, and to output the imbalance amount for regulating and controlling the gas pipe network system.

[0110] The technical scheme of the embodiment quickly calculates the pipe volume and the imbalance amount through the mechanism model, fuses a multi-model early warning mechanism, and introduces open-loop correction and closed-loop control, thereby effectively overcoming problems of missing flow meters, complex calculation, early warning lag, and no feedback correction, and significantly improving the pipe network monitoring precision and the regulation and control efficiency.

[0111] The steps of implementing the respective functions of each parameter and each module in the online anomaly early warning and imbalance amount calculation system 200 of the gas pipe network according to the embodiment can refer to the parameters and steps in the embodiments of the online anomaly early warning and imbalance amount calculation method of the gas pipe network, which will not be described herein.

[0112] As shown in FIG. 2, Figure 3 The process starts from the data collection and preprocessing stage. The system synchronously collects time series data such as temperature and pressure at the production end and the consumption end of the gas pipe network, and then preprocesses the data, including abnormal value cleaning based on the 3σ principle and missing value processing using linear interpolation, to ensure data quality.

[0113] The preprocessed data enters the pipe volume and imbalance amount calculation stage. Based on the pre-constructed mechanism model, the weighted average temperature and the weighted average pressure at the production and consumption ends are used to obtain pipe volume time series data through a series of physical calculation formulas (including calculation of pipe average pressure, average temperature, and final pipe inventory).

[0114] The core link is anomaly detection and early warning. The system performs multiple anomaly detection methods in parallel: one is residual anomaly detection based on multiple trend prediction models (ARIMA, GRU, TCN) of different principles, each model predicts the tank, calculates the prediction residual, and uses the DBSCAN algorithm for unsupervised classification to identify abnormal points; the second is anomaly detection by two statistical methods, respectively calculating the sliding standard deviation and sliding median of the tank data, and applying the interquartile method (IQR) to the obtained sequence to find outliers as anomalies. The preliminary anomaly information generated by the above five methods is sent to a voting mechanism for comprehensive judgment, and when a preset number (such as three) of methods indicate anomalies, the final anomaly detection result is determined, and warning information is generated.

[0115] The process ends in the decision output and control phase. The system outputs the imbalance according to the operation mode: in the open-loop test mode, based on the actual adjustment value fed back by the operator, the imbalance is corrected by a pre-built regression model (such as linear regression), the adjustable parameters (such as weights, adjustable coefficient k) in the mechanism model are optimized, and the corrected imbalance is written into the control terminal as the scheduling quantity; in the closed-loop control mode, the imbalance calculated in real time is directly written into the control terminal as the scheduling quantity, realizing automatic control.

[0116] This process fully shows the closed-loop processing process from raw data to final control instruction, realizing online anomaly early warning and intelligent regulation and control of the gas pipe network system.

[0117] As shown in Figure 4 The electronic device 300 according to the embodiment of the present application, the electronic device 300 includes a processor 320, the processor 320 is coupled with a memory 310, the memory 310 stores at least one computer program 330, the at least one computer program 330 is loaded and executed by the processor 320, so that the electronic device 300 realizes any one of the above-mentioned online anomaly early warning and imbalance calculation method of gas pipe network, specifically: The electronic device 300 can have great differences due to different configurations or performances, and can include one or more processors 320 (Central Processing Units, CPU) and one or more memories 310, wherein the one or more memories 310 store at least one computer program 330, and the at least one computer program 330 is loaded and executed by the one or more processors 320, so that the electronic device 300 realizes any one of the online anomaly early warning and imbalance calculation method of gas pipe network provided by the above-mentioned embodiment. Of course, the electronic device 300 can also have a wired or wireless network interface, a keyboard, and an input and output interface, etc. components, so as to perform input and output, and the electronic device 300 can also include other components for realizing device functions, which will not be described here.

[0118] The computer readable storage medium of the embodiment of the present application stores at least one computer program. The at least one computer program is loaded and executed by the processor, so that the computer implements the online abnormal early warning and imbalance calculation method of any one of the gas pipe networks.

[0119] Optionally, the computer readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, and an optical data storage device, etc.

[0120] In the exemplary embodiment, a computer program product or computer program is also provided, which includes computer instructions stored in a computer readable storage medium. The processor of the electronic device reads the computer instructions from the computer readable storage medium. The processor executes the computer instructions, so that the electronic device executes the online abnormal early warning and imbalance calculation method of any one of the gas pipe networks.

[0121] Those skilled in the art know that the present application can be implemented as a system, a method or a computer program product, therefore, the present disclosure can be specifically implemented in the following forms: it can be a complete hardware, a complete software (including firmware, resident software, microcode, etc.), and also a combination of hardware and software, which is generally referred to as "circuit", "module" or "system" in this paper. In addition, in some embodiments, the present application can also be implemented in the form of a computer program product in one or more computer readable media, which includes computer readable program code.

[0122] Any combination of one or more computer readable medium can be utilized. The computer readable medium can be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium include: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium can be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.

[0123] Although the embodiments of the present application have been shown and described above, it should be understood by those skilled in the art that the above embodiments are exemplary, and cannot be understood as limiting the present application, and those skilled in the art can make changes, modifications, replacements, and variations to the above embodiments within the scope of the present application.

Claims

1. A method for online anomaly early warning and imbalance calculation of a gas pipeline network, characterized in that, include: Collect time-series data from both the production and consumption ends of the gas pipeline network system, and preprocess the time-series data; Based on the pre-constructed mechanism model, the pre-processed time series data is calculated to obtain the pipe capacity time series data of the pipeline network system, and the unbalance of the pipeline network system is calculated based on the pipe capacity time series data. Based on a pre-built trend prediction model and statistical methods, anomaly detection is performed on the pipeline capacity time series data to obtain anomaly detection results. Based on the anomaly detection results, early warning information is generated, and the imbalance quantity is output for the purpose of regulating the gas pipeline network system.

2. The method for online anomaly early warning and imbalance calculation of gas pipeline networks according to claim 1, characterized in that, The steps for preprocessing time-series data include: outlier cleaning and missing value handling.

3. The method for online anomaly early warning and imbalance calculation of gas pipeline networks according to claim 1, characterized in that, The steps of calculating the pipeline capacity time series data of the pipeline network system based on the pre-constructed mechanism model include: calculating the pipeline capacity time series data based on the weighted average temperature and weighted average pressure of the production end and the consumption end according to the pre-constructed time series data.

4. The method for online anomaly early warning and imbalance calculation of gas pipeline networks according to claim 3, characterized in that, The steps for calculating the imbalance of the pipeline network system include: performing linear fitting on the pipeline capacity time series data within a preset time window, and using the slope obtained from the fitting as the imbalance.

5. The method for online anomaly early warning and imbalance calculation of gas pipeline networks according to claim 1, characterized in that, The steps for anomaly detection in the pipeline capacity time series data based on a pre-built trend prediction model and statistical methods include: Execute at least two different types of anomaly detection methods in parallel: Residual anomaly detection based on multiple trend prediction models with different principles; Statistical anomaly detection based on sliding standard deviation; Statistical anomaly detection based on the moving median.

6. The method for online anomaly early warning and imbalance calculation of gas pipeline networks according to claim 5, characterized in that, Residual anomaly detection based on multiple trend prediction models with different principles, including: The pre-built ARIMA, GRU, and TCN models are used to predict the pipe capacity time series data to obtain the predicted values ​​of each model. The predicted values ​​of each model are subtracted from the corresponding true values ​​in the pipe capacity time series data to obtain the prediction residuals of each model. Unsupervised classification is performed on the prediction residuals of each model to identify outliers, which serve as preliminary anomaly information for the corresponding residual anomaly detection methods.

7. The method for online anomaly early warning and imbalance calculation of gas pipeline networks according to claim 6, characterized in that, Statistical anomaly detection based on moving standard deviation and statistical anomaly detection based on moving median include: For the time series data of the tube capacity, the moving standard deviation and the moving median are calculated respectively. The outliers of the calculated moving standard deviation sequence and the moving median sequence are identified by the quartile method as outliers, which serve as the preliminary anomaly information for the corresponding statistical anomaly detection method.

8. The method for online anomaly early warning and imbalance calculation of gas pipeline networks according to claim 7, characterized in that, The steps for determining the anomaly detection result include: The preliminary anomaly information obtained from various anomaly detection methods is synthesized based on a voting mechanism to determine the final anomaly detection result.

9. The method for online anomaly early warning and imbalance calculation of gas pipeline networks according to claim 1, characterized in that, The step of outputting the imbalance includes: Execute open-loop test mode or closed-loop control mode; The open-loop testing mode involves correcting the imbalance based on the actual adjustment value reported by the operator using a pre-built regression model to optimize calculation accuracy, and then writing the corrected imbalance as a scheduling quantity for regulation into the control terminal. The closed-loop control mode involves directly writing the imbalance as a scheduling quantity into the control terminal to achieve automatic control.

10. An online anomaly early warning and imbalance calculation system for a gas pipeline network, characterized in that, The method for online anomaly early warning and imbalance calculation of gas pipeline networks as described in any one of claims 1-9 is adopted.