A digital twin driven predictive control system and method for gas odorization

CN123006958APending Publication Date: 2026-10-30PRELITE (TIANJIN) GAS EQUIP CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202611106327.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-24
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0005]针对现有技术的不足,本发明提供了一种数字孪生驱动的燃气加臭预测性控制系统和方法,解决了长距离燃气管网加臭过程中,由于流体输运存在的纯滞后特性以及管壁吸附参数的动态漂移,导致浓度反馈控制出现时间错位与系统震荡发散的问题

Benefits of technology

[0035]本发明通过孪生服务器内嵌的数字孪生机理模型,依据管网局部加臭剂浓度计算管壁吸附速率并生成吸附补偿流率,实现了对管网沿程吸附损耗的前馈补偿。该机制在流体输运至下游检测点之前,预先在总控制指令中叠加了用于抵消物理消耗的流率,解决了长输管网中因管壁动态吸附造成的末端加臭剂浓度偏低问题,提升了基础的加臭计量精度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123006958A_ABST
    Figure CN123006958A_ABST
Patent Text Reader

Abstract

The application relates to the field of gas odorization control, and discloses a digital twin driven gas odorization predictive control system and method, which comprises the following steps: a twin server performs mechanism model deduction based on gas operation data and injection flow rate, and calculates and generates an adsorption compensation flow rate; a controller establishes a timestamp mapping dictionary, accurately maps a concentration feedback deviation to a historical injection time, and generates a feedback compensation flow rate; and finally, a total control instruction is generated by combining a basic proportional instruction and the adsorption compensation flow rate. In addition, the system actively executes a pulse superposition instruction when the flow is stable, compares a characteristic deviation matrix of a theoretical response waveform and a measured response waveform, and updates a pipe wall adsorption reaction constant and a desorption constant in the model online. The application decouples the pure lag characteristic of fluid transportation, compensates for pipe wall dynamic adsorption loss, avoids feedback control divergence under the condition of a long-distance pipe network, and improves the odorization control precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of gas odorization control, specifically to a digital twin-driven predictive control system and method for gas odorization. Background Technology

[0002] Odorization of natural gas is a fundamental aspect of the safe operation of urban gas pipeline networks. Existing technologies include solutions that can automatically odorize gas based on instantaneous gas flow rates. For example, CN204164669U discloses an intelligent gas odorization system that uses a PLC intelligent odorization controller to collect instantaneous natural gas flow signals, calculates the odorization amount based on the instantaneous gas flow rate and preset odorization parameters, and then drives a metering pump to inject odorant into the odorization point of the gas pipeline. CN203656580U also discloses an automatic gas odorization device that uses a flow meter, controller, and injection mechanism to adjust the amount of odorant added. While these technologies can achieve proportional injection of odorant based on gas flow rates, their control is primarily focused on the instantaneous flow rate at the odorization point. They do not further consider pipeline pressure, temperature, injection mass flow rate, and local odorant concentration in the pipeline network to deduce the mechanism and provide feedforward compensation for pipe wall adsorption losses of the odorant during long-distance transportation. Therefore, when the odorant is dynamically adsorbed by the inner wall of the pipeline during transportation, the existing system has difficulty in offsetting this physical consumption before it reaches the downstream detection point, which easily leads to a lower measured concentration of odorant at the end and insufficient basic odorization metering accuracy.

[0003] To correct for end-point concentration deviations, existing technologies utilize chromatographs or odorant detection devices to obtain downstream odorant concentrations. For example, EP0445927A2 discloses an analytical system for natural gas odorant detection, and CN115479999A discloses a sulfur-free odorant detection system based on thermal desorption and gas chromatography. While these detection technologies can provide downstream concentration feedback, in long-distance gas pipeline networks, the concentration data currently sampled by downstream detection equipment actually corresponds to the injection state at a historical moment upstream. If conventional control systems directly use the current detection deviation to correct the current odorization command, they fail to decouple the pure time delay characteristics of the gas transportation process, easily causing a time misalignment between the feedback action and the actual physical state. This can lead to integral saturation, overcompensation, or control command oscillations under long-lag conditions, affecting the stability of closed-loop control.

[0004] Meanwhile, the physical parameters affecting odorant transport losses within the pipeline network are not constant. Changes in ambient temperature, long-term pipeline service, pipe wall aging, changes in roughness, or changes in liquid conditions all cause drift in the adsorption and desorption constants of the pipe wall. Existing odorization systems generally rely on preset parameters, flow ratio control, or passive concentration feedback for correction, lacking a mechanism to actively acquire measured characteristic data of the pipeline network flow field evolution without interrupting normal odorization operations. Furthermore, it is difficult to perform online optimization and updates of internal mechanism parameters based on the deviation between theoretical and measured response waveforms. Therefore, when changes occur in the pipeline environment or pipe wall conditions, existing systems struggle to calibrate adsorption-related parameters in a timely manner, making it difficult to maintain the accuracy of odorization control over long-term operation. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides a digital twin-driven predictive control system and method for gas odorization, which solves the problems of time misalignment and system oscillation divergence in concentration feedback control caused by the pure lag characteristics of fluid transport and the dynamic drift of pipe wall adsorption parameters during the odorization process of long-distance gas pipelines.

[0006] To achieve the above objectives, the present invention provides the following technical solution:

[0007] The first aspect of this invention provides a digital twin-driven predictive control system for gas odorization, comprising:

[0008] The sensor network collects instantaneous volumetric flow rate, gas pressure, and gas temperature data of the gas.

[0009] The odorization module receives the main control command and injects odorant into the gas pipeline network, while simultaneously measuring the injection mass flow rate;

[0010] The detection module acquires odorant concentration data according to a fixed sampling and analysis cycle;

[0011] The twin server is equipped with a digital twin mechanism model. It uses the acquired instantaneous volumetric flow rate, gas pressure data, gas temperature data and injection mass flow rate to perform the digital twin mechanism model deduction of the gas pipeline flow field and calculate and generate the adsorption compensation flow rate.

[0012] The controller has a preset concentration target stored inside. Based on the comparison between the acquired odorant concentration data and the preset concentration target, the concentration feedback deviation is calculated and converted into a feedback compensation flow rate. At the same time, the adsorption compensation flow rate and the feedback compensation flow rate calculated by the twin server are combined to perform algebraic operations to generate a total control command and control the operation of the odorization module.

[0013] Preferably, the controller provides a unified hardware timing clock signal for the hardware devices deployed on-site to perform system-level time synchronization; the controller adds a timestamp corresponding to the current physical moment of reception to the acquired instantaneous gas volume flow rate, gas pressure data, gas temperature data, and injection mass flow rate; when the controller receives odorant concentration data, it uses the physical moment of opening the sampling valve inside the chromatograph as the timestamp reference for the odorant concentration data.

[0014] Preferably, the twin server receives timestamped instantaneous gas volumetric flow rate, gas pressure data, gas temperature data, and injection mass flow rate, establishes computational boundary conditions, and inputs the timestamped instantaneous gas volumetric flow rate, timestamped gas pressure data, and gas temperature data into the digital twin mechanism model to construct the solution domains for the flow field and temperature field. The twin server establishes a dynamic distribution function within the digital twin mechanism model based on the timestamped injection mass flow rate, and calculates the local odorant concentration at the odorization injection point at the current sampling time. The local odorant concentration at the odorization injection point at the current sampling time is equal to the injection mass flow rate at the current sampling time divided by the instantaneous gas volumetric flow rate at the current sampling time. The twin server sets the calculated local odorant concentration as the baseline parameter for the subsequent component transport solver operation.

[0015] Preferably, the digital twin mechanism model includes a one-dimensional unsteady flow equation solver and a component transport solver, and has built-in pipe wall adsorption reaction constant and pipe wall desorption constant. The twin server establishes time-domain boundary conditions based on the instantaneous volumetric flow rate, gas pressure data, and gas temperature data of the gas. It uses the one-dimensional unsteady flow equation solver to solve and output the transient cross-sectional average velocity field based on the time-domain boundary conditions. It extracts the local transient velocity of the gas fluid particles in the trajectory from the transient cross-sectional average velocity field. It uses the physical constraint relationship that the spatial integral of the differential of the process time variable with respect to the local transient velocity is equal to the effective pipe length of the gas pipeline network, and solves the spatial integral equation to establish a timestamp mapping dictionary.

[0016] The twin server uses the local odorant concentration in the pipeline network output by the component transport solver to calculate the pipe wall adsorption rate. The pipe wall adsorption rate is equal to the difference between two terms: the first term is the product of the pipe wall adsorption reaction constant, the local odorant concentration in the pipeline network, and the remaining adsorbable capacity per unit pipe wall area; the second term is the product of the pipe wall desorption constant and the instantaneous adsorption amount per unit pipe wall area. The twin server then performs a spatial integration of the pipe wall adsorption rate along the entire length of the gas pipeline network using the inner wall surface area to obtain the total adsorption consumption mass rate, and introduces a saturation limiting function to generate the adsorption compensation flow rate.

[0017] Preferably, the controller synchronously calculates the basic proportional odorization command, and the basic proportional odorization command is equal to the product of the instantaneous volumetric flow rate of the gas and the preset concentration target; the controller looks up the upstream injection time corresponding to the downstream detection time according to the timestamp mapping dictionary, maps the calculated concentration feedback deviation to the corresponding upstream injection time in the internally maintained historical state queue, and generates a feedback compensation flow rate corrected according to the timestamp mapping dictionary.

[0018] The feedback compensation flow rate corrected according to the timestamp mapping dictionary is equal to the product of the instantaneous volumetric flow rate of the gas and the correction coefficient term. The correction coefficient term includes the product of the preset proportional gain constant and the mapped concentration feedback deviation, as well as the product of the preset integral gain coefficient and the accumulated value obtained by integrating the concentration feedback deviation in the time series over time. The preset integral gain coefficient is equal to the preset proportional gain constant divided by the preset integral time constant. The algebraic operation performed by the controller is to add the basic proportional odorization command, the adsorption compensation flow rate, and the feedback compensation flow rate corrected according to the timestamp mapping dictionary to obtain the total control command.

[0019] Preferably, the controller continuously monitors the fluctuation state of the instantaneous volumetric flow rate of the gas and calculates the gas flow rate fluctuation rate. When it is confirmed that the gas flow rate fluctuation rate is within the preset steady-state window, the controller drives the odorization pump to execute the pulse superposition command to inject a characteristic mass cluster into the gas pipeline network. The twin server extracts the injected mass flow rate of the pulse phase recorded by the micro-flow meter as the model input boundary and simulates the physical process evolution of the characteristic mass cluster in the gas pipeline network flow field to generate a theoretical response waveform.

[0020] Preferably, the twin server embeds a data processing unit; the data processing unit constructs a measured response waveform based on the acquired odorant concentration data; the data processing unit compares the theoretical response waveform with the measured response waveform, and extracts the peak lag time, peak amplitude, full width at half maximum (FWHM), and integral area of ​​the waveform for both theoretical and measured dual channels; for the peak lag time, peak amplitude, FWHM, and integral area, the data processing unit calculates the absolute value of the difference between the measured response waveform value and the theoretical response waveform value, and divides it by the value under the theoretical response waveform to obtain the normalized relative deviation of each dimension, and calculates and generates a feature deviation matrix.

