Methods, devices, equipment and media for dynamic tracking of gas source components in natural gas pipeline networks

By constructing and solving the flow rate and component matrix inside the pipeline, the dynamic tracking of gas source components of the natural gas pipeline network is solved, and the problems of small coverage, high cost and directed closed-loop pipeline network in the existing technology are improved, and the calculation efficiency and Reliability of results.

CN118710442BActive Publication Date: 2024-12-03SHANGHAI THREE ZERO FOUR ZERO TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411195804.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2024-12-03
Estimated Expiration
2044-08-29

AI Technical Summary

Technical Problem

In the dynamic tracking of gas source components in natural gas pipeline networks, the metrological tracking coverage is small, the cost is high and inaccurate. Simulation tracking is difficult to solve the problem of directional closed-loop pipeline networks, the calculation efficiency is low, and the results are poor.

Method used

By obtaining the transient simulation results of the current and previous moments of the pipeline, we can determine whether the first calculation conditions are met, build the flow rate and component matrix inside the pipeline, perform matrix solutions, calculate the components of the first and last pipe segments of the pipeline, and use flow balance processing and Graph search algorithm to determine the components of the target pipeline segment.

Benefits of technology

It improves the calculation efficiency of dynamic tracking of gas source components, improves the rationality and reliability of the results, solves the problem of directional closed-loop pipeline network, and reduces the impact of simulation results on tracking.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118710442B_ABST
    Figure CN118710442B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, equipment and medium for dynamically tracking gas source components of a natural gas pipeline network, and relates to the technical field of dynamically tracking gas source components of a natural gas pipeline network. If the transient simulation result at the current moment does not meet the initial operation condition, the dynamic tracking result of the gas source components at the previous moment is determined; data processing is performed on the transient simulation result at the current moment and the dynamic tracking result of the gas source components at the previous moment to construct a pipeline internal segment flow velocity matrix and a pipeline internal component matrix, and solve them to obtain a general solution of the components of the first and last segments of the pipeline; a pipeline endpoint flow balance matrix and a pipeline endpoint component matrix are constructed; the components of the first and last segments of the pipeline are calculated based on the pipeline endpoint flow balance matrix, the pipeline endpoint component matrix and the general solution of the components of the first and last segments of the pipeline; the pipeline segment components are calculated to determine the target pipeline segment components to obtain the dynamic tracking result of the gas source components of the natural gas pipeline network, thereby improving the calculation efficiency of the dynamic tracking of the gas source components and the reliability of the dynamic tracking results of the gas source components.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of dynamic tracking of gas source components in a natural gas pipeline network, and in particular to a method, device, equipment and medium for dynamic tracking of gas source components in a natural gas pipeline network. Background Art

[0002] At present, there are two main ways to obtain dynamic tracking results of gas source components, namely, metering tracking using sensor measurement and simulation tracking using simulation results. Metering tracking installs the required sensors in the pipeline network, such as flow meters, component analyzers, etc., and obtains the flow value and component status of a specific location through real-time monitoring of the sensor, thereby obtaining the tracking results of a specific location in the pipeline network. Simulation tracking uses the pipeline network simulation system to simulate the state of each node in the pipeline network, and transmits the upstream node components to the downstream nodes according to the direction of the actual flow, and finally obtains the tracking results of each node. The disadvantages are as follows: the coverage of metering tracking is small, and it is difficult for sensor equipment to cover each pipeline, especially medium and low pressure pipelines. The cost is high, and the purchase, installation and maintenance of a large number of sensor equipment are expensive. It is impossible to avoid and identify the sensor's own measurement error and fault error. The sensor is affected by the outside world, resulting in reduced stability and accuracy; simulation tracking is difficult to solve the problem of directional closed-loop pipeline network, which is not conducive to the subsequent construction and development of the pipeline network, and the calculation efficiency is low. Simulation errors lead to poor tracking results.

[0003] It can be seen from the above that how to improve the computational efficiency of dynamic tracking of gas source components in a natural gas pipeline network and enhance the rationality and reliability of the results of dynamic tracking of gas source components are issues to be resolved in this field. Summary of the invention

[0004] In view of this, the purpose of the present invention is to provide a method, device, equipment and medium for dynamic tracking of gas source components in a natural gas pipeline network, which can improve the calculation efficiency of dynamic tracking of gas source components in a natural gas pipeline network and enhance the rationality and reliability of the dynamic tracking results of gas source components. The specific scheme is as follows:

[0005] In a first aspect, the present application discloses a method for dynamically tracking gas source components in a natural gas pipeline network, comprising:

[0006] Obtaining the current moment transient simulation result and the previous moment transient simulation result of the pipeline, judging whether the current moment transient simulation result meets the first operation condition, and if the current moment transient simulation result does not meet the first operation condition, determining the gas source component dynamic tracking result at the previous moment from the previous moment transient simulation result;

[0007] Performing data processing on the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment, and constructing a pipeline internal segment flow velocity matrix and a pipeline internal component matrix based on the processed transient simulation result at the current moment and the processed dynamic tracking result of the gas source component at the previous moment, respectively, and solving the pipeline internal segment flow velocity matrix and the pipeline internal component matrix to obtain a general solution of the components of the first and last segments of the pipeline;

[0008] Performing flow balance processing on the processed transient simulation results at the current moment, and constructing a pipeline endpoint flow balance matrix and a pipeline endpoint component matrix based on the transient simulation results at the current moment after the flow balance processing;

[0009] Calculate the components of the first and last pipe sections of the pipeline based on the pipeline endpoint flow balance matrix, the pipeline endpoint component matrix and the first and last pipe section components of the pipeline;

[0010] All pipeline segment components are calculated using the pipeline first and last segment components and the pipeline first and last segment components general solution, a target pipeline segment component is determined from all the pipeline segment components, and the target pipeline segment component is used as a dynamic tracking result of the gas source component of the natural gas pipeline network.

[0011] Optionally, after determining whether the transient simulation result at the current moment meets the first operation condition, the method further includes:

[0012] If the transient simulation result at the current moment meets the first operation condition, a non-dynamic tracking calculation of the gas source component is performed on the transient simulation result at the previous moment to obtain the non-dynamic tracking result of the gas source component at the previous moment; the non-dynamic tracking calculation of the gas source component includes absolute flow balance error rate calculation, flow balance processing, node continuity equation group matrix construction and sparse matrix solution;

[0013] The non-dynamic tracking result of the gas source component at the previous moment is subjected to data preprocessing, and a pipeline internal segment flow rate matrix and a pipeline internal component matrix are respectively constructed based on the processed transient simulation result at the current moment and the processed non-dynamic tracking result of the gas source component at the previous moment.

[0014] Optionally, the data processing of the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment includes:

[0015] Determine whether the flow rate in the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment is a negative number;

[0016] If the flow rate in the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment is a negative number, the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment are processed with a negative flow value to obtain the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment after the negative flow value processing, and the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment after the negative flow value processing are processed with a minimum value and a problem node to obtain the processed transient simulation result at the current moment and the processed dynamic tracking result of the gas source component at the previous moment;

[0017] If the flow rate in the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment is not negative, the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment are directly subjected to minimum value processing and problem node processing to obtain the processed transient simulation result at the current moment and the processed dynamic tracking result of the gas source component at the previous moment.

[0018] Optionally, the step of respectively constructing a pipeline internal segment flow rate matrix and a pipeline internal component matrix based on the processed transient simulation result at the current moment and the processed dynamic tracking result of the gas source component at the previous moment includes:

[0019] Determine whether the pipeline flow in the processed transient simulation result at the current moment is consistent with the processed gas source component dynamic tracking result at the previous moment;

