A multi-modal signal interface output method for ultrasonic water meters

By identifying water temperature ranges and ultrasonic signal characteristics, filtering signals and adjusting memory and communication parameters, the stability and abnormal identification problems of traditional water meter signal interface output are solved, and the accuracy of data transmission and system responsiveness are improved.

CN120568227BActive Publication Date: 2025-09-30SHENZHEN HUAXU TECH DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511044795.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-29
Publication Date
2025-09-30
Estimated Expiration
2045-07-29

AI Technical Summary

Technical Problem

Traditional water meter signal interface output technology cannot identify signal synchronization anomalies caused by high temperature or water quality changes in real time, resulting in wasted memory resources and insufficient adjustment of communication parameters. It is unable to accurately screen abnormal data, causing system analysis errors and control response failures.

Method used

By calling the temperature sensor to identify the water temperature range, combining the propagation time and peak amplitude changes of the ultrasonic signal, filtering the signal, calculating the flow rate data, adjusting the memory allocation and communication parameters, generating data verification results, eliminating distorted signals, and optimizing the data packaging structure.

Benefits of technology

It realizes signal stability control, improves the continuity of data output and the efficiency of buffer space allocation, enhances the accuracy of abnormal data identification, and ensures the accuracy of data transmission and the real-time response capability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120568227B_ABST
    Figure CN120568227B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of remote meter reading technology, specifically a multimodal signal interface output method for an ultrasonic water meter, comprising the following steps: identifying water temperature segments and screening ultrasonic signals, calculating flow velocity, evaluating signal stability and eliminating distorted signals, adjusting channel memory allocation and communication encapsulation mode, marking difference fields and tracing abnormal frames. In the present invention, by acquiring water temperature in real time and establishing a water temperature segment index, signal screening is achieved by combining the propagation time and the peak amplitude change trend, calculating the synchronous change relationship between the propagation time and the peak amplitude in real time, accurately determining the signal stability, effectively eliminating abnormal data interference, flexibly adjusting memory allocation and communication parameters according to the difference in data channel activity, optimizing data encapsulation structure, strengthening the dual stability control of signals and data, and improving the continuity of data output, the allocation efficiency of buffer space, and the recognition accuracy of abnormal data under multi-cycle dynamic change conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of remote meter reading, and in particular to a multi-modal signal interface output method for an ultrasonic water meter. Background Art

[0002] The field of remote meter reading technology includes data collection and transmission based on communication networks and measuring instruments. The core content is to complete the usage detection of water, electricity, gas, heat and other resources through various sensors or instruments, and transmit the detected data information to the centralized management system through wired or wireless means to realize centralized data management, statistical analysis and user usage monitoring. It includes measurement and metering units, data acquisition units, data transmission units and data concentrators, covering various metering methods such as pulse metering, electromagnetic metering, ultrasonic metering, etc. The communication methods involved include RS485, M-Bus, wireless radio frequency, NB-IoT, LoRa and Wi-Fi, etc., and realize data interaction and status monitoring between multiple devices through various communication protocols. Among them, a multimodal signal interface output method for an ultrasonic water meter refers to a method for outputting the measured water usage data to a back-end system through multiple physical interfaces or communication protocols for an ultrasonic water meter based on the open source Hongmeng operating system. Specifically, it covers measuring the water flow velocity using an ultrasonic transducer, obtaining the flow value based on the time difference of sound wave propagation, and combining the flow data with temperature detection, battery voltage status, and water meter working status. Through different interfaces such as RS485, M-Bus, or wireless radio frequency, frame structure design, data packaging, check byte addition, and multi-protocol adaptation are performed based on the serial communication protocol for output. The driver interface provided by the open source Hongmeng is used to manage task scheduling and data buffering processing, supporting unified access and transmission of multimodal signals.

[0003] During the signal acquisition and data transmission process, traditional water meter signal interface output technology only realizes data output based on periodic sampling and protocol encapsulation. It does not make a linkage judgment on the signal change trend and the temperature environment, and cannot identify signal synchronization anomalies caused by high temperature or water quality changes in real time. The memory resources are divided according to static proportions, which can easily lead to memory overflow of high-activity channels and waste of space in low-activity channels. Communication parameters are not adjusted in accordance with data fluctuation characteristics, and field data output is not verified for historical consistency. In multiple cycles, abnormal data is not identified and continues to be transmitted, resulting in analysis errors and judgment deviations of the central system. In the case of high-frequency fluctuations or boundary signals, the lack of an accurate screening mechanism will cause system feedback delays and control response failures. Summary of the Invention

[0004] The purpose of the present invention is to solve the shortcomings of the prior art and to propose a multi-modal signal interface output method for an ultrasonic water meter.

[0005] In order to achieve the above object, the present invention adopts the following technical solution: a method for outputting a multimodal signal interface of an ultrasonic water meter, comprising the following steps:

[0006] S1: Call the temperature sensor, identify the water temperature range, compare the propagation time of the ultrasonic signal with the change in the peak amplitude of the ultrasonic signal, determine the degree of synchronization between the propagation time and the peak amplitude change within the target temperature range, filter the ultrasonic signal, calculate the flow rate data, and obtain the flow rate measurement data set;

[0007] S2: Based on the flow velocity measurement data set, detect the maximum peak amplitude of the ultrasonic waveform in each measurement cycle, compare the fluctuation direction and amplitude difference of the peak amplitudes of adjacent cycles, determine the peak energy change trend in consecutive cycles, determine the stability of the ultrasonic signal, eliminate the distorted signal, and generate a data verification result;

[0008] S3: Based on the data verification result, detect the number of write records of multiple data channels in the same sampling period, determine the activity level of each channel in the data stream, adjust the memory allocation of multiple channels, and obtain buffer space allocation parameters;

[0009] S4: According to the buffer space allocation parameters, the consistency of the change direction of the flow velocity measurement data in the continuous period is compared to determine the fluctuation characteristics of the flow velocity change, and the communication transmission configuration and the corresponding data encapsulation parameters are adjusted to generate the communication encapsulation mode parameters.

