A method and device for dispensing water from a smart faucet

By collecting container information through the ranging and camera devices of the smart faucet, performing pixel reconstruction and volume calculation, and combining it with the dispensing model to achieve adaptive water dispensing, the problem of inaccurate beverage dispensing caused by differences in household container specifications is solved, improving the accuracy and flexibility of beverage dispensing in home scenarios.

CN122284409APending Publication Date: 2026-06-26NINGBO FOTILE KITCHEN WARE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NINGBO FOTILE KITCHEN WARE CO LTD
Filing Date
2026-03-10
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing smart faucets are difficult to adapt to different sizes of household containers, resulting in insufficient accuracy in beverage preparation and failing to meet the diverse and personalized beverage preparation needs in household settings.

Method used

The smart faucet uses a ranging device and a camera to collect distance and image information of the container, performs pixel restoration processing, accurately calculates the container volume, and combines it with a distribution model to analyze the water output, thereby achieving adaptive water distribution for containers of different sizes.

Benefits of technology

It improves the accuracy and flexibility of beverage preparation, optimizes the user experience, adapts to diverse home use scenarios, and avoids problems such as beverage spillage and insufficient water.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122284409A_ABST
    Figure CN122284409A_ABST
Patent Text Reader

Abstract

This application discloses a smart faucet dispensing method, device, and smart faucet. The method includes: acquiring first image information of a container captured by a camera device and distance information measured by a ranging device; performing pixel restoration processing on the first image information to obtain second image information of the container; determining the volume of the container based on the distance information and the second image information; performing water dispensing analysis processing on the container based on the first image information and the volume to obtain water dispensing information; and controlling the smart faucet to dispense water based on the water dispensing information. The smart faucet dispensing method provided in this application acquires container images and distance information through a smart faucet, corrects image errors through pixel restoration, accurately calculates the container volume, and then combines the container image information and volume to complete water dispensing analysis. This enables adaptive dispensing of containers of different sizes, adapting to diverse household usage scenarios, improving the accuracy and flexibility of beverage dispensing, and optimizing the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of smart home appliances, and in particular to a method, apparatus, and smart faucet for adjusting the water supply. Background Technology

[0002] With the rapid iteration of smart home technology and the continuous improvement of residents' quality of life, the demand for smart beverage preparation in home settings is growing, and users are placing higher demands on the convenience, personalization, and adaptability of beverage preparation.

[0003] Currently, the market offers a variety of automated beverage preparation equipment, including self-service coffee machines, smart tea machines, and pre-quantitative beverage machines. These devices can automatically prepare coffee, tea, and other beverages according to a fixed ratio using preset programs, achieving a certain degree of automation in beverage preparation and are widely used in commercial settings such as restaurants and offices. However, existing equipment uses a fixed water output and fixed ratio preparation mode, which is only compatible with standardized containers in commercial settings. In home settings, however, the sizes and shapes of containers used by users vary greatly. A fixed water output can easily lead to issues such as beverage overflow and a mismatch between the water volume and the container's capacity. When recognizing containers through images, effective pixel restoration and distortion correction are not performed on the captured images, and the perspective error caused by the camera cannot be eliminated. It is difficult to accurately calculate the true size and volume of the container, directly resulting in insufficient accuracy in water dispensing and an inability to achieve adaptive compatibility with different containers. In addition, while smart faucet technology integrating robotic arm structures is gradually developing, current research and development on smart faucets mainly focuses on basic functions such as water dispensing control and sensor-activated start / stop, which is insufficient to meet the diverse and personalized beverage preparation needs of home settings.

[0004] Therefore, it is particularly important to develop a smart faucet mixing method, device, and smart faucet that can adapt to different container sizes, fit diverse household usage scenarios, improve the accuracy and flexibility of beverage mixing, and optimize the user experience. Summary of the Invention

[0005] To address the aforementioned technical issues, this application provides a smart faucet dispensing method, device, and smart faucet. The smart faucet collects container images and distance information, corrects image errors through pixel restoration, accurately calculates the container volume, and then combines the container image information and volume to complete water output analysis. This solves the current problem of lacking a smart faucet dispensing method, device, and smart faucet that can adapt to different container sizes, suit diverse household usage scenarios, improve the accuracy and flexibility of beverage dispensing, and optimize the user experience.