[0020] If the processed transient simulation result at the current moment is consistent with the pipeline flow in the processed gas source component dynamic tracking result at the previous moment, then constructing a pipeline internal pipe segment flow velocity matrix based on the processed transient simulation result at the current moment, and constructing a pipeline internal component matrix based on the processed gas source component dynamic tracking result at the previous moment;

[0021] If the pipeline flow in the processed transient simulation result at the current moment and the processed dynamic tracking result of the gas source component at the previous moment are inconsistent, the pipe section components of the processed transient simulation result at the current moment and the processed dynamic tracking result of the gas source component at the previous moment are flipped, and then the internal pipe section flow velocity matrix of the pipeline is constructed based on the flipped transient simulation result at the current moment, and the internal component matrix of the pipeline is constructed based on the flipped dynamic tracking result of the gas source component at the previous moment.

[0022] Optionally, the flow velocity matrix of the pipe section inside the pipeline is:

[0023] ;

[0024] in, is the flow rate matrix of the pipe segment inside the pipeline, u is the flow rate, t is the duration, l is the length, and m is the number of pipe segments;

[0025] Correspondingly, the internal component matrix of the pipeline is:

[0026] ;

[0027] Here, x is the concentration of the component.

[0028] Optionally, the calculating of the components of the first and last pipe sections of the pipeline based on the pipeline endpoint flow balance matrix, the pipeline endpoint component matrix and the first and last pipe section components of the pipeline general solution includes:

[0029] Generate a group of flow balance equations using the pipeline endpoint flow balance matrix and the pipeline endpoint component matrix;

[0030] The flow balance equation group is combined with the general solution of the pipeline first and last pipe section components and calculated to obtain the pipeline first and last pipe section components.

[0031] Optionally, the calculating all pipeline segment components by using the pipeline first and last segment components and the pipeline first and last segment components general solution, and determining the target pipeline segment component from all the pipeline segment components, includes:

[0032] Substitute the components of the first and last pipe sections of the pipeline into the general solution of the components of the first and last pipe sections of the pipeline for calculation to obtain the components of all pipeline sections;

[0033] A graph search algorithm is used to traverse all of the pipeline segment components and perform node screening to obtain a target pipeline segment component.

[0034] In a second aspect, the present application discloses a natural gas pipeline network gas source component dynamic tracking device, comprising:

[0035] A judgment module, used for obtaining the transient simulation result of the pipeline at the current moment and the transient simulation result at the previous moment, judging whether the transient simulation result at the current moment meets the initial operation condition, and if the transient simulation result at the current moment does not meet the initial operation condition, determining the dynamic tracking result of the gas source component at the previous moment from the transient simulation result at the previous moment;

[0036] A matrix construction and solution module is used to perform data processing on the transient simulation results at the current moment and the dynamic tracking results of the gas source components at the previous moment, and to respectively construct a pipeline internal segment flow velocity matrix and a pipeline internal component matrix based on the processed transient simulation results at the current moment and the processed dynamic tracking results of the gas source components at the previous moment, and to solve the pipeline internal segment flow velocity matrix and the pipeline internal component matrix to obtain a general solution for the components of the first and last segments of the pipeline;

[0037] A flow balance processing module, used for performing flow balance processing on the processed transient simulation result at the current moment, and constructing a pipeline endpoint flow balance matrix and a pipeline endpoint component matrix based on the transient simulation result at the current moment after the flow balance processing;

[0038] A pipe segment component calculation module, used for calculating the components of the first and last pipe segments of the pipeline based on the pipeline endpoint flow balance matrix, the pipeline endpoint component matrix and the first and last pipe segment components of the pipeline;

[0039] The gas source component dynamic tracking result determination module is used to calculate all pipeline section components using the pipeline first and last section components and the pipeline first and last section components general solution, determine the target pipeline section component from all the pipeline section components, and use the target pipeline section component as the gas source component dynamic tracking result of the natural gas pipeline network.

[0040] In a third aspect, the present application discloses an electronic device, comprising:

[0041] Memory, used to store computer programs;

[0042] The processor is used to execute the computer program to implement the aforementioned method for dynamically tracking gas source components of a natural gas pipeline network.

[0043] In a fourth aspect, the present application discloses a computer storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned method for dynamically tracking gas source components of a natural gas pipeline network are implemented.

[0044] It can be seen that the present application provides a method for dynamically tracking gas source components of a natural gas pipeline network, including obtaining the transient simulation results of the pipeline at the current moment and the transient simulation results of the previous moment, judging whether the transient simulation results at the current moment meet the initial operation conditions, and if the transient simulation results at the current moment do not meet the initial operation conditions, determining the dynamic tracking results of the gas source components at the previous moment from the transient simulation results at the previous moment; performing data processing on the transient simulation results at the current moment and the dynamic tracking results of the gas source components at the previous moment, and constructing a pipeline internal pipe segment flow velocity matrix and a pipeline internal component matrix based on the processed transient simulation results at the current moment and the processed dynamic tracking results of the gas source components at the previous moment, respectively, and tracking the internal pipe segment flow velocity matrix of the pipeline and the internal component matrix of the pipeline. The segment flow velocity matrix and the pipeline internal component matrix are solved to obtain the general solution of the pipeline head and end segment components; the processed transient simulation results at the current moment are subjected to flow balance processing, and the pipeline endpoint flow balance matrix and the pipeline endpoint component matrix are constructed based on the transient simulation results at the current moment after the flow balance processing; the pipeline head and end segment components are calculated based on the pipeline endpoint flow balance matrix, the pipeline endpoint component matrix and the general solution of the pipeline head and end segment components; all pipeline segment components are calculated using the pipeline head and end segment components and the general solution of the pipeline head and end segment components, a target pipeline segment component is determined from all the pipeline segment components, and the target pipeline segment component is used as the dynamic tracking result of the gas source component of the natural gas pipeline network. The present application processes data of transient simulation results at the current moment and dynamic tracking results of gas source components at the previous moment, adopts a series of matrix solving processes, constructs a flow velocity matrix of the internal pipe section of the pipeline and a component matrix of the internal pipe section of the pipeline, and then solves them to obtain a general solution of the components of the first and last pipe sections of the pipeline, constructs a flow balance matrix of the pipeline endpoints and a component matrix of the pipeline endpoints, thereby calculating the components of the first and last pipe sections of the pipeline, and realizing dynamic tracking of gas source components of the natural gas pipeline network, reducing the complexity of calculating dynamic tracking of gas source components, effectively solving the problem of directed closed-loop pipeline networks that is difficult to solve in traditional tracking methods, reducing the impact of simulation results on tracking, improving the calculation efficiency of dynamic tracking of gas source components of the natural gas pipeline network, and improving the rationality and reliability of dynamic tracking results of gas source components. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0046] Figure 1 A flow chart of a method for dynamically tracking gas source components in a natural gas pipeline network disclosed in the present application;

[0047] Figure 2 A data processing flow chart disclosed in this application;

[0048] Figure 3 A pipeline segment pre-solution flow chart disclosed in this application;

[0049] Figure 4 A pipeline endpoint component solution flow chart disclosed in this application;

[0050] Figure 5 A pipe network example diagram disclosed in this application;

[0051] Figure 6 A pipe segment solution flow chart disclosed in this application;

[0052] Figure 7 A specific flow chart of dynamic tracking of gas source components disclosed in this application;

[0053] Figure 8 A "three-step" framework flow chart of a matrix solving process disclosed in this application;

[0054] Fig. 9 This is a schematic diagram of the structure of a natural gas pipeline network gas source component dynamic tracking device disclosed in this application;

