A method for regulating hydrogen blending ratio of natural gas pipeline

CN122544260APending Publication Date: 2026-08-11苏州泰汐燃气工程设计有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-18
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

[0003]现有的掺氢比例调控方法在技术实现上存在明显的不足,多数方法依赖于纯数据驱动模型,忽视了物理规律的约束,导致预测结果容易出现失真,即过度依赖训练数据而缺乏对实际物理过程的准确理解;同时,现有技术多采用固定阈值来判断掺氢的安全性,无法适应工况的动态变化,降低了系统的灵活性和可靠性,而传统的腐蚀检测方法也通常使用单一阈值进行判定,对工况变化的响应迟钝,难以及时发现潜在风险;且在误差计算方面,现有方法往往采用固定时间窗口进行统计,无法快速响应工况突变,从而影响调控的实时性和精度;此外,多数方法处理温度、压力和腐蚀等数据,缺乏对多源数据的融合分析

Benefits of technology

本申请公开了一种天然气管道掺氢比例调控方法,包括:本发明通过历史与实时数据的分段处理及物理约束方程组融合,确保预测值严格遵循流体力学与热力学规律,避免传统数据驱动方法的物理不可解释性;其次,采用滑动窗口误差计算与自适应窗口调整机制,结合温度、湿度、压力补偿系数动态修正预测值,实现快速收敛;再者,通过腐蚀模式聚类与泄漏特征加权融合,将腐蚀速率阈值与泄漏判定阈值动态关联工况参数,提升异常检测灵敏度;最后,引入自适应阈值调整机制,根据环境温度、大气压力等外部条件动态修正压力、温度阈值,该方法通过物理规律与数据驱动的深度融合,实现了从被动响应到主动预测调控的转变,显著提升管道运行的安全性与经济性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122544260A_ABST
    Figure CN122544260A_ABST
Patent Text Reader

Abstract

This invention relates to the field of natural gas technology, and discloses a method for controlling the hydrogen blending ratio in natural gas pipelines. The method includes: acquiring pipeline data in real time to obtain a second dataset; segmenting the first and second datasets to obtain segmented datasets; dividing the segmented datasets into a set of physical constraint equations; fusing the physical constraint equations to obtain a third dataset; introducing compensation coefficients; using the third dataset and compensation coefficients to predict temperature; and outputting the predicted temperature value. This invention employs a sliding window error calculation and adaptive window adjustment mechanism, dynamically correcting the predicted value based on temperature, humidity, and pressure compensation coefficients to achieve rapid convergence. Furthermore, it dynamically correlates corrosion rate thresholds and leakage judgment thresholds with operating parameters to improve anomaly detection sensitivity. Through the deep integration of physical laws and data-driven approaches, the safety and economy of pipeline operation are significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural gas technology, and more specifically, to a method for controlling the hydrogen blending ratio in natural gas pipelines. Background Technology

[0002] The hydrogen blending ratio in natural gas pipelines refers to the mixing of a certain amount of hydrogen with natural gas during the natural gas transportation process to increase the hydrogen content of the gas in the pipeline. This ratio is usually determined based on the pipeline material, operating conditions, and the physicochemical properties of hydrogen, aiming to ensure the safety and economy of the pipeline. Optimizing the hydrogen blending ratio can promote the application of green energy, reduce carbon emissions, and meet the hydrogen concentration requirements of different application scenarios.

[0003] Existing methods for controlling hydrogen doping ratios have significant shortcomings in terms of technical implementation. Most methods rely on purely data-driven models, neglecting the constraints of physical laws, which leads to distorted prediction results. In other words, they over-rely on training data and lack an accurate understanding of the actual physical processes. At the same time, existing technologies often use fixed thresholds to judge the safety of hydrogen doping, which cannot adapt to dynamic changes in operating conditions, reducing the flexibility and reliability of the system. Traditional corrosion detection methods also typically use a single threshold for judgment, which is slow to respond to changes in operating conditions and makes it difficult to detect potential risks in a timely manner. In terms of error calculation, existing methods often use fixed time windows for statistics, which cannot quickly respond to sudden changes in operating conditions, thus affecting the real-time performance and accuracy of control. In addition, most methods process data such as temperature, pressure, and corrosion, lacking the fusion analysis of multi-source data. Summary of the Invention

