Pulse output sensor control system for electromagnetic flowmeter
By using a pulse output sensor control system in the electromagnetic flowmeter, real-time acquisition and modeling of working condition data and dynamically adjusting the pulse output parameters, the problem of degradation of signal stability during long-term operation of the electromagnetic flowmeter is solved, and a high consistency and high stability output signal is achieved.
Patent Information
- Application Number
- CN202510660650.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-22
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2045-05-22
AI Technical Summary
During long-term operation of electromagnetic flowmeter, due to factors such as fluctuations in fluid components, electrode scaling, and sensor chain aging, the stability of the output pulse signal decreases and structural offsets, which in turn leads to problems such as increasing cumulative errors, calibration failure or abnormal alarms.
Provided is a pulse output sensor control system, including a acquisition module, a modeling module, a generation module, a discrimination module and an output control module. The system collects working condition data in real time, performs multi-dimensional state modeling, recognizes system state drift, and dynamically adjusts pulse output parameters to ensure the accuracy and stability of the output signal.
The long-term maintenance of the electromagnetic flowmeter output pulse signal is achieved in a high consistency and high stability state, which significantly enhances the drift fault tolerance and adaptive adjustment capabilities in long-term complex operation scenarios, and avoids the need for human intervention and frequent shutdown calibration.
Smart Images