[0055] Fig.10 A structural diagram of an electronic device provided for this application. DETAILED DESCRIPTION

[0056] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0057] At present, there are two main ways to obtain dynamic tracking results of gas source components, namely, metering tracking using sensor measurement and simulation tracking using simulation results. Metering tracking installs the required sensors in the pipeline network, such as flow meters, component analyzers, etc., and obtains the flow value and component status of a specific location through real-time monitoring of the sensor, thereby obtaining the tracking results of a specific location in the pipeline network. Simulation tracking uses the pipeline network simulation system to simulate the state of each node in the pipeline network, and transmits the upstream node components to the downstream nodes according to the direction of the actual flow, and finally obtains the tracking results of each node. The disadvantages are as follows: the coverage of metering tracking is small, and it is difficult for sensor equipment to cover each pipeline, especially medium and low pressure pipelines. The cost is high, and the purchase, installation and maintenance of a large number of sensor equipment are expensive. It is impossible to avoid and identify the sensor's own measurement error and fault error. The sensor is affected by the outside world, resulting in reduced stability and accuracy; simulation tracking is difficult to solve the problem of directional closed-loop pipeline network, which is not conducive to the subsequent construction and development of the pipeline network, and the calculation efficiency is low. Simulation errors lead to poor tracking results. It can be seen from the above that how to improve the computational efficiency of dynamic tracking of gas source components in a natural gas pipeline network and enhance the rationality and reliability of the results of dynamic tracking of gas source components are issues to be resolved in this field.

[0058] See also Figure 1 As shown, the embodiment of the present invention discloses a method for dynamically tracking gas source components in a natural gas pipeline network, which may specifically include:

[0059] Step S11: Obtain the transient simulation result of the pipeline at the current moment and the transient simulation result at the previous moment, and determine whether the transient simulation result at the current moment meets the initial operation condition. If the transient simulation result at the current moment does not meet the initial operation condition, determine the dynamic tracking result of the gas source component at the previous moment from the transient simulation result at the previous moment.

[0060] In this embodiment, the transient simulation results of the pipeline at the current moment and the transient simulation results at the previous moment are obtained to determine whether the transient simulation results at the current moment meet the first operation conditions. If the transient simulation results at the current moment do not meet the first operation conditions, the dynamic tracking results of the gas source components at the previous moment are determined from the transient simulation results at the previous moment. If the transient simulation results at the current moment meet the first operation conditions, the gas source component non-dynamic tracking calculation is performed on the transient simulation results at the previous moment to obtain the non-dynamic tracking results of the gas source components at the previous moment; the non-dynamic tracking calculation of the gas source components includes absolute flow balance error rate calculation, flow balance processing, node continuity equation group matrix construction and sparse matrix solution, data preprocessing is performed on the non-dynamic tracking results of the gas source components at the previous moment, and the pipeline internal section flow velocity matrix and pipeline internal component matrix are respectively constructed based on the processed transient simulation results at the current moment and the processed non-dynamic tracking results of the gas source components at the previous moment.

[0061] This application focuses on the changes between components at adjacent moments. Therefore, when performing transient simulation calculations at the current moment, it is necessary to obtain the transient simulation results at the previous moment to determine whether the transient simulation results at the current moment meet the first operation conditions (i.e., determine whether the transient simulation at the current moment corresponding to the transient simulation results at the current moment is the first transient simulation operation). If not (i.e., the transient simulation at the current moment corresponding to the transient simulation results at the current moment is not the first transient simulation operation), the transient simulation results at the previous moment are directly determined. If satisfied (i.e., the transient simulation at the current moment corresponding to the transient simulation results at the current moment is the first transient simulation operation), the absolute flow balance error rate calculation, flow balance processing, node continuity equation group matrix construction and sparse matrix solution are performed on the transient simulation results at the previous moment to obtain the non-dynamic tracking results of the gas source components at the previous moment, and use them as the initial value of the pipeline tracking process; wherein, the non-dynamic tracking results of the gas source components at the previous moment are shown in Table 1:

[0062] Table 1

[0063]

[0064] The first column is the non-gas source node number, the first row is the gas source node number, taking the second row as an example, 0% of the gas at node 826283 comes from gas source 1670100, 0% comes from 900006, 52% comes from 900001, 48% comes from 900010, and 0% comes from 900008;

[0065] Among them, the dynamic tracking results of the gas source components at the previous moment are shown in Table 2:

[0066] Table 2

[0067]

[0068] The first column is the name of each pipeline section, the first line is the gas source node number, taking the second line as an example, 45890_0_45885_45887 means that the gas flows from node 45885 to node 45887 in the pipeline numbered 45890, section 0. 0% of the gas in this section comes from gas source 1670100, 0% comes from 900006, 52% comes from 900001, 48% comes from 900010, and 0% comes from 900008.

[0069] In addition to obtaining the dynamic tracking results of the gas source components at the previous moment, it is also necessary to obtain the simulation calculation results at the current moment, as shown in Table 3:

[0070] Table 3

[0071]

[0072] The first column pipe_code is the pipeline number, the second column source is the starting node where the pipeline flow flows in, the third column target is the end node where the pipeline flow flows out, the fourth column q is the flow of each section after the pipeline is divided into three sections, and the fifth column v is the flow velocity of each section.

[0073] Step S12: performing data processing on the transient simulation results at the current moment and the dynamic tracking results of the gas source components at the previous moment, and constructing a pipeline internal segment flow velocity matrix and a pipeline internal component matrix based on the processed transient simulation results at the current moment and the processed dynamic tracking results of the gas source components at the previous moment, respectively, and solving the pipeline internal segment flow velocity matrix and the pipeline internal component matrix to obtain a general solution for the components of the first and last segments of the pipeline.

[0074] It is worth noting that if the transient simulation result at the current moment is not calculated for the first time, the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment are processed; if the transient simulation result at the current moment is calculated for the first time, the transient simulation result at the current moment and the non-dynamic tracking result of the gas source component at the previous moment are processed.

[0075] In this embodiment, taking the data processing of the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment as an example: determine whether the flow rate in the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment is a negative number; if the flow rate in the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment is a negative number, the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment are processed with a negative flow value to obtain the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment after the negative flow value processing, and the negative flow value processing is performed on the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment. The transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment are subjected to minimum value processing and problem node processing to obtain the processed transient simulation result at the current moment and the processed dynamic tracking result of the gas source component at the previous moment; if the flow rate in the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment is not a negative number, the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment are directly subjected to minimum value processing and problem node processing to obtain the processed transient simulation result at the current moment and the processed dynamic tracking result of the gas source component at the previous moment. Determine whether the pipeline flow in the processed transient simulation result at the current moment is consistent with the pipeline flow in the processed gas source component dynamic tracking result at the previous moment; if the processed transient simulation result at the current moment is consistent with the pipeline flow in the processed gas source component dynamic tracking result at the previous moment, then construct a pipeline internal pipe segment flow velocity matrix based on the processed transient simulation result at the current moment, and construct a pipeline internal component matrix based on the processed gas source component dynamic tracking result at the previous moment; if the processed transient simulation result at the current moment is inconsistent with the pipeline flow in the processed gas source component dynamic tracking result at the previous moment, then reverse the pipeline segment components of the processed transient simulation result at the current moment and the processed gas source component dynamic tracking result at the previous moment, then construct a pipeline internal pipe segment flow velocity matrix based on the reversed transient simulation result at the current moment, construct a pipeline internal component matrix based on the reversed gas source component dynamic tracking result at the previous moment, and solve the pipeline internal pipe segment flow velocity matrix and pipeline internal component matrix to obtain a general solution of the components of the first and last pipe segments of the pipeline.