[0006] The technical solution provided in this application is as follows: On one hand, this application provides a method for dispensing a smart faucet, the smart faucet including a ranging device and a camera device, with a container placed below the smart faucet, and the method for dispensing the smart faucet including: Acquire the first image information of the container captured by the camera device and the distance information measured by the ranging device; Pixel restoration processing is performed on the first image information to obtain the second image information of the container; The volume of the container is determined based on the distance information and the second image information; Based on the first image information and the volume, the container is subjected to water outflow analysis to obtain water outflow information; Based on the water output information, the smart faucet is controlled to adjust the water output.

[0007] In some optional implementations, the container is located within a container placement area, and the pixel restoration processing of the first image information to obtain the second image information of the container includes: Obtain the target scaling factor; Based on the target scaling factor, the first image information is pixel-restored in the first direction and the second direction respectively to obtain the second image information of the container; Wherein, the plane containing the first direction and the second direction is parallel to the plane containing the container placement area, and the first direction is perpendicular to the second direction.

[0008] In some optional implementations, the method for determining the target scaling factor includes: Acquire reference image information captured by the camera device; the reference image information is image information of a preset reference graphic, and the reference graphic is located within the container placement area; The reference image information is analyzed to obtain the first reference pixel value of the reference graphic in the first direction and the second reference pixel value of the reference graphic in the second direction; A first scaling factor is determined based on the first length of the reference graphic and the first reference pixel value; The second scaling factor is determined based on the second length of the reference graphic and the second reference pixel value; The first scaling factor and the second scaling factor are used as the target scaling factor; Wherein, the first length is the length of the reference pattern in the first direction, and the second length is the length of the reference pattern in the second direction.

[0009] In some optional implementations, the step of performing pixel reconstruction on the first image information in a first direction and a second direction based on the target scaling factor to obtain the second image information of the container includes: The first image information is parsed to obtain the first target pixel value of the first image information in the first direction and the second target pixel value of the first image information in the second direction; The first restored pixel value is determined based on the first scaling factor and the first target pixel value; The second restored pixel value is determined based on the second scaling factor and the second target pixel value; Based on the first restored pixel value and the second restored pixel value, the second image information of the container is obtained.

[0010] In some optional implementations, the distance information includes a first distance and a second distance, wherein the first distance is the distance from the upper edge of the container to the plane where the container is placed, and the second distance is the distance from the liquid surface inside the container to the plane where the container is placed; determining the volume of the container based on the distance information and the second image information includes: The surface area of ​​the upper opening of the container is obtained by parsing the second image information; The height of the container is determined based on the second distance and the first distance; The volume of the container is determined based on the surface area of ​​the upper opening and the height.

[0011] In some optional implementations, the step of performing water effluent analysis on the container based on the first image information and the volume to obtain water effluent information includes: Obtain the allocation model; the allocation model is obtained by training a preset model to predict water temperature and water output based on historical image information and the corresponding water temperature and water output information of the historical image information. The first image information is input into the mixing model, and the first image information is parsed based on the mixing model to obtain the information of the substance to be mixed in the container. The target water temperature information and target water output information are determined based on the information of the substance to be mixed. The target water temperature information and the target water output information are used as the water output information.

[0012] On the other hand, this application provides a dispensing device for a smart faucet, the dispensing device for the smart faucet comprising: The acquisition module is used to acquire the first image information of the container captured by the camera device and the distance information measured by the ranging device; An image processing module is configured to perform pixel restoration processing on the first image information to obtain second image information of the container; and to determine the volume of the container based on the distance information and the second image information. The allocation module is used to perform water outflow analysis processing on the container based on the first image information and the volume to obtain water outflow information; The control module is used to control the smart faucet to adjust the water output based on the water output information.

[0013] On the other hand, this application provides a smart faucet, wherein the smart faucet uses the dispensing method of the smart faucet as described in any one of the above embodiments to dispense water.

[0014] On the other hand, this application provides an electronic device, which includes 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 dispensing method of the smart faucet 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 dispensing method of the smart faucet as described in any of the above embodiments.

[0016] This application provides a smart faucet dispensing method. The smart faucet includes a ranging device and a camera device. A container is placed below the smart faucet. The dispensing method includes: acquiring first image information of the container captured by the camera device and distance information measured by the ranging device; performing pixel restoration processing on the first image information to obtain second image information of the container; determining the volume of the container based on the distance information and the second image information; performing water dispensing analysis processing on the container based on the first image information and the volume to obtain water dispensing information; and controlling the smart faucet to dispense water based on the water dispensing information. By acquiring container images and distance information through the smart faucet, correcting image errors through pixel restoration, accurately calculating the container volume, and then combining the container image information and volume to complete water dispensing analysis, the method achieves adaptive dispensing of containers of different sizes, adapting to diverse household usage scenarios, improving the accuracy and flexibility of beverage dispensing, and optimizing the user experience. 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 diagram of a smart faucet dispensing method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of a dispensing device for an intelligent faucet according to an embodiment of the present invention. Detailed Implementation