[0021] Preferably, the twin server assigns corresponding flow field feature weight coefficients and adsorption feature weight coefficients to each normalized relative deviation in the feature deviation matrix, calculates the flow field and topology mismatch confidence and the adsorption parameter drift confidence respectively, and combines them to generate a fault evaluation matrix; the flow field and topology mismatch confidence is equal to the product of the normalized relative deviation of the peak lag time and the corresponding flow field feature weight coefficient plus the product of the normalized relative deviation of the waveform integral area and the corresponding flow field feature weight coefficient; the adsorption parameter drift confidence is equal to the product of the normalized relative deviation of the peak amplitude and the corresponding adsorption feature weight coefficient plus the product of the normalized relative deviation of the waveform full width at half maximum and the corresponding adsorption feature weight coefficient; when the adsorption parameter drift confidence exceeds the preset adsorption drift threshold, the twin server starts the constraint optimization identification algorithm to construct an objective function containing a penalty term;

[0022] The objective function value is equal to the product of the squared normalized relative deviation of the peak amplitude and the corresponding penalty weight coefficient, plus the product of the squared normalized relative deviation of the full width at half maximum of the waveform and the corresponding penalty weight coefficient.

[0023] The twin server completes the closed-loop update of the digital twin mechanism model by iteratively optimizing the optimal tube wall adsorption reaction constant and the optimal tube wall desorption constant to achieve the convergence condition of the objective function value.

[0024] Preferably, the controller monitors the online operating status of the flow meter, chromatograph, and twin server; when a communication link is interrupted, the controller initiates a safety degradation logic, the internal logic unit of the controller forcibly clears the values ​​of the adsorption compensation flow rate and the feedback compensation flow rate corrected according to the timestamp mapping dictionary, and controls the operating mode to revert to the basic open-loop proportional control mode; when the communication signal of the flow meter is lost, the controller extracts the arithmetic mean of the instantaneous volumetric flow rate of the gas within a fixed time window before the fault occurs as the moving average gas volumetric flow rate and outputs control commands in combination with the preset concentration target.

[0025] Preferably, the data processing unit subtracts the baseline flow rate corresponding to the basic proportional odorant command from the transient odorant mass flow rate measured by the micro-flow meter and then performs time integration to obtain the actual injection increment integral; if the actual injection increment integral is not within the set injection tolerance range, the data processing unit determines that the actuator fault confidence is a complete fault state and stops the waveform comparison and parameter calibration process.

[0026] Preferably, when the constraint optimization identification algorithm fails and the calculated optimal pipe wall adsorption reaction constant or optimal pipe wall desorption constant touches the extreme boundary of the set physical reasonable constraint range for multiple consecutive calibration cycles, the twin server determines that the internal digital twin mechanism model has entered a calculation divergence state. When the calculation divergence state occurs, the twin server triggers the model reset protection mechanism, retrieves the historical stable parameter snapshot from the parameter snapshot stack maintained in the non-volatile storage area, and rewrites the retrieved pipe wall adsorption reaction constant and pipe wall desorption constant into the current running memory to forcibly restore the internal digital twin mechanism model to the healthy operating baseline.

[0027] Preferably, if the chromatograph does not receive a sampling trigger signal from the chromatograph within the preset communication waiting period, the controller marks the odorant concentration data of the current period as invalid data to prevent out-of-order data from participating in the predictive control closed-loop calculation; the corresponding value of the preset communication waiting period is equal to the sum of the fixed sampling and analysis period of the chromatograph and the maximum communication delay time of the industrial network bus.

[0028] Preferably, the flow rate value corresponding to the pulse superposition command is directly superimposed on the total control command calculated and output by the current controller, and the pulse superposition command is subject to physical boundary restrictions: the sum of the flow rate amplitude corresponding to the pulse superposition command and the flow rate value of the current total control command is not greater than the upper limit of the mass flow rate corresponding to the highest odorization concentration, and the duration of the pulse superposition command is not less than three times the fixed sampling and analysis cycle of the chromatograph.

[0029] A second aspect of the present invention provides a digital twin-driven predictive control method for gas odorization, comprising:

[0030] Collect instantaneous volumetric flow rate, gas pressure, and gas temperature data of the gas, and simultaneously obtain odorant concentration data according to a fixed sampling and analysis cycle;

[0031] During the injection of odorant into the gas pipeline network, the current injection mass flow rate is measured;

[0032] The digital twin mechanism model of the gas pipeline flow field is used to perform deduction using the obtained instantaneous volumetric flow rate of the gas, the gas pressure data, the gas temperature data, and the injection mass flow rate, and the adsorption compensation flow rate is calculated and generated.

[0033] Based on the comparison between the acquired odorant concentration data and the preset concentration target, the concentration feedback deviation is calculated and converted into a feedback compensation flow rate. At the same time, the calculated adsorption compensation flow rate and the feedback compensation flow rate are combined to perform algebraic operations to generate a total control command to control the odorization operation.

[0034] The present invention provides a digital twin-driven predictive control system and method for gas odorization, which has the following beneficial effects:

[0035] This invention utilizes a digital twin mechanism model embedded in a twin server to calculate the adsorption rate on the pipe wall based on the local odorant concentration in the pipeline network and generate an adsorption compensation flow rate, thereby achieving feedforward compensation for adsorption losses along the pipeline. This mechanism pre-adds a flow rate to offset physical losses to the overall control command before the fluid is transported to the downstream detection point, solving the problem of low end-point odorant concentration caused by dynamic adsorption on the pipe wall in long-distance pipelines and improving the basic accuracy of odorant metering.

[0036] This invention establishes a physically delayed timestamp mapping dictionary by tracking the spatial trajectory of gas fluid particles. The concentration feedback deviation, derived from current detection data, is mapped to the corresponding upstream injection time in the internally maintained historical state queue for calculation. This cross-time-domain feedback correction method decouples the pure time delay characteristics in long-distance pipeline fluid transport, preventing integral saturation and control command divergence that are prone to occur in conventional proportional-integral control under long-delay systems, thus ensuring the operational stability of the closed-loop logic.

[0037] This invention achieves online optimization and updating of the pipe wall adsorption and desorption constants by driving the odorization module to execute restricted pulse superposition commands within the steady-state flow window and comparing the characteristic deviation matrix of the theoretical and measured response waveforms to initiate a constrained optimization identification algorithm. This mechanism allows the system to actively acquire measured characteristic data of flow field evolution and calibrate the internal digital twin mechanism model without interrupting normal odorization operations, overcoming the drift of physical parameters caused by changes in ambient temperature or pipe aging. Attached Figure Description

[0038] Figure 1 This is a system architecture diagram of the present invention;

[0039] Figure 2 This is a flowchart of the method of the present invention;

[0040] Figure 3 This is a timing diagram of the multidimensional industrial data synchronization and boundary-driven mechanism of the present invention;

[0041] Figure 4 This is a schematic diagram illustrating the principle of spatiotemporal evolution parameter extraction and physical dimension alignment in this invention.

[0042] Figure 5 This is the logic diagram of the advanced process control and instruction reconfiguration of the present invention;

[0043] Figure 6 This is a schematic diagram illustrating the active transient excitation and waveform feature extraction principle of the present invention.

[0044] Figure 7 This is a waveform diagram of the execution of the restricted pulse superposition instruction of the odorization pump of the present invention;

[0045] Figure 8 This is a comparison diagram of the theoretical and measured responses of the downstream detection points in this invention using dual-channel waveforms.

[0046] Figure 9 This is a convergence curve of the objective function of the constraint optimization identification algorithm of the present invention;

[0047] Figure 10 This is a comparison chart of the adsorption compensation flow rate before and after self-calibration according to the present invention. Detailed Implementation

[0048] The technical solutions in 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.

[0049] See Figure 1 This invention provides a digital twin-driven predictive control system for gas odorization, which may include a sensor network, an odorization module, a detection module, a controller, and a twin server. The sensor network collects physical data of the gas pipeline network and aggregates it to the controller. The controller synchronizes data with the twin server and outputs a general control command to the odorization module. After the odorization module injects odorant into the gas pipeline network, the detection module obtains the odorant concentration data to provide closed-loop verification.

[0050] A sensor network is deployed along the gas pipeline network, including flow meters, pressure transmitters, and temperature transmitters. Flow meters are installed on the main gas pipeline to measure the instantaneous volumetric flow rate of gas in real time. Pressure and temperature transmitters are distributed at the nodes of the gas pipeline network to collect real-time gas pressure and temperature data distributed throughout the network and transmit the collected data to the controller.

[0051] The odorization module is installed at the odorization injection point of the gas pipeline network and includes an odorization pump (a backup odorization pump can be installed in parallel internally to ensure system redundancy and safety) and a micro-flow meter. The odorization pump receives the overall control command from the controller and injects odorant into the gas pipeline network. The micro-flow meter is installed on the outlet pipeline of the odorization pump to directly measure the injected mass flow rate of the odorant and transmits the measured injection mass flow rate back to the controller.

[0052] The detection module includes a chromatograph, which is installed at the end of the downstream gas pipeline or a branch node at a preset spatial distance from the odorant injection point. The chromatograph acquires odorant concentration data at fixed sampling and analysis cycles, providing end-point verification data for the entire control closed loop.

[0053] The controller establishes industrial communication connections with the sensor network, odorization module, and detection module, respectively. It is responsible for performing low-level hardware data polling to collect data on instantaneous gas volumetric flow rate, gas pressure, gas temperature, injected mass flow rate, and odorant concentration. Internally, it maintains a historical state queue and pre-stores preset concentration targets. By comparing the obtained odorant concentration data with the preset concentration targets, it calculates the concentration feedback deviation and converts it into a feedback compensation flow rate. Then, it performs algebraic calculations based on the compensation parameters issued by the twin server and outputs a general control command to the odorization module based on the calculation results.

[0054] The twin server establishes data synchronization with the controller through an edge gateway, thereby acquiring instantaneous gas volumetric flow rate, gas pressure data, gas temperature data, injected mass flow rate, and odorant concentration data. The twin server deploys a digital twin mechanism model, which includes a one-dimensional unsteady flow equation solver and a component transport solver, and incorporates pipe wall adsorption reaction constants and pipe wall desorption constants. Using the acquired data, it performs online mechanism calculations of the gas pipeline network flow field to obtain the local odorant concentration in the pipeline network, and calculates and generates compensation parameters including adsorption compensation flow rate, which are then sent to the controller.

[0055] The system is applicable to gas pipeline networks including single-pipe or tree-like branch networks from a single odorization injection point to one or more downstream detection points. To achieve predictive control, the system control logic adopts a dual-loop collaborative architecture. The controller executes a fast feedforward compensation control loop with second-level data updates based on the instantaneous gas volumetric flow rate. The twin server, based on a digital twin mechanism model, pre-evolves the dynamic process of the pipeline network and, combined with the odorant concentration data fed back by the chromatograph, executes a slow parameter identification control loop with a minute-level analysis cycle, thereby constructing a complete predictive control closed loop.

