Dynamic leakage monitoring and graded early warning system based on IoT smart gas meter
The IoT smart gas meter detects gas leaks during non-gas use periods, and combines pressure and temperature data to determine the degree of leakage. This solves the existing resource waste and safety hazard problems in gas leak detection, and realizes intelligent and efficient gas safety monitoring. change.
Patent Information
- Application Number
- CN202410676740.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2044-05-29
AI Technical Summary
Existing gas leakage detection methods have resource waste and safety hazards, and are difficult to accurately detect small leaks, affecting user safety and resource allocation efficiency.
A dynamic leakage monitoring and hierarchical early warning system based on the Internet of Things smart gas meter is used to find the non-gas time period through the distribution pattern of gas use periods in consecutive days as the gas leakage detection window period, combined with pressure and temperature data for detection, and using the minimum quadratic Multiplicative fitting is used to determine the degree of leakage and achieve automatic valve closing and early warning.
It improves the accuracy and efficiency of gas leakage detection, reduces resource waste, ensures the intelligence and efficiency of gas safety monitoring, and optimizes resource allocation.
Smart Images

Figure CN118247927B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of gas safety monitoring, and in particular relates to a dynamic leakage monitoring and graded early warning system based on an Internet of Things smart gas meter. Background Art
[0002] As a flammable and explosive energy source, gas leakage is common in homes, which not only wastes resources but also seriously threatens the safety of users' lives and property. At present, the main inspection schemes for detecting indoor gas leakage and the existing problems are detailed in Table 1.
[0003] Summary of the invention
[0004] In view of the problems existing in the prior art, the purpose of the present invention is to provide a technical solution of a dynamic leakage monitoring and graded early warning system based on an IoT smart gas meter. The user's non-gas usage time period is found by analyzing the distribution pattern of gas usage time periods for consecutive days. There may be multiple non-gas usage time periods. Among these non-gas usage time periods, the time period with the longest time span is found as the gas leak detection window period. During the window period, the valve closing command is executed to form a closed space in the pipe section, and the pressure change trend of the gas pipeline is detected. According to the pressure change trend and the graded early warning scheme, a timely early warning response is made.
[0005] The dynamic leakage monitoring and graded warning system based on the Internet of Things smart gas meter is characterized in that it includes an Internet of Things smart gas meter and a background system. The MCU processor of the Internet of Things smart gas meter finds the user's non-gas usage time period through the distribution law of gas usage time periods for consecutive days. There are one or more non-gas usage time periods, and finds the time period with the longest time span among these non-gas usage time periods as the gas leak detection window period; if the window period is not found, the graded warning information will be sent to the background system through the communication unit of the Internet of Things smart gas meter, and the MCU processor of the Internet of Things smart gas meter will continue to search for the window period; after finding the window period, within the window period, the display unit of the Internet of Things smart gas meter displays the words "self-checking", and the valve control unit of the Internet of Things smart gas meter controls the valve to close, forming a closed pipeline; the pressure and temperature detection unit of the Internet of Things smart gas meter records the temperature and pressure data in the closed pipeline, and the Internet of Things The MCU processor of the smart gas meter calculates the pressure change rate in the pipeline based on the temperature and pressure data; the MCU processor of the IoT smart gas meter compares the pressure change rate obtained in the previous step with the graded warning information stored in the storage unit of the IoT smart gas meter to determine whether the current gas is in a leakage state and the leakage grade; if the MCU processor of the IoT smart gas meter determines that there is no gas leakage, it will send a valve opening command to the valve control unit of the IoT smart gas meter after the gas leak detection window period, and the valve will open without affecting the user's normal gas use; if the MCU processor of the IoT smart gas meter determines that there is a gas leak, it will not send a valve opening command even after the gas leak detection window period, and the valve will remain in the closed state during detection, and the communication unit of the IoT smart gas meter will immediately send graded warning information to the background system, and the background system will send warning information to the user and notify the gas company to dispatch maintenance personnel for on-site safety inspection.
[0006] The dynamic leakage monitoring and graded early warning system based on the Internet of Things smart gas meter is characterized in that the Internet of Things smart gas meter includes an MCU processor, a pressure and temperature detection unit, a valve control unit, a clock unit, a storage unit, a metering unit, a communication unit, and a display unit, and the pressure and temperature detection unit, the valve control unit, the clock unit, the storage unit, the metering unit, the communication unit, and the display unit are connected to the MCU processor.
[0007] MCU processor: stores the collected data of each unit into the storage unit and analyzes the gas usage habits of users; if any abnormality is found during the window period, the communication unit will promptly report the warning information, control the valve control unit to close the valve, and display the working status of the meter through the display unit;
[0008] Pressure and temperature detection unit: collects temperature and pressure data of indoor pipes and uploads them to the MCU processor;
[0009] Valve control unit: receives the signal from the MCU processor and controls the valve to open or close;
[0010] Clock unit: provides the MCU processor with the working time of each functional unit by year, month, day, hour and minute;
[0011] Storage unit: stores temperature, pressure, flow, and time information pre-processed by the MCU processor; stores preset parameters for system analysis;
[0012] Communication unit: receives the gas leakage alarm signal sent by the MCU processor, sends the corresponding leakage alarm information to the background system; receives the instructions sent by the background system;
[0013] Metering unit: records gas usage data through metering sensors, and the MCU processor records and analyzes these data;
[0014] Display unit: displays the working status of the meter.
[0015] The method for implementing the dynamic leakage monitoring and graded early warning system based on the Internet of Things smart gas meter is characterized by comprising the following steps:
[0016] S0: The backend system registers gas facilities and user information, and then issues an account opening instruction;
[0017] S1: Before opening an account, the storage unit stores preset information, including sampling period and corrected pressure threshold;
[0018] S2: After the account is opened, the metering unit cooperates with the clock unit to record the user's gas usage time, calculate the user's non-gas usage time, and store it in the storage unit;
[0019] S3: Obtain the non-gas usage time of public users according to the non-gas usage time periods of users on the Mth day and the M+1th day;
[0020] S4: If the non-gas usage time period cannot be obtained, obtain the non-gas usage time of the user on the day M+2 again, and repeat step S3. If the non-gas usage time period still cannot be obtained, report the "unknown leakage" information, and contact the customer in the backend to investigate the abnormality;
[0021] S5: If the non-gas usage time period is obtained, calculate the duration of the non-gas usage time period for public users on the two days before and after;
[0022] S6: Taking 7 days as a cycle, vertically compare and determine whether the non-gas usage time period of the user on the same day of adjacent cycles can be used as the non-gas usage time of the user in this day and this period in each cycle, that is, the gas detection window period;
[0023] S7: After the first cycle of account opening, the MCU processor determines whether there is a gas leak detection window period on that day, and starts to detect the gas leak situation of the user on that day. The pressure and temperature detection unit starts to read the pressure and temperature data in the closed pipeline; if the display unit displays the words "self-testing" during the detection window period, and the user presses the button to open the valve to use gas during this period, S8 will be executed immediately;
[0024] S8: By comparing the corrected pressure difference with the gas leakage pressure difference threshold, it is determined whether it is a serious leak or a minor leak;
[0025] S9: The corrected pressure difference exceeds the threshold, and the MCU processor determines that there is a serious leak, immediately closes the valve, reports an alarm, and the background system executes the emergency plan;
[0026] S10: The corrected pressure difference does not exceed the threshold value, and there is a risk of a small leakage. The straight line is fitted by the least squares method using multiple sets of data, and the slope is used to determine whether there is a small leakage.
[0027] The method for implementing the dynamic leakage monitoring and graded early warning system based on the Internet of Things smart gas meter is characterized by the following specific steps:
[0028] S100: After the IoT smart gas meter is installed in the user's home, it is necessary to register the gas facilities in the user's home in the background system, including but not limited to single-burner stoves, double-burner stoves, gas water heaters, and wall-mounted boilers; after the IoT smart gas meter registers the user information in the background, the background system issues an account opening instruction or other instructions representing the account opening;
[0029] S101: IoT smart gas meter preset parameters include:
[0030] X p The maximum time interval of public non-gas use time, in minutes, see S105 for details; in order to save power consumption and take into account that the number of temperature and pressure sampling is not less than 3 times, the temperature and pressure data sampling period T can be configured. When the temperature and pressure data sampling period is T, the default is 2 minutes; when X p When >20, the sampling period of temperature and pressure data is T, and the default is 5 minutes; due to the influence of temperature on pressure, the maximum change range of pipeline pressure is set as a threshold , the threshold needs to be set based on the user's pipeline diameter, meter type and pressure sensor detection accuracy;
[0031] S102: When the built-in clock of the clock unit passes through zero, the MCU processor starts to record the gas usage status. If there is no data increase in the zero-point metering unit, the zero point is counted as , if there is data increase at zero point, then the zero point is counted as When the metering unit starts to have metering data, the MCU control unit records the start time of gas consumption. When the metering unit has no metering data, the MCU control unit records the end time of gas consumption. , where e represents the e-th start or end of gas use on the day, [ , ], recorded as [ , ], Represents the start time of the user's non-gas usage period in the nth period of the Mth day, Represents the end time of the user's non-gas usage period of the nth period on the Mth day; the MCU processor allocates data and stores it in the storage unit for subsequent use;
[0032] S103: Preset: Indicates the starting time and minute of the user's non-gas usage period in the nth period on the Mth day, Indicates the end time and minute of the non-gas usage time period of the nth user on the Mth day. There are four situations in which the Mth day and the (M+1)th day have a common non-gas usage time period:
[0033] 1) When When the MCU processor will be [ , ] is defined as , i.e., the effective gas leak detection window period common to the Mth day and the (M+1)th day, and this period is stored in the storage unit for subsequent calculation;
[0034] 2) When When the MCU processor will be [ , ] is defined as , i.e., the effective gas leak detection window period common to the Mth day and the (M+1)th day, and this period is stored in the storage unit for subsequent calculation;
[0035] 3) When When the MCU processor will be [ , ] is defined as , i.e., the effective gas leak detection window period common to the Mth day and the (M+1)th day, and this period is stored in the storage unit for subsequent calculation;
[0036] 4) When When the MCU processor will be [ , ] is defined as , i.e., the effective gas leak detection window period common to the Mth day and the (M+1)th day, and this period is stored in the storage unit for subsequent calculation;
[0037] in , (n is the nth period of non-gas-using time of the user on the (M+1)th day), i is only used for auxiliary calculation and has no real physical meaning;
[0038] The start times are arranged in order of start time, defined as ,in, , the k value is only used for array sorting and has no real physical meaning; when k≠0, proceed to step S105 and replace and , repeat step S103; when k=0, proceed to step S104;
[0039] S104: Continue to monitor the gas usage for (M+2) days and repeat S103; if k is still equal to 0, the MCU processor commands the communication unit to send a message of "there is a possibility of unknown leakage" to the background system. The background system determines whether the user has heating gas facilities such as wall-mounted boilers based on the registered user's gas facilities. If so, ignore this alarm information, otherwise contact the user to confirm whether there is a leakage, and even arrange for maintenance personnel to come to the door for maintenance;
[0040] S105: At the zero crossing point of the clock unit on the (M+2) day, a signal is uploaded to the MCU processor, and the MCU processor reads the data in the storage unit. Data, definition X p (Unit: min) indicates The time span is calculated by the formula It is calculated that, Indicates the value of the hour part of the end time data. Indicates the value of the minute portion of the end time data. Indicates the value of the hour part of the start time data. Indicates the value of the minute part of the start time data;
[0041] S106: Since most families in my country carry out production and living activities on a weekly basis, a 7-day cycle is used, and the first day of account opening is used as the benchmark. When the information uploaded by the clock unit is detected by the MCU as an integer number of cycles compared to the first day of account opening, a longitudinal comparison is performed. X p , the start time of non-gas usage and gas usage duration of the nth user on the first day of the first week are , the start time of non-gas usage and gas usage duration of the nth user on the first day of the second week are , and so on, the non-gas starting time and gas usage duration of the nth period of the user on Monday of the Wth week is , determine whether the non-gas-using time of the nth user on Monday of the Wth week and the non-gas-using time of the nth user on Monday of the (W-1)th week can be used as a reference for the gas leak detection window period;
[0042] S107: After the first seven-day cycle ends, when the MCU processor determines that the day contains a gas leak detection window period, the MCU extracts the corresponding gas leak detection window period. During the window period, the MCU processor records the valve state. When the valve state is open, the MCU processor sends a valve closing command to the valve control unit. The valve closes to form a closed pipeline space. The MCU processor then sends a command to measure the temperature and pressure data in the closed pipeline to the pressure and temperature detection unit, and the indoor gas leak detection begins.
[0043] 1) When When the pressure and temperature detection unit is The temperature data is detected once every moment and recorded as , the pressure data is recorded as , the temperature detection unit is Record the temperature and pressure data again at each time and record them as , ;
[0044] 2) When When the pressure and temperature detection unit is The temperature data is detected once every moment and recorded as , the pressure data is recorded as , let the temperature and pressure data measured by the pressure and temperature detection unit for the Nth time be , ,in , ;
[0045] 3) When When the pressure and temperature detection unit is The temperature data is detected once every moment and recorded as , the pressure data is recorded as , let the temperature and pressure data measured by the pressure and temperature detection unit for the Nth time be , , , ;
[0046] S108: The MCU processor extracts the data pair in the storage unit ( , ), through the formula Calculate the calibrated pressure value and determine the pressure difference , To set the threshold, When , step S109 is executed. When , execute step S110; wherein The added absolute value is the effect of the change in indoor closed pipe pressure caused by temperature change, where: Determined based on the maximum corrected pressure change when a small leak occurs in an indoor closed pipe;
[0047] S109: The MCU processor determines that there is a serious gas leakage accident in the indoor closed pipeline. After the gas leakage detection window period, the MCU processor sends a valve closing command to the valve control unit, and the button cannot open the valve. The MCU processor reports the "serious leakage" information of the pipeline to the background system through the communication module, and the background system dispatches security inspection and repair personnel to troubleshoot the fault;
[0048] S110: The MCU processor converts all calculated corrected pressure and time data sets ( ), fitted into a straight line on the PT coordinate system, the fitting algorithm uses the least squares algorithm, and the expression of the fitted straight line is: , where C is the slope of the line, b is the intercept of the line, and NT represents the Nth period;
[0049] When C=0, the MCU processor determines that the sealing of the indoor pipeline is normal at this time. After the gas leak detection window period, the MCU unit sends a valve opening command to the valve control unit, and the valve opens without affecting the user's normal gas use; when C<0, the MCU determines that there is a small leak in the indoor closed pipeline. At this time, the MCU processor sends a command to keep the valve closed to the valve control unit after the gas leak detection window period. The valve remains closed and cannot be opened by pressing the button. The MCU processor reports the linear leakage C value and the "small leak" signal to the background system through the communication module. The background system determines the extent of the gas leakage based on the uploaded data and reasonably allocates human resources for security inspection; when C>0, this situation basically does not occur. If it occurs, it is most likely caused by a sharp drop in ambient temperature or a failure of the meter. The communication unit uploads the "C>0" information to the background system, and the background system arranges maintenance personnel to perform on-site maintenance.
[0050] The implementation method of the dynamic leakage monitoring and graded early warning system based on the Internet of Things smart gas meter is characterized in that the specific judgment method in step S106 is as follows:
[0051] Calculate the variance of the nth period of non-gas use every Monday over the past W weeks , if the variance If an increase occurs while approaching 0, perform the following steps:
[0052] Determine whether the non-gas-using period of the nth user on Monday of the Wth week is similar to the non-gas-using period of the nth user on Monday of the (W-1)th week. The determination method is as follows:
[0053] 1) Calculate the start time variance, let , ; Calculate the end time variance , ;
[0054] 2) Only when and When both approach 0 regularly with the measurement period, it is judged For the duration of the first natural gas leak detection window in each cycle, the MCU calculates MAX{ }, the specific time period is [ , +MAX{ Repeat step S106 on the second, third, fourth, fifth, sixth, and seventh days of each cycle to determine the gas leak detection window period, and store it in the storage unit through the MCU processor; if As the comparison period gradually stops approaching 0, step S106 is repeated.
[0055] The method for implementing the dynamic leakage monitoring and graded early warning system based on the Internet of Things smart gas meter is characterized in that: when executing step 107, the user suddenly uses the gas equipment and finds that there is no gas output. After the user eliminates the possible abnormality by himself, the user will observe the meter display unit and observe that the display unit continues to display the words "self-checking"; the background system will also be directly queried, and the background will inform the user to observe whether the gas meter display unit displays "self-checking". If the user needs to open the valve for gas, press the gas meter valve opening button, and the MCU sends an instruction to stop detecting the temperature and pressure data, and organize the measured temperature and pressure data to proceed to step S108. If no abnormal leakage is detected, the valve is opened for ventilation, and step S103 is executed to calculate the user's non-gas use time. If a serious leak or a small leak is detected, the reporting step in step S109 or S110 is executed; if the user does not need to open the valve for gas, a complete gas detection is performed.
[0056] The present invention innovatively utilizes continuous monitoring of the temperature and pressure of the entire closed gas pipeline indoors to accurately detect whether there is a gas leak. This method greatly improves the accuracy and efficiency of detection. Since the temperature and pressure changes in the closed pipeline are measured, interference from external environmental factors such as oil smoke is effectively isolated, making the monitoring data more accurate and reliable. Crucially, the solution uses temperature correction to accurately monitor pressure, which increases the sensitivity of monitoring small pressure fluctuations by an order of magnitude, thereby effectively eliminating the interference of temperature fluctuations on pressure readings. This measure greatly improves the sensitivity and accuracy of leak monitoring in actual applications.
[0057] Once an abnormality is detected, the background system will immediately analyze the possible extent of the leak based on the reported data, and reasonably dispatch maintenance and rescue personnel accordingly, which not only ensures the response speed, but also avoids the over-allocation and waste of resources. In short, this solution has achieved intelligent and efficient gas safety monitoring through technological innovation, while optimizing resource allocation, which is a major advancement in the field of modern smart home security. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 It is the work flow chart of the present invention. DETAILED DESCRIPTION
[0059] The present invention will be further described below in conjunction with the accompanying drawings:
[0060] The dynamic leakage monitoring and graded early warning system based on the Internet of Things smart gas meter of the present invention comprises an Internet of Things smart gas meter and a background system. The Internet of Things smart gas meter comprises an MCU processor, a pressure and temperature detection unit, a valve control unit, a clock unit, a storage unit, a metering unit, a communication unit, and a display unit. The pressure and temperature detection unit, the valve control unit, the clock unit, the storage unit, the metering unit, the communication unit, and the display unit are connected to the MCU processor. The Internet of Things smart gas meter reports information to the background system through wireless reporting by the communication unit. The storage unit records the user's gas usage data detected by the metering unit and monitored by the metering sensor. The MCU processor records the user's gas usage data and the gas usage time and the gas outage time through the clock unit and the metering unit. The MCU processor finds the user's non-gas usage time period through the distribution law of gas usage time periods for consecutive days. There may be one or more non-gas usage time periods. The time period with the longest time span is found in these non-gas usage time periods as the gas leakage detection window period. If the window period is not found, the graded early warning information will also be sent to the background system through the communication unit, and the MCU processor will still continue to search for the window period. During the window period, the display unit displays words such as "self-checking", and the valve control unit controls the valve to close, forming a closed pipeline; the pressure and temperature detection unit records the temperature and pressure data in the closed pipeline, and the MCU processor calculates the pressure change rate in the pipeline based on the temperature and pressure data; the MCU processor compares the pressure change rate obtained in the previous step with the graded warning information stored in the storage unit to determine whether the current gas is in a leakage state and the leakage grade; if the MCU processor determines that there is no gas leakage, it will send a valve opening command to the valve control unit after the gas leak detection window period, and the valve will open without affecting the user's normal gas use. If the MCU processor determines that there is a gas leak, it will not send a valve opening command even after the gas leak detection window period, and the valve will remain in the closed state during detection, and the communication unit will immediately send graded warning information to the background system, and the background system will send warning information to the user and notify the gas company to send maintenance personnel to conduct on-site safety inspections.
[0061] The IoT smart gas meter includes an MCU processor, a pressure and temperature detection unit, a valve control unit, a clock unit, a storage unit, a metering unit, a communication unit, and a display unit. The pressure and temperature detection unit, the valve control unit, the clock unit, the storage unit, the metering unit, the communication unit, and the display unit are connected to the MCU processor, and the operation of each unit is controlled by the MCU processor.
[0062] MCU processor: stores the collected data of each unit into the storage unit and analyzes the user's gas usage habits; if any abnormality is found during the window period, the communication unit will promptly report the warning information, control the valve control unit to close the valve, and display the working status of the meter through the display unit.
[0063] Pressure and temperature detection unit: collects temperature and pressure data of indoor pipes and uploads them to the MCU processor.
[0064] Valve control unit: receives the signal sent by the MCU processor and controls the valve to open or close.
[0065] Clock unit: provides the MCU processor with the working time of each functional unit by year, month, day, hour and minute.
[0066] Storage unit: stores temperature, pressure, flow, and time information preprocessed by the MCU processor; stores preset parameters for system analysis.
[0067] Communication unit: receives the gas leakage alarm signal sent by the MCU processor, sends the corresponding leakage alarm information to the background system; receives the instructions sent by the background system.
[0068] Metering unit: The gas usage data is recorded through the metering sensor, and the MCU processor records and analyzes this data.
[0069] Display unit: displays the working status of the meter.
[0070] The implementation method of the dynamic leakage monitoring and graded early warning system based on the Internet of Things smart gas meter includes the following steps:
[0071] S0: The backend system registers gas facilities and user information, and then issues an account opening instruction;
[0072] S1: Before opening an account, the storage unit stores preset information, including sampling period and corrected pressure threshold;
[0073] S2: After the account is opened, the metering unit cooperates with the clock unit to record the user's gas usage time, calculate the user's non-gas usage time, and store it in the storage unit;
[0074] S3: Obtain the non-gas usage time of public users according to the non-gas usage time periods of users on the Mth day and the M+1th day;
[0075] S4: If the non-gas usage time period cannot be obtained, obtain the non-gas usage time of the user on the day M+2 again, and repeat step S3. If the non-gas usage time period still cannot be obtained, report the "unknown leakage" information, and contact the customer in the backend to investigate the abnormality;
[0076] S5: If the non-gas usage time period is obtained, calculate the duration of the non-gas usage time period for public users on the two days before and after;
[0077] S6: Taking 7 days as a cycle, vertically compare and determine whether the non-gas usage time period of the user on the same day of adjacent cycles can be used as the non-gas usage time of the user in this day and this period in each cycle, that is, the gas detection window period;
[0078] S7: After the first cycle of account opening, the MCU processor determines whether there is a gas leak detection window period on that day, and starts to detect the gas leak situation of the user on that day. The pressure and temperature detection unit starts to read the pressure and temperature data in the closed pipeline; if the display unit displays the words "self-testing" during the detection window period, and the user presses the button to open the valve to use gas during this period, S8 will be executed immediately;
[0079] S8: By comparing the corrected pressure difference with the gas leakage pressure difference threshold, it is determined whether it is a serious leak or a minor leak;
[0080] S9: The corrected pressure difference exceeds the threshold, and the MCU processor determines that there is a serious leak, immediately closes the valve, reports an alarm, and the background system executes the emergency plan;
[0081] S10: The corrected pressure difference does not exceed the threshold value, and there is a risk of a small leakage. The straight line is fitted by the least squares method using multiple sets of data, and the slope is used to determine whether there is a small leakage.
[0082] When the present invention is specifically implemented, the following steps are performed:
[0083] S100: After the IoT smart gas meter is installed in the user's home, it is necessary to register the gas facilities in the user's home in the background system, including but not limited to single-burner stoves, double-burner stoves, gas water heaters, and wall-mounted boilers; after the IoT smart gas meter registers the user information in the background, the background system issues an account opening instruction or other instructions representing the account opening.
[0084] S101: IoT smart gas meter preset parameters include:
[0085] X p The maximum time interval of public non-gas use time, in minutes, see S105 for details; in order to save power consumption and take into account that the number of temperature and pressure sampling is not less than 3 times, the temperature and pressure data sampling period T can be configured. When the temperature and pressure data sampling period is T, the default is 2 minutes; when X p >20, the temperature and pressure data sampling period is T, the default is 5 minutes; considering the impact of temperature on pressure, the scheme sets the maximum variation range of pipeline pressure as a threshold , it is necessary to comprehensively judge and set the threshold based on the user's pipeline diameter, meter type and pressure sensor detection accuracy.
[0086] S102: When the built-in clock of the clock unit passes through zero, the MCU processor starts to record the gas usage status. If there is no data increase in the zero-point metering unit, the zero point is counted as , if there is data increase at zero point, then the zero point is counted as When the metering unit starts to have metering data, the MCU control unit records the start time of gas consumption. When the metering unit has no metering data, the MCU control unit records the end time of gas consumption. , where e represents the e-th start or end of gas use on the day, [ , ], recorded as [ , ], Represents the start time of the user's non-gas usage period in the nth period of the Mth day, Represents the end time of the user's non-gas usage period of the nth period on the Mth day; the MCU processor allocates data and stores it in the storage unit for subsequent use.
[0087] S103: Preset: Indicates the starting time and minute of the user's non-gas usage period in the nth period of the Mth day, for example ; Indicates the end time and minute of the user's non-gas usage period in the nth period on the Mth day, for example ; There are four situations in which the Mth day and the (M+1)th day have a common non-gas usage time period:
[0088] 1) When When the MCU processor will be [ , ] is defined as , i.e., the effective gas leak detection window period common to the Mth day and the (M+1)th day, and this period is stored in the storage unit for subsequent calculation;
[0089] 2) When When the MCU processor will be [ , ] is defined as , i.e., the effective gas leak detection window period common to the Mth day and the (M+1)th day, and this period is stored in the storage unit for subsequent calculation;
[0090] 3) When When the MCU processor will be [ , ] is defined as , i.e., the effective gas leak detection window period common to the Mth day and the (M+1)th day, and this period is stored in the storage unit for subsequent calculation;
[0091] 4) When When the MCU processor will be [ , ] is defined as , i.e., the effective gas leak detection window period common to the Mth day and the (M+1)th day, and this period is stored in the storage unit for subsequent calculation;
[0092] in , (n is the nth period of non-gas-using time of the user on the (M+1)th day), i is only used for auxiliary calculation and has no real physical meaning;
[0093] The start times are arranged in order of start time, defined as ,in, , the k value is only used for array sorting and has no real physical meaning; when k≠0, proceed to step S105 and replace and , repeat step S103; when k=0, proceed to step S104.
[0094] S104: Continue to monitor the gas usage for (M+2) days and repeat S103; if k is still equal to 0, the MCU processor commands the communication unit to send a message of "there is a possibility of unknown leakage" to the background system. The background system determines whether the user has heating gas facilities such as wall-mounted boilers based on the registered user gas facilities. If so, ignore this alarm information, otherwise contact the user and confirm whether there is a leakage, and even arrange for maintenance personnel to come to the door for maintenance.
[0095] S105: At the zero crossing point of the clock unit on the (M+2) day, a signal is uploaded to the MCU processor, and the MCU processor reads the data in the storage unit. Data, definition X p (Unit: min) indicates The time span is calculated by the formula It is calculated that, Indicates the value of the hour part of the end time data. Indicates the value of the minute portion of the end time data. Indicates the value of the hour part of the start time data. The value representing the minute portion of the start time data.
[0096] S106: Since most families in my country carry out production and living activities on a weekly basis, a 7-day cycle is used, and the first day of account opening is used as the benchmark. When the information uploaded by the clock unit is detected by the MCU as an integer number of cycles compared to the first day of account opening, a longitudinal comparison is performed. X p , the start time of non-gas usage and gas usage duration of the nth user on the first day of the first week are , the start time of non-gas usage and gas usage duration of the nth user on the first day of the second week are , and so on, the non-gas starting time and gas usage duration of the nth period of the user on Monday of the Wth week is , determine whether the non-gas-using time of the nth user on Monday of the Wth week and the non-gas-using time of the nth user on Monday of the (W-1)th week can be used as a reference for the gas leak detection window period. The specific determination method is as follows:
[0097] Calculate the variance of the nth period of non-gas use every Monday over the past W weeks , if the variance If an increase occurs while approaching 0, perform the following steps:
[0098] Determine whether the non-gas-using period of the nth user on Monday of the Wth week is similar to the non-gas-using period of the nth user on Monday of the (W-1)th week. The determination method is as follows:
[0099] 1) Calculate the start time variance, let ; Calculate the end time variance ;
[0100] 2) Only when When both approach 0 regularly with the measurement period, it is judged The MCU calculates the duration of the first natural gas leak detection window in each cycle. The specific time period is Repeat step S106 on the second, third, fourth, fifth, sixth, and seventh days of each cycle to determine the gas leak detection window period, and store it in the storage unit through the MCU processor; if As the comparison period gradually stops approaching 0, step S106 is repeated.
[0101] S107: After the first seven-day cycle ends, when the MCU processor determines that the day contains a gas leak detection window period, the MCU extracts the corresponding gas leak detection window period. During the window period, the MCU processor records the valve state. When the valve state is open, the MCU processor sends a valve closing command to the valve control unit. The valve closes to form a closed pipeline space. The MCU processor then sends a command to measure the temperature and pressure data in the closed pipeline to the pressure and temperature detection unit, and the indoor gas leak detection begins.
[0102] 1) When When the pressure and temperature detection unit is The temperature data is detected once every moment and recorded as , the pressure data is recorded as , the temperature detection unit is Record the temperature and pressure data again at each time and record them as , ;
[0103] 2) When When the pressure and temperature detection unit is The temperature data is detected once every moment and recorded as , the pressure data is recorded as , let the temperature and pressure data measured by the pressure and temperature detection unit for the Nth time be , ,in , ;
[0104] 3) When When the pressure and temperature detection unit is The temperature data is detected once every moment and recorded as , the pressure data is recorded as , let the temperature and pressure data measured by the pressure and temperature detection unit for the Nth time be , , , .
[0105] When a user uses a gas device and finds that there is no gas output, after the user has eliminated possible abnormalities, he or she will most likely observe the meter display unit, and observe that the display unit continues to display the words "self-checking". The user may also directly inquire the background system, and the background will tell the user to observe whether the gas meter display unit displays "self-checking". If the user needs to open the valve to use gas, press the gas meter valve opening button, and the MCU will issue an instruction to stop detecting the temperature and pressure data, and organize the measured temperature and pressure data to proceed to step S108. If no abnormal leakage is detected, the valve is opened for ventilation, and step S103 is executed to calculate the user's non-gas time. If a serious leak or a small leak is detected, the reporting step in step S109 or S110 is executed. If the user does not need to open the valve to use gas, a complete gas test is performed.
[0106] S108: The MCU processor extracts the data pair in the storage unit ( , ), as the temperature of the pipeline working environment increases, the molecular movement speed increases, which increases the pipeline pressure. According to the known principle, it is necessary to use the gas equation Calculate the calibrated pressure value and then calculate the pressure difference , To set the threshold, When , execute step S109, when When , execute step S110; wherein The added absolute value is the effect of the change in indoor closed pipe pressure caused by temperature change, where: It is determined based on the maximum corrected pressure change when a small leak occurs in an indoor closed pipe.
[0107] S109: The MCU processor determines that there is a serious gas leakage accident in the indoor closed pipeline. After the gas leakage detection window period, the MCU processor sends a valve closing command to the valve control unit, and the button cannot open the valve. The MCU processor reports the "serious leakage" information of the pipeline to the background system through the communication module, and the background system dispatches security inspection and repair personnel to troubleshoot the problem.
[0108] S110: The MCU processor converts all calculated corrected pressure and time data sets ( ), fit into a straight line on the PT coordinate system, the fitting algorithm uses the least squares algorithm (the STM32 microcontroller can already independently implement the least squares algorithm, which will not be described here), and the expression of the fitted straight line is: , where C is the slope of the straight line, b is the intercept of the straight line, and NT represents the Nth period.
[0109] When C=0, the MCU processor determines that the sealing of the indoor pipeline is normal at this time. After the gas leak detection window period, the MCU unit sends a valve opening command to the valve control unit, and the valve opens without affecting the user's normal gas use; when C<0, the MCU determines that there is a small leak in the indoor closed pipeline. At this time, the MCU processor sends a command to keep the valve closed to the valve control unit after the gas leak detection window period. The valve remains closed and cannot be opened by pressing the button. The MCU processor reports the linear leakage C value and the "small leak" signal to the background system through the communication module. The background system determines the extent of the gas leakage based on the uploaded data and reasonably allocates human resources for security inspection; when C>0, this situation basically does not occur. If it occurs, it is most likely caused by a sharp drop in ambient temperature or a failure of the meter. The communication unit uploads the "C>0" information to the background system, and the background system arranges maintenance personnel to perform on-site maintenance.
[0110] The present invention aims to integrate the alarm system with the smart gas meter, which not only reduces the installation cost but also significantly improves the implementation efficiency. The smart gas meter can learn and adapt to the user's gas usage habits, thereby intelligently setting the best time for gas monitoring. This effectively solves the problems caused by traditional timed detection or detection that requires manual valve closure, ensures that the detection period does not conflict with the user's actual gas usage time, and improves the user experience.
Claims
1. Dynamic leakage monitoring and graded early warning system based on IoT smart gas meter, characterized by The implementation method includes the following steps: S0: The backend system registers gas facilities and user information, and then issues an account opening instruction; S1: Before opening an account, the storage unit stores preset information, including the sampling period and the corrected pressure threshold; S2: After the account is opened, the metering unit cooperates with the clock unit to record the user's gas usage time, calculate the user's non-gas usage time, and store it in the storage unit; S3: Obtain the public user non-gas usage time based on the user non-gas usage time periods on the Mth day and the M+1th day; S4: If the non-gas usage time period cannot be obtained, obtain the user's non-gas usage time on the M+2 day again and repeat step S3. If the non-gas usage time period still cannot be obtained, report the "unknown leak" information and contact the customer in the backend to investigate the anomaly. S5: If the non-gas usage time period is obtained, calculate the duration of the non-gas usage time period for public users on the two days before and after; S6: Using a 7-day cycle, perform a longitudinal comparison to determine whether the user's non-gas usage time period on the same day in adjacent cycles can be used as the user's non-gas usage time period on this day in each cycle, i.e., the gas detection window period; S7: After the first account opening cycle, the MCU processor determines whether there is a gas leak detection window on that day and begins detecting gas leaks for that day. The pressure and temperature detection unit begins reading the pressure and temperature data in the closed pipeline. If the display unit displays "Self-Testing" within the detection window, and the user presses a button to open the valve for gas use during this period, S8 will be executed immediately. S8: By comparing the corrected pressure difference with the gas leakage pressure difference threshold, it is determined whether it is a serious leak or a minor leak; S9: If the corrected pressure difference exceeds the threshold, the MCU processor determines that there is a serious leak, immediately closes the valve, reports an alarm, and the backend system executes the emergency plan; S10: The corrected pressure difference does not exceed the threshold, indicating a potential small leak. A straight line is fitted using the least squares method using multiple sets of data, and the slope is used to determine whether there is a small leak. The specific steps are as follows: S100: After the IoT smart gas meter is installed in the user's home, the user's gas facilities in the home need to be registered in the background system, including but not limited to single-burner stoves, double-burner stoves, gas water heaters, and wall-mounted boilers; After the IoT smart gas meter registers the user information in the background, the background system issues an account opening instruction or other instructions on behalf of the account opening; S101: IoT smart gas meter preset parameters include: X p The maximum time interval of public non-gas time, in minutes, see S105 for details; in order to save power consumption while taking into account the temperature and pressure sampling times of not less than 3 times, the temperature and pressure data sampling period T can be configured. When the temperature and pressure data sampling period is T, the default is 2 minutes; when X p When the temperature is greater than 20, the sampling period of temperature and pressure data is T, which is 5 minutes by default. Due to the influence of temperature on pressure, the maximum variation range of pipeline pressure is set as a threshold. , the threshold needs to be determined and set based on the user's pipeline diameter, meter type, and pressure sensor detection accuracy; S102: When the built-in clock of the clock unit passes zero, the MCU processor starts to record the gas usage status. If there is no data increase in the zero point metering unit, the zero point is counted as If there is data increase at zero point, then the zero point is counted as When the metering unit starts to have metering data, the MCU control unit records the gas start time When the metering unit has no metering data, the MCU control unit records the end time of gas use. , where e represents the e-th start or end of gas use on the day, [ , ], recorded as [ , ], Represents the start time of the user's non-gas usage period in the nth period of the Mth day, Represents the end time of the user's non-gas usage period in the nth period of the Mth day; the MCU processor allocates data and stores it in the storage unit for subsequent use; S103: Preset: Indicates the starting time and minute of the user's non-gas usage period in the nth period on the Mth day, Indicates the end time and minute of the user's non-gas usage period for the nth segment on the Mth day. There are four situations in which the Mth day and the (M+1) day share a non-gas usage period: 1) When When the MCU processor will , ] is defined as , i.e., the effective gas leak detection window period on the Mth day and the (M+1)th day, and this period is stored in the storage unit for subsequent calculations; 2) When When the MCU processor will , ] is defined as , i.e., the effective gas leak detection window period on the Mth day and the (M+1)th day, and this period is stored in the storage unit for subsequent calculations; 3) When When the MCU processor will be [ , ] is defined as , i.e., the effective gas leak detection window period on the Mth day and the (M+1)th day, and this period is stored in the storage unit for subsequent calculations; 4) When When the MCU processor will be [ , ] is defined as , i.e., the effective gas leak detection window period on the Mth day and the (M+1)th day, and this period is stored in the storage unit for subsequent calculations; in , (n is the nth period of non-gas usage by the user on the (M+1)th day), i is only used to assist calculations and has no real physical meaning; The start times are arranged in chronological order according to the start time, defined as ,in, , the k value is only used for array sorting and has no real physical meaning; when k≠0, proceed to step S105 and use replace and , repeat step S103; when k=0, proceed to step S104; S104: Continue monitoring gas usage for (M+2) days and repeat S103. If k is still equal to 0, the MCU processor instructs the communication unit to send a "possible unknown leak" message to the backend system. The backend system determines whether the user has heating facilities such as wall-mounted boilers based on the registered user's gas facilities. If so, the alarm message is ignored. Otherwise, the user is contacted to confirm whether there is a leak, and maintenance personnel may even be arranged for on-site inspection. S105: On the (M+2) day, the clock unit passes through zero and uploads a signal to the MCU processor, and the MCU processor reads the data in the storage unit. Data, definition X p (Unit: min) indicates The time span is calculated by the formula It is calculated that, Indicates the hour value in the end time data. Indicates the minute value of the end time data. Indicates the value of the hour part in the start time data. Indicates the value of the minute part of the start time data; S106: Since most families in my country carry out production and life activities on a weekly basis, a 7-day cycle is used, and the first day of account opening is used as the benchmark. When the information uploaded by the clock unit is detected by the MCU as an integer number of cycles compared to the first day of account opening, a longitudinal comparison is performed. X p , the start time of non-gas use and gas use duration of user n in period on the first day of week 1 are , the start time of non-gas use and gas use duration of user n in period on the first day of the second week are , and so on, the non-gas usage start time and gas usage duration of the nth period user on Monday of week W is , determine whether the user non-gas usage time in the nth period on Monday of week W and the user non-gas usage time in the nth period on Monday of week (W-1) can be used as a reference for the gas leak detection window period; S107: After the first seven-day period ends, if the MCU processor determines that the day contains a gas leak detection window period, the MCU extracts the corresponding gas leak detection window period. During the window period, the MCU processor records the valve status. When the valve status is open, the MCU processor sends a valve closing command to the valve control unit. The valve closes, forming a closed pipe space. The MCU processor then sends a command to the pressure and temperature detection unit to measure the temperature and pressure data in the closed pipe, and indoor gas leak detection begins. 1) When When the pressure and temperature detection unit is The temperature data is detected once every moment and recorded as , the pressure data is recorded as , the temperature detection unit is Record the temperature and pressure data again at each moment and record them as , ; 2) When When the pressure and temperature detection unit is The temperature data is detected once every moment and recorded as , the pressure data is recorded as , let the temperature and pressure data measured by the pressure and temperature detection unit for the Nth time be , ,in , ; 3) When When the pressure and temperature detection unit is The temperature data is detected once every moment and recorded as , the pressure data is recorded as , let the temperature and pressure data measured by the pressure and temperature detection unit for the Nth time be , , , ; S108: The MCU processor extracts the data from the storage unit ( , ), through the formula Calculate the calibrated pressure value and determine the pressure difference , To set the threshold, When , step S109 is executed. When , step S110 is executed; wherein The added absolute value is to remove the impact of changes in indoor closed pipe pressure caused by temperature changes, among which, Determined based on the maximum corrected pressure change when a small leak occurs in an indoor closed pipe; S109: The MCU processor determines that there is a serious gas leak in the indoor closed pipeline. After the gas leak detection window period, the MCU processor sends a command to the valve control unit to keep the valve closed. The key cannot open the valve. The MCU processor reports the "serious leak" information of the pipeline to the backend system through the communication module. The backend system dispatches security inspection and repair personnel to troubleshoot the problem. S110: The MCU processor converts all the calculated corrected pressure and time data sets ( ), it is fitted into a straight line in the PT coordinate system. The fitting algorithm uses the least squares algorithm, and the expression of the fitted straight line is: , where C is the slope of the line, b is the intercept of the line, and NT represents the Nth period; When C=0, the MCU processor determines that the indoor pipeline is normally sealed at this time. After the gas leak detection window period, the MCU unit sends a valve opening command to the valve control unit. The valve opens and does not affect the user's normal gas use. When C<0, the MCU determines that there is a small leak in the indoor closed pipeline. At this time, the MCU processor sends a command to keep the valve closed to the valve control unit after the gas leak detection window period. The valve remains closed and cannot be opened by pressing the button. The MCU processor reports the linear leakage C value and the "small leak" signal to the background system through the communication module. The background system determines the extent of the gas leak based on the uploaded data and reasonably allocates human resources for security inspection. When C>0, the communication unit uploads the "C>0" information to the background system, and the background system arranges maintenance personnel to perform on-site maintenance.
2. The dynamic leakage monitoring and graded early warning system based on the Internet of Things smart gas meter according to claim 1 is characterized in that Including the Internet of Things smart gas meter and the background system, the MCU processor of the Internet of Things smart gas meter finds the user's non-gas usage time period through the distribution pattern of gas usage time periods for consecutive days. There are one or more non-gas usage time periods. Among these non-gas usage time periods, the time period with the longest time span is found as the gas leak detection window period; if the window period is not found, the communication unit of the Internet of Things smart gas meter will also send graded early warning information to the background system, and the MCU processor of the Internet of Things smart gas meter will continue to search for the window period; after finding the window period, within the window period, the display unit of the Internet of Things smart gas meter will display the words "self-testing", and the valve control unit of the Internet of Things smart gas meter will control the valve to close. After the formation, the pipeline is closed; the pressure and temperature detection unit of the IoT smart gas meter records the temperature and pressure data in the closed pipeline, and the MCU processor of the IoT smart gas meter calculates the pressure change rate in the pipeline based on the temperature and pressure data; the MCU processor of the IoT smart gas meter compares the pressure change rate obtained in the previous step with the graded warning information stored in the storage unit of the IoT smart gas meter to determine whether the current gas is in a leaking state and the leakage grade; if the MCU processor of the IoT smart gas meter determines that there is no gas leak, it will send a valve opening command to the valve control unit of the IoT smart gas meter after the gas leak detection window period, and the valve will open without affecting the user's normal gas use; If the MCU processor of the IoT smart gas meter determines that a gas leak has occurred, it will not issue a valve opening command even after the gas leak detection window has passed. The valve will remain in the closed state during detection. The communication unit of the IoT smart gas meter will immediately send a graded warning message to the background system. The background system will send a warning message to the user and notify the gas company to send maintenance personnel to conduct on-site safety inspections.
3. The dynamic leakage monitoring and graded early warning system based on the Internet of Things smart gas meter according to claim 2 is characterized in that The IoT smart gas meter includes an MCU processor, a pressure and temperature detection unit, a valve control unit, a clock unit, a storage unit, a metering unit, a communication unit, and a display unit. The pressure and temperature detection unit, the valve control unit, the clock unit, the storage unit, the metering unit, the communication unit, and the display unit are connected to the MCU processor. MCU processor: stores the collected data from each unit into the storage unit and analyzes the user's gas usage habits. If any abnormality is found during the window period, the communication unit promptly reports the warning information, controls the valve control unit to close the valve, and displays the meter's working status on the display unit. Pressure and temperature detection unit: collects temperature and pressure data of indoor pipes and uploads them to the MCU processor; Valve control unit: receives signals from the MCU processor and controls the valve to open or close; Clock unit: provides the MCU processor with the working time of each functional unit by year, month, day, hour and minute; Storage unit: stores temperature, pressure, flow, and time information pre-processed by the MCU processor; stores preset parameters for system analysis; Communication unit: Receives gas leakage alarm signals from the MCU processor and sends corresponding leakage alarm information to the background system; receives instructions from the background system; Metering unit: records gas usage data through metering sensors, and the MCU processor records and analyzes this data; Display unit: displays the working status of the meter.
4. The method for implementing the dynamic leakage monitoring and graded early warning system based on the Internet of Things smart gas meter according to claim 1 is characterized in that The specific determination method in step S106 is as follows: Calculate the variance of the nth period of non-gas use every Monday over the past W weeks , if the variance If an increase occurs while approaching 0, perform the following steps: Determine whether the non-gas usage period of the nth segment of the Monday of the Wth week is close to the non-gas usage period of the nth segment of the Monday of the (W-1)th week. The determination method is as follows: 1) Calculate the variance of the starting time, let , ; Calculate the end time variance , ; 2) Only when and When the values of For the duration of the first natural gas leak detection window in each cycle, MCU calculates MAX{ }, the specific time period is [ , +MAX{ Repeat step S106 on the second, third, fourth, fifth, sixth and seventh days of each cycle to determine the gas leak detection window period, and store it in the storage unit through the MCU processor; if As the comparison period gradually becomes less close to 0, step S106 is repeated.
5. The method for implementing the dynamic leakage monitoring and graded early warning system based on the Internet of Things smart gas meter according to claim 1 is characterized in that: When executing step 107, the user suddenly uses the gas equipment and finds that there is no gas output. After the user eliminates the possible abnormality by himself, he will observe the meter display unit and find that the display unit continues to display the words "self-testing"; he will also directly inquire the background system, and the background will tell the user to observe whether the gas meter display unit shows "self-testing". If the user needs to open the valve to use gas, press the gas meter valve opening button, and the MCU will issue an instruction to stop detecting the temperature and pressure data, and organize the measured temperature and pressure data to proceed to step S108. If no abnormal leakage is detected, the valve is opened for ventilation, and step S103 is executed to calculate the user's non-gas use time. If a serious leak or a small leak is detected, the reporting step in step S109 or S110 is executed; if the user does not need to open the valve to use gas, a complete gas test is performed.
