Flow compensation and remote transmission integrated system for ultrasonic gas meter
By constructing an integrated system for flow compensation and remote data transmission, the metering accuracy and remote data transmission problems of ultrasonic gas meters in complex environments are solved. High-precision metering and stable data transmission are achieved in low-flow and signal interference environments, making it suitable for difficult-to-maintain scenarios such as underground wells.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZENNER METERING TECH (SHANGHAI) LTD
- Filing Date
- 2026-01-05
- Publication Date
- 2026-07-03
Smart Images

Figure CN121702490B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of ultrasonic gas metering technology, specifically to an integrated system for flow compensation and remote transmission of ultrasonic gas meters. Background Technology
[0002] Ultrasonic gas meters, with their advantages of no moving mechanical parts, high metering accuracy, and fast response speed, are gradually replacing traditional mechanical gas meters and becoming an important device for urban gas metering. However, in practical applications, the metering accuracy of ultrasonic gas meters is affected by several factors, especially when the gas flow rate is extremely low, temperature fluctuations are frequent, pipeline vibration disturbances are strong, or the installation location is irregular. In these situations, traditional flow compensation models struggle to accurately respond to environmental changes, leading to significant metering deviations at low flow rates.
[0003] In addition, ultrasonic gas meters need to have remote meter reading function in some application scenarios, especially in cold or remote areas where there is a strong demand for centralized management. The installation of the remote transmission module usually relies on external wiring, which has problems such as poor contact, difficult maintenance, and high power consumption, which seriously affect the reliability and lifespan of the meter.
[0004] Currently, there is no integrated solution that can balance flow compensation accuracy and remote data transmission stability under low flow conditions. Especially in narrow downhole pipelines, frequent gas source switching, or heating accompanied by gas fluctuations, metering errors and remote transmission failures coexist, becoming a technical bottleneck that urgently needs to be solved. Summary of the Invention
[0005] The purpose of this invention is to provide an integrated system for flow compensation and remote transmission of ultrasonic gas meters to address the shortcomings of the prior art.
[0006] To achieve the above objectives, the present invention provides the following technical solution: a flow compensation and remote transmission integrated system for ultrasonic gas meters, comprising:
[0007] The operating condition discrimination module obtains the initial operating parameters of the ultrasonic gas meter installed in the target pipe section, including ambient temperature T0, pipeline pressure P0, low flow threshold Qmin, and real-time signal interference intensity I0, to determine whether the current operating condition is in a low flow and weak signal state.
[0008] The correction factor generation module, if determined to be in a low flow rate and weak signal state, establishes a gas density dynamic model D(t) based on T0, P0 and Qmin, and constructs a real-time gas flow rate correction factor Cv(t) in conjunction with the standard parameters G of the gas components.
[0009] The stability judgment module compensates the currently detected flow rate value Qa of the gas meter according to Cv(t), and obtains the compensated flow rate Qc = Qa × Cv(t), and judges whether Qc is within the stable range [Qmin, Qmax];
[0010] The identification module, if Qc is within the stable range, encapsulates Qc and attaches the current timestamp T t and the unique device number ID to form a remote transmission data packet Dp;
[0011] The communication control module obtains the current power supply state V0 and the network reachable state Sn. If V0 ≥ the threshold voltage Vt and Sn is valid, it uploads Dp to the remote server;
[0012] The network detection module, if V0 < Vt or Sn fails, temporarily caches Dp to the local EEPROM storage unit, enters the low-power sleep mode, and at the same time starts the intermittent network detection subroutine Sd until V0 ≥ Vt and Sn is valid, and then executes the communication control module;
[0013] The update module compares the successfully reported Qc with the initial value Qa and D(t) to evaluate the stability of the compensation model. If there are N consecutive differences, , it automatically corrects the Cv(t) model parameters according to the trend of ΔQ and reconstructs D(t);
[0014] The maintenance trigger module, if ΔQ tends to 0 for a long time, outputs that the current meter condition is effective compensation and records it in the remote database; otherwise, it outputs compensation abnormality and sends a maintenance instruction.
[0015] Preferably, judging whether the current working condition is in the low-flow weak signal state includes: if the currently detected flow rate Qa ≤ Qmin; and at the same time satisfying I0 ≥ the signal interference threshold Ithresh; and satisfying ΔT / Δt > 5°C / min or ΔP / Δt > 10 kPa / min; then the current operating state is determined to be in the low-flow weak signal state.
[0016] Preferably, the correction factor generation module includes:
[0017] Based on the obtained ambient temperature T0 and pipeline pressure P0, combined with the ideal gas state equation, calculate the instantaneous reference density value ρ0 of the gas in the target pipe section;
[0018] On the basis of ρ0, introduce the flow state correction coefficient corresponding to the low-flow threshold Qmin, continuously correct ρ0 over time, and establish a dynamic gas density model D(t) that changes over time;
[0019] The standard parameters G of the gas components corresponding to the current gas type are called, and the standard parameters G of the gas components are coupled with the dynamic model D(t) of gas density to obtain the gas sound speed correction parameters.
[0020] The time difference of ultrasonic wave propagation is compensated based on the gas sound velocity correction parameter to generate a real-time gas velocity correction factor Cv(t).
[0021] Preferably, the stability determination module includes:
[0022] The real-time gas flow rate correction factor is multiplied with the current detected flow rate value to obtain the compensated flow rate value.
[0023] Set minimum and maximum flow rate thresholds that match the structural characteristics of the gas meter and the characteristics of the gas source to construct a stable judgment range;
[0024] The compensated flow velocity value is compared with the stability judgment interval. If the compensated flow velocity is within the interval, it is judged as a stable operating condition; otherwise, it is an unstable operating condition.
[0025] The compensated flow velocity values are processed by moving average over multiple consecutive time periods. If the moving average value remains within a stable range, the current operating condition is confirmed to be stable.
[0026] Preferably, the communication control module includes:
[0027] The power supply voltage value is obtained in real time through a voltage detection circuit and compared with a preset threshold voltage to determine whether the current power supply status meets the upload conditions.
[0028] The network status query command is invoked through the communication module to obtain the current network signal strength and access authentication status, and a network reachability status flag is generated.
[0029] If the supply voltage is greater than or equal to the threshold voltage and the network reachability flag is valid, the data transmission interface is invoked to send the encapsulated data packet to the remote server.
[0030] Preferably, the update module includes:
[0031] After each successful data upload, record the difference between the current compensated flow rate value and the initial detected flow rate value, and calculate the absolute difference ΔQ.
[0032] An error threshold is set. If the difference within a preset number of consecutive times is greater than or equal to the error threshold, it is determined that the compensation model has an offset.
[0033] Based on the trend of the difference change, and combined with the parameter fitting residual of the gas density dynamic model, the dynamic weight of the gas flow rate correction factor is adjusted.
[0034] The gas density dynamic model is reconstructed based on the updated dynamic weights, and a new correction factor is output for use in the next round of compensation calculation.
[0035] Preferably, the dynamic weights of the gas flow rate correction factor include:
[0036] Trend analysis was performed on the difference between the compensated flow velocity value and the initial detected flow velocity value over multiple consecutive data periods to extract the characteristics of the change direction and fluctuation amplitude.
[0037] Using historical parameters involved in the calculation of correction factors in the gas density dynamic model as input variables, an error residual fitting function is constructed, and the least squares residual is solved.
[0038] The sensitivity coefficients of each input variable are calculated based on the fitting residuals, and these coefficients are used as the basis for adjusting the dynamic weights.
[0039] A gradient update strategy is used to iteratively optimize the weights of the gas velocity correction factor to obtain the updated correction factor.
[0040] Preferably, the maintenance triggering module evaluates the long-term trend of ΔQ. If the average value of ΔQ approaches 0 and the standard deviation is less than the stability threshold σ, then the compensation is effective.
[0041] The technical effects and advantages provided by the present invention in the above technical solution are as follows:
[0042] 1. This invention constructs an integrated ultrasonic gas meter flow compensation and remote transmission system that combines operating condition discrimination, dynamic gas density modeling, adaptive optimization of flow rate correction factors, and remote communication control. This system effectively addresses the impact of non-ideal operating conditions such as low flow rate, signal interference, and gas composition fluctuations on ultrasonic metering accuracy. In particular, the introduction of a closed-loop correction mechanism based on physical modeling and data feedback enables the compensation results to have self-learning and self-correcting capabilities, significantly improving the system's long-term stability and reliability in complex environments.
[0043] 2. This invention also integrates functional modules such as low-power sleep mode, breakpoint resume, network recovery identification, and remote maintenance triggering, ensuring data integrity and reducing energy consumption even in scenarios with insufficient power supply or network failure. It is suitable for difficult-to-maintain application environments such as downhole and edge areas. The overall system achieves an intelligent closed loop from operational condition perception to data upload, from compensation modeling to maintenance response, and possesses good scalability. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0045] Figure 1 This is a flowchart of the system modules of the present invention. Detailed Implementation
[0046] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, 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.
[0047] For examples, please refer to Figure 1 As shown in this embodiment, a flow compensation and remote transmission integrated system for ultrasonic gas meters includes:
[0048] The operating condition discrimination module obtains the initial operating parameters of the ultrasonic gas meter installed in the target pipe section, including ambient temperature T0, pipeline pressure P0, low flow threshold Qmin, and real-time signal interference intensity I0, to determine whether the current operating condition is in a low flow and weak signal state.
[0049] In this embodiment, the operating condition discrimination module is used to identify whether the ultrasonic gas meter is in a low flow and weak signal state during actual operation, so as to perform flow compensation and remote transmission processing in the future.
[0050] Specifically, the operating condition discrimination module is communicatively connected to the ultrasonic gas meter installed in the target pipeline section, and can obtain the following initial operating parameters in real time:
[0051] Ambient temperature T0: obtained through the built-in temperature sensor or external temperature detection component, in degrees Celsius;
[0052] Pipeline pressure P0: The static gas pressure of the pipe section before or after the meter is measured by the connected differential pressure sensor, and the unit is kPa;
[0053] Low flow threshold Qmin: Obtained by preset by the gas meter's built-in metering module or remotely configured, representing the system's perceived critical flow rate for low reliability, in units of... ;
[0054] Real-time signal interference intensity I0: Obtained by quantitatively calculating the correlation, amplitude stability, and background noise level of ultrasonic transmission and reception signals, with the unit of dB or relative perturbation coefficient.
[0055] The working condition discrimination module internally presets a set of logical rules for determining the low-flow weak-signal state. The typical rules are as follows: If the current detected flow velocity Qa ≤ Qmin; and at the same time, I0 ≥ signal interference threshold Ithresh; and ΔT / Δt > 5°C / min or ΔP / Δt > 10 kPa / min; then the current operating state is determined as the low-flow weak-signal state, and the status flag bit is output , driving the compensation modeling module to start the compensation process. Otherwise, if Qa > Qmin and I0 < Ithresh, it is determined as the normal flow state, , and the system enters the standard metering and remote transmission process.
[0056] To improve the determination accuracy, the working condition discrimination module can integrate a sliding window algorithm for data trend smoothing to ensure that the recognition process is insensitive to instantaneous perturbations but can respond in a timely manner to continuous deterioration of the working condition.
[0057] The correction factor generation module. If it is determined as the low-flow weak-signal state, a dynamic gas density model D(t) is established based on T0, P0, and Qmin, and combined with the standard parameters G of the gas components, a real-time gas flow velocity correction factor Cv(t) is constructed.
[0058] In this embodiment, based on the obtained ambient temperature T0 and pipeline pressure P0, combined with the gas flow characteristics under low-flow conditions, a gas flow velocity correction factor Cv(t) is constructed through gas density modeling and sound velocity calibration to improve the metering accuracy of the ultrasonic gas meter under non-stable conditions.
[0059] First, the ideal gas state equation is used to construct the instantaneous reference density of the gas under the current working condition. The ideal gas state equation is: ρ0 = (P0 × M) / (R × T0); where: ρ0 represents the instantaneous reference density of the gas in the target pipeline section, with the unit of kg / m³; P0 is the real-time pipeline pressure collected, with the unit of Pa; T0 is the ambient temperature collected, with the unit of K; M is the molar mass corresponding to the target gas type, with the unit of kg / mol; R is the ideal gas constant, with a value of 8.314 J / (mol·K). Through the above calculation, the theoretical density base value of the gas under the current environment can be obtained.
[0060] Considering the instability of the gas flow pattern under the low-flow state, a time-varying correction factor is introduced on the basis of ρ0 to construct a gas density dynamic model D(t) that more conforms to the actual flow characteristics.
[0061] The time-varying correction factor is based on a low flow threshold Qmin to construct a flow regime correction coefficient K(t), with a value range of [0.95, 1.05]. It represents the density fluctuation rate of the gas at low flow rates, and is specifically defined as follows: Where: α is the adjustment coefficient, ranging from 0.01 to 0.05, representing the density fluctuation amplitude; f is the disturbance frequency, in Hz, determined by the ratio of Qa to Qmin under actual operating conditions; t is the current time, in seconds. Then the gas density dynamic model D(t) is expressed as: This model can dynamically reflect the fluctuations in actual gas density under weak flow disturbances.
[0062] Based on the gas density represented by D(t) above, and considering the gas composition characteristics, the correction parameter for sound velocity compensation is further calculated. Assuming the current gas type is natural gas, its composition parameter G is obtained by looking up a table, including the main gas components (methane, ethane, propane, nitrogen, etc.) and their volume fractions. The sound velocity correction parameter Ca(t) is calculated as follows: Where: γ is the specific heat ratio of the gas, calculated by weighted average of the gas component parameters G; M_eff is the effective molar mass corresponding to the current gas component, in kg / mol; R is the ideal gas constant; T0 is the temperature. By jointly calculating D(t) and G, M_eff and γ are obtained, thus Ca(t), which is the gas sound velocity correction parameter under the current operating condition.
[0063] Finally, the sound velocity correction parameter Ca(t) is applied to correct the ultrasonic wave propagation time difference to generate the flow velocity correction factor Cv(t) for flow velocity compensation.
[0064] Let the original calculated flow velocity be Qa, measured based on the bidirectional ultrasonic propagation time difference Δt. According to the correction parameter Ca(t), Δt is adjusted to Δt′, with the relationship: Δt′ = Δt × (C0 / Ca(t)); where: C0 is the gas sound velocity constant during initial calibration; Δt is the currently detected ultrasonic propagation time difference; Ca(t) is the currently calculated corrected sound velocity. Substituting Δt′ into the ultrasonic flow velocity formula, we get: Where L is the sensor spacing. The flow rate correction factor Cv(t) is expressed as: Cv(t) = Q_c / Qa; that is, the proportionality coefficient between the original flow rate and the corrected flow rate, used to compensate for Qa. Using the Cv(t) output for subsequent flow rate calculation can effectively improve the metering accuracy of ultrasonic gas meters in low-flow, complex disturbance environments.
[0065] The stability assessment module compensates for the current flow rate Qa detected by the gas meter based on Cv(t) to obtain the compensated flow rate. And determine whether Qc is in the stable interval [Qmin, Qmax].
[0066] First, obtain the original flow velocity value detected by the ultrasonic gas meter, and record it as the current detected flow velocity value. Then, using the previously calculated real-time gas flow velocity correction factor, multiply the two values to calculate the compensated flow velocity value. The calculation formula is: Compensated flow velocity value = Current detected flow velocity value × Real-time gas flow velocity correction factor; where the real-time gas flow velocity correction factor originates from the flow velocity compensation process and represents the correction ratio coefficient after the ultrasonic wave propagation is affected by changes in sound velocity.
[0067] To define whether a flow rate is stable, a set of flow rate thresholds that match the structural parameters of the ultrasonic gas meter and the characteristics of a typical gas source must be preset.
[0068] A minimum stable flow rate threshold is set as the minimum flow rate threshold, and a maximum stable flow rate threshold is set as the maximum flow rate threshold. Together, they constitute the stability judgment interval: Stability judgment interval = [minimum flow rate threshold, maximum flow rate threshold]; where: the minimum flow rate threshold is generally set as the lower limit at which ultrasonic metering accuracy begins to decline, typically 0.016 cubic meters per hour; the maximum flow rate threshold is determined based on the pipe diameter and meter body structure, generally 1.2 to 1.5 times the rated maximum flow rate, used to tolerate short-term flow rate peaks. This interval serves as an important benchmark for judging the stability of the operating condition.
[0069] The compensated flow velocity value is compared with the aforementioned stability judgment interval. If the compensated flow velocity value falls between the minimum and maximum flow velocity thresholds, the current operating condition is considered to be within a qualified stable range and recorded as a preliminary stable state; otherwise, it is judged as an unstable operating condition. This comparison is a single-point judgment, mainly used to quickly identify sudden abnormal states or the entry into the compensation boundary region.
[0070] To enhance the robustness of operating condition judgment and eliminate the interference of short-term sudden changes on the judgment results, a moving average judgment over a time period is introduced.
[0071] Within a set fixed time period (e.g., 30 seconds), the compensated flow velocity values are processed using a moving average. The moving average is implemented using a simple weighted average model, expressed as: current moving average flow velocity value = sum of all compensated flow velocity values within the selected time period / number of flow velocity samples; generally, sampling is performed once per second, with a total of 30 data points within 30 seconds.
[0072] If the sliding average flow velocity value remains within the stability determination range for three consecutive time periods (e.g., 90 seconds), then the current operating condition is finally confirmed as a stable state.
[0073] If the average flow rate exceeds the threshold range in any period, the current operating condition remains unstable and remote data encapsulation is not triggered.
[0074] The identification module, if Qc is within a stable range, encapsulates Qc and attaches the current timestamp T. t Together with the device's unique ID, a remote data packet Dp is generated.
[0075] The compensated flow velocity value is output by the flow velocity compensation module and confirmed by the stability judgment module to be between the minimum and maximum flow velocity thresholds. Furthermore, a stable state is confirmed through multi-period moving averages. The identification module initiates the packetization process only when all the above conditions are met simultaneously.
[0076] To ensure that the transmitted data has time tracking capabilities, a high-precision real-time clock component is invoked during the packet encapsulation process to generate a timestamp for the current sampling moment, which is recorded as the current timestamp. This timestamp uses the Coordinated Universal Time (UTC) format and is accurate to the second.
[0077] The current timestamp is obtained by calling the embedded clock register or an external time synchronization module, and is stored in the packet buffer along with the compensated flow rate value as a criterion for judging data validity.
[0078] To identify the source of the data and prevent data confusion from multiple gas meters, a unique device number is attached during the packaging process and recorded as the unique device number.
[0079] The unique device serial number is written into a non-erasable memory chip during the manufacturing stage via laser marking or firmware burning. The format can be represented by a 32-bit or 64-bit hexadecimal code, such as "0xA1B2C3D4E5F60789". This serial number occupies a fixed field position in the packet structure and is used for device identification and maintenance tracking after data reporting.
[0080] A complete remote data packet contains the following fields: header identification field (such as a synchronization word, used for communication identification); device unique number; current timestamp; compensated flow rate value; and data integrity check code (such as CRC-8 or CRC-16). These fields are packaged in a preset format and written to the data buffer to form a remote data packet, denoted as a remote data packet.
[0081] If the system has network type recognition function or power consumption management requirements, the following fields can be added: current signal quality level; module working status code; data retransmission flag (used to determine whether the data is reported repeatedly).
[0082] After the packetization process is complete, the identification module writes the remote transmission data packet into the output queue of the communication module, waiting for the communication control module to perform the reporting operation. This process is structurally decoupled from the compensation and judgment processes, but logically remains dependent on them, ensuring that packetization and transmission only occur when the data is reliable.
[0083] The communication control module obtains the current power supply status V0 and network reachability status Sn. If V0 ≥ threshold voltage Vt and Sn is valid, then Dp is uploaded to the remote server.
[0084] The communication control module has a set of voltage detection circuits connected in parallel with the main power supply circuit, which are used to periodically obtain the current power supply voltage value of the device and record it as the current power supply voltage value.
[0085] The current supply voltage is compared with a preset threshold voltage. This threshold voltage is determined based on the startup voltage and stable operating voltage of the communication module used, and is typically set to 3.3 volts. For example, when the module is an NB-IoT communication module, the threshold voltage is set to 3.3 volts, with a tolerance range of ±0.1 volts. The judgment condition is:
[0086] If the current power supply voltage is greater than or equal to the threshold voltage, the power supply status is deemed to be satisfied.
[0087] If the current power supply voltage is less than the threshold voltage, the current power supply status is considered not to meet the data upload conditions, and the communication control module enters a waiting or low-power state, without triggering the upload operation.
[0088] This judgment process runs on a millisecond cycle, ensuring that communication operations are only performed under stable voltage conditions, thus reducing the risk of communication failure.
[0089] Provided that the power supply status is met, the communication control module further uses the communication module to call the standard network status query command to obtain the signal strength and access authentication status of the current communication network.
[0090] Signal strength is determined by reading the Signal Received Quality (RSRP) and Signal Strength Indication (RSSI). If the RSRP is higher than -100 dB / mW and the RSSI is higher than -85 dB / mW, the signal strength is good.
[0091] Simultaneously, the module queries the network registration status to confirm whether network access and authentication registration have been completed. Only when the access status is "registration complete" and the signal strength meets the set threshold is a network reachability status flag generated, recorded as the network status flag. The network status flag values are as follows:
[0092] Valid status (flag value "1"): Indicates that the current network status meets the data transmission requirements;
[0093] Invalid status (flag value "0"): indicates that the current network is unavailable and data upload operations are prohibited.
[0094] The network status assessment cycle is synchronized with the power supply assessment, and the status is refreshed every 10 seconds by default.
[0095] When the power supply state is satisfied and the network state flag is in a valid state, the communication control module calls the data transmission interface and sends the encapsulated data packet to the remote server.
[0096] The data transmission interface uses a connection-oriented data upload protocol, such as MQTT, CoAP, or HTTP, and automatically selects a low-power priority channel according to the configuration. The content of the data packet includes: the compensated flow rate value; the current timestamp; the unique device number; and the data integrity check code.
[0097] After sending the data, the communication module waits for the server to return a receive confirmation instruction. If the confirmation is successful, the upload time and response status are recorded; if the reception is not successful or there is no response after the timeout, the data retransmission or cache waiting logic is entered to prevent data loss.
[0098] Through the joint implementation of the above power supply state judgment, network reachability detection, and data transmission control, it is ensured that the data upload process is stable and secure, and it is suitable for the remote transmission application scenario of ultrasonic gas meters with low power consumption and high reliability requirements.
[0099] For the network detection module, if V0 < Vt or Sn fails, Dp is temporarily cached in the local EEPROM storage unit, and the low-power sleep mode is entered. At the same time, the intermittent network detection subroutine Sd is started until V0 ≥ Vt and Sn is valid, and then the communication control module is executed.
[0100] When the communication control module detects that the current power supply voltage value is less than the threshold voltage, or the network state flag is in an invalid state, that is, the power supply or network does not meet the data upload requirements, the network detection module immediately takes over the processing flow.
[0101] At this time, the remote transmission data packet generated by the identification module will be temporarily written into the local non-volatile storage unit. It is preferably to use EEPROM as the cache medium to ensure that the data remains after power-off.
[0102] The cache writing process includes the following operations:
[0103] Pack the compensated flow rate value, the current timestamp, and the unique device number into structured data;
[0104] Generate and append a data integrity check field, such as a 16-bit cyclic redundancy check code;
[0105] Write the encapsulated complete data frame into the preset data cache area in the EEPROM according to the address index;
[0106] Update the write pointer and the cache status flag to prevent repeated writing or overwriting of unuploaded data.
[0107] The cache structure is organized in a circular queue manner and supports data reading back in chronological order.
[0108] After the data caching operation is completed, the network detection module immediately controls the main control chip to enter a low-power sleep mode, reducing overall current consumption and extending the device's battery life.
[0109] The sleep mode employs a low-power hardware pin-triggered mechanism, shutting down all functional units except for the watchdog timer and clock module, including the display, power indicator, and main power supply path of the communication module. Typical current is controlled below 5 microamps in sleep mode.
[0110] Before entering hibernation, save the current power supply voltage value and the previous network status so that the detection program can continue to make judgments after waking up.
[0111] To monitor network status recovery in real time, an intermittent network detection subroutine is embedded within the network detection module. This subroutine periodically wakes up the communication module at set time intervals to detect network connectivity and power supply status, and determines whether to reactivate the communication control module.
[0112] The detection subroutine's execution cycle is defined as the detection period, configurable between 60 and 300 seconds, with a default value of 120 seconds. Each detection process includes:
[0113] Wake up the communication module and reacquire the current power supply voltage value; call the network status query command to obtain the network signal strength and registration status; determine whether the power supply voltage value is greater than or equal to the threshold voltage; determine whether the network status flag is valid.
[0114] If both of the following conditions are met simultaneously: the current power supply voltage is greater than or equal to the threshold voltage; and the network status flag is valid, then the detection subroutine outputs a recovery signal, immediately exits sleep mode, and triggers the communication control module to start the data upload process. Otherwise, the subroutine automatically shuts down the communication module power supply, re-enters sleep mode, and wakes up again when the next detection cycle arrives.
[0115] To improve reliability, the network detection module also maintains a cache index table to record the location, timestamp, and number of upload attempts for data to be uploaded. If a single piece of data fails to upload five times consecutively, an error flag is generated and recorded in the local maintenance log area for subsequent manual or remote maintenance.
[0116] The update module compares the successfully reported Qc with the initial values Qa and D(t) to evaluate the stability of the compensation model. If the difference is N consecutive times... Then, the Cv(t) model parameters are automatically corrected based on the ΔQ trend, and D(t) is reconstructed.
[0117] After each compensation, once the flow rate value is successfully uploaded to the remote server, the difference between the compensated flow rate value and the initial detected flow rate value before compensation is immediately recorded, and its absolute value is calculated and denoted as the difference ΔQ. The calculation method is: Difference ΔQ = Compensated flow rate value minus the absolute value of the initial detected flow rate value, i.e. .
[0118] Subsequently, a static error threshold is set, denoted as error threshold δ. The value of δ is set according to the minimum measurable resolution of the gas meter, which is usually 0.015 cubic meters per hour.
[0119] If the difference ΔQ over N consecutive data periods is greater than or equal to the error threshold δ (for example, N is 5), then the current compensation model is determined to have a stability shift, triggering the correction process.
[0120] A trend analysis is performed on the difference ΔQ over the aforementioned N data periods, including determining its growth direction (positive / negative), growth rate, and fluctuation amplitude. The specific method is as follows:
[0121] Calculate the difference sequence between adjacent differences and extract the direction of change;
[0122] The degree of volatility was assessed using the sliding standard deviation method.
[0123] A trend scoring factor is constructed to measure the stability risk of model deviation.
[0124] This scoring factor serves as one of the triggering conditions for subsequent model residual fitting.
[0125] The historical input parameters currently used in the construction of the gas density dynamic model are used as variable inputs, including ambient temperature, pipeline pressure, flow regime correction coefficient, and gas composition parameters.
[0126] Based on these variables, a set of fitting functions is constructed, and the compensation error residuals are fitted using least squares, in the form of:
[0127] Minimize: Fitting residual = Measured ΔQ minus the sum of squares of the model-predicted ΔQ.
[0128] By fitting the results, the mapping relationship between each input variable and the error is obtained, and the sensitivity coefficient of each variable is calculated. The sensitivity coefficient represents the strength of the variable's influence on the error under a unit change, and serves as a reference for subsequent weight updates.
[0129] Based on the sensitivity coefficient results, a gradient update strategy is used to iteratively optimize the weights of the constituent parameters of the gas flow rate correction factor. The gradient update strategy is expressed as follows: new weight value = current weight value minus learning rate multiplied by sensitivity gradient. The learning rate, an adjustment factor between 0.05 and 0.1, is used to control the optimization step size and prevent parameter oscillation or divergence.
[0130] This strategy assigns new dynamic weights to each participating factor, resulting in an updated gas flow rate correction factor.
[0131] The optimized weight allocation results are substituted back into the gas density dynamic model, the corrected density expression is recalculated, and a new round of gas flow rate correction factor is output as the input parameter for the next cycle of compensation calculation.
[0132] The new correction factor will be used to calculate the compensation flow rate in the current cycle and to determine whether to maintain or further correct it in the next cycle, so as to achieve adaptive modeling of dynamic closed loop.
[0133] Through the above complete process, continuous self-learning and dynamic optimization of the gas flow rate compensation model can be achieved, improving the long-term metering stability of ultrasonic gas meters under non-standard gas sources and fluctuating flow conditions.
[0134] If the maintenance trigger module detects a long-term trend of ΔQ towards 0, it outputs that the current metering condition is valid and records it to the remote database; otherwise, it outputs that the compensation is abnormal and sends a maintenance command.
[0135] After the compensation model update module outputs the correction factor, the maintenance trigger module tracks the trend of the absolute difference ΔQ between the compensated flow velocity value and the initial detected flow velocity value in each cycle.
[0136] Set a continuous time window T (such as 24 hours or 100 measurement periods), and calculate the average and standard deviation of all ΔQ within this window to determine the volatility of the compensation model output.
[0137] The specific judgment condition is as follows: if the average value of ΔQ approaches 0 within the time window T, and the standard deviation is lower than the preset stability threshold σ (e.g., 0.005 cubic meters per hour), then the model compensation result is considered stable and the error is controllable. This state is judged as "effective compensation state".
[0138] When the current meter is determined to be in a compensated and effective state, the maintenance trigger module generates a status log, including: the current timestamp; the current device's unique ID; the determination result (compensation effective); and the average and standard deviation of ΔQ. This log is written to a remote database through the data encapsulation module as a historical record of the device's status, which is used by the remote monitoring platform for trend analysis and performance evaluation.
[0139] If the maintenance trigger module detects that ΔQ continuously deviates from 0 within multiple time windows, or that the fluctuation amplitude exceeds the stability threshold σ, and the model has failed to converge after more than two rounds of adaptive updates, it determines that the compensation model may have failed and enters a "compensation anomaly state." The anomaly state triggering logic includes, but is not limited to, any of the following conditions: the average value of ΔQ is continuously higher than the set offset threshold (e.g., 0.03 cubic meters per hour); the standard deviation of ΔQ exceeds the set upper limit (e.g., 0.01 cubic meters per hour); the correction factor weight adjustment frequency exceeds three times but ΔQ shows no significant downward trend. At this time, the maintenance trigger module automatically generates a maintenance instruction, which includes: the target device number; the current anomaly type (e.g., excessive compensation deviation); and suggested maintenance operations (e.g., checking sensor interfaces, resetting compensation parameters, or remotely issuing initialization commands). This maintenance instruction is pushed to the management platform or maintenance personnel's client via a remote communication interface as the trigger for maintenance operations.
[0140] After receiving the response command from the remote platform, the maintenance trigger module can record the maintenance execution result, such as "initialization command issued" or "equipment enters manual maintenance mode", and update the local status flag to avoid repeated alarms.
[0141] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A flow compensation and remote transmission integrated system for ultrasonic gas meters, characterized in that: Including: A working condition discrimination module, which obtains the initial operating parameters of an ultrasonic gas meter installed in a target pipe section, including the ambient temperature T0, the pipeline pressure P0, the low flow threshold Qmin, and the real-time signal interference intensity I0, and is used to determine whether the current working condition is in a low flow weak signal state; A correction factor generation module. If it is determined to be in a low flow weak signal state, a gas density dynamic model D(t) is established based on T0, P0, and Qmin, and combined with the standard gas component parameters G, a real-time gas flow velocity correction factor Cv(t) is constructed, including: Based on the obtained ambient temperature T0 and pipeline pressure P0, combined with the ideal gas state equation, the instantaneous reference density value ρ0 of the gas in the target pipe section is calculated; On the basis of ρ0, a flow state correction coefficient corresponding to the low flow threshold Qmin is introduced to continuously correct ρ0 over time, and a gas density dynamic model D(t) that changes with time is established; Call the standard gas component parameters G corresponding to the current gas type, and perform a coupling calculation on the standard gas component parameters G and the gas density dynamic model D(t) to obtain a gas sound speed correction parameter; Compensate the ultrasonic propagation time difference according to the gas sound speed correction parameter to generate a real-time gas flow velocity correction factor Cv(t); A stability judgment module, which compensates the current detected flow velocity value Qa of the gas meter according to Cv(t) to obtain a compensated flow velocity Qc = Qa × Cv(t), and judges whether Qc is within the stable interval [Qmin, Qmax]; The identification module, if Qc is within a stable range, encapsulates Qc and attaches the current timestamp T. t And the device's unique ID, forming a remote data packet Dp; A communication control module, which obtains the current power supply state V0 and the network reachable state Sn. If V0 ≥ the threshold voltage Vt and Sn is valid, then upload Dp to the remote server; A network detection module. If V0 < Vt or Sn fails, then temporarily cache Dp to the local EEPROM storage unit, enter the low-power sleep mode, and at the same time start an intermittent network detection subroutine Sd until V0 ≥ Vt and Sn is valid, and then execute the communication control module; The update module compares the successfully reported Qc with the initial values Qa and D(t) to evaluate the stability of the compensation model. If the difference is N consecutive times... If the threshold δ is set, the Cv(t) model parameters will be automatically corrected based on the ΔQ trend, and D(t) will be reconstructed. A maintenance trigger module. If ΔQ tends to 0 for a long time, then output that the current meter working condition is compensated effectively and record it in the remote database; otherwise, output compensation abnormality and send a maintenance instruction.
2. The flow compensation and remote transmission integrated system for ultrasonic gas meters according to claim 1, characterized in that: Determining whether the current working condition is in a low flow weak signal state includes: if the current detected flow velocity Qa ≤ the low flow threshold Qmin; and at the same time, the real-time signal interference intensity I0 ≥ the signal interference threshold Ithresh; and the change range of the ambient temperature per unit time is greater than 5°C / min or the change range of the pipeline pressure is greater than 10 kPa / min; then determine the current operating state as a low flow weak signal state.
3. The flow compensation and remote transmission integrated system for ultrasonic gas meters according to claim 1, characterized in that: The stability judgment module includes: Performing a multiplication operation on the real-time gas flow velocity correction factor and the current detected flow velocity value to obtain a compensated flow velocity value; Setting a minimum flow velocity threshold and a maximum flow velocity threshold that match the structural characteristics of the gas meter and the gas source characteristics to construct a stable judgment interval; Comparing the compensated flow velocity value with the stable judgment interval. If the compensated flow velocity is within this interval, it is determined as a stable working condition; otherwise, it is an unstable working condition. The compensated flow velocity values are processed by moving average over multiple consecutive time periods. If the moving average value remains within a stable range, the current operating condition is confirmed to be stable.
4. The flow compensation and remote transmission integrated system for ultrasonic gas meters according to claim 1, characterized in that: The communication control module includes: The power supply voltage value is obtained in real time through a voltage detection circuit and compared with a preset threshold voltage to determine whether the current power supply status meets the upload conditions. The network status query command is invoked through the communication module to obtain the current network signal strength and access authentication status, and a network reachability status flag is generated. If the supply voltage is greater than or equal to the threshold voltage and the network reachability flag is valid, the data transmission interface is invoked to send the encapsulated data packet to the remote server.
5. The flow compensation and remote transmission integrated system for ultrasonic gas meters according to claim 1, characterized in that: The update module includes: After each successful data upload, record the difference between the current compensated flow rate value and the initial detected flow rate value, and calculate the absolute difference ΔQ. An error threshold is set. If the difference within a preset number of consecutive times is greater than or equal to the error threshold, it is determined that the compensation model has an offset. Based on the trend of the difference change, and combined with the parameter fitting residual of the gas density dynamic model, the dynamic weight of the gas flow rate correction factor is adjusted. The gas density dynamic model is reconstructed based on the updated dynamic weights, and a new correction factor is output for use in the next round of compensation calculation.
6. The flow compensation and remote transmission integrated system for ultrasonic gas meters according to claim 5, characterized in that: The dynamic weights of the gas flow rate correction factor include: Trend analysis was performed on the difference between the compensated flow velocity value and the initial detected flow velocity value over multiple consecutive data periods to extract the characteristics of the change direction and fluctuation amplitude. Using historical parameters involved in the calculation of correction factors in the gas density dynamic model as input variables, an error residual fitting function is constructed, and the least squares residual is solved. The sensitivity coefficients of each input variable are calculated based on the fitting residuals, and these coefficients are used as the basis for adjusting the dynamic weights. A gradient update strategy is used to iteratively optimize the weights of the gas velocity correction factor to obtain the updated correction factor.
7. The flow compensation and remote transmission integrated system for ultrasonic gas meters according to claim 1, characterized in that: The maintenance triggering module evaluates the long-term trend of ΔQ. If the average value of ΔQ approaches 0 and the standard deviation is less than the stability threshold σ, then it outputs a compensation effective state.