Instant heating type water dispenser water pump PWM software control method and corresponding medium and equipment

By introducing a historical PWM value storage and retrieval mechanism and a PID control algorithm into the instant hot water dispenser, the problem of slow heating start-up of the instant hot water dispenser has been solved, achieving rapid heating and temperature stability, thereby improving user experience and system efficiency.

CN121806418APending Publication Date: 2026-04-07GUANGDONG ELITE ELECTRONIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-23
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing instant water dispensers require real-time calculation of the appropriate water flow rate each time water is dispensed, resulting in slow heating speed, poor user experience, and frequent calculations that increase the computing load on the controller, affecting energy efficiency and system stability.

Method used

A mechanism for storing and recalling historical PWM values ​​is introduced. Combined with PID control algorithm and temperature monitoring, historical PWM values ​​are obtained through the initial control process and corrected in the fast start-up process to achieve rapid heating and maintain stable temperature.

Benefits of technology

It significantly reduces heating start-up time, improves system response speed and user experience, while ensuring long-term stability and adaptability of outlet water temperature, and enhances the practicality and robustness of control strategies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121806418A_ABST
    Figure CN121806418A_ABST
Patent Text Reader

Abstract

The invention discloses a water pump PWM software control method for an instant heating type water dispenser and a corresponding medium and equipment, and the method comprises the steps: S1, receiving a water outlet instruction, and judging whether a water pump PWM historical value corresponding to the current target temperature exists or not; s2, if not, a water pump and a heater are started, the PWM value of the water pump is dynamically adjusted through a PID algorithm according to the difference value between the outlet water temperature and the target temperature till the water temperature stably reaches the standard, and the PWM value is stored as a historical value; s3, if yes, the historical PWM value is directly called to control a water pump and start a heater; and S4, continuously monitoring the water temperature in the quick starting process, and if the water temperature deviates from the target temperature, correcting the historical PWM value to keep the constant temperature. According to the invention, rapid starting is realized by storing and calling the historical PWM value, and time consumed by real-time calculation is reduced; closed-loop control is formed by combining monitoring and correction, long-term stability of the water temperature is guaranteed, and the system adapts to environment and equipment state changes.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of automatic control technology, and particularly relates to a PWM software control method for a water pump of an instant water heater, and a corresponding medium and device. BACKGROUND

[0002] With the improvement of living quality, instant water heaters gradually become common devices in families and offices due to their characteristics of fast heating and quantitative water output. At present, most instant water heaters on the market adopt a constant power heating scheme, which controls the water temperature by adjusting the flow rate of the water pump, that is, the required flow rate is dynamically calculated according to real-time temperature feedback at each water output, so as to realize temperature stability. However, this method has obvious deficiencies: since the appropriate flow rate needs to be calculated by a software algorithm in real time each time, especially in devices with low voltage, low power or limited system resources, the calculation process takes a long time, which leads to a prolonged waiting time from starting to reaching the target temperature, slow heating speed, and affects the user experience; at the same time, frequent real-time calculation also increases the operation load of the controller, which is not conducive to the optimization of energy efficiency and system stability. SUMMARY

[0003] (I) Invention purpose In order to overcome the above deficiencies, the purpose of the present application is to provide a PWM software control method for a water pump of an instant water heater, and a corresponding medium and device, so as to solve the technical problem that the existing instant water heater needs to calculate the appropriate flow rate of the water pump in real time at each water output, which leads to slow heating speed and poor user experience.