[0076] Data processing mainly involves three aspects: negative flow processing, minimum flow processing and problem node processing. Figure 2As shown in the figure: First, the negative flow value is processed. In the simulation calculation, the positive and negative signs of the flow indicate the gas flow direction, and the flow direction is crucial in tracking. Therefore, in the subsequent numerical calculation, the negative value needs to be converted into a positive value for calculation. In addition, the inlet and outlet nodes at both ends of the pipeline need to be swapped, and the pipe section flow and pipe section flow velocity need to be flipped and converted into positive values; then the minimum value is processed. The simulation calculation results are statistically analyzed, and it is found that the flow in the results has minimum values ​​such as 1e-10 and 1e-15. In real scenarios, such flow can be treated as 0, which means that there is no flow in the pipeline. For pipelines with no flow, there is no need to track them, so such pipelines with very small flow should be filtered out. Data, which reduces the number of pipelines to a certain extent, helps to improve the efficiency of tracking calculations; finally, the problem node processing, in the tracking project, the known node types mainly include gas sources, users and other nodes, among which the gas source is used as a gas supply node, and when the flow rate is not 0, it is always used as the gas outlet of the gas flow direction; the user is used as a gas consumption node, and when the flow rate is not 0, it is always used as the gas inlet of the gas flow direction. However, in the simulation calculation, due to calculation errors and errors, there are situations where the gas source is used as a gas consumption node and the user is used as a gas outlet node, which does not conform to the logic of the pipeline network flow direction. Therefore, the pipelines flowing downward are screened out to avoid the influence of such problem nodes on subsequent tracking calculations.

[0077] In this embodiment, the pipe section pre-solving step includes: constructing a pipe section flow velocity matrix and a pipe section component matrix inside the pipeline, and solving the pipe section flow velocity matrix and the pipe section component matrix inside the pipeline to obtain a general solution of the components of the first and last pipe sections of the pipeline; wherein the pipe section flow velocity matrix inside the pipeline is:

[0078] ;

[0079] in, is the flow rate matrix of the pipe segment inside the pipeline, u is the flow rate, t is the duration, l is the length, and m is the number of pipe segments;

[0080] The internal component matrix of the pipeline is:

[0081] ;

[0082] Here, x is the concentration of the component.

[0083] The pipeline pre-solution process is as follows: Figure 3 As shown, the pipe segment pre-solution needs to use the current moment transient simulation results and the previous moment tracking results to construct the pipeline internal pipe segment flow rate matrix and the pipeline internal component matrix, where the previous moment tracking results include the previous moment transient simulation results or the previous moment gas source component non-dynamic tracking results: If the current moment transient simulation result is the first calculation, then the pipeline internal component matrix is ​​constructed based on the current moment transient simulation results and the previous moment gas source component non-dynamic tracking results. If the current transient simulation result is not the first calculation, the internal component matrix of the pipeline is constructed based on the current transient simulation result and the previous transient simulation result. For the transient simulation results obtained at the current moment, the flow velocity, length, number of pipe segments, and the time interval between the two simulations of each pipe segment are known, and the flow velocity matrix of the pipe segment inside the pipeline is constructed. It should be noted that it is necessary to determine whether the flow direction of the same pipeline at two times is consistent. If not, it is necessary to flip the pipe segment components of the tracking results before proceeding to the next step. , find the relationship between the first and last pipe sections of each pipeline, and obtain the general solution of the first and last pipe section components of the pipeline to complete the pre-solution of the pipe section. The specific formula is derived as follows:

[0084] A pipeline is divided into m sections. The simulation results of each section of the pipeline at time t, the concentration x of a certain component, the flow rate u, and the length l are known. According to the component transport equation, we can get:

[0085] ;

[0086] Discretize the above equation, perform forward difference on the time term, and perform central difference on the convection term to obtain the adjacent pipe segments (i and i+1) in The change relationship after the moment satisfies:

[0087] ;

[0088] ;

[0089] For m pipe segments:

[0090] ;

[0091] ;

[0092] ;

[0093] Then we have:

[0094] ;

[0095] Where A is a matrix with m rows and m+1 columns. The above system of equations is underdetermined and has no unique solution. A general solution can be found. Assume is a free variable, and the end pipe segment of the pipe network is available express( For the general solution, For a special solution):

[0096] ;

[0097] The list can be as follows: ;

[0098] Among them, n pipes have n such relationships:

[0099] ;

[0100] ;

[0101] ;

[0102] Therefore, the components of all pipe sections inside each pipeline are related to the component concentration at the starting end of the pipeline, and the relationship between the end pipe section and the starting pipe section can be obtained, and the pre-solution of the pipe sections inside the pipeline is completed.

[0103] Step S13: performing flow balance processing on the processed transient simulation results at the current moment, and constructing a pipeline endpoint flow balance matrix and a pipeline endpoint component matrix based on the transient simulation results at the current moment after the flow balance processing.

[0104] In this embodiment, flow balance processing is performed on the processed transient simulation results at the current moment, and a flow balance equation group is generated using the pipeline endpoint flow balance matrix and the pipeline endpoint component matrix. The flow balance equation group is combined with the general solution of the pipeline first and last pipe section components and calculated to obtain the pipeline first and last pipe section components.

[0105] In this embodiment, the pipeline endpoint solution includes flow balance processing and constructing a pipeline endpoint flow balance matrix and a pipeline endpoint component matrix. The pipeline endpoint component solution process is as follows: Figure 4 As shown in the figure, for a node in the pipe network, from an ideal point of view, the sum of its multiple inflow flows is equal to the total outflow of the flow. Using this principle, the present invention uses the flow of each pipeline head and end section in the current moment transient result simulation data to construct the pipeline endpoint flow balance matrix and pipeline endpoint component matrix , forming the flow balance equation group , and combine this set of equations with the set of equations for the relationship between the components of the first and last pipe sections obtained in the pre-solution of the pipe section, so as to obtain the components of the first and last pipe sections of each pipeline and complete the solution of the pipeline endpoints. Flow balance mechanism: From an ideal point of view, it is reasonable to solve the pipeline endpoints, but in real scenarios, adsorption, leakage, and errors in simulation calculations may cause unequal inflow and outflow of nodes. Therefore, blindly using the inflow and outflow of a certain node at both ends to construct a flow balance matrix will cause the flow to be unbalanced, so the subsequent component calculations will also have serious deviations. In response to this problem, the present invention proposes a flow balance mechanism. For non-gas source node equations, the sum of the node inflow flow is used as the total outflow of the node flow, and the actual outflow flow of the node in the simulation measurement is ignored. The deviation of the total outflow of the node is corrected by this method, which effectively ensures the inflow and outflow balance of the node flow.

[0106] For example, the pipe network solution for pipe endpoints Figure 5 As shown in the figure, the solution of pipeline endpoints involves the inflow and outflow of nodes, so an example is used to illustrate the derivation process. The pipeline network has 6 pipelines (n=6) and 6 nodes, of which 1 and 2 are gas source nodes, 3, 4, and 5 are intermediate common nodes, and 6 is a user node. Assume that the proportion of gas sources 1 and 2 in each node is expressed as According to the node flow balance principle, the relationship between the flow at the end of the inflow pipe and the flow at the start of the outflow pipe at each node can be listed.

[0107] Gas source equation:

[0108] ;

[0109] ;

[0110] Other node equations:

[0111] ;

[0112] ;

[0113] ;

[0114] ;

[0115] Can be listed as The system of equations, where:

[0116] ;

[0117] ;

[0118] ;