[0004] To overcome the above-mentioned defects of the prior art, embodiments of the present invention provide a method for controlling the hydrogen blending ratio in natural gas pipelines.

[0005] To achieve the above objectives, the present invention provides the following technical solution: A method for controlling the hydrogen blending ratio in a natural gas pipeline, the method comprising: S101: Collect pipeline operation history records to obtain pipeline historical data, preprocess the pipeline historical data to obtain the first dataset; S102: Real-time acquisition of pipeline data to obtain the second dataset, segmentation of the first and second datasets to obtain segmented datasets, division of physical constraint equations based on segmented datasets, fusion of physical constraint equations to obtain the third dataset, introduction of compensation coefficients, use of the third dataset and compensation coefficients to perform temperature prediction, and output of temperature prediction values. S103: Extract corrosion data from the first dataset, cluster the corrosion data, and identify corrosion patterns under different working conditions; derive leakage judgment results based on the second dataset; S104: A basic threshold table is set using physical constraint equations, real-time corrosion data, and leakage judgment results. The basic threshold table is then modified and an adaptive adjustment mechanism is introduced to obtain an optimized threshold table, which is then combined with a real-time control strategy for the optimized threshold.

[0006] Furthermore, both the first and second datasets include: pressure data, flow rate data, temperature data, humidity data, hydrogen concentration data, corrosion rate data, and leakage data; The pressure data includes steady-state / transient pressure values ​​under different hydrogen doping ratios; The segmentation process for the first and second datasets specifically involves: Read the traffic data from the first dataset and the second dataset, calculate the traffic change rate within the window, set a change rate threshold, and when the traffic change rate of multiple consecutive sampling points is greater than the change rate threshold, segment at the last sampling point to obtain a preliminary segment set; Calculate the number of data points in each segment of the initial segment set, and adjust accordingly to obtain the segmented dataset.

[0007] Furthermore, the step of dividing the physical constraint equations based on the segmented dataset includes: Extract the higher-order functions of each segment in the segmented dataset, output the segmented matrix, and calculate the constraint equations using the pipeline physical parameters; The fitting coefficients are obtained by fitting the piecewise matrix and the constraint equations. The fitting coefficients are then corrected and integrated as polynomials to obtain the physical constraint equations.

[0008] Furthermore, the third dataset, derived by fusing the combined physical constraint equations, includes: The temperature data in the first dataset and the second dataset are aligned in two dimensions, time and space, to obtain the aligned dataset. The sound velocity is fitted to the flow rate data in the second dataset to obtain the first sound velocity. The base delay time is calculated by combining the pipe length and the first sound velocity. An adaptive delay coefficient is introduced through the base delay time. The adaptive delay coefficient is used to filter the aligned dataset to obtain the third dataset.

[0009] Furthermore, the introduction of an adaptive delay coefficient through the base delay time includes: The first influencing factor is calculated by combining real-time traffic with basic latency time, and the second influencing factor is calculated based on temperature and humidity data from the second dataset. Multiply the first impact factor by the second impact factor to obtain the adaptive delay coefficient.

[0010] Furthermore, the temperature prediction using the third dataset and compensation coefficients includes: The compensation coefficients include: temperature compensation coefficient, humidity compensation coefficient, and pressure compensation coefficient; The adjustment formulas for the temperature compensation coefficient, humidity compensation coefficient, and pressure compensation coefficient are as follows:

[0011]

[0012]

[0013] In the formula: This is the baseline temperature value. This represents the rate of change in ambient temperature over the past hour. This is the baseline humidity value. Relative humidity, Indicates the baseline pressure value. For real-time stress data, Standard atmospheric pressure; Based on the third dataset, it is divided according to temperature regions to obtain multiple segments of the third dataset. Different fitting strategies are applied to each segment of the third dataset and physical constraints are added to obtain multiple temperature equations. Based on the current temperature value, the corresponding temperature equation set is selected from the multi-segment temperature equation set for prediction to obtain the initial predicted value. The error is calculated using a sliding window to obtain the relative error. Based on the relative error, the window and compensation coefficient are adjusted to obtain the temperature prediction value.