[0010] As a further solution of the present invention, the flow rate measurement data set specifically includes water temperature segment information, propagation time information, and flow rate measurement values; the data verification results specifically include peak change trends, signal stability marks, and distortion signal marks; the buffer space allocation parameters include channel priority order, buffer start address, and buffer end address; and the communication encapsulation mode parameters specifically include encapsulation mode type, timestamp format, and data frame length information.

[0011] As a further solution of the present invention, the steps of acquiring the flow velocity measurement data set are specifically as follows:

[0012] S111: Calling the temperature sensor to obtain the water temperature detection signal in real time and comparing it with the preset temperature segment boundary value, identifying the water temperature segment, and establishing the water temperature segment number;

[0013] S112: Based on the water temperature segment number, detecting the propagation time of the ultrasonic signal, obtaining the peak amplitude of the current cycle and the peak amplitude of the previous cycle, determining the degree of synchronization between the propagation time and the peak amplitude change within the target temperature segment, calculating the synchronization coefficient, and obtaining a synchronization analysis result;

[0014] S113: Filter the ultrasonic signal according to the synchronization degree analysis result, and calculate the flow velocity value using the propagation time information to obtain a flow velocity measurement data set.

[0015] As a further solution of the present invention, the step of obtaining the data verification result is specifically as follows:

[0016] S211: Detecting the flow velocity measurement data set, obtaining the maximum peak amplitude of the ultrasonic waveform in each measurement cycle, normalizing the maximum peak amplitude of each cycle and arranging them in chronological order to generate a peak amplitude sequence;

[0017] S212: Based on the peak amplitude sequence, compare the maximum peak amplitude of the current cycle with the maximum peak amplitude of the previous cycle and calculate the difference, arrange the differences between adjacent cycles in sequence, and obtain a fluctuation difference sequence;

[0018] S213: Calculate the signal stability according to the fluctuation difference sequence, identify and remove distorted signals, and obtain data verification results.

[0019] As a further solution of the present invention, the step of obtaining the buffer space allocation parameter is specifically as follows:

[0020] S311: Obtain the data verification result, detect the number of write records of the flow rate channel, temperature channel, voltage channel, and status channel in the same sampling period, accumulate the number of write records of each channel in multiple periods, and generate a total number of channel write records;

[0021] S312: Based on the total number of channel writes, sequentially compare the number of writes to the flow rate channel, the temperature channel, the voltage channel, and the status channel, evaluate the activity of each channel in the data stream, and generate a channel activity ranking;

[0022] S313: According to the channel activity order, the total number of channel write times is called, the memory allocation adjustment coefficient of each channel is calculated, the memory allocation of multiple channels is adjusted, and the buffer start address and end address pointers are updated to obtain the buffer space allocation parameters.

[0023] As a further solution of the present invention, the step of obtaining the communication encapsulation mode parameter is specifically as follows:

[0024] S411: detecting the flow velocity measurement data in the current sampling period and the flow velocity measurement data in the previous sampling period according to the buffer space allocation parameter, calculating the change value of the flow velocity measurement data in adjacent periods, and obtaining the flow velocity change value;

[0025] S412: Based on the flow velocity change value, by comparing the change direction of the flow velocity measurement data in consecutive periods, determining the consistency feature of the flow velocity change direction, and generating a flow velocity change consistency index;

[0026] S413: Determine the fluctuation characteristics of the flow rate change according to the flow rate change consistency index, adjust the communication transmission configuration and corresponding data encapsulation parameters according to the fluctuation characteristics, and obtain communication encapsulation mode parameters.

[0027] As a further embodiment of the present invention, the method further comprises:

[0028] S5: Based on the communication encapsulation mode parameters, detect the data recorded by each data channel in the current cycle, compare each data with the corresponding data stored in the key field record table, determine the consistency of the field data, filter the difference fields and mark them as abnormal, send a data retransmission request, and obtain the abnormal frame tracing result;

[0029] The abnormal frame tracing result specifically refers to the abnormal field name, field difference value, and retransmission trigger mark.

[0030] As a further solution of the present invention, the steps for obtaining the abnormal frame tracing result are specifically as follows:

[0031] S511: Detecting the flow rate data, temperature data, voltage data, and status data recorded in the current cycle according to the communication encapsulation mode parameters, comparing each data item with the corresponding data stored in the key field record table, and obtaining a corresponding difference value of the field data;

[0032] S512: Based on the corresponding difference values ​​of the field data, determine the degree of correspondence between each field data, filter out fields with data differences, and generate abnormal field information;

[0033] S513: Mark the abnormal state according to the abnormal field information, output the abnormal state result, send a data retransmission request, and obtain the abnormal frame tracing result.

[0034] Compared with the prior art, the advantages and positive effects of the present invention are:

[0035] In the present invention, by acquiring the water temperature in real time and establishing a water temperature segment index, signal screening is achieved by combining the propagation time and the peak amplitude change trend, the synchronous change relationship between the propagation time and the peak amplitude is calculated in real time, the signal stability is accurately determined, and the interference of abnormal data is effectively eliminated. The memory allocation and communication parameters are flexibly adjusted according to the difference in data channel activity, the data encapsulation structure is optimized, and the dual stability control of signals and data is strengthened. Under the conditions of multi-cycle dynamic changes, the continuity of data output, the allocation efficiency of buffer space and the recognition accuracy of abnormal data are improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is a schematic diagram of the main steps of the present invention;

[0037] Figure 2 A flow chart for obtaining a flow velocity measurement data set of the present invention;

[0038] Figure 3 A flow chart for obtaining data verification results of the present invention;

[0039] Figure 4 A flow chart for obtaining buffer space allocation parameters of the present invention;

[0040] Figure 5 The communication encapsulation mode parameter acquisition flow chart of the present invention;

[0041] Figure 6 This is a flowchart for obtaining abnormal frame tracing results of the present invention. DETAILED DESCRIPTION