[0019] 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.

[0020] 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.

[0021] 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.

[0022] The current mixing equipment is prone to problems such as beverage spillage and mismatch between water volume and container capacity. It is difficult to accurately calculate the actual size and volume of the container, resulting in insufficient accuracy in water mixing. It cannot achieve adaptive compatibility with different containers and cannot meet the diverse and personalized beverage mixing needs in home settings.

[0023] Therefore, in order to adapt to different container sizes, suit diverse household usage scenarios, improve the accuracy and flexibility of beverage preparation, and optimize the user experience, this application provides a preparation method, device, and smart faucet for a smart faucet.

[0024] Please see Figure 1 , Figure 1 This is a schematic flowchart of a smart faucet dispensing method according to an embodiment of the present invention. In one aspect, this application provides a smart faucet dispensing method, wherein the smart faucet includes a ranging device and a camera device, and a container is placed below the smart faucet. The smart faucet dispensing method includes: S101. Obtain the first image information of the container captured by the camera device and the distance information measured by the ranging device.

[0025] Optionally, the robotic arm of the smart faucet can move freely in a plane parallel to the container placement area, i.e., the tabletop, combining the basic water dispensing function of the faucet with the ability to automatically locate and position the target container. The camera device is a high-definition camera, fixedly mounted below the end of the robotic arm, with a vertically downward shooting angle. The imaging plane is parallel to the plane of the container placement area, and the two maintain a fixed installation distance, providing a stable geometric basis for image acquisition and subsequent pixel size conversion. The ranging device is an infrared ranging module used for full-water detection, integrated near the smart faucet's spout, coaxially positioned with the camera device, using a vertically downward ranging direction, and equipped with a dual-beam infrared light emission structure.

[0026] Optionally, before formally collecting data, the smart faucet first uses a camera device to perform preliminary identification and coarse positioning of the container. A built-in positioning algorithm converts the container's image coordinates into world coordinates, driving a robotic arm to move directly above the container's rim. This ensures the camera and ranging device are in optimal acquisition positions with no obstructions and minimal viewing angle deviations. After the robotic arm is positioned directly above the container's rim, the vertically downward-facing camera acquires the image. The acquisition action and the ranging action of the ranging device are executed synchronously, ensuring spatiotemporal consistency between image and distance data. The first image information is the raw, uncorrected image data directly acquired by the camera. The acquired image information includes the raw pixel data of the container's outline, including the complete outline of the container's top opening, and the raw pixel dimensions of the container in the first and second directions; as well as the overall shape characteristics of the container, information about the contents to be mixed inside the container, and the container's precise position within the placement area, providing raw image data for subsequent water output analysis and mixing model calculations.

[0027] Optionally, distance information is acquired synchronously with the first image information, using a dual-beam infrared ranging module. Two infrared beams are emitted vertically downwards, precisely projected onto the upper edge of the container (the rim) and the liquid surface inside the container (or the bottom surface when there is no liquid), respectively. The vertical distance between these two points is then calculated. This data is combined with the second image information obtained after pixel reconstruction to accurately calculate the total volume and remaining capacity of the container. Furthermore, it provides real-time water level monitoring data for subsequent water dispensing, enabling water level control and preventing beverage spillage.

[0028] S102. Perform pixel restoration processing on the first image information to obtain the second image information of the container.

[0029] In an optional embodiment, the container is located within a container placement area, and the step of performing pixel restoration processing on the first image information to obtain the second image information of the container includes: Obtain the target scaling factor; Based on the target scaling factor, the first image information is pixel-restored in the first direction and the second direction respectively to obtain the second image information of the container; Wherein, the plane containing the first direction and the second direction is parallel to the plane containing the container placement area, and the first direction is perpendicular to the second direction.

[0030] In an optional embodiment, the method for determining the target scaling factor includes: Acquire reference image information captured by the camera device; the reference image information is image information of a preset reference graphic, and the reference graphic is located within the container placement area; The reference image information is analyzed to obtain the first reference pixel value of the reference graphic in the first direction and the second reference pixel value of the reference graphic in the second direction; A first scaling factor is determined based on the first length of the reference graphic and the first reference pixel value; The second scaling factor is determined based on the second length of the reference graphic and the second reference pixel value; The first scaling factor and the second scaling factor are used as the target scaling factor; Wherein, the first length is the length of the reference pattern in the first direction, and the second length is the length of the reference pattern in the second direction.