[0014] Furthermore, the identification of corrosion modes under different operating conditions includes: Cluster the corrosion data to obtain multiple corrosion clusters. Based on the multiple corrosion clusters, construct a transaction set and mine the reverse association rules, and output the association rule set. Using corrosion rate as a benchmark and combining it with a set of rules, correlation degree calculations were performed to obtain correlation degrees for temperature, pressure, pH value, flow rate, and material type. The key influencing factors were then sorted in descending order to obtain a sequence. Multiple thresholds are set based on multiple corrosion clusters, and the thresholds are adjusted by humidity.

[0015] Furthermore, the process of deriving the leakage judgment result based on the second dataset includes: The first and second features are extracted from the second dataset, and the first and second features are weighted and fused to obtain the third feature; A leakage feature library is constructed, and a leakage identification rule library is established by combining the physical constraint equations and temperature prediction values. The leakage identification rule library is queried according to the real-time leakage signal, and the feature vector with the highest similarity is matched to obtain the leakage judgment result.

[0016] An electronic device includes a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the above-described method for controlling the hydrogen blending ratio in a natural gas pipeline.

[0017] A computer-readable storage medium storing a computer program that, when executed, implements the above-described method for controlling the hydrogen blending ratio in a natural gas pipeline.

[0018] Compared with the prior art, the beneficial effects of the present invention are as follows: This application discloses a method for controlling the hydrogen blending ratio in natural gas pipelines, comprising: First, by segmenting historical and real-time data and fusing physical constraint equations, the method ensures that the predicted values ​​strictly follow the laws of fluid mechanics and thermodynamics, avoiding the physical uninterpretability of traditional data-driven methods. Second, by employing a sliding window error calculation and adaptive window adjustment mechanism, combined with temperature, humidity, and pressure compensation coefficients, the predicted values ​​are dynamically corrected to achieve rapid convergence. Third, by using corrosion pattern clustering and leakage feature weighted fusion, the corrosion rate threshold and leakage judgment threshold are dynamically correlated with operating parameters to improve the sensitivity of anomaly detection. Finally, an adaptive threshold adjustment mechanism is introduced to dynamically correct pressure and temperature thresholds based on external conditions such as ambient temperature and atmospheric pressure. This method, through the deep integration of physical laws and data-driven approaches, achieves a shift from passive response to active prediction and control, significantly improving the safety and economy of pipeline operation. Attached Figure Description

[0019] Figure 1 A flowchart of a method for controlling the hydrogen blending ratio in a natural gas pipeline, provided by the present invention; Figure 2 A schematic diagram of the structure of an electronic device provided by the present invention; Figure 3 A schematic diagram of the structure of a computer-readable storage medium provided by the present invention; Figure 4 This invention provides a flowchart of temperature prediction values ​​in a method for controlling the hydrogen blending ratio in a natural gas pipeline. Detailed Implementation

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

[0021] Example 1 Please see Figure 1 and Figure 4 As shown in the figure, this embodiment discloses a method for controlling the hydrogen blending ratio in a natural gas pipeline, the method comprising: S101: Collect pipeline operation history records to obtain pipeline historical data, preprocess the pipeline historical data to obtain the first dataset; The historical pipeline data includes hydrogen doping ratio, pressure, flow rate, temperature, hydrogen concentration, corrosion rate, and leakage events. Preprocessing of the historical pipeline data includes data cleaning and standardization, both of which are existing technologies and will not be elaborated on here.

[0022] It should be noted that the data is acquired by infrared hydrogen concentration sensors, ultrasonic leak detectors, pressure transmitters, temperature sensors, etc., and deployed at key nodes in the pipeline, such as injection points, valves, and ends.