[0119] Among them, A is a matrix with n rows and 2n columns. The system of equations is underdetermined and has no unique solution. The unique solution can be obtained by combining the above formula to obtain a coefficient matrix with 2n rows and 2n columns. The endpoint components of n pipes can be obtained by calculation, and the solution of the pipe endpoints is completed.

[0120] Step S14: Calculate the components of the first and last pipe sections of the pipeline based on the pipeline endpoint flow balance matrix, the pipeline endpoint component matrix and the first and last pipe section components of the pipeline.

[0121] Step S15: Calculate all pipeline segment components using the pipeline first and last segment components and the pipeline first and last segment components general solution, determine a target pipeline segment component from all the pipeline segment components, and use the target pipeline segment component as a dynamic tracking result of the gas source component of the natural gas pipeline network.

[0122] In this embodiment, the pipeline first and last pipe section components are substituted into the pipeline first and last pipe section components general solution for calculation to obtain all pipeline section components, and a graph search algorithm is used to traverse all the pipeline section components and perform node screening to obtain the target pipeline section components, and the target pipeline section components are used as the gas source component dynamic tracking result of the natural gas pipeline network.

[0123] In this embodiment, the pipe segment solution includes calculating all the pipe segment components by using the first and last pipe segment components of the pipeline and the first and last pipe segment components of the pipeline. The pipe segment solution process is as follows: Figure 6 As shown, according to the above steps, it is known that the , and , by the relationship The composition of each pipe section in the pipeline can be calculated.

[0124] Finally, the specific principle of using the graph search algorithm to traverse all pipeline segment components and perform node screening is as follows: Because transient simulation as a numerical calculation cannot be completely consistent with the actual working conditions and the boundary node assignment is unreasonable, there are local unreasonable situations in the simulation calculation. After analysis, the manifestation of this type of unreasonable situation is mainly the appearance of pseudo-gas source nodes, that is, the node is not a gas source node, there is flow outflow but no flow inflow. According to the above formula and flow balance mechanism, if the inflow flow is 0, the outflow flow is also 0, which can be listed as:

[0125] ;

[0126] The coefficients of the unknown components in the above formula are all 0, so the unknowns have arbitrary solutions, which leads to the arbitrary components of the pipe section of the pipeline where the pseudo gas source node is located, exceeding the theoretical value of the proportion (0%~100%). At the same time, the components of the subordinate pipelines where the flow of the pipeline flows out will also be affected, and then the local unreasonableness will cause problems in the entire tracking result. Therefore, it is necessary to screen out the gas source flow pipeline starting from the pseudo gas source node, and use the graph search method to traverse from the source until there are no subordinate pipelines or the flow of the subordinate pipelines is 0. Although the pseudo gas source node and its subordinate pipeline screening mechanism based on graph search cannot solve the pseudo gas source node problem from the source, the post-processing method of the result effectively reduces the influence of the problem node on the entire tracking result effect, avoiding the presentation of most of the remaining tracking results due to simulation limitations and unreasonable boundary node assignment.

[0127] The specific process of this application is as follows Figure 7 As shown, it mainly includes data acquisition, data processing, pipe section pre-solution, pipeline endpoint solution, flow balance mechanism, pipe section solution and final result post-processing. Since the amount of data involved in the present invention is large, especially for pipeline networks of tens of thousands, the running time cannot be ignored, so a parallel method is used to construct multiple groups of sparse matrices for component solution. First, the transient simulation results of the pipeline at the current moment and the transient simulation results at the previous moment are obtained; then, it is determined whether the transient simulation results at the current moment meet the first operation conditions. If not, the dynamic tracking results of the gas source components at the previous moment are directly determined from the transient simulation results at the previous moment; then, the transient simulation results at the current moment and the dynamic tracking results of the gas source components at the previous moment are processed; then, based on the processed transient simulation results at the current moment and the processed dynamic tracking results of the gas source components at the previous moment, the pipeline internal pipe section flow velocity matrix and the pipeline internal component matrix are respectively constructed, and the pipeline internal pipe section flow velocity matrix and the pipeline internal component matrix are solved. , in order to obtain the general solution of the components of the first and last pipe sections of the pipeline; perform flow balance processing on the processed transient simulation results at the current moment, and construct the pipeline endpoint flow balance matrix and pipeline endpoint component matrix based on the transient simulation results at the current moment after flow balance processing; then calculate the components of the first and last pipe sections of the pipeline based on the pipeline endpoint flow balance matrix, the pipeline endpoint component matrix and the general solution of the components of the first and last pipe sections of the pipeline; finally, use the components of the first and last pipe sections of the pipeline and the general solution of the components of the first and last pipe sections of the pipeline to calculate all the pipeline section components, determine the target pipeline section components from all the pipeline section components, and use the target pipeline section components as the dynamic tracking result of the gas source components of the natural gas pipeline network.

[0128] The innovation of this application is that: (1) based on the existing pipeline network, no additional equipment, operation and maintenance costs are required, and only transient simulation results are used to obtain dynamic tracking results of gas source components through numerical calculation. At the same time, starting from the pain points of traditional tracking implementation methods, the calculation deduction is replaced by matrix calculation instead of graph traversal, the variable storage is replaced by sparse matrix instead of full matrix, and the operation mode is replaced by multi-task parallel instead of single-task serial, which effectively solves the directed closed-loop pipeline network problem that is difficult to solve in traditional tracking methods, greatly reduces the time complexity and space complexity of the entire algorithm, which is particularly significant in the calculation of multi-segment components in large-scale pipelines; (2) the "three-step" framework used in the matrix solution process of the present invention, the three-step framework is as follows Figure 8 As shown in the figure, they are pipe segment pre-solution, pipeline endpoint solution and pipe segment solution respectively. The pipe segment pre-solution derives the general solution through the connection between pipe segments in each pipeline to obtain the relationship between the first and last pipe segments of the same pipeline. The pipe endpoint solution obtains the relationship between the first and last pipe segments of different pipelines through the principle of node flow balance, and solves the components of the first and last pipe segments of each pipeline based on this, and then solves the components of each pipe segment of each pipeline by re-substituting the relationship between the first and last pipe segments of the same pipeline. From theoretical derivation to technical implementation, from pre-solving of pipe sections to solving of pipeline endpoints and finally solving of pipe sections, the calculation process is clearer, and it is easier to discover and solve detailed problems in the algorithm, making the algorithm more stable and reliable; (3) The data processing ideas (negative flow processing, minimum flow processing, problem node processing) and flow balance mechanism for simulation data proposed in the present invention, as well as the pseudo gas source node and its subordinate pipeline screening mechanism based on graph search for tracking results effectively reduce the impact of poor simulation results on tracking, and improve the rationality of dynamic tracking of gas source components; (4) The present invention applies the component transport equation to the construction of the dynamic relationship matrix of pipeline network components, realizes the dynamic component analysis function of dynamic tracking of gas source components, and meets the requirements of component tracking tasks that emphasize dynamic changes of components, such as hydrogenation, odorization, and sudden changes in gas source flow.