[0056] See Figure 2 This invention provides a digital twin-driven predictive control method for gas odorization, comprising the following steps:

[0057] S10. Synchronously acquire transient fluid dynamics data of the gas pipeline network and microscopic transport data of the odorant. The twin server acquires the instantaneous volumetric flow rate of the gas measured by the flow meter, the gas pressure data measured by the pressure transmitter, and the gas temperature data measured by the temperature transmitter. It also simultaneously acquires the injection mass flow rate fed back by the micro-flow meter and the odorant concentration data measured by the chromatograph, which are used to establish the time-domain boundary conditions of the digital twin mechanism model.

[0058] S20. Solve the unsteady flow equations and extract spatiotemporal evolution parameters. The twin server tracks the spatial trajectory of the gas fluid particles based on the established temporal boundary conditions and establishes a physically lagging timestamp mapping dictionary. During the spatial evolution process, the twin server uses the digital twin mechanism model to calculate the local odorant concentration in the pipeline network, calculates the adsorption rate on the pipe wall based on the local odorant concentration, and integrates it along the space to generate the adsorption compensation flow rate.

[0059] S30. Based on the fast feedforward compensation control loop, dynamic control commands are generated and odorization control actions are executed. The controller internally maintains a historical state queue and calculates the basic proportion odorization command in combination with the preset concentration target. By comparing the obtained odorant concentration data with the preset concentration target, the concentration feedback deviation is calculated and converted into a feedback compensation flow rate. Then, the basic proportion odorization command, the adsorption compensation flow rate, and the feedback compensation flow rate corrected according to the timestamp mapping dictionary are algebraically summed to generate a total control command, and the odorization pump is driven to operate according to the total control command.

[0060] S40. Trigger restricted active transient excitation and acquire physical flow rate feedback. During the odorization control action, the controller continuously monitors the fluctuation state of the instantaneous volumetric flow rate of the gas. When it is determined that the gas flow rate fluctuation rate is within the preset steady-state flow window, the controller sends a pulse superposition command to the odorization pump. After the pulse action is executed, the twin server extracts the injected mass flow rate of the pulse phase recorded by the micro-flowmeter as the model input boundary and evolves to generate the theoretical response waveform reaching the location of the detection module.

[0061] S50. Extract the four-dimensional feature parameters of the dual-channel waveform. Within the preset observation time window, the data processing unit embedded in the twin server compares the theoretical response waveform with the measured response waveform constructed based on the odorant concentration data obtained by the chromatograph. From the dual-channel comparison, peak lag time, peak amplitude, full width at half maximum (FWHM), and integral area of ​​the waveform are extracted respectively. For these four feature parameters, the values ​​of the measured response waveform and the theoretical response waveform are obtained sequentially. The absolute value of the difference between the two is calculated, and the absolute value is divided by the value of the corresponding feature parameter under the theoretical response waveform to obtain the normalized relative deviation of each dimension. Then, the feature deviation matrix is ​​generated by calculating the normalized relative deviation of each dimension.

[0062] S60. Based on the slow parameter identification control loop, multi-dimensional feature joint decoupling and mechanism model self-calibration are performed. Feature weights are assigned according to the extracted feature deviation matrix to construct a fault evaluation matrix, used to identify whether the digital twin mechanism model has experienced parameter drift. If parameter drift is confirmed, the twin server initiates a constraint optimization identification algorithm to update the tube wall adsorption reaction constant and tube wall desorption constant of the internal digital twin mechanism model, completing the closed-loop self-calibration.

[0063] See Figure 3 In step S10, the process of simultaneously acquiring transient hydrodynamic data of the gas pipeline network and microscopic transport data of the odorant includes the following sub-steps:

[0064] S11. System hardware clock synchronization. There are differences in sampling frequencies and physical communication delays among the various hardware devices within the sensor network, odorization module, and detection module. To ensure data timing consistency, the controller uses a known synchronization method, such as a network time protocol or a precision time protocol, to send a unified hardware timing clock signal to all deployed devices in the field via an industrial network bus.

[0065] The controller acquires the instantaneous volumetric flow rate of the gas measured by the flow meter, the gas pressure data measured by the pressure transmitter, the gas temperature data measured by the temperature transmitter, and the injection mass flow rate fed back by the micro flow meter. While acquiring the data, the controller adds a timestamp corresponding to the current physical moment to the received instantaneous volumetric flow rate, gas pressure data, gas temperature data, and injection mass flow rate.

[0066] Since the odorant concentration data acquired by the chromatograph is based on its fixed sampling and analysis cycle, the controller uses the moment when the sampling valve inside the chromatograph opens as the timestamp reference for the odorant concentration data when receiving the odorant concentration data from the chromatograph. If no sampling trigger signal is received from the chromatograph within the preset communication waiting period, the controller marks the odorant concentration data of the current cycle as invalid data to prevent out-of-order data from affecting subsequent predictive control closed-loop calculations, thereby completing the time axis alignment of multi-dimensional industrial data. The preset communication waiting period is pre-configured by system maintenance personnel and written into the controller; its value is the sum of the chromatograph's fixed sampling and analysis cycle and the maximum communication delay of the industrial network bus.

[0067] S12. Construction of Flow Field Calculation Boundary Conditions. After receiving timestamped physical data, the twin server establishes computational boundary conditions for the internally deployed one-dimensional unsteady flow equation solver. In establishing these boundary conditions, the geometric and physical reference of the gas pipeline network is first established within the digital twin mechanism model, and then a one-dimensional spatial coordinate system is defined, setting the spatial coordinates as... The origin of the coordinate system is... Set the odorization injection point where the odorization module is located, and set the coordinate endpoint. Set as the downstream detection point of the detection module (for tree-shaped branch pipe networks, spatial coordinates) Specifically, this is represented by the equivalent topological path tracing coordinates along the main fluid flow path to the specific branch detection module, and simultaneously, the actual pipe inner diameter of the gas pipeline network is loaded into the digital twin mechanism model. .

[0068] From the perspective of the principles of physical flow field evolution, digital twin mechanism models need to clearly define the fluid input to the pipeline network and the state resistance along the pipeline. Therefore, in continuous time... The twin server then resolves the timestamped instantaneous volumetric flow rate of the gas into dynamic flow inflow boundary conditions at the gas pipeline inlet. Simultaneously, it maps and matches the timestamped gas pressure and temperature data to the corresponding gas pipeline topology nodes in the digital twin mechanism model, thereby transforming the gas pressure and temperature data into pressure distribution boundary conditions and temperature field boundary conditions during the fluid evolution process. For the continuity and momentum equations involved in one-dimensional unsteady flow, those skilled in the art can perform discrete solutions using known numerical methods such as the method of characteristics or the finite volume method based on the set boundary conditions; these will not be elaborated upon here.

[0069] S13. Setting Boundary Conditions for Component Transport Calculation. The component transport solver needs to obtain the initial concentration field formed by the mixing of trace odorant components into the main gas flow field. Based on the injection mass flow rate fed back by a timestamped micro-flowmeter, the twin server establishes a dynamic mass source term at the odorization injection point within the digital twin mechanism model. To obtain the initial input values ​​for component transport, the twin server calculates the current sampling time using the following formula. Local odorant concentration at odor injection point in the pipeline network:

[0070] ;

[0071] in, Represents the current sampling time The local concentration of odorant in the pipeline network at the odorization injection point; Represents the current sampling time Injection mass flow rate fed back by a micro flow meter; Represents the current sampling time The flow meter measures the instantaneous volumetric flow rate of the gas. The twin server ultimately sets the calculated local odorant concentration in the pipeline network as the convection-diffusion inflow boundary condition for the component transport solver.

[0072] S14. Initialization of the digital twin mechanism model. After preparing the required boundary data, the twin server synchronously loads the parsed dynamic flow inflow boundary conditions, pressure distribution boundary conditions, temperature field boundary conditions, and convection-diffusion inflow boundary conditions into the internal digital twin mechanism model.

[0073] The digital twin mechanism model utilizes loaded dynamic flow inflow boundary conditions, pressure distribution boundary conditions, temperature field boundary conditions, and convection-diffusion inflow boundary conditions to update the initial velocity matrix, initial pressure matrix, and initial component concentration matrix of the internal computational discrete grid nodes based on the gas pipeline network topology. By performing matrix update operations, it completes the initialization of the internal computational environment, enabling the one-dimensional unsteady flow equation solver and component transport solver to advance the time step and perform pipeline network dynamic evolution calculations, thus preparing to enter a continuous real-time computation cycle.

[0074] Reference Figure 4 In step S20, the process of solving the unsteady flow equations and extracting the spatiotemporal evolution parameters includes the following sub-steps:

[0075] S21. Spatial Trajectory Tracking and Timestamp Mapping of Gas Fluid Particles. Gas pipeline flow fluctuates under varying operating conditions, causing a non-linear physical lag in the time it takes for the odorant to travel from the odorization module to the detection module. In the conventional constant flow assumption, the transport time is considered constant. However, in actual gas pipelines, the internal flow velocity changes dynamically with the peak and valley variations in gas consumption at the user end. This dynamic change makes the physical lag time over the same spatial distance a dynamic variable that varies with time.

[0076] To compensate for calculation errors caused by nonlinear hysteresis effects due to flow field fluctuations, the twin server establishes time-domain boundary conditions based on acquired instantaneous gas volumetric flow rate, gas pressure, and gas temperature data. Using a one-dimensional unsteady flow equation solver, it solves and outputs the transient cross-sectional average velocity field based on the time-domain boundary conditions, establishing a spatial trajectory model of the gas fluid particles. The spatial trajectory of the gas fluid particles satisfies the underlying microscopic kinematic laws, namely, the derivative of the spatial coordinate trajectory of the gas fluid particles with respect to the process time variable is always equal to the local transient velocity in the trajectory. Based on these microscopic kinematic laws, the twin server solves the spatial integral equation by integrating the local transient velocity of the gas fluid particles in the trajectory, extracted from the transient cross-sectional average velocity field, with respect to the process time variable. The result is equal to the effective pipe length of the gas pipeline network. This transforms the fixed spatial distance into a dynamic time mapping relationship. The spatial integral equation is as follows:

[0077] ;

[0078] in, Represents the downstream detection time; Represents the upstream injection time; Represents the transient cross-sectional average velocity field; Represents process time variables The differential; Represents the effective length of the gas pipeline network; The spatial coordinate trajectory representing the change of gas fluid particles over time; This represents the local transient velocity of the gas fluid particles in their trajectory. Represents the integral operator.

