Intelligent faucet

By symmetrically installing infrared sensors on faucets, constructing a time-series trajectory matrix, and performing flow level matching and delay determination, the problems of weak anti-interference and flow mismatch in existing faucets are solved, realizing intelligent flow regulation and precise delay control, improving user experience and water resource utilization efficiency.

CN120907000AInactive Publication Date: 2025-11-07WENZHOU CHENKAI SANITARY WARE CO LTD

Patent Information

Application Number
CN202511431847.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-09
Publication Date
2025-11-07
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing faucet sensors suffer from weak interference resistance, mismatched flow rates, and delays caused by continuous water use, resulting in poor user experience and wasted water resources.

Method used

By symmetrically installing dual infrared distance sensors and calibrating with dynamic background reference values, a time-series trajectory matrix is ​​constructed. Through flow level matching rules and cosine similarity determination of delay adjustment, accurate sensing and on-demand flow regulation are achieved.

Benefits of technology

It improves the stability of hand detection, avoids problems such as faucet mis-triggering and flow mismatch, and realizes intelligent flow adjustment and precise delay control according to user needs, thereby improving user experience and water resource utilization efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120907000A_ABST
    Figure CN120907000A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent faucet, and relates to the technical field of kitchen and bath intelligent water equipment, the faucet comprises a data acquisition module, a flow matching module, a delay determination module and an MCU; the data acquisition module acquires hand data through double infrared sensors, and transmits the hand data to the MCU after background reference value calibration, gesture state marking and abnormity filtering; the traffic matching module constructs a time sequence track matrix, extracts features and normalizes the features to match corresponding traffic; and the delay judgment module generates a standard matrix template based on the scene, and adjusts the water outlet delay through cosine similarity comparison. According to the invention, while the sensing reliability of the faucet is improved, accurate flow adaptation and delay optimization are realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of intelligent water equipment for kitchen and bathroom, in particular to a smart faucet. BACKGROUND

[0002] In the prior art, the traditional manual faucet needs to be operated by contact and cannot realize automatic water adjustment. Although the existing induction faucet realizes non-contact control, it still has the following disadvantages: Firstly, a single sensor is usually used to collect hand signals, which has weak anti-interference ability and is easily interfered by sink water mist, strong light and the like, resulting in false triggering or detection failure and being unable to stably capture hand position changes. Secondly, the water use scene is determined by relying on a fixed distance threshold, which cannot adapt to the difference in hand activity range of different users, resulting in poor scene adaptability. Thirdly, the flow regulation mode is single, only "on / off" or fixed flow output can be realized, and the flow cannot be matched as needed according to the hand gesture state, which easily causes water resource waste or unsatisfied water demand. Fourthly, the continuous water use delay determination logic is simple and relies on a fixed timing length, which cannot accurately identify the continuous water use state of the user, and easily causes problems such as long-time hand washing false water off or continuous water output when no one is present, affecting user experience and wasting water resources. Therefore, there is an urgent need for a smart faucet scheme capable of realizing accurate induction, on-demand flow regulation and intelligent delay. SUMMARY

[0003] In view of the deficiencies of the prior art, the present application provides a smart faucet, which solves the problems of weak induction anti-interference, flow inadaptation and continuous water use leading to delay misjudgment of the existing faucet.

[0004] To achieve the above purpose, the present application realizes the following technical scheme: a smart faucet, comprising: A data acquisition module, two groups of infrared distance sensors are symmetrically installed on both sides of the faucet outlet, after the sensors are started, irrelevant environmental interference is excluded according to a background reference value, when the hand enters the range, the initial distance of the first detection is recorded, a timer is started to record the hand staying time, and the hand gesture state marking and abnormal value filtering are performed on the continuously collected hand position data; A flow matching module, the continuously collected real-time distance changes are arranged in time sequence to construct a time sequence trajectory matrix, the change slope and fluctuation amplitude of are calculated based on the row vector of the time sequence trajectory matrix, the flow level of the faucet outlet is obtained according to the flow level matching rule, and the electromagnetic valve opening degree is adjusted according to the flow level; The time delay determination module generates a continuous water use standard matrix template based on the time sequence trajectory matrix of normal water use of the user, calculates the cosine similarity Sim of the time sequence trajectory matrix generated in real time and the continuous water use standard matrix template, and adjusts the water outlet of the faucet in time delay according to the Sim.