[0023] S102: Real-time acquisition of pipeline data to obtain the second dataset, segmentation of the first and second datasets to obtain segmented datasets, division of physical constraint equations based on segmented datasets, fusion of physical constraint equations to obtain the third dataset, introduction of compensation coefficients, use of the third dataset and compensation coefficients to perform temperature prediction, and output of temperature prediction values. Both the first and second datasets include: pressure data, flow rate data, temperature data, humidity data, hydrogen concentration data, corrosion rate data, and leakage data; The pressure data includes steady-state / transient pressure values ​​under different hydrogen doping ratios; The segmentation process for the first and second datasets specifically involves: Read the traffic data from the first dataset and the second dataset, calculate the traffic change rate within the window, set the change rate threshold, and when the traffic change rate of multiple consecutive sampling points is greater than the change rate threshold, segment at the last sampling point to obtain a preliminary segment set. For example, when the traffic change rate of 3 consecutive sampling points is greater than the change rate threshold, segmentation is triggered at the 3rd sampling point. Calculate the number of data points in each segment of the initial segment set, and adjust accordingly to obtain the segmented dataset.

[0024] The adjustment based on the number of data points is as follows: when the number of data points is less than 200, a dynamic expansion strategy is adopted, prioritizing the use of subsequent data to complete the data, ensuring that no key operating condition data is lost. When subsequent data is insufficient, the data is backtracked to the most recent 200 sampling points.

[0025] In this embodiment, a sliding window with a width of 10s is used to calculate the rate of change in flow rate:

[0026] In the formula: The change in flow rate within the window. For time intervals; The physical constraint equations derived from the segmented dataset include: Extract the higher-order functions of flow rate and pressure for each segment in the segmented dataset, output the segmented matrix, and calculate the constraint equations using the pipe physical parameters (pipe diameter D, length L, roughness ε), i.e.: Reynolds number constraint: enforced at the laminar-turbulent transition point

[0027] In the formula: A is the cross-sectional area of ​​the pipe, and Q is the flow volume. Indicates density, Dynamic viscosity; Transforming the above equation into the polynomial form of the flow rate Q, we get:

[0028] In the formula: for , =0; At the resonance point, the second derivative of the pressure-flow relationship must satisfy the stability condition, and the original inequality is:

[0029] In the formula: v is the speed of sound in the fluid. , The specific heat ratio is represented by R, the gas constant is T, the temperature is P, and the pressure is P. Convert the above second derivative into a function of polynomial coefficients:

[0030] in, The quadratic polynomial prototype of flow-pressure; At the segment boundary flow point Force adjacent polynomials to have equal derivatives:

[0031] in: This is the first piecewise pressure function. This is the second piecewise pressure function; Calculate the derivative by considering the boundary conditions:

[0032] Based on the piecewise matrix and the constraint equations, fitting coefficients are obtained. These coefficients are then corrected, and the corrected coefficients are integrated using a polynomial approach to obtain the physical constraint equations, specifically: The weighted least squares method is used, and the weights are proportional to the signal-to-noise ratio of the data points:

[0033] In the formula: Let be the weight coefficient of the i-th sample. For the i-th sample, the actual measured response variable is something like corrosion rate or temperature. Let be the coefficients to be estimated for the k-th basis function. For the k-th basis function in the independent variable The value at; Solving constrained problems involves both equality and inequality constraints, namely, boundary derivative continuity, Reynolds number threshold, and second derivative threshold of resonance frequency.

[0034] The fitting coefficients are corrected and verified based on physical laws, such as flow-pressure monotonicity verification, friction factor verification, and energy conservation verification. When verification fails, a physical boot correction is used: In the formula , The correction coefficient is determined by minimizing the deviation from the physical laws.

[0035] The third dataset, derived by fusing the combined physical constraint equations, includes: The temperature data from the first and second datasets are aligned in both time and space to obtain the aligned dataset, as follows: Timestamp standardization is performed by converting the timestamps of temperature data to UTC time zone and extracting millisecond-level precision timestamps. At the same time, based on the three-dimensional coordinate system of the pipeline, the spatial position is converted into the distance along the pipeline, and the real-time data is aligned according to the timestamps to obtain an aligned dataset. The speed of sound is fitted to the flow rate data in the second dataset to obtain the first speed of sound, as shown in the formula:

[0036] In the formula: As the reference speed of sound, 、 The fitting coefficients must satisfy the constraint of the hydrogen-to-natural gas mixing ratio; The base delay time was calculated by combining the pipe length and the first velocity of sound. An adaptive delay coefficient is introduced by using the base delay time, and the aligned dataset is filtered using the adaptive delay coefficient to obtain the third dataset.

[0037] The introduction of an adaptive delay coefficient through a base delay time includes: Combine real-time traffic with base latency. The first influencing factor was calculated, and then the second influencing factor was calculated based on the temperature and humidity data of the second dataset. Specifically:

[0038] In the formula: , These are the temperature and humidity sensitivity coefficients, respectively. For real-time ambient temperature, Based on ambient temperature, Reference relative humidity; Multiply the first impact factor by the second impact factor to obtain the adaptive delay coefficient.

[0039] The method of using a third dataset and compensation coefficients for temperature prediction includes: The compensation coefficients include: temperature compensation coefficient, humidity compensation coefficient, and pressure compensation coefficient; The adjustment formulas for the temperature compensation coefficient, humidity compensation coefficient, and pressure compensation coefficient are as follows:

[0040]

[0041]

[0042] In the formula: This is the baseline temperature value. This represents the rate of change in ambient temperature over the past hour. This is the baseline humidity value. Relative humidity, Indicates the baseline pressure value. For real-time stress data, Standard atmospheric pressure; It should be noted that the baseline temperature value is determined by historical temperature-corrosion rate correlation data. A linear regression is performed on the corrosion rate and temperature within each temperature range, and the slope is the baseline temperature value. Similarly, the baseline humidity value is determined by constructing an exponential function based on the humidity-corrosion current density relationship. The value of 'd' is the baseline humidity value, and the baseline pressure value is fitted using the flow velocity-pressure relationship. ; This is a pressure correction factor, with a value of 0.001 to 0.005 in low-carbon steel pipes; Based on the third dataset, it is divided according to temperature regions to obtain multiple segments of the third dataset. Different fitting strategies are applied to each segment of the third dataset and physical constraints are added to obtain multiple temperature equations. As a specific implementation method, the system is divided into three segments based on ambient temperature ranges: [-20℃, 0℃), [0℃, 25℃), and [25℃, 50℃]. For the low-temperature segment, a quadratic polynomial fitting is used to enhance the nonlinear expression of the hydrogen embrittlement effect at low temperatures. For the ambient temperature segment, bicubic spline interpolation is used to ensure surface smoothness while capturing complex interactive effects at moderate temperatures. For the high-temperature segment, an exponential correction term is introduced to reflect the nonlinear characteristics of enhanced thermal radiation at high temperatures. Simultaneously, the constraints of energy conservation and the second law of thermodynamics must be followed.

[0043] Based on the current temperature value, the corresponding temperature equation set is selected from the multi-segment temperature equation set for prediction to obtain the initial predicted value. The error is calculated using a sliding window to obtain the relative error. Based on the relative error, the window and compensation coefficient are adjusted to obtain the temperature prediction value.

[0044] For example, in this embodiment, the relative error between the predicted value and the measured value is calculated every 2 minutes, and an error threshold of ±3% is set. When the relative error fluctuation increases, the sliding window is automatically shortened to 1 minute to improve the response speed. Furthermore, when the predicted temperature exceeds the safety threshold of 65℃, or when the relative error exceeds the threshold for three consecutive times, an early warning will be triggered and manual verification will be initiated.