[0079] The twin server solves the spatial integral equation through numerical integration iteration. During iterative calculation, the computer program starts from the upstream injection time and accumulates the integral along the spatial coordinates by advancing the time step until the spatial integral value equals the effective pipe length, at which point the iteration stops. The system uses this numerical integration derivation method to back-calculate the corresponding upstream injection time for each downstream detection time that receives odorant concentration data, thereby establishing a nonlinear timestamp mapping dictionary. This timestamp mapping dictionary is used to accurately correspond the odorant concentration data acquired by the detection module to the historical time when the odorant module performs the physical injection action. For the specific algorithm of the numerical integration iteration solution, those skilled in the art can use the Runge-Kutta method, whose specific algorithm is well-known in the field and will not be elaborated here.

[0080] S22. Calculation of Pipe Wall Adsorption Rate Based on Local Gas Phase Concentration. During gas pipeline transmission, odorant undergoes physical adsorption and desorption on the pipeline wall, causing a decrease or abnormal increase in the gas phase odorant concentration along the pipeline. Generally speaking, when the local odorant concentration in the pipeline is high and the pipe wall adsorption is not saturated, odorant molecules adhere to the pipe wall, resulting in adsorption loss; conversely, when the local odorant concentration decreases and the pipe wall adhesion is high, the adhered odorant molecules detach from the pipe wall and re-enter the gas phase fluid, resulting in desorption replenishment. The twin server uses the local odorant concentration output by the component transport solver, combined with the adsorption kinetic parameters built into the digital twin mechanism model, to calculate the microscopic pipe wall adsorption rate. The specific calculation formula is as follows:

[0081] ;

[0082] in, Represents the adsorption reaction constant of the tube wall; This represents the maximum adsorption capacity per unit tube wall area. Represents the desorption constant of the tube wall; Represents the sign of partial derivatives; Represents continuous time Spatial coordinates The concentration of odorant added to the local pipeline network at the location; Represents continuous time Spatial coordinates The instantaneous adsorption capacity per unit wall area at the location; Represents continuous time Spatial coordinates The adsorption rate on the tube wall at that location; Represents continuous time Spatial coordinates The remaining adsorption capacity per unit tube wall area at the location; Represents continuous time Spatial coordinates The partial derivative of the instantaneous adsorption capacity per unit pipe wall area with respect to continuous time. That is, the pipe wall adsorption rate is equal to the difference between the following two terms: the first term is the product of the pipe wall adsorption reaction constant, the local odorant concentration in the pipe network, and the remaining adsorbable capacity per unit pipe wall area; the second term is the product of the pipe wall desorption constant and the dynamic instantaneous adsorption capacity per unit pipe wall area.

[0083] The pipe wall adsorption reaction constant, pipe wall desorption constant, and maximum adsorption capacity per unit pipe wall area all characterize the intrinsic properties of the pipe material. Initial values ​​for these parameters can be obtained through laboratory static adsorption tests on pipe samples used in specific gas pipeline networks, or retrieved from industry pipe material experience manuals. By calculating the pipe wall adsorption rate, a digital twin mechanism model can assess and calculate the dynamic loss of the odorant mass source due to the adsorption effect on the pipeline wall.

[0084] S23. Physical Dimension Alignment and Adsorption Compensation Flow Rate Generation. The microscopic pipe wall adsorption rate cannot be directly used by the controller for equipment control. The twin server performs a physical dimension alignment operation, converting the pipe wall adsorption rate into macroscopic executable equipment command parameters. Specifically, the conversion process involves spatially integrating the pipe wall adsorption rate along the entire length of the gas pipeline using the inner wall surface area to calculate the total adsorption consumption mass rate. To prevent the total adsorption consumption mass rate from causing overflow of internal controller commands or mechanical overload of the odorization pump under extreme operating conditions, an engineering saturation limiting mechanism is further introduced to generate the final adsorption compensation flow rate. The calculation formula is as follows:

[0085] ;

[0086] in, Represents continuous time Adsorption compensation flow rate; Represents the saturation limiting function; Represents continuous time Spatial coordinates The adsorption rate on the tube wall at that location; Represents the constant value of pi; This represents the actual inner diameter of the gas pipeline network. Differential variables representing spatial coordinates; Represents the effective length of the gas pipeline network; This represents the lower limit of the safety margin for the compensation flow rate; This represents the safe upper limit of the compensation flow rate; This represents the total adsorption and consumption mass rate obtained by integrating the adsorption rate along the inner wall of the gas pipeline network.

[0087] When configuring the control system parameters, the lower limit of the compensation flow rate is set to a negative value, and the absolute value of the lower limit of the compensation flow rate is limited to a preset ratio value within the range of 10% to 20% of the rated minimum output flow of the odorizing pump. At the same time, the controller introduces a dynamic safety constraint when executing the logic operation of the total control command to ensure that the algebraic sum of the current basic ratio odorization command and the adsorption compensation flow rate is always not less than the rated minimum output flow of the odorizing pump. The preset ratio value is set by the technicians according to the operating condition manual of the odorizing pump to prevent the odorization action from being interrupted by the reverse command issued by the control system under severe desorption conditions. The upper limit of the compensation flow rate is set to a positive value, and the value of the upper limit of the compensation flow rate does not exceed the remaining work margin of the equipment after subtracting the basic ratio odorization command from the maximum operating flow of the odorizing pump.

[0088] In the physical constraint relationship, when the pipe wall adsorption rate is greater than zero, it indicates that net adsorption occurs in the gas pipeline network, and the adsorption compensation flow rate is positive; when the pipe wall adsorption rate is less than zero, it indicates that net desorption occurs in the gas pipeline network, and the adsorption compensation flow rate is negative. The twin server sends the generated adsorption compensation flow rate to the controller to participate in the algebraic calculation of the overall control command. For the code compilation logic of the saturation limiting function and the one-dimensional space integral, those skilled in the art can call standard mathematical function libraries; its code compilation logic is well-known technology in this field and will not be elaborated here.

[0089] See Figure 5 In step S30, the process of generating dynamic control commands based on the fast feedforward compensation control loop and executing the odorization control action includes the following sub-steps:

[0090] S31. Concentration feedback deviation calculation mechanism based on historical state queue maintenance and comparison with preset concentration targets. The controller's underlying layer uses a programmable logic controller (PLC) responsible for executing a fast feedforward compensation control loop with second-level data updates. Due to the spatial span of long-distance gas pipelines, the odorant concentration data acquired by the detection module lags behind the injection action of the odorization module. If the difference is calculated based on the data collected in the same clock cycle, timing misalignment errors will be introduced. In actual industrial scenarios, fluctuations in pipeline operating conditions will cause changes in gas flow rate, and conventional fixed time constant delay compensation is difficult to adapt to the requirements of variable operating conditions. To overcome the control interference caused by physical transmission delay, the controller extracts the correction basis based on the timestamp mapping dictionary established by the twin server in step S20.

[0091] The controller internally maintains a historical state queue updated in a time series and pre-stores preset concentration targets. In some optional implementations, to prevent hardware storage overflow, the historical state queue is maintained in a sliding time window format, and the maximum storage time span of the historical state queue is set to be greater than the physical transmission time of the gas pipeline at the lowest flow rate. When the chromatograph inside the detection module completes a sampling analysis and outputs odorant concentration data at the downstream detection time, the controller uses the internally stored preset concentration target as the base minuend and the odorant concentration data measured at the downstream detection time as the subtrahend, performs a difference operation, and thus calculates the concentration feedback deviation at the corresponding time. After obtaining the concentration feedback deviation, the controller uses a timestamp mapping dictionary to find the upstream injection time corresponding to the downstream detection time.

[0092] The controller maps the calculated concentration feedback deviation to the corresponding upstream injection time in the historical state queue, and uses a proportional-integral control algorithm with variable time delay correction. Combined with the real-time measured instantaneous gas volumetric flow rate, it converts the concentration dimension into the flow rate control dimension, thereby generating a feedback compensation flow rate corrected according to the timestamp mapping dictionary. The specific calculation formula is as follows:

[0093] ;

[0094] in, Represents continuous time The flow meter measures the instantaneous volumetric flow rate of the gas. Represents the integral time differential variable; Represents the preset dimensionless proportional gain constant; This represents the preset integration time constant; Represents from the initial moment to continuous time The integral operator; Represents mapping to continuous time Concentration feedback deviation; Represents the corresponding integration time variable Mapping concentration feedback bias; Represents continuous time Feedback compensation flow rate corrected based on timestamp mapping dictionary; Represents the integral gain coefficient; This represents integrating the concentration feedback deviation in the time series over time. The proportional correction term representing the coupled real-time traffic; The integral correction term represents the coupled real-time flow rate. The feedback compensation flow rate corrected according to the timestamp mapping dictionary is equal to the product of the instantaneous volumetric flow rate of the gas and the correction coefficient term. The correction coefficient term includes the product of the preset proportional gain constant and the mapped concentration feedback deviation, as well as the product of the integral gain coefficient and the accumulated value obtained by integrating the concentration feedback deviation in the time series over time.

[0095] Due to physical transmission delays in long-distance pipeline networks, the upstream injection time mapped by the latest acquired odorant concentration data will inevitably lag behind the current continuous time. To compensate for logical gaps caused by missing data and ensure the continuity of integration operations, the controller, when performing integration operations, considers the continuous time from the most recent successfully mapped upstream injection moment to the present. For the undetected time window between these points, a zero-order hold logic is used to force the maintenance and call the most recent concentration feedback deviation value to participate in the integral accumulation within this time window.

[0096] To ensure the stability of the algorithm logic, the controller has a preset integral anti-saturation limit threshold. This threshold is calculated and calibrated by engineers based on the maximum physical output flow rate of the odorization pump and is pre-stored in the controller's memory. When the accumulated value of the integral correction term reaches the integral anti-saturation limit threshold, the controller pauses the further accumulation calculation of the integral correction term until the concentration feedback deviation reverses. The specific values ​​of the preset dimensionless proportional gain constant and the preset integral time constant are determined by engineers during the system debugging phase using the critical proportional gain method or the attenuation curve method, based on the flow capacity of the gas pipeline network and the response characteristics of the odorization pump, and are then permanently written into the controller's register.

[0097] The controller parameter tuning process can be directly calculated and implemented by those skilled in the art. Controller parameter tuning technology is well-known in this field and will not be elaborated upon here. Through the concentration feedback deviation calculation mechanism, the system avoids pure time delay interference caused by the spatial distance of the pipeline network and restores the system error in the odorization control process.

[0098] S32. A total control command issuance mechanism based on the algebraic sum of the basic proportional command, adsorption compensation flow rate, and feedback deviation. During the execution cycle of the fast feedforward compensation control loop, the controller synchronously calculates the basic proportional odorization command. The basic proportional odorization command is numerically equal to the product of the instantaneous volumetric flow rate of the gas measured by the flow meter at the current physical moment and the preset concentration target. The preset concentration target is a fixed value specified by the gas pipeline network dispatching system and issued to the controller according to the urban gas odorization standard.

[0099] The controller performs an algebraic sum operation on the basic proportional odorization command, the adsorption compensation flow rate issued by the twin server, and the feedback compensation flow rate corrected according to the timestamp mapping dictionary, thereby generating a total control command with feedforward compensation and anti-hysteresis feedback attributes. The total control command logically includes a pure feedforward proportional control term based on the transient flow rate of the pipeline network, a pipe wall adsorption prediction compensation term based on the digital twin mechanism model, and a closed-loop concentration feedback correction term based on time-delay mapping.

