Garden soil layer dynamic monitoring system based on soil multi-parameter sensor network

By collecting voltage and current data in real time in the garden soil monitoring system, calculating key indicators during the wake-up process, and dynamically adjusting the peripheral startup strategy, the reset problem caused by insufficient power supply to the garden monitoring nodes was solved, thus improving stability and data continuity.

CN122084865APending Publication Date: 2026-05-26JINAN QUANSEN GREENING DESIGN CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JINAN QUANSEN GREENING DESIGN CO LTD
Filing Date
2026-02-10
Publication Date
2026-05-26

Smart Images

  • Figure CN122084865A_ABST
    Figure CN122084865A_ABST
Patent Text Reader

Abstract

This invention discloses a dynamic monitoring system for garden soil layers based on a multi-parameter soil sensor network, relating to the fields of environmental monitoring and smart gardening. By deploying multi-parameter sensor nodes with integrated microcontroller units at different regions and depths of the garden soil, it achieves hierarchical acquisition of environmental parameters such as temperature, humidity, conductivity, and pH. Simultaneously, it collects real-time data on changes in power supply voltage and peripheral current before and after MCU wake-up, calculates the dynamic wake-up voltage gradient and instantaneous load initiation factor, inputs these into a nonlinear prediction model, assesses the probability of reset risk, and dynamically adjusts the peripheral startup sequence during high-risk periods to avoid reset events. Combined with rolling learning, the model is adaptively updated to improve the operational stability and data continuity of the monitoring nodes. This invention possesses advantages such as low power consumption, high reliability, and intelligent control, making it suitable for long-term soil monitoring applications in complex garden environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of environmental monitoring and smart landscaping technology, specifically to a dynamic monitoring system for landscaping soil layers based on a multi-parameter soil sensor network. Background Technology

[0002] A dynamic soil monitoring system for gardens, based on a multi-parameter sensor network, utilizes various sensors (such as those for humidity, temperature, pH, and conductivity) deployed in the garden soil. These sensors collect and transmit real-time soil information to a control center via wireless or wired networks, enabling continuous tracking and analysis of soil changes. This system helps garden managers accurately understand soil conditions, optimize irrigation, fertilization, and maintenance measures, and improve the scientific management of the plant growth environment.

[0003] Under extreme low-power conditions, garden monitoring nodes typically employ a deep sleep + timed wake-up strategy for the MCU to extend battery life. However, when continuous rainy weather leads to insufficient solar power, the power supply voltage may frequently experience short-term dips. In such cases, the MCU may trigger an unexpected Brown-Out Reset, causing the system to unexpectedly restart or enter an abnormal state, resulting in disrupted data acquisition cycles or even data loss. This problem is insidious and difficult to debug, often occurring frequently due to inaccurate Brown-Out detection threshold settings, inadequate power supply filtering design, and insufficient consideration of current fluctuations during wake-up, severely impacting system stability and data continuity. Summary of the Invention

[0004] The purpose of this invention is to provide a dynamic monitoring system for garden soil layers based on a multi-parameter soil sensor network, in order to address the shortcomings of the prior art.

[0005] To achieve the above objectives, the present invention provides the following technical solution: a dynamic monitoring system for garden soil layers based on a multi-parameter soil sensor network, comprising:

[0006] Sensor node deployment module: Several sensor nodes are deployed in different areas and at different depths of the garden soil, and each sensor node integrates a microcontroller unit (MCU).

[0007] Power status sensing parameter acquisition module: In the sensor node, power supply voltage change data and peripheral startup instantaneous current data are collected in real time before and after MCU wake-up; among them, dynamic wake-up voltage gradient DWVG is calculated based on the collected voltage data, and instantaneous load startup factor ILAF is calculated based on the current data;

[0008] Reset Risk Modeling and Assessment Module: The DWVG and ILAF are used as input feature values ​​and input into a preset nonlinear prediction model to calculate and assess the risk of unexpected low-voltage reset of the MCU during the wake-up process; if the output reset risk probability value exceeds the preset threshold, it is determined that there is a reset risk in the current wake-up cycle;

[0009] Peripheral delay scheduling module: During the Bootloader stage of MCU startup, the peripheral startup scheduling strategy is dynamically executed based on the reset risk assessment results; among them, for cycles with high reset risk, high-power or non-critical modules are delayed in startup, and low-power or critical task modules are loaded first.

[0010] Update module: Records the results of DWVG, ILAF, peripheral scheduling strategy and whether a reset occurs in each wake-up cycle as sample data, and dynamically updates the nonlinear prediction model through rolling learning.

[0011] Preferably, the sensor nodes are deployed according to the principles of soil type, vegetation cover difference, terrain structure and management functional zone division of garden soil, and multiple nodes at different depths are set in each area along the vertical direction to realize the layered monitoring of the environmental status of surface, middle and deep soil layers.

[0012] Preferably, the sensor node integrates a soil temperature sensor, a soil moisture sensor, a soil conductivity sensor, and a soil pH sensor; and each sensor is connected to the microcontroller unit via a low-power control circuit.