[0042] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0043] In the description of the present invention, it should be understood that the terms "length," "width," "up," "down," "front," "back," "left," "right," "vertical," "horizontal," "top," "bottom," "inside," "outside," and the like, indicating positions or relationships, are based on the positions or relationships shown in the accompanying drawings and are intended only to facilitate the description of the present invention and simplify the description. They do not indicate or imply that the devices or elements referred to must have a specific orientation, be constructed, or operate in a specific orientation. Therefore, they should not be construed as limiting the present invention. Furthermore, in the description of the present invention, "plurality" means two or more, unless otherwise expressly and specifically defined.

[0044] See also Figure 1 The present invention provides a technical solution, a method for outputting a multi-modal signal interface of an ultrasonic water meter, comprising the following steps:

[0045] S1: Call the temperature sensor, identify the water temperature range, compare the propagation time of the ultrasonic signal with the change in the peak amplitude of the ultrasonic signal, determine the degree of synchronization between the propagation time and the peak amplitude change within the target temperature range, filter the ultrasonic signal, calculate the flow rate data, and obtain the flow rate measurement data set;

[0046] S2: Based on the flow rate measurement data set, detect the maximum peak amplitude of the ultrasonic waveform in each measurement cycle, compare the fluctuation direction and amplitude difference of the peak amplitudes in adjacent cycles, determine the peak energy change trend in consecutive cycles, determine the stability of the ultrasonic signal, eliminate the distorted signal, and generate data verification results;

[0047] S3: Based on the data verification results, detect the number of write records of multiple data channels in the same sampling period, determine the activity level of each channel in the data stream, adjust the memory allocation of multiple channels, and obtain buffer space allocation parameters;

[0048] S4: Based on the buffer space allocation parameters, the consistency of the change direction of the flow velocity measurement data in the continuous period is compared to determine the fluctuation characteristics of the flow velocity change, and the communication transmission configuration and the corresponding data encapsulation parameters are adjusted to generate the communication encapsulation mode parameters;

[0049] S5: Based on the communication encapsulation mode parameters, detect the data recorded by each data channel in the current cycle, compare each type of data with the corresponding data stored in the key field record table, determine the consistency of the field data, filter the difference fields and mark the anomalies, send a data retransmission request, and obtain the abnormal frame tracing results.

[0050] The flow measurement data set specifically includes water temperature section information, propagation time information, and flow measurement values. The data verification results specifically include peak change trends, signal stability marks, and distorted signal marks. The buffer space allocation parameters include channel priority order, buffer start address, and buffer end address. The communication encapsulation mode parameters specifically include encapsulation mode type, timestamp format, and data frame length information. The abnormal frame tracing results specifically refer to the abnormal field name, field difference value, and retransmission trigger mark.

[0051] See also Figure 2 ,The steps for acquiring the velocity measurement dataset are as follows:

[0052] S111: Calling the temperature sensor to obtain the water temperature detection signal in real time and comparing it with the preset temperature segment boundary value, identifying the water temperature segment, and establishing the water temperature segment number;

[0053] The process of calling the temperature sensor begins with integrating a temperature sensor probe into the water meter. The sensor probe senses the temperature of the water flowing through the measuring pipe in real time and outputs an analog voltage signal. This voltage signal is converted to digital form by the internal ADC. For example, in a real-world scenario, a voltage signal of 1.25V is measured, and the digital value after ADC conversion is 512. This digital value is then compared with the preset temperature range boundary values ​​one by one to determine the temperature. The preset temperature ranges are divided into sections, as shown in Table 1:

[0054] Table 1 Water temperature section setting table

[0055] ;

[0056] By comparing with Table 1, if the measured ADC digital value is 512, it falls within interval 2 (401~600), that is, the water temperature segment number is determined to be 2, and the final water temperature segment number is 2.

[0057] S112: Based on the water temperature segment number, the propagation time of the ultrasonic signal is detected, and the peak amplitude of the current cycle and the peak amplitude of the previous cycle are obtained. The degree of synchronization between the propagation time and the peak amplitude change within the target temperature segment is determined according to the formula:

[0058] ;

[0059] Calculate the synchronization degree coefficient and obtain the synchronization degree analysis results;

[0060] in, is the synchronization coefficient, is the normalized value of the current cycle propagation time, which is obtained by subtracting the propagation time sample mean from the current cycle propagation time and then dividing it by the propagation time sample standard deviation. is the normalized value of the propagation time of the previous cycle, which is obtained by subtracting the mean of the propagation time samples from the propagation time of the previous cycle and dividing it by the standard deviation of the propagation time samples. is the normalized value of the peak amplitude of the current cycle, which is obtained by subtracting the peak amplitude sample mean from the peak amplitude of the current cycle and then dividing it by the peak amplitude sample standard deviation. is the normalized value of the peak amplitude of the previous cycle, which is obtained by subtracting the peak amplitude sample mean from the peak amplitude of the previous cycle and then dividing it by the peak amplitude sample standard deviation. is the normalized value of the propagation distance, which is obtained by subtracting the propagation distance sample mean from the propagation distance and then dividing it by the propagation distance sample standard deviation;

[0061] Based on the water temperature segment number 2 obtained above, the ultrasonic transceiver unit transmits a pulse signal after startup, which propagates through the water medium in the pipe, measures the propagation time of the received signal, and calculates the current cycle propagation time based on the time difference from the ultrasonic pulse emission moment to the signal reception moment. For example, the current cycle propagation time is 85μs, and the previous cycle propagation time is 82μs. At the same time, the current cycle peak amplitude and the previous cycle peak amplitude are obtained, which is actually achieved by ADC conversion of the amplitude signal. For example, the current cycle peak ADC digital value is 680, and the previous cycle ADC digital value is 700. The propagation time and peak amplitude are normalized separately, that is, a certain number of sample data are first collected, and the propagation time sample mean is measured to be 83μs, with a standard deviation of 1.5μs, and the peak amplitude sample mean is 690, with a standard deviation of 15. Use these statistical parameters to calculate the normalized value: Normalized value of current cycle propagation time: , the normalized value of the propagation time of the previous cycle: , the normalized value of the peak amplitude of the current cycle: , the normalized value of the peak amplitude of the previous cycle: , the measured value of the propagation distance is fixed. For example, if it is set to 100mm, the sample mean is 100mm, and the standard deviation is 5mm, then the normalized value of the propagation distance is: , bring the above normalized results into the formula:

[0062] ;

[0063] Description of parameters in the formula: : Synchronization coefficient, which indicates the degree of synchronization between propagation time and peak amplitude; 、 : Normalized value of the current and previous cycle propagation time, used to reflect the time change between cycles; 、 : Normalized value of the peak amplitude of the current and previous cycles, reflecting the trend of signal amplitude changes; : Normalized value of propagation distance, representing the stability of propagation path; the formula is based on the synchronization coefficient It reflects the coordinated change characteristics of propagation time and peak amplitude.

[0064] Among them, the synchronization coefficient represents the coupling change intensity of the ultrasonic propagation time change and the peak amplitude change in the current target temperature range. It is a dimensionless value that describes the degree of consistency of the synchronous fluctuations of the two. It is used to quantify the degree of coordination between the two changes in the process of flow conditions. The closer the coefficient value is to zero, the stronger the consistency of the change direction of the propagation time and the peak amplitude. The increase in the value indicates the deviation or imbalance of the change trend. The actual effect is used to judge whether the ultrasonic signal is credible and to screen reliable signals to participate in the subsequent flow velocity calculation process. It serves as a basic evaluation indicator for the validity of flow velocity measurement data. The calculation result is 4.006, which indicates that the degree of synchronization is in a strong synchronization state (the higher the degree of synchronization, the larger the value). This value is compared with the synchronization judgment threshold of 3 and is higher than the threshold. Therefore, it is determined that the propagation time and peak amplitude changes in this period are highly synchronized, and it is determined to be a valid signal.

[0065] S113: Filtering the ultrasonic signal based on the synchronization degree analysis result, and calculating the flow velocity value using the propagation time information to obtain a flow velocity measurement data set;

[0066] According to the synchronization coefficient obtained in the previous step This value is compared with a preset synchronization threshold (set to 3). If the synchronization coefficient exceeds the threshold, the ultrasonic signal for the current cycle is determined to be a valid signal. The propagation time parameter is then used to extract the specific values ​​of the ultrasonic propagation time for each valid signal. For example, the valid propagation time data collected for five consecutive measurement cycles are 85μs, 84μs, 85μs, 86μs, and 85μs, respectively, and the corresponding water temperature segment number is 2. Based on the ultrasonic propagation path length (set to 100mm), the flow velocity values ​​for each of these valid propagation time data are calculated item by item. Through repeated calculations and data storage, the corresponding flow velocity values ​​are 588.235m / s, 595.238m / s, 588.235m / s, 581.395m / s, and 588.235m / s, respectively. This data is considered a flow velocity measurement data sequence, and this method is continuously collected and stored to form a complete flow velocity measurement data set. The flow velocity values ​​in the data set are further calculated for inter-cycle differences and fluctuation determination. For example, the flow velocity change in the second cycle relative to the first cycle is 6.003 m / s, and the change in the third cycle relative to the second cycle is -7.003 m / s. By calculating the fluctuation range and change trend between the flow velocity values ​​of each cycle, the change characteristics and stability state of the flow velocity data in each measurement cycle are clarified and stored in the corresponding data recording area to form a more detailed flow velocity measurement data set.

[0067] See also Figure 3 , the specific steps for obtaining data verification results are:

[0068] S211: Detecting a flow velocity measurement data set, obtaining the maximum peak amplitude of the ultrasonic waveform in each measurement cycle, normalizing the maximum peak amplitude of each cycle and arranging them in chronological order to generate a peak amplitude sequence;

[0069] The flow rate measurement data set is called. According to the specific implementation process, the maximum peak amplitude data of the ultrasonic waveform in multiple consecutive measurement cycles (taking the actual 6 cycles as an example, numbered as cycle 1 to cycle 6) are extracted. For example, the actual measured original peak amplitude ADC values ​​in cycles 1 to 6 are 720, 715, 732, 698, 709, and 705, respectively. The peak amplitude of each cycle is normalized using the pre-obtained sample data average value of 710 and the standard deviation of 12. That is, the peak amplitude value of each cycle is subtracted from the average value and then divided by the standard deviation, so that the normalized peak amplitude values ​​of each cycle are 0.833, 0.417, 1.833, -1.000, -0.083, and -0.417, respectively. The obtained normalized data are sorted and stored in chronological order to obtain a peak amplitude sequence.

[0070] S212: Based on the peak amplitude sequence, compare the maximum peak amplitude of the current cycle with the maximum peak amplitude of the previous cycle and calculate the difference, arrange the differences between adjacent cycles in sequence, and obtain a fluctuation difference sequence;

[0071] Based on the above normalized peak amplitude sequence, the normalized values ​​of the maximum peak amplitudes of the current cycle and the previous cycle are calculated one by one. By subtracting the peak amplitude of cycle 1 (0.833) from the peak amplitude of cycle 2 (0.417), the difference between cycle 2 and cycle 1 is -0.416, the difference between cycle 3 and cycle 2 is calculated to be 1.416, the difference between cycle 4 and cycle 3 is calculated to be -2.833, the difference between cycle 5 and cycle 4 is calculated to be 0.917, and the difference between cycle 6 and cycle 5 is calculated to be -0.334. Through the above specific numerical difference calculation process, the difference sequences of adjacent cycles are obtained in sequence as -0.416, 1.416, -2.833, 0.917, and -0.334, forming a fluctuation difference sequence.

[0072] S213: Based on the volatility difference sequence, the formula is:

[0073] ;

[0074] Calculate the signal stability, identify and eliminate distorted signals, and obtain data verification results;