[0100] After instruction reconstruction and algebraic summation, the overall control instruction is uniformly represented in physical dimensions as the required mass injection flow rate of the odorant. The controller converts the overall control instruction into a standard industrial analog current signal or a high-speed pulse frequency signal, and sends it to the drive mechanism of the odorant pump. The odorant pump adjusts its mechanical stroke or motor speed according to the received signal to execute the corresponding physical injection action. For the electromechanical conversion mechanism, those skilled in the art can use conventional drivers; the electromechanical conversion mechanism is a well-known technology in the field and will not be described in detail here.

[0101] S33. Safety degradation for sensor and communication link anomalies in the fast feedforward compensation control loop. During step S30, the controller monitors the online operating status of the flow meter, chromatograph, and twin server in real time via the industrial Ethernet protocol. To achieve low-level execution of status monitoring, the controller is equipped with a watchdog timer mechanism. When the data update cycle of the flow meter or chromatograph exceeds the set heartbeat timeout threshold, or when the network communication link between the controller and the twin server is interrupted, the controller determines that the system has entered a data loss state. In practical engineering applications, the heartbeat timeout threshold is 5 to 10 seconds, configured by technicians according to the latency characteristics of the field communication network.

[0102] To prevent erroneous accumulation and amplification of the feedback compensation flow rate and adsorption compensation flow rate corrected according to the timestamp mapping dictionary, leading to uncontrolled execution, the controller initiates safety degradation logic. In industrial automation, when the closed-loop feedback channel or advanced feedforward model fails, the system needs to be able to smoothly revert to the most basic open-loop control state, sacrificing some control accuracy to maintain process continuity and safety. Based on the aforementioned safety degradation principle, the controller's internal logic unit forcibly resets the values ​​of the adsorption compensation flow rate and the feedback compensation flow rate corrected according to the timestamp mapping dictionary to zero, thereby smoothly reverting the control mode from advanced closed-loop control to basic open-loop proportional control mode.

[0103] In the safety degradation mode, if the flow meter's communication signal is lost, the controller retrieves the historical data storage area and extracts the arithmetic mean of the instantaneous gas volumetric flow rate within a fixed time window before the fault occurred as the moving average gas volumetric flow rate. The fixed time window is set to be the interval of 10 to 15 minutes before the fault occurred, to replace the lost real-time flow data. Then, the controller calculates the safety degradation control command based on the basic open-loop proportional control logic. The calculation logic is as follows: when the flow meter's communication is normal (i.e., degradation is only triggered by an anomaly in the chromatograph or twin server), the value of the safety degradation control command is equal to the algebraic product of the currently acquired real-time instantaneous gas volumetric flow rate and the preset concentration target; when the flow meter's communication signal is lost, the value of the safety degradation control command is equal to the algebraic product of the aforementioned extracted moving average gas volumetric flow rate and the preset concentration target. Through the algebraic product operation, the system ensures the consistency of the physical dimensions of the flow rate calculation in the degradation state.

[0104] Furthermore, to avoid logical dead zones caused by damage to the historical data storage area leading to the failure of the moving average gas volumetric flow rate calculation, the controller's register is preset with a safety baseline flow rate corresponding to the minimum operating load of the associated pipeline network. This safety baseline flow rate is calculated and calibrated by engineers based on the historical minimum load data of the gas pipeline network and the lower limit of the odorant safety concentration. When historical data cannot be read, the controller directly calls the safety baseline flow rate to generate control commands. In abnormal operating conditions due to external hardware or communication network failures, the system relies on the controller's underlying basic logic to maintain the basic injection of odorant, ensuring the safety and compliance requirements of the gas pipeline network. Regarding the watchdog timer's program configuration logic, those skilled in the art can compile and implement it using the standard timer function blocks of a programmable logic controller. The watchdog timer's program configuration logic is well-known in the field and will not be elaborated upon here.

[0105] like Figure 6 As shown, the process of triggering the constrained active transient excitation and obtaining physical flow rate feedback in step S40 includes the following sub-steps:

[0106] S41. Preset steady-state flow window determination and restricted pulse superposition command issuance. The execution of the slow parameter identification control loop requires the introduction of active transient excitation to obtain the dynamic response characteristics of the pipeline flow field. If active transient excitation is triggered during periods of severe fluctuation in gas pipeline operating conditions, the injected flow rate waveform characteristics will be submerged or distorted by the background fluctuations of the flow field itself, leading to the failure of subsequent parameter identification. To ensure the effectiveness of parameter identification, a test signal needs to be injected when the flow field is relatively stable to reduce the interference of the background noise of the flow field on feature extraction. Therefore, during the execution of odorization control actions, the controller continuously monitors the fluctuation state of the instantaneous volumetric flow rate of the gas measured by the flow meter.

[0107] The controller has an internal sliding time judgment window, within which it calculates the ratio of the standard deviation to the arithmetic mean of the instantaneous gas volumetric flow rate sequence in real time to obtain the gas flow rate fluctuation rate. When the gas flow rate fluctuation rate is less than a preset fluctuation threshold for multiple consecutive calculation cycles, thus determining that the gas flow rate fluctuation rate is within the preset flow steady-state window and the system confirms that it is not currently in the safety degradation mode of step S33, the controller sends a pulse superposition command to the odorization pump. The flow rate value corresponding to the pulse superposition command is directly superimposed on the total control command calculated and output by the current controller to jointly drive the odorization pump to operate.

[0108] In practical applications, the preset fluctuation threshold is set in the range of 1% to 5%, and the duration of the sliding time judgment window is generally set to cover at least 3 control cycles. The specific values ​​of the preset fluctuation threshold and the duration of the sliding time judgment window are comprehensively derived and calibrated by engineering technicians based on the root mean square error of the flow meter's background noise under historical steady-state operating conditions, combined with the pipe diameter and load characteristics of the gas pipeline network.

[0109] To prevent active transient excitation from causing local odorant concentrations in the pipeline network to violate national safety standards, the pulse superposition command is subject to two physical boundary restrictions. First, the sum of the flow amplitude corresponding to the pulse superposition command and the flow rate value of the current overall control command must not exceed the upper limit of the mass flow rate corresponding to the highest odorant concentration permitted by national regulations. Second, the duration of the pulse superposition command is set to be greater than or equal to three times the fixed sampling and analysis cycle of the chromatograph, and the duration of the pulse superposition command satisfies the following mathematical constraint formula:

[0110] ;

[0111] in, The duration of the pulse overlay command; Represents a multiple constant; This represents the fixed sampling and analysis cycle of the chromatograph. By setting the time width, it ensures that downstream detection equipment can capture the complete pulse concentration waveform changes, reducing the risk of undersampling and missed detections.

[0112] S42. Actual Physical Injection Flow Rate Extraction and Theoretical Response Waveform Evolution. After the odorizing pump receives the pulse superposition command and executes the pulse action, the twin server does not directly use the pulse superposition command issued by the controller as the input source item of the digital twin mechanism model. Due to diaphragm aging, one-way valve wear, or cavitation phenomena during long-term operation of the odorizing pump, there is a mechanical execution deviation between the command value and the actual physical injection value.

[0113] To isolate hardware failure factors of the actuator from the control closed loop, the twin server extracts the injected mass flow rate during the pulse phase recorded by the micro-flowmeter as the input boundary of the digital twin mechanism model. The twin server loads the extracted injected mass flow rate during the pulse phase into the digital twin mechanism model as a replacement instruction sequence, and calls the internal one-dimensional unsteady flow equation solver and component transport solver. Leveraging the computing power of the computer system, it performs advanced evolution calculations with a computational step size exceeding the actual physical time, simulating the convective transport, molecular diffusion, and pipe wall adsorption processes of the pulse mass cluster in the pipeline flow field, thereby generating the theoretical response waveform reaching the location of the detection module.

[0114] In step S50, the process of extracting the waveform's dual-channel four-dimensional feature parameters includes the following sub-steps:

[0115] S51. Construction of Measured Response Waveform and Time-Domain Alignment of Dual-Channel Waveform. After the odorant pulse mass cluster reaches the downstream region after the physical transmission time, the chromatograph in the detection module continuously acquires discrete odorant concentration data according to a fixed sampling and analysis cycle. The data processing unit embedded in the twin server performs interpolation fitting operations on the odorant concentration data acquired by the chromatograph according to the time series, such as using numerical calculation algorithms like cubic spline interpolation or linear interpolation, thereby constructing a continuous measured response waveform.

[0116] To extract comparative features, the data processing unit sets a preset observation time window. First, the starting execution time of the pulse superposition command is added to the theoretical peak lag time to calculate the theoretical arrival time. Then, using the theoretical arrival time as the reference anchor point, a reserved time is set for the starting edge of the preset observation time window ahead of the reference anchor point, and a reserved time is set for the ending edge of the preset observation time window behind the reference anchor point. The reserved time is based on the longitudinal convection diffusion broadening effect of the odorant during transmission in the gas pipeline network. It is calibrated by engineers based on the longitudinal convection diffusion coefficient of the odorant molecules calculated by the gas pipeline network diameter and the on-site flow velocity. The reserved time at the starting edge and the reserved time at the ending edge are set to be within the range of 10% to 20% of the theoretical peak lag time. The data processing unit places the theoretical response waveform and the measured response waveform within the preset observation time window, completing the time domain alignment of the twin theoretical calculation channel and the physical actual detection channel.

[0117] S52. Dual-channel four-dimensional waveform feature parameter extraction and feature deviation matrix calculation. Within a preset observation time window, the data processing unit embedded in the twin server compares the theoretical response waveform with the measured response waveform constructed based on the odorant concentration data obtained from the chromatograph, extracting the peak lag time, peak amplitude, full width at half maximum (FWHM), and integral area of ​​the waveform from the dual-channel comparison. If no effective feature extremum of the measured response waveform is extracted within the preset observation time window (e.g., due to severe flow field anomalies causing missing measured peak values), the data processing unit directly assigns the normalized relative deviation of the corresponding feature to a preset maximum value to ensure continuous triggering of the fault decoupling alarm mechanism in subsequent steps.

[0118] The four dimensional characteristics and their corresponding physical meanings and theoretical and measured physical quantities are as follows:

[0119] Peak lag time characterizes the transmission time from the start of odorant pulse injection to the occurrence of the highest point of waveform concentration, reflecting the transport rate and topological connectivity of the macroscopic flow field of the gas pipeline network. Peak lag time includes theoretical peak lag time and measured peak lag time.

[0120] Peak amplitude represents the absolute value of the highest point of waveform concentration, reflecting the degree of energy attenuation of odorant during transmission. Peak amplitude includes theoretical peak amplitude and measured peak amplitude.

[0121] The full width at half maximum (FWHM) of a waveform represents the time span at which the waveform amplitude equals half the peak amplitude, reflecting the longitudinal convection and diffusion effect inside the fluid. The full WHM of a waveform includes the theoretical full WHM of the waveform and the measured full WHM of the waveform.

