Multi-channel dynamic flow compensation method, device, equipment and storage medium
By acquiring pipeline pressure, flow rate, and temperature in real time, dynamically calculating fluid density and viscosity using the gas state equation, and combining correction coefficients and feedforward to correct the PID controller, the problem of low accuracy in traditional pipeline flow control is solved, achieving higher flow control accuracy and response speed.
Patent Information
- Application Number
- CN202610898549.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-22
- Publication Date
- 2026-08-25
AI Technical Summary
Traditional pipeline flow control methods cannot accurately adapt to the dynamic changes in complex working conditions at construction sites, resulting in low flow control accuracy.
By acquiring pipeline pressure, instantaneous flow rate, and fluid temperature in real time, the fluid density and viscosity are dynamically calculated using the gas state equation. The basic adjustment of the PID controller is then corrected by combining correction coefficients and feedforward, thereby improving control accuracy.
It improves the adjustment accuracy of the mass flow controller under multiple operating conditions, and enhances the accuracy and response speed of pipeline flow control.
Smart Images

Figure CN122632905A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of pipeline engineering technology, and in particular to a method, device, equipment and storage medium for dynamic flow compensation in multiple flow paths. Background Technology
[0002] With the rapid development of pipeline engineering, the complexity of pipeline systems at construction sites is increasing. Among these, pipeline flow control is a core element in ensuring the efficiency of project operation. Accurately regulating the flow distribution of pipelines directly affects the stability of transmission and distribution and the reliability of energy supply under complex operating conditions, and thus affects the construction quality and operational safety of the entire pipeline project.
[0003] Currently, pipeline flow control in related technologies mainly relies on traditional PID regulation or static valve control strategies. These strategies are based on fixed parameters of pipe diameter, flow velocity, and pressure difference under design conditions. However, due to the high complexity of pipeline systems at construction sites and the continuous changes in resistance characteristics and flow demand along the pipeline, traditional control strategies often cannot accurately adapt to the dynamic changes in actual working conditions. Therefore, traditional pipeline flow control methods suffer from low flow control accuracy. Summary of the Invention
[0004] The purpose of this application is to provide a method, apparatus, device and storage medium for multi-flow path dynamic flow compensation, which aims to improve the accuracy of multi-flow path dynamic flow compensation results and thus improve the precision of pipeline flow control results.
[0005] To achieve the above objectives, this application adopts the following technical solution: In a first aspect, this application provides a multi-path dynamic flow compensation method, including acquiring the pipeline pressure inside the transmission pipeline, the instantaneous flow rate of the fluid being transmitted in the transmission pipeline, and the fluid temperature; calculating the fluid density and fluid viscosity of the current fluid using the gas state equation based on the pipeline pressure and fluid temperature; calculating the actual injection volume based on the instantaneous flow rate and comparing it with the theoretical injection volume to obtain the volume deviation; when the volume deviation exceeds a preset volume threshold, obtaining a correction coefficient based on the fluid density and fluid viscosity; correcting the basic adjustment amount output by the PID controller using the correction coefficient, and superimposing the corrected basic adjustment amount with the feedforward amount generated based on the pressure change rate to obtain a valve opening command; wherein, the PID controller is used to calculate the basic adjustment amount based on the error between the target flow rate and the actual flow rate; and outputting the valve opening command to a mass flow controller, which is used to adjust the valve opening inside the regulating pipeline to control the fluid flow rate.
[0006] Based on the aforementioned technical means, this application acquires pipeline pressure, instantaneous flow rate, and fluid temperature in real time, and dynamically calculates fluid density and viscosity using the gas state equation to sense real-time changes in fluid properties. Compared to relying on fixed property parameters, dynamically calculating fluid density and viscosity reduces control deviation. Furthermore, this application identifies abnormal operating conditions by analyzing the deviation between the actual injection volume and the theoretical injection volume. When the deviation exceeds limits, a correction coefficient is determined by introducing density and viscosity, and this coefficient is used to correct the basic adjustment of the PID controller output, improving control accuracy. In addition, the corrected PID basic adjustment is superimposed on a feedforward quantity based on the pressure change rate. The feedforward component compensates for predictable disturbances such as sudden pressure changes in advance. The synergy of these two components effectively reduces the response lag of flow control, improves the adjustment accuracy of the mass flow controller under multiple operating conditions, and increases the accuracy of multi-path dynamic flow compensation results, thereby improving the accuracy of pipeline flow control results.
[0007] One possible approach involves correcting the base regulation of the PID controller output using a correction factor, including: multiplying the correction factor by at least one of the PID controller's proportional gain, integral gain, and derivative gain; and recalculating the base regulation using the adjusted gain.
[0008] In one possible approach, the feedforward quantity generated based on the pressure change rate is calculated as follows: real-time monitoring of pipeline pressure, calculating the pressure difference between the current moment and the previous moment and dividing it by the sampling interval to obtain the pressure change rate; when the absolute value of the pressure change rate exceeds a preset change rate threshold, multiplying the pressure change rate by a preset feedforward coefficient to obtain the feedforward quantity; when the absolute value of the pressure change rate does not exceed the preset change rate threshold, determining the feedforward quantity to be zero.
[0009] One possible approach involves superimposing the corrected baseline regulation amount with a feedforward amount generated based on the pressure change rate, including: calculating the variance of N pipeline pressures obtained before the current moment as a stability index; determining weighting coefficients based on the stability index; multiplying the weighting coefficients by the corrected baseline regulation amount to obtain the weighted baseline regulation amount; and superimposing the weighted baseline regulation amount with the feedforward amount.
[0010] One possible approach is to determine the weighting coefficient based on the stability index, including: when the stability index is greater than a first threshold, setting the weighting coefficient to a positive number less than 1 to reduce the adjustment step size; when the stability index is less than a second threshold, setting the weighting coefficient to 1; and when the stability index is between the first and second thresholds, decreasing the weighting coefficient as the stability index increases.
[0011] In one possible approach, the fluid density and viscosity of the current fluid are calculated using the gas state equation based on the pipeline pressure and fluid temperature. This includes: normalizing the pipeline pressure and mapping the normalized pressure value to a preset range; performing a logarithmic transformation on the normalized pressure value to obtain a transformed pressure value; and using the transformed pressure value as one of the input parameters of the gas state equation to calculate the fluid density and viscosity of the current fluid.
[0012] In one possible approach, the actual injection volume is calculated based on the instantaneous flow rate and compared with the theoretical injection volume to obtain the volume deviation. This includes: integrating the instantaneous flow rate over a preset time window to obtain the actual injection volume; calculating the difference between the actual injection volume and the theoretical injection volume; dividing the difference by the theoretical injection volume to obtain the relative volume deviation as the volume deviation.
[0013] Secondly, this application provides a multi-path dynamic flow compensation device, comprising: an acquisition module, a calculation module, a determination module, and an output module; the acquisition module is used to acquire the pipeline pressure inside the transmission pipeline, the instantaneous flow rate of the fluid transmitted in the transmission pipeline, and the fluid temperature; the calculation module is used to calculate the fluid density and fluid viscosity of the current fluid using the gas state equation based on the pipeline pressure and fluid temperature; the determination module is used to calculate the actual injection volume based on the instantaneous flow rate and compare it with the theoretical injection volume to obtain the volume deviation; the acquisition module is also used to obtain a correction coefficient based on the fluid density and fluid viscosity when the volume deviation exceeds a preset volume threshold; the determination module is also used to correct the basic adjustment amount output by the PID controller using the correction coefficient, and superimpose the corrected basic adjustment amount with the feedforward amount generated based on the pressure change rate to obtain the valve opening command; wherein, the PID controller is used to calculate the basic adjustment amount based on the error between the target flow rate and the actual flow rate; the output module is used to output the valve opening command to the mass flow controller, and the mass flow controller is used to adjust the valve opening inside the regulating pipeline to control the flow rate of the fluid.
[0014] Thirdly, this application provides an electronic device including a memory and a processor; the memory and the processor are coupled; the memory is used to store instructions executable by the processor; when the processor executes the instructions, it performs the methods described in the first aspect and any possible implementation thereof.
[0015] Fourthly, this application provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the methods described in the first aspect and any possible implementation thereof.
[0016] Fifthly, this application provides a chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run computer programs or instructions to implement the methods described in the first aspect and any possible implementation thereof.
[0017] Sixthly, this application provides a computer program product containing instructions that, when executed by a computer, cause the computer to perform the methods described in the first aspect and any possible implementation thereof.
[0018] The technical problems that can be solved and the technical effects that can be achieved by the multi-path dynamic flow compensation device, electronic device, computer storage medium, chip or computer program product in the above solution can be referred to the technical problems and technical effects solved in the first aspect above, and will not be repeated here. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This application provides a schematic diagram of the structure of a multi-path dynamic flow compensation system according to an embodiment of the present application. Figure 2 A flowchart of a multi-path dynamic flow compensation method provided in this application embodiment; Figure 3 A logic block diagram for determining a valve opening command provided in an embodiment of this application; Figure 4 A structural diagram of a multi-path dynamic flow compensation device provided in an embodiment of this application; Figure 5 This is a schematic diagram of a multi-path dynamic flow compensation device provided in an embodiment of this application. Detailed Implementation
[0021] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0022] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0023] In embodiments of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, article, or apparatus that includes that element.
[0024] In the embodiments of this application, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of the words "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.
[0025] In the description of this specification, specific features, structures, materials, or characteristics may be combined in any suitable manner in one or more embodiments or examples.
[0026] With the rapid development of pipeline engineering, the complexity of pipeline systems at construction sites is increasing. Among these, pipeline flow control is a core element in ensuring the efficiency of project operation. Accurately regulating the flow distribution of pipelines directly affects the stability of transmission and distribution and the reliability of energy supply under complex operating conditions, and thus affects the construction quality and operational safety of the entire pipeline project.
[0027] Currently, pipeline flow control in related technologies mainly relies on traditional PID regulation or static valve control strategies. These strategies are based on fixed parameters of pipe diameter, flow velocity, and pressure difference under design conditions. However, due to the high complexity of pipeline systems at construction sites and the continuous changes in resistance characteristics and flow demand along the pipeline, traditional control strategies often cannot accurately adapt to the dynamic changes in actual working conditions. Therefore, traditional pipeline flow control methods suffer from low flow control accuracy.
[0028] Therefore, this application acquires pipeline pressure, instantaneous flow rate, and fluid temperature in real time, and dynamically calculates fluid density and viscosity using the gas state equation to sense real-time changes in fluid properties. Compared to relying on fixed property parameters, dynamically calculating fluid density and viscosity reduces control deviation. Furthermore, this application identifies abnormal operating conditions by analyzing the deviation between the actual injection volume and the theoretical injection volume. When the deviation exceeds limits, a correction coefficient is determined by introducing density and viscosity, and this coefficient is used to correct the base adjustment of the PID controller output, improving control accuracy. In addition, the corrected PID base adjustment is superimposed on a feedforward quantity based on the pressure change rate. The feedforward component compensates for predictable disturbances such as sudden pressure changes in advance. The synergy of these two components effectively reduces the response lag of flow control, improves the adjustment accuracy of the mass flow controller under multiple operating conditions, and increases the accuracy of multi-path dynamic flow compensation results, thereby improving the accuracy of pipeline flow control results.
[0029] The multi-path dynamic flow compensation method provided in this application can be applied to multi-path dynamic flow compensation systems. Please refer to... Figure 1 The multi-path dynamic flow compensation system may include: a data acquisition device 101, a central control device 102, and a mass flow controller 103. The data acquisition device 101 and the central control device 102 are communicatively connected, and the central control device 102 and the mass flow controller 103 are communicatively connected.
[0030] In some embodiments, such as Figure 1 As shown, the multi-path dynamic flow compensation system also includes multiple flow paths, such as flow path 1, flow path 2, and flow path N. These multiple flow paths are used to collect natural gas samples at different pressures; for example, flow path 1 can collect high-pressure gas, and flow path 2 can collect low-pressure gas. Furthermore, each flow path is equipped with an independent flow path switching valve, such as V1, V2, and Vn. Each flow path switching valve is communicatively connected to the central control device 102 and can send valve switching signals to the central control device 102. Each flow path switching valve uses a low dead volume straight-through ball valve or diaphragm valve. All flow paths converge into a single main pipeline via a vertical confluence pipeline, achieving gas source selection and isolation.
[0031] In some embodiments, the flow path switching valve can be specifically multiple independent sets of two-position three-way or two-position two-way solenoid valves. Alternatively, it can be a multi-position rotary selector valve, where switching is achieved by a motor driving the valve core to rotate to different orifice positions. It can also be a valve assembly with dual shut-off discharge to provide higher isolation safety and prevent cross-contamination caused by minor leaks.
[0032] The data acquisition device 101 can be a signal acquisition device such as a pressure sensor, flow meter, temperature sensor, data acquisition card (DAQ), or embedded acquisition module deployed on the pipeline site. This application embodiment does not limit the specific form or model of the data acquisition device. Alternatively, the data acquisition device 101 can also be an intelligent inspection robot, a drone integrating multiple sensors, or a distributed IoT acquisition network composed of multiple edge computing nodes and sensors. This application embodiment does not impose any limitations in this regard.
[0033] In some embodiments, such as Figure 1 As shown, the data acquisition device 101 can be a sensor array, which can be located in the middle of the main pipeline. The sensor array includes at least one closely adjacent pressure sensor (P) and temperature sensor (T). Only one pressure sensor (P) and one temperature sensor (T) are shown in the figure. The pressure sensor uses a high-frequency response transmitter (i.e., response time <10ms) to monitor the static pressure of the fluid in the pipe in real time. The probe of the temperature sensor is inserted into the center of the fluid to collect the fluid temperature in real time.
[0034] In some embodiments, the pressure sensor may be a capacitive pressure transmitter, a piezoresistive sensor, or a piezoelectric sensor, and the temperature sensor may be a platinum resistance thermometer, a thermocouple sensor, or a semiconductor temperature sensor. Furthermore, the data acquisition device 101 may also include a flow sensor, which may be a thermal gas mass flow meter or a Coriolis mass flow meter.
[0035] The data acquisition device 101 is used to collect the pipeline pressure inside the transmission pipeline, the instantaneous flow rate of the fluid transmitted in the transmission pipeline, and the fluid temperature, and send the pipeline pressure inside the transmission pipeline, the instantaneous flow rate of the fluid transmitted in the transmission pipeline, and the fluid temperature to the multi-path dynamic flow compensation device 102.
[0036] The central control device 102 can be an electronic device such as a personal computer (PC), laptop computer, mobile device, tablet computer, or laptop computer. This application embodiment does not limit the specific form of the electronic device. Alternatively, the multi-path dynamic flow compensation device 102 can also be a server, or a server cluster composed of multiple servers. In some implementations, the server cluster can be a distributed cluster server. This application embodiment does not impose any restrictions in this regard.
[0037] In some embodiments, such as Figure 1As shown, the central control device 102 can be a microcontroller unit (MCU) or a programmable logic controller (PLC) containing a standard operating condition database. This application embodiment does not limit the specific form of the central control device 102.
[0038] The central control device 102 is used to respond to the pipeline pressure, instantaneous flow rate, and fluid temperature transmitted in the pipeline received from the data acquisition device 101. Based on the pipeline pressure and fluid temperature, the current fluid density and viscosity are calculated using the gas state equation. The actual injection volume is calculated based on the instantaneous flow rate and compared with the theoretical injection volume to obtain the volume deviation. When the volume deviation exceeds a preset volume threshold, a correction coefficient is obtained based on the fluid density and viscosity. The correction coefficient is used to correct the basic adjustment value output by the PID controller, and the corrected basic adjustment value is superimposed with the feedforward value generated based on the pressure change rate to obtain the valve opening command. The PID controller is used to calculate the basic adjustment value based on the error between the target flow rate and the actual flow rate. The valve opening command is output to the mass flow controller 103, which is used to adjust the valve opening inside the regulating pipeline to control the fluid flow rate.
[0039] In some embodiments, such as Figure 1 As shown, the mass flow controller 103 can be a gas mass flow controller (MFC). The MFC is located downstream of the sensor array and serves as the execution end of the system. It receives opening commands from the central control unit to quickly adjust the valve core position to control the instantaneous flow rate. Furthermore, after the mass flow controller 103 completes the opening command, it can feed back the command execution result to the central control device 102.
[0040] In some embodiments, the mass flow controller 103 can also be replaced by a high-speed proportional solenoid valve in conjunction with an independent flow meter to form a closed-loop control, in order to achieve lower cost and faster response. Alternatively, the mass flow controller 103 can also be replaced by an electric regulating needle valve driven by a stepper motor, which is suitable for applications with small flow rates and extremely high requirements for regulation accuracy. This application does not limit the specific form of the mass flow controller 103.
[0041] Furthermore, the actions, terms, etc., involved in the various embodiments of this application can be referenced interchangeably without limitation. The message names or parameter names in the messages between the various devices in the embodiments of this application are merely examples, and other names may be used in specific implementations without limitation.
[0042] It should be noted that the system architecture and application scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems. For example, the data acquisition device 101 and the multi-path dynamic flow compensation device 102 can be separate devices or different functional modules of the same device.
[0043] The multi-path dynamic flow compensation method provided in this application embodiment can be applied to the aforementioned central control device, specifically to the processor of the central control device. Please refer to... Figure 2 The multi-path dynamic flow compensation method provided in this application specifically includes S201-S206.
[0044] S201. Obtain the pipeline pressure inside the transmission pipeline, the instantaneous flow rate of the fluid being transmitted in the transmission pipeline, and the fluid temperature.
[0045] In one embodiment, when the central control device is powered on, the operation of acquiring the pipeline pressure, instantaneous flow rate, and fluid temperature within the transmission pipeline can be triggered. Alternatively, during the power-on process of the central control device, if a flow path switching command is received (e.g., flow path 1 is switched to flow path 2), the operation of acquiring the pipeline pressure, instantaneous flow rate, and fluid temperature within the transmission pipeline can be triggered. Furthermore, the operation of acquiring the pipeline pressure, instantaneous flow rate, and fluid temperature within the transmission pipeline can also be triggered by a timer or event trigger; this embodiment of the application does not impose limitations on this.
[0046] In one embodiment, the instantaneous flow rate of the fluid transported within the transmission pipeline is the amount of fluid flowing through the cross-section of the pipeline at a specific moment (or within a very short time window). The instantaneous flow rate can be obtained by a flow meter inside the pipeline, the pipeline pressure can be obtained by a pressure sensor inside the pipeline, and the fluid temperature can be obtained by a temperature sensor inside the pipeline.
[0047] For example, in a pipeline scenario for transporting natural gas, based on a preset frequency (e.g., 100Hz), data acquisition devices such as flow meters, pressure sensors, and temperature sensors are used to synchronously collect data on the current pipeline pressure P (0.38 MPa), instantaneous flow rate Q (920 Nm³ / h), and fluid temperature T (15℃).
[0048] It should be noted that this application does not limit the specific methods for obtaining the pipeline pressure, instantaneous flow rate, and fluid temperature within the transmission pipeline. In practical applications, these methods can be set according to requirements to cover different interaction modes and equipment scenarios. For example, in high-pressure fluid transportation conditions, a high-pressure resistant pressure transmitter and an ultrasonic flow meter can be used, with the acquisition frequency adjustable to 10Hz to adapt to the gradual changes in long-distance transmission. In urban gas pipeline network scenarios, a combination of a diaphragm gas meter and a piezoresistive pressure sensor can be used, with an acquisition frequency set to 1Hz to meet metering requirements.
[0049] S202. Calculate the current fluid density and viscosity using the gas state equation based on the pipeline pressure and fluid temperature.
[0050] In one embodiment, the data collected by different sensors may have different dimensions, and the physical state of the fluid may change under different operating conditions. Therefore, after collecting the pipeline pressure, instantaneous flow rate, and fluid temperature inside the transmission pipeline through the data acquisition device, the raw data collected by the data acquisition device can be preprocessed. The raw data refers to the pipeline pressure, instantaneous flow rate, and fluid temperature inside the transmission pipeline before preprocessing.
[0051] In one possible implementation, S202 can be implemented as follows: normalizing the pipeline pressure and mapping the normalized pressure value to a preset range; performing a logarithmic transformation on the normalized pressure value to obtain the transformed pressure value; using the transformed pressure value as one of the input parameters of the gas state equation and using the gas state equation to calculate the current fluid density and fluid viscosity.
[0052] For example, the raw data is normalized to map different raw data to a preset interval [0,1], thus eliminating the influence of different physical dimensions on the algorithm's convergence. For the normalized pressure data collected under high-pressure conditions, a logarithmic transformation P'=ln(P+1) is performed to make its distribution characteristics closer to linear, facilitating subsequent calculations. Using a preset gas state equation and component data from a standard operating condition database, the fluid density and viscosity are calculated based on the current pipeline pressure and fluid temperature.
[0053] In one embodiment, the preset gas equation of state can be a virial-type equation of state extended by AGA8. Furthermore, after normalizing and logarithmically transforming the raw data, in addition to calculating the fluid density and viscosity using the gas equation of state, the fluid density and viscosity can also be obtained by looking up a pre-established multidimensional lookup table using linear interpolation based on the current pipeline pressure and fluid temperature.
[0054] S203. Calculate the actual injection volume based on the instantaneous flow rate and compare it with the theoretical injection volume to obtain the volume deviation.
[0055] In one embodiment, the theoretical injection volume can be the volume of gas (typically the standard state volume, in Nm³) that should flow under ideal conditions, calculated based on a preset target flow rate and integration time. This is used to represent the standard injection volume of the fluid transported within the pipeline under the current operating conditions.
[0056] For example, under the current operating conditions, the target flow rate in the transmission pipeline is 1000 Nm³ / h, and the time window for the actual injection volume is 10s. Therefore, the theoretical injection volume within this time window is approximately 2.78 Nm³.
[0057] In one embodiment, the flow rate correction factor K can be determined by the fluid density ρ and fluid viscosity μ, and the corrected theoretical injection volume can be determined by multiplying the flow rate correction factor by the theoretical injection volume.
[0058] In one embodiment, instantaneous flow rate represents the amount of fluid flowing through a pipe cross-section at a specific moment (or within a very short time). The actual injection volume during that time period can be obtained by integrating the instantaneous flow rate over a period of time.
[0059] In one possible implementation, S203 above can be implemented as follows: Integrate the instantaneous flow rate over time within a preset time window to obtain the actual injection volume. Calculate the difference between the actual injection volume and the theoretical injection volume, divide the difference by the theoretical injection volume, and obtain the relative volume deviation as the volume deviation.
[0060] For example, the theoretical injection volume within 10 seconds is approximately 2.78 Nm³. Integrating the instantaneous flow rate within 10 seconds, the actual injection volume is determined to be 2.56 Nm³. The difference between the actual and theoretical injection volumes is 0.22 Nm³. Dividing the difference by the theoretical injection volume yields a relative volume deviation of 7.91%.
[0061] By calculating the relative volume deviation, the difference between the actual injection volume and the theoretical injection volume can be normalized to a dimensionless percentage. This allows the control system to use a uniform deviation threshold (e.g., 5%) for judgment under different flow rates and operating conditions, avoiding the problem of inconsistent judgment scales caused by different flow rates. As a result, the correction logic can be triggered accurately and timely in various scenarios such as high flow rate, low flow rate, and rapid flow fluctuation, thus improving the robustness and adaptability of flow control.
[0062] S204. When the volume deviation exceeds the preset volume threshold, obtain the correction coefficient based on the fluid density and fluid viscosity.
[0063] In one embodiment, the volumetric flow rate collected by the flow meter is often calibrated using a standard medium (air). However, the actual medium density and viscosity are different, which causes the actual flow volume to deviate from the calibrated value under the same valve opening. Therefore, it is necessary to determine a correction factor.
[0064] In one embodiment, the correction factor is obtained by multiplying the density correction factor, viscosity correction factor, and compressibility factor correction factor. According to the law of conservation of mass flow rate, compared to ideal air, the higher the density of the fluid transported in the pipeline, the smaller the volume corresponding to the same mass, leading to a lower flow meter reading. Increased viscosity of the fluid transported in the pipeline increases flow resistance, resulting in a lower flow meter reading. The compressibility factor correction factor indicates the degree to which the fluid transported in the pipeline deviates from an ideal gas. The density correction factor, viscosity correction factor, and compressibility factor correction factor can be calculated by inputting the fluid density and viscosity into the gas law.
[0065] In one embodiment, S204 can be implemented as follows: when the volume deviation exceeds a preset volume threshold, the fluid density and fluid viscosity are input into the gas state equation to determine the density correction coefficient, viscosity correction coefficient, and compressibility factor correction coefficient, and the correction coefficient is obtained by multiplying the density correction coefficient, viscosity correction coefficient, and compressibility factor correction coefficient.
[0066] For example, when the relative volume deviation is 7.91% (exceeding the preset threshold of 1%), under the current operating conditions of P=3.2MPa, T=25°C, and 21 components, the following results are obtained through iterative solution of the AGA8-92DC equation of state: actual density ρ_actual=18.6 kg / m³, actual viscosity μ_actual=12.3 μPa·s, and compressibility factor Z_actual=0.92. Comparing these results with the standard operating conditions (ρ_std=1.225 kg / m³, μ_std=17.8 μPa·s, Z_std=1.0), the following correction factors are calculated: density correction factor = 1.225 / 18.6=0.0659, viscosity correction factor = 17.8 / 12.3=1.447, and compressibility factor correction factor = 0.92 / 1.0=0.92. The product of these three factors yields the correction factor K. =0.0659×1.447×0.92=0.0877.
[0067] S205. The basic adjustment amount output by the PID controller is corrected using the correction coefficient, and the corrected basic adjustment amount is superimposed with the feedforward amount generated based on the pressure change rate to obtain the valve opening command.
[0068] The PID controller is used to calculate the basic adjustment amount based on the error between the target flow rate and the actual flow rate.
[0069] In one possible implementation, correcting the basic regulation of the PID controller output using a correction factor can be achieved by multiplying the correction factor by at least one of the proportional gain, integral gain, and derivative gain of the PID controller; and then recalculating the basic regulation using the adjusted gain.
[0070] For example, by using the correction factor K and the scaling gain K p Multiplication, proportional gain K p Make corrections and determine the corrected proportional gain K. p ′, by using the square root of the correction coefficient K and the integral gain K i Multiplication, with respect to the integral gain K i Make corrections and determine the corrected integral gain K. i ′, by using the differential gain K d Divide by the correction coefficient K to obtain the differential gain K. d Make corrections and determine the corrected differential gain K. d ′.
[0071] In one possible implementation, the base adjustment is recalculated using the adjusted gain, satisfying the following formula 1: ΔU=K p ′ e+K i ′ ∑e Δt+K d ′ (e) e prev Formula 1 for Δt Where ΔU is the recalculated base adjustment amount, and K p ′ represents the corrected proportional gain, K i ′ represents the corrected integral gain, K d ′ represents the corrected differential gain, and e represents the flow error, i.e., the target flow rate Q. set The difference between the actual flow rate and the actual flow rate, e prev This represents the volume error from the previous cycle.
[0072] In one possible implementation, the feedforward quantity generated based on the pressure change rate is calculated as follows: The pipeline pressure is monitored in real time, and the pressure difference between the current and previous moments is calculated and divided by the sampling interval to obtain the pressure change rate. When the absolute value of the pressure change rate exceeds a preset change rate threshold, the pressure change rate is multiplied by a preset feedforward coefficient to obtain the feedforward quantity. When the absolute value of the pressure change rate does not exceed the preset change rate threshold, the feedforward quantity is determined to be zero.
[0073] For example, the pressure change rate ΔP is monitored in real time, and a feedforward quantity U is directly generated at the instant when the pressure changes abruptly (e.g., during a flow path switch). ff This allows for proactive compensation by mitigating pressure shocks in advance.
[0074] In one possible implementation, superimposing the corrected baseline regulation with the feedforward quantity generated based on the pressure change rate can be achieved as follows: Calculate the variance of the N pipeline pressures obtained before the current moment, using it as a stability index. Determine weighting coefficients based on the stability index, multiply these coefficients by the corrected baseline regulation to obtain the weighted baseline regulation. Then, superimpose the weighted baseline regulation with the feedforward quantity.
[0075] For example, suppose N=5 pipeline pressure values were collected before the current time: P=[3.21, 3.19, 3.23, 3.18, 3.22] MPa. Calculate its variance σ²=0.000376 MPa², which serves as a stability index. If σ²<0.001, the system is stable, with a weighting coefficient w=1.0; if σ² is between 0.001 and 0.005, there is moderate fluctuation, with w=0.6; if σ²>0.005, there is severe fluctuation, with w=0.3. In this example, σ²=0.000376<0.001, so w=1.0 is chosen. The weighted base adjustment amount ΔU calculated in the previous step is 0.001425, so the weighted base adjustment amount is 1.0 × 0.001425 = 0.001425. Assuming the feedforward amount (the opening compensation obtained by directly looking up the table based on Q_set) is 0.0008, the two are added together to obtain the final valve opening change ΔU_final = 0.001425 + 0.0008 = 0.002225, which means the valve opening increases by 0.22%.
[0076] In one possible implementation, determining the weighting coefficient based on the stability index can be achieved as follows: when the stability index is greater than the first threshold, the weighting coefficient is set to a positive number less than 1 to reduce the adjustment step size; when the stability index is less than the second threshold, the weighting coefficient is set to 1; when the stability index is between the first and second thresholds, the weighting coefficient decreases as the stability index increases.
[0077] like Figure 3 The diagram shown is a logic block diagram for determining a valve opening command according to an embodiment of this application. Line 1 represents the main PID loop, which uses the target flow rate Q... set and actual traffic Q realThe difference between the values determines the flow error e. Combined with the correction coefficient K and the flow error e, the adaptive PID algorithm is used to determine the corrected base adjustment amount ΔU. Line 2 represents the feedforward control branch. Through the pressure change rate ΔP, feedforward control is performed at the instant of a sudden pressure change (e.g., during flow path switching), directly generating the feedforward compensation amount Uff. Line 3 is the stability correction branch. Based on the stability index S calculated from the statistical variance of the pressure signal, a smooth approximation strategy is used to calculate the output opening degree Uout. The base adjustment amount ΔU of Line 1, the feedforward compensation amount Uff of Line 2, and the opening degree Uout of Line 3 are superimposed at the aggregation point (Σ) to generate the final valve opening command Uut.
[0078] S206. Output the valve opening command to the mass flow controller. The mass flow controller is used to adjust the valve opening inside the regulating pipeline to control the flow rate of the fluid.
[0079] In one embodiment, by outputting a valve opening command to a mass flow controller, the mass flow controller can execute a response action based on the valve opening command and then continue to measure the actual flow rate value Q. real and the new actual flow value Q real The feedback loop returns to the input, compares it with the set value to form a new error signal, thereby achieving closed-loop control.
[0080] As can be seen from the technical solutions S201-S206 above, this application obtains pipeline pressure, instantaneous flow rate, and fluid temperature in real time, and dynamically calculates fluid density and viscosity using the gas state equation to sense real-time changes in fluid properties. Compared to using fixed property parameters, dynamically calculating fluid density and viscosity reduces control deviation. Furthermore, this application also judges abnormal operating conditions by the deviation between the actual injection volume and the theoretical injection volume. When the deviation exceeds the limit, a correction coefficient is determined by introducing density and viscosity, and the basic adjustment amount output by the PID controller is corrected using the correction coefficient, thus improving control accuracy. In addition, the corrected PID basic adjustment amount is superimposed with the feedforward amount based on the pressure change rate. The feedforward link achieves early compensation for predictable disturbances such as pressure surges. The two work together to effectively reduce the response lag of flow control, improve the adjustment accuracy of the mass flow controller under multiple operating conditions, improve the accuracy of multi-flow path dynamic flow compensation results, and thus improve the accuracy of pipeline flow control results.
[0081] The foregoing mainly describes the solutions provided in the embodiments of this application from a methodological perspective. It is understood that, in order to achieve the above functions, the multi-path dynamic flow compensation device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should readily recognize that, based on the multi-path dynamic flow compensation method steps described in conjunction with the embodiments disclosed in this application, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0082] This application also provides a multi-path dynamic traffic compensation device. This multi-path dynamic traffic compensation device can be a server, a CPU within the server, a module within the server used for multi-path dynamic traffic compensation, or a client within the server used for multi-path dynamic traffic compensation.
[0083] This application embodiment can divide the multi-path dynamic flow compensation device into functional modules or functional units according to the above method example. For example, each function can be divided into a separate functional module or functional unit, or two or more functions can be integrated into one processing unit. The integrated module can be implemented in hardware or in software functional modules or functional units. The module or unit division in this application embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.
[0084] When dividing each function into modules according to its corresponding function. Figure 4 This application provides a structural diagram of a multi-path dynamic flow compensation device as an example. Figure 4 As shown, the multi-path dynamic flow compensation device can be used to perform... Figure 2The multi-path dynamic flow compensation method is shown. The multi-path dynamic flow compensation device 40 includes: an acquisition module 401, a calculation module 402, a determination module 403, and an output module 404. The acquisition module 401 is used to acquire the pipeline pressure inside the transmission pipeline, the instantaneous flow rate of the fluid being transmitted in the transmission pipeline, and the fluid temperature. The calculation module 402 is used to calculate the fluid density and fluid viscosity of the current fluid using the gas state equation based on the pipeline pressure and fluid temperature. The determination module 403 is used to calculate the actual injection volume based on the instantaneous flow rate and compare it with the theoretical injection volume to obtain the volume deviation. The acquisition module 401 is also used to... When the product deviation exceeds a preset volume threshold, a correction coefficient is obtained based on the fluid density and fluid viscosity. The determination module 403 is also used to correct the basic adjustment amount output by the PID controller using the correction coefficient, and to superimpose the corrected basic adjustment amount with the feedforward amount generated based on the pressure change rate to obtain the valve opening command. The PID controller is used to calculate the basic adjustment amount based on the error between the target flow rate and the actual flow rate. The output module 404 is used to output the valve opening command to the mass flow controller, which is used to adjust the valve opening inside the regulating pipeline to control the flow rate of the fluid.
[0085] This application also provides a multi-path dynamic flow compensation device; the multi-path dynamic flow compensation device can be used to perform the multi-path dynamic flow compensation method provided in any of the above embodiments. Figure 5 This is a schematic diagram of the structure of a multi-path dynamic flow compensation device 50 provided in an embodiment of this application. Figure 5 As shown, the multi-path dynamic flow compensation device 50 may include a processor 501, a bus 502, a communication interface 503, and a memory 504.
[0086] The processor 501, memory 504 and communication interface 503 can be connected via bus 502.
[0087] The processor 501 can be a CPU, a general-purpose processor, a network processor (NP), a digital signal processor (DSP), a microprocessor, a microcontroller, a programmable logic device (PLD), or any combination thereof. The processor 501 can also be other devices with processing capabilities, such as circuits, devices, or software modules, without limitation.
[0088] Bus 502 is used to transmit information between the components included in the multi-path dynamic flow compensation device 50.
[0089] Communication interface 503 is used to communicate with other devices or other communication networks. These other communication networks can be Ethernet, radio access network (RAN), wireless local area networks (WLAN), etc. Communication interface 503 can be a module, circuit, communication interface, or any device capable of enabling communication.
[0090] Memory 504 is used to store instructions. These instructions can be computer programs.
[0091] The memory 504 can be a read-only memory (ROM) or other type of static storage device that can store static information and / or instructions; it can also be a random access memory (RAM) or other type of dynamic storage device that can store information and / or instructions; it can also be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, etc., without limitation.
[0092] It should be noted that the memory 504 can exist independently of the processor 501 or can be integrated with the processor 501. The memory 504 can be used to store instructions, program code, or some data. The memory 504 can be located inside or outside the multi-flow path dynamic flow compensation device 50, without limitation. The processor 501 is used to execute the instructions stored in the memory 504 to implement the multi-flow path dynamic flow compensation method provided in the following embodiments of this application.
[0093] In one example, processor 501 may include one or more CPUs.
[0094] As an optional implementation, the multi-path dynamic flow compensation device 50 includes multiple processors.
[0095] As an optional implementation, the multi-path dynamic flow compensation device 50 also includes an output device and an input device, which are not shown in the figure.
[0096] In this embodiment of the application, the chip system may be composed of chips or may include chips and other discrete devices.
[0097] This disclosure also provides a computer-readable storage medium storing instructions that, when executed by a processor of an electronic device, enable the electronic device to perform the multi-path dynamic flow compensation method provided in the embodiments of this disclosure described above.
[0098] This disclosure also provides a computer program product containing instructions that, when run on an electronic device, cause the electronic device to execute the multi-path dynamic flow compensation method provided in the above-described embodiments of this disclosure.
[0099] The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: electrical connections having one or more wires; portable computer disks; hard disks; random access memory (RAM); read-only memory (ROM); erasable programmable read-only memory (EPROM); registers; hard disks; optical fibers; portable compact disc read-only memory (CD-ROM); optical storage devices; magnetic storage devices; or any suitable combination thereof; or any other form of computer-readable storage medium known in the art. An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium may also be a component of the processor. The processor and the storage medium may reside in an application-specific integrated circuit (ASIC). In the embodiments of this application, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0100] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0101] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another apparatus, or some features may be ignored or not executed. Furthermore, the mutual 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.
[0102] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the classified units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0103] Furthermore, the functional units in the various embodiments of this application 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. The integrated unit can be implemented in hardware or as a software functional unit.
[0104] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, essentially, or the part that contributes to the prior art, or a complete or partial classification of the technical solution, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0105] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A multi-path dynamic flow compensation method, characterized in that, include: The pipeline pressure inside the transmission pipeline, the instantaneous flow rate of the fluid transmitted in the transmission pipeline, and the fluid temperature are obtained. Based on the pipeline pressure and the fluid temperature, the current fluid density and fluid viscosity are calculated using the gas state equation. The actual injection volume is calculated based on the instantaneous flow rate and compared with the theoretical injection volume to obtain the volume deviation; When the volume deviation exceeds a preset volume threshold, a correction coefficient is obtained based on the fluid density and the fluid viscosity. The correction coefficient is used to correct the basic adjustment amount output by the PID controller, and the corrected basic adjustment amount is superimposed with the feedforward amount generated based on the pressure change rate to obtain the valve opening command; wherein, the PID controller is used to calculate the basic adjustment amount based on the error between the target flow rate and the actual flow rate; The valve opening command is output to the mass flow controller, which is used to adjust the valve opening inside the pipeline to control the flow rate of the fluid.
2. The method according to claim 1, characterized in that, The step of correcting the basic adjustment of the PID controller output using the correction coefficient includes: Multiply the correction factor by at least one of the proportional gain, integral gain, and derivative gain of the PID controller; The base adjustment amount is recalculated using the adjusted gain.
3. The method according to claim 1, characterized in that, The feedforward quantity generated based on the rate of pressure change is calculated as follows: Real-time monitoring of pipeline pressure; calculation of the pressure difference between the current moment and the previous moment, divided by the sampling interval, yields the pressure change rate. When the absolute value of the pressure change rate exceeds a preset change rate threshold, the pressure change rate is multiplied by a preset feedforward coefficient to obtain the feedforward amount. When the absolute value of the pressure change rate does not exceed the preset change rate threshold, the feedforward amount is determined to be zero.
4. The method according to claim 1, characterized in that, The step of superimposing the corrected base adjustment amount with the feedforward amount generated based on the pressure change rate includes: Calculate the variance of the N pipeline pressures obtained up to the current time, and use it as a stability index; The weighting coefficients are determined based on the stability index, and the weighting coefficients are multiplied by the corrected base adjustment amount to obtain the weighted base adjustment amount. The weighted base adjustment amount is superimposed with the feedforward amount.
5. The method according to claim 4, characterized in that, The step of determining the weighting coefficients based on the stability index includes: When the stability index is greater than the first threshold, the weighting coefficient is set to a positive number less than 1 to reduce the adjustment step size; When the stability index is less than the second threshold, the weighting coefficient is set to 1; When the stability index is between the first threshold and the second threshold, the weighting coefficient decreases as the stability index increases.
6. The method according to claim 1, characterized in that, The step of calculating the current fluid density and viscosity using the gas state equation based on the pipeline pressure and the fluid temperature includes: The pipeline pressure is normalized, and the normalized pressure value is mapped to a preset range. The normalized pressure value is logarithmically transformed to obtain the transformed pressure value; The transformed pressure value is used as one of the input parameters of the gas state equation, and the current fluid density and viscosity are calculated using the gas state equation.
7. The method according to claim 1, characterized in that, The step of calculating the actual injection volume based on the instantaneous flow rate and comparing it with the theoretical injection volume to obtain the volume deviation includes: The instantaneous flow rate is integrated over time within a preset time window to obtain the actual injection volume. Calculate the difference between the actual injection volume and the theoretical injection volume, divide the difference by the theoretical injection volume, and obtain the relative volume deviation as the volume deviation.
8. A multi-path dynamic flow compensation device, characterized in that, The device includes: an acquisition module, a calculation module, a determination module, and an output module; The acquisition module is used to acquire the pipeline pressure inside the transmission pipeline, the instantaneous flow rate of the fluid transmitted in the transmission pipeline, and the fluid temperature. The calculation module is used to calculate the current fluid density and fluid viscosity based on the pipeline pressure and the fluid temperature using the gas state equation. The determining module is used to calculate the actual injection volume based on the instantaneous flow rate and compare it with the theoretical injection volume to obtain the volume deviation; The acquisition module is further configured to acquire a correction coefficient based on the fluid density and the fluid viscosity when the volume deviation exceeds a preset volume threshold. The determining module is further configured to correct the basic adjustment amount output by the PID controller using the correction coefficient, and to superimpose the corrected basic adjustment amount with the feedforward amount generated based on the pressure change rate to obtain the valve opening command; wherein, the PID controller is configured to calculate the basic adjustment amount based on the error between the target flow rate and the actual flow rate; The output module is used to output the valve opening command to the mass flow controller, which is used to adjust the valve opening inside the pipeline to control the flow rate of the fluid.
9. An electronic device, characterized in that, include: A processor and a communication interface; the communication interface is coupled to the processor, the processor being configured to run computer programs or instructions to implement the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed by a computer, perform the method described in any one of claims 1-7.