Air source heat pump water heater-based guardianship monitoring method and system for old people living alone, storage medium and computer program product
By collecting data through built-in sensors in air source heat pump water heaters and combining it with edge cloud collaborative analysis, the problems of high hardware costs and insufficient intelligence in the monitoring of elderly people living alone have been solved. This has enabled precise monitoring of water usage behavior and hierarchical alarms, improving safety and energy efficiency.
Patent Information
- Application Number
- CN202511154661.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-18
- Publication Date
- 2025-11-21
AI Technical Summary
Existing technologies for monitoring elderly people living alone suffer from problems such as high hardware costs, complex installation, privacy concerns, high false detection rates, and the inability to achieve hierarchical linkage with public security platforms. Furthermore, the energy-saving strategies of water heaters lack intelligence.
By collecting data from the water flow switch, compressor current, and water tank temperature difference sensor built into the air source heat pump water heater, and combining it with edge lightweight neural networks and cloud-based circular neural networks, water usage behavior monitoring and abnormal alarms can be achieved. Furthermore, it can be linked with the public security platform through a hierarchical alarm interface to support energy-saving control.
It achieves low-cost, accurate monitoring of water use behavior with a low false alarm rate. It can automatically trigger a national standard alarm when the guardian is out of contact, shortening social rescue time and achieving significant energy-saving effects.
Smart Images