[0122] The waveform integral area represents the integral area of ​​the waveform curve and the time axis within the preset observation time window. Based on the law of conservation of mass, it reflects the total mass of odorant reaching the detection point. The waveform integral area includes the theoretical waveform integral area and the measured waveform integral area.

[0123] The data processing unit extracts the values ​​of the four characteristic parameters of the theoretical waveform and the four characteristic parameters of the measured waveform, respectively. Then, it calculates the absolute value of the difference between the measured and theoretical values, and divides the absolute value of the difference by the theoretical value to obtain the normalized relative deviation for each dimension. To construct an accurate characteristic deviation matrix, the formulas for calculating the normalized relative deviation for each dimension are as follows:

[0124] ; ; ; ;

[0125] in, Normalized relative deviation representing peak lag time; Represents the measured peak lag time; Represents the theoretical peak lag time; The absolute value of the difference between the measured peak lag time and the theoretical peak lag time is the absolute deviation of the peak lag time.

[0126] Normalized relative deviation representing the peak amplitude; Represents the measured peak amplitude; Represents the theoretical peak amplitude; The absolute value of the difference between the measured peak amplitude and the theoretical peak amplitude is the absolute deviation of the peak amplitude.

[0127] Normalized relative deviation representing the full width at half maximum (FWHM) of the waveform; Represents the full width at half maximum (FWHM) of the measured waveform; The full width at half maximum (FWHM) of the representative theoretical waveform; The absolute value of the difference between the measured full width at half maximum (FWHM) of the waveform and the theoretical full width at half maximum (FWHM) of the waveform is called the absolute deviation of the full width at half maximum (FWHM) of the waveform.

[0128] Normalized relative deviation representing the integral area of ​​the waveform; Represents the integral area of ​​the measured waveform; Represents the integral area of ​​the theoretical waveform; The absolute value of the difference between the measured integral area of ​​the waveform and the theoretical integral area is called the absolute deviation of the integral area of ​​the waveform.

[0129] The data processing unit arranges the normalized relative deviations of the four dimensions in a fixed row and column order, calculates the characteristic deviation matrix, and stores the characteristic deviation matrix in a register, providing a dimensionless mathematical criterion for subsequent fault decoupling and model calibration. For the software implementation of waveform interpolation fitting, extreme point search, and numerical integration, those skilled in the art can use well-known signal processing algorithms for programming implementation. The software implementation of waveform interpolation fitting, extreme point search, and numerical integration is well-known technology in this field and will not be elaborated further here.

[0130] In step S60, the process of the twin server performing multidimensional feature joint decoupling and mechanism model self-calibration includes the following sub-steps:

[0131] S61. Construction of Fault Evaluation Matrix Based on Feature Deviation Matrix Weights and Determination of Physical Faults in Actuators. After extracting the feature deviation matrix containing normalized relative deviations in four dimensions in step S52, the data processing unit embedded in the twin server first subtracts the baseline flow rate corresponding to the basic proportional odorization command from the transient odorization mass flow rate measured by the micro-flowmeter, and then performs time integration calculation within the pulse injection period to obtain the actual injection increment integral, so as to eliminate the interference of physical faults such as mechanical jamming or failure of actuators such as odorization pumps.

[0132] The twin server compares the actual injected incremental integral with the set injection tolerance range. If the actual injected incremental integral is not within the set injection tolerance range, the actuator fault confidence level is determined to be a complete fault state (corresponding confidence level value is set to 1), and a safety degradation logic is immediately triggered, suspending subsequent waveform comparison and parameter calibration processes. The lower limit of the injection tolerance range is set by engineers based on the theoretical integral amount of the pulse command multiplied by the allowable mechanical tolerance lower limit coefficient, with the allowable mechanical tolerance lower limit coefficient ranging from 0.8 to 0.9. The upper limit of the injection incremental tolerance range is set by engineers based on the theoretical integral amount of the pulse command multiplied by the allowable mechanical tolerance upper limit coefficient, with the allowable mechanical tolerance upper limit coefficient ranging from 1.1 to 1.2.

[0133] If the actual injection increment integral is within the set injection tolerance range, the twin server assigns corresponding flow field feature weight coefficients and adsorption feature weight coefficients to each normalized relative deviation in the feature deviation matrix. Combining the feature deviation matrix weights, a multi-dimensional fault confidence fault evaluation matrix is ​​constructed. The specific calculation formula is as follows:

[0134] ;

[0135] in, Represents the fault evaluation matrix; Represents the confidence level of flow field and topology mismatch; This represents the confidence level of the adsorption parameter drift; The flow field characteristic weighting coefficient representing the peak lag time; Normalized relative deviation representing peak lag time; The flow field characteristic weighting coefficient representing the integral area of ​​the waveform; Normalized relative deviation representing the integral area of ​​the waveform; The adsorption characteristic weighting coefficient represents the peak amplitude; Normalized relative deviation representing the peak amplitude; The adsorption characteristic weighting coefficient represents the full width at half maximum (FWHM) of the waveform; Normalized relative deviation representing the full width at half maximum (FWHM) of the waveform;

[0136] The flow field weighted component representing the peak lag time; The weighted component of the flow field representing the integral area of ​​the waveform; The adsorption-weighted component represents the peak amplitude; The adsorption-weighted component represents the full width at half maximum (FWHM) of the waveform; This represents the aggregated term of the total flow field deviation, which is composed of the weighted components of the flow field, i.e., the flow field and topology mismatch confidence. This represents the total adsorption deviation aggregation term composed of the adsorption weighted components, i.e., the confidence level of adsorption parameter drift.

[0137] In addition, the sum of the flow field characteristic weighting coefficient of peak lag time and the flow field characteristic weighting coefficient of waveform integral area is set to 1; the sum of the adsorption characteristic weighting coefficient of peak amplitude and the adsorption characteristic weighting coefficient of waveform full width at half maximum is set to 1.

[0138] S62. Simultaneous and Decoupled Identification of Multidimensional Fault States. After constructing the fault evaluation matrix, the twin server extracts the confidence elements from the fault evaluation matrix to perform simultaneous and decoupled identification of multidimensional fault states. The system should not directly modify the adsorption parameters in the digital twin mechanism model, because the deviation in measured concentration may be caused by changes in the macroscopic flow field of the gas pipeline network, rather than changes in the microscopic adsorption mechanism.

[0139] The evolution of fluid within a pipeline network simultaneously involves macroscopic fluid dynamics transport and microscopic physicochemical adsorption. Peak lag time and waveform integral area are primarily controlled by macroscopic convective transport and mass conservation; while peak amplitude and full width at half maximum (FWHM) are mainly controlled by physicochemical adsorption attenuation and internal diffusion effects along the pipeline network. The driving mechanisms of macroscopic convective transport and mass conservation differ from those of physicochemical adsorption attenuation and internal diffusion effects along the pipeline network, thus providing a physical basis for the simultaneous decoupling and identification of multidimensional fault states using multidimensional features.

[0140] During the decoupling determination process, the twin server first compares the flow field and topology mismatch confidence with the preset flow field safety threshold. If the flow field and topology mismatch confidence is greater than the preset flow field safety threshold, it determines that the flow field state of the gas pipeline is mismatched (e.g., the main flow meter has drifted or there is an unknown leak or diversion phenomenon in the pipeline), and outputs an equipment-level alarm to the operator terminal. At the same time, it locks the parameter identification control loop to terminate the mechanism model self-calibration action.

[0141] If the confidence level of the flow field mismatch with the topology is less than or equal to the preset flow field safety threshold, it indicates that the macroscopic transport time and overall mass of the fluid in the gas pipeline network are basically conserved, and the confidence level of the macroscopic flow field calculation model is high. The value of the preset flow field safety threshold is set by engineers based on the allowable comprehensive measurement error of the flow meter and chromatograph at the site, combined with engineering experience. The preset flow field safety threshold ranges from 0.02 to 0.05.

[0142] Under the premise of stable and accurate flow field, the twin server further evaluates the confidence level of adsorption parameter drift to determine whether the current overall deviation is caused by the aging of adsorption parameters at the microscopic level of the pipe wall. Through the simultaneous decoupling identification of multi-dimensional fault states, the system avoids the erroneous calibration phenomenon of misjudging hydraulic faults as adsorption kinetic parameter drift.

[0143] S63. Capturing and Establishing Parameter Drift States and Constrained Optimization and Closed-Loop Update of the Tube Wall Adsorption Reaction Constant and Tube Wall Desorption Constant of the Internal Digital Twin Mechanism Model. During the decoupling evaluation phase, the twin server compares the confidence level of the adsorption parameter drift with the preset adsorption drift threshold. If the confidence level of the adsorption parameter drift is less than or equal to the preset adsorption drift threshold, it indicates that the current characteristic deviation is within the normal measurement tolerance or slight operating condition fluctuation range of the system. In this case, the internal digital twin mechanism model is determined to be in a healthy state, and the existing parameters of the internal digital twin mechanism model remain unchanged, ending this round of self-calibration judgment branch.

[0144] The preset adsorption drift threshold is set by multiplying the adsorption parameter drift confidence level collected by the twin server during historical fault-free operation cycles and the calculated statistical variance by a preset safety margin coefficient. The preset safety margin coefficient ranges from 2.0 to 3.0.

[0145] If the confidence level of the adsorption parameter drift exceeds the preset adsorption drift threshold, it indicates that a long-term physical drift has occurred in the adsorption characteristics of the tube wall. The twin server determines that it has captured the parameter drift state and immediately calls the constraint optimization identification algorithm based on nonlinear programming to update the tube wall adsorption reaction constant and tube wall desorption constant of the internal digital twin mechanism model, completing the closed-loop self-calibration. To enable the digital twin calculation model to approximate the actual physical state through iteration, the twin server constructs an objective function containing a penalty term. The specific calculation formula is as follows:

[0146] ;

[0147] in, Represented by the tube wall adsorption reaction constant Desorption constant of the tube wall The objective function value of the independent variable; The penalty weighting coefficient represents the peak amplitude; The penalty weighting coefficient represents the full width at half maximum (FWHM) of the waveform; The squared term representing the normalized relative deviation of the peak amplitude; The squared term representing the normalized relative deviation of the full width at half maximum (FWHM) of the waveform; The weighted penalty term represents the peak amplitude; This represents the weighted penalty term for the full width at half maximum (FWHM) of the waveform. The sum of the penalty weight coefficients for the peak amplitude and the full width at half maximum (FWHM) is set to 1.

[0148] During the iterative optimization process, the twin server, within a set physically reasonable constraint range, repeatedly calls the internal digital twin mechanism model to perform small perturbations on the parameter input. It then uses the finite difference approximation method to obtain the numerical gradient of the objective function with respect to the adsorption parameters. Finally, it employs a gradient descent iterative algorithm to adjust the values ​​of the pipe wall adsorption reaction constant and the pipe wall desorption constant in the internal digital twin mechanism model. The physically reasonable constraint range is set based on the historical adsorption decay curve of the pipe of a specific material or a numerical range calibrated in the laboratory. For example, it is set within a fixed positive and negative ratio range of the current parameter initial values ​​to prevent the algorithm from searching for unrealistic mathematical solutions.