[0129] In this embodiment, the transient simulation result of the pipeline at the current moment and the transient simulation result of the previous moment are obtained to determine whether the transient simulation result at the current moment meets the initial operation condition. If the transient simulation result at the current moment does not meet the initial operation condition, the dynamic tracking result of the gas source component at the previous moment is determined from the transient simulation result at the previous moment; data processing is performed on the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment, and a pipeline internal segment flow rate matrix and a pipeline internal component matrix are respectively constructed based on the processed transient simulation result at the current moment and the processed dynamic tracking result of the gas source component at the previous moment, and the pipeline internal segment flow rate matrix and the pipeline internal component matrix are respectively constructed based on the processed transient simulation result at the current moment and the processed dynamic tracking result of the gas source component at the previous moment. The matrix is ​​solved to obtain a general solution for the components of the first and last pipe sections of the pipeline; flow balance processing is performed on the processed transient simulation results at the current moment, and a pipeline endpoint flow balance matrix and a pipeline endpoint component matrix are constructed based on the transient simulation results at the current moment after the flow balance processing; the components of the first and last pipe sections of the pipeline are calculated based on the pipeline endpoint flow balance matrix, the pipeline endpoint component matrix and the general solution of the components of the first and last pipe sections of the pipeline; all pipeline section components are calculated using the components of the first and last pipe sections of the pipeline and the general solution of the components of the first and last pipe sections of the pipeline, a target pipeline section component is determined from all the pipeline section components, and the target pipeline section component is used as a dynamic tracking result of the gas source component of the natural gas pipeline network. The present application processes data of transient simulation results at the current moment and dynamic tracking results of gas source components at the previous moment, adopts a series of matrix solving processes, constructs a flow velocity matrix of the internal pipe section of the pipeline and a component matrix of the internal pipe section of the pipeline, and then solves them to obtain a general solution of the components of the first and last pipe sections of the pipeline, constructs a flow balance matrix of the pipeline endpoints and a component matrix of the pipeline endpoints, thereby calculating the components of the first and last pipe sections of the pipeline, realizing dynamic tracking of gas source components of the natural gas pipeline network, reducing the complexity of calculating dynamic tracking of gas source components, effectively solving the problem of directed closed-loop pipeline networks that is difficult to solve in traditional tracking methods, reducing the impact of simulation results on tracking, improving the calculation efficiency of dynamic tracking of gas source components of the natural gas pipeline network, and improving the rationality and reliability of tracking results.

[0130] See also Fig. 9 As shown, the embodiment of the present invention discloses a natural gas pipeline network gas source component dynamic tracking device, which may specifically include:

[0131] The judgment module 11 is used to obtain the transient simulation result of the pipeline at the current moment and the transient simulation result at the previous moment, and judge whether the transient simulation result at the current moment meets the initial operation condition. If the transient simulation result at the current moment does not meet the initial operation condition, the dynamic tracking result of the gas source component at the previous moment is determined from the transient simulation result at the previous moment;

[0132] The matrix construction and solution module 12 is used to perform data processing on the transient simulation results at the current moment and the dynamic tracking results of the gas source components at the previous moment, and respectively construct a pipeline internal segment flow rate matrix and a pipeline internal component matrix based on the processed transient simulation results at the current moment and the processed dynamic tracking results of the gas source components at the previous moment, and solve the pipeline internal segment flow rate matrix and the pipeline internal component matrix to obtain a general solution for the components of the first and last segments of the pipeline;

[0133] A flow balance processing module 13 is used to perform flow balance processing on the processed transient simulation result at the current moment, and to construct a pipeline endpoint flow balance matrix and a pipeline endpoint component matrix based on the transient simulation result at the current moment after the flow balance processing;

[0134] A pipe segment component calculation module 14 is used to calculate the components of the first and last pipe segments of the pipeline based on the pipeline endpoint flow balance matrix, the pipeline endpoint component matrix and the first and last pipe segment components of the pipeline;

[0135] The gas source component dynamic tracking result determination module 15 is used to calculate all pipeline segment components using the pipeline first and last segment components and the pipeline first and last segment components general solution, determine the target pipeline segment component from all the pipeline segment components, and use the target pipeline segment component as the gas source component dynamic tracking result of the natural gas pipeline network.

[0136] In this embodiment, the transient simulation result of the pipeline at the current moment and the transient simulation result of the previous moment are obtained to determine whether the transient simulation result at the current moment meets the initial operation condition. If the transient simulation result at the current moment does not meet the initial operation condition, the dynamic tracking result of the gas source component at the previous moment is determined from the transient simulation result at the previous moment; data processing is performed on the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment, and a pipeline internal segment flow rate matrix and a pipeline internal component matrix are respectively constructed based on the processed transient simulation result at the current moment and the processed dynamic tracking result of the gas source component at the previous moment, and the pipeline internal segment flow rate matrix and the pipeline internal component matrix are respectively constructed based on the processed transient simulation result at the current moment and the processed dynamic tracking result of the gas source component at the previous moment. The matrix is ​​solved to obtain a general solution for the components of the first and last pipe sections of the pipeline; flow balance processing is performed on the processed transient simulation results at the current moment, and a pipeline endpoint flow balance matrix and a pipeline endpoint component matrix are constructed based on the transient simulation results at the current moment after the flow balance processing; the components of the first and last pipe sections of the pipeline are calculated based on the pipeline endpoint flow balance matrix, the pipeline endpoint component matrix and the general solution of the components of the first and last pipe sections of the pipeline; all pipeline section components are calculated using the components of the first and last pipe sections of the pipeline and the general solution of the components of the first and last pipe sections of the pipeline, a target pipeline section component is determined from all the pipeline section components, and the target pipeline section component is used as a dynamic tracking result of the gas source component of the natural gas pipeline network. The present application processes data of transient simulation results at the current moment and dynamic tracking results of gas source components at the previous moment, adopts a series of matrix solving processes, constructs a flow velocity matrix of the internal pipe section of the pipeline and a component matrix of the internal pipe section of the pipeline, and then solves them to obtain a general solution of the components of the first and last pipe sections of the pipeline, constructs a flow balance matrix of the pipeline endpoints and a component matrix of the pipeline endpoints, thereby calculating the components of the first and last pipe sections of the pipeline, realizing dynamic tracking of gas source components of the natural gas pipeline network, reducing the complexity of calculating dynamic tracking of gas source components, effectively solving the problem of directed closed-loop pipeline networks that is difficult to solve in traditional tracking methods, reducing the impact of simulation results on tracking, improving the calculation efficiency of dynamic tracking of gas source components of the natural gas pipeline network, and improving the rationality and reliability of tracking results.

[0137] In some specific embodiments, the determination module 11 may specifically include:

[0138] The gas source component non-dynamic tracking calculation module is used to perform a gas source component non-dynamic tracking calculation on the transient simulation result at the previous moment if the transient simulation result at the current moment meets the first operation condition, so as to obtain the gas source component non-dynamic tracking result at the previous moment; the gas source component non-dynamic tracking calculation includes absolute flow balance error rate calculation, flow balance processing, node continuity equation group matrix construction and sparse matrix solution;

[0139] The flow rate matrix and component matrix construction module is used to perform data preprocessing on the non-dynamic tracking results of the gas source components at the previous moment, and to respectively construct the pipeline internal pipe section flow rate matrix and the pipeline internal component matrix based on the processed transient simulation results at the current moment and the processed non-dynamic tracking results of the gas source components at the previous moment.

[0140] In some specific embodiments, the matrix construction and solution module 12 may specifically include:

[0141] A flow rate determination module, used to determine whether the flow rates in the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment are negative numbers;

[0142] A flow negative value processing module, used for, if the flow in the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment is a negative number, performing flow negative value processing on the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment to obtain the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment after the flow negative value processing, performing minimum value processing and problem node processing on the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment after the flow negative value processing to obtain the processed transient simulation result at the current moment and the processed dynamic tracking result of the gas source component at the previous moment;

[0143] The minimum value processing and problem node processing module is used to directly perform minimum value processing and problem node processing on the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment if the flow rate in the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment is not negative, so as to obtain the processed transient simulation result at the current moment and the processed dynamic tracking result of the gas source component at the previous moment.

[0144] In some specific embodiments, the flow balance processing module 13 may specifically include:

[0145] A pipeline flow consistency judgment module is used to judge whether the pipeline flow in the processed transient simulation result at the current moment and the processed gas source component dynamic tracking result at the previous moment are consistent;

[0146] A pipeline internal component matrix construction module is used to construct a pipeline internal pipe segment flow rate matrix based on the processed current moment transient simulation result if the pipeline flow in the processed gas source component dynamic tracking result at the previous moment is consistent with that in the processed gas source component dynamic tracking result at the previous moment, and to construct a pipeline internal component matrix based on the processed gas source component dynamic tracking result at the previous moment;

[0147] The module for constructing the flow rate matrix of the internal pipe section of the pipeline is used to flip the pipe section components of the processed transient simulation results at the current moment and the processed dynamic tracking results of the gas source components at the previous moment if the pipeline flow rates in the processed transient simulation results at the current moment are inconsistent with those in the processed dynamic tracking results of the gas source components at the previous moment, and then construct the flow rate matrix of the internal pipe section of the pipeline based on the flipped transient simulation results at the current moment, and construct the internal component matrix of the pipeline based on the flipped dynamic tracking results of the gas source components at the previous moment.

[0148] In some specific embodiments, the flow rate matrix of the pipe section inside the pipeline is:

[0149] ;

[0150] in, is the flow rate matrix of the pipe segment inside the pipeline, u is the flow rate, t is the duration, l is the length, and m is the number of pipe segments;

[0151] Correspondingly, the internal component matrix of the pipeline is:

[0152] ;

[0153] Here, x is the concentration of the component.

[0154] In some specific embodiments, the pipe segment component calculation module 14 may specifically include:

[0155] A flow balance equation group generating module, used for generating a flow balance equation group using the pipeline endpoint flow balance matrix and the pipeline endpoint component matrix;

[0156] The pipeline first and last pipe section component calculation module is used to combine and calculate the flow balance equation group and the first and last pipe section component general solution to obtain the pipeline first and last pipe section components.

[0157] In some specific embodiments, the gas source component dynamic tracking result determination module 15 may specifically include:

[0158] The pipeline section component calculation module is used to substitute the pipeline first and last section components into the pipeline first and last section components general solution for calculation to obtain all pipeline section components;

[0159] The screening module is used to traverse all the pipeline segment components and perform node screening using a graph search algorithm to obtain a target pipeline segment component.

[0160] Fig.10A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the method for dynamically tracking gas source components of a natural gas pipeline network performed by an electronic device disclosed in any of the aforementioned embodiments.

[0161] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0162] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 221, a computer program 222 and data 223, etc. The storage method can be temporary storage or permanent storage.

[0163] Among them, the operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, so as to realize the operation and processing of the data 223 in the memory 22 by the processor 21, which can be Windows, Unix, Linux, etc. In addition to including a computer program that can be used to complete the natural gas pipeline network gas source component dynamic tracking method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks. In addition to including data transmitted from an external device received by the natural gas pipeline network gas source component dynamic tracking device, the data 223 can also include data collected by its own input and output interface 25, etc.

[0164] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0165] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, the steps of the method for dynamically tracking gas source components of a natural gas pipeline network disclosed in any of the aforementioned embodiments are implemented.

[0166] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0167] The above is a detailed introduction to a method, device, equipment and storage medium for dynamically tracking gas source components in a natural gas pipeline network provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for a person skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for dynamically tracking gas source components in a natural gas pipeline network, characterized in that: include: Obtaining the current moment transient simulation result and the previous moment transient simulation result of the pipeline, judging whether the current moment transient simulation result meets the first operation condition, and if the current moment transient simulation result does not meet the first operation condition, determining the gas source component dynamic tracking result at the previous moment from the previous moment transient simulation result; Data processing is performed on the transient simulation results at the current moment and the dynamic tracking results of the gas source components at the previous moment, and a pipeline internal segment flow velocity matrix and a pipeline internal component matrix are respectively constructed based on the processed transient simulation results at the current moment and the processed dynamic tracking results of the gas source components at the previous moment, and the pipeline internal segment flow velocity matrix and the pipeline internal component matrix are solved to obtain a general solution of the components of the first and last segments of the pipeline; the data processing includes negative flow processing, minimum flow processing and problem node processing; Performing flow balance processing on the processed transient simulation results at the current moment, and constructing a pipeline endpoint flow balance matrix and a pipeline endpoint component matrix based on the transient simulation results at the current moment after the flow balance processing; Calculate the components of the first and last pipe sections of the pipeline based on the pipeline endpoint flow balance matrix, the pipeline endpoint component matrix and the first and last pipe section components of the pipeline; Calculate all pipeline segment components by using the pipeline first and last segment components and the pipeline first and last segment components general solution, determine the target pipeline segment component from all the pipeline segment components, and use the target pipeline segment component as the gas source component dynamic tracking result of the natural gas pipeline network; Wherein, the pipeline internal pipe segment flow rate matrix and pipeline internal component matrix are respectively constructed based on the processed transient simulation result at the current moment and the processed dynamic tracking result of the gas source component at the previous moment, including: judging whether the pipeline flow in the processed transient simulation result at the current moment and the processed dynamic tracking result of the gas source component at the previous moment is consistent; if the pipeline flow in the processed transient simulation result at the current moment and the processed dynamic tracking result of the gas source component at the previous moment is consistent, then constructing the pipeline internal pipe segment flow rate matrix based on the processed transient simulation result at the current moment, and constructing the pipeline internal component matrix based on the processed dynamic tracking result of the gas source component at the previous moment; if the pipeline flow in the processed transient simulation result at the current moment and the processed dynamic tracking result of the gas source component at the previous moment is inconsistent, then performing pipe segment component flipping on the processed transient simulation result at the current moment and the processed dynamic tracking result of the gas source component at the previous moment, and then constructing the pipeline internal pipe segment flow rate matrix based on the flipped transient simulation result at the current moment, and constructing the pipeline internal component matrix based on the flipped dynamic tracking result of the gas source component at the previous moment; The flow velocity matrix of the internal pipe section of the pipeline is: ; in, is the flow velocity matrix of the pipe segment inside the pipeline, u is the flow velocity, t is the time, l is the length, m is the number of pipe segments, For the first pipe segment at t+ The flow rate at the moment, For the second pipe segment at t+ The flow rate at the moment, For the mth pipe segment at t+ Flow rate at the time; Correspondingly, the internal component matrix of the pipeline is: ; Where x is the component concentration; The method of solving the pipeline internal segment velocity matrix and the pipeline internal component matrix to obtain a general solution for the pipeline first and last segment components includes: constructing an internal segment component equation group based on the pipeline internal segment velocity matrix and the pipeline internal component matrix, solving the internal segment component equation group to obtain a relationship between each pipeline first and last segment, and obtaining a general solution for the pipeline first and last segment components; the internal segment component equation group is: ; ; set up is a free variable, then the terminal pipe section of the pipe network is , It is the general solution of the components of the first and last sections of the pipeline. The pipeline end pipe section component is a special solution; the pipeline end pipe section component is calculated based on the pipeline end point flow balance matrix, the pipeline end point component matrix and the pipeline end pipe section component general solution, including: using the pipeline end point flow balance matrix and the pipeline end point component matrix to generate a flow balance equation group; the flow balance equation group is combined with the pipeline end pipe section component general solution and calculated to obtain the pipeline end pipe section component; The method of calculating all pipeline segment components by using the pipeline first and last segment components and the pipeline first and last segment components general solution, and determining the target pipeline segment components from all the pipeline segment components, comprises: , and , according to the formula The components of each pipe section in the pipeline can be calculated to obtain all the pipeline section components; the gas source flow pipeline starting from the pseudo gas source node is screened out, and the graph search method is used to traverse from the source until there are no subordinate pipelines or the subordinate pipeline flow is 0, so as to complete the traversal and node screening of all pipeline section components, and obtain the target pipeline section components after traversal and node screening.