Figure CN120991467A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of smart home and Internet of Things technology, and in particular to a method, system, storage medium and computer program product for monitoring elderly people living alone based on an air source heat pump water heater. Background Technology
[0002] Since the beginning of the 21st century, my country's population aging rate has far exceeded the global average. The seventh national census shows that people aged 65 and above account for 14.2% of the total population, with the proportion of empty-nest and single-living elderly continuing to rise. Single-living elderly people lack real-time care from family members living with them, and are very likely to miss the best rescue window if accidents such as falls, fainting, fires, or water leaks occur. Although traditional emergency call buttons, wearable bracelets, and video surveillance have been commercialized, they still face three pain points: (1) they rely on the elderly to operate them actively or wear them for a long time, resulting in low compliance; (2) camera solutions have privacy concerns and complex wiring; (3) pure software-based "sedentary / fall detection" is easily affected by posture obstruction, algorithm misdetection, and device offline.
[0003] Academics and industry have attempted to infer the daily life status of the elderly through household water usage patterns. A Chinese patent published in 2015, CN104680716A, entitled "Home Emergency Rescue System Based on Water Consumption," directly adds a real-time water flow meter to the tap water inlet. If "emergency water consumption" or prolonged inactivity is detected, an alarm is sent to the caregiver. This solution is the first to map water usage behavior to vital signs, resulting in highly accurate water usage data. It is imperceptible to the elderly, does not infringe on their privacy, and is suitable for empty-nest households. However, its hardware cost is limited by the "real-time water flow meter," installation requires pipe modifications and is sensitive to water pressure fluctuations, the system only supports single SMS alarms, cannot be linked to a tiered public security platform, and does not consider deep integration with water heater operation.
[0004] Subsequent patents such as CN102646320B and CN109023847A proposed the concept of "remote monitoring of water usage by elderly people living alone / washing machine water usage," but most of them used external flow meters and failed to further reduce hardware costs or achieve collaboration between local inference and cloud-based self-learning models. For hot water scenarios, CN113936424A (Qingdao Haier) proposed the idea of "water heater + behavior recognition + active alarm," starting to utilize the water heater's own sensing resources; however, this solution still uses video / radar or flow meters as the core detection method, and has not yet fully utilized the readily available multi-physical parameters of air source heat pumps, nor has it established a hierarchical alarm escalation mechanism.
[0005] Air source heat pump water heaters (ASHP-WH) have been widely adopted in the past decade due to their advantages such as high efficiency, energy saving, and CO2 emission reduction. Mainstream products all incorporate a compressor drive board current sensor, inlet and outlet water temperature probes, and a protective reed flow switch. According to the user manual, this type of flow switch is designed for "water shortage shutdown" and "start / stop judgment," and its on / off time has a stable linear relationship with the actual inlet water volume. Compared to an external flow meter, the reed flow switch costs only one-tenth of the cost and does not require cutting copper pipes during installation, making it naturally suitable for "low-cost metering."
[0006] According to a 2021 user test conducted by EnergyVanguard, an 80-gallon (≈300L) household heat pump water heater consumed only 1002kWh of energy over two years, demonstrating that its insulation energy consumption accounts for a significant proportion of total energy consumption. If the insulation setting could be automatically lowered when the user is away for extended periods, energy consumption could be further reduced by 5%–15%. Currently, mainstream heat pump water heaters only offer a "holiday mode" or a fixed temperature setting, lacking intelligent energy-saving strategies that consider the behavior of elderly users when they are away from home.
[0007] The GB / T28181 series of national standards, implemented since 2012, provides a unified transmission and alarm interface for public security video surveillance networking. The 2022 version of the standard added a SIP-UDP / TCP alarm framework and XML alarm message format, allowing direct access to platforms such as police stations and community police offices via the China Standards Network. Currently, most home security cameras and fire detectors support this standard, but there are no mature products with national standard interfaces for home water heaters and water monitoring devices. Existing smart water heaters often only provide APP push notifications or SMS messages, lacking public security linkage and hierarchical escalation / de-escalation logic, resulting in the inability to automatically escalate to social assistance when guardians fail to respond in a timely manner. Meanwhile, researchers are attempting to introduce GB / T28181 into health monitoring for the elderly. A WebRTC-SIP compatible platform integrates fall detection cameras in a community elderly care project and reports anomalies using the national standard channel. This demonstrates that using the national standard for alarm uplink is a feasible and precedent-based technical approach.
[0008] Regarding smart home terminal security, group standards such as the "Technical Requirements for Security of Smart Home Gateways" issued by the Ministry of Industry and Information Technology recommend adding security chips at the sensor link level and signing sensor data with AES-CMAC or ECDSA to prevent sensors from being short-circuited or data from being tampered with. However, most existing water monitoring devices are single MCU designs, lacking edge encryption and hardware root of trust, resulting in insufficient system reliability. In addition, cloud-edge collaboration has become a development trend for low-power AI terminals. TinyML lightweight neural networks can achieve millisecond-level inference on MCUs with hundreds of kB of Flash and tens of kB of RAM, making them suitable for real-time activity recognition; cloud-based LSTM or Transformers can use long-cycle data for user behavior modeling, threshold adaptation, and OTA model push. However, in the specific field of water monitoring, only a few academic articles have verified the classification effect of TinyML on water meter pulses, and there are no commercially available water heaters that integrate the three sources of information—water flow switch pulses, compressor current, and temperature difference—to infer elderly activity in real time on the MCU. Summary of the Invention
[0009] To address the aforementioned technical issues, this invention aims to provide a monitoring method that deeply integrates air source heat pump water heaters with low-cost water flow pulse metering, edge-cloud collaborative intelligent identification, and hierarchical network alarms. This method enables precise monitoring of water usage behavior, immediate alarm for abnormalities, and energy-saving operation control for elderly people living alone without the need for additional expensive hardware, thereby improving home safety and equipment energy efficiency.
[0010] To achieve the above objectives, the present invention adopts the following technical solution:
[0011] A method for monitoring elderly people living alone based on an air source heat pump water heater includes the following steps:
[0012] S1. The closed pulse signal S1 is collected by the flow switch installed at the cold water inlet, and the real-time water consumption Q(t) is calculated according to the current flow-time conversion factor K.
[0013] S2. Synchronously collect the compressor input current I_c(t) and the temperature difference ΔT(t) between the upper and lower layers of the water tank, and combine Q(t), I_c(t), and ΔT(t) into a multi-dimensional feature vector V(t);
[0014] S3. Infer V(t) using a lightweight neural network on the edge side to obtain the elderly activity label L(t);
[0015] S4. After the end of each day, upload the total water consumption Q_d and activity tag sequence to the cloud recurrent neural network, update the personalized baseline μ±σ based on the samples of the most recent N days (N≥7), and send the threshold parameter to the edge end;
[0016] S5. When Q_d or L(t) deviates from the baseline threshold, a level one alarm is activated, and alarm information is sent to the guardian through at least two independent communication channels.
[0017] S6. If no alarm extinguishing instruction is received from the guardian within the preset period T1, the alarm will be upgraded to level two and the help request information and location data will be sent to the public security agency according to the alarm interface of GB / T28181.
[0018] S7. When the system detects that the elderly person has been without water for a continuous period of time ≥ T2, it automatically lowers the heat pump insulation temperature by ΔT_eco and restores the original set temperature t_pre minutes before the expected return home.
[0019] S8. During the daily water-free period, the control unit drives the solenoid valve to open for τ_ref seconds to inject a quantitative amount of water. The coefficient K is recalibrated by comparing the closing time obtained, and the integrity of the signature output by the water flow switch is verified. If the verification fails, the highest level alarm is triggered.
[0020] Preferably, step S1 uses a reed flow switch. The MCU captures the rising edge with a resolution of 1μs and accumulates the closing duration ΣΔt within a 100ms period. The instantaneous water consumption is calculated according to the formula ΔQ=K×ΣΔt and written into the cumulative metering value Q(t).
[0021] And / or, in step S2, a 50A range Hall current sensor is used to sample at 2kHz and the effective value I_c(t) is calculated within a 100ms window. At the same time, the temperature is collected every 0.5s using two DS18B20 sensors at the top and bottom and the difference is calculated to obtain ΔT(t). The three data are aligned on a 1s cycle and then normalized using a 24h sliding z-score.
[0022] Preferably, the lightweight neural network in step S3 adopts a 1-layer 16-unit GRU, global average pooling and two-level fully connected-Softmax structure, takes the feature sequence of the most recent 60s as input, infers five types of activities and outputs the label L(t) using the 3s mode de-jitter.
[0023] Preferably, in step S4, data is uploaded via MQTT-TLS and modeled in the cloud using a two-layer 32-unit LSTM. μ and σ are calculated using data from the most recent 14 days, with a default deviation coefficient k of 2.0. Upper and lower thresholds Θ_low and Θ_high are generated and sent out with ECDSA-SHA256 signatures.
[0024] Preferably, the Level 1 alarm in step S5 is sent simultaneously via SMS gateway and MQTT-push service. If the activity tag is "activity missing" or the daily water consumption deviation is detected within 120 seconds, the alarm will be triggered. d -μ|>kσ triggers an alarm, and SMS messages will be resent every 15 minutes and push notifications every 10 minutes until confirmation is received from the guardian;
[0025] And / or, the secondary alarm in step S6 is sent to the local public security platform using a GB / T28181 SIP message encrypted with AES-128-CBC, and a TTS voice dialing reminder is initiated to the guardian at the same time; if the public security does not respond within 30 minutes, it will be automatically resent, up to three times.
[0026] Preferably, step S7 is performed according to ΔT eco =min{ΔT min +α(τ idle -T2), ΔT max The temperature drop is adaptively determined, with a maximum of 10℃, and the preheating advance t_pre is dynamically calculated based on the historical heating rate; the temperature control PID suppresses frequent compressor start-stop within a ±0.5℃ dead zone.
[0027] Preferably, in step S8, the solenoid valve τ_ref = 5s is opened to inject 2L of calibration water in the early morning when there is no water usage, and K is calculated. meas =V ref / ΣΔt cal and with K new =(1-γ)K old +γK meas (γ=0.25) Sliding update coefficient; Simultaneously verify the AES-CMAC signature issued by the flow switch. If the signature verification fails, immediately trigger the highest level alarm and lock the valve.
[0028] Furthermore, the present invention also provides an air-source heat pump water heater monitoring system for implementing the method, the system comprising:
[0029] The air source heat pump circulation loop includes a compressor, a four-way valve, a finned heat exchanger, an electronic expansion valve, a shell-and-tube heat exchanger, and a gas-liquid separator.
[0030] A pressurized water tank thermally coupled to the shell-and-tube heat exchanger;
[0031] A flow switch installed at the cold water inlet is used to output a closed pulse signal S1;
[0032] The current sensing unit that collects the compressor current and the temperature sensing unit that collects the temperature difference between the upper and lower layers of the water tank;
[0033] A control unit configured to perform steps S1-S8 of claim 1;
[0034] The edge-side inference module employs a spiking neural network or a TinyML model.
[0035] The remote communication module includes at least a cellular data channel and a Wi-Fi / Ethernet channel;
[0036] The cloud server is used to run the recurrent neural network and send threshold parameters to the control unit;
[0037] A backup power supply is provided to maintain monitoring and communication functions for at least 24 hours in the event of a mains power outage.
[0038] Security elements are used to encrypt and sign the count of the closing pulses of the flow switch.
[0039] Furthermore, the present invention also provides a computer-readable storage medium having a computer program or instructions stored thereon, which, when executed by a processor, implement the method.
[0040] Furthermore, the present invention also provides a computer program product, including a computer program or instructions that, when executed by a processor, implement the method.
[0041] This invention, employing the aforementioned technical solution, synchronously collects three low-cost, easily obtainable physical quantities—the water flow switch pulse, compressor current, and water tank temperature difference—from the heat pump water heater. A lightweight neural network is embedded within the edge MCU to infer the elderly person's activity in real time. Combined with a cloud-based recurrent neural network that dynamically updates the personalized water usage baseline, this achieves high-precision, low-latency monitoring of the water usage behavior and vital signs of elderly people living alone. Compared to existing technologies relying on flow meters or camera equipment, this invention reduces hardware costs by approximately 80% and lowers the false alarm rate for anomaly identification to below 3% through multi-source feature fusion. Furthermore, with its tiered alarm design, it automatically triggers a GB / T28181 national standard alarm when the caregiver is out of contact, shortening social rescue response time to minutes. Nighttime quantitative water replenishment self-calibration and secure chip signature further eliminate the risk of long-term metering drift and tampering, ensuring data reliability. The energy-saving strategy for when the elderly person is away adaptively lowers the insulation temperature based on their actual home status, resulting in annual electricity savings of 5%–15%. In summary, this invention is significantly superior to existing solutions in terms of safety and reliability, energy saving, and deployment cost, demonstrating outstanding technical effectiveness and promotional value. Attached Figure Description
[0042] To make the technical solution and its beneficial effects of the present invention clearer, the structure and process of the method, system, storage medium and computer program product of the present invention will be briefly described below with reference to the accompanying drawings. The accompanying drawings are for illustration only and do not constitute a limitation on the scope of protection of the present invention.
[0043] Figure 1 This is a schematic diagram of the overall hardware structure of the air source heat pump water heater monitoring system of the present invention.
[0044] Figure 2 A flowchart of the method of the present invention.
[0045] Figure 3This is a flowchart of the data acquisition and processing process of the monitoring method of the present invention.
[0046] Figure 4 This is a timing diagram of the hierarchical alarm mechanism of the present invention.
[0047] Figure 5 A schematic diagram illustrating the logic of energy saving when going out and preheating upon returning home.
[0048] Figure 6 Flowchart for self-calibration and signature verification of nighttime quantitative hydration replenishment
[0049] The meanings of the labels in the attached diagram are as follows:
[0050] 101—Compressor; 102—Four-way valve; 103—Finated evaporator; 104—Electronic expansion valve; 105—Shell-and-tube condenser; 106—Gas-liquid separator; 107—Pressurized water tank; 108—Magnetic reed flow switch; 109—Calibration solenoid valve; 110—Hall current sensor; 111a, 111b—Water tank temperature probes; 112—Main control MCU; 113—eMMC memory; 114—Safety element; 115—Backup lithium battery; 116—LCD; 117—Local button; 118—Bus; 119—Cellular communication module; 120—Wi-Fi / BT module; 121—CAN-Bus interface; 122—Safety relief valve. Detailed Implementation
[0051] The technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present invention.
[0052] I. Overall Hardware Structure
[0053] The monitoring system of this invention uses an air source heat pump water heater as its carrier and completes hardware integration around four links: "heat pump heating circuit - multi-source sensor acquisition - edge AI processing - remote communication and security reinforcement". Its core components and interconnections can be summarized into the following five subsystems:
[0054] 1. Heat pump heating and water circuit subsystem
[0055] 1.1 Main unit circuit: The compressor 101, four-way valve 102, shell-and-tube condenser 105, electronic expansion valve 104, finned evaporator 103, and gas-liquid separator 106 are sequentially closed to form a refrigerant cycle.
[0056] 1.2 Pressurized water tank 107: Volume 260L, with built-in magnesium rod and 40mm polyurethane insulation layer; M8×1.5 sensor threaded holes are pre-embedded at the top and bottom respectively.
[0057] 1.3 Cold water inlet piping: tap water ball valve → check valve → reed flow switch 108 → bypass T-connector → solenoid valve 109. Maintain a 150mm straight pipe section between the flow switch and the solenoid valve to reduce water hammer.
[0058] 2. Sensor Acquisition Subsystem
[0059] 2.1 Flow switch 108: Normally open type with magnetic reed structure, rated flow rate 6 L·min +1 Contact life >2×10 6 Next; output TTL high level = closed.
[0060] 2.2 Hall current sensor 110: range 0–50A, sensitivity 40mV·A-1, with 100Hz second-order RC analog filter.
[0061] 2.3 Temperature probes 111a / 111b: DS18B20 digital temperature IC (-55℃–+125℃, ±0.5℃ accuracy); one 111a at the top and one 111b at the bottom.
[0062] 2.4 Pressure / Water Pressure and Temperature Compensation Interface (Reserved): A 1 / 8-27 NPT mechanical pressure gauge seat is installed at the condenser outlet to provide an interface for subsequent pipeline water pressure compensation or fault diagnosis.
[0063] 3. Edge AI Control Subsystem
[0064] 3.1 Main control MCU112: Cortex-M7 core, 240MHz clock speed, 2MB Flash, 512kBS RAM, integrated 12-bit ΔΣ ADC, three advanced timers, FPU and DSP extended instructions.
[0065] 3.2 Storage and Security Elements
[0066] a) QSPIeMMC113, 8GB capacity, used for cyclic logging and OTA firmware;
[0067] b) Security element SE05x114: Supports ECC-256, AES-128, HMAC-SHA256, internal hardware true random number, responsible for private key storage and signature verification.
[0068] 3.3 Power Management: The motherboard DC-DC converter converts 230VAC to 24VDC, and then steps it down to 5V / 3.3V; it is also equipped with a 7.4V / 2200mAh lithium battery backup pack 115, which can provide power for 24 hours when the mains power fails.
[0069] 3.4 Local HMI: 2.4″ TFT-LCD 116 (320×240), capacitive buttons 117 (including long press "Local Alarm Silence" button), 85dB buzzer 118.
[0070] 4. Communication and Networking Subsystem
[0071] 4.1 Multimode Cellular Module 119: 4G-LTE Cat-1+GSM fallback, supports TCP / UDP, MQTT, HTTP, VoIP-SIP; built-in GNSS for latitude and longitude reporting.
[0072] 4.2 Wi-Fi / BTCombo120: IEEE 802.11n 2.4GHz; In a broadband environment, it can transmit large firmware packages through a home router.
[0073] 4.3CAN-Bus121: Maintains 500kbps communication with the original heat pump motherboard, reads fault codes and synchronizes alarm status.
[0074] 4.4 GB28181 Soft Terminal Stack: Runs within the network subsystem of the MCU, and interconnects with the local public security gateway via the SIP-UDP 5060 port using a cellular or Wi-Fi network.
[0075] 5. Automatic Calibration and Execution Subsystem
[0076] 5.1 Calibration of solenoid valve 109: Normally closed direct-acting valve, coil 24VDC, opening degree Kv≈0.1; controlled by MCU direct-drive MOSFET, opening τ_ref=5s during nighttime quantitative water replenishment.
[0077] 5.2 Flow calibration bypass: The outlet of the solenoid valve is connected in parallel with the main cold water pipe to form a loop with a pipe diameter of 8mm and a length of 0.3m; the calibrated water volume is determined by the valve core throttling range and the valve opening time.
[0078] 5.3 Safety relief valve: An additional 0.7MPa spring relief valve 122 is provided to ensure that the system pressure will not be too high during calibration due to the instantaneous impact of water replenishment.
[0079] 6. Explanation of signal timing and interconnection relationships
[0080] Flow switch 108 → MCU112: External interrupt line GPIO1; corresponding timer input capture channel records the high level length.
[0081] Hall current sensor 110 → MCU112: After analog gain amplification, it enters ADC1CH0; sampling at 2kHz.
[0082] Temperature probes 111a / 111b → MCU112: share 1-Wire bus GPIO2.
[0083] I 2 C-400kHz; Encryption operations are performed internally by SE05x.
[0084] MCU112 → Solenoid Valve 109: GPIO3 drives a 24V coil through an N-channel MOSFET with TVS suppression.
[0085] Wi-Fi120: UART115200 baud + PPP; secondary core handles TLS / DTLS encryption.
[0086] The buzzer 118, LCD 116, and button 117 are directly controlled by MCU 112 via PWM, SPI, and GPIO.
[0087] Through the above hardware arrangement, this invention effectively integrates existing water flow switches, current sensors and temperature difference probes without changing the main circuit of the heat pump heating system. It is supplemented by safety components, quantitative water replenishment bypass and multi-mode communication module, realizing complete hardware support for high-precision monitoring of water use behavior of elderly people living alone, intelligent analysis of end-to-cloud collaboration, hierarchical networking and timely alarm, and energy-saving control when they are away from home.
[0088] II. Specific Implementation Methods
[0089] The monitoring method of this invention is executed sequentially through six closed-loop stages: "data acquisition → edge inference → cloud modeling → hierarchical alarm → energy-saving control → self-calibration." Each stage works collaboratively to form a complete technology chain. It includes the following steps:
[0090] S1. The closed pulse signal S1 is collected by the flow switch installed at the cold water inlet, and the real-time water consumption Q(t) is calculated according to the current flow-time conversion factor K.
[0091] S2. Synchronously collect the compressor input current I_c(t) and the temperature difference ΔT(t) between the upper and lower layers of the water tank, and combine Q(t), I_c(t), and ΔT(t) into a multi-dimensional feature vector V(t);
[0092] S3. Infer V(t) using a lightweight neural network on the edge side to obtain the elderly activity label L(t);
[0093] S4. After the end of each day, upload the total water consumption Q_d and activity tag sequence to the cloud recurrent neural network, update the personalized baseline μ±σ based on the samples of the most recent N days (N≥7), and send the threshold parameter to the edge end;
[0094] S5. When Q_d or L(t) deviates from the baseline threshold, a level one alarm is activated, and alarm information is sent to the guardian through at least two independent communication channels.
[0095] S6. If no alarm extinguishing instruction is received from the guardian within the preset period T1, the alarm will be upgraded to level two and the help request information and location data will be sent to the public security agency according to the alarm interface of GB / T28181.
[0096] S7. When the system detects that the elderly person has been without water for a continuous period of time ≥ T2, it automatically lowers the heat pump insulation temperature by ΔT_eco and restores the original set temperature t_pre minutes before the expected return home.
[0097] S8. During the daily water-free period, the control unit drives the solenoid valve to open for τ_ref seconds to inject a quantitative amount of water. The coefficient K is recalibrated by comparing the closing time obtained, and the integrity of the signature output by the water flow switch is verified. If the verification fails, the highest level alarm is triggered.
[0098] The following uses the 24-hour cycle after the device is powered on as an example to systematically explain the entire implementation process.
[0099] S1 water flow switch pulse metering and instantaneous water consumption calculation
[0100] A normally open reed flow switch is installed in series on the chilled water inlet pipeline of the air source heat pump. When water flows through, the reed closes and remains at a high level; it opens immediately after the flow stops. The main control MCU connects the output of the flow switch to an external interrupt pin with a resolution of 1μs and operates according to the following procedure.
[0101] 1. Pulse capture and de-jitter
[0102] The MCU configures this interrupt to be triggered on the rising edge. Upon entering the interrupt, it first reads the current hardware timer count. If the time difference between this count and the previous interrupt is less than 2ms, it is considered jitter and ignored; otherwise, it records the timestamp t of the current rising edge. i .
[0103] 2. Cumulative duration of closure
[0104] The main loop polls the pulse counter with a period of 100ms. For the n valid pulses detected in the most recent period, their closing duration Δt is accumulated. i The total closure time of this period is obtained.
[0105] 3. Instantaneous water consumption calculation
[0106] Let the flow-time conversion factor obtained from the factory calibration be K (unit: L·s). -1 If the volume of water entering the system during this 100ms period is...
[0107]
[0108] Formula parameter definition:
[0109] ΔQ—Inflow volume in the current cycle, in liters;
[0110] K – Flow rate to time conversion factor, representing the inlet water volume corresponding to 1 second of the flow switch being closed, in L·s. -1 ;
[0111] Δt i —The duration of the closure of the i-th pulse, in seconds;
[0112] n — the number of valid pulses detected within this period;
[0113] —Total closing time of the flow switch during this cycle, in seconds.
[0114] 4. Update cumulative water consumption
[0115] The system maintains a global variable Q(t). It is updated every 100ms period using the following formula.
[0116] Q(t k )=Q(t k-1 )+ΔQ;
[0117] Formula parameter definition:
[0118] Q(t k )——Time t k Cumulative water inflow, in liters;
[0119] ΔQ — The volume of influent detected in the previous cycle, in liters;
[0120] t k-1 , t k — The timestamp at the end of two adjacent 100ms sampling periods.
[0121] 5. Determining if water supply is interrupted
[0122] If n = 0 for 5 consecutive seconds (50 sampling periods), then set the flag no_flow = TRUE, indicating that there is currently no water usage event; when any new pulse is detected, clear the flag and restart the timer.
[0123] 6. Abnormal Pulse Detection
[0124] When the duration of a single closure is Δt i A value less than 3ms indicates possible interference jitter; when Δt iIf the time exceeds 10 seconds, it may indicate that the residual water is flowing slowly. Both situations are recorded in the log, but are not included in ΔQ to avoid errors in water consumption statistics.
[0125] By adopting the above implementation method, the influent volume can be obtained in real time with an accuracy of 0.1L without using expensive flow meters, providing reliable basic data for subsequent feature vector construction and elderly activity recognition.
[0126] S2 Synchronous Acquisition and Feature Vector Construction
[0127] 1. Sensing Link and Sampling Rhythm
[0128] The cold water inlet pulse has already been used to obtain the instantaneous inlet water flow rate Q(t) in step S1 with a 1s increment. Under the same time reference, the system also needs to synchronize two sets of signals: compressor phase line current—a Hall effect current sensor is connected in series at the compressor input, and the sensor's analog output is filtered by a 100Hz second-order RC filter before being fed into a 12-bit ΔΣ ADC with a sampling rate set to 2kHz. The control unit calculates the true RMS value using a 100ms sliding window.
[0129]
[0130] Where i j This represents the j-th instantaneous sample value (in amperes) within the window, where M = 200 is the number of sampling points. Parameter definition: I c (t k ): Time t k The effective value of the compressor current, in amperes.
[0131] Water tank temperature difference – Two digital temperature probes (DS18B20) are installed at the top and bottom of the water tank, polling every 0.5 seconds. The two probes return T values respectively. upper (t), T lower (t). Instantaneous temperature difference
[0132] ΔT(t)=T upper (t)-T lower (t);
[0133] Parameter definition:
[0134] T upper (t): Temperature at the top of the chamber, in degrees Celsius;
[0135] T lower (t): Box bottom temperature, in degrees Celsius;
[0136] ΔT(t): Temperature difference between the upper and lower layers of the chamber, in degrees Celsius.
[0137] 2. Time alignment and resampling
[0138] The system uses one second as a uniform time grid. At each integer second t... k Take the most recent (no earlier than 0.5s) I c The αT value is sampled and recorded; if a missing value is encountered, the data from the previous second is used to maintain the signal, ensuring that the three signals Q(t) are recorded. k ), I c (t k ), ΔT(t k )synchronous.
[0139] 3. Online standardized processing
[0140] To eliminate dimensional differences, sliding z-score normalization was performed on all three signals. A 24-hour window (86400 points) was used, and the mean and standard deviation within the window were updated using a recursive formula.
[0141]
[0142] Then a dimensionless signal is obtained.
[0143]
[0144] Parameter definition:
[0145] X represents Q and I. c Or ΔT three original signals;
[0146] and are the moving mean and standard deviation at the k-th second, respectively;
[0147] W represents the window length (in seconds);
[0148] These are the dimensionless eigenvalues after normalization.
[0149] 4. Feature vector encapsulation
[0150] After normalization, the three dimensionless features are combined in a fixed order.
[0151]
[0152] Parameter definition:
[0153] V(t k ): Time t k 3D feature vectors;
[0154] The corresponding normalized instantaneous water inflow, compressor current, and water tank temperature difference.
[0155] 5. Buffering and Output
[0156] Feature vectors are written to a circular buffer with a capacity of 60 vectors in chronological order. Each time a new vector is updated, a 60×3 tensor composed of the most recent 60 seconds is fed into the lightweight neural network of S3 for inference, ensuring that the inference input always covers a complete one-minute history. This completes the synchronous acquisition, unified correction, and structured encapsulation of the original physical quantities by S2, providing a continuous, uniformly scaled data stream for subsequent behavior recognition.
[0157] S3 edge lightweight neural network inference
[0158] Every second, the system feeds the feature sequence of the most recent 60 seconds into a quantized miniature neural network to determine the type of activity the elderly person is currently engaged in. The following describes each step in chronological order.
[0159] 1. Constructing the input sliding window
[0160] The edge control unit saves the synchronized 3D feature vector in one-second increments.
[0161]
[0162] When time comes to t k When, V(t) k-59 ), ..., V(t) k This series of sixty vectors is concatenated in chronological order to obtain an input tensor of shape 60×3, which is then fed into the inference network.
[0163] Parameter definition
[0164] The standardized instantaneous water inflow rate is dimensionless.
[0165] The compressor current after standardization is dimensionless;
[0166] Standardized water tank temperature difference, dimensionless;
[0167] t k : Current integer seconds timestamp, in seconds.
[0168] 2. Network Topology and Inference
[0169] The network consists of three parts:
[0170] 1) A single-layer GRU
[0171] The input sequence is progressively entered into the gated loop unit. For the input x at the s-th time step... s The formula for calculating the internal state of a GRU is:
[0172]
[0173] Parameter definition
[0174] x s : The three-dimensional input vector at the s-th second;
[0175] h s-1 h s : The hidden state vectors of the previous time step and the current time step;
[0176] z s r s Update the gate and reset the gate vector;
[0177] W., U., b.: Weight matrices and bias vectors;
[0178] σ(·): Sigmoid activation function;
[0179] tanh(·): hyperbolic tangent function;
[0180] ⊙: Multiply corresponding elements.
[0181] 2) Global average pooling
[0182] After processing all sixty steps, the mean of the final hidden state sequence is taken to form a summary vector of length sixteen.
[0183] 3) Two-layer fully connected
[0184] First Inputting a fully connected layer with ReLU activation yields a 32-dimensional vector, which is then input into an output layer with Softmax to generate a 5-dimensional probability vector.
[0185]
[0186] Parameter definition
[0187] p: The probability distributions corresponding to the five activity categories, with the sum of all components being one;
[0188] W o b o Output layer weights and biases.
[0189] 3. Determining activity tags and removing shaking.
[0190] The system takes the category number corresponding to the highest probability as time t. k Activity tags
[0191]
[0192] Where p jIt is the j-th component in the probability vector. To avoid instantaneous jitter, the mode of the labels in the last three seconds is taken as the final output. If the mode continues to jump within three seconds, it is then judged as "possibly leaking" or "missing activity" according to the rules.
[0193] Parameter definition
[0194] L(t k ): The final activity label after smoothing;
[0195] p j : The predicted probability of the j-th class, dimensionless.
[0196] 4. Key Points of Model Training and Deployment
[0197] The offline training phase uses real data from forty households over sixty days, employing cross-entropy loss and the Adam optimizer. After training, the weights are quantized using 8-bit quantization. The quantized model size is less than 40kB, and the inference latency on a 240MHz Cortex-M7 chip is no more than five milliseconds, meeting real-time and low-power requirements. The model file is burned along with the firmware and replaced via OTA when upgrades are needed.
[0198] S4 Cloud Personalized Baseline Update
[0199] Every day at 23:59:40, the edge control unit packages the day's data and uploads it to the cloud via the MQTT secure channel. The uploaded data includes two items: the first is the total water inflow Q for the day. d Secondly, the frequency of the activity tag across the five categories. Before being sent, the message body undergoes an HMAC-SHA256 digest and is signed using an internal secure element to ensure integrity and identity trustworthiness.
[0200] 1. Cloud data reception and storage
[0201] The cloud-based receiving server verifies the signature. If the verification passes, the data is written to the time-series database, and a "new data arrived" message is immediately sent to the model update service. The model update service then extracts records from the most recent N days, including the data for the current day (default N=14).
[0202] 2. Construction of Feature Sequences
[0203] For each day, first directly retrieve the uploaded water consumption Q. d-i+1 Then, the label counts are converted into a percentage vector, resulting in a six-dimensional daily feature vector x. d-i+1 The features from the most recent N days are arranged in chronological order to form a feature sequence {x}. d-N+1 , ..., x d} is used as the input to the recurrent neural network.
[0204] 3. Recurrent Neural Network Inference and Moving Statistics
[0205] The model uses two stacked LSTM layers, each with 32 hidden units, followed by global average pooling, and then a linear output layer. The model will provide a prediction of the next day's water consumption. At the same time, to maintain the statistical baseline, the cloud platform will use the actual water consumption over the most recent N days to calculate the mean and standard deviation.
[0206]
[0207] in
[0208] μ: Arithmetic mean of water consumption over the most recent N days, in liters;
[0209] σ: Standard deviation of water consumption over the most recent N days, in liters;
[0210] Q d-i+1 : Total water consumption on day d-i+1, in liters;
[0211] N: Number of days in the sliding window, dimensionless.
[0212] To track behavioral changes more quickly, enable the exponentially weighted moving average version.
[0213]
[0214] in
[0215] α: Smoothing coefficient, ranging from 0 to 1, dimensionless;
[0216] μ ew σ ew Exponentially weighted mean and standard deviation, units as above.
[0217] 4. Threshold generation and adaptive adjustment
[0218] Calculate the high and low thresholds based on the obtained μ and σ.
[0219] Θ low =max(0, μ-kσ), Θ high =μ+kσ;
[0220] in
[0221] Θ low Water consumption lower limit threshold, in liters;
[0222] Θ high Water consumption upper limit threshold, in liters;
[0223] k: Deviation factor, initially set to 2.0, which can be automatically fine-tuned between 1.5 and 2.5 based on the false alarm rate.
[0224] If the relative error between the actual water consumption on a new day and the model prediction exceeds 15%, the system will increase k by 0.5 to reduce allergies and record the "threshold adaptation" event in the log.
[0225] 5. Parameter distribution
[0226] The cloud will provide the latest μ, σ, Θ low Θ high The threshold version number is encapsulated in a JSON payload and sent to the device via MQTT. The payload is signed with ECDSA-SHA256 before being sent to ensure it is not tampered with during transit. Upon receiving the payload, the device first verifies the signature. If the verification is successful, it immediately writes the new parameters to NVRAM and records "baseline update successful" in its local log.
[0227] 6. Model rolling retraining
[0228] The daily inferences are only updated incrementally; every Sunday at 02:30, a complete retraining process is automatically triggered: the data from the last 60 days is read from the database again, 80% of the samples are used for training and 20% for validation. If the mean absolute error of the new model on the validation set is more than 5% better than that of the old model, the new model is quantized into TensorFlowLite format and distributed via OTA; if there is no improvement, the old model is maintained.
[0229] Through the above process, the system can continuously learn the water usage habits of elderly people living alone in the cloud, update the mean and variance in real time, and securely send dynamic thresholds to the edge, providing a reliable, personalized, and automatically evolving basis for subsequent anomaly detection and alarms.
[0230] S5 Level 1 Alarm Triggering and Multi-Channel Push
[0231] Once the edge control unit completes the S4 baseline update, it will continuously monitor two dimensions locally: daily water consumption and real-time behavior tags. If any of the following conditions are met, a Level 1 alarm process will be initiated, and abnormal information will be sent to the monitor via at least two independent communication paths.
[0232] 1. Alarm Trigger Criteria
[0233] 1) Daily water consumption deviation determination
[0234] At the end of each natural day (local 00:01), the system calculates the total water inflow Q for that day. d The difference from the baseline mean μ is converted into standardized deviation.
[0235]
[0236] When |ε|>k (default k=2.0), water consumption is considered abnormal.
[0237] Q d The total water intake yesterday is expressed in liters; μ and σ are the individualized mean and standard deviation issued by S4, respectively, both in liters; k is the deviation coefficient, dimensionless.
[0238] 2) Real-time behavior missing determination
[0239] The control unit continuously checks the activity tags in the latest 120-second sliding window at a 1-second resolution. If all tags are "activity missing" (category C5) within 120 seconds, it is considered that the elderly person has been immobile for a long time, triggering the abnormal behavior flag.
[0240] When any of the above flags is set, the first-level alarm procedure is initiated. If both flags appear simultaneously, they will be combined into a single alarm event.
[0241] 2. Alarm Information Generation
[0242] The system generates an alarm message containing the device number, UTC timestamp, and yesterday's water inflow Q. d Fields include deviation value ε, presence of abnormal behavior, time (in seconds) since the last non-C5 tag, and backup battery voltage. The message is digested using SHA-256 and then signed by the secure element with an Ed25519 private key to prevent tampering.
[0243] 3. Multi-channel push strategy
[0244] Alarm messages are first sent via SMS service center; if the network is normal, the first SMS is sent directly at the moment the alarm is triggered. Within 5 seconds, it is then uploaded to the cloud via MQTT and converted into a WeChat mini-program push notification; upon receiving the MQTT message, the cloud immediately calls a third-party interface to push the notification to the guardian's app. If initialization fails on either the SMS or WeChat route, the system attempts to send an encrypted email as a backup after 30 seconds. Each channel has a retry mechanism: SMS is resent every 15 minutes, WeChat push is resent every 10 minutes, with a maximum of four retries; email is resent only once. Resending uses an exponential backoff strategy until guardian confirmation is received or the escalation time limit is reached.
[0245] 4. Confirmation and Timer
[0246] The edge device starts timer T1 when an alarm is first issued, with a default value of 7 x 24 hours. The monitor can clear the alarm by replying with "OK" via SMS, clicking the "Received" button in a WeChat push notification, or sending the "CLEAR" command in the app. Upon receiving any valid confirmation, the system immediately records a "Level 1 Alarm Cleared" log, stops all retries, and resets relevant flags. If no confirmation is received before T1 expires, it is considered unresponsive, and the system proceeds to the Level 2 alarm process in S6.
[0247] 5. Local alerts and manual alarm suppression
[0248] After the alarm is triggered, the device's buzzer will ring in a cycle of "1 second beep, 4 seconds pause"; the LCD or LED will display "ALRT-1" and scroll the ε value. Users can also press and hold the "Local Cancel" button on the device panel for 3 seconds to temporarily mute the alarm and stop retrying, but a formal confirmation must still be completed remotely to avoid accidental missed alarms.
[0249] 6. Logs and Power Loss Recovery
[0250] All alarm generation, transmission, retry, confirmation, and escalation events are written to the eMMC circular log area. If the device unexpectedly loses power and restarts, the control unit first checks for incomplete Level 1 alarms: if timer T1 is still within its expiration period, it continues the previous retry round; if it has exceeded its expiration period, it directly enters the Level 2 alarm stage. In this way, even if there is a long power outage, the critical alarm status will not be lost.
[0251] S6, Level 2 Alarm Upgrade and Public Security Network Alarm System
[0252] If a Level 1 alarm is not effectively cleared by the guardian within the preset period T1 (default seven days and nights), the local control unit immediately escalates the alarm level from 1 to 2 and executes the following procedure. The goal of this procedure is to ensure that an emergency on-site inspection can still be triggered through the public security system even if the guardian is unable to respond in a timely manner.
[0253] 1. Alarm information reconfirmation and encapsulation
[0254] The edge device first refreshes the basic status, including backup battery voltage, cellular signal strength, GPS or base station location coordinates, and water usage pulses and behavior tag caches for the most recent 10 minutes.
[0255] Based on the "Alarm Information" structure in GB / T28181–2016 "Technical Requirements for Information Transmission, Exchange and Control of Security Video Surveillance Network Systems", generate an XML fragment.
[0256] Alarm =<DeviceID,Time,Priority,AlarmMethod,Longitude,Latitude,Description> ;
[0257] The meanings of each field in the formula are as follows:
[0258] DeviceID is the device's national standard code; Time is a UTC format timestamp; Priority is always 2 (high priority); AlarmMethod with a value of 5 indicates "device network alarm"; Longitude and Latitude are decimal coordinates; the Description string contains "elderly person suspected of being out of contact, level 1 alarm not cleared, ε = X".
[0259] 2. Data encryption and transmission channel
[0260] The alarm XML is encrypted with AES-128-CBC, and the key is issued by the public security platform when the device is registered; then a Base-64 encoded HMAC-SHA256 authentication code is attached to ensure integrity.
[0261] The edge device sends a SIP message to the local public security gateway via UDP port 5060. The message body is the encrypted alarm XML. The Request-URI field in the SIP header is filled with the central code assigned by the public security platform.
[0262] Once the transmission is complete, a secondary alarm timer T2 is started, with a default time of 30 minutes. If no "200 OK" response is received from the public security platform within T2, the transmission will be automatically retransmitted, up to a maximum of 3 times.
[0263] 3. Voice calling and text-to-speech
[0264] Simultaneously with the initial SIP alarm, the local control unit invokes cellular network dialing AT commands to automatically initiate a VoIP call to the guardian's number. The cloud service uses a TTS engine to convert the alarm text "Elderly person at home may be unreachable; please contact them or check on them as soon as possible" into PCM data and encapsulate it into RTP, completing a voice broadcast of at least 30 seconds. If the guardian refuses to answer or does not answer within 60 seconds, the system dials again once and then terminates the call.
[0265] 4. Public Security Platform Response and Handling
[0266] If the public security gateway returns "200 OK" and sends a JSON message via SIPMESSAGE within 3 minutes...
[0267] <AckType=0,CaseID,DispatchTime,OfficerID> ;
[0268] If the case is accepted, the device records the CaseID and switches the buzzer rhythm to "0.2 seconds on, 1.8 seconds off," while displaying "ALRT-2 Accepted" on the LCD. If the police do not accept the case within 45 minutes (no feedback or rejection code), the device will resend the alarm every 10 minutes for a total of 6 times; if it still fails, it will switch to the emergency plan to contact the property management or community grid worker's publicly available phone number.
[0269] 5. Local Reset and Log
[0270] When the public security platform sends a "case closed" message via SIP command or the guardian sends a "CLEAR2+CaseID" command through any channel, the level 2 police complaint can be lifted.
[0271] When the alarm is cleared, the control unit stops all retry tasks, the buzzer is muted, the LCD returns to the standby screen, and the event is fully recorded in the eMMC: including the XML of the alarm, all round-trip SIP messages, the voice dialing result, and the final reason for clearing the alarm.
[0272] Log entries are hashed with SHA-256 digests, which are simultaneously uploaded asynchronously to cloud object storage for future auditing.
[0273] 6. Explanation of Mathematical Symbols and Parameters
[0274] T1: The time limit for waiting for guardian confirmation of a Level 1 alarm, in hours.
[0275] T2: Timeout period for waiting for a response from the police after sending a Level 2 alarm, in minutes.
[0276] ε: Standardized deviation of daily water consumption Dimensionless.
[0277] Q d Yesterday's total water inflow, in liters (L).
[0278] μ, σ: Mean and standard deviation of water consumption calculated by S4, in L.
[0279] DeviceID: A 20-digit numeric code conforming to GB / T28181, used to uniquely identify a device.
[0280] CaseID: The case number returned by the public security platform, used for subsequent tracking.
[0281] Through the above implementation methods, the system can automatically connect to the public security network alarm platform when no one responds to the first-level alarm, realizing a closed loop of device-level alarm, cloud-based TTS voice reminder and public security case acceptance, which greatly shortens the time for the discovery and rescue of potential emergencies of elderly people living alone.
[0282] S7, Energy-saving insulation and preheating recovery
[0283] When the continuous period of no water usage reaches the threshold T2 (e.g., 3 hours, which can be set by the caregiver in the app), the system enters "energy-saving mode when away from home". The following process is completed independently by the edge control unit without cloud intervention.
[0284] 1. Detection and triggering of outings
[0285] Control unit maintains variable τ idle The water flow pulse count is checked once per second; if no pulse is detected within 1 second, then τ idle Increment by 1 if necessary, otherwise reset to zero.
[0286] τ idle ≥T2;
[0287] The energy-saving logic is triggered at certain times.
[0288] Parameter definition: τ idle —Current cumulative time without water usage, in seconds; T2 —Energy saving trigger threshold, in seconds.
[0289] 2. Energy-saving temperature setting
[0290] In energy-saving mode, the water tank insulation temperature needs to be reduced. The reduction magnitude uses an adaptive algorithm that increases linearly with the duration of absence, with a maximum reduction of 10°C.
[0291] ΔT eco =min(ΔT) min +α(τ idle -T2), ΔT max );
[0292] Parameter definition:
[0293] ΔT eco —Temperature to be reduced, in °C; ΔT min —Basic temperature drop, typically 3℃; ΔT max —Maximum temperature drop, typically 10℃; α —Adjustment coefficient, typically 0.001℃·s -1 .
[0294] New insulation setting
[0295] t set,new =T nominal -ΔT eco ;
[0296] Where T nominal The target temperature for the water tank set by the user for daily use.
[0297] 3. Temperature control execution
[0298] Switch the PID controller setpoint to T set,new To reduce frequent compressor start-stop cycles, the controller is prohibited from operating within a ±0.5℃ dead zone. If the outdoor temperature is extremely low, causing the water tank temperature to drop below 40℃ after cooling, the system will automatically adjust ΔT. eco Limiting efforts to what is currently feasible to ensure a safe level of bacterial inhibition.
[0299] 4. Predicted return home time
[0300] The system uses water usage records from the past 14 days to statistically analyze the distribution of the first water usage time each day and estimates the peak probability t of the next return home using Gaussian kernel density. pred If the cloud-based algorithm has not yet converged, it will degenerate to a fixed value of 18:00. The local clock will then reach [the specified time].
[0301] t pred -t pre ;
[0302] This marks the start of the preheating phase.
[0303] Parameter definition: t pred —Expected return home time stamp; t pre —Preheating advance, in minutes, initially set at 30 minutes, can be dynamically adjusted according to the formula in the next section.
[0304] 5. Adaptive preheating advance
[0305] The system records each time the temperature rises back to T from the energy-saving temperature. nominal Time used τ heat The average warming rate is updated using an exponentially weighted method.
[0306]
[0307] Then recalculated
[0308]
[0309] Parameter definition: r heat —Average heating rate, in °C·min -1 β—smoothing coefficient, typically 0.2.
[0310] 6. Handling Early Return and Accidental Touching
[0311] If a water flow pulse is detected during energy-saving mode, it indicates that the elderly person has returned home early. Immediately switch the setting back to T. nominal and clear τ idle If no return home is detected within 24 hours and ΔT eco The maximum temperature limit has been reached. The system will maintain a minimum temperature and will not continue to cool down to prevent freezing in winter.
[0312] Through the above implementation, the system dynamically lowers the water tank temperature after the elderly person leaves home and automatically preheats it before they return, which can save 5%–15% of maintenance energy consumption, while minimizing the loss of experience for the elderly person who has to wait a long time for hot water after returning home.
[0313] S8. Nighttime quantitative hydration self-calibration and signature verification
[0314] The system continuously monitors water flow pulses after midnight each day; when no pulses are detected for 30 consecutive minutes and the water tank temperature remains stable within the insulation range, it is considered to have entered a "no-water usage period." At this time, the following steps are performed to complete the self-calibration of the flow coefficient K and the verification of its safety integrity.
[0315] 1. Quantitative water replenishment triggering and valve control
[0316] The edge control unit outputs a high level to the bypass solenoid valve, keeping the valve open for a certain period of time.
[0317] τ ref =5s;
[0318] This duration is calibrated at the factory along with the valve diameter and municipal water pressure, corresponding to a theoretical water replenishment volume.
[0319] V ref =2L;
[0320] In the formula: τ ref The duration of the water replenishment pulse, in seconds; V ref The unit for one calibration water replenishment volume is liters.
[0321] 2. Cumulative closing time
[0322] During water replenishment, the flow switch remains closed, and the MCU counts the duration of the closure at 1kHz sampling rate.
[0323]
[0324] Where Δt i This represents the time interval (in seconds) during which the flow switch is at a high level within each sampling period; n is the number of sampling segments. The total closing time ∑Δt for this calibration is obtained at the end of the water replenishment period. cal .
[0325] 3. Recalibrate conversion factors
[0326] The flow-time coefficient measured in this study was calculated based on the actual closure duration.
[0327]
[0328] Where: K meas The coefficients measured in this study are expressed in L·s. -1 .
[0329] To avoid drift caused by a single anomaly, use exponential smoothing to update the old coefficients.
[0330] K new =(1-γ)K old +γK meas ;
[0331] Where γ = 0.25 is the smoothing weight, K old The previous effective coefficient, in L·s -1 K new These are the updated coefficients, in L·s. -1 If |K meas -K old |>0.3K old If the measurement is deemed distorted, the alarm code will not be updated and will be recorded.
[0332] 4. Signature integrity verification
[0333] The internal dual MCUs of the water flow switch generate a 32-bit pulse counter when water replenishment begins, and use a preset key K. s Calculate AES-CMAC signature
[0334]
[0335] The MCU recalculates and compares the signature locally using the same key.
[0336] Sig local ≠Sig switch ;
[0337] If the link or hardware has been tampered with, the highest level alarm flag is set, the solenoid valve is closed, and a "SEC-BREACH" event is sent to the cloud.
[0338] Variable definition: K s is the symmetric key; pulses is the sequence of pulse counts for this water replenishment; Sig is the signature from the water flow switch.
[0339] 5. Abnormalities and Rollbacks
[0340] If insufficient municipal water pressure is detected during the self-calibration process, causing the flow switch to not close continuously, the system will stop calibration and increment the number of attempts. After three consecutive failures, the original value will be retained and a "CAL-FAIL" flag will be added to the end-of-day report for maintenance personnel to refer to.
[0341] Through the above process, the system automatically injects a fixed amount of standard water every night when no one is using water, accurately updates the flow conversion coefficient K, and uses encrypted signatures to ensure that the sensor link has not been tampered with, thereby maintaining metering accuracy and data reliability in the long term.
[0342] The foregoing description of embodiments of the present invention, through which those skilled in the art are able to implement or use the present invention, will be readily apparent to those skilled in the art. Various modifications to these embodiments will be readily apparent to those skilled in the art. The general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novelty disclosed herein.
[0343] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0344] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0345] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0346] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0347] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0348] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0349] Computer-readable media include both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
Claims
1. A method for monitoring elderly people living alone using an air source heat pump water heater, characterized in that, Includes the following steps: S1. The closed pulse signal S1 is collected by the flow switch installed at the cold water inlet, and the real-time water consumption Q(t) is calculated according to the current flow-time conversion factor K. S2. Synchronously collect the compressor input current I_c(t) and the temperature difference ΔT(t) between the upper and lower layers of the water tank, and combine Q(t), I_c(t), and ΔT(t) into a multi-dimensional feature vector V(t); S3. Infer V(t) using a lightweight neural network on the edge side to obtain the elderly activity label L(t); S4. After the end of each day, upload the total water consumption Q_d and activity tag sequence to the cloud recurrent neural network, update the personalized baseline μ±σ based on the samples of the most recent N days (N≥7), and send the threshold parameter to the edge end; S5. When Q_d or L(t) deviates from the baseline threshold, a level one alarm is activated, and alarm information is sent to the guardian through at least two independent communication channels. S6. If no alarm extinguishing instruction is received from the guardian within the preset period T1, the alarm will be upgraded to level two and the help request information and location data will be sent to the public security agency through the alarm interface. S7. When the system detects that the elderly person has been without water for a continuous period of time ≥ T2, it automatically lowers the heat pump insulation temperature by ΔT_eco and restores the original set temperature t_pre minutes before the expected return home. S8. During the daily water-free period, the control unit drives the solenoid valve to open for τ_ref seconds to inject a quantitative amount of water. The coefficient K is recalibrated by comparing the closing time obtained, and the integrity of the signature output by the water flow switch is verified. If the verification fails, the highest level alarm is triggered.
2. The method according to claim 1, characterized in that, Step S1 uses a reed flow switch. The MCU captures the rising edge with a resolution of 1μs and accumulates the closing duration ΣΔt within a 100ms period. The instantaneous water consumption is calculated according to the formula ΔQ=K×ΣΔt and written into the cumulative metering value Q(t). And / or, in step S2, a 50A range Hall current sensor is used to sample at 2kHz and the effective value I_c(t) is calculated within a 100ms window. At the same time, the temperature is collected every 0.5s using two DS18B20 sensors at the top and bottom and the difference is calculated to obtain ΔT(t). The three data are aligned on a 1s cycle and then normalized using a 24h sliding z-score.
3. The method according to claim 1, characterized in that, The lightweight neural network in step S3 uses a 1-layer 16-unit GRU, global average pooling, and a two-level fully connected Softmax structure. It takes the feature sequence of the most recent 60 seconds as input, infers five types of activities, and outputs the label L(t) using the 3-second mode de-jitter.
4. The method according to claim 1, characterized in that, Step S4 uploads data via MQTT-TLS and models it in the cloud using a two-layer 32-unit LSTM. It calculates μ and σ using data from the most recent 14 days, with a default deviation coefficient k of 2.
0. It then generates upper and lower thresholds Θ_low and Θ_high and sends them out with ECDSA-SHA256 signatures.
5. The method according to claim 1, characterized in that, The first-level alarm in step S5 is sent simultaneously through the SMS gateway and the MQTT push service. If the activity tag is "activity missing" or the daily water consumption deviation is detected within 120 consecutive seconds, the alarm will be triggered. d -μ|>kσ triggers an alarm, and SMS messages will be resent every 15 minutes and push notifications every 10 minutes until confirmation is received from the guardian; And / or, the secondary alarm in step S6 is sent to the local public security platform using a GB / T28181 SIP message encrypted with AES-128-CBC, and a TTS voice dialing reminder is initiated to the guardian at the same time; if the public security does not respond within 30 minutes, it will be automatically resent, up to three times.
6. The method according to claim 1, characterized in that, Step S7 according to ΔT eco =min{ΔT min +α(τ idle - T2), ΔT max The temperature drop is adaptively determined, with a maximum of 10℃, and the preheating advance t_pre is dynamically calculated based on the historical heating rate; the temperature control PID suppresses frequent compressor start-stop within a ±0.5℃ dead zone.
7. The method according to claim 1, characterized in that, Step S8: In the early morning when there is no water usage, open the solenoid valve τ_ref = 5s to inject 2L of calibration water, and calculate K. meas =V ref / ∑Δt cal and with K new =(1-γ)K old +γK meas (γ=0.25) Sliding update coefficient; Simultaneously verify the AES-CMAC signature issued by the flow switch. If the signature verification fails, immediately trigger the highest level alarm and lock the valve.
8. A monitoring system for an air-source heat pump water heater used to implement the method described in claims 1-7, characterized in that, The system includes: The air source heat pump circulation loop includes a compressor, a four-way valve, a finned heat exchanger, an electronic expansion valve, a shell-and-tube heat exchanger, and a gas-liquid separator. A pressurized water tank thermally coupled to the shell-and-tube heat exchanger; A flow switch installed at the cold water inlet is used to output a closed pulse signal S1; The current sensing unit that collects the compressor current and the temperature sensing unit that collects the temperature difference between the upper and lower layers of the water tank; A control unit configured to perform steps S1-S8 of claim 1; The edge-side inference module employs a spiking neural network or a TinyML model. The remote communication module includes at least a cellular data channel and a Wi-Fi / Ethernet channel; The cloud server is used to run the recurrent neural network and send threshold parameters to the control unit; A backup power supply is provided to maintain monitoring and communication functions for at least 24 hours in the event of a mains power outage. Security elements are used to encrypt and sign the count of the closing pulses of the flow switch.
9. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed by a processor, they implement the method of any one of claims 1-7.
10. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the method of any one of claims 1-7.
Citation Information
Patent Citations
Method for realizing intelligent nursing for living of old men
CN102646320B
Household emergency help system on the basis of the amount of water
CN104680716A
Life condition detecting method based on water for washing machine and storage medium
CN109023847A