[0075] in, is the signal stability level, is the normalized value of the peak amplitude of the i-th cycle, which is obtained by normalizing the original peak amplitude according to the measurement period. is the standard deviation of the peak amplitude normalized sequence, by Calculate the standard deviation, is the maximum value of the normalized sequence of peak amplitudes, which is obtained by Filter the maximum value to get, is the minimum value of the normalized sequence of peak amplitudes, which is obtained by Filter the minimum value to get, is the mean of the normalized sequence of peak amplitudes, by Calculate the average value, is the total number of measurement cycles, obtained by the number of data cycles actually involved in the normalization calculation, is the cycle index, and the traversal range is 2 to , used to distinguish the current cycle from the previous cycle;

[0076] The parameters are called according to the fluctuation difference sequence, and the specific values ​​are brought into the formula to calculate the signal stability. The specific parameters of the formula mean: signal stability ( ) is the fluctuation and stability of the peak amplitude sequence; is the standard deviation of the peak amplitude sequence, which is directly calculated from the normalized peak amplitude data 0.833, 0.417, 1.833, -1.000, -0.083, -0.417. The specific calculation process is to first calculate the square of the difference between all data and the mean, then divide it by (the number of data - 1), and finally take the square root to get ; and are the maximum and minimum values ​​of the peak amplitude sequence, respectively, which are obtained by screening from the sequence. The actual values ​​are , ; is the mean of the peak amplitude sequence, which is calculated by (0.833 + 0.417 + 1.833 - 1.000 - 0.083 - 0.417) ÷ 6, and the actual value is 0.264; Indicates the number of data cycles actually involved in normalization calculation, the actual value is 6; cycle index It is used to represent the data calculation time sequence, and the difference calculation and summation are performed from cycle 2 to cycle 6, that is, The specific calculation example is as follows: First calculate the summation term on the right side of the formula:

[0077] ;

[0078] Then calculate the overall formula:

[0079] ;

[0080] Substituting the above values:

[0081] ;

[0082] The signal stability degree is a dimensionless value designed to measure the global and local fluctuation trends of the normalized sequence of peak amplitudes during ultrasonic water meter measurement. It quantifies the relative fluctuation level and short-term fluctuation rate of the signal amplitude within a continuous measurement cycle. Smaller values ​​indicate more stable peak amplitude fluctuations and better overall signal stability. Larger values ​​indicate significant dispersion, abrupt changes, or discontinuities in the peak amplitude, indicating weaker signal stability. This parameter serves as a fundamental criterion for data verification and anomaly screening, assisting in determining the validity and reliability of acquired signals and identifying and avoiding abnormal ultrasonic distortion signals. It is a key factor in subsequent data screening and fault tolerance compensation. The results indicate a signal stability degree of 17.075. Based on the empirical range of actual experimental data, the signal stability threshold is set at 15.0. This threshold is determined based on statistical analysis of long-term test data. When the stability value exceeds 15.0, the signal is unstable and should be identified as a distorted signal and removed from the waveform dataset. When the stability value is below 15.0, the signal is considered stable and retained in the dataset. The currently calculated signal stability level of 17.075 is greater than the threshold value of 15.0. Therefore, it is determined that the current data is distorted. The periodic data should be eliminated, and the remaining peak amplitude sequence data should be stored back in the data recording area to obtain the data verification result after eliminating the distorted signal.

[0083] See also Figure 4 , the steps for obtaining the buffer space allocation parameters are as follows:

[0084] S311: Obtain data verification results, detect the number of write records for the flow rate channel, temperature channel, voltage channel, and status channel within the same sampling period, accumulate the number of write records for each channel over multiple periods, and generate a total number of channel write records;

[0085] The data verification results of the previous stage are called. For the four channels (flow rate channel, temperature channel, voltage channel and status channel), the actual number of data records written in each channel is counted within the preset sampling period. In the specific implementation process, an example of the number of channel write records within 5 consecutive sampling periods is shown in Table 2:

[0086] Table 2 Example of channel write record times

[0087] ;

[0088] In the above specific implementation, the number of writes recorded in each channel in each cycle is called separately, and the number of writes for each channel is accumulated cycle by cycle, that is, the total number of writes for the flow rate channel is 25+27+26+28+29=135 times, the total number of writes for the temperature channel is 12+10+11+13+12=58 times, the total number of writes for the voltage channel is 8+9+7+8+9=41 times, and the total number of writes for the status channel is 5+6+4+5+6=26 times, forming the total number of writes for each channel.

[0089] S312: Based on the total number of channel writes, compare the number of writes to the flow rate channel, the temperature channel, the voltage channel, and the status channel in sequence, evaluate the activity of each channel in the data stream, and generate a channel activity ranking;

[0090] The total number of write times for each channel obtained in the above steps is called, and the flow rate channel, temperature channel, voltage channel and status channel are compared item by item to judge and determine the activity level of each channel in the entire data stream. In the specific implementation process, the difference between the flow rate channel (135 times) and the temperature channel (58 times) is calculated, and the difference is 77 times, which determines that the flow rate channel is more active than the temperature channel; the difference between the temperature channel (58 times) and the voltage channel (41 times) is calculated, and the difference is 17 times, which determines that the temperature channel is more active than the voltage channel; the difference between the voltage channel (41 times) and the status channel (26 times) is further calculated, and the difference is 15 times, which determines that the voltage channel is more active than the status channel; finally, the order of activity of the four channels is flow rate channel, temperature channel, voltage channel, and status channel.

[0091] S313: Based on the order of channel activity, the total number of channel writes is called using the formula:

[0092] ;

[0093] Calculate the memory allocation adjustment coefficient of each channel, adjust the memory allocation of multiple channels and update the buffer start address and end address pointers to obtain the buffer space allocation parameters;