[0005] As a further scheme of the present application, the specific operation of excluding irrelevant environmental interference according to the background reference value is as follows: After the sensor is powered on and started, the "no hand state" is first confirmed: three times of environmental distance data are continuously collected, if the maximum deviation of the three times of data is less than or equal to the deviation threshold, and the "hand entering" signal is not triggered, it is determined that the current is "no hand state"; Under the "no hand state", K groups of environmental distance data are continuously collected, and the arithmetic mean value thereof is calculated as the initial background reference value ; The update interval is set , every time arrives, the "no hand state" is first confirmed to ensure that there is no hand interference; After confirming the "no hand state", three groups of environmental distance data are continuously collected to calculate the arithmetic mean value, denoted as the newly collected average value B_new, and the updated reference value B_new is calculated according to the formula ; ; In the process of collecting the three groups of environmental distance data, for each newly collected data , the deviation rate thereof from is first calculated according to the formula , if the deviation rate is greater than 20%, the data is determined to be temporary interference data; The temporary interference data is directly discarded, and the next group of data is re-collected until three groups of valid data with a deviation rate of less than or equal to 20% are obtained, and the B_new calculation and update described above are performed.

[0006] As a further scheme of the present application, the specific operation of marking the hand position data continuously collected with a gesture state is as follows: A sliding window of W consecutive samples is taken, and the distance data set in each window is calculated in real time , wherein W is a variable parameter, and the value range is preferably [3, 5]; The coefficient of variation CV of the set D is calculated, and the specific formula is: CV = standard deviation / average value x 100%; If the of two consecutive windows are the same, and the maximum distance difference in each window is less than or equal to , it is marked as a static gesture, wherein is a static distance difference threshold, is a static threshold. If the maximum distance difference in each window is ≥ , and the maximum distance difference in two consecutive windows is ≥ , then mark it as a dynamic gesture, wherein, is a dynamic distance difference threshold, is a dynamic threshold; If the above two conditions are not met, mark it as a transition state, do not update the gesture state, and continue to monitor the next window.

[0007] As a further scheme of the present application, the specific process of outlier filtering on newly collected distance data is as follows: After marking the gesture state, store twenty sets of effective distance data in real time, calculate the mean and standard deviation of the data set as the baseline for anomaly determination, and the effective distance data is the data under static / dynamic marking; For newly collected distance data , if and the difference between the adjacent previous data is greater than , mark it as single abnormal data, wherein, is an adjacent difference threshold; If it is single abnormal data, complete it with linear interpolation of and the next normal data , without deleting the original data; If the data collected continuously for two times both meet , determine that the sensor is faulty, and automatically switch to single-sensor collection mode.

[0008] As a further scheme of the present application, the data is packaged in the format of "timestamp + initial distance + real-time distance change + stay duration t + gesture state", and transmitted to the MCU through the SPI interface. CRC check is performed once every ten data packets.

[0009] As a further scheme of the present application, the specific steps of constructing the time sequence trajectory matrix are as follows: Determine the row dimension M of the matrix: set a fixed time window T, and combine the fixed sampling frequency f of the sensor to obtain M=Txf; Determine the column dimension N of the matrix: set the actual change range of to ±D, divide the value interval by a fixed interval s, and the total number of intervals is (2D / s)+1, i.e. N=(2D / s)+1, and each column corresponds to a value interval; For M The sampled values ​​are analyzed one by one to determine their corresponding numerical range, and the matrix is ​​filled using "0-1 encoding": if a certain row... If a value belongs to a certain column, fill in 1 at the intersection of the row and column, and fill in 0 in the other positions; If there are missing samples within the time window T, linear interpolation of preceding and following values ​​is used to complete the sampling.

[0010] As a further aspect of the present invention, the specific operation of linear interpolation for before and after values ​​is as follows: Find the row with the nearest non-missing data before the missing row, and obtain that row. The corresponding column j1, where j1 is the column number of the row containing the number 1 in the matrix; Find the row with the nearest non-missing data after the missing row, and obtain that row. The corresponding column j2, where j2 is the column number of the row containing the number 1 in the matrix; The column number for filling in missing rows is: and in the missing row of the matrix Fill in 1 for the first column and 0 for the rest to complete the missing rows. [] is the integer symbol. like If the value exceeds ±D, it is classified as a boundary column. Classified as column 1 It is assigned to column N.

[0011] As a further aspect of the present invention, the specific process for obtaining the flow rate level of the faucet outlet according to the flow rate level matching rule is as follows: For a matrix with M rows of data, extract the column corresponding to the row containing "1". Numerical values, forming "sampling time - Numerical time series, denoted as The slope k and standard deviation of the sequence were calculated using a linear regression algorithm. ; Set k, The extreme value ranges are respectively , For k, Perform min-max normalization separately to obtain , ,in, The maximum slope at which the hand rapidly approaches. The maximum slope at which the hand moves rapidly away. This represents the minimum fluctuation when the hand is at rest. This represents the maximum fluctuation during vigorous hand movement; according to , Set traffic level matching rules: If and If the distance is less than the low-flow threshold, then the low-flow is matched; if the distance is greater than the high-flow threshold, then the high-flow is matched; the rest of the combinations match the medium-flow, wherein, or the high-flow is matched; the rest of the combinations match the medium-flow, wherein, , the slope lower limit and upper limit are , the fluctuation lower limit and upper limit are