[0045] S103: Extract corrosion data from the first dataset, cluster the corrosion data, and identify corrosion patterns under different working conditions; derive leakage judgment results based on the second dataset; The identification of corrosion modes under different operating conditions includes: Cluster the corrosion data to obtain multiple corrosion clusters. Based on the multiple corrosion clusters, construct a transaction set and mine the reverse association rules, and output the association rule set. It should be added that the clustering method used for the corrosion data is K-means++. First, the sum of squares within the cluster corresponding to different K values ​​is calculated using the elbow rule. When K=4 is selected, the point of abrupt change in the rate of decrease of the sum of squares within the cluster is selected. K-means++ was used to optimize the selection of the initial center point to avoid local optima. The maximum number of iterations was set to 100. The iteration was stopped when the cluster center moved a distance of less than 0.001. Then, each sample was assigned to the cluster to which the nearest center point belonged according to the Euclidean distance. This yielded the corrosion modes under different working conditions: low temperature and low pressure, medium temperature and medium pressure, high temperature and high pressure, and strong acid flow rate.

[0046] Using corrosion rate as a benchmark and combining it with a set of rules, correlation degree calculations were performed to obtain correlation degrees for temperature, pressure, pH value, flow rate, and material type. The key influencing factors were then sorted in descending order to obtain a sequence. The formula for calculating the degree of correlation is as follows:

[0047] In the formula: The observation value at time k is the baseline sequence (i.e., the corrosion rate sequence). Let i be the observation value of the i-th comparison sequence, such as temperature or pressure, at time k. The resolution coefficient ranges from 0 to 1, and is typically set to 0.5. Multiple thresholds are set based on multiple corrosion clusters, and the thresholds are adjusted by humidity.

[0048] The specific steps for setting multiple threshold segments based on multiple erosion clusters are as follows: For carbon steel at 20℃~40℃: threshold = 0.10mm / year; for carbon steel at >40℃: threshold = 0.08mm / year. For stainless steel, the threshold is 0.05 mm / year, and if the relative humidity is greater than 80%, the threshold is increased by 10%.

[0049] The process of deriving the leakage judgment result based on the second dataset includes: The first and second features are extracted from the second dataset, and the first and second features are weighted and fused to obtain the third feature; In this embodiment, the first feature and the second feature are infrared concentration feature and ultrasonic feature, respectively, and the weighting coefficients of infrared concentration feature and ultrasonic feature are 0.6 and 0.4, respectively. A leakage feature library is constructed, and a leakage identification rule library is established by combining the physical constraint equations and temperature prediction values. The leakage identification rule library is queried according to the real-time leakage signal, and the feature vector with the highest similarity is matched to obtain the leakage judgment result. The construction of the leakage feature library is specifically as follows: based on association rules, the Apriori algorithm is used to mine and extract strong rules, while the pressure-flow relationship is introduced for correction. The Apriori algorithm first iteratively generates candidate k-itemsets based on prior properties. Through a join step expansion, a pruning step screening, and support calculation, it gradually mines frequent itemsets with support ≥ the minimum threshold. Then, it derives all non-empty subset rules from the frequent itemsets. By calculating confidence = support (itemset union) / support (premise set), it retains strong association rules with confidence ≥ the minimum threshold, and finally completes the transformation from raw data to knowledge rules. S104: A basic threshold table is set using physical constraint equations, real-time corrosion data, and leakage judgment results. The basic threshold table is then modified and an adaptive adjustment mechanism is introduced to obtain an optimized threshold table, which is then combined with a real-time control strategy for the optimized threshold.

[0050] Furthermore, a basic threshold table is established using the physical constraint equations, real-time corrosion data, and leakage judgment results, specifically as follows: Set pressure threshold, temperature threshold, corrosion rate threshold, and leakage detection threshold respectively; The pressure threshold is based on a set of physical constraint equations, and is set as an upper limit of 1.2 times the predicted pressure value for each hydrogen doping ratio, such as when the hydrogen doping is 20%. ; The temperature threshold is set to the predicted temperature value + 20℃; The corrosion rate threshold is the same as above, and the leakage detection threshold is 90%.