[0094] in, The memory allocation adjustment coefficient for the kth channel, is the number of writes in the jth sampling period of the kth channel, which is obtained by collecting the number of write data of the corresponding channel in each sampling period. is the average number of times written in all sampling cycles of the kth channel, through all Finding the average value yields, The maximum value of the number of times the kth channel is written is obtained by Filter the maximum value to get, The minimum value of the number of times the kth channel is written is obtained by The minimum value is obtained by filtering, M is the number of sampling cycles, which is obtained by setting the total number of sampling window cycles, j is the sampling cycle index, which indicates the sequence number of the sampling cycle where the number of writes is located, and k is the channel index, which indicates the sequence number of different data channels;

[0095] According to the channel activity order determined in the above steps, the total number of channel writes is called and the memory allocation adjustment coefficient is calculated. The meaning of each parameter in the formula is as follows: Memory allocation adjustment coefficient Indicates the Channel memory allocation adjustment ratio; Indicates the Channel No. The specific number of writes within a sampling period is determined by the number of channel writes actually collected within each sampling period; For the The average number of write times for all sampling cycles of the channel, which is the total number of cycle write times divided by the number of cycles get; For the The maximum value of the number of write times in each cycle of the channel, For the The minimum value of the number of write times in each cycle of the channel is determined by comparing the data cycle by cycle; is the number of sampling cycles, which is 5 in this embodiment; is the sampling period number, from the 1st period to the 5th period; is the channel index, and the values ​​are flow rate (1), temperature (2), voltage (3), and state (4) channels. ) as an example to illustrate the actual calculation:

[0096] Temperature channel for , maximum value , minimum , calculate the sum of the formula:

[0097] ;

[0098] Substitute the formula for calculation :

[0099] ;

[0100] Among them, the memory allocation adjustment coefficient is a dimensionless value obtained after comprehensive calculation based on multiple characteristics of each data channel's write behavior over a period of time, such as the activity, fluctuation amplitude, and extreme changes. It serves as the basis for adjusting the buffer space allocation. The larger the coefficient value, the more active and volatile the channel write is, and more memory space needs to be allocated to avoid data overflow or congestion; the smaller the value, the more stable the channel write is or the load is low, and the buffer can be appropriately reduced. This is reflected in the system's automatic and dynamic allocation of memory resources, improving data storage utilization and multi-task concurrency performance, and effectively supporting the collaborative collection and management of multi-channel signals in complex IoT terminals. Through the same calculation process, the memory allocation adjustment coefficients of each channel are obtained as shown in Table 3:

[0101] Table 3 Channel memory allocation adjustment coefficient calculation results

[0102] ;

[0103] As shown in Table 3, the memory allocation adjustment coefficients calculated for each channel are different. Memory adjustment operations are performed using the above coefficients, and the buffer space size of each channel is adjusted accordingly. The start and end address pointers of the original buffer of each channel are reset according to the memory allocation adjustment coefficient. The actual process is as follows: the memory start address remains unchanged at the initial base address, and the end address of the flow rate channel is determined in turn based on the flow rate channel coefficient of 0.130. Then, the end address of the temperature channel is determined immediately after the flow rate channel, and then the end address of the voltage channel is determined based on the voltage channel coefficient of 0.381. Finally, the end address of the state channel is determined based on the state channel coefficient. The memory address range allocated to each channel is stored as the buffer space allocation parameter.

[0104] See also Figure 5 , the steps for obtaining the communication encapsulation mode parameters are as follows:

[0105] S411: Detecting the flow velocity measurement data in the current sampling period and the flow velocity measurement data in the previous sampling period according to the buffer space allocation parameter, calculating the change value of the flow velocity measurement data in adjacent periods, and obtaining the flow velocity change value;

[0106] Call the channel buffer start and end addresses set by the aforementioned buffer space allocation parameters, read the flow rate measurement data of two consecutive sampling cycles stored in the flow rate channel buffer, and extract the actual measured flow rate values ​​of the current sampling cycle and the previous sampling cycle respectively. Taking the specific implementation process as an example, the flow rate data measurement values ​​stored in the current cycle buffer are 588.2 m / s, 595.2 m / s, 588.2 m / s, 581.4 m / s, and 588.2 m / s, respectively. The flow rate measurement data of the previous sampling cycle are 586.5 m / s, 590.0 m / s, 585.5 m / s, 582.8 m / s, and 587.0 m / s, respectively. Perform numerical difference calculation on the data one by one, specifically, the first data 588.2 m / s of the current cycle minus the first data 586.5 m / s of the previous cycle, and obtain a change value of 1.7 m / s. Similarly, the second data change value 5.2 is obtained in sequence. m / s, the third data change value is 2.7 m / s, the fourth data change value is -1.4 m / s, and the fifth data change value is 1.2 m / s. The above calculation results are stored in sequence to form a flow velocity change value sequence.

[0107] S412: Based on the flow velocity change value, by comparing the change direction of the flow velocity measurement data in the continuous period, determining the consistency feature of the flow velocity change direction, and generating a flow velocity change consistency index;

[0108] Call the velocity change value sequence obtained above and perform the velocity change direction comparison operation item by item. The specific process is as follows: compare the first change value 1.7 m / s with the second change value 5.2 m / s. Since both change values ​​are positive, it is judged that the change directions are consistent; then compare the second change value 5.2 m / s with the third change value 2.7 m / s. Both values ​​are positive, so the change directions are consistent; further compare the third change value 2.7 m / s with the fourth change value -1.4 m / s. The former is positive and the latter is negative, so the change directions are inconsistent; then compare the fourth change value -1.4 m / s with the fifth change value 1.2 m / s. The direction changes from negative to positive, so it is judged that the change directions are inconsistent. Accumulate the change direction consistency counts for all cycles, with 2 times for consistent directions and 2 times for inconsistent directions. Define the velocity change consistency index as the consistent direction count divided by the total count, which is calculated as 2 / 4=0.5, and generate a velocity change consistency index of 0.5.

[0109] S413: Determine the fluctuation characteristics of the flow rate change according to the flow rate change consistency index, adjust the communication transmission configuration and corresponding data encapsulation parameters based on the fluctuation characteristics, and obtain communication encapsulation mode parameters;