[0013] Preferably, the dynamic wake-up voltage gradient is obtained by calculating the difference between the maximum and minimum voltage values ​​and dividing it by the time interval within a sampling window of 10 milliseconds before and after MCU wake-up.

[0014] Preferably, the instantaneous load start-up factor is obtained by integrating the sampling points that exceed the reference no-load current threshold within a set time window after the MCU is woken up, and normalizing the integral value into an instantaneous load start-up factor per unit current and per unit time.

[0015] Preferably, the nonlinear prediction model is an extended logistic regression model with a regularization term. The input features include dynamic wake-up voltage gradient, instantaneous load initiation factor, the product of the two, scheduling strategy encoding, and the square of each feature. The output value is a reset risk probability value between 0 and 1.

[0016] Preferably, the peripheral device startup scheduling strategy is divided into three levels—low risk, medium risk, and high risk—based on the reset risk probability value, and the corresponding peripheral device startup scheduling table is called respectively to control the startup time delay, priority order, and activation status of different peripheral devices.

[0017] Preferably, the rolling learning method employs a stochastic gradient descent algorithm with L2 regularization, which performs incremental parameter updates on newly added sample data without resetting the model structure. The update is automatically triggered when the model update cycle and the number of samples reach preset conditions.

[0018] Preferably, each set of sample data for model updates includes the dynamic wake-up voltage gradient of the current cycle, the instantaneous load start-up factor, the peripheral start-up strategy number adopted, and a tag value indicating whether an unexpected low-voltage reset has occurred. The sample data is stored in a structured manner in the microcontroller's non-volatile cache.

[0019] Preferably, the power status sensing parameter acquisition module is located in the main control circuit board of the sensor node, including a high-precision voltage divider sampling network and a low-resistance current detection resistor connected in parallel with the power path, and respectively connected to the analog-to-digital conversion channel of the microcontroller unit, for high-frequency sampling of the power supply voltage and current during the wake-up phase.

[0020] The technical effects and advantages provided by the present invention in the above technical solution are as follows:

[0021] 1. This invention achieves continuous, multi-dimensional, and hierarchical dynamic monitoring of the soil environment by deploying sensor nodes with multi-parameter monitoring capabilities in garden soil and combining them with the low-power design and power status sensing mechanism of the microcontroller unit. Compared to traditional sensor networks that only focus on the acquisition and uploading of sensor data, this invention performs real-time modeling of the power supply behavior during the MCU wake-up phase at the system level. By calculating two key indicators, the Dynamic Wake-up Voltage Gradient (DWVG) and the Instantaneous Load Start-up Factor (ILAF), it effectively identifies potential risks of unexpected low-voltage reset, providing quantifiable decision-making basis for subsequent control strategies.

[0022] 2. This invention introduces a nonlinear reset risk prediction model based on DWVG and ILAF, dynamically executing a peripheral startup scheduling strategy during the microcontroller boot phase. During high-risk periods, it prioritizes loading low-power critical modules and delays the startup of high-power modules, thereby avoiding system reset events caused by load surges. Furthermore, it utilizes a rolling learning method to incrementally optimize the prediction model, enabling continuous adaptive capabilities. This significantly improves the system's long-term stability and data acquisition continuity in complex garden environments, demonstrating good engineering practical value. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.

[0024] Figure 1 This is a flowchart of the system modules of the present invention. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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, 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.

[0026] For examples, please refer to Figure 1 As shown in this embodiment, the garden soil dynamic monitoring system based on a multi-parameter soil sensor network includes:

[0027] Sensor node deployment module: Several sensor nodes are deployed in different areas and at different depths of the garden soil, and each sensor node integrates a microcontroller unit (MCU).

[0028] In this invention, to achieve multi-dimensional, continuous, and hierarchical data collection on the soil environmental conditions in garden areas, it is necessary to scientifically deploy and integrate sensor nodes. Specifically, this includes the following:

[0029] In garden landscapes or green areas, the sensor node deployment areas should be selected according to the following principles:

[0030] Representative soil types: covering different types such as sandy soil, loam, and clay;

[0031] Differences in vegetation cover: Select areas corresponding to different vegetation types (trees, shrubs, lawns);

[0032] Management needs-oriented: Taking into account both important viewing areas and irrigation control areas;

[0033] Topographical structure considerations: Incorporating micro-topography such as highlands, depressions, and water edges;

[0034] In each selected area, one or more sets of sensor nodes are pre-buried along the vertical direction. Common depths include: surface layer (5~10 cm): monitoring surface temperature and evaporation effects; middle layer (20~30 cm): reflecting the main root activity layer; deep layer (50~80 cm): analyzing water storage layer, water retention and salt migration; the actual depth can be customized and adjusted according to the plant root structure and irrigation infiltration radius.

[0035] Each sensor node is a single, integrated package, providing waterproof, dustproof, and corrosion-resistant capabilities, making it suitable for long-term burial. Internally, it integrates the following multi-parameter soil sensing modules:

[0036] Soil temperature sensor: such as the DS18B20 digital temperature probe, with a measurement accuracy of ±0.5°C;

[0037] Soil moisture sensor: Employs a capacitive moisture measurement core, outputting analog or digital signals;

[0038] Soil electrical conductivity (EC) sensor: used to determine the total salt concentration in soil solution, in μS / cm;

[0039] Soil pH sensor: based on glass electrode or solid electrode technology, typically with a pH range of 3 to 9;

[0040] Optional modules: Oxidation-reduction potential (ORP), soil salinity, soluble organic matter, potential gradient, etc.

[0041] The aforementioned sensors are connected to the main control circuit board via pin header soldering or flexible flat cables, and are led out via corrosion-resistant wires or sealed using an integrated injection molding process.

[0042] The core control unit of the sensor node is an MCU, which uses low-power microcontroller chips such as the STM32L series, MSP430, and ESP32 (low-power mode), and has the following functions:

[0043] Main control scheduling: coordinates data acquisition from various sensor modules and peripheral control;

[0044] Timed wake-up: Built-in RTC module or external low-power timer, set a fixed sampling period (e.g., 15 minutes / time).

[0045] Low-power sleep mode: Enters Stop Mode or Deep Sleep mode during non-data acquisition periods; current consumption is controlled to <10μA;

[0046] Wake-up triggering methods: timer interrupt wake-up; external level wake-up (such as sensing light / activity through voltage changes);

[0047] Power-loss protection and reset management: Integrated Brown-Out Reset (BOR) module; software layer supports power supply voltage judgment and initialization reset process.

[0048] The sensor nodes adopt a self-sufficient energy design, combined with the following energy management methods:

[0049] Main power supply: Solar panel (e.g., 6V / 3W) + lithium battery pack (18650 type or LiFePO4).

[0050] Power management chips, such as BQ24075 and TP4056, provide overcharge / over-discharge protection.

[0051] Regulated output: The LDO regulator provides a stable output of 3.3V or 5V;

[0052] Power consumption optimization measures: The MCU shuts off the sensor power supply during non-acquisition periods; peripherals are powered on only during communication / acquisition windows; MOSFET switches are used to control the power supply of submodules.

[0053] Each node supports one of the following communication methods for uploading collected data to the aggregation gateway: LoRa communication: suitable for long-distance, low-power scenarios; ZigBee networking: suitable for building medium-to-short-distance multi-node communication networks; NB-IoT / 4G module: suitable for remote independent communication nodes; Wi-Fi communication: suitable for small-area, high-frequency data collection scenarios. The communication module is off by default and is only enabled by the MCU upon power-up after the data collection window is completed, reducing power consumption.

[0054] The data acquisition process includes: the MCU is woken up by a timer interrupt; the required sensor modules are activated; sampling begins after a voltage regulation waiting time (e.g., 100ms); the values ​​of each sensor are read sequentially, and necessary filtering processes (e.g., moving average) are performed; the data is packaged into a data frame and written to the buffer; if the upload cycle is reached, the communication module is started and the data is sent; after completion, the peripherals are turned off, and the MCU re-enters sleep mode.

[0055] The sensor node adopts the following protective measures to meet the long-term deployment requirements of the garden environment: Shell material: corrosion-resistant engineering plastic (such as ABS+PC), epoxy resin encapsulation; Interface sealing: IP67 level waterproof design; Lead wire protection: polyurethane-coated cable to prevent rodents from biting through; Module heat dissipation: heat dissipation is achieved through copper foil embedded structure.

[0056] In this embodiment, through the above deployment and structural design, the sensor nodes achieve high-precision, multi-parameter, low-power, and long-term stable environmental monitoring of different areas and depths of garden soil, providing a solid data foundation and node support for the subsequent data processing, dynamic analysis, and intelligent control of the system.

[0057] Power status sensing parameter acquisition module: In the sensor node, power supply voltage change data and peripheral startup instantaneous current data are collected in real time before and after MCU wake-up; among them, dynamic wake-up voltage gradient DWVG is calculated based on the collected voltage data, and instantaneous load startup factor ILAF is calculated based on the current data.

[0058] In this invention, to prevent unexpected reset events of the microcontroller unit (MCU) caused by unstable power supply or sudden load startup, a risk identification mechanism based on power behavior modeling is proposed. By dynamically acquiring and calculating the power supply voltage and load current before and after MCU wake-up, key indicators reflecting reset risk are obtained: Dynamic Wake-up Voltage Gradient (DWVG) and Instantaneous Load Start-up Factor (ILAF). The specific technical implementation steps and structural design are as follows:

[0059] A high-precision voltage sampling path is set up in the sensor node main control board to continuously detect changes in the power supply voltage (Vcc) before and after the MCU wakes up. Specifically, this includes:

[0060] A voltage divider resistor network is installed at the output of the lithium battery or the back end of the LDO regulator, and connected to the built-in or external ADC channel of the MCU.