[0004] (II) Technical solutions In order to achieve the above purpose, the technical solutions provided by the present application are as follows: A PWM software control method for a water pump of an instant water heater, the instant water heater comprising a heater, a water pump, a temperature sensor and a controller, characterized in that the method comprises the following steps: S1: in response to a water output start instruction, determining whether a water pump PWM value corresponding to a current target temperature has been stored in the controller; S2: if not stored, performing a first control process: starting the water pump and the heater, dynamically calculating and adjusting the PWM value of the water pump based on the difference between the water output temperature fed back by the temperature sensor and the target temperature by a PID control algorithm, until the water output temperature reaches and stabilizes at the target temperature, and saving the PWM value of the water pump at this time as a historical PWM value associated with the target temperature; S3: if stored, performing a rapid start process: directly calling the historical PWM value to control the water pump, and starting the heater to heat; S4: in the rapid start process, continuously monitoring the water output temperature, and if the water output temperature deviates from the target temperature, modifying the historical PWM value to maintain the constant water output temperature.

[0005] The application realizes fast start by introducing a storage and calling mechanism of historical PWM values, directly calling historical values when the same temperature demand occurs subsequently, significantly reducing the calculation time of each heating start, and improving the system response speed and user experience. At the same time, the system continues to monitor the temperature during the fast start process and combines real-time temperature monitoring and PWM value correction to form a closed-loop control, ensuring the long-term stability and adaptability of the outlet water temperature, avoiding water temperature fluctuations caused by changes in the environment or device state, and achieving efficient and stable unification.

[0006] In some embodiments, the first control process includes: S21: initialize the parameters of the PID control algorithm, and set an initial PWM value for the water pump; S22: start the water pump and determine whether the internal pipeline of the water dispenser has been filled with water; S23: when it is confirmed that the pipeline has been filled with water, control the heater to work at full power, and run the PID control algorithm to calculate and output a new water pump PWM value in real time according to the difference between the outlet water temperature feedback by the temperature sensor and the target temperature, to adjust the water flow rate; S24: continuously determine whether the outlet water temperature reaches the target temperature; S25: when the outlet water temperature reaches the target temperature and remains stable, the corresponding water pump PWM value at this time is saved as a historical PWM value associated with the current target temperature.

[0007] The embodiment refines the first control process, emphasizing starting full-power heating after water filling to prevent dry burning and ensure the accuracy of temperature control. Through step-by-step initialization, water filling detection, PID adjustment, and stability determination, a safe and reliable first value acquisition process is formed, providing a reliable data basis for subsequent fast start. This process improves the safety and reliability of the first temperature calibration process through coordinated control of water filling detection and full-power heating, avoiding abnormal device operation. At the same time, clear step division enables the system to efficiently and stably acquire the optimal PWM value during the initialization phase, enhancing the practicality and robustness of the overall control strategy.

[0008] In some embodiments, running the PID control algorithm in step S23 includes: S231: calculate the real-time error value between the outlet water temperature and the target temperature; S232: based on the real-time error value, generate an adjustment amount for the water pump PWM value through the proportional, integral, and derivative terms of the PID control algorithm; S233: update and output the PWM value for controlling the water pump according to the adjustment amount.

[0009] The PID control algorithm is adopted to realize dynamic adjustment of the PWM value, which significantly improves the response speed and control accuracy of the system to temperature changes. Through the comprehensive action of the three items of proportion, integral, and differential, the system can quickly converge to the target temperature and remain stable, effectively suppressing overshoot and oscillation, thereby ensuring the accuracy of the outlet water temperature while improving energy efficiency and equipment life.

[0010] In some embodiments, the correcting the historical PWM value comprises: periodically determining the deviation of the outlet water temperature from the target temperature; if the outlet water temperature is lower than the target temperature, decreasing the historical PWM value; if the outlet water temperature is higher than the target temperature, increasing the historical PWM value.

[0011] Through periodic temperature deviation detection and PWM value directional correction, the system can adapt to environmental changes and equipment aging in long-term operation, maintaining the stability of the outlet water temperature. This mechanism enhances the fault tolerance and persistent adaptability of the control system, enabling continuous optimization without human intervention, improving product reliability and user satisfaction.