[0110] Based on the aforementioned velocity change consistency index of 0.5, this value is compared with the set consistency index baseline threshold, which is set to 0.7 (determined based on long-term measurement experience with historical data). Through a specific numerical comparison operation, the actual velocity change consistency index of 0.5 is compared with the baseline threshold of 0.7. It is determined that the actual index value is lower than the baseline threshold. Based on this, the fluctuation characteristic of the current velocity data is determined to be large (large fluctuation is defined as the velocity change consistency index being below 0.7). Then, based on this fluctuation characteristic, specific adjustments are made to the communication transmission configuration, specifically calling the transmission rate and communication data encapsulation format parameters of the communication interface, and adjusting the communication interface transmission rate downward. For example, if the initial communication rate is set to 9600 bps, the communication rate is adjusted to 4800 bps. At the same time, the data encapsulation parameters are expanded, specifically increasing the original data frame length from 32 bytes to 64 bytes, and adding an additional velocity stability identification field to the data frame. The adjusted communication encapsulation mode parameters are stored as new communication configuration parameters. The specific implementation values ​​after the parameter adjustment are shown in Table 4:

[0111] Table 4 Communication encapsulation mode parameter adjustment example

[0112] ;

[0113] As shown in Table 4, the specific values ​​of the communication encapsulation mode parameters are obtained and stored in the system for subsequent use.

[0114] See also Figure 6 The specific steps for obtaining the abnormal frame tracing results are as follows:

[0115] S511: Detect the flow rate data, temperature data, voltage data, and status data recorded in the current cycle according to the communication encapsulation mode parameters, compare each data item with the corresponding data stored in the key field record table, and obtain the corresponding difference value of the field data;

[0116] The communication encapsulation mode parameters obtained in the previous stage are called, and the flow rate data, temperature data, voltage data, and status data recorded in the current sampling period in the buffer are used. For example, the flow rate data recorded in the current period is 588.2 m / s, the temperature data is 22.5°C, the voltage data is 3.3 V, and the status data is normal (indicated by the quantization status code "01"). The corresponding field reference data values ​​stored in the key field record table are read one by one. For example, the standard flow rate data stored in the key field record table is 587.0 m / s, the standard temperature data is 22.5°C, the standard voltage data is 3.5 V, and the standard status data is normal (status code "01"). The current period data and the key field data are respectively subjected to numerical difference calculation operations. Specifically, the flow rate data difference is 588.2 m / s - 587.0 m / s = 1.2 m / s, the temperature data difference is 22.5°C - 22.5°C = 0°C, and the voltage data difference is 3.3 V - 3.5 V = -0.2 V. The status data difference is the status code difference 0, and the corresponding difference values ​​of the above field data are stored in sequence to form a field data difference value sequence.

[0117] S512: Based on the corresponding difference values ​​of the field data, determine the degree of correspondence between the data of each field, filter out the fields with data differences, and generate abnormal field information;

[0118] The above field data difference value sequence is called to perform the corresponding degree judgment operation item by item. In the specific implementation process, the corresponding degree judgment threshold is preset. The flow rate data judgment threshold is set to ±1.0 m / s, the voltage data judgment threshold is set to ±0.1V, the temperature data judgment threshold is set to ±0.5℃, and the status data judgment threshold is 0. Through the comparison of the specific numerical differences with the thresholds item by item, after comparing the flow rate data difference value 1.2 m / s with the threshold value ±1.0 m / s, it is judged that the flow rate data exceeds the threshold range and it is determined that there is a data difference; after comparing the voltage data difference value -0.2 V with the threshold value ±0.1 V, it is judged that the voltage data exceeds the threshold range and it is determined that there is a data difference; after comparing the temperature data difference value 0℃ with the threshold value ±0.5℃, it is judged that the temperature data does not exceed the threshold range and there is no data difference; the status data difference is 0, which does not exceed the threshold and it is judged that there is no data difference. Based on this, the flow rate data and voltage data fields with data differences are screened out, and abnormal field information is generated and stored.

[0119] S513: Mark the abnormal state according to the abnormal field information, output the abnormal state result, send a data retransmission request, and obtain the abnormal frame tracing result;

[0120] The abnormal field information obtained above is called to perform the abnormal status marking operation. The specific process is to add abnormal marking codes to the flow rate data field and voltage data field with differences. The marking code uses the field name suffix "_ERR". Specifically, the flow rate data is marked as "flow rate_ERR" and the voltage data is marked as "voltage_ERR". After marking, they are stored in the data abnormality mark record area in sequence; further, the abnormal status output operation is performed to output the abnormal field information and marking results through the serial port or network interface. The output data example is shown in Table 5:

[0121] Table 5 Abnormal field marking and output example table

[0122] ;

[0123] As shown in Table 5, after the abnormal status information is output, the system communication control unit is further called to send a data retransmission request instruction. The specific content sent is a request frame carrying the mark field position and cycle index. For example, the request frame content is "retransmission request: cycle number 12, abnormal field: flow rate, voltage". After receiving the retransmission request, the system performs a data source backtracking operation, traces back to the original data record area of ​​the corresponding sampling period according to the cycle number and the abnormal field name, and retransmits the original record frame corresponding to the abnormal data. After the transmission is completed, the system re-checks and stores the returned data to form the abnormal frame tracing result, and stores the result for subsequent calls.

[0124] The above are merely preferred embodiments of the present invention and do not limit the present invention in any other form. Any technician familiar with the profession may use the technical content disclosed above to change or modify it into an equivalent embodiment with equivalent changes and apply it to other fields. However, any simple modification, equivalent change and modification made to the above embodiment based on the technical essence of the present invention without departing from the content of the technical solution of the present invention shall still fall within the scope of protection of the technical solution of the present invention.

Claims