[0031] In an optional embodiment, the step of performing pixel reconstruction on the first image information in a first direction and a second direction based on the target scaling factor to obtain the second image information of the container includes: The first image information is parsed to obtain the first target pixel value of the first image information in the first direction and the second target pixel value of the first image information in the second direction; The first restored pixel value is determined based on the first scaling factor and the first target pixel value; The second restored pixel value is determined based on the second scaling factor and the second target pixel value; Based on the first restored pixel value and the second restored pixel value, the second image information of the container is obtained.

[0032] Optionally, the target scaling factor is divided into two sets of independent parameters: a first scaling factor in the first direction and a second scaling factor in the second direction, which correspond to the actual physical length represented by a single image pixel in two vertical directions, the first direction being the X-axis direction and the second direction being the Y-axis direction.

[0033] Optionally, reference image information captured by the camera device is obtained. This reference image is a captured image of a reference graphic with a known actual size that is preset within the container placement area. For example, the reference graphic can be a 10cm × 10cm square mark, with its first length in the first direction and its second length in the second direction both being fixed known values ​​of 10cm, providing a standard reference for pixel calibration.

[0034] Optionally, image analysis is performed on the acquired reference image information to extract the first reference pixel value of the reference graphic in the first direction (i.e., the number of pixels corresponding to the horizontal side length of the square) and the second reference pixel value in the second direction (i.e., the number of pixels corresponding to the vertical side length of the square). Since the camera maintains a fixed vertical distance from the container's placement plane, the ratio of this pixel value to the actual length is a fixed value and will not change due to the translational movement of the robotic arm within the plane, ensuring the universality of the calibration parameters. The first scaling factor is the ratio of the first length of the reference graphic to the first reference pixel value, i.e., the actual physical length corresponding to each pixel in the first direction; the second scaling factor is the ratio of the second length of the reference graphic to the second reference pixel value, i.e., the actual physical length corresponding to each pixel in the second direction. The target scaling factor is used to convert the original pixel size in the container's first image information into a restored pixel value reflecting the container's actual physical size. This solves the core problems of camera imaging perspective distortion and pixel-to-actual-physical-size conversion deviation, improving the accuracy of container size measurement. Furthermore, it only requires a preset standard square reference graphic, eliminating the need for professional calibration equipment, making it suitable for home smart hardware usage scenarios, and balancing ease of use with long-term stability.

[0035] Optionally, image contour analysis is performed on the acquired first image information of the container to extract pixel data of the complete contour of the container's opening, obtaining the first target pixel value in the first direction and the second target pixel value in the second direction. Simultaneously, the overall shape features of the container can be extracted to distinguish between cylindrical and irregularly shaped containers, providing a basis for subsequent volume calculation. Based on the target scaling factor, independent reconstruction calculations are performed on the target pixel values ​​in both directions to obtain the true physical dimensions. The first reconstructed pixel value is the product of the first target pixel value and the first scaling factor, and the second reconstructed pixel value is the product of the second target pixel value and the second scaling factor. Based on the calculated first and second reconstructed pixel values, the container contour of the first image information is dimensionally calibrated and reconstructed, ultimately generating the second image information of the container. The second image information is a calibrated image representing the true physical contour of the container, the true diameter and surface area of ​​the rim, and the overall shape features. It can be directly combined with the distance information acquired by the ranging device to complete the accurate calculation of the container's volume.

[0036] Optionally, the second image information can be adapted to different types of containers. For mainstream cylindrical cups, the surface area of ​​the rim can be directly calculated using the restored actual size of the cup opening, and the volume can be calculated by combining the height data. For special-shaped cups, the volume correction calculation can be performed using the restored complete outline size, covering the usage scenarios of most household containers. Through the process of baseline image pre-calibration, bidirectional independent scaling coefficient calculation, and directional pixel restoration, the measurement error problem caused by camera imaging distortion is solved, achieving accurate conversion from pixel size to actual physical size. This significantly improves the accuracy of container size and volume calculation, laying the foundation for subsequent adaptive water dispensing and personalized beverage preparation.

[0037] S103. Determine the volume of the container based on the distance information and the second image information.

[0038] In an optional embodiment, the distance information includes a first distance and a second distance, wherein the first distance is the distance from the upper edge of the container to the plane where the container is placed, and the second distance is the distance from the liquid surface inside the container to the plane where the container is placed; determining the volume of the container based on the distance information and the second image information includes: The surface area of ​​the upper opening of the container is obtained by parsing the second image information; The height of the container is determined based on the second distance and the first distance; The volume of the container is determined based on the surface area of ​​the upper opening and the height.