[0012] In some embodiments, if the outlet water temperature is lower than the target temperature, decreasing the historical PWM value comprises: if the outlet water temperature is 1 degree Celsius lower than the target temperature, the historical PWM value is decreased by 0.5%; If the outlet water temperature is higher than the target temperature, increasing the historical PWM value comprises: if the outlet water temperature is 1 degree Celsius higher than the target temperature, the historical PWM value is increased by 0.5%.

[0013] By quantifying the correction amplitude, the system can make moderate and stable PWM value adjustments when the temperature deviates, avoiding water temperature oscillation or response lag caused by excessive correction. This fine correction strategy further improves the smoothness and consistency of temperature control, maintaining good adaptability and stability in various use scenarios.

[0014] In some embodiments, the method further comprises: receiving and storing a plurality of different user set temperatures and historical PWM values corresponding to each temperature obtained through the first control process; In step S1, when responding to the outlet water instruction, the determining step comprises: according to the currently received user set temperature, querying whether there is a corresponding historical PWM value.

[0015] By supporting historical PWM value storage and query for multiple temperature points, the system can cover multiple temperature settings commonly used by users, significantly improving the starting efficiency and use convenience in multiple scenarios. Users can enjoy fast starting experience when switching between different temperature requirements, significantly enhancing the practicality and user stickiness of the product.

[0016] In some embodiments, if there is no saved, precisely corresponding historical PWM value for the target temperature set by the current user, a first-time control process is performed for the target temperature, and the obtained water pump PWM value is saved as a new historical PWM value.

[0017] The system has adaptive learning capability, can automatically calibrate and store newly set temperatures, and continuously expand the temperature range for fast start. This self-improving mechanism makes the product more and more in line with user habits during use, continuously improves the response speed and intelligent level, and realizes the long-term use experience of more and more convenient use.

[0018] In some embodiments, the method further comprises: associating a usage frequency statistical value and a last call timestamp with each stored historical PWM value corresponding to a user-set temperature; updating the corresponding usage frequency statistical value and last call timestamp after each call of the historical PWM value completes the heating of the water outlet flow process; for the historical PWM value whose usage frequency exceeds a preset threshold, after the outlet water temperature deviates from the target temperature and the historical PWM value is corrected in the fast start process, the correction result is updated in the historical PWM value saved in the storage with a preset weight; periodically scanning the stored historical PWM values, and deleting the historical PWM value record whose last call time is earlier than a preset validity period and whose usage frequency is lower than a preset frequency threshold.

[0019] On the basis of storing historical PWM values at multiple temperature points, a dynamic management mechanism based on usage frequency and timestamp is introduced. By associating usage frequency and last call time with each stored value, the system can intelligently distinguish between frequently used settings and rarely used settings. For frequently used temperature points, the system continuously optimizes the PWM value in a gradual manner during the learning process, so that the control parameters can adaptively adjust with changes in device state and environment, achieving accurate control over a long period of use. At the same time, by setting a cleaning mechanism based on time and usage frequency, the system can automatically eliminate obsolete and inefficient historical data, avoiding the storage space being occupied by invalid information, and keeping the knowledge base simple and effective. This improves the utilization efficiency of storage resources, and also ensures that the system always makes decisions based on the most relevant and most adaptive data to the current conditions. Overall, this mechanism enables the control system to have self-optimization and self-maintenance capabilities, significantly improving the adaptability, intelligent level, and user experience of the product during long-term use.

[0020] Another aspect of the present application provides a computer readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the above method.

[0021] The control method can be embedded in the control system of various instant water dispensers in the form of a storage medium, and software upgrading and function expansion can be realized without changing the hardware, thereby significantly reducing the product research and development and maintenance costs and improving the promotion applicability and implementation convenience of the scheme.

[0022] In another aspect, the application provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the method described above when executing the computer program.

[0023] The electronic device integrates the storage and processing capabilities required by the control method, and can be directly applied to terminal products such as instant water dispensers to achieve efficient and stable temperature control. The device structure is clear and reliable, and provides practical hardware support for improving the overall performance and user experience. BRIEF DESCRIPTION OF DRAWINGS