[0012] As a further scheme of the present application, the step of generating the continuous water use standard matrix template is: According to the initial distance and the gesture state, two types of core continuous water use scenarios are divided: Scenario one is the close-type continuous water use, i.e. the gesture state is mainly static, and the continuous water use standard matrix template T1 is corresponded; Scenario two is the far-type continuous water use, i.e. the gesture state is mainly dynamic, and the continuous water use standard matrix template T2 is corresponded, wherein, is the distance threshold value; For each scenario, Z groups of user time sequence trajectory matrices of "confirming continuous water use" are collected, and the samples need to meet: the user stays for a duration t≥ stay threshold value th in the scenario, and there is no user manual adjustment; For the time sequence trajectory matrices in the same scenario, the continuous water use standard matrix template is generated by the row and column voting method: For each position (i, j) of the matrix, the proportion of the number of "1"s in the position in Z groups of samples is counted; If the proportion is greater than or equal to , then 1 is filled in the position of the standard matrix template, otherwise 0 is filled, which represents that the position has no distribution in most continuous water use time trajectory matrices, and is a non-core feature, wherein, is the proportion threshold value; The generated , template is bound with the corresponding scenario label and stored in the template library of the MCU.

[0013] As a further scheme of the present application, the specific operation steps of the time delay adjustment of the faucet water outlet according to the similarity Sim are: The corresponding similarity reference value is set for the continuous water use standard matrix template of each type of scenario: If it is scenario one, then is set as , and if it is scenario two, then is set as ; After the time delay timer is started, the MCU compares the real-time Sim value with every second: If , it is determined that the user is continuously using water, and the delay time is automatically increased , and the total delay time after the extension does not exceed the maximum delay time ; If , it is determined that the hand movement is abnormal, and the delay time is not increased, and the observation stage is entered The duration of the observation stage is set in advance During this period, the Sim value is recalculated every second, and if at a certain time , it is determined that the user has resumed continuous water use, and the observation stage is immediately exited and the delay adjustment is resumed If After the end, all Sim values are , it is determined that the user has finished using water, and the electromagnetic valve opening degree is gradually reduced every second to slowly turn off the water.

[0014] The present application provides a smart faucet, which has the following advantages compared with the prior art: (1) The present application is symmetrically installed by double infrared sensors, avoiding data loss caused by unilateral sensor blocking by oil stains and water mist, and combining with dynamic background reference value calibration mechanism, real-time excluding interference such as sink countertop and environmental strong light, ensuring the stability of hand detection and position data acquisition (2) The present application constructs a time sequence trajectory matrix about , extracts the slope and fluctuation amplitude characteristics and normalizes the processing, matches the corresponding flow level according to the gesture state, avoids the limitation of fixed flow output or only "on / off" mode of the existing faucet, and adjusts the flow according to the actual water demand of the user (3) The present application divides the scene based on the initial distance and gesture state and generates a corresponding continuous water use standard matrix template, determines the continuous water use state in real time through cosine similarity, and avoids the problems of easy water off or waste of existing fixed delay. BRIEF DESCRIPTION OF DRAWINGS

[0015] Figure 1 is the system principle frame of the present application Figure 2 is a step flow chart for constructing a time sequence trajectory matrix Figure 3 is a step flow chart for generating a continuous water use standard matrix template DETAILED DESCRIPTION