[0061] Select an analog-to-digital converter (ADC) with a resolution of at least 12 bits and a sampling rate of at least 10 kHz to ensure sufficient resolution for short-term voltage fluctuations;

[0062] Within each sampling period, a sampling window of 5-10 milliseconds is set before and after wake-up to record the change of voltage value over time during the corresponding period.

[0063] The sampled data is stored in the MCU buffer by timestamp and used as input data for calculating DWVG.

[0064] To monitor load current fluctuations generated by peripherals during MCU wake-up and startup, a transient current detection module is integrated into the main power supply path. Commonly used components include:

[0065] Current sensing chips: such as INA219, INA226 and other current / voltage monitoring modules with I²C interfaces;

[0066] Detection location: Placed on the main power path shared by the MCU and peripherals, and equipped with a precision sampling resistor (e.g., 0.01Ω).

[0067] Detection time point: Within 10ms before and after the MCU wakes up and immediately starts the peripheral device, the current value is recorded once every 1ms;

[0068] The sampled data is uploaded to the MCU RAM in real time and combined with the reference no-load current to form the basis for calculation.

[0069] Based on the voltage and current sampling data mentioned above, the system calculates the two parameters DWVG and ILAF respectively:

[0070] DWVG is an important indicator reflecting the rate of change of the supply voltage when the MCU switches from sleep mode to run mode, and is used to judge the voltage stability during the wake-up process. Its calculation method is as follows:

[0071] Set the voltage sampling window before and after wake-up:

[0072] Wake-up window: from t = −10 ms to t = 0 ms;

[0073] Window after wake-up: from t=0 ms to t=+10 ms;

[0074] It is recommended to sample 10-20 points per window (depending on the ADC sampling rate).

[0075] In the two time windows mentioned above, the voltage sampling sequences were recorded respectively: ; .

[0076] Calculate the minimum voltage value within the time window before wake-up: ;

[0077] Calculate the maximum voltage value within the time window after wake-up: .

[0078] The default window center time difference is: It should be noted that the time difference here can be customized to be smaller or larger to adapt to different hardware response characteristics;

[0079] Substituting the extreme value and the time difference into the formula, we get: ;in, To dynamically wake up the voltage gradient.

[0080] DWVG is measured in millivolts per millisecond (mV / ms). When its value is negative and the absolute value is large, it indicates a significant voltage drop, which may trigger a Brown-Out Reset risk.

[0081] For example, ; Time difference = 10 ms; .

[0082] ILAF is mainly used to characterize the sudden increase in current load caused by starting multiple peripherals within a very short time after the MCU wakes up. Its calculation method is as follows:

[0083] Set the current sampling window T after wake-up, for example, 10ms; set the sampling frequency, for example, 1kHz (i.e., sample once every 1ms, for a total of 10 samples); record the current sequence: ;in, Run the system while the MCU is awake but the peripherals are not activated, and record the stable current; calculate the average current in this state as... Set overshoot threshold ;

[0084] For example: if =15 mA, θ=1.3 → threshold is 19.5 mA;

[0085] Find all ti that satisfy I(ti)> Numerical integration (e.g., using the trapezoidal rule) is performed on these sampling points. Where Δt is the sampling interval (e.g., 1 ms), the integration result is normalized to the amount of current per unit time and unit time, and the instantaneous load start-up factor is calculated. The expression is: .

[0086] ILAF is dimensionless and typically greater than 1. The larger the ILAF value, the stronger the system load impact after wake-up. Using it in conjunction with DWVG can more accurately determine the electrical stability during the wake-up phase.

[0087] For example: setting =15 mA; T=10 ms; Sampling frequency: 1 kHz (10 points in total); Current sequence (in mA): {15,16,18,20,22,24,21,18,16,15}; θ=1.2, overshoot threshold is 18 mA; Extract the interval greater than 18 mA: {20,22,24,21} (assuming a time span of 4 ms); Integration result (approximate): ≈12(20+22)+12(22+24)+12(24+21)=21+23+22.5=66.5 mA; Calculation: ILAF=66.5 / 150≈0.443; This indicates that the relative overshoot intensity of the startup process within a 10ms window is 44.3%.

[0088] Reset Risk Modeling and Assessment Module: The DWVG and ILAF are used as input feature values ​​and input into a preset nonlinear prediction model to calculate and assess the risk of unexpected low-voltage reset of the MCU during the wake-up process; if the output reset risk probability value exceeds the preset threshold, it is determined that there is a reset risk in the current wake-up cycle.

[0089] In this embodiment, to accurately identify whether there is an unexpected low-voltage reset risk during the wake-up process of the microcontroller unit due to voltage instability or load surges, the two key parameters, the Dynamic Wake Voltage Gradient and the Instantaneous Load Activation Factor, calculated above, are combined to construct a nonlinear classification model, thereby predicting and judging the reset risk probability. The specific technical steps are as follows:

[0090] During each microcontroller unit wake-up process, two key feature values ​​are acquired as model inputs:

[0091] Dynamic wake-up voltage gradient: This represents the rate of change of the supply voltage of the microcontroller unit before and after wake-up. This value is obtained by taking the difference between the minimum voltage before wake-up and the maximum voltage after wake-up, and dividing by the sampling time difference between the two. The unit is millivolts per millisecond.

[0092] Instantaneous load start-up factor: This represents the current surge intensity caused by peripheral device startup within a short period after the microcontroller unit wakes up. This value is calculated by integrating the startup current over a period of time that is higher than the reference current by a certain proportion, and then normalizing it to a dimensionless value per unit time and per unit current.

[0093] The two feature values ​​mentioned above are denoted as the first feature value and the second feature value, respectively. During the data preparation phase, based on multiple real-world wake-up scenarios, it is necessary to label whether each wake-up generates a low-voltage reset behavior, and construct a training dataset containing the first feature value, the second feature value, and the corresponding labels.

[0094] A binary classification nonlinear prediction model is used to model the reset risk of microcontroller units. The model selected is a regularized logistic regression model, chosen for its low computational complexity and high parameter interpretability. The specific model construction steps are as follows:

[0095] Training data collection: Collect at least 500 wake-up data samples, including:

[0096] The first characteristic value for each wake-up (dynamic wake-up voltage gradient);

[0097] The second characteristic value for each wake-up (instantaneous load start factor);

[0098] Whether a low-voltage reset occurs after wake-up (label value, 0 indicates no reset, 1 indicates reset).

[0099] Feature normalization: The minimum-maximum normalization is performed on the two feature values ​​respectively, and the range of the processed values ​​is 0 to 1.

[0100] Model structure design: Construct a logistic regression model with quadratic terms, whose prediction function can be described as:

[0101] The first eigenvalue, the second eigenvalue, the squared term of the first eigenvalue, the squared term of the second eigenvalue, and the cross product term of the two are used as input feature vectors and input into a logic function with a bias term. The output is a reset risk probability value between 0 and 1.

[0102] Model training and optimization:

[0103] The cross-entropy loss function is used as the objective function;

[0104] The parameters are solved using gradient descent.

[0105] L2 regularization is introduced during training to prevent overfitting;

[0106] The model is trained until the loss function converges and the accuracy on the validation set reaches over 90%.

[0107] The trained logistic regression model is fixed as a set of coefficients and bias values, implemented as a function in the microcontroller's main program. Upon each wake-up, the following steps are executed:

[0108] Input the first and second feature values ​​obtained in the current period into the model function;

[0109] Based on the preset model calculation steps, a floating-point value between 0 and 1 is output, which is the probability of an unexpected low-voltage reset occurring in the current wake-up cycle.

[0110] This risk probability is a predicted result and does not directly trigger any hardware operation, but is used to determine whether to take protective measures.

[0111] To ensure the operability of the model output, a risk assessment threshold needs to be set. This threshold is determined during model training in the following way:

[0112] In the training dataset, calculate the risk probability distribution of all predicted samples;

[0113] The Youden index method is used to calculate the optimal classification threshold, which maximizes the sum of the true positive rate and the true negative rate. The obtained optimal threshold is rounded to two decimal places and used as the reset risk judgment threshold. In this embodiment, the threshold is set to 0.62.

[0114] After each microcontroller unit wake-up and power characteristic value acquisition, the following decision logic is executed:

[0115] If the risk probability value output by the prediction model is greater than or equal to 0.62, it is determined that there is an unexpected low-voltage reset risk in the current wake-up cycle; if the prediction result is lower than 0.62, it is determined that the reset risk in the current wake-up cycle is low, and the peripheral device and acquisition task can be started according to the normal procedure; all prediction and judgment results are stored in the local storage module as the data source for subsequent adaptive updates of the model.

[0116] In this embodiment, the above steps enable the prediction of potential reset risks in the early stages of microcontroller wake-up in a precise quantitative manner, allowing for early adjustment of wake-up behavior and optimization of peripheral startup sequence, thereby effectively improving the operational stability and data continuity of soil sensor nodes.

[0117] Peripheral delay scheduling module: During the Bootloader stage of MCU startup, the peripheral startup scheduling strategy is dynamically executed based on the reset risk assessment results; among them, for cycles with high reset risk, high-power or non-critical modules are delayed in startup, and low-power or critical task modules are loaded first.

[0118] In this embodiment, to prevent unexpected low-voltage resets caused by sudden voltage drops or load surges during microcontroller unit startup, a preset peripheral startup scheduling strategy is used to dynamically adjust the power-on sequence of different types of external devices between the microcontroller unit's wake-up from sleep mode and the start-up phase. This strategy is based on a reset risk assessment and prioritizes the activation of critical low-power devices while delaying or postponing the startup of high-power non-critical peripherals. This reduces instantaneous current peaks and enhances overall startup stability. This scheduling method primarily operates in the bootloader phase of the microcontroller unit startup process. The specific technical implementation steps are as follows:

[0119] In the hardware design of sensor nodes, all controllable peripherals are pre-classified into different startup levels based on their functional importance and operating power consumption during the program initialization phase. The classification criteria are as follows:

[0120] Category 1 peripherals: mission-critical peripherals, low-power devices; including: soil temperature and humidity sensor, built-in clock module, configuration register accessor; startup current less than 5 mA; startup priority set to 1; regardless of risk level, they must be loaded first.

[0121] Category 2 peripherals: medium power consumption, functionally necessary peripherals; including: conductivity sensor, pH sensor, SPI memory; startup current between 5 and 15 mA; startup priority set to 2; parallel loading only when the risk of reset is low.

[0122] Category 3 peripherals: High-power, non-critical peripherals; including: LoRa communication modules, 4G modules, LED display devices; startup current greater than 20 mA; startup priority set to 3; delayed loading or complete disable loading in cases of high reset risk. The lower the priority number, the earlier the startup order.

[0123] Based on the reset risk probability value output by the aforementioned logistic regression model, this value is mapped to the startup strategy during the bootloader stage, with the specific rules as follows:

[0124] If the risk probability value is less than 0.4, it is defined as a low-risk level;

[0125] If the risk probability value is between 0.4 and 0.62, it is defined as a medium risk level;

[0126] If the risk probability value is greater than or equal to 0.62, it is defined as a high-risk level.

[0127] To address the three risk levels mentioned above, three startup scheduling tables are pre-defined to control the loading order and time delay of peripheral devices, respectively:

[0128] Boot scheduler construction method: Each peripheral boot table entry includes three parameters: boot time offset (in milliseconds); boot priority; boot enable flag (Boolean value);

[0129] For example, at a high-risk level, the startup time offset of the communication module is set to 300 milliseconds, the startup priority is 3, and the startup permission flag is "No"; while the startup time offset of the temperature and humidity sensor is 0 milliseconds, the priority is 1, and the startup permission flag is "Yes". This scheduling table is statically stored in the software as a structure array, and the Bootloader calls the corresponding table entry by resetting the risk value.

[0130] When the microcontroller unit enters the Bootloader stage, the following operations are performed: Risk value reading and judgment: Read the reset risk probability value obtained from the previous wake-up process; judge its corresponding risk level (low, medium, high); call the corresponding schedule table: start the schedule table according to the risk level index; traverse the peripheral startup list according to the priority order in the schedule table; delay the execution of peripheral loading: for each peripheral marked "allow startup", read its startup delay time; execute the delay function, wait for the specified time, and initialize the peripheral; if the peripheral is marked "disable startup", skip the initialization process of the device in this startup cycle; after the peripheral is initialized, set its status flag to "enabled".

[0131] The scheduling logic described above is implemented through a combination of Boolean judgments, time control functions (such as timer interrupts), and peripheral initialization functions.

[0132] During peripheral device scheduling, any of the following anomalies should be recorded in non-volatile storage for later analysis: peripheral device initialization failure or timeout; actual current exceeding the upper limit preset value (e.g., 80 mA) during startup; abnormal response of the communication module after delayed startup. The record should include the peripheral device number, risk level, actual startup time, peak current, etc. Based on historical anomaly records, developers can adjust the startup delay time or enable / disable flags of each device in the scheduling table to continuously optimize startup stability.

[0133] By using the reset risk probability value as a dynamic input to control the loading order and delay time of peripherals, the instantaneous voltage dip caused by multiple high-power devices starting up simultaneously in the early stage of wake-up is avoided, significantly reducing the probability of unexpected low-voltage reset events.

[0134] In the experimental scenario, the low-voltage reset rate of the nodes using this delayed scheduling method decreased from 8.2% before optimization to 1.1%, effectively improving the continuous and stable operation capability of the system.

[0135] Update module: Records the results of DWVG, ILAF, peripheral scheduling strategy and whether a reset occurs in each wake-up cycle as sample data, and dynamically updates the nonlinear prediction model through rolling learning.

[0136] In this embodiment, to improve the accuracy of the nonlinear prediction model in identifying microcontroller unit reset risks and enhance its adaptability to feature shifts caused by changes in the external environment, power state fluctuations, and hardware aging during long-term operation, a dynamic update method based on rolling learning is used to incrementally train and optimize the model. The specific implementation steps are as follows:

[0137] After the wake-up cycle of each microcontroller unit ends, training samples are collected and constructed in the following manner:

[0138] Read the dynamic wake-up voltage gradient value of this cycle. This value is obtained by collecting the voltage extreme values ​​in two fixed time windows before and after wake-up, and calculating the voltage difference by dividing the time difference. The unit is millivolts per millisecond.

[0139] Read the instantaneous load initiation factor value for this cycle. This value is obtained by integrating and normalizing the current in the high load range after wake-up, and represents the load impact degree of unit current per unit time.

[0140] Record the peripheral scheduling policy identifier used in the current cycle, including the startup priority, delay time and activation status of each peripheral;