[0051] The basic threshold table is revised and an adaptive adjustment mechanism is introduced, including: Temperature correction: Using linear interpolation, the temperature threshold is reduced by 5℃ when the ambient temperature is less than -10℃ and by 3℃ when the ambient temperature is greater than 40℃. Humidity correction: When the relative humidity is greater than 80%, the corrosion threshold is multiplied by the humidity correction factor, where the humidity correction factor is 1 - 0.05 × relative humidity. Atmospheric pressure correction: based on Adjust the leakage detection threshold if Less than 0.9 The leakage detection threshold has been reduced to 85%.

[0052] Calculate the relative deviation between the real-time flow rate and the set value. When the relative deviation is less than -5%, increase the valve opening at the injection point: When the relative deviation is greater than +5%, The results were verified using the pressure-flow equation after adjustment. When real-time pressure data exceeds the pressure threshold, a multi-level response is initiated: Level 1: The bypass relief valve opens at 10% flow rate and continues until the real-time pressure data is less than the pressure threshold of 0.95. Level 2: If the problem does not resolve within 10 minutes, the compressor will be triggered to reduce its frequency by 5Hz to lower the inlet pressure. Level 3: If there are 3 consecutive overpressures, the emergency shutdown procedure will be initiated and manual verification will be triggered.

[0053] When the predicted temperature exceeds the temperature threshold, if it is winter, reduce the heater power by 10% and adjust the flow rate Q-2 accordingly; if it is summer, cool down at a rate of 0.5℃ / min.

[0054] Example 2 Please see Figure 2 As shown, this embodiment discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the natural gas pipeline hydrogen blending ratio control method provided by the above methods.

[0055] Since the electronic device described in this embodiment is the electronic device used to implement the method for controlling the hydrogen blending ratio of natural gas pipelines in this application embodiment, those skilled in the art can understand the specific implementation methods and various variations of the electronic device in this embodiment based on the method for controlling the hydrogen blending ratio of natural gas pipelines described in this application embodiment. Therefore, how the electronic device implements the method in this application embodiment will not be described in detail here. As long as those skilled in the art implement the electronic device used in the method for controlling the hydrogen blending ratio of natural gas pipelines in this application embodiment, it falls within the scope of protection of this application.

[0056] Example 3 Please see Figure 3 As shown, this embodiment discloses a computer-readable storage medium, including a memory, a processor, and a computer program stored on the memory and running on the processor. When the processor executes the computer program, it implements the natural gas pipeline hydrogen blending ratio control method provided by the above methods.

[0057] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters, weights, and thresholds in the formulas are set by those skilled in the art according to the actual situation.

[0058] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired or wireless network. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.

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

[0060] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0061] In the several embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only one method, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0062] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0063] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0064] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

[0065] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for controlling the hydrogen blending ratio in a natural gas pipeline, characterized in that, The method includes: S101: Collect pipeline operation history records to obtain pipeline historical data, preprocess the pipeline historical data to obtain the first dataset; S102: Real-time acquisition of pipeline data to obtain the second dataset, segmentation of the first and second datasets to obtain segmented datasets, division of physical constraint equations based on segmented datasets, fusion of physical constraint equations to obtain the third dataset, introduction of compensation coefficients, use of the third dataset and compensation coefficients to perform temperature prediction, and output of temperature prediction values. S103: Extract corrosion data from the first dataset, cluster the corrosion data, and identify corrosion patterns under different working conditions; derive leakage judgment results based on the second dataset; S104: A basic threshold table is set using physical constraint equations, real-time corrosion data, and leakage judgment results. The basic threshold table is then modified and an adaptive adjustment mechanism is introduced to obtain an optimized threshold table, which is then combined with a real-time control strategy for the optimized threshold.

2. The method for controlling the hydrogen blending ratio in natural gas pipelines according to claim 1, characterized in that, Both the first and second datasets include: pressure data, flow rate data, temperature data, humidity data, hydrogen concentration data, corrosion rate data, and leakage data; The pressure data includes steady-state / transient pressure values ​​under different hydrogen doping ratios; The segmentation process for the first and second datasets specifically involves: Read the traffic data from the first dataset and the second dataset, calculate the traffic change rate within the window, set a change rate threshold, and when the traffic change rate of multiple consecutive sampling points is greater than the change rate threshold, segment at the last sampling point to obtain a preliminary segment set; Calculate the number of data points in each segment of the initial segment set, and adjust accordingly to obtain the segmented dataset.