Figure CN120176789A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of electromagnetic flowmeters, and more particularly, to a pulse output sensor control system for an electromagnetic flowmeter. Background Art
[0002] As a fluid flow measurement instrument commonly used in industrial processes, an electromagnetic flowmeter has the advantages of no moving parts, high measurement accuracy, and applicability to conductive liquids. However, during long-term actual operation, due to factors such as fluid composition fluctuations, electrode scaling, aging of the sensing chain, and enhanced flow disturbances, it often leads to problems such as a decrease in the stability of its output pulse signal and structural deviation, which in turn causes an increase in cumulative error, calibration failure, or abnormal alarm. Existing methods are mostly based on fixed parameter models or periodic calibration mechanisms, and it is difficult to dynamically respond to the signal drift caused by these slow or instantaneous changes without interrupting the measurement process. In addition, in dealing with non-Newtonian fluids, bubble interference, or complex working condition disturbances, existing pulse output adjustment schemes lack sufficient real-time performance and adaptive capabilities, and cannot ensure the consistency and controllability of the output signal in long-term, high-precision measurement tasks. Summary of the Invention
[0003] Aiming at the deficiencies of the prior art, in order to solve the technical problem of how to maintain the accuracy and stability of the output pulse signal for a long time during the long-term operation measurement of an electromagnetic flowmeter in the case of long-term drift of the measurement signal caused by changes in fluid characteristics or slow state changes inside the measurement system, this application provides a pulse output sensor control system for an electromagnetic flowmeter, including: An acquisition module for acquiring the working condition data of the target fluid to be measured under the current measurement working condition; the working condition data includes: the conductivity value, temperature value, viscosity gradient index of the target fluid to be measured, the change rate of the output pulse signal amplitude of the target fluid to be measured within a preset time window, and the waveform characteristics of the induced electromotive force; A modeling module for performing multi-dimensional state modeling based on the working condition data to generate a working condition state vector and a health state vector; identifying system state drift based on the health state vector to generate drift information; the health state vector is a state description vector obtained by comparing and calculating the working condition state vector with the historical health distribution; A generation module for receiving the working condition state vector, health state vector, and drift information, and mapping and generating pulse control parameters based on a preset parameter mapping function; performing signal synthesis based on the pulse control parameters to generate a first pulse signal; A discrimination module for performing waveform alignment, edge detection, and pulse count comparison on the first pulse signal using a standard pulse waveform, and outputting a structural deviation score; An output control module, configured to receive the structural deviation score, update a control parameter vector in a parameter mapping function according to a preset loss function and in combination with the drift information, so as to obtain an updated parameter mapping function; re-perform a signal synthesis operation based on the updated parameter mapping function to generate a second pulse signal, and output the second pulse signal to an external interface of the electromagnetic flowmeter.
[0004] As an optional implementation manner, collecting the working condition data of the to-be-detected target fluid under the current measurement working condition includes: Measuring a flow velocity difference by at least two flow velocity sensors installed at different positions of a measuring pipe section, and determining a viscosity gradient index of the to-be-detected target fluid based on the flow velocity difference according to a preset viscosity gradient calculation method; Real-time sampling the amplitude of the output pulse signal within a preset time window, and calculating a change slope of the amplitude within the preset time window to determine an amplitude change rate of the output pulse signal; Collecting an induced electromotive force waveform by a sampling unit installed at both ends of an excitation electrode of the electromagnetic flowmeter, and calculating a waveform frequency, an amplitude, and a fluctuation range to determine characteristics of the induced electromotive force waveform.
[0005] As an optional implementation manner, generating the working condition state vector and the health state vector includes: Respectively performing numerical normalization processing on the conductivity value, the temperature value, the viscosity gradient index, the amplitude change rate of the output pulse signal, and the characteristics of the induced electromotive force waveform, and constructing the working condition state vector by means of a vectorized splicing method; Based on historical operation working condition data, performing data clustering analysis in a preset working condition space to construct a historical health distribution; Calculating a similarity between the working condition state vector and the historical health distribution, determining a health deviation degree according to a preset drift threshold, and constructing the health state vector based on the health deviation degree.
[0006] As an optional implementation manner, mapping and generating pulse control parameters based on a preset parameter mapping function includes: Fusing and splicing the working condition state vector, the health state vector, and the drift information into a main mapping input vector, and separately inputting the viscosity gradient index into a modulation sub-network, where the modulation sub-network includes at least one neural layer with a non-linear activation function for generating a modulation factor vector; Inputting the main mapping input vector into a multi-layer perceptron main mapping network, where the main mapping network includes at least two hidden layers, and each hidden layer includes multiple neurons with non-linear activation functions; Introduce a modulation operation in the middle hidden layer of the main mapping network. The modulation operation includes performing element-wise multiplication or affine transformation on the modulation factor vector and the current hidden layer output to form an intermediate feature representation dynamically modulated by the viscosity gradient; Generate a control parameter vector for characterizing the pulse frequency, duty cycle, and maintenance duration based on the output of the main mapping network after modulation.
[0007] As an alternative implementation, the identifying system state drift based on the health status vector and generating drift information includes: Calculate the distance value between the current working condition and the historical health distribution based on the health status vector; Compare the distance value with a preset drift threshold interval. When the distance value exceeds the drift threshold interval, it is determined that the system state drifts; Quantitatively generate drift level information for characterizing the severity of state drift according to the amplitude by which the distance value exceeds the drift threshold interval.
[0008] As an alternative implementation, the generating drift information further includes: Perform multi-resolution wavelet transform on the time-varying sequence of the drift amplitude value to distinguish the low-frequency trend drift component and the high-frequency short-time perturbation component; Perform online clustering analysis in the multi-dimensional feature space composed of drift level, drift direction, and drift rate respectively based on the low-frequency trend drift component and the high-frequency short-time perturbation component to identify typical drift patterns; Establish and implement different compensation strategies for different typical drift patterns respectively.
[0009] As an alternative implementation, the wavelet basis function used for the wavelet transform is Symlets wavelet or Coiflets wavelet; the performing multi-resolution wavelet transform on the time-varying sequence of the drift amplitude value includes: Based on the excitation frequency of the electromagnetic flowmeter and its integer multiple harmonic frequencies, determine the scale decomposition layer number of the wavelet transform to decompose the drift amplitude sequence into wavelet subsequences corresponding to the low-frequency trend drift component and the high-frequency short-time perturbation component in the scale space; For the wavelet subsequences, perform threshold suppression and reconstruction of harmonic interference through the following steps: Perform spectrum analysis on each scale wavelet subsequence to calculate the spectrum distribution of the wavelet subsequence at each scale; Identify and locate the harmonic interference frequency positions that are integer multiples of the excitation frequency in the spectrum distribution, and determine the spectrum amplitudes corresponding to each harmonic interference frequency point; Calculate an adaptive threshold based on the spectral amplitudes corresponding to each harmonic interference frequency point, where the calculation of the adaptive threshold includes determining it according to the mean and standard deviation of the spectral amplitudes within the neighborhood of each harmonic interference frequency point; Set to zero or attenuate proportionally the spectral amplitudes exceeding the adaptive threshold at each harmonic interference frequency point to obtain a spectrum after harmonic interference suppression; Perform wavelet reconstruction respectively based on the spectrum after harmonic interference suppression to obtain a low-frequency trend drift component corresponding to the long-term trend drift and a high-frequency short-term perturbation component corresponding to the short-term perturbation.
[0010] As an alternative implementation, the identifying of typical drift patterns includes: Calculate the long-term drift rate and drift accumulation amount based on the low-frequency trend drift component to determine the long-term trend drift feature vector; Calculate the spectral energy distribution and instantaneous drift rate of the short-term perturbation based on the high-frequency short-term perturbation component to determine the short-term perturbation feature vector; Perform vector fusion of the long-term trend drift feature vector and the short-term perturbation feature vector in a four-dimensional feature space composed of drift level, drift direction, drift rate, and spectral energy to form a comprehensive drift feature vector; Input the comprehensive drift feature vector into a preset clustering model to generate a clustering result; the clustering model is a density peak-based clustering algorithm; Based on the clustering result, determine and label the typical drift patterns, where the typical drift patterns include: a progressive drift pattern caused by sensor fouling, a high-frequency perturbation pattern caused by bubble inclusion, and a sudden drift pattern caused by sensor transient failure.
[0011] As an alternative implementation, the outputting of the structural deviation score includes: Perform edge detection on the first pulse signal and the standard pulse waveform, extract the timestamp sequences of the rising edge and the falling edge respectively, and calculate the time offset of the corresponding edge to obtain the edge time deviation score; Perform point-by-point difference calculation on the amplitudes of the first pulse signal and the standard pulse waveform at the corresponding sampling moments to obtain an amplitude error sequence, and determine the amplitude error score based on the root mean square value of the amplitude error sequence; Within a preset time window, count the number of valid pulses in the first pulse signal and the standard pulse waveform respectively, calculate the pulse count difference between the two to obtain the pulse count difference score; Fuse the edge time deviation score, the amplitude error score, and the pulse count difference score with preset weighting coefficients to output the structural deviation score.
[0012] As an alternative implementation, the generating of the second pulse signal includes: Construct a target loss function based on the structural deviation score, where the target loss function includes a structural deviation score term and a drift adjustment regularization term related to the drift level; Determine an adjustment factor in the target loss function according to the drift level information, where the adjustment factor is used to dynamically adjust the update amplitude of the target loss function; Use an optimization algorithm based on the first-order gradient to iteratively update the control parameter vector in the parameter mapping function, where the optimization algorithm includes: the adaptive moment estimation algorithm and the stochastic gradient descent algorithm; Replace the corresponding parameters in the parameter mapping function with the updated control parameter vector, and re-execute the signal synthesis operation to generate the second pulse signal.
[0013] Compared with the prior art, the pulse output sensor control system for electromagnetic flowmeters proposed in this application realizes real-time acquisition and modeling of key variables such as conductivity, temperature, viscosity gradient, and signal waveform by constructing a control mechanism with closed-loop of working condition perception, state modeling, parameter generation, deviation discrimination, and feedback correction; uses the health state vector to identify the degree of system drift, and dynamically adjusts the pulse output frequency, duty cycle, and maintenance duration accordingly. Combining the loss function optimization process driven by the structural deviation score, the output pulse signal is always maintained in a highly consistent and stable state, significantly enhancing the drift tolerance and adaptive adjustment capabilities of the electromagnetic flowmeter in long-term complex operating scenarios, and avoiding the need for manual intervention and frequent shutdown calibration. Description of the Drawings
[0014] Figure 1 It is a schematic diagram of the pulse output sensor control system for electromagnetic flowmeters provided by this application; Figure 2 It is a schematic diagram of bubbles in a fluid provided by this application; Figure 3 It is a flowchart of the method for generating the working condition state vector and the health state vector provided by this application; Figure 4 It is a flowchart of the method for mapping and generating pulse control parameters based on a preset parameter mapping function provided by this application. Detailed Embodiments
[0015] Next, the technical solutions in the embodiments of this application will be clearly and completely described in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all of the embodiments.
[0016] Refer to Figure 1 As shown, it is a schematic diagram of the pulse output sensor control system for electromagnetic flowmeters provided by this application. The system includes: The acquisition module 10 is used to acquire the working condition data of the target fluid to be measured under the current measurement working condition; the working condition data includes: the conductivity value, temperature value, viscosity gradient index of the target fluid to be measured, the change rate of the output pulse signal amplitude of the target fluid to be measured within a preset time window, and the induced electromotive force waveform characteristics; The modeling module 20 is used to perform multi-dimensional state modeling based on the working condition data to generate a working condition state vector and a health state vector; identify system state drift based on the health state vector to generate drift information; the health state vector is a state description vector obtained by comparing and calculating the working condition state vector with the historical health distribution; The generation module 30 is used to receive the working condition state vector, health state vector and drift information, and map and generate pulse control parameters based on a preset parameter mapping function; perform signal synthesis based on the pulse control parameters to generate a first pulse signal; The discrimination module 40 is used to perform waveform alignment, edge detection and pulse count comparison on the first pulse signal using a standard pulse waveform, and output a structural deviation score; The output control module 50 is used to receive the structural deviation score, update the control parameter vector in the parameter mapping function according to a preset loss function and in combination with the drift information to obtain an updated parameter mapping function; re-perform signal synthesis operations based on the updated parameter mapping function to generate a second pulse signal, and output the second pulse signal to the external interface of the electromagnetic flowmeter.
[0017] This application aims to improve the accuracy and stability of the pulse output signal of the electromagnetic flowmeter under various complex working conditions. The system can real-time sense the changes in the state of the fluid to be measured and the measurement environment, and dynamically adjust the pulse output parameters through an intelligent modeling and feedback control mechanism to adapt to and compensate for the influence brought by various interference factors, so as to ensure that the electromagnetic flowmeter outputs high-quality pulse signals.
[0018] Regarding the above acquisition module 10: The acquisition module 10 in this embodiment is used to obtain multiple working condition data of the target fluid to be measured under specific measurement working condition conditions. First, the acquisition module 10 uses a conductivity sensor installed in the pipeline measurement area of the electromagnetic flowmeter to detect the conductivity value of the target fluid to be measured in real time. In the specific detection process, the two measurement electrodes of the conductivity sensor are directly in contact with the target fluid to be measured. Through a constant current excitation method, a stable induced voltage signal is generated inside the target fluid to be measured, and an accurate conductivity value is calculated based on this induced voltage signal. This value is the conductivity value in the working condition data.
[0019] Secondly, the acquisition module 10 uses the temperature sensors installed on the outer wall of the pipeline to measure the temperature value of the target fluid to be measured in real time. During the measurement process, the temperature sensors are in close contact with the pipeline surface. The measurement end of the temperature sensors senses the temperature change of the pipeline wall in real time, and then determines the actual temperature value of the target fluid based on the pre-determined pipeline-fluid temperature relationship function to ensure the measurement accuracy. Among them, the pipeline-fluid temperature relationship function can select an empirical interpolation model, a piecewise linear heat conduction model, or a heat transfer approximation model constructed based on finite element simulation according to different measurement conditions. The empirical interpolation model can be realized through the calibration curve of the preset flow rate and heat transfer coefficient. The piecewise linear model is applicable to the conditions of low flow rate and stable pipeline wall thickness. The heat transfer approximation model is applicable to the precise measurement scenarios with high requirements for temperature sensitivity.
[0020] Subsequently, in order to obtain the viscosity gradient index of the target fluid, the acquisition module 10 installs flow rate sensors at at least two different positions in the axial direction of the pipe section to measure the flow rate values at these two positions in real time, and transmits the measured multiple flow rate values to the data processing unit inside the module in real time. The data processing unit calculates the flow rate difference between multiple positions in real time, and then, according to the preset viscosity gradient calculation method, clearly converts the calculated flow rate difference into the viscosity gradient index of the target fluid to be measured. The viscosity gradient calculation method can adopt a flow rate difference normalization model, a local shear rate model, or a modified Reynolds number model. The flow rate difference normalization model estimates the viscous difference by normalizing the flow rate difference at multiple points into the velocity gradient within a unit distance; the local shear rate model combines the change trend of the velocity profile to estimate the shear deformation degree within the boundary layer and is applicable to non-Newtonian fluids; the modified Reynolds number model calculates the change trend of the fluid viscosity characteristics based on the joint calculation of the instantaneous velocity and temperature and is applicable to the dynamic temperature and pressure change scenarios.
[0021] Meanwhile, the acquisition module 10 is connected to the pulse output interface of the electromagnetic flowmeter. Through the interface, the acquisition module 10 continuously collects the amplitude data sequence of the output pulse signal within the preset time window in real time, and records the sampling time corresponding to each data point collected with the internal high-precision clock. Subsequently, the data processing unit inside the module calculates the amplitude change rate through the least squares fitting calculation method based on the sampled amplitude data sequence and the corresponding time stamps, so as to determine the output pulse signal amplitude change rate index within the preset time window as one of the input variables for subsequent state modeling.
[0022] Finally, to obtain the waveform characteristics of the induced electromotive force, the acquisition module 10 is connected to the excitation electrode port of the electromagnetic flowmeter, and the waveform data of the induced electromotive force output by the excitation electrode is collected in real time through the high-speed analog-to-digital conversion sampling unit set inside. After the acquisition is completed, the data processing unit inside the module performs point-by-point analysis based on the collected waveform data, extracts the frequency characteristics, amplitude characteristics, and fluctuation interval characteristics of the induced electromotive force waveform, and clearly outputs these waveform characteristic values as part of the working condition data, and further inputs them into the subsequent multi-dimensional state modeling process.
[0023] It should be noted that the viscosity gradient index reflects the change rate of fluid viscosity in spatial distribution, and its dimension is reciprocal per second , corresponding to the degree of change in velocity per unit distance. In industrial water treatment or mild chemical slurry scenarios, this index generally falls between 0.1 and ; for high-viscosity oil products or resin circulation pipelines, it can extend to or so.
[0024] For different fluid characteristics, the viscosity gradient index can be obtained through one of the following three models: The flow velocity difference normalization model is applicable to Newtonian fluids or clear water systems with gentle viscosity changes, and its output value is proportional to the measured point velocity difference; the local shear rate model is applicable to non-Newtonian fluids (such as polymer solutions) and can more accurately reflect the shear effect caused by the velocity profile within the fluid boundary layer; the modified Reynolds number model is applicable to scenarios with significant dynamic changes in temperature and pressure (such as the reflux pipe of a high-temperature reactor), and captures the minute fluctuations in viscosity characteristics under complex working conditions by comprehensively considering the temperature and the instantaneous velocity change trend.
[0025] In the flow velocity difference normalization model, the velocity difference can be set as the velocity difference between two points within the unit distance of the pipe diameter, and its calibration coefficient is generally between 0.5 and 1.5; in the local shear rate model, the shear rate range is usually within ; in the modified Reynolds number model, the characteristic Reynolds number can fluctuate between 500 and 5000, and is converted in combination with the temperature correction coefficient of 0.8 to 1.2.
[0026] In an optional implementation manner, the acquisition module 10 further includes specific acquisition paths and processing flows for implementing the viscosity gradient index, the change rate of the output pulse signal amplitude, and the waveform characteristics of the induced electromotive force.
[0027] To obtain the viscosity gradient index, the acquisition module 10 installs more than two flow velocity sensors at different axial positions of the pipe segment to be measured. The flow velocity sensors can be electromagnetic, ultrasonic Doppler, or micro-thermal sensors, and are used to measure the local flow velocity values at their respective positions in real time. The module obtains the measured values of each sensor through a time synchronization mechanism and calculates their velocity differences. Combining parameters such as the relative distance between each measuring point, the cross-sectional position where the measuring point is located, and the pipe cross-sectional area, the module derives the changing trend of the velocity gradient per unit length according to a preset viscosity gradient calculation model, and generates a viscosity gradient index for characterizing the spatial distribution characteristics of the current fluid viscosity accordingly.
[0028] To extract the amplitude change characteristics of the output pulse signal, the acquisition module 10 establishes a stable connection with the digital output interface of the electromagnetic flowmeter, and based on the internally configured high-speed sampling module, obtains the instantaneous amplitude data sequence of the output pulse signal within a preset time window at a fixed sampling interval. The acquisition module 10 sets the sampling window length (such as the integral cycle time of multiple excitation cycles), performs a linear trend estimation on the sampled amplitude data sequence, and extracts the average change slope of the pulse signal during this period as the amplitude change rate index of the output pulse signal, which is used to reflect the signal dynamic characteristics and output stability.
[0029] To extract the time-domain and frequency-domain characteristics of the induced electromotive force, the acquisition module 10 can be connected to the output path of the excitation electrode in a manner of analog coupling or digital parallel connection, use the analog-to-digital conversion unit to sample the induced electromotive force at a high frequency, and input the sampling result into the waveform feature extraction module. During the feature extraction process, the system constructs a complete waveform cycle based on the sampling points and calculates statistics such as the main frequency, average amplitude, maximum amplitude, and fluctuation range, which are used to characterize the signal stability, response amplitude, and disturbed state. Furthermore, a complete waveform feature vector of the induced electromotive force is formed and input into the modeling module 20 for subsequent processing.
[0030] Regarding the above-mentioned modeling module 20: As an alternative implementation, please refer to Figure 3 , which is the flow chart of the method for generating the working condition state vector and the health state vector provided by this application. The method includes steps S101 to S103, where: S101: Perform numerical normalization processing on the conductivity value, temperature value, viscosity gradient index, output pulse signal amplitude change rate, and induced electromotive force waveform characteristics respectively, and construct the working condition state vector through a vectorized splicing method; S102: Based on historical operating condition data, perform data clustering analysis in a preset working condition space to construct a historical health distribution; S103: Calculate the similarity between the operating condition state vector and the historical health distribution, determine the degree of health deviation according to a preset drift threshold, and construct the health state vector based on the degree of health deviation.
[0031] The modeling module 20 in this embodiment is used to perform engineering processing on various operating condition data output by the acquisition module 10 to generate specific and clear operating condition state vectors and health state vectors, and identify whether there is a drift phenomenon in the current system operating state that deviates from the healthy area.
[0032] Specifically, the modeling module 20 first receives five types of real-time numerical operating condition data from the acquisition module 10, including conductivity value, temperature value, viscosity gradient index, change rate of output pulse signal amplitude, and characteristic value of induced electromotive force waveform. These data are transmitted to the normalization processing unit of the modeling module 20 in floating-point format. The normalization processing unit pre-stores the minimum and maximum values of each item of data accumulated during the historical operation process. During the processing, the normalization processing unit linearly scales each real-time value according to the corresponding historical value range to ensure that the converted data falls within the unified range of 0 to 1, so as to eliminate the influence of different measurement units and value ranges. After the above normalization operation is completed, the module arranges these five normalized single values in sequence to form a one-dimensional vector to clearly represent the current operating condition state.
[0033] Next, the modeling module 20 retrieves the health state reference database established in advance in the storage unit. The health state reference database is a set of typical health states obtained based on a large number of historical data samples through a preselected clustering analysis algorithm (such as K-means clustering or density clustering method). Each type of health state is stored as a set of normalized numerical vectors, representing the typical characteristic patterns of this type of state. The module uses the internally embedded distance calculation program to perform element-by-element difference calculation on the current operating condition state vector and the representative vector of each health state category in turn, and further calculates the square root of the sum of squares of each difference to determine the closeness of the current state to each health category.
[0034] The modeling module 20 further compares the calculated distance values with a preset drift threshold. If the distance values between the current operating condition state and all health categories are greater than the preset threshold, it indicates that the current operating condition may have an abnormal state shift, and the system state needs to be marked as a drift state; if the distance value between a certain health category and the current state is less than or equal to the preset threshold, it is considered that the system is still within the normal health range corresponding to this category.
[0035] If the system state is marked as a drifting state, the level judgment unit of the modeling module 20 will further calculate the specific gap between the current state and the health state category with the closest distance. According to the degree to which the gap value exceeds the threshold, the severity level of the drift is divided. The specific level division can be set as "slight drift", "moderate drift" or "severe drift" to intuitively represent the deviation degree of the system operating state.
[0036] Finally, the modeling module 20 clearly outputs at least the following three items of information: The working condition state vector at the current measurement moment (a one-dimensional real number array containing five standardized values); The health state vector (the standardized value vector corresponding to the health state category closest to the current state); The drift information (the level identifier indicating whether there is a drift in the current state and the severity of the drift).
[0037] Regarding the above-mentioned generation module 30: As an alternative implementation, please refer to Figure 4 , which is the flowchart of the method for mapping and generating pulse control parameters based on a preset parameter mapping function provided by this application. The method includes steps S201 to S204, where: S201: Fuse and splice the working condition state vector, the health state vector, and the drift information into a main mapping input vector, and separately input the viscosity gradient index into the modulation sub-network. The modulation sub-network includes at least one neural layer with a non-linear activation function for generating a modulation factor vector; S202: Input the main mapping input vector into a multi-layer perceptron main mapping network. The main mapping network includes at least two hidden layers, and each hidden layer includes multiple neurons with non-linear activation functions; S203: Introduce a modulation operation in the middle hidden layer of the main mapping network. The modulation operation includes performing element-wise multiplication or affine transformation on the modulation factor vector and the output of the current hidden layer to form an intermediate feature representation dynamically modulated by the viscosity gradient; S204: Generate a control parameter vector for characterizing the pulse frequency, duty cycle, and maintenance duration based on the output of the main mapping network after modulation.
[0038] The generation module 30 in this implementation is mainly used to receive the working condition state vector, the health state vector, and the drift information output by the modeling module 20, and based on these input data, execute the calculation process of the pulse control parameters. The generation module 30 internally includes two sub-structures: a main mapping network and a modulation sub-network, which work together to dynamically output the key parameters for controlling the pulse output of the electromagnetic flowmeter, including: frequency, duty cycle, and maintenance duration.
[0039] Exemplarily, the generation module 30 first receives three input contents: the first is a working condition state vector with a length of 5, representing the standardized working condition information at the current measurement moment; the second is a health state vector, which can be the standardized vector representation of the historical health state most similar to the current working condition; the third is drift information, mainly including whether there is a drift in the system state and the corresponding drift level label.
[0040] The generation module 30 first splices the working condition state vector and the health state vector in the same data channel to obtain a set of fused vectors with doubled length. Subsequently, the drift level label is converted into a numerical representation and spliced with the above-mentioned fused vector together, finally forming the input vector of the main mapping network. This input vector is fed into a multi-layer perceptron structure, which contains more than two neural layers, the number of nodes in each layer is preset, and the activation function type can be ReLU or Tanh, determined according to the configuration item. The main mapping network is used to extract the deep combination relationship of state features and output a set of intermediate feature expressions.
[0041] In parallel with the main mapping network, the modulation sub-network specifically receives the single input variable of the viscosity gradient index and processes it through several neural layers with non-linear transformation capabilities, and outputs a modulation factor vector. This modulation factor vector will be used as an adjustment parameter and introduced into the calculation process of the hidden layer of the main mapping network.
[0042] The specific processing method is: after the output of the intermediate hidden layer of the main mapping network is completed, perform an element-wise multiplication or affine transformation operation with the modulation factor vector, so that the intermediate features are dynamically adjusted by the viscosity gradient factor before being passed to the next layer, enhancing the model's response ability to changes in fluid shear properties.
[0043] After completing the above feature fusion and modulation, the main mapping network will output a set of floating-point values, corresponding to the three output control parameters of the control pulse frequency, duty cycle, and maintenance duration respectively. The generation module 30 encapsulates these three parameters into a control parameter vector and transmits it to the signal synthesis unit for subsequent generation of the first pulse signal.
[0044] Exemplarily, the main mapping network in the parameter mapping function can adopt a multi-layer perceptron structure, including an input layer, two hidden layers, and an output layer, and the full connection structure is adopted between each layer; It is recommended to set 16 to 64 neurons in each hidden layer; the modulation sub-network is a separate shallow neural network, including an input layer (receiving viscosity gradient indicators), a hidden layer (such as 8 neurons), and an output layer (outputting a modulation factor vector). During the initial training of the network, historical labeled samples are used as supervised learning data, and the goal is to minimize the structural deviation score between the historically measured pulse signal and the standard template; the loss function can be defined as a combination of weighted mean squared error (MSE) and the structural deviation score, where the structural deviation score is introduced as an auxiliary supervision quantity; the weight range of the drift level guiding regularization term can be set from 0.1 to 0.5 and adjusted dynamically according to the training stage.
[0045] The training dataset includes no less than 5000 groups of historical measurement samples, and each group of samples contains: 5 types of operating condition data (conductivity, temperature, viscosity gradient, amplitude change rate, induction electromotive force characteristics), historical health vectors, labeled pulse control parameters, and the score value between the actual output signal and the target template; The data should cover different fluid types, flow rate ranges, and typical drift situations, such as sensor aging, temperature difference disturbances, etc.
[0046] As an alternative implementation, the control parameters can set accuracy limits and range boundaries. For example, the adjustable range of frequency is from 1 Hz to 500 Hz, the duty cycle range is from 5% to 90%, and the duration can be limited according to the system response time to avoid physical overload or error accumulation.
[0047] Finally, the control parameters output by the generation module 30 will directly determine the morphological characteristics of the first pulse signal generated by the signal synthesis circuit in the next stage. This first pulse signal will be sent to the discrimination module 40 for structural consistency evaluation, and parameter updates will be performed according to the feedback deviation, thereby realizing closed-loop regulation control.
[0048] Regarding the above-mentioned discrimination module 40: The discrimination module 40 in this implementation is used to perform structural analysis on the first pulse signal output by the generation module 30 and make multi-dimensional comparisons with the standard pulse waveform to output a structural deviation score describing the degree of signal difference, which serves as the key input basis for subsequent parameter adjustment.
[0049] Specifically, the discrimination module 40 first receives the first pulse signal from the generation module 30. This signal is a digital-form time-series signal stream generated by the signal synthesis unit based on the control parameter vector. The discrimination module 40 caches the complete pulse signal sequence through an internal high-speed cache unit and resamples it in segments to ensure that the waveform comparison has a unified starting point, sampling rate, and period boundary in the time dimension.
[0050] Next, the discrimination module 40 loads a reference waveform template that matches the current working condition from a standard pulse template library preset within the system. The standard template can be selected based on the similarity between the historical health status vector and the current measurement working condition to ensure that the comparison object is representative in terms of parameter matching. The standard template is a set of verified ideal signal sequences that record the key structural parameters of the reference pulse waveform, including typical rise time, fall time, peak amplitude, and duration, etc.
[0051] Exemplarily, the discrimination process is divided into three dimensions: Edge time deviation detection: The discrimination module 40 first performs edge detection operations on the first pulse signal and the standard waveform. The time differentiator is used to locate the rise and fall edge positions in the signal, and the edge timestamp sequence within each pulse period is extracted. Subsequently, the time offsets at the corresponding edge points between the actual signal and the standard pulse waveform are calculated respectively, and the average deviation time is statistically calculated as the basis for the edge time deviation score.
[0052] Amplitude error statistics: The module aligns the actual pulse waveform with the standard template at the same sampling points and performs point-by-point amplitude difference calculations to obtain a complete amplitude error sequence. By performing an average variance analysis on this error sequence within a set time window, an amplitude error score is generated to evaluate the consistency between the signal amplitude and the expected output.
[0053] Pulse count comparison: The module respectively counts the number of valid pulses in the actual pulse signal and the standard template within the current time window. A "valid pulse" is defined as a complete cycle signal whose amplitude and duration both exceed the minimum detection threshold. After the statistics, the difference in the number of pulses between the two is calculated as the pulse count difference score, which reflects whether there are phenomena such as signal loss, excess, or jitter in the current signal.
[0054] The scoring items in the above three dimensions will be fused according to the weighted coefficients preset by the system. The fusion process is completed by the structural score calculation unit, and the final structural deviation score is output. The setting of the weighted coefficients can be configured as needed. For example, in high-precision application scenarios, the weight of the amplitude error term can be enhanced, and in scenarios sensitive to response rate, the weight of the edge time term can be increased.
[0055] The structural deviation score is in the form of a single floating point number. The higher the value, the greater the deviation degree between the actual signal and the ideal standard. This scoring result will be directly transmitted to the output control module 50 for subsequent update and optimization of the control parameter mapping path.
[0056] Regarding the above output control module 50: In this embodiment, the output control module 50 receives the structural deviation score output by the discrimination module 40, and combines the system drift information provided by the modeling module 20 to perform an update operation on the parameter mapping function in the generation module 30. This module aims to achieve dynamic adjustment of pulse control parameters and closed-loop optimization of the signal output path, so as to enhance the output consistency and working condition adaptation ability of the electromagnetic flowmeter during long-term operation.
[0057] In specific implementation, the output control module 50 obtains the structural deviation score from the discrimination module 40, and this score is a quantitative index for evaluating the difference between the current pulse signal and the standard template. At the same time, it obtains the drift level information of the current system state from the modeling module 20, including structured state contents such as whether there is drift, the drift direction, and its severity. The state perception logic inside the output control module 50 dynamically adjusts the control strategy according to the change of the drift level. For example, when a relatively serious drift is detected, the update range is relaxed and the adjustment rate is increased to quickly respond to the change of the system state.
[0058] After receiving the score and drift information, the output control module 50 constructs a target loss function inside for guiding parameter update. This loss function consists of two parts. One part is the structural deviation score itself, which directly reflects the overall deviation level of the current pulse signal. The other part is a drift adjustment regularization term related to the drift level, which is used to suppress the error accumulation or optimization oscillation caused by long-term system drift. The output control module 50 comprehensively evaluates the above two parts according to the set adjustment mode and historical state, constructs an adjustable optimization objective function, and performs parameter adjustment accordingly.
[0059] The output control module 50 integrates a multi-strategy parameter optimizer for iteratively updating the parameter mapping function inside the generation module 30. The optimizer supports the combined use of the adaptive moment estimation method and the gradient descent method, and can be flexibly switched in the scenario of accuracy priority or speed priority. When the optimizer receives the target loss function, it calculates the update step size of the control parameter vector based on the current parameter gradient direction and completes the parameter replacement operation.
[0060] After the update is completed, the output control module 50 sends the new control parameter vector to the generation module 30, instructing it to re-execute the signal synthesis logic to generate the second pulse signal. This signal has been corrected at the parameter level according to the deviation score and the system drift degree compared with the first pulse signal, and has higher consistency and stability. The second pulse signal is finally sent by the output control module 50 to the external interface of the electromagnetic flowmeter.
[0061] In this way, the acquisition module 10 continuously sends out five types of "fundamental environmental quantities", such as the conductivity, temperature, viscosity gradient, pulse amplitude change rate, and induced electromotive force waveform, which are truly generated by the fluid during operation, enabling the subsequent algorithms to always have the original basis synchronized with the current working conditions. As long as these working condition quantities slowly shift over time (for example, the conductivity slowly decreases due to electrode scaling, the viscosity gradient gradually increases as the slurry thickens, and the amplitude of the induction waveform drifts due to periodic temperature drift), the acquisition module 10 can perceive such changes in real time. Therefore, it is the first perception entry for detecting long-term drifts.
[0062] The modeling module 20 uniformly normalizes the five types of data collected and arranges them into a working condition state vector with a fixed length, and then compares the distance between it and the historical health distribution. When the distance exceeds the threshold, it outputs the drift level; the greater the distance, the higher the level. In this way, regardless of whether the drift source is the physical properties of the fluid or the aging of the measurement chain, it is quantified into a "drift weight" that can directly participate in subsequent decisions, ensuring that the system has a measurable sensitivity to "slow changes".
[0063] The generation module 30 uses the latest working condition state vector, health state vector, and drift level. Through the combined action of the main mapping network and the viscosity gradient modulation sub-network, it immediately converts these "offset signs" into three parameters: pulse frequency, duty cycle, and maintenance duration. The design of having the viscosity gradient go through a separate modulation branch enables the pulse width or duty cycle to actively stretch or compress when the fluid thickens or undergoes stratified shear, thereby counteracting the measurement phase error caused by flow field distortion; while the drift level participates in the input of the main mapping network, allowing long-term trend changes to directly change the target value of the parameter output, achieving "self-correction with drift".
[0064] The discrimination module 40 aligns each pulse of the newly generated first pulse signal with the standard template under the same working conditions, compares the time difference, amplitude difference, and counts the number of pulses, and synthesizes a structural deviation score from three quantitative scores. This score is an immediate physical examination of the "parameter compensation effect": if the compensation is insufficient, the edge time or amplitude deviation will increase; if there is overcompensation, the pulse count difference will be enlarged. The higher the score, the greater the remaining error, and the system needs to update the control parameters more aggressively.
[0065] The output control module 50 receives the structural deviation score and writes the drift level as a regularization factor into the target loss. In the early stage of slow drift, the score is small and the regularization proportion is high, so the parameter adjustment range is limited, which can avoid jitter. When entering the medium and severe drift area, both the score and the level are high, and the regularization term instead encourages larger step updates, enabling the control parameters to quickly catch up with the accumulated error. The updated parameters immediately drive the generation module 30 to resynthesize and output the second pulse signal, thus completing a small closed-loop of "measurement - judgment - adjustment - re-measurement" during operation. The system continuously loops this closed-loop, and when running for a long time, the drift amount introduced by fluid property changes or sensing chain aging can be suppressed within the threshold, maintaining the amplitude, timing, and count stability of the pulse output, and solving the core technical problem that electromagnetic flowmeters are prone to drift during long-term measurement but difficult to correct in real time.
[0066] As an alternative implementation, the generation of drift information further includes: Performing multi-resolution wavelet transform on the time-varying sequence of drift amplitude values to distinguish the low-frequency trend drift component and the high-frequency short-term disturbance component; Performing online clustering analysis in the multi-dimensional feature space composed of drift level, drift direction, and drift rate respectively based on the low-frequency trend drift component and the high-frequency short-term disturbance component to identify typical drift patterns; For different typical drift patterns, different compensation strategies are established and implemented respectively.
[0067] As an alternative implementation, the wavelet basis function used in the wavelet transform can be Symlets wavelet or Coiflets wavelet; the performing of multi-resolution wavelet transform on the time-varying sequence of drift amplitude values includes: Based on the excitation frequency of the electromagnetic flowmeter and its integer multiple harmonic frequencies, determining the scale decomposition layer number of the wavelet transform to decompose the drift amplitude sequence into wavelet subsequences corresponding to the low-frequency trend drift component and the high-frequency short-term disturbance component in the scale space; For the wavelet subsequences, performing threshold suppression and reconstruction of harmonic interference through the following steps: Performing spectrum analysis on each scale wavelet subsequence to calculate the spectrum distribution of the wavelet subsequence at each scale; Identifying and locating the harmonic interference frequency positions that are integer multiples of the excitation frequency in the spectrum distribution, and determining the spectrum amplitudes corresponding to each harmonic interference frequency point; Calculating an adaptive threshold based on the spectrum amplitudes corresponding to each harmonic interference frequency point, and the calculation of the adaptive threshold includes determining according to the mean and standard deviation of the spectrum amplitudes in the neighborhood of each harmonic interference frequency point; Setting to zero or attenuating proportionally the spectrum amplitudes exceeding the adaptive threshold at each harmonic interference frequency point to obtain the spectrum after harmonic interference suppression; Wavelet reconstruction is performed separately on the spectra after harmonic interference suppression to obtain a low-frequency trend drift component corresponding to the long-term trend drift and a high-frequency short-term perturbation component corresponding to the short-term perturbation.
[0068] Among them, the long-term trend drift refers to the slow and progressive changes that occur continuously in the drift amplitude sequence within a relatively long time window, usually manifested as the continuous monotonic increase or decrease of the average amplitude value, the stable fluctuation range but the displacement of the central value, etc. In this system, the determination basis of the long-term trend drift can include: within the past 30 minutes or longer period, the offset trends in multiple resampled segments continuously show the same direction, and the average change amplitude of a single segment reaches the set threshold, such as more than 0.01 unit amplitude / minute. In actual operation, this type of drift is mostly related to slow-changing working conditions such as electrode scaling, fluid component changes, and equipment thermal deformation.
[0069] The short-term perturbation refers to the sudden and discontinuous drift fluctuations that occur within a relatively short time window, which are characterized by short duration, high frequency, and obvious amplitude jumps in the time domain.
[0070] Exemplarily, in engineering implementation, when it is detected that the drift amplitude suddenly jumps within a single sampling window and the duration is less than 5 seconds, or an abrupt increase in energy is captured in the high-frequency scale component, it can be determined as a short-term perturbation event. This type of perturbation usually originates from unstable factors such as bubble inclusions, external interference signals, and the passage of foreign objects in the liquid, and has the characteristics of high frequency, non-periodicity, and strong randomness.
[0071] When performing wavelet decomposition and feature extraction, it is possible to automatically determine whether a segment of data belongs to the long-term trend drift or the short-term perturbation according to the signal energy distribution and change trend at different scales, and map them to different drift components respectively, so as to achieve an accurate classification response for subsequent clustering and compensation strategies.
[0072] The long-term drift rate is used to quantitatively describe the average change trend of the drift amplitude within a relatively long time window, and is one of the indicators for judging whether the system state is in a slow offset state.
[0073] Exemplarily, the system samples the drift amplitude values at fixed time intervals (such as every 5 minutes) and records multiple consecutive sampling points within a sliding time window. The long-term drift rate can be calculated by comparing the drift amplitude difference between the current time point and the start point of the window, and combining the time span of this period. This rate can reflect whether the drift is in a slow accumulation state or has approached saturation or stability.
[0074] In practical engineering applications, the unit of the long-term drift rate can be taken as the amplitude unit per minute or the percentage amplitude per hour. For example, if the average increase in the structural deviation score of an electromagnetic flowmeter exceeds 0.1 per hour, it is regarded as a medium-level long-term drift rate. The system can set multiple drift rate level thresholds to determine whether to trigger the classification of the progressive drift mode in combination with the drift accumulation.
[0075] In this embodiment, after obtaining the health status vector, a drift mode recognition sub-module is further included, which is used to extract two types of signal components, namely long-term trend and short-term disturbance, from the drift amplitude time series output by the modeling module 20, and to identify the drift mode in real time based on the characteristics of both, so as to adopt different compensation strategies subsequently.
[0076] The drift mode recognition sub-module first inputs the continuous time-varying sequence of drift amplitudes into the multi-resolution wavelet transform unit. This unit selects Symlets wavelets or Coiflets wavelets, and determines the decomposition level according to the known characteristics of the excitation frequency of the electromagnetic flowmeter and its harmonics. After wavelet transform, the low-frequency subsequence is reconstructed into a low-frequency trend drift component, which is used to reflect the slow drift caused by sensor aging, electrode fouling or slow change of the flow field, etc.; the high-frequency subsequence is reconstructed into a high-frequency short-term disturbance component, which is used to capture instantaneous anomalies such as bubble inclusions, transient turbulence or electromagnetic interference.
[0077] Subsequently, the drift mode recognition sub-module extracts three-dimensional drift features from the trend drift component and the short-term disturbance component respectively, including the drift level (given by the modeling module 20), the drift direction (determined by the increasing or decreasing trend of the amplitude sequence), and the drift rate (determined by the amplitude change rate), and maps each subsequence into a three-dimensional feature vector. The online clustering unit performs a density peak-based clustering algorithm on these feature vectors to classify the current component into the predefined typical drift modes in real time. The typical drift modes at least include: the "progressive drift mode" dominated by slow change trends, the "high-frequency disturbance mode" dominated by high-frequency mutations, and the "sudden drift mode" dominated by sudden anomalies.
[0078] After identifying the specific drift mode, the compensation strategy execution unit calls the corresponding compensation logic according to different modes. If the current mode is the progressive drift mode, a continuous and stable parameter adjustment strategy is adopted, and the control parameters output by the generation module 30 are increased or decreased in small steps in each update cycle to smoothly track the slow drift; if the current mode is the high-frequency disturbance mode, the alarm prompt module is triggered, and at the same time, the pulse frequency or duty cycle is briefly adjusted in the subsequent pulse generation to filter out transient interference; if the sudden drift mode is detected, a fast response strategy is executed, and the alignment of the pulse and the standard template is quickly restored through one or more parameter refreshes, and the event is recorded in the system log for subsequent maintenance.
[0079] The above method combines wavelet decomposition with online clustering to play a dual resolution role. On the one hand, it distinguishes the drift components in different frequency bands, and on the other hand, it accurately identifies the drift category in the multi-dimensional feature space and implements targeted compensation or alarm, thereby significantly improving the electromagnetic flowmeter's adaptive correction capability for slow drift and short-term disturbances in long-term operation.
[0080] For example, on an actual industrial cooling water circulation pipeline, the electromagnetic flowmeter worked continuously for three months. The system enabled the drift pattern recognition submodule and recorded the complete adjustment process. The following is an example of a typical scenario: Before the start of the morning shift, the output of the electromagnetic flowmeter remained stable. About four hours into the peak production period, slight scaling appeared on the electrode surface, causing the drift amplitude value given by the modeling module 20 to slowly increase in the positive direction. The drift pattern recognition submodule collects drift amplitude sequences at intervals of 5 minutes and calls the wavelet transform every thirty minutes. The transformation results show that there are continuously rising low-frequency components in the lowest two levels of scale, while the high-frequency subsequences fluctuate very little. The online clustering unit automatically classifies the current three-dimensional feature vector as a "progressive drift mode". Based on this, the compensation strategy execution unit reduces the pulse frequency by 1 Hz each time and increases the duty cycle by 0.5% simultaneously. After four iterations, the structural deviation score fed back by the discrimination module 40 returns to the normal range.
[0081] See also Figure 2 , is a schematic diagram of bubbles in a fluid provided by the present application, which is a section of a local fluid channel intercepted along the axial direction of the pipeline. The pipeline cross section contains a number of irregular bubbles of various shapes, and the bubbles are distributed in the main body of the fluid. The arrow indicates the direction of fluid flow. When the afternoon shift was switched, a small amount of air was mixed into the production tank, and irregular bubbles appeared in the fluid. Within a few minutes, the drift amplitude sequence produced dense spikes, and the wavelet transform obtained high-frequency components with significantly amplified amplitudes at the highest two levels of scale. Based on this, the online clustering unit classifies the feature vector as a "high-frequency disturbance mode". The system immediately triggers local sound and light prompts and writes the alarm information into the maintenance log. At the same time, in the next three rounds of pulse generation, the duty cycle upper limit is temporarily increased and the maintenance time is shortened, so that the waveform peak is insensitive to the transient attenuation caused by bubbles. Ten minutes later, the bubbles dissipated, and the structural deviation score fed back by the discrimination module 40 was restored.
[0082] During the evening shift, the power supply in the workshop suddenly dropped and then quickly resumed. The excitation link of the electromagnetic flowmeter was briefly abnormal, and the overall output signal shifted significantly. At this time, the drift amplitude sequence jumped several times within a short period, and the wavelet decomposition also detected a single pulsed large disturbance in the high-frequency channel. The clustering unit marked it as the "sudden drift mode". The compensation strategy execution unit immediately performed a full-scale parameter refresh: the pulse frequency was restored to the daily benchmark, the duty cycle and the maintenance duration were synchronously returned to the default median value, and a maintenance event report was sent to the host computer. In less than two minutes, the structural deviation score was pulled back to the normal range.
[0083] As can be seen from the above specific scenario, the wavelet decomposition first separates the slow-varying trend from the transient disturbance, the online clustering then classifies different offset behaviors into corresponding modes, and the compensation strategy immediately takes measures such as small-step steady adjustment, rapid alarm or one-time forced correction according to the mode differences, so as to maintain the time consistency and amplitude stability of the pulse output for a long time during continuous operation.
[0084] As an alternative implementation, the drift mode recognition sub-module can select the Discrete Meyer Wavelet (abbreviated as dmey) to replace Symlets or Coiflets to further improve the separation accuracy of the excitation harmonics and transient interference and reduce the reconstruction artifacts.
[0085] In this implementation, the multi-resolution wavelet transform unit first configures the wavelet basis type as dmey, and combines the calibration data of the excitation frequency of the electromagnetic flowmeter and its integer multiple harmonics to pre-determine the corresponding decomposition layer number. After the drift amplitude time series is input, the module calls the open-source or embedded dmey decomposition routine to decompose the time series into wavelet subsequences at multiple scales.
[0086] For each subsequence marked as the excitation harmonic component, the module performs a fast spectrum analysis: in the spectrum distribution of the subsequence, the average value of the amplitudes in the neighborhood window plus twice the standard deviation is used as the threshold, and the frequency components near the harmonic center and with amplitudes exceeding this threshold are directly set to zero, and the components slightly higher than the threshold but not reaching twice the standard deviation are attenuated point by point according to a preset ratio of 0.6 to 0.8. After the harmonic suppression is completed, the system sequentially calls the inverse wavelet transform for all scale subsequences to reconstruct the low-frequency trend drift component and the high-frequency short-time disturbance component without harmonics respectively.
[0087] Compared with other wavelet bases, the Discrete Meyer Wavelet has a smoother frequency domain response and better symmetry, can avoid the energy leakage between decomposition layers while maintaining the boundary smoothness, and thus obtain cleaner trend and disturbance signals in the subsequent three-dimensional or four-dimensional drift feature extraction stage.
[0088] After the DMEY reconstruction is completed, the drift mode recognition sub-module extracts features such as drift level, drift direction, and drift rate according to the above-mentioned process, and inputs them into the online clustering unit based on density peaks to identify typical categories such as "progressive drift mode", "high-frequency disturbance mode", and "sudden drift mode". The compensation strategy execution unit then calls adjustment logics such as small-step smoothing update, rapid alarm, or one-time full-scale reset according to different modes.
[0089] In this way, by introducing the discrete Meyer wavelet, the interference of excitation harmonics and signal boundary effects on drift recognition can be significantly reduced, and the discrimination accuracy and robustness of the system for slow-varying trends and transient disturbances can be improved, so as to more reliably maintain the timing consistency and amplitude stability of the pulse output signal of the electromagnetic flowmeter during long-term operation.
[0090] As an alternative implementation, the recognition of typical drift modes includes: Calculating the long-term drift rate and drift accumulation based on the low-frequency trend drift component to determine the long-term trend drift feature vector; Calculating the spectral energy distribution and instantaneous drift rate of short-term disturbances based on the high-frequency short-term disturbance component to determine the short-term disturbance feature vector; Fusing the long-term trend drift feature vector and the short-term disturbance feature vector in the four-dimensional feature space composed of drift level, drift direction, drift rate, and spectral energy to form a comprehensive drift feature vector; Inputting the comprehensive drift feature vector into a preset clustering model to generate a clustering result; the clustering model is a density-peak-based clustering algorithm; Based on the clustering result, determining and marking typical drift modes, where the typical drift modes include: progressive drift mode caused by sensor scaling, high-frequency disturbance mode caused by bubble inclusion, and sudden drift mode caused by sensor transient failure.
[0091] In specific implementation, after the basic wavelet decomposition is completed, the drift mode recognition sub-module further performs targeted processing on each decomposition layer in combination with the excitation parameters of the electromagnetic flowmeter. Specifically, when the excitation frequency is the reference value, the system will obtain according to experience or calibration The wavelet decomposition scale numbers corresponding to the harmonics are determined. After each multi-resolution wavelet transform, the subsequences at the corresponding scales are automatically labeled with harmonic tags. Subsequently, the module performs a fast spectral analysis on each subsequence identified by the tags. For example, in the spectral distribution of the subsequence, the average value of the amplitudes within the neighborhood window plus twice the standard deviation is used as the adaptive threshold. For the components located at the harmonic frequencies and with amplitudes exceeding the threshold, the module directly sets the corresponding spectral amplitudes to zero; for the components slightly above the threshold but not reaching twice the standard deviation, they are gradually attenuated point by point according to a pre-set ratio between 0.6 and 0.8. After all the tags are processed, the system calls the inverse wavelet transform to reconstruct the low-frequency trend drift component and the high-frequency short-term perturbation component without harmonics, ensuring that there are no excitation harmonic artifacts in these two types of components.
[0092] Exemplarily, after the low-frequency trend drift component and the high-frequency short-term perturbation component are reconstructed and their features are extracted, the online clustering unit will continue to process the four-dimensional drift feature vector. In this embodiment, the trend drift rate can be taken as the average value of the amplitude differences every five minutes in the past half hour, and the drift accumulation is obtained by accumulating all the amplitude increments in the most recent four hours in the memory; the high-frequency perturbation energy is defined as the ratio of the sum of the energies of the sampling points exceeding 1 kHz in the short-term perturbation component to the total energy of the full frequency band; the instantaneous drift rate directly uses the latest amplitude jump value. These four indicators are normalized to the range of 0 to 1 to form a four-dimensional vector, which is then input into the instance of the density peak-based clustering algorithm in real time. By setting parameters such as the local density radius of 0.15 and the density threshold of 5, this algorithm clusters similar vectors into one cluster online.
[0093] Once the clustering result is generated, the system automatically determines the typical drift mode to which the current cluster belongs: when the trend drift rate continuously exceeds 0.02 and the accumulation exceeds 0.5, label this cluster as the "progressive drift mode"; when the ratio of the high-frequency energy fluctuates by more than 0.3 in the short term and the instantaneous drift rate exceeds 0.05, it is determined as the "high-frequency perturbation mode"; when the amplitude jump at a single moment exceeds twice the historical maximum amplitude and is accompanied by a sudden drop in energy, it is classified as the "sudden drift mode". According to different modes, the compensation strategy execution unit calls the corresponding logics respectively: for the "progressive drift mode", a small-step parameter smoothing adjustment is adopted; for the "high-frequency perturbation mode", a local rapid alarm is triggered and the filtering level is increased for a short time; for the "sudden drift mode", an immediate full-scale parameter reset is performed and the event is recorded to ensure that the system output quickly returns to the normal range.
[0094] As an alternative embodiment, the output structure deviation score includes: Performing edge detection on the first pulse signal and the standard pulse waveform, respectively extracting the timestamp sequences of the rising edge and the falling edge, and calculating the time offset of the corresponding edges to obtain the edge time deviation score; Perform point-by-point difference calculation on the amplitudes of the first pulse signal and the standard pulse waveform at corresponding sampling moments to obtain an amplitude error sequence, and determine the amplitude error score based on the root mean square value of the amplitude error sequence; Within a preset time window, respectively count the number of valid pulses in the first pulse signal and the standard pulse waveform, calculate the pulse count difference between the two, and obtain the pulse count difference score; Fuse the edge time deviation score, amplitude error score, and pulse count difference score with preset weighting coefficients, and output the structural deviation score.
[0095] As a more detailed optional implementation manner, after obtaining the standard pulse template and the actual pulse signal, the discrimination module 40 can also perform refined processing according to the following steps: The discrimination module 40 stores the pulse waveform data of the most recent 100 ms in a buffer area at a fixed sampling rate (e.g., 10 kHz), and maintains two equal-length index arrays: the previous sampling value and the current sampling value. When it is detected that the previous sampling value is "0" and the current sampling value is "1", it is determined that a rising edge has occurred, and the buffer index corresponding to this sampling is multiplied by the sampling interval (0.1 ms) and stored in the rising edge timestamp queue; similarly, when the previous sampling value is "1" and the current sampling value is "0", the index corresponding time is added to the falling edge timestamp queue. After capturing the same number of rising edges and falling edges as the template pulses within a complete cycle, the module subtracts the rising edge timestamps from the corresponding rising edge time points in the template in sequence, takes the absolute value and accumulates them, and then divides by the number of pulses to obtain the average edge time deviation; the falling edge is processed in the same way, and finally the larger of the two average deviations is taken as the edge time deviation score.
[0096] The amplitude error score is obtained by performing the following operations on each sampling point in the same buffer area: when the module starts, it reads the amplitude expectation array of each sampling point from the template, and during operation, subtracts the corresponding expected amplitude from the actual sampling amplitude to obtain an error sequence; sum the squares of each value in the error sequence, divide by the total number of sampling points, and finally take the square root of the average square value to obtain the root mean square error of the amplitude, which is directly used as the amplitude error score.
[0097] The pulse count difference score analyzes the number of valid pulses by counting the rising edge timestamp queue within the same 100 ms window. A so-called "valid pulse" requires that the amplitude peak of this pulse exceeds 50% of the template peak and the difference between the falling edge timestamp and the corresponding rising edge timestamp (pulse width) is not less than 80% of the template pulse width. The module traverses all rising edge records, counts the pulses that meet these two conditions, and subtracts the number of pulses in the template within the same time window after obtaining the actual count to obtain the pulse count difference score.
[0098] After completing the above three evaluations, the module reads the weight table in the system parameter storage area (default edge time deviation weight 0.4, amplitude error weight 0.4, pulse count difference weight 0.2), multiplies the three evaluations by their respective weights and sums them, and then divides the result by the total weight for normalization to output the final structural deviation score. The weights and various thresholds (such as 50% of the peak value, 80% of the pulse width, 100 ms of the window length, etc.) are all saved in a configuration table that can be dynamically adjusted through the maintenance interface for online optimization according to different working conditions or accuracy requirements.
[0099] As an alternative implementation, the generating the second pulse signal includes: Constructing a target loss function based on the structural deviation score, the target loss function includes a structural deviation score term and a drift adjustment regularization term related to the drift level; Determining an adjustment factor in the target loss function according to the drift level information, the adjustment factor is used to dynamically adjust the update amplitude of the target loss function; Using an optimization algorithm based on the first-order gradient to iteratively update the control parameter vector in the parameter mapping function, the optimization algorithm includes: adaptive moment estimation algorithm and stochastic gradient descent algorithm; Replacing the corresponding parameters in the parameter mapping function with the updated control parameter vector, and re-executing the signal synthesis operation to generate the second pulse signal.
[0100] In this embodiment, after the output control module 50 receives the structural deviation score provided by the discrimination module 40, it first transmits the score to the target loss construction unit. The score represents the overall structural deviation degree between the current first pulse signal and the standard template in floating point type. At the same time, the output control module 50 obtains the current drift level identifier of the system from the modeling module 20. This identifier is a discrete level label and corresponds to a normalized adjustment factor in the internal configuration table. This adjustment factor increases non-linearly with the increase of the level and is used to control the allowable step size during parameter update.
[0101] The output control module 50 inputs the structural deviation score as the basic error term and the adjustment factor as the modulation factor into the target loss construction unit together.
[0102] Exemplarily, this construction process is completed by a loss weighting module: the module has two input channels, namely the "structural error channel" and the "drift adjustment channel", and each channel is weighted through configurable weights to finally generate the total loss value. In a specific implementation, the total loss value is saved in a floating-point register as the subsequent optimization target.
[0103] The optimization process is called through the embedded optimizer. The optimizer includes two sub-paths: the adaptive moment estimation path and the basic stochastic gradient path. By default, the system gives priority to the adaptive moment estimation path, which maintains two state caches to record the first-order gradient average and fluctuation amplitude of the control parameters in the past several rounds, which are used to generate update directions and strides with jitter buffer effects. When it is detected that the total loss value decreases too slowly for several consecutive cycles, or the direction of the gradient change swings violently, the system automatically switches to the stochastic gradient path, ignoring the historical trend, and only uses the reverse direction of the current loss value gradient as the update direction, and selects a larger but bounded random perturbation step size to avoid falling into the local minimum.
[0104] After the optimization is completed, the output control module 50 reads the updated control parameter vector from the optimizer, and the structure of the vector completely corresponds to the weight structure in the original mapping network. The output control module 50 directly writes the vector into the control parameter storage area of the generation module 30, overwriting the original parameter value through the data channel, and completing the real-time replacement operation of the parameter mapping function.
[0105] After the parameter update takes effect, the output control module 50 immediately issues a signal resynthesis instruction. After the generation module 30 responds to the instruction, it re-executes the forward calculation process and uses the updated control parameters to generate a new pulse signal sequence, i.e., the second pulse signal. The output format of the signal is consistent with the first pulse signal, including a fixed-length sampling sequence and an edge identification bit with a timestamp. The system then sends the signal to the output port of the electromagnetic flowmeter, and stores the current structural deviation score and control parameter change record in the system log for subsequent analysis or abnormal backtracking.
[0106] For example, the industrial slurry circulation system in the pipeline has been working smoothly since it was put into use in the early morning. At around 10:00 am, the modeling module 20 and the discrimination module 40 successively fed back that the structural deviation score increased from 0.05 in the normal range to 0.25, and detected that the drift level switched from "slight drift" to "medium drift". The output control module 50 immediately enters the target loss construction process, feeds the deviation score of 0.25 and the adjustment factor corresponding to the medium drift level (for example, 1.5 times) into the loss weighting unit, and finally obtains a total loss value after the medium deviation is amplified.
[0107] The optimizer first enabled the adaptive moment estimation algorithm path. After three consecutive iterations, the total loss dropped to 0.12, the pulse frequency parameter was reduced by 2 Hz, and the duty cycle was increased by 1%. At the fourth iteration, the system found that the loss was decreasing slowly and the gradient direction fluctuated slightly, so it automatically switched to the stochastic gradient descent branch and used a slightly larger step size to make a strong adjustment to the parameters: the frequency was further reduced by 5 Hz, the duty cycle was further increased by 2%, and the maintenance time parameter was refreshed to increase the signal stability margin.
[0108] After the parameter update is completed, the output control module 50 immediately calls the generation module 30 to resynthesize the second pulse signal and sends it to the instrument output port.
[0109] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in this application can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of this application.
Claims
1. Pulse output sensor control system for electromagnetic flowmeter, characterized in that, Including: A collection module for collecting the working condition data of the fluid to be measured under the current measurement working condition; The working condition data includes: the conductivity value, temperature value, viscosity gradient index of the fluid to be measured, the change rate of the output pulse signal amplitude of the fluid to be measured within a preset time window, and the induced electromotive force waveform characteristics; A modeling module for performing multi-dimensional state modeling based on the working condition data to generate a working condition state vector and a health state vector; identifying system state drift based on the health state vector to generate drift information; the health state vector is a state description vector obtained by comparing and calculating the working condition state vector with the historical health distribution; A generation module for receiving the working condition state vector, the health state vector and the drift information, and mapping and generating pulse control parameters based on a preset parameter mapping function; performing signal synthesis based on the pulse control parameters to generate a first pulse signal; A discrimination module for performing waveform alignment, edge detection and pulse count comparison on the first pulse signal using a standard pulse waveform, and outputting a structural deviation score; An output control module for receiving the structural deviation score, updating the control parameter vector in the parameter mapping function according to a preset loss function and in combination with the drift information to obtain an updated parameter mapping function; re-performing signal synthesis operations based on the updated parameter mapping function to generate a second pulse signal, and outputting the second pulse signal to the external interface of the electromagnetic flowmeter.
2. The pulse output sensor control system for electromagnetic flowmeter according to claim 1, characterized in that, The collection of the working condition data of the fluid to be measured under the current measurement working condition includes: Measuring the flow velocity difference through at least two flow velocity sensors installed at different positions on the measuring pipe section, and determining the viscosity gradient index of the fluid to be measured based on the flow velocity difference according to a preset viscosity gradient calculation method; Real-time sampling the amplitude of the output pulse signal within a preset time window, and calculating the change slope of the amplitude within the preset time window to determine the change rate of the output pulse signal amplitude; Collecting the induced electromotive force waveform through a sampling unit installed at both ends of the excitation electrode of the electromagnetic flowmeter, and calculating the waveform frequency, amplitude and fluctuation interval to determine the induced electromotive force waveform characteristics.
3. The pulse output sensor control system for electromagnetic flowmeter according to claim 1, characterized in that, The generation of the working condition state vector and the health state vector includes: Performing numerical normalization processing on the conductivity value, temperature value, viscosity gradient index, change rate of the output pulse signal amplitude and induced electromotive force waveform characteristics respectively, and constructing the working condition state vector by means of vectorized splicing; Based on the historical operation working condition data, performing data clustering analysis in a preset working condition space to construct a historical health distribution; Calculating the similarity between the working condition state vector and the historical health distribution, determining the health deviation degree according to a preset drift threshold, and constructing the health state vector based on the health deviation degree.
4. The pulse output sensor control system for electromagnetic flowmeter according to claim 1, characterized in that, The mapping and generation of pulse control parameters based on a preset parameter mapping function includes: Fuse and splice the working condition state vector, health state vector, and drift information into a main mapping input vector, and separately input the viscosity gradient index into a modulation sub-network, which includes at least one neural layer with a non-linear activation function for generating a modulation factor vector; Input the main mapping input vector into a multi-layer perceptron main mapping network, which includes at least two hidden layers, and each hidden layer includes multiple neurons with non-linear activation functions; Introduce a modulation operation in the middle hidden layer of the main mapping network, and the modulation operation includes performing element-wise multiplication or affine transformation on the modulation factor vector and the output of the current hidden layer to form an intermediate feature representation dynamically modulated by the viscosity gradient; Generate a control parameter vector for characterizing pulse frequency, duty cycle, and maintenance duration based on the output of the main mapping network after modulation.
5. The pulse output sensor control system for electromagnetic flowmeter according to claim 3, characterized in that, The identification of system state drift based on the health state vector and the generation of drift information include: Calculate the distance value between the current working condition and the historical health distribution based on the health state vector; Compare the distance value with a preset drift threshold interval, and when the distance value exceeds the drift threshold interval, determine that the system state has drifted; Quantify and generate drift level information for characterizing the severity of state drift according to the amplitude by which the distance value exceeds the drift threshold interval.
6. The pulse output sensor control system for electromagnetic flowmeter according to claim 5, characterized in that, The generation of drift information further includes: Perform multi-resolution wavelet transform on the time-varying sequence of drift amplitude values to distinguish between a low-frequency trend drift component and a high-frequency short-term perturbation component; Perform online clustering analysis in a multi-dimensional feature space composed of drift level, drift direction, and drift rate based on the low-frequency trend drift component and the high-frequency short-term perturbation component respectively to identify typical drift patterns; Establish and implement different compensation strategies for different typical drift patterns respectively.
7. The pulse output sensor control system for electromagnetic flowmeter according to claim 6, characterized in that, The wavelet basis function used for the wavelet transform is a Symlets wavelet or a Coiflets wavelet; the performing of multi-resolution wavelet transform on the time-varying sequence of drift amplitude values includes: Based on the excitation frequency of the electromagnetic flowmeter and its integer multiple harmonic frequencies, determine the number of scale decomposition layers of the wavelet transform to decompose the drift amplitude sequence into wavelet sub-sequences corresponding to the low-frequency trend drift component and the high-frequency short-term perturbation component in the scale space; For the wavelet sub-sequences, perform threshold suppression and reconstruction of harmonic interference, and the steps include: Perform spectral analysis on each scale wavelet sub-sequence to calculate the spectral distribution of the wavelet sub-sequence at each scale; Identify and locate the positions of harmonic interference frequencies that are integer multiples of the excitation frequency in the spectral distribution, and determine the spectral amplitudes corresponding to each harmonic interference frequency point; Calculate an adaptive threshold based on the spectral amplitudes corresponding to each harmonic interference frequency point, and the calculation of the adaptive threshold includes determining it according to the mean and standard deviation of the spectral amplitudes in the neighborhood of each harmonic interference frequency point; Set to zero or attenuate proportionally the spectral amplitudes exceeding the adaptive threshold at each harmonic interference frequency point to obtain a spectrum after harmonic interference suppression; Perform wavelet reconstruction separately based on the spectra after harmonic interference suppression to obtain a low-frequency trend drift component corresponding to the long-term trend drift and a high-frequency short-term perturbation component corresponding to the short-term perturbation.
8. The pulse output sensor control system for an electromagnetic flowmeter according to claim 7, wherein, The identification of typical drift patterns includes: Calculate the long-term drift rate and drift accumulation based on the low-frequency trend drift component, and determine the long-term trend drift feature vector; Calculate the spectral energy distribution and instantaneous drift rate of the short-term perturbation based on the high-frequency short-term perturbation component, and determine the short-term perturbation feature vector; Perform vector fusion on the long-term trend drift feature vector and the short-term perturbation feature vector in a four-dimensional feature space composed of drift level, drift direction, drift rate, and spectral energy to form a comprehensive drift feature vector; Input the comprehensive drift feature vector into a preset clustering model to generate a clustering result; the clustering model is a density peak-based clustering algorithm; Based on the clustering result, determine and label the typical drift patterns, and the typical drift patterns include: a progressive drift pattern caused by sensor scaling, a high-frequency perturbation pattern caused by bubble inclusion, and a sudden drift pattern caused by sensor transient failure.
9. The pulse output sensor control system for an electromagnetic flowmeter according to claim 8, wherein, The output of the structural deviation score includes: Perform edge detection on the first pulse signal and the standard pulse waveform, extract the timestamp sequences of the rising edge and the falling edge respectively, calculate the time offset of the corresponding edge, and obtain the edge time deviation score; Perform point-by-point difference calculation on the amplitudes of the first pulse signal and the standard pulse waveform at the corresponding sampling moments to obtain an amplitude error sequence, and determine the amplitude error score based on the root mean square value of the amplitude error sequence; Within a preset time window, count the number of valid pulses in the first pulse signal and the standard pulse waveform respectively, calculate the pulse count difference between the two, and obtain the pulse count difference score; Fuse the edge time deviation score, the amplitude error score, and the pulse count difference score by weighted fusion according to a preset weighting coefficient, and output the structural deviation score.
10. The pulse output sensor control system for an electromagnetic flowmeter according to claim 9, wherein, The generation of the second pulse signal includes: Construct a target loss function based on the structural deviation score, and the target loss function includes a structural deviation score term and a drift adjustment regularization term related to the drift level; Determine the adjustment factor in the target loss function according to the drift level information, and the adjustment factor is used to dynamically adjust the update amplitude of the target loss function; Use a first-order gradient-based optimization algorithm to iteratively update the control parameter vector in the parameter mapping function, and the optimization algorithms include: adaptive moment estimation algorithm and stochastic gradient descent algorithm; Replace the corresponding parameters in the parameter mapping function with the updated control parameter vector, and re-execute the signal synthesis operation to generate the second pulse signal.
Citation Information
Patent Citations
Electromagnetic flowmeter and self-diagnosing method of exciting circuit unit thereof
CN103376136A
Water turbine runner real-time state evaluation method and application thereof
CN113027658A
Data processing method, device and equipment, medium and vehicle-mounted data acquisition equipment and system
CN118157803A
Pulse output device, electromagnetic flowmeter, and pulse output method
JP2019045343A
Electromagnetic flowmeters
US4723449A
Cited By
Infrared oil measuring instrument for driving infrared LED lamp through pulse signal
CN120385620A
An infrared oil detector driven by pulse signal
CN120385620B
Double-layer substrate circuit module adopting non-sealed hybrid high integration
CN120751585A
A dual-layer substrate circuit module employing non-sealed hybrid high integration
CN120751585B
Electromagnetic flowmeter flow prediction method based on magnetic sensor identification and analysis
CN120846457A