[0039] Optionally, the first distance is the vertical distance from the top edge of the container (i.e., the rim of the cup) to the plane where the container is placed, which is the upper limit benchmark for calculating the container height. The second distance is the vertical distance from the liquid surface inside the container to the plane where the container is placed; when there is no liquid, it is the vertical distance from the bottom surface inside the container (i.e., the bottom of the cup) to the plane where it is placed, which is the lower limit benchmark for calculating the container height. The container's capacity is divided into two core scenarios: in the empty cup state, it is the total capacity that the container can hold; in the liquid state, it is the remaining capacity that the container can hold, i.e., the maximum capacity that can safely dispense water.

[0040] Optionally, standardized image processing is performed on the second image information, including grayscale conversion, edge detection, contour fitting, and noise filtering, to obtain the complete closed contour of the container's opening. For mainstream cylindrical round cups, the true diameter of the cup opening is extracted from the restored contour, and the accurate surface area of ​​the opening is calculated using the formula for the area of ​​a circle. For square cups, the true length and width are extracted from the restored contour, and the surface area of ​​the opening is calculated using the formula for the area of ​​a rectangle. For elliptical cups, the true dimensions of the major and minor axes are extracted, and the area is calculated using the formula for the area of ​​an ellipse, adapting to common irregularly shaped cups used in home settings. For special-shaped cups, the irregular closed contour of the cup opening can be identified using the second image information, and the true surface area of ​​the opening is calculated using contour integration. At the same time, a correction coefficient interface is reserved in conjunction with the overall shape features of the cup body recognized by the image.

[0041] Optionally, the height of the container is the difference between the first distance and the second distance, which is the vertical height from the top edge of the container to the internal liquid surface or the bottom of the cup. This is the effective water-holding height of the container, rather than the total physical height of the container including the thickness of the bottom, ensuring that the volume calculation matches the actual water dispensing scenario. When the cup is empty, the calculated height is the total effective water-holding height of the container, i.e., the vertical distance from the rim of the cup to the inner surface of the bottom of the cup, used to calculate the total capacity of the container. When the cup is filled with liquid, the calculated height is the remaining water-holding height of the container, i.e., the vertical distance from the rim of the cup to the existing liquid surface, used to calculate the remaining capacity of the container, preventing beverage spillage during subsequent dispensing.

[0042] Optionally, for cylindrical containers, which are most commonly used in home settings, their cross-sectional area is uniform along the height. Therefore, the container's volume is the product of the top surface area and the container's height. This formula corresponds to the calculation logic for the volume of a cylinder, is simple and efficient, and can be adapted to most household cups on the market, meeting the needs of home use. For special-shaped containers such as conical cups and irregularly shaped cups, the shape features and taper parameters of the cup body can be identified through second image information. Combined with the top surface area and height data, a preset cup shape correction coefficient is matched to adapt and correct the volume calculation results, further improving the measurement accuracy.

[0043] By accurately reconstructing the rim area from images and precisely measuring the height using infrared distance, the system achieves adaptive and accurate calculation of the container's volume, breaking through the limitations of fixed cup shapes. At the same time, it precisely controls the water flow, avoiding issues such as beverage overflow and insufficient water, and significantly improving the user experience.

[0044] S104. Based on the first image information and the volume, perform water outflow analysis processing on the container to obtain water outflow information.

[0045] In an optional embodiment, the step of performing water effluent analysis on the container based on the first image information and the volume to obtain water effluent information includes: Obtain the allocation model; the allocation model is obtained by training a preset model to predict water temperature and water output based on historical image information and the corresponding water temperature and water output information of the historical image information. The first image information is input into the mixing model, and the first image information is parsed based on the mixing model to obtain the information of the substance to be mixed in the container. The target water temperature information and target water output information are determined based on the information of the substance to be mixed. The target water temperature information and the target water output information are used as the water output information.

[0046] Optionally, the mixing model is a supervised training intelligent model capable of predicting water temperature and output volume. The preset model is a multimodal deep learning model used to output adapted water temperature and output volume predictions based on the recognition results, balancing image recognition accuracy with the professionalism of the mixing decision. The historical image information used for model training covers image data related to all categories of home-use mixing, including images of different types of tea and tea bases, images of containers of different sizes and water levels, and original images of containers in different scenarios. Each set of historical image information is labeled with industry-standard and adapted mixing water temperatures, as well as water temperature fine-tuning parameters corresponding to different dosages and concentrations. Each set of historical image information is also labeled with the adapted golden ratio of water output, along with safety constraints on container volume and water output. The dataset is also supplemented with publicly available professional beverage mixing data and a unique mixing scheme adapted to the faucet robotic arm, further enhancing the model's professionalism and adaptability.