3. The method for controlling the hydrogen blending ratio in natural gas pipelines according to claim 1, characterized in that, The physical constraint equations derived from the segmented dataset include: Extract the higher-order functions of each segment in the segmented dataset, output the segmented matrix, and calculate the constraint equations using the pipeline physical parameters; The fitting coefficients are obtained by fitting the piecewise matrix and the constraint equations. The fitting coefficients are then corrected and integrated as polynomials to obtain the physical constraint equations.

4. The method for controlling the hydrogen blending ratio in natural gas pipelines according to claim 1, characterized in that, The third dataset, derived by fusing the combined physical constraint equations, includes: The temperature data in the first dataset and the second dataset are aligned in two dimensions, time and space, to obtain the aligned dataset. The sound velocity is fitted to the flow rate data in the second dataset to obtain the first sound velocity. The base delay time is calculated by combining the pipe length and the first sound velocity. An adaptive delay coefficient is introduced through the base delay time. The adaptive delay coefficient is used to filter the aligned dataset to obtain the third dataset.

5. The method for controlling the hydrogen blending ratio in natural gas pipelines according to claim 4, characterized in that, The introduction of an adaptive delay coefficient through a base delay time includes: The first influencing factor is calculated by combining real-time traffic with basic latency time, and the second influencing factor is calculated based on temperature and humidity data from the second dataset. Multiply the first impact factor by the second impact factor to obtain the adaptive delay coefficient.

6. The method for controlling the hydrogen blending ratio in natural gas pipelines according to claim 1, characterized in that, The method of using a third dataset and compensation coefficients for temperature prediction includes: The compensation coefficients include: temperature compensation coefficient, humidity compensation coefficient, and pressure compensation coefficient; The adjustment formulas for the temperature compensation coefficient, humidity compensation coefficient, and pressure compensation coefficient are as follows: ; ; ; In the formula: This is the baseline temperature value. This represents the rate of change in ambient temperature over the past hour. This is the baseline humidity value. Relative humidity, Indicates the baseline pressure value. For real-time stress data, Standard atmospheric pressure; Based on the third dataset, it is divided according to temperature regions to obtain multiple segments of the third dataset. Different fitting strategies are applied to each segment of the third dataset and physical constraints are added to obtain multiple temperature equations. Based on the current temperature value, the corresponding temperature equation set is selected from the multi-segment temperature equation set for prediction to obtain the initial predicted value. The error is calculated using a sliding window to obtain the relative error. Based on the relative error, the window and compensation coefficient are adjusted to obtain the temperature prediction value.

7. The method for controlling the hydrogen blending ratio in natural gas pipelines according to claim 1, characterized in that, The identification of corrosion modes under different operating conditions includes: Cluster the corrosion data to obtain multiple corrosion clusters, construct a transaction set based on the multiple corrosion clusters, perform association rule mining, and output the association rule set; Using corrosion rate as a benchmark and combining it with a set of association rules, the correlation degree is calculated to obtain the correlation degree of temperature, pressure, pH value, flow rate and material type. The key influencing factors are then sorted in descending order to obtain the sequence of key influencing factors. Multiple thresholds are set based on multiple corrosion clusters, and the thresholds are adjusted in conjunction with humidity.

8. The method for controlling the hydrogen blending ratio in natural gas pipelines according to claim 7, characterized in that, The process of deriving the leakage judgment result based on the second dataset includes: The first and second features are extracted from the second dataset, and the first and second features are weighted and fused to obtain the third feature; A leakage feature library is constructed, and a leakage identification rule library is established by combining the physical constraint equations and temperature prediction values. The leakage identification rule library is queried according to the real-time leakage signal, and the feature vector with the highest similarity is matched to obtain the leakage judgment result.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the method for controlling the hydrogen blending ratio in natural gas pipelines as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed, implements the method for controlling the hydrogen blending ratio in a natural gas pipeline as described in any one of claims 1 to 8.