[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0017] Example 1 like Figure 1 This invention provides a smart faucet, comprising: The data acquisition module uses two sets of infrared distance sensors symmetrically installed on both sides of the faucet outlet; The sensor can be selected as an 850nm wavelength diffuse infrared distance sensor. The 850nm infrared wavelength can effectively avoid the strong interference band in sunlight, while the diffuse reflection type can directly detect the hand without the need for a reflector, making it suitable for scenarios where the water tank has no fixed reflective surface. Symmetrical installation is mainly to avoid data loss caused by oil or water mist blocking the sensor on one side. For example, if the left side is covered by detergent foam, the right side can still collect data normally. Set the detection range as , To closely approximate the distance to the water outlet, the value range is [2cm, 3cm]. The range of the test is the natural arm extension distance of an adult, with a value range of [15cm, 20cm]. This test range covers the limits of hand movement in household water use. The sampling frequency is set to f, with a range of [8 times / second, 12 times / second]. 10 times / second is preferred to capture rapid hand movements and avoid missing key trajectories. After the sensor is activated, irrelevant environmental interference is eliminated based on the background reference value. The specific operation is as follows: After the sensor is powered on, it first performs a "no hand state" confirmation: it continuously collects environmental distance data three times. If the maximum deviation of the three data is less than or equal to the deviation threshold (no obvious fluctuation indicates that no hand or temporary object has entered the detection range), and no "hand entry" signal is triggered, then the current state is determined to be "no hand state". In a "handless state," K sets of environmental distance data were continuously collected, and their arithmetic mean was calculated as the initial background reference value. ; Set update interval Each time they arrive At all times, first confirm the "no-hands state" to ensure there is no hand interference; After confirming the "no hand" status, three sets of environmental distance data were collected consecutively, and the arithmetic mean was calculated and recorded as the newly collected average value B_new. This value was then used according to the formula... Calculate the updated baseline value ; In the process of collecting three sets of environmental distance data, for each newly collected data , the deviation rate is calculated according to the formula If the deviation rate is > 20%, it is determined that the data is temporary interference data; The temporary interference data is directly discarded, and the next set of data is re-collected until three sets of valid data with a deviation rate ≤ 20% are obtained, and then the above B_new calculation and update is performed; When the hand enters the range is detected, the initial distance of the first detection is recorded, and a timer is started to record the hand staying time t; Continuous collection of hand position data, and gesture state marking for each collected data, the specific operation steps are: Take W consecutive samples as a sliding window, and calculate the distance data set in each window , wherein W is a variable parameter, and the value interval is preferably [3, 5]; Calculate the coefficient of variation CV for the set D, and the specific formula is: CV = standard deviation / average value × 100%, wherein CV reflects the fluctuation degree of the distance in the window, the smaller CV, the more stable the hand, and vice versa, the more active the hand moves; If the of the two windows is continuous, and the maximum distance difference in each window is ≤ , it is marked as a static gesture, wherein is a static distance difference threshold, is a static threshold; If the of the two windows is continuous, and the maximum distance difference in each window is ≥ , it is marked as a dynamic gesture, wherein is a dynamic distance difference threshold, is a dynamic threshold; If it does not meet the above two conditions, it is marked as a transition state, and the gesture state is not updated, and the next window is continuously monitored; Abnormal value filtering is performed on the newly collected distance data, and only continuous and stable valid data is retained, and the specific operation steps are: After marking the gesture state, real-time storage of twenty sets of continuous valid distance data (only including static / dynamic state data, excluding transition state) is performed, and the mean and standard deviation of the data set are calculated as the baseline for abnormality determination; For the newly collected distance data , if and​ Compared with the previous adjacent data The difference > Mark it as a single instance of anomalous data, where, The threshold is the difference between adjacent elements; If it is a single instance of abnormal data, then use With the next normal data Linear interpolation completion without deleting the original data; If the data collected in two consecutive times both meet the requirements If the sensor fails, it is determined to be a sensor malfunction and will automatically switch to single sensor acquisition mode (using only the data from the normal sensor on the other side). By "timestamp + initial distance" +Real-time distance change The data is packaged in the format "+stay duration t+gesture status" and transmitted to the MCU via the SPI interface. A CRC check is performed every ten data packets to avoid transmission errors.