[0047] Optionally, with the training objectives of minimizing water temperature prediction error and water output prediction error, a pre-defined model is trained under supervision using a labeled dataset. The model's weight parameters are continuously optimized through backpropagation. After training, the model's recognition accuracy and prediction accuracy are verified using a test set. Once the standards are met, a final usable model is formed. The smart faucet can embed the pre-trained model into the device's local control chip for offline use, ensuring normal operation even in network outage scenarios. Alternatively, the model can be deployed in the cloud, allowing the device to access the latest version of the model in real time via wireless network, supporting continuous iterative optimization and adapting to more beverage preparation scenarios.

[0048] Optionally, after receiving the first image information, the mixing model first uses a front-end image feature extraction network to perform grayscale conversion, feature extraction, contour segmentation, and classification matching on the original image, filtering out interference information such as containers and backgrounds, extracting the core features of the ingredients to be mixed inside the container, and outputting complete information about the ingredients to be mixed. The type of tea base in the cup is identified by the camera device; for example, the coverage area of ​​tea leaves at the bottom of the cup and the amount of strong tea base can be calculated after detection by the camera device and the ranging module. The information about the ingredients to be mixed may include: information about the type of ingredients to be mixed; dosage information about the ingredients to be mixed, such as identifying the coverage area and stacking height of tea leaves or coffee powder at the bottom of the cup, converting it into the actual weight of the material, or identifying the water level and volume of the liquid already in the container; initial state information of the container, identifying whether there is liquid in the container, the type and concentration of the liquid already in the container, and the initial water level, used to distinguish between empty cup mixing and liquid replenishment scenarios; and basic feature information of the container, such as identifying the shape and type of the container.

[0049] Optionally, the model uses the type of item to be prepared as the core basis, combined with professional brewing knowledge learned during training, to output the optimal target water temperature information. It can also adaptively fine-tune based on material dosage and brewing scenario. The model uses the brewing ratio corresponding to the material dosage as a basis, with container volume as a hard constraint, to output accurate target water output information. In the case of an empty cup with no liquid, it matches the trained ingredient ratio based on the identified tea or coffee powder dosage to calculate the appropriate basic water output; simultaneously, it sets a safety threshold to reserve a safety margin to prevent overflow. In the case of liquid with tea base, it calculates the appropriate replenishment amount based on the identified existing tea base type, dosage, and concentration, combined with the user's brewing needs. The target water temperature information is a precise temperature value, corresponding to the control instructions of the smart faucet water purification temperature control system, used to drive the heating or cooling module to adjust the outlet water temperature to the target value in real time; the target water output information is a precise volume value, corresponding to the control instructions of the smart faucet solenoid valve, water pump, and water output timing module, used to accurately control the water output duration and total water output, ensuring that the actual water output is consistent with the target value.

[0050] Optionally, the water output information can be synchronized with personalized user input commands, including voice commands, APP settings, button operations, etc. The model will adjust the water output volume appropriately based on the basic water output information, and output the final water output information after completing the personalized adaptation of parameters.

[0051] Through a trained mixing model, adaptive dynamic adjustment of water temperature and output is achieved. The type and dosage of the substance to be mixed are automatically obtained through image recognition. Without the need for users to manually set parameters, the optimal mixing temperature and water volume can be automatically matched, solving the problem of difficulty in controlling the mixing parameters manually. At the same time, it avoids the problems of beverage overflow and insufficient water volume caused by fixed output volume, greatly improving the safety and user experience of intelligent use in home scenarios.

[0052] S105. Based on the water output information, control the smart faucet to adjust the water output.

[0053] Optionally, the main control unit calls upon the container position image data collected by the front-end camera device, converts the container's image coordinates into world coordinates through a positioning algorithm, and drives the robotic arm to translate in a plane parallel to the tabletop, precisely moving the water outlet to the center directly above the container's rim, ensuring that the water flows vertically into the cup. After obtaining the water output information, the temperature control system is activated based on the target water temperature information. If the target water temperature is higher than the current purified water temperature, the heating module is activated; if the target water temperature is low, the cooling module is activated. If the water output information includes multiple ingredient ratio requirements, the main control unit can unlock the control valve of the corresponding beverage ingredient box according to the ratio requirements, preparing for branch dispensing. Based on the target water output information, the flow rate is controlled to avoid water output deviation caused by overflow, until the cumulative flow reaches the target water output. In addition, according to the ingredient ratio and dispensing sequence in the water output information, the control valves of the corresponding ingredients are controlled sequentially or synchronously. Each ingredient is equipped with an independent flow metering module to accurately control the dispensing volume of a single ingredient, while the total water output is strictly locked within the container's safe volume range.