[0141] Record whether an unexpected low-voltage reset event occurs during this cycle. If it occurs, the corresponding label value for the sample is "1", otherwise it is "0".

[0142] The above four data items are packaged into a set of training sample data with a fixed structure. The data format includes two continuous features (dynamic wake-up voltage gradient and instantaneous load start-up factor), one enumerated policy feature (peripheral scheduling policy number), and one binary label variable (whether to reset).

[0143] All generated training sample data is temporarily stored in a local circular buffer with a first-in, first-out (FIFO) structure and a capacity of 100 data sets. Each time a new sample is generated, it is automatically appended to the end of the buffer.

[0144] When the number of new samples accumulated in the cache reaches the preset lower limit of the update batch, and the time interval between the last model update and the current update exceeds a preset minimum period (e.g., 1 hour), the rolling update process of the nonlinear prediction model is triggered. The recommended minimum update batch size is 10 samples to ensure that each update is representative and gradient stable.

[0145] The nonlinear prediction model is a set of trained and optimized logistic regression extension models, whose input includes five features:

[0146] First characteristic: Dynamic wake-up voltage gradient;

[0147] Second characteristic: Instantaneous load initiation factor;

[0148] Third feature: The product of the first two features;

[0149] Fourth feature: One-hot encoded vector of peripheral scheduling strategy number;

[0150] Fifth feature: The square term of the dynamic wake-up voltage gradient and the load initiation factor (used to enhance nonlinear expression capability).

[0151] The initial model is generated through offline training using a preloaded training set, has a fixed structure, and is not reconstructed in the field deployment environment.

[0152] During the dynamic update phase, a rolling learning algorithm is used to incrementally optimize the existing model weights without resetting the model structure and initial parameters. The rolling learning method used is a stochastic gradient descent algorithm with L2 regularization, i.e.:

[0153] For each new sample, calculate the cross-entropy loss between the model's predicted value and the label value;

[0154] Adjust parameters using the gradient direction of the current sample;

[0155] After all samples are completed, all weights are updated once to correct the model classification boundary.

[0156] The learning rate was set to 0.01 and the regularization coefficient was set to 0.001 to avoid overfitting.

[0157] The update process runs during the microcontroller's non-collection cycle and has no blocking effect on the main business process.

[0158] After the model update is completed, the adjusted model parameters (including weight vectors and bias terms) are written to the non-volatile storage area of ​​the microcontroller unit, such as on-chip Flash or external EEPROM, along with an update timestamp.

[0159] At the start of the next microcontroller unit startup or wake-up cycle, the program prioritizes loading the latest version of the model parameters and uses these parameters to predict the reset risk probability of the feature values ​​for the current cycle, guiding the peripheral loading strategy.

[0160] In this embodiment, by continuously introducing real samples during operation and combining them with a rolling learning algorithm to perform low-cost and lightweight dynamic optimization of the nonlinear prediction model, the model has a good adaptability to power supply fluctuation trends, peripheral configuration changes and feature drift caused by node aging, effectively improving the accuracy of reset risk judgment and the stability of node operation.

[0161] To verify whether the nonlinear prediction model based on dynamic wake-up voltage gradient and instantaneous load initiation factor can effectively improve the accuracy of reset risk prediction for microcontroller units during the wake-up process after adopting the dynamic update method of this application, the following experimental design was conducted:

[0162] Hardware platform: It adopts an STM32L432 low-power microcontroller and is equipped with a LoRa communication module, a soil multi-parameter sensor and a dynamic power sampling module;

[0163] Power supply method: Solar panel + lithium battery combination, simulating the situation of unstable power supply for several consecutive days of cloudy and rainy weather;

[0164] Data sampling frequency:

[0165] Both voltage and current sampling frequencies are 1kHz;

[0166] The wake-up cycle is set to once every 15 minutes;

[0167] Experiment duration: 7 days in total, with a total of approximately 672 wake-up cycles;

[0168] Reset determination method: The Brown-OutReset is determined by the independent watchdog flag bit inside the MCU.

[0169] Experimental and control group setup:

[0170]

[0171] The core evaluation indicators include:

[0172] Reset risk prediction accuracy: the consistency between the model's predicted value and whether a reset actually occurs;

[0173] False alarm rate: The proportion of cases that are not reset but are predicted as reset;

[0174] False negative rate: The proportion of actual resets that were not predicted by the model;

[0175] Model stability trend: Whether the model's prediction accuracy remains the same or improves over time.

[0176] Experimental Results Data Statistics (Summary):

[0177]

[0178] The results of this embodiment demonstrate that the nonlinear prediction model incorporating the rolling learning method can achieve automatic local updates and parameter fine-tuning by continuously collecting key features of each wake-up cycle (dynamic wake-up voltage gradient, instantaneous load initiation factor, peripheral scheduling strategy, and whether a reset occurs). Within a 7-day experimental period, the experimental group model improved accuracy by approximately 7.5% without reconstruction, and reduced the false negative rate by over 30 percentage points, significantly enhancing the system's ability to predict Brown-Out Reset risks and effectively supporting the accuracy of subsequent peripheral delay scheduling decisions.