[0024] Figure 1 is a flowchart of the PWM software control method for the water pump of the instant water dispenser of the application. DETAILED DESCRIPTION

[0025] To make the purpose, technical solutions and advantages of the application clearer and more comprehensible, the application will be further described in detail below with reference to the specific embodiments and the accompanying drawings. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the application. In addition, in the following description, the description of known structures and technologies is omitted to avoid unnecessary confusion of the concept of the application.

[0026] The application provides a PWM software control method for the water pump of an instant water dispenser, which is applied to an instant water dispenser including a heater, a water pump, a temperature sensor and a controller. The controller is usually a micro control unit (MCU), which is electrically connected to the heater, the water pump driving circuit and the temperature sensor through wires, so as to send control signals and receive feedback information. The temperature sensor preferably uses an NTC thermistor, which is installed near the water outlet to directly detect the outlet water temperature. The heater is an instant electric heating tube, and the water pump is a direct current brushless water pump, whose rotating speed is adjusted by the PWM signal output by the controller. It is worth noting that the core of the method of the application lies in the design and execution process of the software algorithm.

[0027] The control method steps are described below: S1: In response to the water outlet starting instruction, the controller determines whether the water pump PWM value corresponding to the target temperature set by the current user has been stored in the internal non-volatile memory of the controller. The instruction can be derived from the panel button or the wireless communication module.

[0028] S2: If not stored, execute the first control process: the controller starts the water pump and the heater at the same time. During this process, the temperature sensor continuously feeds back the real-time outlet water temperature, the controller calculates the difference between the outlet water temperature and the target temperature, and uses the PID control algorithm to dynamically calculate and adjust the PWM duty cycle output to the water pump, so as to change the water flow rate. This adjustment process continues until the outlet water temperature reaches the target temperature and remains stable for a predetermined period of time (for example, about 5 seconds). At this time, the controller takes the final stable water pump PWM value as the historical PWM value, associates it with the target temperature, and saves it to the memory.

[0029] S3: If it is judged that the corresponding historical PWM value has been stored, execute the fast start process: the controller directly calls the historical PWM value to drive the water pump, and at the same time starts the heater to heat, thereby saving the complex real-time calculation process.

[0030] S4: During the fast start process, the controller will still continuously monitor the outlet water temperature. Once it is monitored that the outlet water temperature deviates from the target temperature, a correction mechanism is started to fine-tune the historical PWM value used this time to maintain the constant outlet water temperature. In this way, both fast start and long-term temperature stability are achieved.

[0031] The specific details of the above steps are described in detail as follows: For the first control process, the specific implementation details are as follows: S21: The controller initializes the parameters of the PID control algorithm, including the proportional coefficient, the integral coefficient and the differential coefficient, which can be pre-set according to experience or obtained through simple experiment calibration. At the same time, a safe initial PWM value is set for the water pump, which can ensure a low basic flow rate.

[0032] S22: The controller starts the water pump and judges whether the internal pipeline of the water dispenser has been filled with water. This judgment can be realized by a special water flow sensor, or indirectly realized by detecting that the water pump has been running for more than a threshold value (for example, about 2 seconds) required to ensure that the water is filled.

[0033] S23: After confirming that the pipeline water has been filled, the controller controls the heater to start working at full rated power to ensure heating efficiency. At the same time, the PID control algorithm is formally put into operation, which calculates and outputs a new and more appropriate water pump PWM value in real time according to the difference between the outlet water temperature and the target temperature fed back by the temperature sensor, so as to dynamically adjust the water flow rate and make the water temperature approach the target value.

[0034] S24: The controller continuously judges whether the outlet water temperature has reached the target temperature, which can be set to an allowable error range (for example, ±1 degree Celsius).