[0054] On the other hand, this application provides a dispensing device for a smart faucet; please refer to [link / reference]. Figure 2 , Figure 2 This is a schematic diagram of a dispensing device for a smart faucet according to an embodiment of the present invention. The dispensing device for the smart faucet includes: The acquisition module 201 is used to acquire the first image information of the container captured by the camera device and the distance information measured by the ranging device; Image processing module 202 is used to perform pixel restoration processing on the first image information to obtain second image information of the container; and to determine the volume of the container based on the distance information and the second image information. The allocation module 203 is used to perform water outflow analysis processing on the container based on the first image information and the volume to obtain water outflow information; The control module 204 is used to control the smart faucet to adjust the water output based on the water output information.

[0055] In an optional embodiment, the image processing module 202 includes: The target scaling factor acquisition unit is used to acquire the target scaling factor. The second image information determination unit is used to perform pixel restoration on the first image information in the first direction and the second direction based on the target scaling factor to obtain the second image information of the container.

[0056] In an optional embodiment, the image processing module 202 further includes: A reference image information acquisition unit is used to acquire reference image information captured by the camera device; the reference image information is image information of a preset reference graphic, and the reference graphic is located within the container placement area; A reference pixel value determination unit is used to parse the reference image information to obtain a first reference pixel value of the reference graphic in the first direction and a second reference pixel value of the reference graphic in the second direction. A scaling factor determining unit is configured to determine a first scaling factor based on a first length of the reference graphic and a first reference pixel value; and to determine a second scaling factor based on a second length of the reference graphic and a second reference pixel value. The target scaling factor determination unit is used to use the first scaling factor and the second scaling factor as the target scaling factor.

[0057] In an optional embodiment, the second image information determining unit includes: The target pixel value determination subunit is used to parse the first image information to obtain the first target pixel value of the first image information in the first direction and the second target pixel value of the first image information in the second direction. The pixel value determination subunit is configured to determine a first restored pixel value based on the first scaling factor and the first target pixel value; and to determine a second restored pixel value based on the second scaling factor and the second target pixel value. The second image information determination subunit is used to obtain the second image information of the container based on the first restored pixel value and the second restored pixel value.

[0058] In an optional embodiment, the image processing module 202 further includes: The upper surface area determination unit is used to parse the second image information to obtain the upper surface area of ​​the container; A height determination unit is used to determine the height of the container based on the second distance and the first distance; A volume determination unit is used to determine the volume of the container based on the surface area of ​​the upper opening and the height.

[0059] In an optional embodiment, the dispensing module 203 includes: The allocation model acquisition unit is used to acquire the allocation model; the allocation model is obtained by training a preset model to predict water temperature and water output based on historical image information and the corresponding water temperature and water output information of the historical image information. The water discharge information determination unit is used to input the first image information into the mixing model, parse the first image information based on the mixing model to obtain the information of the substance to be mixed in the container, determine the target water temperature information and the target water discharge information based on the information of the substance to be mixed, and use the target water temperature information and the target water discharge information as the water discharge information.

[0060] On the other hand, this application provides a smart faucet, wherein the smart faucet uses the dispensing method of the smart faucet as described in any of the above embodiments to dispense water.

[0061] The smart faucet dispensing method provided in this application includes a ranging device and a camera device. A container is placed below the smart faucet. The dispensing method includes: acquiring first image information of the container captured by the camera device and distance information measured by the ranging device; performing pixel restoration processing on the first image information to obtain second image information of the container; determining the volume of the container based on the distance information and the second image information; performing water discharge analysis processing on the container based on the first image information and the volume to obtain water discharge information; and controlling the smart faucet to dispense water based on the water discharge information. The smart faucet dispensing method provided in this application has the following beneficial effects: (1) By linking the camera device and the ranging device, the camera imaging distortion is first eliminated by pixel restoration processing, the actual volume of the container and the remaining space that can be accommodated are accurately calculated, and then the water output analysis and adaptive water output adjustment are completed based on the container parameters. It is suitable for most containers of most specifications and shapes in household scenarios and has strong applicability. (2) By using the preset reference graphic within the container placement area, the independent scaling coefficients of the first and second directions are calibrated. Then, the original image is pixel restored by using the target scaling coefficient, which eliminates the size measurement error caused by camera imaging distortion and improves the accuracy of volume calculation. (3) Through the pre-trained mixing model, the type and dosage of tea base in the cup can be automatically identified based on the collected container image. Without the user having to manually set parameters, the water temperature and appropriate water output of the corresponding type of material can be automatically matched, improving the level of intelligence and the user's experience.