[0149] For each newly generated tube wall adsorption reaction constant and tube wall desorption constant, the twin server re-calls the digital twin mechanism model to perform waveform evolution calculations, obtains new theoretical response waveforms, and recalculates the normalized relative deviation of the peak amplitude and the normalized relative deviation of the full width at half maximum (FWHM) of the waveform, until the objective function value converges to the preset tolerance range, which is set to 0.01 to 0.05.

[0150] After obtaining the optimal pipe wall adsorption reaction constant and the optimal pipe wall desorption constant that make the objective function value converge, the twin server reloads the optimal pipe wall adsorption reaction constant and the optimal pipe wall desorption constant into the kinetic equation used to solve the adsorption compensation flow rate to overwrite the underlying configuration file of the digital twin mechanism model, and then updates the pipe wall adsorption reaction constant and pipe wall desorption constant of the internal digital twin mechanism model.

[0151] The updated digital twin mechanism model will output more accurate local odorant concentration and adsorption compensation flow rate in the next control cycle, thereby completing a predictive closed loop from sensing and control to adaptive correction. Regarding the gradient optimization iteration rule in the constrained optimization algorithm, those skilled in the art can implement it using gradient descent algorithms or nonlinear programming functions. The gradient optimization iteration rule in the constrained optimization algorithm is a well-known technique in this field and will not be elaborated upon here.

[0152] S64. Calculation divergence and physical fault protection of the actuator for the digital twin mechanism model. In step S60, when the twin server determines the actuator fault confidence level to be a complete fault state in step S61, the system establishes that the odorizing pump may have suffered substantial equipment damage, such as internal diaphragm rupture or drive motor burnout. To prevent unodorized gas from being directly delivered to the user end, the twin server issues a hardware interlock shutdown command to the controller. The controller cuts off the power supply circuit of the faulty odorizing pump according to the hardware interlock shutdown command, and uses an internal relay to start the parallel-installed backup odorizing pump to take over the odorizing work. At the same time, it reports the corresponding equipment-level fault code to the gas pipeline network dispatching system to prompt on-site personnel to intervene for maintenance.

[0153] Furthermore, during the constraint optimization closed-loop update process in step S63, if the constraint optimization identification algorithm fails to find the optimal solution due to unknown physical interference sources at the gas pipeline site, and the calculated optimal pipe wall adsorption reaction constant or optimal pipe wall desorption constant touches the extreme boundary of the set physical reasonable constraint range for multiple consecutive calibration cycles, the twin server determines that the internal digital twin mechanism model has entered a calculation divergence state. The threshold for judging multiple consecutive calibration cycles is 3 to 5 consecutive calibration cycles.

[0154] In actual optimization calculations, the optimization algorithm may get stuck in local boundary deadlock due to sudden changes in environmental factors or transient noise from sensors. At this time, the calculated adsorption parameters have lost their practical significance in characterizing the physical process. Therefore, a model melting and recovery mechanism is introduced.

[0155] When a computational divergence occurs, the twin server triggers a model reset protection mechanism. The twin server maintains a parameter snapshot stack in its non-volatile storage area, periodically backing up the digital twin mechanism model configuration file during stable system operation. The backup cycle can be set to once every 24 hours. The twin server retrieves the most recent historical stable parameter snapshot from the parameter snapshot stack that is not accompanied by any abnormal alarm records. The twin server overwrites the tube wall adsorption reaction constant and tube wall desorption constant from the historical stable parameter snapshot into the current running memory, forcibly restoring the internal digital twin mechanism model to a known healthy operating baseline. After triggering the model reset protection mechanism, it suspends the mechanism model self-calibration process until the physical interference source is manually eliminated.

[0156] For the push and pop storage process of the parameter snapshot stack, those skilled in the art can use a circular buffer data structure for programming. The push and pop storage process of the parameter snapshot stack is a well-known technology in the field and will not be described in detail here.

[0157] See appendix Figure 7 To be continued Figure 10To aid in understanding the technical solution of the digital twin-driven predictive control system and method for gas odorization of this invention, a specific application embodiment combining specific operating parameters and practical engineering application background is provided below. In this embodiment, the effective length of the main gas pipeline to be controlled... The setting is 5000 meters, but the actual pipe inner diameter is... The distance is 0.5 meters. Under stable pipeline conditions, the instantaneous volumetric flow rate of gas remains at approximately 1000 cubic meters per hour. The preset concentration target set by the gas dispatching system and transmitted to the controller is 20 mg / m³. 3 This includes the following steps:

[0158] The system simultaneously acquires transient fluid dynamics data from the gas pipeline network and microscopic transport data of the odorant. The controller employs a programmable logic controller (PLC) with an ARM Cortex-A processor, establishing low-level hardware communication with field-deployed flow meters, pressure transmitters, and temperature transmitters via a PROFINET industrial Ethernet bus. The controller utilizes the IEEE 1588 precision time protocol to send a unified hardware timing clock signal to each sensor node. The controller receives instantaneous gas volumetric flow rate. The gas chromatograph receives gas pressure data, gas temperature data, and injection mass flow rate, and appends a timestamp corresponding to the current physical moment of receipt to each received data. The chromatograph uses a fixed 5-minute sampling and analysis cycle. The controller uses the moment when the internal sampling valve of the chromatograph opens as the timestamp reference for the odorant concentration data. The preset communication waiting period is set to 5.2 minutes.

[0159] The digital twin server receives physical data with timestamps. The digital twin mechanism model uses a system of partial differential equations for one-dimensional unsteady flow to establish the flow field reference and define spatial coordinates. The twin server converts the instantaneous volumetric flow rate of the gas into the pipeline inlet value. The dynamic flow inflow boundary conditions at the location are used to convert the gas pressure data into pressure distribution boundary conditions. Those skilled in the art can use the MacCormack predictor-corrector method to perform finite volume discretization. The twin server calculates... Establish dynamic quality source terms. Injection quality flow rate based on feedback. The concentration of odorant in the initial localized inlet pipe network is calculated to be 20 mg / m³, given a concentration of 20 g / h. 3 This boundary condition is used as the boundary condition for convection-diffusion inflow and loaded into the solver. The twin server uses this boundary condition to update the state matrix of the discrete grid nodes, which includes flow velocity, pressure, and component concentration, enabling the digital twin mechanism model to enter a real-time calculation loop with a step size of 100 milliseconds.

[0160] The unsteady flow equations are solved and spatiotemporal evolution parameters are extracted. The twin server outputs velocity field information using a one-dimensional unsteady flow equation solver. Due to the dynamic changes in gas consumption, the average velocity inside the pipe fluctuates around 1.41 m / s. The twin server uses the kinematic space integral equation... A spatial trajectory tracking system for gas fluid particles was established. Using the fourth-order Runge-Kutta integral algorithm, the twin server calculated the current nonlinear physical lag time from the injection point to the detection point as 59.1 min, and wrote this dynamic time mapping relationship into the timestamp mapping dictionary.

[0161] Then, the digital twin mechanism model is based on The adsorption rate at the microscopic level on the tube wall was calculated. In this embodiment, the tube wall adsorption reaction constant was used. The initial value is set to 1.5 × 10. -4 The tube wall desorption constant The initial value is set to 2.0 × 10. -5 The twin server performs physical dimension alignment based on the formula. The flow rate is integrated along the entire length of the pipeline and limited. The lower limit of the compensation flow rate is set to -4.0 g / h, and the upper limit is set to 20.0 g / h. The twin server then generates and outputs the adsorption compensation flow rate to the controller.

[0162] Dynamic control commands are generated and odorization control actions are executed based on a fast feedforward compensation control loop. The controller allocates a 4-hour sliding data buffer in its internal memory as a historical state queue. The controller extracts the odorant concentration data returned by the chromatograph at the current downstream detection time and compares it with the preset concentration target of 20 mg / m³. 3 The concentration feedback deviation is calculated by subtraction. The controller calls the timestamp mapping dictionary to find the upstream injection time corresponding to the downstream detection time and maps this concentration feedback deviation to the historical state queue. Subsequently, a proportional-integral control algorithm with variable time delay correction is used. Generate the corrected feedback compensation flow rate. Proportional gain constant. Set to 0.05, integration time constant. Set to 1200 seconds.

[0163] The controller synchronously calculates the baseline odorization command (which is stable at 20 g / h). The controller then performs an algebraic sum calculation using the baseline odorization command of 20 g / h, the adsorption compensation flow rate fed back from the twin server, and the corrected feedback compensation flow rate to generate the overall control command. This overall control command is converted into a 4-20mA standard analog current signal to drive the odorization pump. A watchdog timer with a 10-second cycle monitors the communication status in the controller's background. If a link timeout occurs, the controller forcibly sets both compensation flow rates to zero and calls the moving average gas volumetric flow rate to calculate the equivalent safety degradation control command, which is the product of the flow rates.

[0164] The controller triggers a restricted active transient excitation and obtains physical flow rate feedback. It extracts the gas flow rate sequence over 10 consecutive feedforward calculation cycles to calculate the volatility. When the volatility drops to 1.2% and is determined to be within a preset steady-state flow window, the controller sends a pulse superposition command to the odorization pump. (Combined with the attached...) Figure 7 It can be seen that the total control command flow rate of the odorization pump increases in a step from the basic 20 g / h to 40 g / h. The duration of the pulse superposition command is [not specified]. The time is set to 15 minutes, which satisfies the logical constraint that the sampling analysis period is greater than or equal to three times the fixed sampling analysis period of 5 minutes.

[0165] The twin server captures the actual pulse injection mass flow rate synchronously fed back by the on-site micro-flowmeter and replaces the ideal square wave injection model within the algorithm, thereby avoiding the mechanical hysteresis error caused by the diaphragm assembly of the odorizing pump. The twin server's component transport solver evolves the flow field according to the captured pulse mass sequence and generates the theoretical response waveform reaching the detection point.

[0166] Extract the two-channel four-dimensional feature parameters of the waveform. Combine with the appendix... Figure 8 It can be seen that the data processing unit embedded in the twin server performs continuous mapping on the discrete concentration sequence returned by the chromatograph to construct the measured response waveform. Using the theoretical arrival time of 60 minutes as the reference anchor point, a reserved duration is set to capture the preset observation time window. The data processing unit performs first-order derivative peak finding calculations and numerical integration operations on the theoretical and measured response waveforms.

[0167] The extracted characteristic of the theoretical response waveform is: theoretical peak lag time. The theoretical peak amplitude is 60 minutes. 35mg / m 3 Theoretical waveform full width at half maximum (FWHM) For 20 minutes, the theoretical waveform integral area 800 mg·min / m 3 The corresponding features extracted from the measured response waveform are: measured peak lag time. The measured peak amplitude was 61 minutes. 28 mg / m 3 The measured full width at half maximum (FWHM) of the waveform The measured waveform integral area is 24 minutes. 790 mg·min / m 3 Calculate the normalized relative deviation based on the formula: the normalized relative deviation of the peak lag time. The normalized relative deviation of the peak amplitude is 0.0167. 0.2; Normalized relative deviation of waveform full width at half maximum (FWHM) The normalized relative deviation of the waveform integral area is 0.2. The value is 0.0125. The final arrangement yields the characteristic deviation matrix.