[0035] S25: Once it is determined that the outlet water temperature not only reaches the target temperature but also remains stable within the error range for a predetermined period of time, the controller saves the corresponding water pump PWM value as the final historical PWM value, paired with the current target temperature. This process, including water filling checks, ensures the safety of the initial heating process and the accuracy of data acquisition.

[0036] The PID control algorithm is implemented as follows: S231: The controller calculates the error between the measured water temperature and the target temperature setting in real time.

[0037] S232: Perform PID calculations based on the real-time error value.

[0038] Specifically, the proportional term is directly proportional to the error value; the integral term accumulates the error value over time; and the derivative term calculates the rate of change of the error value. The weighted sum of the results of these three terms generates the adjustment amount for the pump's PWM value. Preferably, the PID calculation period can be set to approximately 100 milliseconds.

[0039] S233: The controller updates the current output PWM duty cycle based on the calculated adjustment amount, and outputs the PWM signal to the water pump drive circuit through its I / O port, thereby completing one adjustment cycle. This algorithm can effectively balance response speed and stability.

[0040] In practical use, various factors can cause the outlet water temperature to deviate from the target temperature even when historical PWM values ​​are used. For example, seasonal changes in ambient temperature can affect the initial inlet water temperature; heaters or pumps may experience performance degradation over time; or internal heat buildup after prolonged continuous operation can affect heating efficiency. Therefore, through periodic monitoring and correction, the system can adapt to these changes and maintain a constant outlet water temperature. Correction of historical PWM values ​​is necessary.

[0041] The specific implementation method for correcting historical PWM values ​​is as follows: The controller is set to a fixed period (e.g., every 10 seconds) to periodically read the current outlet water temperature during the fast start-up process and calculate its deviation from the target temperature. If the outlet water temperature is determined to be lower than the target temperature, it indicates that the current water flow rate may be too fast, resulting in insufficient heating; therefore, the historical PWM value used to control the water pump needs to be reduced. Conversely, if the outlet water temperature is higher than the target temperature, it indicates that the water flow rate may be too slow, resulting in overheating; therefore, the historical PWM value needs to be increased. The correction can be a fixed, small percentage value.

[0042] Based on this, this application preferably provides a preferred, quantified modification scheme. For example: In periodic checks, if the outlet water temperature is detected to be 1 degree Celsius lower than the target temperature, the controller reduces the currently used historical PWM value by 0.5%. Conversely, if the outlet water temperature is 1 degree Celsius higher than the target temperature, the historical PWM value is increased by 0.5%. This method of linkage correction based on a fixed temperature difference and a fixed ratio is simple, reliable, and easy to implement in resource-constrained microcontrollers. Of course, the correction threshold temperature and proportional coefficient are not limited to this set of values ​​and can be adjusted according to the specific product characteristics.

[0043] Furthermore, this method can manage multiple temperature setpoints in practical applications. The controller receives different target temperatures (e.g., 45℃, 75℃, 90℃, etc.) set by the user through the interface, and for each temperature point that is successfully reached and stabilized for the first time, a corresponding historical PWM value is obtained and saved through the aforementioned initial control process, thereby forming a temperature-PWM value lookup table in the memory. Therefore, when responding to the water discharge command in step S1, the judgment process is specified as follows: based on the currently received user-set temperature value, a search is performed in the lookup table to check whether there is a historical PWM value that exactly matches or approximately matches.

[0044] Furthermore, to enhance the system's adaptability, if a user sets a completely new target temperature that does not have an exact corresponding value in the lookup table, the controller will automatically initiate a complete initial control process for that temperature. After the process is complete, the newly acquired water pump PWM value is recorded as a new entry, associated with the new target temperature, and stored in the lookup table. In this way, the system can continuously learn and expand its knowledge base, better adapting to the usage habits of different users.

[0045] Building upon the aforementioned storage of historical PWM values ​​at multiple temperature points, this invention further optimizes system performance and adapts to long-term changes in user habits by providing an optimized dynamic learning and forgetting control method. Specifically, the controller not only stores the correspondence between the target temperature and historical PWM values ​​but also associates each record with a usage frequency statistic and the last call timestamp.