[0062] 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 dispensing method of the smart faucet as described in any of the above embodiments.

[0063] In an optional embodiment, 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 smart faucet dispensing method as described in any of the above embodiments.

[0064] The above description is merely 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 dispensing water from a smart faucet, characterized in that, The smart faucet includes a ranging device and a camera device. A container is placed below the smart faucet. The method for adjusting the smart faucet includes: Acquire the first image information of the container captured by the camera device and the distance information measured by the ranging device; Pixel restoration processing is performed on the first image information to obtain the second image information of the container; The volume of the container is determined based on the distance information and the second image information; Based on the first image information and the volume, the container is subjected to water outflow analysis to obtain water outflow information; Based on the water output information, the smart faucet is controlled to adjust the water output.

2. The dispensing method for the intelligent faucet according to claim 1, characterized in that, The container is located within the container placement area. The step of performing pixel reconstruction processing on the first image information to obtain the second image information of the container includes: Obtain the target scaling factor; Based on the target scaling factor, the first image information is pixel-restored in the first direction and the second direction respectively to obtain the second image information of the container; Wherein, the plane containing the first direction and the second direction is parallel to the plane containing the container placement area, and the first direction is perpendicular to the second direction.

3. The dispensing method for the intelligent faucet according to claim 2, characterized in that, The method for determining the target scaling factor includes: Acquire reference image information captured by the camera device; the reference image information is image information of a preset reference graphic, and the reference graphic is located within the container placement area; The reference image information is analyzed to obtain the first reference pixel value of the reference graphic in the first direction and the second reference pixel value of the reference graphic in the second direction; A first scaling factor is determined based on the first length of the reference graphic and the first reference pixel value; The second scaling factor is determined based on the second length of the reference graphic and the second reference pixel value; The first scaling factor and the second scaling factor are used as the target scaling factor; Wherein, the first length is the length of the reference pattern in the first direction, and the second length is the length of the reference pattern in the second direction.

4. The dispensing method for the intelligent faucet according to claim 3, characterized in that, The step of performing pixel reconstruction on the first image information in the first direction and the second direction based on the target scaling factor to obtain the second image information of the container includes: The first image information is parsed to obtain the first target pixel value of the first image information in the first direction and the second target pixel value of the first image information in the second direction; The first restored pixel value is determined based on the first scaling factor and the first target pixel value; The second restored pixel value is determined based on the second scaling factor and the second target pixel value; Based on the first restored pixel value and the second restored pixel value, the second image information of the container is obtained.

5. The dispensing method for the intelligent faucet according to claim 1, characterized in that, The distance information includes a first distance and a second distance. The first distance is the distance from the upper edge of the container to the plane where the container is placed, and the second distance is the distance from the liquid surface inside the container to the plane where the container is placed. Determining the volume of the container based on the distance information and the second image information includes: The surface area of ​​the upper opening of the container is obtained by parsing the second image information; The height of the container is determined based on the second distance and the first distance; The volume of the container is determined based on the surface area of ​​the upper opening and the height.

6. The dispensing method for the intelligent faucet according to claim 1, characterized in that, The step of analyzing the water discharge from the container based on the first image information and the volume to obtain water discharge information includes: Obtain the allocation model; the allocation model is obtained by training a preset model to predict water temperature and water output based on historical image information and the corresponding water temperature and water output information of the historical image information. The first image information is input into the mixing model, and the first image information is parsed based on the mixing model to obtain the information of the substance to be mixed in the container. The target water temperature information and target water output information are determined based on the information of the substance to be mixed. The target water temperature information and the target water output information are used as the water output information.

7. A dispensing device for an intelligent faucet, characterized in that, The dispensing device of the smart faucet includes: The acquisition module is used to acquire the first image information of the container captured by the camera device and the distance information measured by the ranging device; An image processing module is configured to perform pixel restoration processing on the first image information to obtain second image information of the container; and to determine the volume of the container based on the distance information and the second image information. The allocation module is used to perform water outflow analysis processing on the container based on the first image information and the volume to obtain water outflow information; The control module is used to control the smart faucet to adjust the water output based on the water output information.

8. A smart faucet, characterized in that, The smart faucet uses the dispensing method described in any one of claims 1-6 to dispense water.

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 dispensing method of the smart faucet 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 dispensing method of the smart faucet as described in any one of claims 1-6.