2. The method for dynamically tracking gas source components in a natural gas pipeline network according to claim 1, characterized in that: After determining whether the transient simulation result at the current moment meets the first operation condition, the method further includes: If the transient simulation result at the current moment meets the first operation condition, a non-dynamic tracking calculation of the gas source component is performed on the transient simulation result at the previous moment to obtain the non-dynamic tracking result of the gas source component at the previous moment; the non-dynamic tracking calculation of the gas source component includes absolute flow balance error rate calculation, flow balance processing, node continuity equation group matrix construction and sparse matrix solution; The non-dynamic tracking result of the gas source component at the previous moment is subjected to data preprocessing, and a pipeline internal segment flow rate matrix and a pipeline internal component matrix are respectively constructed based on the processed transient simulation result at the current moment and the processed non-dynamic tracking result of the gas source component at the previous moment.

3. The method for dynamically tracking gas source components of a natural gas pipeline network according to claim 1, characterized in that: The data processing of the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment includes: Determine whether the flow rate in the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment is a negative number; If the flow rate in the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment is a negative number, the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment are processed with a negative flow value to obtain the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment after the negative flow value processing, and the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment after the negative flow value processing are processed with a minimum value and a problem node to obtain the processed transient simulation result at the current moment and the processed dynamic tracking result of the gas source component at the previous moment; If the flow rate in the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment is not negative, the transient simulation result at the current moment and the dynamic tracking result of the gas source component at the previous moment are directly subjected to minimum value processing and problem node processing to obtain the processed transient simulation result at the current moment and the processed dynamic tracking result of the gas source component at the previous moment.

4. The method for dynamically tracking gas source components of a natural gas pipeline network according to any one of claims 1 to 3, characterized in that: The step of calculating all pipeline segment components by using the pipeline first and last segment components and the pipeline first and last segment components general solution, and determining the target pipeline segment component from all the pipeline segment components, comprises: Substitute the components of the first and last pipe sections of the pipeline into the general solution of the components of the first and last pipe sections of the pipeline for calculation to obtain the components of all pipeline sections; A graph search algorithm is used to traverse all of the pipeline segment components and perform node screening to obtain a target pipeline segment component.

5. A natural gas pipeline network gas source component dynamic tracking device, characterized in that: include: A judgment module, used for obtaining the transient simulation result of the pipeline at the current moment and the transient simulation result at the previous moment, judging whether the transient simulation result at the current moment meets the initial operation condition, and if the transient simulation result at the current moment does not meet the initial operation condition, determining the dynamic tracking result of the gas source component at the previous moment from the transient simulation result at the previous moment; A matrix construction and solution module is used to perform data processing on the transient simulation results at the current moment and the dynamic tracking results of the gas source components at the previous moment, and to respectively construct a pipeline internal segment flow rate matrix and a pipeline internal component matrix based on the processed transient simulation results at the current moment and the processed dynamic tracking results of the gas source components at the previous moment, and to solve the pipeline internal segment flow rate matrix and the pipeline internal component matrix to obtain a general solution for the components of the first and last segments of the pipeline; the data processing includes negative flow processing, minimum flow processing and problem node processing; A flow balance processing module, used for performing flow balance processing on the processed transient simulation result at the current moment, and constructing a pipeline endpoint flow balance matrix and a pipeline endpoint component matrix based on the transient simulation result at the current moment after the flow balance processing; A pipe segment component calculation module, used for calculating the components of the first and last pipe segments of the pipeline based on the pipeline endpoint flow balance matrix, the pipeline endpoint component matrix and the first and last pipe segment components of the pipeline; A gas source component dynamic tracking result determination module is used to calculate all pipeline segment components by using the pipeline first and last segment components and the pipeline first and last segment components general solution, determine the target pipeline segment component from all the pipeline segment components, and use the target pipeline segment component as the gas source component dynamic tracking result of the natural gas pipeline network; Wherein, the pipeline internal pipe segment flow rate matrix and pipeline internal component matrix are respectively constructed based on the processed transient simulation result at the current moment and the processed dynamic tracking result of the gas source component at the previous moment, including: judging whether the pipeline flow in the processed transient simulation result at the current moment and the processed dynamic tracking result of the gas source component at the previous moment is consistent; if the pipeline flow in the processed transient simulation result at the current moment and the processed dynamic tracking result of the gas source component at the previous moment is consistent, then constructing the pipeline internal pipe segment flow rate matrix based on the processed transient simulation result at the current moment, and constructing the pipeline internal component matrix based on the processed dynamic tracking result of the gas source component at the previous moment; if the pipeline flow in the processed transient simulation result at the current moment and the processed dynamic tracking result of the gas source component at the previous moment is inconsistent, then performing pipe segment component flipping on the processed transient simulation result at the current moment and the processed dynamic tracking result of the gas source component at the previous moment, and then constructing the pipeline internal pipe segment flow rate matrix based on the flipped transient simulation result at the current moment, and constructing the pipeline internal component matrix based on the flipped dynamic tracking result of the gas source component at the previous moment; The flow velocity matrix of the internal pipe section of the pipeline is: ; in, is the flow velocity matrix of the pipe segment inside the pipeline, u is the flow velocity, t is the time, l is the length, m is the number of pipe segments, For the first pipe segment at t+ The flow rate at the moment, For the second pipe segment at t+ The flow rate at the moment, For the mth pipe segment at t+ Flow rate at the time; Correspondingly, the internal component matrix of the pipeline is: ; Where x is the component concentration; The method of solving the pipeline internal segment velocity matrix and the pipeline internal component matrix to obtain a general solution for the pipeline first and last segment components includes: constructing an internal segment component equation group based on the pipeline internal segment velocity matrix and the pipeline internal component matrix, solving the internal segment component equation group to obtain a relationship between each pipeline first and last segment, and obtaining a general solution for the pipeline first and last segment components; the internal segment component equation group is: ; ; set up is a free variable, then the terminal pipe section of the pipe network is , It is the general solution of the components of the first and last sections of the pipeline. The pipeline end pipe section component is a special solution; the pipeline end pipe section component is calculated based on the pipeline end point flow balance matrix, the pipeline end point component matrix and the pipeline end pipe section component general solution, including: using the pipeline end point flow balance matrix and the pipeline end point component matrix to generate a flow balance equation group; the flow balance equation group is combined with the pipeline end pipe section component general solution and calculated to obtain the pipeline end pipe section component; The method of calculating all pipeline segment components by using the pipeline first and last segment components and the pipeline first and last segment components general solution, and determining the target pipeline segment components from all the pipeline segment components, comprises: , and , according to the formula The components of each pipe section in the pipeline can be calculated to obtain all the pipeline section components; the gas source flow pipeline starting from the pseudo gas source node is screened out, and the graph search method is used to traverse from the source until there are no subordinate pipelines or the subordinate pipeline flow is 0, so as to complete the traversal and node screening of all pipeline section components, and obtain the target pipeline section components after traversal and node screening.

Citation Information

Patent Citations

  • Natural gas component determination and gas source composition determination method and device

    CN113192570A

  • Dynamic tracking and real-time calculation system and method for natural gas components in natural gas pipeline network

    CN113239645A

  • Dynamic component tracking method for natural gas pipeline network

    CN117034517A

  • Dynamic gas source proportion tracking method for natural gas pipeline network

    CN117077336A

  • Steady state traceability monitoring analysis method, device and equipment of natural gas pipeline network and medium

    CN118171500A