[0046] Specifically, based on the temperature-PWM value lookup table established above, whenever a historical PWM value is successfully invoked and completes a water heating process, the controller increments the corresponding usage frequency statistics by 1 and updates the last invocation time to the current system time. In this way, the system can distinguish between frequently used temperature settings and rarely used temperature settings.

[0047] Based on this, a dynamic PWM value optimization and memory management mechanism is introduced: First, for frequently used temperature points (e.g., where the usage frequency statistics exceed a preset threshold), if the controller detects and corrects a temperature deviation during the fast startup process, it will not only update the PWM value used that time, but also synchronously update the historical PWM value stored in memory with the corrected result using a smaller weight (e.g., employing a first-order low-pass filter algorithm). This means that the PWM value of frequently used setpoints will be slowly and continuously optimized over time, gradually approaching the optimal value under the current environment and device conditions, achieving the effect of "becoming more accurate with use".

[0048] Secondly, to prevent the accumulation of too many infrequently used or expired temperature-PWM value records in memory (e.g., temperature settings that have not been used for a long time due to seasonal changes), the system introduces a time- and frequency-based forgetting mechanism. The controller periodically (e.g., monthly) or when storage space is about to run out, scans the lookup table. For records that meet both of the following conditions: first, the last call time is more than a set validity period (e.g., 6 months); second, the usage frequency statistics are below a minimum threshold, the system will mark them as "low priority" or delete them directly, thereby freeing up storage space. When the user sets the temperature again, the system will re-execute the initial control flow to obtain a new PWM value to adapt to the possibly changed device state and environmental conditions.

[0049] Furthermore, for two temperature points with similar set values ​​(e.g., target temperatures differing by less than 5 degrees Celsius), if the historical PWM value record of one of the temperature points is deleted, and the user sets another temperature point, the system can use an interpolation algorithm (such as linear interpolation) to calculate an initial PWM value based on the historical PWM values ​​of neighboring temperature points for fast startup. This provides a better startup speed even when data is insufficient, and the system can be improved through a learning mechanism during use.

[0050] By introducing a management mechanism that combines usage frequency statistics, progressive optimization, and intelligent forgetting, the control system of this invention is not merely a passive data recording and retrieval system, but has evolved into an intelligent system capable of proactively adapting to user habits, optimizing its own parameters, and managing storage resources. This significantly improves the long-term user experience and adaptability of the product.

[0051] This application also provides a computer-readable storage medium, a common embodiment of which is a Flash memory chip in an embedded device. The computer program stored thereon contains all the machine instructions of the method described in any one of claims 1 to 7. When this storage medium is placed in the reading environment of a water dispenser controller and executed by its processor, the corresponding control method can be implemented. This medium allows the algorithm to be solidified, facilitating mass production and functional standardization.

[0052] This application also provides a final, specifically referring to, core control board for an instant hot water dispenser. This device includes a memory (such as SRAM and Flash), a processor (such as an ARM Cortex-M series MCU), and a computer program stored in the memory. The memory and processor are connected via a system bus. When the device is powered on, the processor reads and executes the computer program from the memory, thereby coordinating the operation of components such as the heater, water pump, and temperature sensor to fully implement any of the aforementioned control methods, ultimately outputting stable and rapidly heated hot water.

[0053] It should be understood that the specific embodiments described above are merely illustrative or explanatory of the principles of the invention and do not constitute a limitation thereof. Therefore, any modifications, equivalent substitutions, improvements, etc., made without departing from the spirit and scope of the invention should be included within the protection scope of the invention. Furthermore, the appended claims are intended to cover all variations and modifications falling within the scope and boundaries of the appended claims, or equivalent forms of such scope and boundaries.

Claims