[0018] The traffic matching module arranges the continuously collected real-time distance changes in chronological order to construct a time-series trajectory matrix; Calculated from the row vectors of the time-series trajectory matrix The specific process involves determining the slope and fluctuation amplitude of the water flow, and matching the flow rate at the faucet outlet. For a matrix with M rows of data, extract the column corresponding to the row containing "1". Numerical values, forming "sampling time - Numerical time series, denoted as The slope k of the sequence change is calculated using a linear regression algorithm. If k is positive, then... As time increases, it indicates that the hand is moving away from the outlet. If k is negative, it indicates that the hand is moving closer to the outlet. The larger the absolute value of k, the more obvious the movement trend. For the above time series, calculate Standard deviation of the value , The larger, the better The more frequent the changes within a time window, the more active the hand; conversely, the less frequent the changes, the more stable the hand. Set k, The extreme value ranges are respectively , For k, Perform min-max normalization separately to obtain , ; in, The maximum slope at which the hand rapidly approaches. The maximum slope at which the hand moves rapidly away. The minimum fluctuation when the hand is stationary, The maximum fluctuation when the hand moves violently; According to , Set the flow level matching rule: If And , it means that the hand is stationary, and low flow is matched; If Or , it means that the hand action has rapid changes, such as rapid movement and large shaking, which is suitable for flushing demand, and high flow is matched; The rest of the combination matches the medium flow, which means that the hand has slight dynamics but no rapid changes, which is suitable for washing / rinsing / light water contact demand; Among them, , The lower and upper limits of the slope are , The lower and upper limits of the fluctuation are; The MCU will substitute the real-time , Into the rule to determine the flow level and output the corresponding electromagnetic valve opening signal: low flow corresponds to the opening interval [P1, P2], medium flow corresponds to the opening interval [P3, P4], and high flow corresponds to the opening interval [P5, P6], where P1, P2, P3, P4, P5, P6 are all opening thresholds, which need to be adjusted according to the actual situation; After the electromagnetic valve starts the water flow according to the opening, the data within Time is continuously collected, and And are recalculated, if the flow level matched by the new features is the same as the original determined flow level, no adjustment is needed, otherwise, the electromagnetic valve opening needs to be adjusted according to the flow level matched by the new features; When the water flow of the faucet cannot meet the user's demand, the user needs to actively adjust the water flow of the faucet, at this time, the trajectory matrix features when the user manually adjusts the flow need to be recorded, and , , , , , , , ; The above dynamic update is triggered by two conditions: Condition one, after the user manually adjusts the flow, the current Time trajectory matrix, intervention flow value, And Need to be recorded immediately; Condition two, after accumulating the G group of effective flow matching data, start batch update, the effective data is defined as "no user manual adjustment and the new feature matching flow level is the same as the original determination flow level"; Combining the time stamp range with the initial distance The range of the time stamp belongs to the range of the initial distance The range of the time stamp belongs to the range of the initial distance According to the cumulative data under the same scene label, re-adjust 、 、 、 、 、 、 、 .

[0019] Delay determination module, based on the time sequence trajectory matrix of the user's normal water use, generate a continuous water use standard matrix template; Calculate the cosine similarity between the real-time generated time sequence trajectory matrix and the continuous water use standard matrix template, the specific operation steps are: During the delay timing, MCU intercepts the Data of a time window T from the sensor data, T is consistent with the template time window, generates a real-time matrix , the dimension is exactly the same as the standard template; The continuous water use standard matrix template and the real-time matrix are respectively unfolded into one-dimensional vectors according to row priority, respectively obtaining the standard template vector and the real-time vector ; The cosine similarity formula is used to calculate the similarity Sim between and , the specific formula is , wherein, the numerator is the dot product of the two vectors, the denominator is the product of the lengths of the two vectors, the value range of Sim is [0, 1], the closer Sim is to 1, the more similar the real-time matrix is to the continuous water use standard matrix template; According to the similarity Sim, the faucet water is delayed adjusted, the specific operation steps are: Set the corresponding similarity reference value for each type of continuous water use standard matrix template: If scenario one, T1 trajectory fluctuation dispersion (multiple columns contain 1), the similarity peak value is low, so is set to ; If scenario two, T2 trajectory unidirectional concentration (some columns have 1 in succession), the similarity peak value is high, so is set to ; The template trajectory features are different in different scenarios, and the similarity distribution range is different. Fixed may cause scenario one to be mistakenly closed or scenario two to be wasted; After the delay timer starts, the MCU compares the real-time Sim value with every second: If , it is determined that the user is continuously using water, and the delay time needs to be automatically increased , and the total delay time after extension does not exceed the maximum delay time to avoid forgetting to turn off the water; If , it is determined that the hand movement is abnormal, and the delay time is not increased, and the observation stage is entered; representing that the real-time matrix is similar to the continuous water use standard matrix template, indicating that the user is still using water normally, and the delay time needs to be increased, while needs to be further observed to avoid directly turning off the water affecting the user experience, such as the user briefly lifting the hand to take hand sanitizer; The duration of the observation stage is set to during which the Sim value is recalculated every second, and if at a certain time , it is determined that the user has resumed continuous water use, and the observation stage is immediately exited and the delay adjustment is restored; After the observation stage ends, all Sim values are , it is determined that the user has finished using water, and the slow water closing process is started, gradually reducing the electromagnetic valve opening degree every second to avoid sudden interruption of water flow.

