Container detection method and device of smart home appliance and smart home appliance
By combining infrared gratings and deep learning models, precise positioning and differentiated water output control of the embedded water purifier container are achieved, solving the problems of inaccurate container positioning and weak anti-interference ability in existing technologies, and improving the intelligence and safety of the water purifier.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NINGBO FOTILE KITCHEN WARE CO LTD
- Filing Date
- 2026-05-27
- Publication Date
- 2026-07-24
Smart Images

Figure CN122449633A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of smart home appliance technology, and in particular to a container detection method, device, and smart home appliance for smart home appliances. Background Technology
[0002] With the rapid popularization of smart home technology, built-in water purifiers have become one of the kitchen appliances in modern homes. Built-in water purifiers generally adopt a fixed water outlet design, and the water outlet position cannot be adjusted. Users need to manually place the water cup directly under the water outlet to complete the water filling operation.
[0003] To address the issue of container presence detection, related technologies typically employ single-point infrared detection, pressure sensing, and capacitive sensing to determine container presence. However, these technologies can only determine the presence of a container, not pinpoint its exact location. Furthermore, single-sensor technologies have weak anti-interference capabilities and are susceptible to interference from obstructions, accidental touches, and other factors, making it difficult to meet users' higher demands for intelligent, convenient, and safe water purifiers.
[0004] Therefore, it is particularly important to develop a container detection method, device, and smart home appliance that can avoid indiscriminate detection across the entire area, reduce computing power and the number of invalid camera triggers, and improve the reliability of container detection. Summary of the Invention
[0005] To address the aforementioned technical issues, this application provides a container detection method, apparatus, and smart home appliance for smart home appliances. The method involves collecting signals from the container placement area using an infrared grating, filtering continuously blocked signal segments and determining their validity, and activating a camera at the location corresponding to the valid signal to determine its attributes. This addresses the current lack of a container detection method, apparatus, and smart home appliance that can avoid indiscriminate detection across the entire area, reduce computing power and the number of invalid camera triggers, and improve the reliability of container detection.
[0006] The technical solution provided in this application is as follows: On one hand, this application provides a container detection method for a smart home appliance, wherein the smart home appliance includes an infrared device, a camera device, and a container placement device, and the container detection method for the smart home appliance includes: Acquire the grating signal of the area where the container placement device is located, collected by the infrared device; A series of continuous and blocked signal segments are selected from the grating signal to obtain multiple continuous blocked signal segments; each of the continuous blocked signal segments corresponds to a specific object to be detected. The signal validity is determined for each of the continuously blocked signal segments to obtain the signal validity determination result for each of the continuously blocked signal segments. When the validity judgment result of each of the continuous blocking signal segments indicates that each of the continuous blocking signal segments is valid, the camera device is controlled to perform attribute judgment on the object to be detected at the corresponding position of each of the continuous blocking signal segments, and the attribute judgment result of the object to be detected is obtained. Based on the attribute judgment result of the object to be detected, the operation of the smart home appliance is controlled.
[0007] In some optional embodiments, the grating signal includes a plurality of sampling points, and before selecting continuous and blocked signal segments from the grating signal to obtain a plurality of continuous blocked signal segments, the method further includes: A coordinate system is established based on the grating signal; In the coordinate system, the sampled values of the sampling points where the grating signal is blocked are set as target preset values; The step of selecting continuous and blocked signal segments from the grating signal to obtain multiple continuous blocked signal segments includes: From the coordinate system, obtain the sampled values of the blocked sampling points; If the sampled values of the blocked sampling points are continuous within a preset time, the grating signal corresponding to the blocked sampling points will be treated as multiple continuous blocking signal segments.
[0008] In some optional implementations, the step of determining the validity of each of the continuously blocked signal segments to obtain a validity determination result for each of the continuously blocked signal segments includes: Obtain the effective signal width threshold; Determine the width of each of the consecutive blocking signal segments; If the width of each of the continuously blocked signal segments is greater than or equal to the effective signal width threshold, the validity determination result of each of the continuously blocked signal segments indicates that each of the continuously blocked signal segments is effective; If the width of each of the continuously blocked signal segments is less than the effective signal width threshold, the validity determination result of each of the continuously blocked signal segments indicates that each of the continuously blocked signal segments is invalid.
[0009] In some optional implementations, when the validity determination result of each of the continuous blocking signal segments indicates that each of the continuous blocking signal segments is valid, controlling the camera device to perform attribute determination on the object to be detected at the corresponding position of each of the continuous blocking signal segments to obtain the attribute determination result of the object to be detected includes: If the validity determination result of each of the continuous blocking signal segments indicates that each of the continuous blocking signal segments is valid, the camera device is controlled to move to the location of each of the continuous blocking signal segments; Acquire target images of the object to be detected at the corresponding positions of each of the continuous blocking signal segments; The target image is subjected to attribute determination to obtain the attribute determination result of the object to be detected.
[0010] In some optional implementations, the step of performing attribute determination on the target image to obtain the attribute determination result of the object to be detected includes: Obtain the target model; the target model is obtained by training a preset model based on historical images and the attribute labels corresponding to the historical images, and performing attribute judgment training. The target image is input into the target model to obtain the attribute judgment result of the object to be detected.
[0011] In some optional implementations, controlling the operation of the smart home appliance based on the attribute determination result of the object to be detected includes: If the attribute judgment result of the object to be detected indicates that the object to be detected is the target detection object, control the smart home appliance to dispense water; If the attribute judgment result of the object to be detected indicates that the object to be detected is not the target object, the smart home appliance is controlled to not dispensing water.
[0012] On the other hand, this application provides a container detection device for smart home appliances, the container detection device for smart home appliances comprising: The signal acquisition module is used to acquire the grating signal of the area where the container placement device is located, collected by the infrared device; The signal extraction module is used to select continuous and blocked signal segments from the grating signal to obtain multiple continuous blocked signal segments; the position corresponding to each continuous blocked signal segment is the object to be detected. The judgment module is used to judge the validity of each of the continuous blocking signal segments and obtain the validity judgment result of each of the continuous blocking signal segments; and to control the camera device to perform attribute judgment on the object to be detected at the corresponding position of each of the continuous blocking signal segments when the validity judgment result of each of the continuous blocking signal segments indicates that each of the continuous blocking signal segments is valid, and obtain the attribute judgment result of the object to be detected. The control module is used to control the operation of the smart home appliance based on the attribute judgment result of the object to be detected.
[0013] On the other hand, this application provides a smart home appliance, characterized in that the smart home appliance is a water purification device, and the water purification device performs container detection using the container detection method of the smart home appliance as described in any one of the above embodiments.
[0014] On the other hand, this application provides an electronic device including a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement the container detection method of the smart home appliance as described in any of the above embodiments.
[0015] On the other hand, this application provides a computer-readable storage medium storing at least one instruction or at least one program, which is loaded and executed by a processor to implement the container detection method for smart home appliances as described in any of the above embodiments.
[0016] This application provides a container detection method for smart home appliances. The smart home appliance includes an infrared device, a camera device, and a container placement device. The container detection method includes: acquiring a grating signal from the area where the container placement device is located, collected by the infrared device; selecting continuous and blocked signal segments from the grating signal to obtain multiple continuous blocked signal segments; each continuous blocked signal segment corresponds to a specific object to be detected; performing a signal validity judgment on each continuous blocked signal segment to obtain a signal validity judgment result for each continuous blocked signal segment; if the validity judgment result of each continuous blocked signal segment indicates that each continuous blocked signal segment is valid, controlling the camera device to perform attribute judgment on the object to be detected at the corresponding position of each continuous blocked signal segment to obtain an attribute judgment result for the object to be detected; and controlling the operation of the smart home appliance based on the attribute judgment result of the object to be detected. By acquiring signals from the container placement area using an infrared grating, filtering continuous blocked signal segments and performing validity judgments, and activating the camera device to perform attribute judgments at the positions corresponding to valid signals, the method avoids indiscriminate detection across the entire area, reduces computing power and the number of invalid camera triggers, and improves the reliability of container detection. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a schematic flowchart of a container detection method for smart home appliances according to an embodiment of the present invention; Figure 2 This is a schematic diagram of a grating signal according to an embodiment of the present invention; Figure 3 This is a schematic diagram of grating signal blocking distribution according to an embodiment of the present invention; Figure 4 This is a schematic diagram of a short-term foreign object detection process according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the overall structure of a smart home appliance according to an embodiment of the present invention; Figure 6 This is a bottom view schematic diagram of a water outlet module according to an embodiment of the present invention; Figure 7 This is a schematic diagram of the identification process of a camera device according to an embodiment of the present invention; Figure 8 This is a schematic diagram of the overall control process of a smart home appliance according to an embodiment of the present invention; Figure 9 This is a schematic diagram of a container detection device for smart home appliances according to an embodiment of the present invention.
[0019] The following is supplementary explanation of the attached figures: 1-Infrared grating transmitter; 2-Infrared grating receiver; 3-Crawler-type transmission slide rail; 4-Water outlet module; 41-Water outlet; 42-Supplemental light; 43-Camera device. Detailed Implementation
[0020] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0021] The term "an embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of this application. In the description of this application, it should be understood that the terms "upper," "lower," "top," "bottom," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. Moreover, the terms "first," "second," etc., are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein.
[0022] When a numerical range is disclosed herein, the range is considered continuous and includes the minimum and maximum values of the range, as well as every value between the minimum and maximum values. Furthermore, when the range refers to an integer, it includes every integer between the minimum and maximum values of the range. Additionally, when multiple ranges are provided to describe a feature or characteristic, the ranges may be combined. In other words, unless otherwise specified, all ranges disclosed herein should be understood to include any and all subranges to which they are included. For example, a specified range from “1 to 10” should be considered to include any and all subranges between the minimum value 1 and the maximum value 10. Exemplary subranges of the range 1 to 10 include, but are not limited to, 1 to 6.1, 3.5 to 7.8, 5.5 to 10, etc.
[0023] Currently used single-point infrared detection, pressure sensing, and capacitive sensing technologies can only determine the presence of a container, but cannot achieve precise container location. Furthermore, these single-sensor technologies have weak anti-interference capabilities and are easily affected by factors such as obstruction by debris and accidental touches, making it difficult to meet users' higher demands for intelligent, convenient, and safe water purifiers. Therefore, to avoid indiscriminate detection across the entire area, reduce computing power and the number of invalid camera triggers, and improve the reliability of container detection, this application provides a container detection method, device, and smart home appliance for smart home appliances.
[0024] Please see Figure 1 , Figure 1 This is a schematic flowchart of a container detection method for smart home appliances according to an embodiment of the present invention. In one aspect, this application provides a container detection method for smart home appliances, wherein the smart home appliance includes an infrared device, a camera device, and a container placement device, and the container detection method for the smart home appliance includes: S101. Obtain the grating signal of the area where the container placement device is located, collected by the infrared device.
[0025] Optionally, the infrared device consists of an infrared grating transmitter 1 and an infrared grating receiver 2 paired vertically. (See [link to relevant documentation]). Figure 2 , Figure 2This is a schematic diagram of a grating signal according to an embodiment of the present invention. An infrared grating transmitter 1 and an infrared grating receiver 2 are respectively installed above and below the outlet 41 of an embedded water purifier, completely covering the area where the container placement device of the water purifier is located. For example, the effective length of the container placement area can be 45cm; therefore, the acquisition length of the infrared grating must match this size to ensure that containers placed at any position within this range can be detected. The infrared grating transmitter 1 continuously emits infrared light downwards, and the receiver below synchronously receives the infrared light at the corresponding position. When there is no object obstructing the area where the container placement device is located, the infrared grating receiver 2 can completely receive all the infrared light; when a water cup or other object is placed in this area, the object will block the infrared light at the corresponding position, causing the infrared grating receiver 2 at that position to be unable to receive the light, thus creating a signal blocking state.
[0026] Optionally, the sampling width interval is controlled within 1mm. For a sampling length of 45cm, at least 450 sampling points are required. Increasing the number of sampling points can improve position measurement accuracy, but it increases data processing volume and hardware cost. A 1mm interval is the optimal value balancing accuracy and cost. The grating scanning frequency is controlled within 50Hz, meaning a full-area scan is completed every 20ms. Since the signal state is relatively stable after the user places the water cup, high-frequency sampling is unnecessary. Reducing the scanning frequency can significantly reduce chip performance usage and heat generation of the grating device.
[0027] Optionally, to avoid false acquisition caused by the outlet itself blocking the grating, a pre-shielding mechanism for the outlet 41 position will be activated simultaneously during the signal acquisition stage. The physical width of the outlet 41 will be recorded in advance, and its theoretical horizontal position will be calculated in real time based on the moving speed of the outlet 41. The grating coordinates will be used for correction, and the signal at the corresponding position of the outlet 41 will be automatically shielded during signal acquisition to ensure that the acquired grating signal only reflects the actual object occlusion state of the container placement area.
[0028] S102. Select continuous and blocked signal segments from the grating signal to obtain multiple continuous blocked signal segments; each of the continuous blocked signal segments corresponds to a corresponding object to be detected.
[0029] In an optional embodiment, the grating signal includes a plurality of sampling points, and before selecting continuous and blocked signal segments from the grating signal to obtain a plurality of continuous blocked signal segments, the method further includes: A coordinate system is established based on the grating signal; In the coordinate system, the sampled values of the sampling points where the grating signal is blocked are set as target preset values; The step of selecting continuous and blocked signal segments from the grating signal to obtain multiple continuous blocked signal segments includes: From the coordinate system, obtain the sampled values of the blocked sampling points; If the sampled values of the blocked sampling points are continuous within a preset time, the grating signal corresponding to the blocked sampling points will be treated as multiple continuous blocking signal segments.
[0030] Optionally, please refer to Figure 3 , Figure 3 This is a schematic diagram of grating signal blocking distribution according to an embodiment of the present invention. A two-dimensional quantized coordinate system is established based on the grating signal. The coverage of the coordinate system is completely consistent with the effective acquisition length of the infrared grating. The grating uses a sampling width interval of 1 mm, corresponding to at least 450 independent sampling points, ensuring that the position detection accuracy meets the positioning requirements of the water cup. The X-axis horizontal coordinate is based on the physical arrangement order of the sampling points. From the leftmost to the rightmost side of the container placement area, the sampling point numbers start from 0 and increase sequentially. Each number corresponds to a horizontal position of 1 mm in physical space. The Y-axis signal coordinate is used to characterize the on / off state of the grating at the corresponding X-axis position. It only stores discrete binary values, simplifying the subsequent data processing logic. The original electrical signal without spatial attributes is transformed into a coordinate point with clear positional information. The occlusion of an object in the container placement area will be directly reflected in the change of the Y-axis value at the corresponding X-axis position in the coordinate system.
[0031] Optionally, after the coordinate system is established, the system performs unified binary encoding on the raw signals of all sampling points, converting the analog on / off state into a calculable digital signal using 0 / 1 binary encoding. When the grating is not obstructed, the sample value of the corresponding sampling point is set to 0; when the grating is blocked by an object, the sample value of the corresponding sampling point is set to the target preset value of 1. This encoding method significantly reduces data storage and chip computational complexity. The encoding process is synchronized with the grating scanning process in real time. After each full-area scan, the Y-axis values of all sampling points are immediately updated to ensure that the coordinate system always reflects the true state of the current container placement area. During the encoding stage, the signal shielding of the outlet 41 itself is completed simultaneously. The system pre-records the physical width of the outlet 41 and calculates its theoretical horizontal position in real time based on the moving speed of the outlet 41. This is then corrected using the grating coordinates, forcing the sample value at the corresponding position of the outlet 41 to be set to 0, thus avoiding mis-encoding caused by the outlet 41 itself obstructing the grating.
[0032] Optionally, the system iterates through the Y-axis values of all sampling points in the coordinate system, extracting all sampling points with a target preset value of 1. These sampling points represent all horizontal positions currently occluded by the object. Only when the blocked sampling points simultaneously satisfy both spatial and temporal continuity conditions will they be determined as a valid continuous blocking signal segment. For details, please refer to [link to relevant documentation]. Figure 4 , Figure 4This is a schematic diagram of a short-term foreign object detection process according to an embodiment of the present invention. The numbering of the blocked sampling points on the X-axis must be continuous and without interval, forming a continuous horizontal obstruction range. If there are unblocked sampling points between two blocked sampling points, they are determined to be two independent areas to be detected. The aforementioned spatially continuous sampling points must remain in an obstructed state for a preset time, which can be set to 3 seconds to filter interference from short-term, instantaneous foreign objects such as fingers swiping or insects flying by. A continuous sampling point that satisfies the dual continuity condition is an independent continuous obstruction signal segment. Each signal segment corresponds to a horizontal position range of an object to be detected. If there are multiple discontinuous obstruction areas in the container placement area, multiple continuous obstruction signal segments will be generated, providing a basis for sequential detection of multiple cups.
[0033] By mapping the physical space of the container placement area to a standardized two-dimensional coordinate system and using binary encoding to standardize the grating signal, the signal storage and operation logic is greatly simplified, effectively reducing chip performance consumption and heat generation of the grating device. At the same time, by extracting continuous blocking signal segments through spatial and temporal continuity judgment, multiple independent areas to be detected can be accurately divided, and short-term instantaneous interference such as fingers swiping or insects flying can be filtered in advance, reducing subsequent invalid signal verification and camera calls, and significantly improving the response speed, anti-interference ability and operating efficiency of the entire detection system.
[0034] S103. Perform a signal validity judgment on each of the continuously blocked signal segments to obtain the signal validity judgment result for each of the continuously blocked signal segments.
[0035] In an optional embodiment, the step of determining the validity of each of the continuously blocked signal segments to obtain a validity determination result for each of the continuously blocked signal segments includes: Obtain the effective signal width threshold; Determine the width of each of the consecutive blocking signal segments; If the width of each of the continuously blocked signal segments is greater than or equal to the effective signal width threshold, the validity determination result of each of the continuously blocked signal segments indicates that each of the continuously blocked signal segments is effective; If the width of each of the continuously blocked signal segments is less than the effective signal width threshold, the validity determination result of each of the continuously blocked signal segments indicates that each of the continuously blocked signal segments is invalid.
[0036] Optionally, the effective signal width threshold is a quantitative standard for distinguishing between valid containers and invalid small foreign objects. Its value is not fixed and can be determined comprehensively based on the actual application scenario and hardware design. Using the smallest common cup size on the market as a benchmark, it can be set within the range of 10cm-30mm, preferably 20cm. This value covers the minimum diameter of most mini water cups, cans, and standard beverage bottles on the market, while ensuring that most non-container foreign objects are excluded. The threshold must be greater than the physical width of the outlet 41 itself. Even if there is a slight deviation in the pre-shielding mechanism at the outlet 41 position, the signal segment generated by its own shielding will be judged invalid because its width is less than the threshold, forming double protection.
[0037] Optionally, the system can simultaneously calculate the width of multiple independent continuous blocked signal segments. The system compares the calculated width of each signal segment with a preset effective signal width threshold and outputs a clear validity judgment result. When the width of a continuous blocked signal segment is greater than or equal to the effective signal width threshold, the signal segment is determined to be valid. This means that the size of the obstructed area meets the minimum size requirement of a common water cup and may be a container to be detected. The system will mark its location and trigger subsequent camera attribute judgment steps. When the width of a continuous blocked signal segment is less than the effective signal width threshold, the signal segment is determined to be invalid. Such signal segments usually correspond to small ornaments, spoons, chopsticks, utensil fragments, flying insects or fingers that have lingered for a long time, and other non-container foreign objects. The system will directly discard the signal segment without further processing. For short-lived, momentary foreign objects such as user fingers or flying insects, the system eliminates them by combining the duration and width of the obstruction. For small, continuously placed foreign objects such as desktop ornaments, the system removes them by analyzing long-term signal stability and matching size characteristics. When the water outlet 41 moves and obstructs the grating, the system pre-records the width of the water outlet 41 and calculates its theoretical position based on the moving speed of the water outlet. It then uses the grating coordinates for real-time correction and automatically blocks the signal at that position to avoid misidentification.
[0038] By combining temporal and spatial continuity, the system filters out both short-term and small-sized interference. It also eliminates invalid signals quickly through pure digital calculations, avoiding the high computational power consumption caused by frequent camera movement, image acquisition, and recognition. At the same time, it reduces the number of invalid movements of the slide rail motor and extends the service life of mechanical components.
[0039] S104. If the validity judgment result of each of the continuous blocking signal segments indicates that each of the continuous blocking signal segments is valid, the camera device is controlled to perform attribute judgment on the object to be detected at the corresponding position of each of the continuous blocking signal segments, and the attribute judgment result of the object to be detected is obtained.
[0040] In an optional embodiment, when the validity judgment result of each of the continuous blocking signal segments indicates that each of the continuous blocking signal segments is valid, controlling the camera device to perform attribute judgment on the object to be detected at the corresponding position of each of the continuous blocking signal segments to obtain the attribute judgment result of the object to be detected includes: If the validity determination result of each of the continuous blocking signal segments indicates that each of the continuous blocking signal segments is valid, the camera device is controlled to move to the location of each of the continuous blocking signal segments; Acquire target images of the object to be detected at the corresponding positions of each of the continuous blocking signal segments; The target image is subjected to attribute determination to obtain the attribute determination result of the object to be detected.
[0041] In an optional embodiment, the step of performing attribute determination on the target image to obtain the attribute determination result of the object to be detected includes: Obtain the target model; the target model is obtained by training a preset model based on historical images and the attribute labels corresponding to the historical images, and performing attribute judgment training. The target image is input into the target model to obtain the attribute judgment result of the object to be detected.
[0042] Optionally, please refer to Figure 5 , Figure 6 , Figure 5 This is a schematic diagram of the overall structure of a smart home appliance according to an embodiment of the present invention; Figure 6 This is a bottom-view schematic diagram of a water outlet module according to an embodiment of the present invention. The camera device 43 and the water outlet 41 are integrated and mounted on the same movable water outlet module 4, which is connected to the water purifier body via a tracked drive rail 3. The target position of the movement command is the X-axis center coordinate of the effective continuous blocking signal segment in a two-dimensional coordinate system. Please refer to... Figure 7 , Figure 7 This is a schematic diagram of the identification process of a camera device according to an embodiment of the present invention. When the moving water outlet module 4 approaches the target position, the camera device 43 acquires images from below in real time. By identifying the deviation between the center position of the object to be detected and the center of the camera's field of view, the rotation angle and speed of the motor are dynamically adjusted until the object to be detected is completely inside the center of the camera's field of view. This negative feedback mechanism effectively compensates for the mechanical backlash and cumulative error of the slide rail transmission, ensuring the accuracy of subsequent image acquisition. If there are multiple independent and effective continuous blocking signal segments, the system will control the camera device to move to the corresponding position of each signal segment in a fixed order, completing the attribute judgment one by one.
[0043] Optionally, before image acquisition, the system automatically turns on the integrated LED fill light 42 below the camera to provide uniform illumination to the cup rim and the area inside the cup. Once the camera has accurately stopped and the brightness of the fill light 42 is stable, the system triggers the camera to acquire an image. The acquired target image must completely include the upper contour of the object to be detected, the cup rim boundary, and the liquid area inside the cup. The acquired raw image will first undergo rapid preprocessing, including Gaussian noise reduction and contrast enhancement, to further improve image quality and reduce the error rate of subsequent attribute judgment.
[0044] Optionally, attribute judgment not only confirms whether the object to be detected is the target detection object and whether the target detection object is a container that can receive water, but also needs to extract key water dispensing control parameters. Specifically, this includes: determining whether the object to be detected is a water cup, excluding large non-container foreign objects; extracting the shape and diameter of the cup opening, especially identifying excessively narrow cup openings with a diameter ≤30mm; combining the cup body width detected by the grating with the cup opening width recognized by the camera to distinguish between narrow-mouthed and wide-mouthed cups; and identifying the liquid surface position inside the cup through edge detection to obtain the initial liquid level height, etc. The system outputs structured attribute judgment results, including whether it is the target container, cup type, cup opening diameter, initial liquid level height, etc. If it is determined to be the target container, these parameters are passed to the subsequent water dispensing control module; if it is determined to be a non-target container, the system does not perform any water dispensing operation and automatically jumps to the next valid signal segment for processing.
[0045] Optionally, the target model is a dedicated model specifically trained for embedded water purifier container detection scenarios. Its training process strictly follows a supervised learning paradigm, and the training dataset consists of a massive amount of historical images from real kitchen scenarios, comprehensively covering various operating conditions of water purifiers in actual use, ensuring the model has sufficient generalization ability. Each historical image is labeled with multi-dimensional attribute labels: category labels are binary, indicating whether it is a target detection object or a non-target detection object, used to determine whether the object to be detected is a container capable of receiving water; cup type classification labels: labeled as narrow-mouthed cup or wide-mouthed cup; cup mouth parameter labels include the cup mouth diameter value and cup mouth shape; and the initial liquid level is labeled as the proportion of the effective height of the cup body, used for subsequent calculations of total water output and flow rate adjustment.
[0046] Optionally, a lightweight deep learning model adapted for edge computing is selected as the base model. Annotated historical images and corresponding attribute labels are input into the model. A multi-task supervised learning approach is employed, continuously optimizing the model's weight parameters through backpropagation. This enables the model to learn the essential visual feature differences between containers and foreign objects, as well as the characteristic patterns of various cup shapes, rims, and liquid levels. During training, the prediction accuracy for both classification and regression tasks is simultaneously optimized. After training, the model is converted to a lightweight format suitable for embedded chip operation and finally deployed to the main control system of the water purifier.
[0047] Optionally, after acquiring the target image of the object to be detected, the system inputs the image into the deployed target model and obtains multi-dimensional attribute judgment results through forward propagation inference. The preprocessed target image is input into the target model, which automatically extracts low-level visual features such as edges, textures, and shapes from the image. Through multi-layer neural network calculations, it outputs prediction results for each attribute dimension. The model output is multi-dimensional structured data, including whether the object to be detected is the target object, the cup type, the cup diameter, the cup shape, and the initial liquid level height.
[0048] Deep learning models effectively distinguish large non-container objects from real containers, solving the problem that grating detection can only identify size and position but cannot determine object attributes, thus reducing the system's false trigger rate. Furthermore, it not only determines whether water is being dispensed but also extracts key parameters such as cup shape, rim size, and initial liquid level, providing precise data for subsequent flow regulation and level control for different cup types. This effectively reduces splashing and overflow, significantly improving the system's environmental adaptability and reliability. Attribute judgment complements the grating signal screening of the previous two stages, solving the problem that gratings can only detect size and position but cannot identify object attributes, eliminating false triggers from large non-container objects, and significantly improving system safety and reliability. By extracting parameters such as cup shape, rim size, and initial liquid level, data support is provided for subsequent flow regulation and level control, enabling the adoption of optimal dispensing strategies for different cup types, effectively reducing splashing and overflow. Through sequential movement and judgment, multiple cups are identified one by one, significantly improving the user experience.
[0049] S105. Based on the attribute judgment result of the object to be detected, control the operation of the smart home appliance.
[0050] In an optional embodiment, controlling the operation of the smart home appliance based on the attribute determination result of the object to be detected includes: If the attribute judgment result of the object to be detected indicates that the object to be detected is the target detection object, control the smart home appliance to dispense water; If the attribute judgment result of the object to be detected indicates that the object to be detected is not the target object, the smart home appliance is controlled to not dispensing water.
[0051] Optionally, when the attribute judgment result output by the target model clearly indicates that the object to be detected is a water-receiving container, the system does not simply perform uniform water dispensing. Instead, it performs differentiated and precise water dispensing control based on information extracted from the attribute judgment result, such as the cup shape, cup mouth parameters, initial liquid level, and cup mouth height. The system first confirms that the water dispensing module 4 with the integrated camera is precisely positioned directly above the container through a negative feedback mechanism, and that the center of the cup mouth is correctly aligned with the center of the water outlet 41. Then, it opens the water dispensing valve to start dispensing water. During the dispensing process, the camera continuously monitors the liquid level inside the cup in real time, dynamically updating the liquid level height through an edge detection algorithm, serving as the basis for adjusting the water flow rate and stopping the dispensing. For containers with ultra-narrow cup mouths (diameter ≤ 30mm), a low-flow-rate water dispensing strategy is used throughout. Due to the extremely small water contact surface at ultra-narrow cup mouths, splashing and overflow are highly likely. Even if the initial liquid level is low, a high flow rate is not used to minimize operational risks. Standard narrow-mouthed cups (diameter > 30mm) use a segmented water dispensing method, starting with a large flow and gradually decreasing to maximize efficiency. When the camera detects that the liquid level reaches 70% of the cup's effective height, it automatically switches to a smaller flow and slows down the dispensing until the maximum set volume is reached. Wide-mouthed cups, where the cup width is roughly the same as the rim width, also use a segmented dispensing method, but with a lower liquid level threshold for switching flow rates. When the liquid level reaches 60% of the cup's effective height, it switches to a smaller flow rate because the wider mouth provides a larger water contact area, making splashing more likely. Low-mouthed containers, with a rim height of only 40mm-50mm, use a consistently small flow rate throughout. Because the rim is close to the countertop, the liquid level rises quickly and is prone to overflow; a small flow rate allows for better control of the liquid level.
[0052] Optionally, to ensure convenient handling and prevent water spillage during capping or movement, the system is set to automatically dispensing a maximum of 80% of the cup's effective height. When the camera detects that the liquid level has reached this threshold, the dispensing valve immediately closes, stopping the water flow. If the user requires more water, they must manually press the dispensing button to add more.
[0053] Optionally, if the system detects multiple valid continuous blocking signal segments in the early stages, and multiple objects to be detected are all identified as target containers, the system will sequentially complete the water dispensing operation for each container in a fixed order. After the current container finishes dispensing water, the water dispensing module 4 automatically moves to the top of the next container, repeating the attribute verification and differentiated water dispensing process until all containers have been filled with water. This logic avoids the need for manual placement and dispensing of each cup in traditional water purifiers, significantly improving the efficiency of high-frequency water dispensing scenarios. During the water dispensing process, the infrared grating continuously monitors the signal status of the container placement area. If the system detects that the current container has been moved, it will immediately close the water dispensing valve and stop dispensing water to prevent water from spraying directly onto the countertop, causing water waste and safety hazards due to slippery surfaces.
[0054] Optionally, when the attribute judgment result output by the target model indicates that the object to be detected is not the target detection object, the system will implement no water discharge control to prevent false water discharge. Non-target detection objects mainly include two categories: one is large foreign objects that have passed the grating signal screening but cannot pass the camera attribute verification, such as common kitchen ornaments, condiment bottles, dishes, mobile phones, tissue boxes, etc.; the other is objects that, although similar in shape to containers, are not suitable for receiving water, such as inverted cups, sealed bottles with too small openings, broken containers, etc. The system immediately skips the position of the object to be detected and does not perform any water discharge operation; if there are other unprocessed valid continuous blocking signal segments, the water discharge module 4 automatically moves to the corresponding position of the next signal segment to continue attribute judgment and subsequent processing; if all signal segments have been processed and all are determined to be non-target detection objects, the system will control the water discharge module 4 to reset to the initial position and enter a low-power standby state, waiting for the next grating signal trigger.
[0055] The non-dispensing control logic and the front-end anti-interference system form a complete safety protection. The grating filters out short-term interference such as fingers swiping and insects flying, as well as small foreign objects such as spoons and chopsticks. The camera's deep learning model filters out large non-container foreign objects. This dual verification ensures that only genuine water-receiving containers can trigger water dispensing, solving the problems of accidental dispensing caused by button presses, pet touches, and foreign object obstructions in traditional water purifiers. In particular, it reduces the safety risks caused by accidental operation by children at home. The differentiated water dispensing strategy accurately controls the flow rate and water volume according to the characteristics of different cup shapes, effectively avoiding water splashing and overflow. Users do not need to manually control the water dispensing time and flow rate. It supports the sequential identification and dispensing of multiple containers, eliminating the need for users to operate each cup individually, greatly improving the convenience of use in high-frequency water dispensing scenarios.
[0056] Please see Figure 8 , Figure 8 This is a schematic diagram of the overall control process of a smart home appliance according to an embodiment of the present invention. The following will provide a general description of the overall control process of a smart home appliance provided in this application embodiment: After the water purifier starts the container detection program, it controls the infrared grating transmitter 1 installed above the water outlet module 4 to emit infrared light downwards, and the infrared grating receiver 2 below synchronously collects the grating signal of the area where the container is placed in real time. The system first establishes a two-dimensional coordinate system based on the acquired grating signal. When the grating is unobstructed, the sampled value is marked as 0; when it is obstructed, it is marked as 1. The system then traverses all sampling points in the coordinate system, selecting a set of sampling points with a value of 1 that remains continuous for 3 seconds. The grating signal segments corresponding to these continuously blocked sampling points are defined as multiple continuous blocking signal segments. Each signal segment corresponds to the horizontal position of the object to be detected, completing the initial coarse positioning of the water cup. If the user sets a forced water dispensing mode and presses and holds the dispensing button, forced water dispensing will be executed. The system first presets a threshold for the width of an effective signal, and then calculates the horizontal width corresponding to each continuous blocked signal segment. If the width of the signal segment is greater than or equal to the threshold, the signal segment is determined to be valid and a suspected water cup is found at the corresponding location; if the width is less than the threshold, it is determined to be an invalid signal and is directly rejected. Once a certain continuous blocking signal segment is determined to be valid, the system controls the camera device mounted on the water outlet to move to the horizontal position corresponding to the signal segment via a tracked slide rail. After the camera device reaches the designated position, the LED supplement light below is turned on to collect the target image of the object to be detected. The image is then input into a pre-trained target model for attribute judgment. This model can distinguish whether the object to be detected is the target water cup, as well as the liquid level height and type of water cup. Based on the attribute judgment results, corresponding operations are executed. If the object to be detected is determined to be a non-target object, the water purifier is controlled to not dispensing water, effectively avoiding the problem of accidental water dispensing caused by children accidentally touching buttons or foreign objects blocking the water. If the object is determined to be the target water cup, a differentiated water dispensing strategy is executed based on the type of water cup and the liquid level detection results. In addition, when the grating detects multiple effective continuous blocking signal segments, the system will control the water outlet to move to each signal segment position in sequence, and complete the attribute judgment and water dispensing operation one by one through the camera, so as to realize the automatic sequential water production of multiple cups without the need for the user to manually place the cups one by one.
[0057] On the other hand, this application provides a container detection device for smart home appliances; please refer to [link / reference]. Figure 9 , Figure 9 This is a schematic diagram of a container detection device for smart home appliances according to an embodiment of the present invention. The container detection device for smart home appliances includes: Signal acquisition module 901 is used to acquire the grating signal of the area where the container placement device is located, collected by the infrared device. Signal extraction module 902 is used to select continuous and blocked signal segments from the grating signal to obtain multiple continuous blocked signal segments; the position corresponding to each continuous blocked signal segment is an object to be detected; The judgment module 903 is used to judge the validity of each of the continuous blocking signal segments and obtain the validity judgment result of each of the continuous blocking signal segments; and to control the camera device to perform attribute judgment on the object to be detected at the corresponding position of each of the continuous blocking signal segments when the validity judgment result of each of the continuous blocking signal segments indicates that each of the continuous blocking signal segments is valid, and obtain the attribute judgment result of the object to be detected. The control module 904 is used to control the operation of the smart home appliance based on the attribute judgment result of the object to be detected.
[0058] In an optional embodiment, the container detection device for the smart home appliance further includes: A coordinate system establishment module is used to establish a coordinate system based on the grating signal; The sampling point assignment module is used to set the sampling value of the sampling point where the grating signal is blocked to a target preset value in the coordinate system.
[0059] In an optional embodiment, the signal extraction module 902 includes: A sampling value determination unit is used to obtain the sampling value of the blocked sampling point from the coordinate system; The continuous blocking signal segment determination unit is used to determine the grating signal corresponding to the blocked sampling point as multiple continuous blocking signal segments when the sampling value of the blocked sampling point is a continuous sampling value within a preset time.
[0060] In an optional embodiment, the determination module 903 includes: The effective signal width threshold acquisition unit is used to acquire the effective signal width threshold. A signal width determination unit is used to determine the width of each of the continuous blocking signal segments; The first judgment unit is used to determine the validity judgment result of each of the continuous blocking signal segments, indicating that each of the continuous blocking signal segments is valid, when the width of each of the continuous blocking signal segments is greater than or equal to the effective signal width threshold. The second judgment unit is used to determine the validity judgment result of each of the continuous blocking signal segments, indicating that each of the continuous blocking signal segments is invalid, when the width of each of the continuous blocking signal segments is less than the effective signal width threshold.
[0061] In an optional embodiment, the determination module 903 further includes: The first control unit is configured to control the camera device to move to the location of each of the continuous blocking signal segments when the validity determination result of each of the continuous blocking signal segments indicates that each of the continuous blocking signal segments is valid; The target image acquisition unit is used to acquire the target image of the object to be detected at the corresponding position of each of the continuous blocking signal segments; The attribute judgment result determination unit is used to perform attribute judgment on the target image and obtain the attribute judgment result of the object to be detected.
[0062] In an optional embodiment, the attribute determination result determination unit includes: The target model acquisition unit is used to acquire a target model; the target model is obtained by training a preset model based on historical images and the attribute labels corresponding to the historical images, and performing attribute judgment. The model inference unit is used to input the target image into the target model to obtain the attribute judgment result of the object to be detected.
[0063] In an optional embodiment, the control module 904 includes: The second control unit is used to control the smart home appliance to dispense water when the attribute judgment result of the object to be detected indicates that the object to be detected is the target detection object; The third control unit is used to control the smart home appliance to not dispense water when the attribute judgment result of the object to be detected indicates that the object to be detected is not the target object to be detected.
[0064] On the other hand, this application provides a smart home appliance, which is a water purification device, and the water purification device uses the container detection method of the smart home appliance as described in any of the above embodiments to perform container detection.
[0065] This application provides a container detection method for smart home appliances. The smart home appliance includes an infrared device, a camera device, and a container placement device. The container detection method includes: acquiring a grating signal collected by the infrared device in the area where the container placement device is located; selecting continuous and blocked signal segments from the grating signal to obtain multiple continuous blocked signal segments; each continuous blocked signal segment corresponds to a corresponding object to be detected; determining the signal validity of each continuous blocked signal segment to obtain a signal validity determination result for each continuous blocked signal segment; if the validity determination result of each continuous blocked signal segment indicates that each continuous blocked signal segment is valid, controlling the camera device to perform attribute determination on the object to be detected at the corresponding position of each continuous blocked signal segment to obtain an attribute determination result for the object to be detected; and controlling the operation of the smart home appliance based on the attribute determination result of the object to be detected. The container detection method for smart home appliances provided by this application has the following beneficial effects: (1) The infrared grating can simultaneously identify multiple obstruction areas within the container placement area and generate multiple independent continuous blocking signal segments. The system will control the water outlet module to move to the corresponding position of each signal segment, and automatically dispense water after completing the container attribute verification, thus improving the user experience. (2) By judging the temporal and spatial continuity of the grating signal, short-term instantaneous interference such as fingers swiping and flying insects flying is filtered out. By using the effective signal width threshold, small foreign objects such as spoons, chopsticks and small ornaments are filtered out. By using the deep learning model on the camera, large non-container foreign objects and real water-receiving containers are accurately distinguished. The triple verification ensures that only the target container can trigger water discharge, which solves the problem of accidental water discharge caused by button touch and foreign object obstruction, and reduces safety hazards. (3) The grating adopts a low scanning frequency and a sampling interval of 1mm, which balances the position detection accuracy and chip computing power consumption, and reduces the heat generation of the grating device; the front-mounted grating signal filtering reduces the number of invalid camera movements, image acquisitions and judgments, and at the same time reduces the invalid movement frequency of the slide rail motor, effectively extending the service life of mechanical parts.
[0066] In an optional embodiment, this application provides an electronic device including a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement the container detection method for a smart home appliance as described in any of the above embodiments.
[0067] In an optional embodiment, this application provides a computer-readable storage medium storing at least one instruction or at least one program segment, which is loaded and executed by a processor to implement the container detection method for smart home appliances as described in any of the above embodiments.
[0068] The above description is only an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for detecting containers in smart home appliances, characterized in that, The smart home appliance includes an infrared device, a camera device, and a container placement device. The container detection method of the smart home appliance includes: Acquire the grating signal of the area where the container placement device is located, collected by the infrared device; A series of continuous and blocked signal segments are selected from the grating signal to obtain multiple continuous blocked signal segments; each of the continuous blocked signal segments corresponds to a specific object to be detected. The signal validity is determined for each of the continuously blocked signal segments to obtain the signal validity determination result for each of the continuously blocked signal segments. When the validity judgment result of each of the continuous blocking signal segments indicates that each of the continuous blocking signal segments is valid, the camera device is controlled to perform attribute judgment on the object to be detected at the corresponding position of each of the continuous blocking signal segments, and the attribute judgment result of the object to be detected is obtained. Based on the attribute judgment result of the object to be detected, the operation of the smart home appliance is controlled.
2. The container detection method for smart home appliances according to claim 1, characterized in that, The grating signal includes several sampling points. Before selecting continuous and blocked signal segments from the grating signal to obtain multiple continuous blocked signal segments, the method further includes: A coordinate system is established based on the grating signal; In the coordinate system, the sampled values of the sampling points where the grating signal is blocked are set as target preset values; The step of selecting continuous and blocked signal segments from the grating signal to obtain multiple continuous blocked signal segments includes: From the coordinate system, obtain the sampled values of the blocked sampling points; If the sampled values of the blocked sampling points are continuous within a preset time, the grating signal corresponding to the blocked sampling points will be treated as multiple continuous blocking signal segments.
3. The container detection method for smart home appliances according to claim 1, characterized in that, The step of determining the validity of each of the continuously blocked signal segments to obtain the validity determination result of each of the continuously blocked signal segments includes: Obtain the effective signal width threshold; Determine the width of each of the consecutive blocking signal segments; If the width of each of the continuously blocked signal segments is greater than or equal to the effective signal width threshold, the validity determination result of each of the continuously blocked signal segments indicates that each of the continuously blocked signal segments is effective; If the width of each of the continuously blocked signal segments is less than the effective signal width threshold, the validity determination result of each of the continuously blocked signal segments indicates that each of the continuously blocked signal segments is invalid.
4. The container detection method for smart home appliances according to claim 1, characterized in that, When the validity judgment result of each of the continuous blocking signal segments indicates that each of the continuous blocking signal segments is valid, the camera device is controlled to perform attribute judgment on the object to be detected at the corresponding position of each of the continuous blocking signal segments to obtain the attribute judgment result of the object to be detected, including: If the validity determination result of each of the continuous blocking signal segments indicates that each of the continuous blocking signal segments is valid, the camera device is controlled to move to the location of each of the continuous blocking signal segments; Acquire target images of the object to be detected at the corresponding positions of each of the continuous blocking signal segments; The target image is subjected to attribute determination to obtain the attribute determination result of the object to be detected.
5. The container detection method for smart home appliances according to claim 4, characterized in that, The step of performing attribute determination on the target image to obtain the attribute determination result of the object to be detected includes: Obtain the target model; the target model is obtained by training a preset model based on historical images and the attribute labels corresponding to the historical images, and performing attribute judgment training. The target image is input into the target model to obtain the attribute judgment result of the object to be detected.
6. The container detection method for smart home appliances according to claim 5, characterized in that, The step of controlling the operation of the smart home appliance based on the attribute judgment result of the object to be detected includes: If the attribute judgment result of the object to be detected indicates that the object to be detected is the target detection object, control the smart home appliance to dispense water; If the attribute judgment result of the object to be detected indicates that the object to be detected is not the target object, the smart home appliance is controlled to not dispensing water.
7. A container detection device for smart home appliances, characterized in that, The container detection device for the smart home appliance includes: The signal acquisition module is used to acquire the grating signal of the area where the container placement device is located, collected by the infrared device; The signal extraction module is used to select continuous and blocked signal segments from the grating signal to obtain multiple continuous blocked signal segments; the position corresponding to each continuous blocked signal segment is the object to be detected. The judgment module is used to judge the validity of each of the continuous blocking signal segments and obtain the validity judgment result of each of the continuous blocking signal segments; and to control the camera device to perform attribute judgment on the object to be detected at the corresponding position of each of the continuous blocking signal segments when the validity judgment result of each of the continuous blocking signal segments indicates that each of the continuous blocking signal segments is valid, and obtain the attribute judgment result of the object to be detected. The control module is used to control the operation of the smart home appliance based on the attribute judgment result of the object to be detected.
8. A smart home appliance, characterized in that, The smart home appliance is a water purification device, and the water purification device uses the container detection method for smart home appliances as described in any one of claims 1-6 to perform container detection.
9. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or at least one program being loaded and executed by the processor to implement the container detection method for smart home appliances as described in any one of claims 1-6.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one instruction or at least one program, which is loaded and executed by a processor to implement the container detection method for smart home appliances as described in any one of claims 1-6.