1. A PWM software control method for a water pump in an instant hot water dispenser, wherein the instant hot water dispenser includes a heater, a water pump, a temperature sensor, and a controller, characterized in that, The method includes the following steps: S1: In response to the water outlet start command, determine whether the controller has stored the water pump PWM value corresponding to the current target temperature; S2: If not stored, execute the first control process: start the water pump and heater, and dynamically calculate and adjust the PWM value of the water pump based on the difference between the outlet water temperature fed back by the temperature sensor and the target temperature, until the outlet water temperature reaches and stabilizes at the target temperature, and save the water pump PWM value at this time as a historical PWM value associated with the target temperature. S3: If it has been stored, execute the fast start process: directly call the historical PWM value to control the water pump and start the heater for heating; S4: During the rapid start-up process, the outlet water temperature is continuously monitored. If the outlet water temperature deviates from the target temperature, the historical PWM value is corrected to maintain a constant outlet water temperature.

2. The method according to claim 1, characterized in that, The initial control process includes: S21: Initialize the parameters of the PID control algorithm and set an initial PWM value for the water pump; S22: Start the water pump and determine whether the internal pipes of the water dispenser are full of water; S23: After confirming that the pipeline is full of water, control the heater to work at full power and run the PID control algorithm. Based on the difference between the outlet water temperature fed back by the temperature sensor and the target temperature, calculate and output a new water pump PWM value in real time to adjust the water flow rate. S24: Continuously determine whether the outlet water temperature has reached the target temperature; S25: When the outlet water temperature reaches the target temperature and remains stable, the corresponding water pump PWM value at this time is saved as the historical PWM value and associated with the current target temperature.

3. The method according to claim 2, characterized in that, Running the PID control algorithm in step S23 includes: S231: Calculate the real-time error value between the outlet water temperature and the target temperature; S232: Based on the real-time error value, the adjustment amount of the PWM value of the water pump is generated by calculating the proportional, integral and derivative terms of the PID control algorithm; S233: Update and output the PWM value for controlling the water pump based on the adjustment amount.

4. The method according to claim 1, characterized in that, The correction of historical PWM values ​​includes: The deviation between the outlet water temperature and the target temperature is periodically determined; If the outlet water temperature is lower than the target temperature, then the historical PWM value is reduced; If the outlet water temperature is higher than the target temperature, then the historical PWM value is increased.

5. The method according to claim 4, characterized in that, If the outlet water temperature is lower than the target temperature, reducing the historical PWM value includes: If the outlet water temperature is 1 degree Celsius lower than the target temperature, the historical PWM value will be reduced by 0.5%. If the outlet water temperature is higher than the target temperature, increasing the historical PWM value includes: If the outlet water temperature is 1 degree Celsius higher than the target temperature, the historical PWM value will be increased by 0.5%.

6. The method according to claim 1 or 2, characterized in that, The method further includes: Receive and store multiple different user-set temperatures and historical PWM values ​​corresponding to each temperature obtained through the initial control process; In step S1, when responding to a water outlet command, the determination step includes: querying whether there is a corresponding historical PWM value based on the currently received user-set temperature.

7. The method according to claim 6, characterized in that, If there is no saved, precisely corresponding historical PWM value for the target temperature set by the current user, then the first control process is executed for the target temperature, and the obtained water pump PWM value is saved as a new historical PWM value.

8. The method according to claim 6, characterized in that, The method further includes: Associate each stored historical PWM value corresponding to the user-defined temperature with a frequency statistic and a last call timestamp; After each historical PWM value is called to complete the water heating process, the corresponding usage frequency statistics and the last call timestamp are updated. For historical PWM values ​​whose usage frequency exceeds a preset threshold, if the outlet water temperature is detected to deviate from the target temperature during the fast start-up process and the historical PWM value is corrected, the correction result will be used to update the historical PWM value stored in the memory with a preset weight. The stored historical PWM values ​​are periodically scanned, and historical PWM value records that were last called before the preset expiration date and used at a frequency lower than the preset frequency threshold are deleted.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 7.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 7.