[0020] Embodiment 2 This embodiment further discloses a method for constructing a time sequence trajectory matrix based on embodiment 1, as shown in Figure 2 , the specific content includes: Determine the matrix row dimension M (time dimension): set a fixed time window T, and combine the sensor fixed sampling frequency f to get M=Txf, each row of the matrix corresponds to a sampling time, a total of M rows, covering time sequence data in T time; If the time window T is too short, it may not be able to capture the complete gesture, causing the matrix to miss key action data. If T is too long, it will delay the flow matching response. For example, if the user has already started using water, the flow has not yet been adjusted, affecting the user experience. The sampling frequency f is fixed at 10 times / second because a frequency lower than 8 times / second will miss the details of rapid hand movements, while a frequency higher than 12 times / second will increase the computational load on the MCU. 10 times / second is the balance point between detail capture and computational load. Determine the column dimension N of the matrix ( Numerical dimension): setting The actual range of variation is ±D. The numerical intervals are divided according to a fixed interval s, and the total number of intervals is (2D / s) + 1, i.e., N = (2D / s) + 1. Each column corresponds to one... Numerical range; D was obtained through research on the normal range of hand movements in home / public settings: In home settings, users' hand movements are mostly within 5cm when washing and rinsing, while in public settings they may move up to 6cm. D is adjustable to ensure adaptation to different scenarios. If the interval s is too fine, it will cause N to be too large, resulting in a surge in matrix data volume and high storage pressure on the MCU; if it is too coarse, it will merge similar intervals. Loss of detail differences; For M items within time window T Each sampled value is then analyzed to determine its corresponding numerical range, and the matrix is ​​filled using a 0-1 encoding: if a certain row (at the sampling time) has a range of values... If a value belongs to a certain column (numerical range), fill in 1 at the intersection of the row and column, and fill in 0 in the other positions; The original values ​​have different magnitudes. Directly filling the matrix with values ​​will cause subsequent feature calculations (such as the slope of change and the amplitude of fluctuation) to be interfered with by the absolute value, making it impossible to have a unified judgment standard. 0-1 encoding will " The question "whether it is in a certain interval" is converted to "0 / 1", ignoring the difference in absolute values ​​and only focusing on the interval, thus achieving data standardization. For example, the i-th row If a value belongs to the j-th column, then matrix (i,j)=1, and all other columns corresponding to the i-th row of the matrix are filled with 0; If there are missing samples within the time window T, such as a brief sensor interference causing several missing sample values, then linear interpolation of the preceding and following values ​​is used to fill in the missing samples. The specific operation is as follows: Find the row with the nearest non-missing data before the missing row, and obtain that row. The corresponding j1st column (j1 is the column number of the row containing 1 in the matrix); Find the row with the nearest non-missing data after the missing row, and obtain that row. The corresponding column j2 (j2 is the column number of the row containing 1 in the matrix); The completion column number of the missing row is: and filling 1 in the matrix missing row column and 0 in the remaining columns to complete the missing row, wherein [] is the integer symbol; If If it exceeds the range of ±D, such as rapid and large movement of the hand, it is classified as a boundary column, i.e. it is classified as the first column, and the Nth column.

[0021] Embodiment 3 This embodiment continues to disclose a method for generating a continuous water use standard matrix template based on Embodiment 1 and Embodiment 2, as shown in Figure 3 The specific process is as follows: According to the initial distance and the gesture state, two types of core continuous water use scenarios are divided: Scenario one is close-type continuous water use, i.e. The gesture state is mainly static, and the continuous water use standard matrix template T1 is corresponded; Scenario two is far-type continuous water use, i.e. The gesture state is mainly dynamic, and the continuous water use standard matrix template T2 is corresponded, wherein is the distance threshold; For each scenario, Z groups of users' time sequence trajectory matrices of "confirming continuous water use" are collected, and the samples need to meet: the user stays for a duration t≥ stay threshold th in the scenario, and there is no manual adjustment of the user; For the time sequence trajectory matrices under the same scenario, the continuous water use standard matrix template is generated by the row and column voting method: For each position (i, j) of the matrix (the ith row and the jth column), the proportion of the number of "1"s in the position in Z groups of samples is counted; If the proportion ≥ , then fill 1 in the position of the standard matrix template, otherwise fill 0, which represents that the position has no distribution in most continuous water use time trajectory matrices, and is a non-core feature, wherein is the proportion threshold; The voting method can extract the common features of most continuous water use time sequence trajectory matrices and eliminate individual differences caused by individual features; The generated , template is bound with the corresponding scene label and stored in the template library of the MCU, supporting dynamic addition of scenes; The template is bound with the scene label, which can ensure that the real-time matrix obtained subsequently can call the template of the corresponding scene for comparison, avoiding cross-scene mismatch.

[0022] Some data in the above formula are dimensionless for numerical calculation, and the contents not described in detail in the specification are all prior art known by those skilled in the art.

[0023] The above examples are only used to illustrate the technical method of the present application but not limit the present application. Although the present application is described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical method of the present application can be modified or replaced equivalently without departing from the spirit and scope of the technical method of the present application.

Claims