[0179] Therefore, the proposed dynamic update method has good real-time adaptability and algorithm convergence performance, and has significant technological advancement and practical value.

[0180] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A dynamic monitoring system for garden soil layers based on a multi-parameter soil sensor network, characterized in that: include: Sensor node deployment module: Several sensor nodes are deployed in different areas and at different depths of the garden soil, and each sensor node integrates a microcontroller unit (MCU). Power status sensing parameter acquisition module: In the sensor node, power supply voltage change data and peripheral startup instantaneous current data are collected in real time before and after MCU wake-up; among them, dynamic wake-up voltage gradient DWVG is calculated based on the collected voltage data, and instantaneous load startup factor ILAF is calculated based on the current data; Reset Risk Modeling and Assessment Module: The DWVG and ILAF are used as input feature values ​​and input into a preset nonlinear prediction model to calculate and assess the risk of unexpected low-voltage reset of the MCU during the wake-up process; if the output reset risk probability value exceeds the preset threshold, it is determined that there is a reset risk in the current wake-up cycle; Peripheral delay scheduling module: During the Bootloader stage of MCU startup, the peripheral startup scheduling strategy is dynamically executed based on the reset risk assessment results; among them, for cycles with high reset risk, high-power or non-critical modules are delayed in startup, and low-power or critical task modules are loaded first. Update module: Records the results of DWVG, ILAF, peripheral scheduling strategy and whether a reset occurs in each wake-up cycle as sample data, and dynamically updates the nonlinear prediction model through rolling learning.

2. The garden soil layer dynamic monitoring system based on a multi-parameter soil sensor network according to claim 1, characterized in that: in, The sensor nodes are deployed according to the principles of soil type, vegetation cover differences, terrain structure and management functional zone division of garden soil, and multiple nodes at different depths are set in each area along the vertical direction to achieve layered monitoring of the environmental status of surface, middle and deep soil layers.

3. The garden soil dynamic monitoring system based on a multi-parameter soil sensor network according to claim 1, characterized in that: in, The sensor node integrates a soil temperature sensor, a soil moisture sensor, a soil conductivity sensor, and a soil pH sensor; and each sensor is connected to the microcontroller unit through a low-power control circuit.

4. The garden soil dynamic monitoring system based on a multi-parameter soil sensor network according to claim 1, characterized in that: in, The dynamic wake-up voltage gradient is obtained by calculating the difference between the maximum and minimum voltage values ​​and dividing it by the time interval within a sampling window of 10 milliseconds before and after MCU wake-up.

5. The garden soil layer dynamic monitoring system based on a multi-parameter soil sensor network according to claim 1, characterized in that: in, The instantaneous load start-up factor is obtained by integrating the sampling points that exceed the reference no-load current threshold within a set time window after the MCU is woken up, and normalizing the integral value into an instantaneous load start-up factor per unit current and per unit time.

6. The garden soil dynamic monitoring system based on a multi-parameter soil sensor network according to claim 1, characterized in that: in, The nonlinear prediction model is an extended logistic regression model with a regularization term. The input features include dynamic wake-up voltage gradient, instantaneous load initiation factor, the product of the two, scheduling strategy encoding, and the square of each feature. The output value is a reset risk probability value between 0 and 1.

7. The garden soil layer dynamic monitoring system based on a multi-parameter soil sensor network according to claim 6, characterized in that: in, The peripheral device startup scheduling strategy is divided into three levels—low risk, medium risk, and high risk—based on the reset risk probability value, and calls the corresponding peripheral device startup scheduling table to control the startup time delay, priority order, and activation status of different peripheral devices.

8. The garden soil dynamic monitoring system based on a multi-parameter soil sensor network according to claim 1, characterized in that: in, The rolling learning method employs a stochastic gradient descent algorithm with L2 regularization. It performs incremental parameter updates on newly added sample data without resetting the model structure. The update cycle and sample quantity are automatically triggered when they reach preset conditions.

9. The garden soil dynamic monitoring system based on a multi-parameter soil sensor network according to claim 8, characterized in that: in, Each set of sample data used for model updates includes the dynamic wake-up voltage gradient of the current cycle, the instantaneous load start-up factor, the peripheral start-up strategy number adopted, and a tag value indicating whether an unexpected low-voltage reset has occurred. The sample data is stored in a structured manner in the microcontroller's non-volatile cache.

10. The garden soil dynamic monitoring system based on a multi-parameter soil sensor network according to claim 1, characterized in that: in, The power status sensing parameter acquisition module is located in the main control circuit board of the sensor node. It includes a high-precision voltage divider sampling network and a low-resistance current detection resistor connected in parallel with the power path, and is respectively connected to the analog-to-digital conversion channel of the microcontroller unit to realize high-frequency sampling of the power supply voltage and current during the wake-up phase.