1. A method for outputting a multimodal signal interface of an ultrasonic water meter, characterized in that: The following steps are involved: S1: Call the temperature sensor, identify the water temperature range, compare the propagation time of the ultrasonic signal with the change in the peak amplitude of the ultrasonic signal, determine the degree of synchronization between the propagation time and the peak amplitude change within the target temperature range, filter the ultrasonic signal, calculate the flow rate data, and obtain the flow rate measurement data set; S2: Based on the flow velocity measurement data set, detect the maximum peak amplitude of the ultrasonic waveform in each measurement cycle, compare the fluctuation direction and amplitude difference of the peak amplitudes of adjacent cycles, determine the peak energy change trend in consecutive cycles, determine the stability of the ultrasonic signal, eliminate the distorted signal, and generate a data verification result; S3: Based on the data verification result, detect the number of write records of multiple data channels in the same sampling period, determine the activity level of each channel in the data stream, adjust the memory allocation of multiple channels, and obtain buffer space allocation parameters; S4: comparing the consistency of the change direction of the flow velocity measurement data in consecutive cycles according to the buffer space allocation parameter, determining the fluctuation characteristics of the flow velocity change, and adjusting the communication transmission configuration and the corresponding data encapsulation parameters to generate communication encapsulation mode parameters; The steps for obtaining the flow velocity measurement data set are specifically as follows: S111: Calling the temperature sensor to obtain the water temperature detection signal in real time and comparing it with the preset temperature segment boundary value, identifying the water temperature segment, and establishing the water temperature segment number; S112: Based on the water temperature segment number, detecting the propagation time of the ultrasonic signal, obtaining the peak amplitude of the current cycle and the peak amplitude of the previous cycle, determining the degree of synchronization between the propagation time and the peak amplitude change within the target temperature segment, calculating the synchronization coefficient, and obtaining a synchronization analysis result; S113: Filtering the ultrasonic signal according to the synchronization degree analysis result, and calculating the flow velocity value using the propagation time information to obtain a flow velocity measurement data set; The steps for obtaining the communication encapsulation mode parameters are specifically as follows: S411: detecting the flow velocity measurement data in the current sampling period and the flow velocity measurement data in the previous sampling period according to the buffer space allocation parameter, calculating the change value of the flow velocity measurement data in adjacent periods, and obtaining the flow velocity change value; S412: Based on the flow velocity change value, by comparing the change direction of the flow velocity measurement data in consecutive periods, determining the consistency feature of the flow velocity change direction, and generating a flow velocity change consistency index; S413: Determine the fluctuation characteristics of the flow rate change according to the flow rate change consistency index, adjust the communication transmission configuration and corresponding data encapsulation parameters according to the fluctuation characteristics, and obtain communication encapsulation mode parameters.

2. The ultrasonic water meter multimodal signal interface output method according to claim 1, characterized in that: The flow rate measurement data set specifically includes water temperature segment information, propagation time information, and flow rate measurement values; the data verification results specifically include peak change trends, signal stability marks, and distortion signal marks; the buffer space allocation parameters include channel priority order, buffer start address, and buffer end address; the communication encapsulation mode parameters specifically include encapsulation mode type, timestamp format, and data frame length information.

3. The ultrasonic water meter multimodal signal interface output method according to claim 1, characterized in that: The steps for obtaining the data verification result are specifically as follows: S211: Detecting the flow velocity measurement data set, obtaining the maximum peak amplitude of the ultrasonic waveform in each measurement cycle, normalizing the maximum peak amplitude of each cycle and arranging them in chronological order to generate a peak amplitude sequence; S212: Based on the peak amplitude sequence, compare the maximum peak amplitude of the current cycle with the maximum peak amplitude of the previous cycle and calculate the difference, arrange the differences between adjacent cycles in sequence, and obtain a fluctuation difference sequence; S213: Calculate the signal stability according to the fluctuation difference sequence, identify and remove distorted signals, and obtain data verification results.

4. The ultrasonic water meter multimodal signal interface output method according to claim 1, characterized in that: The steps for obtaining the buffer space allocation parameters are specifically as follows: S311: Obtain the data verification result, detect the number of write records of the flow rate channel, temperature channel, voltage channel, and status channel in the same sampling period, accumulate the number of write records of each channel in multiple periods, and generate a total number of channel write records; S312: Based on the total number of channel writes, sequentially compare the number of writes to the flow rate channel, the temperature channel, the voltage channel, and the status channel, evaluate the activity of each channel in the data stream, and generate a channel activity ranking; S313: According to the channel activity order, the total number of channel write times is called, the memory allocation adjustment coefficient of each channel is calculated, the memory allocation of multiple channels is adjusted, and the buffer start address and end address pointers are updated to obtain the buffer space allocation parameters.

5. The ultrasonic water meter multimodal signal interface output method according to claim 1, characterized in that: The method further comprises: S5: Based on the communication encapsulation mode parameters, detect the data recorded by each data channel in the current cycle, compare each data with the corresponding data stored in the key field record table, determine the consistency of the field data, filter the difference fields and mark them as abnormal, send a data retransmission request, and obtain the abnormal frame tracing result; The abnormal frame tracing result specifically refers to the abnormal field name, field difference value, and retransmission trigger mark.

6. The ultrasonic water meter multimodal signal interface output method according to claim 5, characterized in that: The specific steps for obtaining the abnormal frame tracing result are: S511: Detecting the flow rate data, temperature data, voltage data, and status data recorded in the current cycle according to the communication encapsulation mode parameters, comparing each data item with the corresponding data stored in the key field record table, and obtaining a corresponding difference value of the field data; S512: Based on the corresponding difference values ​​of the field data, determine the degree of correspondence between each field data, filter out fields with data differences, and generate abnormal field information; S513: Mark the abnormal state according to the abnormal field information, output the abnormal state result, send a data retransmission request, and obtain the abnormal frame tracing result.

Citation Information

Patent Citations

  • Flow metering method of ultrasonic water meter

    CN116952318A

  • Intelligent monitoring method and system of Internet of Things ultrasonic water meter

    CN120213150A