1. A smart faucet, characterized in that, The application relates to a water faucet with a delay adjustment function. The application comprises the following: The flow matching module will continuously collect real-time distance changes In time sequence, the time sequence trajectory matrix is constructed, the change slope and fluctuation amplitude of The change slope and fluctuation amplitude of the change slope and fluctuation amplitude of the change slope and fluctuation amplitude of the change slope and fluctuation amplitude of the change slope and fluctuation amplitude of the change slope and fluctuation amplitude of the change slope and fluctuation amplitude of the change slope and fluctuation amplitude of the change slope and fluctuation amplitude of the change slope and fluctuation amplitude of the change slope and fluctuation amplitude of the change slope and fluctuation amplitude of the change slope and fluctuation amplitude of the change slope and fluctuation amplitude of the change slope and fluctuation amplitude of the change slope and fluctuation amplitude of the change slope and fluctuation amplitude of the change slope and fluctuation amplitude of the change slope and fluctuation amplitude of the change slope and fluctuation amplitude of the change slope A data acquisition module, two groups of infrared distance sensors are symmetrically installed on both sides of a water outlet of a water faucet, after the sensors are started, irrelevant environmental interference is excluded according to a background reference value, when a hand enters a detection range, an initial distance of first detection is recorded, a timer is started to record a hand staying duration, and hand position data continuously collected is marked with a gesture state and filtered with an abnormal value; 2. The smart faucet of claim 1, wherein, A delay judgment module, based on a time sequence trajectory matrix of normal water use of a user, a continuous water use standard matrix template is generated, a time sequence trajectory matrix generated in real time is calculated with a cosine similarity Sim of the continuous water use standard matrix template, and the water outlet of the water faucet is adjusted with a delay according to the Sim. The specific operation of excluding irrelevant environmental interference according to the background reference value is as follows: In the "hands-free state", K sets of environmental distance data are continuously acquired, and the arithmetic mean thereof is calculated as an initial background reference value ; Setting update interval Every time the moment, first "no hand state" confirmation, to ensure no hand interference; After confirming the "no hand state", three sets of environmental distance data are continuously collected to calculate the arithmetic mean value, recorded as the newly collected average value B_new, and the updated reference value is calculated according to the formula B_new = B_old + (B_new - B_old) / 3 ; During the process of collecting the three sets of environmental distance data mentioned above, for each newly collected data set... According to the formula First calculate its and If the deviation rate is greater than 20%, the data set is considered temporary interference data. The temporary interference data is directly abandoned, the next group of data is re-collected, until three groups of effective data with deviation rate ≤20% are obtained, and then the above B_new calculation and updating.

3. The smart faucet of claim 1, wherein, After the sensors are started, a "no hand state" is confirmed: environmental distance data is continuously collected for three times, if the maximum deviation of the three times of data is less than or equal to a deviation threshold value, and a "hand entering" signal is not triggered, it is determined that the current state is "no hand state"; Taking W consecutive samplings as a sliding window, the distance data set in each window is calculated in real time wherein W is a variable parameter, and the value interval is preferably [3, 5]; The specific operation of marking the gesture state of the continuously collected hand position data is as follows: If the maximum distance difference of each window is ≤ , and the maximum distance difference of each window is ≤ , then mark as static gesture, wherein, is a static distance difference threshold, is a static threshold; If the maximum distance difference of two consecutive windows is ≥ , and the maximum distance difference in each window is ≥ , then mark as dynamic gesture, where, is the dynamic distance difference threshold, is the dynamic threshold; The coefficient of variation CV of the set D is calculated, and the specific formula is: CV = standard deviation / average value*100%; 4. The smart faucet of claim 3, wherein, If the above two conditions are not met, the transition state is marked, the gesture state is not updated, and the next window is continuously monitored. After marking the gesture state, store 20 sets of valid distance data in real time, calculate the mean value of the data set and standard deviation , as the baseline for anomaly determination, the valid distance data is the data marked as static / dynamic; to newly acquired distance data if and the difference to the adjacent previous data is greater than it is marked as single outlier data, wherein is the adjacent difference threshold If it is single abnormal data, it is completed by linear interpolation with the last normal data and the original data is not deleted . If the data collected twice successively both satisfy then it is determined that the sensor is faulty, and the single-sensor collection mode is automatically switched.

5. The smart faucet of claim 1, wherein, The data is packaged in the format of "time stamp + initial distance + real-time distance change + stay time t + gesture state" and transmitted to the MCU through the SPI interface, and a CRC check is performed every ten data packets.

6. The smart faucet of claim 1, wherein, The specific process of filtering the newly collected distance data with an abnormal value is as follows: The specific steps of constructing the time sequence trajectory matrix are as follows: Determine the matrix dimension N: Set The actual range of variation of D is ±, the numerical interval is divided by a fixed interval s, and the total number of intervals is (2D / s)+1, that is, N=(2D / s)+1, and each column corresponds to a numerical interval; M The sampling values are judged one by one to belong to the numerical interval, and the matrix filling is adopted "0-1 coding": if a certain row belongs to a certain column, the intersection position of the row and column is filled with 1, and the rest is filled with 0. The matrix row dimension M is determined: a fixed time window T is set, and the M = T*f is obtained by combining the fixed sampling frequency f of the sensor.