[0168] The control loop, based on slow parameter identification, performs multi-dimensional feature joint decoupling and mechanistic model self-calibration. A lower limit coefficient of 0.8 and an upper limit coefficient of 1.2 are set for allowable mechanical tolerance. The actual injected incremental integral falls within the tolerance range, confirming the normal physical operation of the actuator. The twin server calculates the flow field and topology mismatch confidence level based on the flow field feature weight coefficient allocation. Based on the weighting coefficients of adsorption characteristics, the confidence level of adsorption parameter drift is calculated. The twin server compared the flow field and topology mismatch confidence level (0.0146) with the preset safety threshold (0.05), establishing the basic conservation of macroscopic fluid transport time. Simultaneously, it compared the adsorption parameter drift confidence level (0.2) with the preset threshold (0.1), determining that the threshold was exceeded, confirming the capture of parameter drift, and establishing that long-term physical liquid accumulation or intrinsic material adsorption aging had occurred on the pipeline inner wall.

[0169] The twin server initiates a constraint optimization identification algorithm based on nonlinear programming. The objective function is constructed. Combined with the appendix Figure 9 It can be seen that the partial derivative gradient descent trial converges to within the tolerance band of 0.005 near the 15th iteration. (Combined with the appendix...) Figure 10 It can be seen that the model output waveform shifts upwards after self-calibration, which means that the adsorption compensation flow rate (dashed line, low amplitude) before calibration is effectively enhanced after calibration (solid line, increased amplitude), thus offsetting the abnormal adsorption consumption. The system maintains an independent parameter snapshot stack operation mechanism in the background to rewrite historical stable parameters when gradient divergence occurs.

[0170] The control system utilizes a dual-loop collaborative architecture to separate and handle the coupled disturbances of long-distance spatial pure time delay and microscopic material decay. In conventional PID control scenarios, due to transport delays as long as 60 minutes, low terminal concentrations can easily lead to excessive integral saturation of the controller, resulting in severe flow rate oscillations. This solution employs a proportional-integral control algorithm logic based on variable time delay correction using dynamic trajectory timestamps. This precisely aligns the current terminal measured concentration with the historical injection origin state conditions, ensuring that command adjustments are fully adapted to the physical transmission cycle.

[0171] Appendix Figure 8 The deviation from the distribution reflected in the four-dimensional characteristics proves that adsorption aging problems, independent of the macroscopic gas transmission volume, accumulate during pipeline operation. The theoretical waveform peak amplitude is 35 mg / m³. 3 The measured waveform peak value decreased to 28 mg / m³. 3 Furthermore, the broadening phenomenon increased. By constructing a weighted fault evaluation matrix, the system successfully distinguished between a flow field confidence score of 0.0146 and an adsorption drift confidence score of 0.2. The separation and identification technology avoided misjudging chemical losses as physical leaks in the pipeline network, ensuring the correct premise for basic flow control calculations.

[0172] Appendix Figure 9 With appendix Figure 10 Convergence and comparative data demonstrate that the self-calibration closed-loop correction based on objective function optimization possesses convergence robustness. With iterative iteration of the nonlinear programming gradient, the underlying kinetic constants of the model are adaptively updated, and the objective error rapidly narrows to within the safe region of 0.005. The adsorption compensation flow rate calculated by the calibrated model achieves an overall adaptive increase throughout the entire continuous time domain (as shown in the attached figure). Figure 10 As shown by the solid line, the system can dynamically offset complex pipe wall consumption variables without manual periodic static calibration, thereby always keeping the actual end-point odorant concentration stably suppressed within the minimum tolerance range of the preset concentration target set by the standard.

Claims

1. A digital twin-driven predictive control system for gas odorization, characterized in that, include: Sensor networks are used to collect data on instantaneous gas volumetric flow rate, gas pressure, and gas temperature. The odorization module is used to receive the main control command and inject odorant into the gas pipeline network, as well as measure the injection mass flow rate; The detection module is used to acquire odorant concentration data; The twin server is internally deployed with a digital twin mechanism model, which is used to perform digital twin mechanism model deduction of the gas pipeline flow field using instantaneous gas volume flow rate, gas pressure data, gas temperature data and injection mass flow rate, and calculate and generate adsorption compensation flow rate. The controller is used to determine the feedback compensation flow rate based on the odorant concentration data and the preset concentration target, and to generate a general control command based on the adsorption compensation flow rate and the feedback compensation flow rate to control the operation of the odorization module.

2. The digital twin-driven predictive control system for gas odorization according to claim 1, characterized in that, The sensor network includes a flow meter that measures the instantaneous volumetric flow rate of the gas, a pressure transmitter that collects gas pressure data, and a temperature transmitter that collects gas temperature data. The odorization module includes an odorization pump and a micro flow meter for measuring the injected mass flow rate. The odorization pump is used to receive overall control commands and perform physical actions. The detection module includes a chromatograph, which acquires odorant concentration data according to the sampling and analysis cycle.

3. The digital twin-driven predictive control system for gas odorization according to claim 1, characterized in that, The controller is used for: Provides a unified hardware time synchronization signal for the hardware devices deployed on-site for system-level time synchronization; The acquired instantaneous volumetric flow rate, gas pressure data, gas temperature data, and injection mass flow rate are each appended with a timestamp corresponding to the current physical moment of reception. When receiving odorant concentration data, the physical action of opening the sampling valve inside the detection module is used as the timestamp reference for the odorant concentration data.

4. A digital twin-driven predictive control system for gas odorization according to claim 3, characterized in that, Twin servers are also used for: The instantaneous volumetric flow rate of the gas with timestamps, the gas pressure data with timestamps, and the gas temperature data are input into the digital twin mechanism model to construct the solution domains for the flow field and temperature field. A dynamic distribution function is established within the digital twin mechanism model based on the injected mass flow rate with timestamps, and the local odorant concentration at the odor injection point in the pipeline is calculated at the current sampling time. The calculated local odorant concentration in the pipeline network is set as the baseline parameter for the component transport solver operation.

5. A digital twin-driven predictive control system for gas odorization according to claim 4, characterized in that, The digital twin mechanism model includes a one-dimensional unsteady flow equation solver and a component transport solver; The twin server establishes time-domain boundary conditions based on the instantaneous volumetric flow rate, pressure, and temperature data of the gas. It then uses a one-dimensional unsteady flow equation solver to solve and output the transient cross-sectional average velocity field based on the time-domain boundary conditions. From the transient cross-sectional average velocity field, it extracts the local transient velocity of the gas fluid particles in their trajectory. Based on the physical constraint that the spatial integral of the differential of the process time variable with respect to the local transient velocity equals the effective pipe length of the gas pipeline network, the spatial integral equation is solved to establish a timestamp mapping dictionary; The twin server uses the local odorant concentration in the pipeline network output by the component transport solver to calculate the adsorption rate of the pipe wall. The adsorption rate of the pipe wall is spatially integrated along the entire length of the gas pipeline by the inner wall surface area to obtain the total adsorption consumption mass rate. A saturation limiting function is then introduced to generate the adsorption compensation flow rate.

6. A digital twin-driven predictive control system for gas odorization according to claim 5, characterized in that, The controller is also used for: The concentration feedback deviation is calculated based on the comparison between the odorant concentration data and the preset concentration target. The upstream injection time corresponding to the downstream detection time is found based on the timestamp mapping dictionary. The calculated concentration feedback deviation is mapped to the corresponding upstream injection time in the internally maintained historical state queue, and a feedback compensation flow rate corrected according to the timestamp mapping dictionary is generated. The overall control command is generated based on the adsorption compensation flow rate and the feedback compensation flow rate corrected according to the timestamp mapping dictionary.

7. A predictive control system for gas odorization driven by a digital twin according to claim 2, characterized in that, The controller is also used to continuously monitor the fluctuation of the instantaneous volumetric flow rate of the gas and calculate the gas flow rate fluctuation rate. When it is confirmed that the gas flow rate fluctuation rate is within the preset steady-state window, the controller drives the odorization pump to execute the pulse superposition command to inject the characteristic mass group into the gas pipeline network. The twin server is also used to capture the injected mass flow rate of the pulse phase recorded by the micro-flowmeter as the input boundary of the digital twin mechanism model, and to simulate the physical process evolution of the characteristic mass cluster in the gas pipeline flow field to generate the theoretical response waveform.

8. A predictive control system for gas odorization driven by a digital twin according to claim 7, characterized in that, The twin server has an embedded data processing unit, which is used to construct the measured response waveform based on the acquired odorant concentration data, compare the theoretical response waveform with the measured response waveform, and extract the peak lag time, peak amplitude, full width at half maximum and integral area of ​​the waveform of the two channels of the theoretical response waveform and the measured response waveform respectively. For peak lag time, peak amplitude, full width at half maximum (FWHM) of waveform, and integral area of ​​waveform, the absolute value of the difference between the measured value and the theoretical value of the measured response waveform is calculated and divided by the value of the theoretical response waveform to obtain the normalized relative deviation of each dimension, and the characteristic deviation matrix is ​​generated.

9. A digital twin-driven predictive control system for gas odorization according to claim 8, characterized in that, The twin server is also used to configure the corresponding flow field feature weight coefficients and adsorption feature weight coefficients for each normalized relative deviation in the feature deviation matrix, calculate the flow field and topology mismatch confidence and adsorption parameter drift confidence respectively, and combine them to generate a fault evaluation matrix. When the confidence level of adsorption parameter drift exceeds the preset adsorption drift threshold, the twin server starts the constraint optimization identification algorithm to construct the objective function, and obtains the optimal tube wall adsorption reaction constant and the optimal tube wall desorption constant that make the objective function value reach the convergence condition through iterative optimization, thus completing the closed-loop update of the digital twin mechanism model.

10. A digital twin-driven predictive control method for gas odorization, characterized in that, The system is applied to a digital twin-driven predictive control system for gas odorization as described in any one of claims 1-9, comprising the following steps: Collect instantaneous volumetric flow rate, gas pressure, and gas temperature data to obtain odorant concentration data; During the injection of odorant into the gas pipeline network, the current injection mass flow rate is measured; A digital twin mechanism model of the gas pipeline network flow field is performed using instantaneous gas volumetric flow rate, gas pressure data, gas temperature data, and injection mass flow rate, and the adsorption compensation flow rate is calculated and generated. Based on the odorant concentration data and the preset concentration target, the feedback compensation flow rate is determined, and a general control command is generated according to the adsorption compensation flow rate and the feedback compensation flow rate to control the odorization operation.

Citation Information

Patent Citations

  • Automatic gas odorization device

    CN203656580U

  • Intelligent fuel gas odorization system

    CN204164669U

  • Odorant analyzer system

    EP0445927A2