Intelligent plant maintenance method and system based on near field communication interaction
Through near-field communication and lightweight machine learning, precise watering decisions for home plant care are achieved, solving the problems of overwatering, water shortage, and high cost in existing technologies. It is adaptable to different varieties and substrates, reducing power consumption and maintenance difficulty.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU LIFANG GARDENING VIRESCENCE MANAGEMENT CO LTD
- Filing Date
- 2026-02-10
- Publication Date
- 2026-05-12
AI Technical Summary
Current home plant care relies on experience or Wi-Fi/BLE gateways, which can easily lead to overwatering or underwatering. BLE gateways are costly and difficult to maintain, and the traditional threshold method has poor transferability and high calibration costs due to different varieties/substrates/pot geometries.
A plant intelligent maintenance method based on near-field communication interaction is adopted. The intelligent terminal establishes a connection with the microcontroller unit of the plant maintenance device to perform parameter configuration, environmental data collection, machine learning decision-making, and user intervention. Combined with a lightweight machine learning model and security strategy, it can achieve precise watering decisions.
It achieves precision and low power consumption in plant maintenance, reduces maintenance costs, adapts to different varieties and substrates, improves equipment adaptability and safety, and forms a closed-loop maintenance system.
Smart Images

Figure CN122018402A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of smart horticulture technology, specifically to a method and system for intelligent plant care based on near-field communication interaction. Background Technology
[0002] Currently, most home plant care relies on experience or continuously connected devices (Wi-Fi / BLE gateways). Wi-Fi solutions are prone to overwatering or underwatering, while BLE gateway solutions are relatively difficult to maintain (network configuration, battery replacement, privacy protection). Furthermore, different plant varieties, substrates, and pot geometries lead to poor adaptability and high calibration costs for traditional threshold methods. Therefore, designing an intelligent plant care solution has become a pressing technical problem for those skilled in the art. Summary of the Invention
[0003] To address the aforementioned shortcomings, this invention discloses a plant intelligent maintenance method based on near-field communication interaction, which can achieve precise plant maintenance with low power consumption and reduce maintenance costs.
[0004] The first aspect of this invention discloses a plant intelligent maintenance method based on near-field communication interaction, comprising: In response to establishing a near-field communication connection with a near-field communication tag embedded in the plant care device, the smart terminal writes a set of initial configuration parameters to the microcontroller unit of the plant care device. The plant care device is set in a pot, and the initial configuration parameters include plant variety identifier, pot volume, substrate type identifier, and security strategy parameters. The microcontroller unit of the plant care device periodically collects environmental data of the corresponding plants from environmental sensors; wherein, the collection of the environmental data is performed within the wake-up cycle of the microcontroller unit; The microcontroller unit generates corresponding plant maintenance decisions based on the collected environmental data and the stored initial configuration parameters. The generation of these plant maintenance decisions includes: Construct a maintenance feature vector based on the environmental data; The maintenance feature vector is input into a pre-trained machine learning model stored in the microcontroller unit to obtain the initial suggested watering amount and initial urgency level; Based on the safety strategy parameters, the initial suggested watering amount and initial urgency are constrained and optimized to determine the final watering amount and final urgency. In response to the near-field communication connection established with the near-field communication tag, the smart terminal reads maintenance status information from the microcontroller unit and displays it on the user's smart terminal; The smart terminal responds to user input and sends an execution command to the microcontroller unit to control the corresponding actuator to perform watering operations based on the maintenance status information and user input.
[0005] As an optional implementation, in a first aspect of the present invention, the step of establishing a near-field communication connection between the smart terminal and the near-field communication tag embedded in the plant care device includes: The microcontroller unit of the plant care device is triggered to enter the communication mode by a near-field communication tag to wake up the microcontroller unit; Establishing a corresponding temporary communication session, which includes: The smart terminal sends a session request frame to the microcontroller unit. The session request frame includes a terminal random number, a timestamp, and smart terminal identification information. In response to the session request frame, the microcontroller unit generates a device random number and an incrementing session counter, and sends the device random number, the session counter, and the device status summary to the smart terminal. A unique session identifier for identifying a temporary communication session is jointly constructed by at least one of the smart terminal and the microcontroller unit based on the terminal random number, the device random number, and the session counter. The unique session identifier is carried in all communication frames during the temporary communication session to prevent cross-session replay attacks.
[0006] As an optional implementation, in a first aspect of the present invention, the environmental sensor includes a moisture content sensor, a temperature sensor, a conductivity sensor, and a light sensor; the periodic acquisition of environmental data of the corresponding plant from the environmental sensor includes: The microcontroller unit is woken up periodically according to a preset sampling cycle; during the wake-up period, raw data is collected from the moisture content sensor, temperature sensor, conductivity sensor and light sensor; The raw readings of the moisture content sensor are compensated for by multiple factors. The compensation amount is calculated based on synchronously acquired temperature data, conductivity data, and a compensation calculation formula, which is as follows:
[0007] in, This is the corrected volumetric moisture content. This represents the original volumetric moisture content. This is the temperature compensation coefficient. EC is the salinity compensation coefficient, and EC is the electrical conductivity. T represents the reference temperature; T represents the detection temperature. When using multi-frequency measurements, a dual-frequency differential estimation algorithm is used to process the data from the moisture content sensor in order to suppress the coupling interference of soil salinity on moisture content measurements. Based on the compensated and / or processed sensor data, and combined with the stored effective volume of the pot, the time and amount of water used for the last watering, and the type identifier of the substrate, a multi-dimensional feature vector for intelligent irrigation decision-making is constructed. The multi-dimensional feature vector is used to characterize the current water requirement environment and historical state of the plant. The multidimensional feature vector is: ; Where f is a multidimensional feature vector. This is the corrected volumetric moisture content. Let T be the rate of change of moisture content, T be the temperature parameter, EC be the electrical conductivity parameter, and L be the light intensity. The effective volume of the basin This is the timestamp of the last watering. This is the amount of water used last time. It is a matrix type.
[0008] As an optional implementation, in the first aspect of the present invention, the pre-trained machine learning model is a lightweight multilayer perceptron neural network with quantized weights, and the model weight data size does not exceed 4 kilobytes. The multilayer perceptron neural network includes: The input layer is used to receive the multidimensional feature vector; At least one hidden layer, the hidden layer being used to extract nonlinear representations and configured with a nonlinear activation function; The output layer produces intermediate outputs, which are then converted into the original watering urgency score and the original recommended water volume by passing through Sigmoid and Softplus respectively. The step of constraining and optimizing the initial suggested watering amount and initial urgency based on the safety policy parameters to determine the final watering amount and final urgency includes: The corresponding predicted watering amount is determined based on the initial suggested watering amount and the watering prediction formula; the watering prediction formula is: , among which, among which, To predict moisture content, This represents the current volumetric moisture content. This is the initial recommended watering amount; For the effective volume of the basin, The water absorption conversion coefficient; Based on the initial urgency, safety strategy parameters, and target mapping formula, a dynamic target moisture content within a preset safe moisture content range is determined; the target mapping formula is:
[0009] ;
[0010]
[0011] in, For the target moisture content, For permanent wilting points, As a lower limit safety margin, Field holding capacity U represents the upper limit of safety margin; U represents the initial urgency level. As the lower limit of the target, The upper limit of the target; Using the initial suggested watering amount as the starting point for optimization, the optimal watering amount is determined by minimizing the objective function; wherein, the objective function is: And Q≥0; where, The penalty intensity for moisture content deviation, The severity of the penalty for over-pouring risk; The watering volume obtained from the optimization solution is constrained to the feasible region defined by the preset safety policy in order to determine the final watering volume.
[0012] As an optional implementation, in the first aspect of the present invention, the over-pouring penalty function is configured as a piecewise quadratic function: the over-pouring penalty function is:
[0013] in, The penalty coefficient is... For a safe watering threshold, and , This is the initial recommended watering amount; The method of determining the optimal watering amount by minimizing the objective function also includes: Calculate the theoretically optimal watering amount without penalty terms; The optimal watering amount is determined based on the theoretical optimal watering amount, the dynamic safe watering amount threshold, and the objective function. The optimized watering amount is subject to the dynamic safe watering amount threshold as a hard upper limit constraint, and its non-negativity is ensured by a pruning function, which is: The clipping function restricts the input values to a lower limit of 0 and an upper limit of 0. between.
[0014] As an optional implementation, in a first aspect of the present invention, reading maintenance status information from the microcontroller unit includes: The system reads the current maintenance status data calculated and stored locally by the microcontroller unit. The current maintenance status data includes the current soil volumetric moisture content and its rate of change, watering urgency, final watering amount, device status summary, and maintenance history summary. The final watering amount is obtained by the microcontroller unit after safety constraint optimization. The device status summary includes power information, sensor anomaly flags, and alarm levels. The maintenance history summary includes the timestamp of the most recent watering, the watering amount, and a log summary of a specified entry.
[0015] A second aspect of this invention discloses a plant intelligent maintenance system based on near-field communication interaction, comprising: Writing module: Used by the smart terminal to write a set of initial configuration parameters to the microcontroller unit of the plant care device in response to establishing a near-field communication connection with the near-field communication tag embedded in the plant care device. The plant care device is set in a pot, and the initial configuration parameters include plant variety identifier, pot volume, substrate type identifier and security policy parameters. Acquisition module: used to periodically acquire environmental data of the corresponding plant from the environmental sensor by the microcontroller unit of the plant care device; wherein, the acquisition of the environmental data is performed within the wake-up cycle of the microcontroller unit; The generation module is used by the microcontroller unit to generate corresponding plant maintenance decisions based on the collected environmental data and the stored initial configuration parameters. Generating the corresponding plant maintenance decisions includes: constructing a maintenance feature vector based on the environmental data; inputting the maintenance feature vector into a pre-trained machine learning model stored in the microcontroller unit to obtain an initial suggested watering amount and an initial urgency level; and performing constraint optimization on the initial suggested watering amount and initial urgency level based on the safety policy parameters to determine the final watering amount and final urgency level. Communication module: used by the smart terminal in response to the near-field communication connection established with the near-field communication tag to read maintenance status information from the microcontroller unit and display it on the user's smart terminal; Operation module: Used by the smart terminal in response to user input to send execution instructions to the microcontroller unit, so as to control the corresponding actuator to perform watering operation according to the maintenance status information and user input.
[0016] A third aspect of the present invention discloses an electronic device, comprising: a memory storing executable program code; a processor coupled to the memory; the processor calling the executable program code stored in the memory to execute the intelligent plant care method based on near-field communication interaction disclosed in the first aspect of the present invention.
[0017] The fourth aspect of this invention discloses a computer-readable storage medium storing a computer program, wherein the computer program causes a computer to execute the intelligent plant care method based on near-field communication interaction disclosed in the first aspect of this invention.
[0018] Compared with the prior art, the embodiments of the present invention have the following beneficial effects: The solution in this invention combines parameter pre-configuration, periodic environmental data acquisition, edge machine learning decision-making, NFC status interaction, and manual intervention into an integrated design. This achieves multiple technical effects in terms of intelligence, precision, portability, safety, and equipment adaptability in plant maintenance. Furthermore, the modules work together to form a closed-loop maintenance system, solving the technical problems of traditional plant maintenance devices, such as cumbersome configuration, crude maintenance decision-making, inconvenient data interaction, high execution risk, and poor human-machine collaboration. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a flowchart illustrating the intelligent plant care method based on near-field communication interaction disclosed in an embodiment of the present invention. Figure 2 This is a schematic diagram of the process for establishing a communication connection disclosed in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of a plant intelligent maintenance system based on near-field communication interaction provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] It should be noted that the terms "first," "second," "third," "fourth," etc., in the specification and claims of this invention are used to distinguish different objects, not to describe a specific order. The terms "comprising" and "having," and any variations thereof, in the embodiments of this invention are intended to cover non-exclusive inclusion. Exemplarily, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or devices.
[0023] Current home plant care largely relies on experience or continuously connected devices (Wi-Fi / BLE gateways). Wi-Fi solutions are prone to overwatering / underwatering, while BLE gateway solutions are costly and difficult to maintain (network configuration, battery replacement, privacy protection). Furthermore, different plant varieties, substrates, and pot geometries result in poor transferability and high calibration costs for traditional threshold methods. Therefore, this invention proposes the following solution, which can: It is based on a low-power MCU and battery, and does not require constant online connectivity; Parameter transmission, data reading, firmware / model update, and secure write-back are accomplished via NFC near-field communication. It enables intelligent water quantity / timing decisions using lightweight models and physical constraints, and can adapt to individuals under sparse interactions.
[0024] Furthermore, it can achieve key sensing (moisture content / temperature / optional EC, light) and reliable water volume decisions with extremely low power consumption budget; enable on-demand data interaction and parameter solidification via NFC proximity without continuous network connection; achieve individual self-calibration and cross-pot migration under sparse interaction conditions of occasional user inspections; and form traceable localized maintenance records to ensure security and privacy.
[0025] Example 1 Please see Figure 1 , Figure 1 This is a flowchart illustrating the intelligent plant care method based on near-field communication interaction disclosed in this invention. The execution entity of the method described in this embodiment is an execution entity composed of software and / or hardware. This execution entity can receive relevant information via wired and / or wireless means and can send certain instructions. It may also have certain processing and storage functions. This execution entity can control multiple devices, such as remote physical servers or cloud servers and related software, or local hosts or servers and related software that perform related operations on devices located in a certain location. In some scenarios, it can also control multiple storage devices, which may be placed in the same location as the devices or in different locations. Figure 1 As shown, this intelligent plant care method based on near-field communication interaction includes the following steps: S101: In response to establishing a near-field communication connection with the near-field communication tag embedded in the plant care device, the smart terminal writes a set of initial configuration parameters to the microcontroller unit of the plant care device, wherein the plant care device is set in a pot, and the initial configuration parameters include plant variety identifier, pot volume, substrate type identifier and security strategy parameters. S102: The microcontroller unit of the plant care device periodically collects environmental data of the corresponding plant from the environmental sensor; wherein, the collection of the environmental data is performed within the wake-up cycle of the microcontroller unit; S103: The microcontroller unit generates corresponding plant maintenance decisions based on the collected environmental data and the stored initial configuration parameters, wherein generating the corresponding plant maintenance decisions includes: Construct a maintenance feature vector based on the environmental data; The maintenance feature vector is input into a pre-trained machine learning model stored in the microcontroller unit to obtain the initial suggested watering amount and initial urgency level; Based on the safety strategy parameters, the initial suggested watering amount and initial urgency are constrained and optimized to determine the final watering amount and final urgency. S104: In response to the near-field communication connection established with the near-field communication tag, the smart terminal reads maintenance status information from the microcontroller unit and displays it on the user's smart terminal; S105: The smart terminal responds to the user input and sends an execution instruction to the microcontroller unit to control the corresponding actuator to perform watering operation according to the maintenance status information and the user input.
[0026] The intelligent plant maintenance system of this invention uses near-field communication (NFC) interaction as the core link, and integrates parameter pre-configuration, periodic environmental data collection, edge machine learning decision-making, NFC status interaction and manual intervention execution into an integrated design. It achieves multiple technical effects in terms of intelligence, precision, portability, safety and equipment adaptability in plant maintenance. Moreover, the modules work together to form a closed-loop maintenance system, which solves the technical problems of traditional plant maintenance devices such as cumbersome configuration, crude maintenance decision-making, inconvenient data interaction, high execution risk and poor human-machine collaboration.
[0027] Specifically, based on the short-range interaction characteristics of near-field communication, it enables contactless and rapid parameter writing between smart terminals and plant maintenance devices, eliminating the need for complex Bluetooth / WiFi pairing or wired connections. This reduces the operational threshold for initial device configuration and improves the convenience and efficiency of user configuration. By writing personalized initial configuration parameters such as plant variety, pot volume, and substrate type, the maintenance system can be adapted to different types of plants, different sizes of pots, and different cultivation substrates, breaking through the limitations of single parameter adaptation in traditional maintenance devices and realizing personalized and scenario-based adaptation of the maintenance system. The security policy parameters are written synchronously to set up pre-emptive security constraints for the generation of subsequent maintenance decisions. This avoids risks such as over-irrigation and ineffective irrigation in subsequent watering operations from the configuration source, laying the foundation for the security of maintenance decisions. The near-field communication tag is embedded in the plant maintenance device and the device is integrated into the pot, realizing hardware miniaturization and integration. No additional external communication equipment is required, which is suitable for the use scenario of potted plants and does not occupy extra space.
[0028] The plant care device's local microcontroller unit (MCU) directly controls environmental sensors to periodically collect data, achieving localized environmental data acquisition on the device side. This eliminates reliance on the cloud or external devices, reducing data transmission latency and communication costs. Data collection operations are confined to the MCU's wake-up cycle, allowing the MCU to enter a low-power mode during non-collection phases. This significantly reduces the overall power consumption of the plant care device, improving its battery life and making it suitable for portable use scenarios where potted plants require no external power supply. It supports a combination of user intervention and intelligent system decision-making. Users can input operation commands based on the maintenance status information displayed on the smart terminal and their own maintenance experience, avoiding the mechanical problems of purely automatic maintenance systems and adapting to different users' maintenance habits and special scenario needs (such as watering in advance when users plan to leave). The system sends execution commands from the smart terminal to the MCU, directly controlling the actuator to complete the watering operation. This ensures precise transmission and execution of commands, which are generated based on maintenance status information and user input, guaranteeing the targeted nature of the watering operation. The actuator is locally controlled by the MCU, enabling end-side execution of the watering operation with fast response speed, promptly meeting the plant's emergency watering needs while avoiding interference from external devices. The core computation, data acquisition, and command execution of the entire system are all completed on the MCU side of the plant maintenance device. Near-field communication serves only as an interaction link between the smart terminal and the device, enabling the system to operate independently offline. This makes it suitable for potted plant maintenance scenarios with no or weak network access, such as homes, offices, and balconies, improving the system's environmental adaptability. The lightweight application of near-field communication technology, combined with the low-power design (wake-up cycle acquisition) of the MCU end, makes the entire plant care system low in hardware cost, low in power consumption, and small in size, making it easy to integrate into various potted plants and possessing good prospects for industrialization and popularization.
[0029] Specifically, during implementation, the MCU makes suggestions, not commands. For example, the MCU might suggest watering with 200ml, but after observing the plant's condition, the user can decide not to water, water 100ml less, or wait until tomorrow. This configuration enhances user engagement on-site.
[0030] If the system is set to fully automatic, the watering action becomes a silent event. The system only knows that I watered, but lacks direct user confirmation and potential status observation feedback, making efficient interaction impossible. Performing watering through the app is equivalent to the user annotating or voting on the MCU's decision.
[0031] A user clicking "water as suggested" provides strong positive feedback, indicating that the MCU's decision aligns with the user's judgment, and the model parameters are reliable. The user manually adjusting the water level before watering provides extremely valuable feedback. The difference directly quantifies the deviation between the model and user experience, making it invaluable data for adaptive learning algorithms. A user choosing to only record and not water provides negative feedback, suggesting the model may be overly sensitive, or the user may have rejected the suggestion based on other factors (such as impending rain).
[0032] More preferably, such as Figure 2 As shown, the step of establishing a near-field communication connection between the smart terminal and the near-field communication tag embedded in the plant care device includes: S1011: The microcontroller unit of the plant care device is triggered to enter the communication mode by the near-field communication tag to wake up the microcontroller unit; Establishing a corresponding temporary communication session, which includes: S1012: The smart terminal sends a session request frame to the microcontroller unit. The session request frame includes a terminal random number, a timestamp, and smart terminal identification information. S1013: In response to the session request frame, the microcontroller unit generates a device random number and an incrementing session counter, and sends the device random number, the session counter, and the device status summary to the smart terminal. S1014: At least one of the smart terminal and the microcontroller unit jointly constructs a unique session identifier for identifying a temporary communication session based on the terminal random number, the device random number, and the session counter, wherein all communication frames during the temporary communication session carry the unique session identifier to prevent cross-session replay attacks.
[0033] The near-field communication tag-triggered wake-up mechanism enables the MCU to remain in a low-power sleep state when there is no NFC interaction, and only enters the communication mode when the smart terminal is close to the tag to complete the trigger. This completely avoids the power waste caused by the MCU continuously waking up to maintain the communication link, further reducing the overall power consumption of the plant care device and extending the device's battery life.
[0034] The session request frame carries a terminal random number and a timestamp, providing randomized and time-sensitive basic data for subsequent session identifier construction and attack prevention. This avoids the problem of predictable communication data caused by fixed request information, thus improving security in the initial stage of communication. Specifically, to adapt to NFC small packet transmission and device-side parsing, the embodiment of this invention uses TLV (Type-Length-Value) format to encapsulate the communication frame. An example of the communication frame fields is as follows: Header: Frame type (Type), Version (Version), Length Session: SessionID, CTR Payload: Request / response data content. Integrity: CRC32 Carrying intelligent terminal identification information enables the MCU to perform preliminary identification of the interacting intelligent terminal, avoiding invalid session requests from unauthorized terminals, reducing the power consumption and computing resource consumption of the MCU due to processing invalid requests, and providing an identity foundation for subsequent personalized interactions (such as remembering configuration parameters bound to the terminal). The standardized session request frame format provides a unified starting standard for communication between the intelligent terminal and the MCU, reducing the difficulty of communication parsing for both parties and improving the efficiency of session establishment. The generation of device random numbers, in conjunction with terminal random numbers, provides a dual-end random source for the construction of a unique session identifier, making the session identifier more random and unpredictable by external malicious devices, thus improving the uniqueness and security of the session identifier.
[0035] An incrementing session counter is set up to generate a unique count identifier for each NFC interaction. This avoids repeated establishment of the same session and provides a timing verification basis for preventing replay attacks. At the same time, the incrementing counter can effectively identify abnormal repeated session requests. Feedback on device status summary allows the smart terminal to quickly obtain the current operating status of the MCU (such as low battery, sensor failure, actuator pending execution, etc.) at the beginning of session establishment. If the device is in an abnormal state, the smart terminal can notify the user in advance instead of continuing to perform parameter writing / status reading, avoiding invalid communication interactions and improving the effectiveness of NFC interactions and user experience. The MCU only dynamically generates random numbers and counters when responding to session requests. It does not perform related calculations when there is no interaction, which is in line with the lightweight computing characteristics of the MCU and avoids consuming too many hardware resources.
[0036] Specifically, a unique session identifier is constructed based on multi-dimensional data from terminal random numbers, device random numbers, and session counters. This combines random information from both ends with timing counting information, ensuring that the identifier for each temporary communication session is non-copyable and non-repeatable. This achieves unique identification of temporary communication sessions from the source, avoids confusion of communication data between different NFC interaction sessions, and ensures the independence and accuracy of data transmission within a session.
[0037] All communication frames during a temporary communication session carry this identifier, enabling the MCU and smart terminal to verify the session affiliation of each communication frame and only receive communication frames belonging to the current session. This directly avoids cross-session replay attacks (where malicious devices copy communication frames from other sessions for forged transmissions), solving the replay attack problem that is vulnerable to in short-range near-field communication interactions due to open communication links. It ensures the security of core data such as parameter writing, status reading, and command sending during transmission and prevents maliciously tampered or forged communication data from being executed by the device. The session identifier is only valid during the temporary communication session and automatically expires after the session ends, eliminating the need for additional identifier cancellation operations. This aligns with the short-term interaction characteristics of NFC, where interaction occurs when the device is near and disconnection occurs when the device is away, reducing the storage and computational burden on the device.
[0038] By deeply integrating the low-power wake-up mechanism with the secure session establishment process, the device power consumption is further reduced while making up for the technical defects of traditional NFC near-field interaction that prioritizes convenience over security. This resolves the technical contradiction between low-power operation and high-security communication, ensuring the secure transmission of core data such as configuration parameters, maintenance status, and execution commands while maintaining long-term low-power operation of the plant maintenance device.
[0039] More preferably, the environmental sensor includes a moisture content sensor, a temperature sensor, a conductivity sensor, and a light sensor; the periodic acquisition of environmental data of the corresponding plant from the environmental sensor includes: The microcontroller unit is woken up periodically according to a preset sampling cycle; during the wake-up period, raw data is collected from the moisture content sensor, temperature sensor, conductivity sensor and light sensor; The raw readings of the moisture content sensor are compensated for by multiple factors. The compensation amount is calculated based on synchronously acquired temperature data, conductivity data, and a compensation calculation formula, which is as follows:
[0040] in, This is the corrected volumetric moisture content. This represents the original volumetric moisture content. This is the temperature compensation coefficient. EC is the salinity compensation coefficient, and EC is the electrical conductivity. T represents the reference temperature; T represents the detection temperature. When using multi-frequency measurements, a dual-frequency differential estimation algorithm is used to process the data from the moisture content sensor in order to suppress the coupling interference of soil salinity on moisture content measurements. Based on the compensated and / or processed sensor data, and combined with the stored effective volume of the pot, the time and amount of water used for the last watering, and the type identifier of the substrate, a multi-dimensional feature vector for intelligent irrigation decision-making is constructed. The multi-dimensional feature vector is used to characterize the current water requirement environment and historical state of the plant. The multidimensional feature vector is: ; Where f is a multidimensional feature vector. This is the corrected volumetric moisture content. Let T be the rate of change of moisture content, T be the temperature parameter, EC be the electrical conductivity parameter, and L be the light intensity. The effective volume of the basin This is the timestamp of the last watering. This is the amount of water used last time. It is a matrix type.
[0041] Among them, the rate of change in water content is used to reflect the rate of water loss and help the model predict the evaporation trend; EC reflects the interference of salt on water content. The solution of this embodiment of the invention has deeply optimized the accuracy of environmental data acquisition, sensor data correction, and comprehensiveness of feature vector construction for plant maintenance. It designs a multi-dimensional compensation / anti-interference algorithm around the core pain point of water content detection, and constructs a standardized multi-dimensional feature vector by combining the historical state of plant maintenance and basic cultivation parameters. This not only solves the measurement error problem caused by the coupling interference of temperature and salinity in traditional soil water content detection, but also provides high-precision, high-dimensional, and strongly correlated input data for the maintenance decision of the subsequent edge machine learning model. It improves the scientificity and accuracy of intelligent irrigation decision from the data source, and adapts to the dynamic water demand pattern of plant growth. It breaks through the maintenance decision bias problem caused by traditional single environmental data acquisition, no correction processing, and missing feature dimensions.
[0042] A dual-factor compensation formula based on temperature and conductivity is designed for the original readings of moisture content sensors. By quantitatively calculating the compensation amount, the original volumetric moisture content is corrected, directly eliminating the systematic errors of temperature deviation and soil salinity in moisture content measurement. This makes the measured moisture content highly consistent with the actual soil moisture content, solving the core problem of large reading deviations of traditional sensors at different temperatures / salinities with the same moisture content. This improves the accuracy of soil moisture content measurement to the level required for practical applications.
[0043] During multi-frequency measurement, a dual-frequency differential estimation algorithm is employed to suppress the coupling interference of soil salinity on moisture content detection from the perspective of measurement principle. This, together with formulaic compensation, forms a dual correction system that combines principle-based anti-interference and post-data compensation. Even in scenarios with large fluctuations in soil salinity (such as after fertilization or in saline-alkali substrates), the stability and accuracy of moisture content detection can be guaranteed, adapting to soil environments of different substrate types and different cultivation stages. The compensation formula is a standardized quantitative calculation, and the dual-frequency differential algorithm is a lightweight data processing method. Neither requires complex cloud computing and can be completed directly on the MCU side, adapting to the end-side computing characteristics of the device without adding additional communication and computing burdens, ensuring the real-time performance of data processing.
[0044] The feature vector construction integrates three core types of information: corrected sensor data, basic cultivation parameters, and historical maintenance status. This breaks through the limitations of traditional features that only use real-time environmental data. The feature vector can comprehensively represent the plant's current water requirement environment, growth environment, and historical maintenance trajectory. It conforms to the objective law that plant water requirement is the result of the combined effects of real-time environment, historical watering behavior, and basic cultivation conditions, providing a more realistic decision-making basis for machine learning models.
[0045] The design incorporates two feature parameters for moisture content: the corrected value and the rate of change. This reflects both the current actual soil moisture content and the dynamic trend of moisture content changes (e.g., a rapid decrease indicates rapid water consumption by plants, while a slow decrease indicates stable water consumption). This allows the model to accurately distinguish between the current water requirement of plants and the trend of water requirement changes, avoiding misjudgments of watering timing caused by static judgments based solely on real-time moisture content. Basic cultivation parameters such as effective pot volume and substrate type identifiers are included, giving the feature vector personalized adaptability. The model can differentiate water requirements based on different pot volumes and different substrate water retention / permeability characteristics (e.g., peat moss has strong water retention, perlite has strong permeability), solving the problem that traditional models with uniform threshold decisions cannot adapt to different cultivation conditions. Historical maintenance data, including the last watering timestamp and watering amount, are incorporated, enabling the model to analyze the rate of soil moisture consumption by combining watering intervals and single watering amounts. This accurately determines the comprehensive water consumption pattern of natural evaporation and plant absorption after watering, avoiding over-irrigation caused by repeated watering in a short period or water shortage caused by excessively long watering intervals.
[0046] More preferably, the pre-trained machine learning model is a lightweight multilayer perceptron neural network with quantized weights, and the model weight data size does not exceed 4 kilobytes. The multilayer perceptron neural network includes: The input layer is used to receive the multidimensional feature vector; At least one hidden layer, the hidden layer being used to extract nonlinear representations and configured with a nonlinear activation function; The output layer produces intermediate outputs, which are then converted into the original watering urgency score and the original recommended water volume by passing through Sigmoid and Softplus respectively. The step of constraining and optimizing the initial suggested watering amount and initial urgency based on the safety policy parameters to determine the final watering amount and final urgency includes: The corresponding predicted watering amount is determined based on the initial suggested watering amount and the watering prediction formula; the watering prediction formula is: , among which, among which, To predict moisture content, This represents the current volumetric moisture content. This is the initial recommended watering amount; For the effective volume of the basin, The water absorption conversion coefficient; Based on the initial urgency, safety strategy parameters, and target mapping formula, a dynamic target moisture content within a preset safe moisture content range is determined; the target mapping formula is:
[0047] ;
[0048]
[0049] in, For the target moisture content, For permanent wilting points, As a lower limit safety margin, Field holding capacity U represents the upper limit of safety margin; U represents the initial urgency level. As the lower limit of the target, The upper limit of the target; Using the initial suggested watering amount as the starting point for optimization, the optimal watering amount is determined by minimizing the objective function; wherein, the objective function is: And Q≥0; where, The penalty intensity for moisture content deviation, The severity of the penalty for over-pouring risk; The watering volume obtained from the optimization solution is constrained to the feasible region defined by the preset safety policy in order to determine the final watering volume.
[0050] Load the individualized quantized lightweight model (MLP model, ≤1–4KB weight) into the MCU, with input vector f, and output watering urgency U ranging from 0 to 1 and suggested water volume Q.
[0051] The solution of this invention has made a deep customized design for the hardware adaptability of the edge machine learning model, the accuracy of the decision output, and the optimization of the safety constraints of maintenance decisions. By adapting the lightweight quantized perceptron model to the characteristics of MCU hardware, differentiating the output decision parameters with multiple activation functions, and optimizing the fine constraints of multiple formulas and objective functions, it solves the core problems of traditional edge intelligent decision-making, such as large model size that cannot be deployed, lack of actual cultivation logic support for decision output, easy violation of soil moisture safety threshold in watering decisions, and high risk of over-watering / under-watering. It achieves the technical effects of efficient edge deployment of the model, decision output that fits the physiological characteristics of plants, and dual protection of safety and accuracy in watering decisions. At the same time, all calculations are adapted to the lightweight computing power of MCU, taking into account both the intelligence of intelligent decision-making and the practicality of the device.
[0052] It adopts a lightweight MLP model with quantized weights, and the model weight data size does not exceed 4 kilobytes, which compresses the model size to the extreme. It is fully adapted to the hardware characteristics of plant maintenance device MCU with limited storage resources and weak computing power. It solves the technical problem that traditional deep learning models are large in size and have many weight parameters, making them impossible to deploy on low-performance MCU edge devices, and realizes the lightweight implementation of complex nonlinear decision models on the edge.
[0053] The solution of this invention retains the nonlinear representation extraction capability of the MLP neural network. By performing deep feature mining on multidimensional feature vectors through the nonlinear activation function of the hidden layer, it can capture the complex nonlinear relationship between plant water requirement status and multidimensional environmental, cultivation, and historical parameters. This breaks through the limitations of traditional linear fitting and threshold judgment in coarse decision-making and improves the accuracy of initial watering amount and urgency prediction.
[0054] Specifically, the input layer directly receives standardized multidimensional feature vectors without additional feature transformation or dimension mapping, achieving seamless connection of model input parameters, ensuring the continuity of the process from feature construction to model inference, and improving decision generation efficiency; the hidden layer is configured with nonlinear activation functions to effectively extract nonlinear representations in multidimensional features (such as the coupling relationship between water content change rate and temperature and light), avoiding the problem that linear models cannot fit the complex water requirement patterns of plants, and laying the feature foundation for accurate output of initial decision parameters; The intermediate outputs of the output layer are differentiated into the original urgency score and the original suggested water volume by the Sigmoid and Softplus functions respectively: the Sigmoid function can map the urgency to a standardized range of 0-1, realize the quantitative classification of urgency, and facilitate the subsequent calculation of dynamic target moisture content; the Softplus function can output non-negative continuous watering volume values, which fits the non-negativity and continuity requirements of actual watering operations, while avoiding the output of extreme values, providing a reasonable initial starting point for subsequent constraint optimization.
[0055] Specifically, the present invention designs a watering prediction formula based on the initial suggested watering amount, current moisture content, effective volume of the pot, and water absorption conversion coefficient. It accurately predicts the soil moisture content after watering and quantitatively models the relationship between watering amount and soil moisture content. This upgrades watering decisions from simply outputting water amount to predicting the actual impact of water amount on soil moisture, which aligns with the actual logic that soil moisture content is the core indicator for judging the rationality of watering in plant cultivation. The dynamic mapping relationship constructed based on the initial urgency level U enables the target water content to be dynamically adjusted according to the urgency of plant water demand: the higher the urgency level (the more water-scarce the plant), the closer the target water content is to the safe upper limit; the lower the urgency level, the closer the target water content is to the safe lower limit, realizing the on-demand dynamic adaptation of the target water content, breaking through the limitation of the traditional fixed target water content being unable to match different levels of plant water demand urgency.
[0056] The objective function is designed, with the initial suggested watering amount as the starting point for optimization. The watering amount is accurately optimized by minimizing the objective function. The optimization requirements of watering decision are transformed into a quantitative mathematical optimization problem, making the optimization process more logical and operable. The objective function includes a water content deviation penalty term, which amplifies the deviation between the predicted and target water content through a squared term. This ensures that the optimized watering amount brings the soil moisture content after watering as close as possible to the dynamic target value, guaranteeing the accuracy of watering. An overwatering risk penalty term is introduced to quantitatively punish excessive watering, prioritizing the avoidance of overwatering risks (overwatering is far more damaging to plants than slight underwatering). This aligns with the practical cultivation experience of erring on the side of dryness rather than waterlogging in plant care, enhancing the practicality of the decision. A constraint condition of Q≥0 is set to reflect the non-negative physical characteristic of watering amount in actual watering operations, avoiding invalid results of negative water amounts in the optimization solution and ensuring the actual executability of the optimization results. Adjustable penalty intensity weights w1 and w2 can be configured, allowing the weight ratio to be adjusted according to the growth characteristics of different plant varieties (e.g., reducing the overwatering penalty for moisture-loving plants and increasing the overwatering penalty for drought-tolerant plants). This gives the optimization model the ability to adapt to individual plant varieties, improving the system's versatility.
[0057] All model inference, formula calculation, and optimization solutions in this invention embodiment are lightweight operations that can be completed quickly on the MCU side without cloud data transmission and computation support. This ensures the device's ability to operate independently offline, making it suitable for potted plant care scenarios with no or weak network, such as homes, offices, and balconies. At the same time, the low computational load further reduces the device's power consumption and extends its battery life.
[0058] More preferably, the over-pouring penalty function is configured as a piecewise quadratic function: the over-pouring penalty function is:
[0059] in, The penalty coefficient is... For a safe watering threshold, and , This is the initial recommended watering amount; The method of determining the optimal watering amount by minimizing the objective function also includes: Calculate the theoretically optimal watering amount without penalty terms; The optimal watering amount is determined based on the theoretical optimal watering amount, the dynamic safe watering amount threshold, and the objective function. The optimized watering amount is subject to the dynamic safe watering amount threshold as a hard upper limit constraint, and its non-negativity is ensured by a pruning function, which is: The clipping function restricts the input values to a lower limit of 0 and an upper limit of 0. between.
[0060] The solution of this invention addresses the precise quantitative penalty for overwatering risk in maintenance decisions, the refined solution for watering volume optimization, and the dynamic adaptation and rigid constraints of safety thresholds. Through a combination of piecewise quadratic overwatering penalty functions, pre-calculation of theoretical optimal values, dynamic safety threshold constraints, and pruning functions, it solves the core problems of indiscriminate overwatering penalties, fixed safety thresholds, easy breaches of safety boundaries in optimization results, and the inability to avoid invalid solutions with negative water volumes in traditional optimization methods. This further enhances the overwatering risk prevention capability, the accuracy of optimization solutions, and the rigidity and dynamic adaptability of safety constraints in watering decisions. Simultaneously, all calculations are lightweight, fully adaptable to the hardware characteristics of the MCU side, and deeply synergize with the preceding objective function optimization and dynamic target moisture content design, forming a complete overwatering protection process from penalty rules to final solution verification.
[0061] Piecewise quadratic functions employ lightweight piecewise operations, requiring only simple numerical range judgments and quadratic multiplication calculations without complex iterations. This allows for rapid completion on the MCU side, balancing the refinement of penalty rules with hardware computational efficiency without increasing the time consumed by edge decision-making. The penalty coefficient k is a configurable parameter, allowing for flexible adjustment of the penalty intensity based on the different waterlogging tolerance characteristics of various plants (e.g., decreasing k for moisture-loving plants and increasing k for drought-tolerant plants). This enables the overwatering penalty to be personalized and adaptable to different plant varieties, enhancing the system's versatility.
[0062] Before optimizing the solution, the theoretical optimal watering amount without penalty is calculated first. The optimal solution that only aims to match the predicted water content with the dynamic target water content is locked in first. This provides an accurate benchmark reference value for subsequent optimization with overwatering penalty. This allows the optimization solution with penalty to start from the theoretical optimal value and make targeted adjustments instead of iterating from random initial values. This greatly reduces the amount of computation for optimization, improves the efficiency of edge-side solution, and adapts to the characteristics of MCU's weak computing power. More preferably, reading the maintenance status information from the microcontroller unit includes: The system reads the current maintenance status data calculated and stored locally by the microcontroller unit. The current maintenance status data includes the current soil volumetric moisture content and its rate of change, watering urgency, final watering amount, device status summary, and maintenance history summary. The final watering amount is obtained by the microcontroller unit after safety constraint optimization. The device status summary includes power information, sensor anomaly flags, and alarm levels. The maintenance history summary includes the timestamp of the most recent watering, the watering amount, and a log summary of a specified entry.
[0063] The solution of this invention has been meticulously designed for the data dimensions, information completeness, local processing characteristics, and user-perceived value of intelligent terminals reading maintenance status information from microcontroller units (MCUs). By clearly defining the multi-dimensional maintenance status data types locally computed and stored by the MCU, and classifying status data categories according to the actual needs of plant maintenance, it solves the problems of single data dimensions, fragmented information, inability of users to fully grasp the status of the device and plants, and lack of historical maintenance information in traditional maintenance status reading. It achieves edge-side localized processing of maintenance status information, comprehensiveness and relevance of the read content, and intuitiveness and practicality for users. At the same time, it deeply collaborates with near-field communication interaction and edge-side intelligent decision-making systems, making the maintenance status information read by NFC the core link connecting edge-side intelligent decision-making and user manual intervention. The specific technical effects are reflected in two aspects: data design and overall collaboration. All maintenance status data is calculated and stored on the MCU side. The reading process only involves short-range NFC data retrieval, without the need for real-time MCU calculation or cloud data retrieval. This significantly improves the NFC reading response speed, adapts to users' habit of simply touching the device to view data, and reduces the power consumption of the MCU due to real-time calculation, ensuring the device's low-power operation characteristics.
[0064] Local storage computing on the device avoids network dependence. Even in scenarios with no or weak network, users can still read complete maintenance status information normally via NFC, continuing the core advantage of the system's independent operation offline. It is suitable for civilian potted plant maintenance scenarios such as homes and balconies. Local data storage enables maintenance status information to be quickly traced without relying on external storage devices. At the same time, it reduces data transmission links, lowers the risk of maintenance data leakage and loss, and improves data security.
[0065] It simultaneously reads and corrects the current soil volumetric moisture content and moisture content change rate, allowing users to grasp the current actual soil moisture status and intuitively understand the dynamic trend of moisture change (such as rapid decrease / slow decrease). This breaks through the limitations of traditional methods that only display a single moisture content value, allowing users to combine the trend to predict the subsequent water requirements of plants and improve their ability to judge the water requirements of plants.
[0066] This type of data is accurate data processed by the MCU end-side through multi-factor compensation and dual-frequency differential processing, rather than the original sensor readings. This avoids the problem of users being unable to interpret the original data due to a lack of professional knowledge, lowers the threshold for user understanding, and allows ordinary users to quickly grasp the core state of the soil.
[0067] The system directly reads the watering urgency and final watering amount after the MCU has been optimized with multiple layers of safety constraints, and presents the core results of the intelligent decision-making on the edge to the user in an intuitive way. This allows the user to clearly understand the system's intelligent maintenance suggestions and provides a scientific and accurate basis for the user's manual intervention operations (such as whether to water or adjust the watering amount), avoiding the user's blind watering based on experience.
[0068] This type of data represents the final result of the system after model reasoning, formula prediction, objective function optimization, and safety constraints. It combines accuracy and security, and users can directly refer to it for execution, thereby improving the rationality and effectiveness of manual intervention and achieving efficient collaboration between intelligent decision-making and manual operation.
[0069] In practical implementation, power information can also be incorporated so that users can keep track of the remaining power of the plant maintenance device in real time, make preparations for charging / battery swapping in advance, and avoid the failure of functions such as environmental data collection, intelligent decision-making, and actuator control due to power outages, thus ensuring the continuous and stable operation of the maintenance system. Add alarm levels to provide graded alerts for device abnormalities (such as low battery or sensor failure) and emergency plant care conditions (such as moisture content below the permanent wilting point). This allows users to quickly focus on high-priority issues, improves their problem-solving efficiency, and avoids plant care failures due to missing important alarms.
[0070] Record the timestamp and amount of watering for the most recent watering, allowing users to track the latest plant care practices. Combined with the current soil moisture content and rate of change, it can analyze the water consumption patterns after watering, providing historical data for users to develop personalized care plans (such as determining the appropriate watering interval for the plant). It provides log summaries for specified entries, allowing users to trace key historical nodes in plant maintenance (such as multiple watering records, abnormal environmental data, device alarm records, etc.). This facilitates users in reviewing the plant maintenance process and provides traceable historical data support for subsequent troubleshooting and adjustment of maintenance strategies. By using log summaries for specified entries instead of the full log, it retains core historical information while controlling the amount of stored data and NFC data transmission, thus adapting to the storage resource limitations of the MCU and the short-range data transmission characteristics of NFC.
[0071] More preferably, after controlling the corresponding actuator to perform the watering operation based on the maintenance status information and user input, the method further includes: The smart terminal writes feedback data to the microcontroller unit via the near-field communication connection. The feedback data includes the execution record of the watering operation, the execution timestamp, the actual amount of water used, the user confirmation flag, and the safety configuration parameter update data. The safety configuration parameter update data includes the permanent wilting point, field capacity, upper limit safety margin, and lower limit safety margin. The microcontroller unit verifies and stores the feedback data in local non-volatile memory; The microcontroller unit updates the internal adaptive model parameters based on the actual water volume, environmental data before and after watering, and time intervals.
[0072] Specifically, the model parameter updates rely on real maintenance data such as actual water volume, environmental data before and after watering, and time intervals, rather than simulated data. This allows the optimization of the edge-side adaptive model to fully match the actual maintenance scenario. It can accurately capture the water consumption patterns of different plants, different substrates, and different environments, as well as the soil moisture change patterns after watering. This solves the problems of traditional pre-trained models being out of touch with the actual scenario and having poor generalization, and enables the model to achieve edge-side self-learning and self-adaptation. Based on a comparison of environmental data before and after watering (such as changes in soil moisture content and temperature), combined with actual watering volume and time intervals, the system can accurately calculate key patterns such as the actual absorption and conversion rate of soil moisture, natural evaporation rate, and plant water consumption rate. This allows the model to adjust parameters accordingly, improving the accuracy of watering volume and urgency predictions in subsequent maintenance decisions, making the system's maintenance recommendations increasingly aligned with the actual water needs of plants. Using the interval between the last watering and the current watering as implicit labels, a semi-Bayesian / robust recursive update is used to estimate individual evapotranspiration rate and estimated effective water holding capacity.
[0073] More preferably, the internal adaptive model parameters include the estimated effective water holding capacity and the estimated evapotranspiration rate, and the updating of the internal adaptive model parameters includes: The updated estimated effective water holding capacity is calculated based on the first update formula, which is:
[0074] in, The estimated effective water holding capacity before the update. The updated estimated effective water holding capacity. For effective water capacity learning rate, This refers to the actual amount of water applied. This represents the cumulative evapotranspiration volume calculated based on the estimated evapotranspiration rate during the interval between two waterings. This refers to the net change in soil volumetric moisture content observed during the interval. The effective volume of the basin; The updated estimated evapotranspiration rate is calculated using the second updated formula, which is:
[0075] in, The estimated evaporation rate before the update, For the updated estimated evaporation rate, The learning rate is the evaporation rate. This represents the currently observed soil volumetric water content. The target soil volumetric water content, This is a shearing function used to limit deviation values to a preset limit. Inside.
[0076] The solution of this invention addresses two core adaptive model parameters—estimated effective water holding capacity and estimated evapotranspiration rate—on the MCU side. It designs a customized update formula that is quantified, lightweight, and aligned with the actual physiological laws of plant care. Through incremental updates with a learning rate, environmental correlation modeling of evapotranspiration rate, and deviation constraints of the shear function, it solves the core problems of traditional model parameter updates, such as parameters being out of touch with the actual cultivation scenario, lack of quantification rules for updates, ignoring environmental influences on evapotranspiration rate, and susceptibility to outlier oscillations. This achieves precise, personalized, and robust self-optimization of core model parameters on the MCU side, allowing model parameters to dynamically adapt to soil water retention characteristics and plant evapotranspiration water consumption patterns based on actual care data. At the same time, all calculations are lightweight and quantified, fully adaptable to the hardware characteristics of the MCU, and deeply collaborate with the preceding feedback data writing and local storage stages, further improving the closed loop of intelligent MCU care on the MCU side.
[0077] The design employs an incremental formula for updating the effective water holding capacity with a learning rate. This formula iterates parameters using pre-update parameters and deviation corrections. The corrections are strongly linked to the actual watering volume, cumulative evapotranspiration volume, and net change in moisture content. This ensures that parameter updates are based entirely on real soil moisture changes after watering operations, accurately capturing the soil's actual effective water retention and holding capacity. This solves the problem of traditional pre-trained parameters not matching the actual water holding characteristics of the substrate / pot, enabling scenario-based adaptive optimization of the effective water holding capacity.
[0078] The formula incorporates the cumulative evapotranspiration volume and deducts the water consumption from plant evapotranspiration and natural evaporation during the watering interval. This ensures that the effective water holding capacity is calculated only for the actual effective water that the soil can retain, which aligns with the actual water balance logic of watering volume, soil water holding capacity, and evapotranspiration in plant cultivation, thus significantly improving the accuracy of effective water holding capacity estimation. By introducing an effective water holding capacity learning rate, the step size of parameter updates can be flexibly adjusted: the smaller the α value, the smoother the parameter updates, avoiding drastic parameter fluctuations caused by a single abnormal data; the larger the α value, the faster the parameters adapt to new cultivation scenarios, balancing the flexibility and robustness of parameter updates. Moreover, the learning rate is a configurable parameter that can be adjusted according to plant / substrate characteristics, improving system adaptability.
[0079] The formula integrates prior feedback data such as actual watering volume, net change in moisture content, and effective volume of the pot with collected data, enabling efficient reuse of data from each module. This allows parameter updates to become a natural extension of prior data collection and operational feedback, ensuring the continuity of the data loop on the end side. The formula is a lightweight linear incremental calculation and definite integral operation. The definite integral is completed step by step based on the temperature and light data collected periodically by the MCU. There are no complex numerical calculations. It can be executed quickly on the MCU side, which is suitable for the hardware characteristics of the MCU with weak computing power and low storage, and does not increase the time consumption of the end-side decision.
[0080] The evapotranspiration rate update is deeply linked to soil moisture content, using the deviation between the current and target moisture content as the basis for correction: when the moisture content is lower than the target value, the estimated evapotranspiration rate is appropriately increased; when the moisture content is higher than the target value, the estimated evapotranspiration rate is appropriately decreased. This ensures that the evapotranspiration rate parameter is always optimized to match the actual water consumption needs of plants, accurately capturing the evapotranspiration water consumption patterns of plants at different growth stages and under different environments. An evapotranspiration rate learning rate β is introduced, forming a matching parameter update step size control with the effective water holding capacity learning rate. This allows for independent adjustment of the evapotranspiration rate update rhythm, enabling differentiated configuration of the update step size for the two core parameters. This adapts to the different parameter characteristics and variation patterns of evapotranspiration rate and effective water holding capacity, improving the accuracy of parameter optimization. The evapotranspiration rate is combined with the dynamic calculation of temperature and light from the preceding environmental data collection, deeply linking the evapotranspiration rate estimate to the core environmental influencing factors of plant evapotranspiration. This aligns with the objective law in plant physiology that higher temperatures and stronger light lead to faster evapotranspiration water consumption, breaking through the limitations of traditional fixed evapotranspiration rates that cannot adapt to dynamic environmental changes.
[0081] More preferably, the intelligent maintenance method further includes: The recovery of soil volumetric moisture content is calculated during the first sensor sampling cycle after watering. If the recovery amount is less than the expected impact threshold of the watering amount, it is determined that there is an abnormality in root zone aeration or infiltration, and the corresponding alarm level is increased. Monitor the trend of soil electrical conductivity changes. If the electrical conductivity is detected to be continuously increasing within a preset period, it is determined that there is a risk of salinity or fertilizer damage, and the corresponding risk level and mitigation suggestions are output. And / or, the intelligent maintenance method further includes: In the next sensor sampling cycle after the watering operation is performed, the prediction error is calculated according to the deviation calculation formula. The deviation calculation formula is as follows:
[0082]
[0083] in, This is after a sampling period following watering. The measured actual soil volumetric moisture content, For the amount of watering performed Effective volume of basin and water absorption conversion coefficient The predicted moisture content after watering; When the prediction error When the preset threshold is exceeded, the model is retrained.
[0084] This invention addresses three core issues of traditional intelligent plant care systems: root zone environmental anomaly detection, salt / fertilizer damage risk warning, and watering effect prediction error monitoring and model retraining triggering. Through precise data comparison, trend analysis, and quantification error calculation within the sampling period, it solves the core problems of traditional intelligent plant care systems that only focus on watering decisions, lack proactive detection of maintenance anomalies, fail to verify watering effects, and lack early warning of model deviations. It upgrades from a single watering decision to full monitoring of maintenance status, early risk warning, verifiable effects, and model self-calibration. Furthermore, all detection, calculation, and warning logic is based on high-precision environmental data and pre-quantification formulas collected from the MCU edge. The lightweight computation is fully adapted to the MCU hardware characteristics and deeply collaborates with the edge-side intelligent decision-making and parameter adaptive update system, further improving the edge-side end-to-end intelligent plant care closed loop. This allows the system to not only accurately decide on watering but also proactively identify maintenance risks, verify decision effects, and trigger model optimization, significantly improving the safety and success rate of plant care.
[0085] The soil volumetric moisture content recovery is calculated for the first sensor sampling cycle after watering. The real-time data of water infiltration and soil absorption after watering are used for verification, enabling rapid and accurate identification of root zone anomalies. This solves the pain point that traditional systems cannot detect soil root zone aeration and permeability issues, and can promptly detect problems such as substrate compaction, poor drainage of pots, and water accumulation in the root zone that prevent normal water infiltration / absorption. Using the expected impact threshold of watering amount as the judgment standard, the recovery amount is quantitatively compared with the expected value, so that the anomaly judgment has a clear numerical basis, avoiding subjective judgment and ensuring the scientificity and consistency of anomaly detection. At the same time, the threshold can be flexibly configured according to the substrate type and pot characteristics to adapt to different cultivation scenarios. Once an anomaly is detected, the corresponding alarm level is directly raised, seamlessly connecting with the alarm level system in the status summary of the preceding device. This allows anomaly information to be synchronized to the smart terminal via NFC interaction, enabling the visualization and hierarchical classification of risk alarms. This reminds users to take timely measures such as loosening the soil, replacing the substrate, and cleaning the drainage holes, thus avoiding irreversible plant damage such as root hypoxia and root rot from the source and significantly improving the safety of plant maintenance.
[0086] In synergy with the preceding adaptive update of end-side parameters, optimization of safety constraints, and deep closure of feedback data, a two-way support of data and function is formed: the moisture content and conductivity data of anomaly detection provide real-world risk data for parameter updates, the prediction error calculation provides quantitative deviation basis for model parameter updates and retraining, and the new weights after model retraining can be written to the MCU via NFC and replace the original weights, enabling data exchange and functional linkage between detection, early warning, verification and optimization, ensuring the consistency and intelligence of the entire system operation; The system further strengthens its core logic of being data-driven and driven by professional cultivation knowledge: the detection of abnormal root zone aeration / permeability is based on the theory of the relationship between soil moisture permeability and root zone aeration; the early warning of salt damage / fertilizer damage is based on the professional correlation between electrical conductivity and soil salinity; the prediction error calculation follows the water balance formula of plant cultivation; all functional designs conform to the objective laws of professional plant maintenance, avoiding the disconnect between functions and actual maintenance caused by pure data fitting, so that every detection and early warning of the system has professional theoretical support, improving the scientificity and reliability of the system.
[0087] The interval between the last watering and the current watering, along with the changes during that period, serve as implicit labels. A semi-Bayesian / robust recursive approach is used to update the estimated individual evapotranspiration rate and estimated effective water holding capacity. The microcontroller unit updates the internal adaptive model parameters, including the estimated effective water holding capacity and estimated evapotranspiration rate, based on the actual water volume, environmental data before and after watering, and the time interval, to form an individualized learning loop based on sparse interactive data. The specific working principle of this invention embodiment: The mobile app is placed close to the near-field communication tag to complete a handshake with the device; the plant variety, effective volume of the pot, substrate type, sunlight type, initial model parameters and safety policy are written in; the safety policy includes the maximum single watering amount and the minimum suggested prompt amount. The microcontroller unit wakes up periodically according to the duty cycle to collect capacitive moisture content, temperature, conductivity and light intensity, and performs temperature / salinity compensation and drift self-check. In multi-frequency cases, dual-frequency differential estimation is used to suppress salinity coupling. Construct a feature vector; load an individualized quantized lightweight model (MLP model, ≤1–4KB weight) into the microcontroller unit, input vector f, output watering urgency and suggested water volume; substitute the suggested water volume into the physical feasible region and equipment / human constraints, and obtain the trimmed water volume through optimization; When users are conducting inspections, the mobile app communicates with the microcontroller unit via a near-field communication tag, reads the current status, decision results, and historical summary information stored and maintained by the microcontroller unit, and selects to perform a watering operation. After watering is performed, the app updates the execution information, feedback, and optional parameters to the device via the near-field communication tag. The microcontroller unit verifies the data and stores it in its local memory, thus achieving decision-making collaboration and traceability closed loop without continuous network connection.
[0088] The solution in this invention combines parameter pre-configuration, periodic environmental data acquisition, edge machine learning decision-making, NFC status interaction, and manual intervention into an integrated design. This achieves multiple technical effects in terms of intelligence, precision, portability, safety, and equipment adaptability in plant maintenance. Furthermore, the modules work together to form a closed-loop maintenance system, solving the technical problems of traditional plant maintenance devices, such as cumbersome configuration, crude maintenance decision-making, inconvenient data interaction, high execution risk, and poor human-machine collaboration.
[0089] Example 2 Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of the intelligent plant care system based on near-field communication interaction disclosed in an embodiment of the present invention. Figure 4 As shown, this intelligent plant care system based on near-field communication interaction may include: Writing module 21: Used by the smart terminal in response to establishing a near-field communication connection with the near-field communication tag embedded in the plant care device, to write a set of initial configuration parameters to the microcontroller unit of the plant care device, wherein the plant care device is set in a pot, and the initial configuration parameters include plant variety identifier, pot volume, substrate type identifier and security strategy parameters. Acquisition module 22: used to periodically acquire environmental data of the corresponding plant from the environmental sensor by the microcontroller unit of the plant care device; wherein, the acquisition of the environmental data is performed within the wake-up cycle of the microcontroller unit; Generation module 23: Used by the microcontroller unit to generate corresponding plant maintenance decisions based on the collected environmental data and the stored initial configuration parameters. Generating the corresponding plant maintenance decisions includes: constructing a maintenance feature vector based on the environmental data; inputting the maintenance feature vector into a pre-trained machine learning model stored in the microcontroller unit to obtain an initial suggested watering amount and an initial urgency level; and performing constraint optimization on the initial suggested watering amount and initial urgency level based on the safety policy parameters to determine the final watering amount and final urgency level. Communication module 24: used by the smart terminal to read maintenance status information from the microcontroller unit in response to the near-field communication connection established with the near-field communication tag, and to display it on the user's smart terminal; Operation module 25: In response to user input, the smart terminal sends an execution command to the microcontroller unit to control the corresponding actuator to perform watering operation based on the maintenance status information and user input.
[0090] The solution in this invention combines parameter pre-configuration, periodic environmental data acquisition, edge machine learning decision-making, NFC status interaction, and manual intervention into an integrated design. This achieves multiple technical effects in terms of intelligence, precision, portability, safety, and equipment adaptability in plant maintenance. Furthermore, the modules work together to form a closed-loop maintenance system, solving the technical problems of traditional plant maintenance devices, such as cumbersome configuration, crude maintenance decision-making, inconvenient data interaction, high execution risk, and poor human-machine collaboration.
[0091] Example 3 Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of the present invention. The electronic device can be a computer, a server, etc. Of course, in certain cases, it can also be a mobile phone, tablet computer, monitoring terminal, or other smart device, as well as an image acquisition device with processing capabilities. Figure 4 As shown, the electronic device may include: Memory 510 storing executable program code; Processor 520 coupled to memory 510; The processor 520 calls the executable program code stored in the memory 510 to execute some or all of the steps in the intelligent plant care method based on near-field communication interaction in Embodiment 1.
[0092] The above provides a detailed description of the intelligent plant care method, system, electronic device, and storage medium based on near-field communication interaction disclosed in the embodiments of the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for intelligent plant care based on near-field communication interaction, characterized in that, include: In response to establishing a near-field communication connection with a near-field communication tag embedded in the plant care device, the smart terminal writes a set of initial configuration parameters to the microcontroller unit of the plant care device. The plant care device is set in a pot, and the initial configuration parameters include plant variety identifier, pot volume, substrate type identifier, and security strategy parameters. The microcontroller unit of the plant care device periodically collects environmental data of the corresponding plants from environmental sensors; wherein, the collection of the environmental data is performed within the wake-up cycle of the microcontroller unit; The microcontroller unit generates corresponding plant maintenance decisions based on the collected environmental data and the stored initial configuration parameters. The generation of these plant maintenance decisions includes: Construct a maintenance feature vector based on the environmental data; The maintenance feature vector is input into a pre-trained machine learning model stored in the microcontroller unit to obtain the initial suggested watering amount and initial urgency level; Based on the safety strategy parameters, the initial suggested watering amount and initial urgency are constrained and optimized to determine the final watering amount and final urgency. In response to the near-field communication connection established with the near-field communication tag, the smart terminal reads maintenance status information from the microcontroller unit and displays it on the user's smart terminal; The smart terminal responds to user input and sends an execution command to the microcontroller unit to control the corresponding actuator to perform watering operations based on the maintenance status information and user input.
2. The intelligent plant care method based on near-field communication interaction as described in claim 1, characterized in that, The process of establishing a near-field communication connection between the smart terminal and the near-field communication tag embedded in the plant care device includes: The microcontroller unit of the plant care device is triggered to enter the communication mode by a near-field communication tag to wake up the microcontroller unit; Establishing a corresponding temporary communication session, which includes: The smart terminal sends a session request frame to the microcontroller unit. The session request frame includes a terminal random number, a timestamp, and smart terminal identification information. In response to the session request frame, the microcontroller unit generates a device random number and an incrementing session counter, and sends the device random number, the session counter, and the device status summary to the smart terminal. A unique session identifier for identifying a temporary communication session is jointly constructed by at least one of the smart terminal and the microcontroller unit based on the terminal random number, the device random number, and the session counter. The unique session identifier is carried in all communication frames during the temporary communication session to prevent cross-session replay attacks.
3. The intelligent plant care method based on near-field communication interaction as described in claim 1, characterized in that, The environmental sensors include a moisture content sensor, a temperature sensor, a conductivity sensor, and a light sensor; the periodic collection of environmental data from the environmental sensors for the corresponding plants includes: The microcontroller unit is woken up periodically according to a preset sampling cycle; during the wake-up period, raw data is collected from the moisture content sensor, temperature sensor, conductivity sensor and light sensor; The raw readings of the moisture content sensor are compensated for by multiple factors. The compensation amount is calculated based on synchronously acquired temperature data, conductivity data, and a compensation calculation formula, which is as follows: in, This is the corrected volumetric moisture content. This represents the original volumetric moisture content. This is the temperature compensation coefficient. EC is the salinity compensation coefficient, and EC is the electrical conductivity. T represents the reference temperature; T represents the detection temperature. When using multi-frequency measurements, a dual-frequency differential estimation algorithm is used to process the data from the moisture content sensor in order to suppress the coupling interference of soil salinity on moisture content measurements. Based on the compensated and / or processed sensor data, and combined with the stored effective volume of the pot, the time and amount of water used for the last watering, and the type identifier of the substrate, a multi-dimensional feature vector for intelligent irrigation decision-making is constructed. The multi-dimensional feature vector is used to characterize the current water requirement environment and historical state of the plant. The multidimensional feature vector is: ; Where f is a multidimensional feature vector. This is the corrected volumetric moisture content. Let T be the rate of change of moisture content, T be the temperature parameter, EC be the electrical conductivity parameter, and L be the light intensity. The effective volume of the basin This is the timestamp of the last watering. This is the amount of water used last time. It is a matrix type.
4. The intelligent plant care method based on near-field communication interaction as described in claim 3, characterized in that, The pre-trained machine learning model is a lightweight multilayer perceptron neural network with quantized weights, and the model weight data size does not exceed 4 kilobytes. The multilayer perceptron neural network includes: The input layer is used to receive the multidimensional feature vector; At least one hidden layer, the hidden layer being used to extract nonlinear representations and configured with a nonlinear activation function; The output layer produces intermediate outputs, which are then converted into the original watering urgency score and the original recommended water volume by passing through Sigmoid and Softplus respectively. The step of constraining and optimizing the initial suggested watering amount and initial urgency based on the safety policy parameters to determine the final watering amount and final urgency includes: The corresponding predicted watering amount is determined based on the initial suggested watering amount and the watering prediction formula; the watering prediction formula is: , among which, among which, To predict moisture content, This represents the current volumetric moisture content. This is the initial recommended watering amount; For the effective volume of the basin, The water absorption conversion coefficient; Based on the initial urgency, safety strategy parameters, and target mapping formula, a dynamic target moisture content within a preset safe moisture content range is determined; the target mapping formula is: ; in, For the target moisture content, For permanent wilting points, As a lower limit safety margin, Field holding capacity U represents the upper limit of safety margin; U represents the initial urgency level. As the lower limit of the target, The upper limit of the target; Using the initial suggested watering amount as the starting point for optimization, the optimal watering amount is determined by minimizing the objective function; wherein, the objective function is: And Q≥0; where, The penalty intensity for moisture content deviation, The severity of the penalty for over-pouring risk; The watering volume obtained from the optimization solution is constrained to the feasible region defined by the preset safety policy in order to determine the final watering volume.
5. The intelligent plant care method based on near-field communication interaction as described in claim 4, characterized in that, The over-pouring penalty function is configured as a piecewise quadratic function: the over-pouring penalty function is: in, The penalty coefficient is... For safe watering thresholds, and , This is the initial recommended watering amount; The method of determining the optimal watering amount by minimizing the objective function also includes: Calculate the theoretically optimal watering amount without penalty terms; The optimal watering amount is determined based on the theoretical optimal watering amount, the dynamic safe watering amount threshold, and the objective function. The optimized watering amount is subject to the dynamic safe watering amount threshold as a hard upper limit constraint, and its non-negativity is ensured by a pruning function, which is: The clipping function restricts the input values to a lower limit of 0 and an upper limit of 0. between.
6. The intelligent plant care method based on near-field communication interaction as described in claim 1, characterized in that, The step of reading maintenance status information from the microcontroller unit includes: The system reads the current maintenance status data calculated and stored locally by the microcontroller unit. The current maintenance status data includes the current soil volumetric moisture content and its rate of change, watering urgency, final watering amount, device status summary, and maintenance history summary. The final watering amount is obtained by the microcontroller unit after safety constraint optimization. The device status summary includes power information, sensor anomaly flags, and alarm levels. The maintenance history summary includes the timestamp of the most recent watering, the watering amount, and a log summary of a specified entry.
7. The intelligent plant care method based on near-field communication interaction as described in claim 1, characterized in that, After controlling the corresponding actuator to perform the watering operation based on the maintenance status information and user input, the method further includes: The smart terminal writes feedback data to the microcontroller unit via the near-field communication connection. The feedback data includes the execution record of the watering operation, the execution timestamp, the actual amount of water used, the user confirmation flag, and the safety configuration parameter update data. The safety configuration parameter update data includes the permanent wilting point, field capacity, upper limit safety margin, and lower limit safety margin. The microcontroller unit verifies and stores the feedback data in local non-volatile memory; The microcontroller unit updates the internal adaptive model parameters based on the actual water volume, environmental data before and after watering, and time intervals.
8. The intelligent plant care method based on near-field communication interaction as described in claim 7, characterized in that, The internal adaptive model parameters include the estimated effective water holding capacity and the estimated evapotranspiration rate. Updating the internal adaptive model parameters includes: The updated estimated effective water holding capacity is calculated based on the first update formula, which is: in, The estimated effective water holding capacity before the update. The updated estimated effective water holding capacity. For effective water capacity learning rate, This refers to the actual amount of water applied. This represents the cumulative evapotranspiration volume calculated based on the estimated evapotranspiration rate during the interval between two waterings. This refers to the net change in soil volumetric moisture content observed during the interval. The effective volume of the basin; The updated estimated evapotranspiration rate is calculated using the second updated formula, which is: in, The estimated evaporation rate before the update, For the updated estimated evaporation rate, The learning rate is the evaporation rate. This represents the currently observed soil volumetric water content. The target soil volumetric water content, This is a shearing function used to limit deviation values to a preset limit. Inside.
9. The intelligent plant care method based on near-field communication interaction as described in claim 7, characterized in that, The intelligent maintenance method also includes: The recovery of soil volumetric moisture content is calculated during the first sensor sampling cycle after watering. If the recovery amount is less than the expected impact threshold of the watering amount, it is determined that there is an abnormality in root zone aeration or infiltration, and the corresponding alarm level is increased. Monitor the trend of soil electrical conductivity changes. If the electrical conductivity is detected to be continuously increasing within a preset period, it is determined that there is a risk of salinity or fertilizer damage, and the corresponding risk level and mitigation suggestions are output. And / or, the intelligent maintenance method further includes: In the next sensor sampling cycle after the watering operation is performed, the prediction error is calculated according to the deviation calculation formula. The deviation calculation formula is as follows: in, This is after a sampling period following watering. The measured actual soil volumetric moisture content, For the amount of watering performed Effective volume of basin and water absorption conversion coefficient The predicted moisture content after watering; When the prediction error When the preset threshold is exceeded, the model is retrained.
10. A plant intelligent maintenance system based on near-field communication interaction, characterized in that, include: Writing module: Used by the smart terminal to write a set of initial configuration parameters to the microcontroller unit of the plant care device in response to establishing a near-field communication connection with the near-field communication tag embedded in the plant care device. The plant care device is set in a pot, and the initial configuration parameters include plant variety identifier, pot volume, substrate type identifier and security policy parameters. Acquisition module: used to periodically acquire environmental data of the corresponding plant from the environmental sensor by the microcontroller unit of the plant care device; wherein, the acquisition of the environmental data is performed within the wake-up cycle of the microcontroller unit; The generation module is used by the microcontroller unit to generate corresponding plant maintenance decisions based on the collected environmental data and the stored initial configuration parameters. Generating the corresponding plant maintenance decisions includes: constructing a maintenance feature vector based on the environmental data; inputting the maintenance feature vector into a pre-trained machine learning model stored in the microcontroller unit to obtain an initial suggested watering amount and an initial urgency level; and performing constraint optimization on the initial suggested watering amount and initial urgency level based on the safety policy parameters to determine the final watering amount and final urgency level. Communication module: used by the smart terminal in response to the near-field communication connection established with the near-field communication tag to read maintenance status information from the microcontroller unit and display it on the user's smart terminal; Operation module: Used by the smart terminal in response to user input to send execution instructions to the microcontroller unit, so as to control the corresponding actuator to perform watering operation according to the maintenance status information and user input.