7. The smart faucet of claim 6, wherein, If there is a sampling loss in the T time window, the front and rear values are linearly interpolated to complete the sampling. find the last non-missing data row before the missing row, get the row corresponding to the j1 column, j1 is the column number of 1 in the matrix find the nearest non-missing data row after the missing row, get the row corresponding to the j2 column, j2 is the column number of 1 in the matrix The completion column number of the missing row is: and filling 1 in the matrix missing row column and 0 in the remaining columns, completing the missing row, wherein [] is the integer symbol; If If the value is beyond the range of ±D, it is classified as a boundary column, i.e. If the value is within the range of ±D, it is classified as the 1st column, If the value is within the range of ±D, it is classified as the Nth column.

8. The smart faucet of claim 1, wherein, The specific operation of linearly interpolating the front and rear values to complete the sampling is as follows: For matrix M row data, extract each row "1" in the column corresponding to the value, form "sample time value" timing sequence, denoted as , and use linear regression algorithm to calculate the change slope k and standard deviation ; Set k, The extreme range of k, , , respectively, min-max normalization processing is carried out on k, , respectively, to obtain , , wherein, The maximum slope of the hand approaching quickly, The maximum slope of the hand moving away quickly, The minimum fluctuation when the hand is stationary, The maximum fluctuation when the hand moves violently; According to , set flow level matching rules: if and , match low flow; if or , match high flow; the rest of the combination matches the middle flow, wherein , is the lower and upper limit of the slope, , is the lower and upper limit of the fluctuation.

9. The smart faucet of claim 1, wherein, The specific process of obtaining the flow rate level of the water outlet of the water faucet according to the flow rate matching rule is as follows: According to the initial distance With the gesture state, two categories of core continuous water scenarios are divided: Scenario one is close to the type of continuous water, namely , the gesture state is mainly static, corresponding to the continuous water standard matrix template T1; Scenario two is the far-off type of continuous water, that is , the gesture state is mainly dynamic, corresponding to the continuous water standard matrix template T2, wherein, is the distance threshold; The steps of generating the continuous water use standard matrix template are as follows: For each scenario, Z groups of time sequence trajectory matrices of "confirming continuous water use" of users are collected, and the samples need to meet the following conditions: the user stays for a duration t greater than or equal to a staying threshold value th in the scenario, and no user manually adjusts the water faucet; The time sequence trajectory matrices in the same scenario are generated into a continuous water use standard matrix template by a row and column voting method: If the proportion ≥ 1 is filled in this position of the standard matrix template, otherwise 0 is filled, representing that this position is not in the majority of the water use time track matrix Distribution, non-core features, where, is the proportion threshold; The generated , The template is bound to the corresponding scene label and stored in the template library of the MCU.

10. The smart faucet of claim 1, wherein, The number of times that the position (i, j) is "1" in the Z groups of samples is counted. The specific operation steps of adjusting the water outlet of the water faucet with a delay according to the similarity Sim are as follows: Setting a corresponding similarity reference value for each type of scenario's continuous water use standard matrix template : If scenario one, then is set to , if scenario two, then is set to ; After the delay timer is started, the MCU compares the real-time Sim value with : If , it is determined that the user continuously uses water, and the delay time is automatically increased , and the total delay time after the extension does not exceed the maximum delay time ; If then it is determined that the hand activity is abnormal, the delay is not increased, and the observation phase is entered; The duration of the observation stage is preset as During this period, the Sim value is recalculated every second, and if at a certain time the user is determined to resume continuous water use, the observation stage is immediately exited, and the delay adjustment is resumed. If After the end, all Sim values are < 0 Then, it is determined that the user has finished using water, and the electromagnetic valve opening is gradually reduced every second to slowly turn off the water.

Citation Information

Patent Citations

  • Electromagnetic valve control system and method capable of preventing water hammer effects

    CN110657275A

  • Oscillating bar type time-delay faucet

    CN120062412A

  • Intelligent control faucet and faucet body

    CN120143714A

  • Pipe network on-line monitoring system

    CN120488156A

  • Water -saving intelligent tap

    CN205155300U

Cited By

  • High-precision non-contact induction energy-saving faucet and induction control method

    CN121382975A

  • Faucet start-stop control method and system based on somatosensory interaction

    CN122176424A

  • A water faucet start-stop control method and system based on somatosensory interaction

    CN122176424B