Plant day and night liquid flow change point measurement method based on piecewise linear model
By using a piecewise linear model and multiple environmental variable change point detection, the diurnal sap flow variation points of plants are identified, solving the problem of inaccurate diurnal sap flow definition and achieving accurate measurement of diurnal sap flow variation points.
Patent Information
- Application Number
- CN202511540904.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-27
- Publication Date
- 2026-01-09
AI Technical Summary
In existing technologies, the points of diurnal fluid flow variation are not accurately defined, and the synergistic effects of multiple environmental factors are not fully considered, resulting in insufficient scientific rigor and repeatability.
Using a piecewise linear model and multiple variable point detection methods, combined with environmental variables such as wind speed, temperature, soil temperature, humidity, and solar radiation, the diurnal sap flow variation points of plants were identified by the maximum likelihood method.
It significantly improves the accuracy of defining diurnal sap flow variation points, adapts to seasonal and weather dynamics, and provides a standardized research method for different plant species.
Smart Images

Figure CN121301699A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of plant physiological and ecological monitoring technology, and in particular relates to a method for measuring the diurnal sap flow change points of plants based on a piecewise linear model. Background Technology
[0002] In plant physiological and ecological research, plant sap flow is a key indicator reflecting plant water absorption, transport, and transpiration. Its diurnal variation is of great significance for revealing the interaction mechanisms between plants and the environment. Accurately defining the diurnal sap flow variation points is a prerequisite for in-depth analysis of the differences between plant daytime growth metabolism and nighttime physiological activities.
[0003] Traditional methods for defining diurnal sap flow change points have two main limitations: one is the use of fixed time points (e.g., 6:00 AM as the early morning change point and 6:00 PM as the evening change point), but plant sap flow is affected by various factors such as season, weather, and species characteristics, and fixed times cannot adapt to its dynamic changes, easily leading to definitional errors; the other is based on only a single environmental factor (e.g., determining nighttime when total radiation is 0), however, sap flow changes are the result of the combined effects of multiple environmental factors such as air temperature, soil temperature, and saturated water vapor pressure difference, and a single factor is difficult to reflect the true physiological transition.
[0004] In existing technologies, some studies have attempted to optimize fluid flow correlation analysis through data-driven methods, but these often focus on fluid flow prediction rather than defining change points. Furthermore, a standardized process integrating multiple environmental factors and based on statistical models has not been established, resulting in insufficient scientific rigor and reproducibility in the diurnal fluid flow division. Therefore, there is an urgent need for a method to measure diurnal change points that can integrate the influence of multiple environmental factors and quantify the fluid flow variation patterns through a segmented model. Summary of the Invention
[0005] To address the problems of inaccurate definition of diurnal sap flow change points and insufficient consideration of the synergistic effects of multiple environmental factors in existing technologies, this invention aims to provide a method for measuring diurnal sap flow change points in plants based on a piecewise linear model. This method mainly uses a piecewise linear model and multiple change point detections to achieve accurate identification of diurnal sap flow change points in plants, providing a reliable technical means for plant physiological and ecological research.
[0006] The technical solution of this invention is: The method of the present invention includes the following steps: S1. Collect continuous time-series data of various environmental variables and plant sap flow as raw time-series data, and preprocess the raw time-series data to construct the initial dataset; S2. Perform Pearson correlation test on the initial dataset to obtain the correlation results between each environmental variable and the plant sap flow data. Based on the correlation results, select several environmental variables and then construct the training sample dataset. S3. Use the maximum likelihood method to detect change points in the training dataset and construct a likelihood function containing change points. Solve the likelihood function containing change points to obtain the diurnal sap flow variation points of the plant.
[0007] Environmental variables include wind speed, wind direction, temperature, soil temperature at different depths, humidity, solar radiation, precipitation, and saturated water vapor pressure difference.
[0008] The preprocessing in step S1 includes outlier removal, missing value filling, error correction, standardization, and temporal alignment of plant sap flow with continuous time-series data of environmental variables.
[0009] Step S2 specifically involves: S2.1. Pre-set a reference time period, and perform Pearson correlation tests on each environmental variable and plant sap flow in the reference time period of the training sample dataset to obtain the correlation coefficients between each environmental variable and plant sap flow. S2.2. Combine the correlation coefficients between various environmental variables and plant sap flow to select several environmental features as several input features; S2.3 Align the plant sap flow data with each input feature in time to obtain a candidate training dataset. Then, perform a generalized fluctuation test on the candidate training dataset to obtain the test result. If the test result is greater than the preset threshold, the candidate training dataset is used as the training dataset; otherwise, return to step S1.
[0010] Step S3 specifically involves: S3.1. Traverse each time point in the training dataset as a candidate variable point, establish a linear fitting model for the data in the training dataset before and after the candidate variable point, and calculate the sum of squared residuals and standard deviation before and after the variable point. S3.2. Solve the likelihood function containing the change point based on the sum of squares and standard deviation of the residuals before and after the change point. Calculate the value of the likelihood function containing the change point and take the candidate change point with the maximum value of the likelihood function containing the change point as the point of change of plant diurnal sap flow.
[0011] The likelihood function containing the change point in step S3 is set according to the following formula: = in, Let represent the likelihood function value at the k-th time point as a candidate change point, and let i represent the sample index at that time point. , This represents the fluid flow observation value at the i-th time point in the training dataset. and These represent the mean parameters of the fluid flow before and after the change point, respectively. This represents the variance of the error term.
[0012] In step S3.2, the value of the likelihood function containing the variable point is obtained by converting the likelihood function containing the variable point into a negative logarithmic form.
[0013] Specifically, step S2.2 involves using the correlation coefficients between various environmental variables and plant sap flow, as well as the environmental characteristics corresponding to the diurnal variation in the correlation between plant sap flow and the same environmental factor, as input features, where both are greater than a preset threshold.
[0014] The beneficial effects of this invention are: 1. This invention comprehensively considers the synergistic effects of multiple environmental factors such as air temperature, total radiation, and saturated water vapor pressure difference on liquid flow. By quantifying the relationship differences before and after the change point through a piecewise linear model, it overcomes the limitations of traditional methods that rely on fixed time or a single factor, and significantly improves the accuracy of defining the diurnal liquid flow change point.
[0015] 2. This invention is applicable to different plant species and can adapt to dynamic changes such as seasons and weather, providing a standardized method for plant physiological research in different scenarios. Attached Figure Description
[0016] Figure 1 This is a flowchart illustrating the process of acquiring and verifying diurnal sap flow variations in plants in this embodiment; Figure 2 This is a correlation analysis diagram of environmental variables and fluid flow in this embodiment; Figure 3 This is a description of the variable point location and the fitting effect of the piecewise linear model in this embodiment. Detailed Implementation
[0017] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0018] like Figure 1 As shown, this embodiment includes the following steps: S1. Simultaneously collect continuous time-series data of various environmental variables and plant sap flow as raw time-series data, and preprocess the raw time-series data to construct the initial dataset; In this embodiment, continuous time-series data of sap flow from 107 poplar trees and corresponding environmental variables (wind speed, air temperature, soil temperature, total radiation, saturated vapor pressure difference, air humidity, and precipitation) were synchronously collected at equal time intervals. The raw time-series data was then preprocessed to obtain an initial dataset. The preprocessing of the raw data included handling outliers and missing values in the sap flow data and environmental variables to ensure data continuity and accuracy. Plant sap flow refers to the water transport activity occurring in the stems of plants, primarily trees, and is typically described by sap flow density (cm³·cm²h¹).
[0019] In practice, the initial data collected by the stem flow meter is usually a temperature difference value, which needs to be converted into sap flow density, reflecting the sap flow rate of the plant, using a specific formula. Calculation of the dimensionless parameter K: ΔT is the real-time temperature difference value (°C); ΔT max This represents the maximum temperature difference (°C) when the liquid flow rate is close to 0. It is typically the average temperature difference during the nighttime period (e.g., 22:00-4:00 the next day) when there is no transpiration, or the minimum value extracted from a sliding window of data (24 hours) spanning 7 consecutive days. Based on Granier's empirical formula: Among them, 0.579 and 1.231 are empirical coefficients, which are applicable to most broad-leaved tree species (such as Populus 107).
[0020] S2, such as Figure 2 As shown, Pearson correlation test was performed on each environmental variable and plant sap flow data in the initial dataset to obtain the correlation results between each environmental variable and plant sap flow data. Based on the correlation results, several environmental variables were selected, and then the training sample dataset was constructed by combining the environmental variables. Visual analysis of the sap flow status of the target tree species was conducted, and two time periods, determined to be nighttime and daytime, were selected as reference time periods. In this embodiment, 10:00-15:00 and 22:00-3:00 were chosen. Pearson correlation tests were performed on the sap flow data and various environmental data during the reference time periods. Two or three features with relatively high correlation coefficients and significant diurnal differences were extracted as input features for subsequent change point detection and model construction. The obtained environmental data and sap flow data were aligned to generate a training dataset. Simultaneously, a generalized fluctuation test was used to verify the structural changes in the data within the sample, ensuring that there were significant segmented differences (P<0.05) in the linear relationship between sap flow and environmental factors, providing a prerequisite for segmented modeling. (See attached figure.) Figure 3 As shown, the correlation analysis between environmental variables and fluid flow in this embodiment is illustrated.
[0021] S3. Use the maximum likelihood method to detect change points in the training dataset and construct a likelihood function containing change points. Solve the likelihood function containing change points to obtain the diurnal sap flow variation points of the plant.
[0022] Specifically, the maximum likelihood method is used to detect change points in the samples within a day, identifying the inflection points in the relationship between fluid flow data and environmental factors. When defining the negative log-likelihood function, the proportion of change points (i.e., the proportion of change point locations to the total data) is first input. Based on this, the change point index is calculated, and this index is restricted to avoid the first and last 5% of the data to prevent boundary effects. Then, the data is divided into two segments according to the change point index. A linear model is fitted to the two segments, and the corresponding residuals (resid1, resid2) and standard deviations (sigma1, sigma2) are calculated. Then, based on the normal distribution assumption, the formula "Negative log-likelihood = ∑(data volume × log(σ) + sum of squared residuals / (2σ)" is used. 2 ))” Calculate the sum of the negative log-likelihoods of the two data segments; when searching for the optimal change point, minimize the negative log-likelihood function within the range of 0.15-0.85 (avoiding data boundaries) to obtain the optimal change point proportion, and convert it into the corresponding change point index and time.
[0023] Environmental variables include wind speed, wind direction, temperature, soil temperature at different depths (10cm, 20cm, 40cm, 60cm), humidity, solar radiation, precipitation, and saturated water vapor pressure difference. The diurnal sap flow change point refers to the characteristic inflection point that occurs when the sap flow trend changes from transpiration to stem rehydration after the stomata close and transpiration tends to end. It is used to identify the critical time point of the diurnal sap flow mechanism change.
[0024] The preprocessing in step S1 includes outlier removal, missing value filling, error correction, standardization, and temporal alignment of plant sap flow with continuous time-series data of environmental variables.
[0025] Step S2 specifically involves: S2.1. Pre-set a reference time period, and perform Pearson correlation tests on each environmental variable and plant sap flow in the reference time period of the training sample dataset to obtain the correlation coefficients between each environmental variable and plant sap flow. S2.2. Based on the correlation coefficients between various environmental variables and plant sap flow, several environmental features are selected as several input features; S2.3 Align the plant sap flow data with each input feature in time to obtain a candidate training dataset. Then, perform a generalized fluctuation test on the candidate training dataset to obtain the test result. If the test result is greater than the preset threshold, the candidate training dataset is used as the training dataset; otherwise, return to step S1.
[0026] Step S3 specifically involves: S3.1. Traverse each time point in the training dataset as a candidate variable point, establish a linear fitting model for the data in the training dataset before and after the candidate variable point, and calculate the sum of squared residuals and standard deviation before and after the variable point. S3.2. Solve the likelihood function containing the change point based on the sum of squares and standard deviation of the residuals before and after the change point. Calculate the value of the likelihood function containing the change point and take the candidate change point with the maximum value of the likelihood function containing the change point as the point of change of plant diurnal sap flow.
[0027] The likelihood function containing the change point in step S3 is set according to the following formula: = in, Let represent the likelihood function value at the k-th time point as a candidate change point, and let i represent the sample index at that time point. , This represents the fluid flow observation value at the i-th time point in the training dataset. and These represent the mean parameters of the fluid flow before and after the change point, respectively. This represents the variance of the error term, where n is the total number of samples.
[0028] In this embodiment, the value of the likelihood function containing the variable point in step S3.2 is specifically obtained by converting the likelihood function containing the variable point into a negative logarithmic form.
[0029] Specifically, step S2.2 involves using the correlation coefficients between various environmental variables and plant sap flow, as well as the environmental characteristics corresponding to the diurnal variation in the correlation between plant sap flow and the same environmental factor, as input features, where both are greater than a preset threshold.
[0030] This embodiment constructs a piecewise linear model to perform multi-dimensional evaluation and verification of the obtained fluid flow change points. First, the data is divided into two segments: before and after the change point, based on the optimal change point time obtained in step 3. Then, sklearn.LinearRegression is used to fit linear models (model1 and model2) for the two segments of data, respectively. The model form is as follows: (in The intercept is... ~ (These are characteristic coefficients), used to quantify the differences in the impact of environmental factors on fluid flow before and after the change point. See attached figure. Figure 3 As shown, the variable point positions and the fitting effect of the piecewise linear model in this embodiment are illustrated.
[0031] The effectiveness of the model was then evaluated using four methods: Firstly, regarding the basic assessment, since fluid flow data is significantly affected by sensor errors and environmental noise, MSE can quantify the model's accuracy in fitting the "true pattern." More than 70% of the diurnal variation in fluid flow should be explainable by environmental factors. R 2 A value close to 1 indicates that the model truly captures this dominant "environment-fluid flow" relationship, rather than being a random fit; if R0... 2 If the value is too low (e.g., <0.6), it indicates that the changepoint division may be out of sync with the actual day-night cycle. MSE and The following formulas were used to calculate the results respectively: in, This represents the actual fluid flow value. is the model's predicted value, and n is the sample size.
[0032] in, The numerator is the mean of the actual fluid flow values, the numerator is the sum of squared residuals (SSE), and the denominator is the sum of squared totals (SST).
[0033] Secondly, the t-test is used. The core difference in diurnal sap flow in plants lies in the "role switching" of driving factors. For example, in Populus 107 in this case, daytime radiation is the primary driving factor (coefficient β_Rad is significantly positive), while after nighttime radiation disappears, temperature and VPD become dominant. The necessity of the t-test lies in quantifying the significance of this role switching. The t-statistic is calculated for each coefficient of the two models according to the following formula: In the formula, , These are the same characteristic coefficients of the model before and after the change point, such as the coefficients of the Radiation Rad; They are respectively , The standard error reflects the uncertainty in coefficient estimation; the degrees of freedom are approximately 1. ( (where p represents the number of features in the two sample segments). The p-value is calculated using a t-distribution. If p < 0.05, the coefficients are significantly different.
[0034] Thirdly, the F-test is used to verify whether the day-night segmentation is truly superior to the global fit by comparing the sum of squared residuals of the segmented model and the global model. The statistic F = ((SSE global − SSE segment) / difference in degrees of freedom) / (SSE segment / degrees of freedom of the segmented model). If the p-value is less than 0.05, it indicates that the segmented model is significantly better and that the day-night segmentation is scientifically significant.
[0035] Fourthly, permutation tests are used. Random fluctuations in environmental variables, such as sudden rainfall or instantaneous high temperatures, may cause temporary deviations in fluid flow patterns, creating one or more spurious change points. For example, a sudden drop in fluid flow caused by an afternoon gust of wind might be mistakenly identified as an evening change point. In such cases, permutation tests can help eliminate the interference of random events and pinpoint the true physiological rhythm change point. Permutation tests do not have a fixed formula, but the core principle is to calculate the p-value by statistically analyzing "extreme cases" to verify whether the obtained change point is merely a coincidence. In this case, p = (number of extreme cases + 1) / (total number of permutations + 1), where the number of extreme cases refers to the number of times the likelihood value of the new change point is better than the likelihood value of the original change point after shuffling the data. The total number of permutations is taken as 1000. If p < 0.05, then the original change point is not random noise.
[0036] The above four types of tests, from the four dimensions of fitting accuracy, driving mechanism change, necessity of segmentation and anti-interference, verify the consistency between the change point division and the diurnal sap flow pattern of plants, ensuring that the result is not only the mathematically optimal solution, but also a true reflection of the plant physiological-environment interaction mechanism.
[0037] Table 1 shows the basic assessment and F-test results for the change points on a certain day in this embodiment. Table 2 shows the t-test results for the change points on a certain day in this embodiment. On the annual dataset of Yang 107, by randomly selecting 5 days of samples each month according to the season for testing, it was found that the average of the diurnal variation points in each month on the annual scale is consistent with the seasonal activity pattern of plants: In spring, the change point is around 5:00-6:00 in the early morning and around 18:20-19:00 in the evening, when plants germinate and grow, and sap flow is sensitive to light; In summer, the change point is around 4:20-5:40 in the early morning and around 19:10-20:00 in the evening, when the day length increases and the light is strong, and the period of active sap flow is prolonged; In autumn, the change point is around 6:00-7:10 in the early morning and around 17:30-19:00 in the evening, when growth slows down, and the period of active sap flow is earlier as the day length shortens; In winter (December-February), the change point is mostly after 7:00 in the early morning and around 17:00-18:30 in the evening, when the sap flow activity decreases at low temperatures, and the change point time is consistent with the trend of shortening daylight. This results in a more flexible and dynamic division of day and night on an annual scale.
[0038] To further verify the applicability of the method, change point detection was attempted in two typical day-night division periods (4:00-10:00 AM and 4:00-10:00 PM) during the experiment. At the same time, preliminary tests were conducted on datasets from different dates and on a small number of other tree species (such as other varieties of poplar). The results showed that the method can stably output the division points.
[0039] The specific embodiments described above are only for explaining the present invention and are not intended to limit the present invention. Those skilled in the art can make various modifications and improvements without departing from the principles and core concepts of the present invention. Any equivalent substitutions, modifications, and similar solutions made based on the claims and description of the present invention are within the protection scope of the present invention.
Claims
1. A method for measuring diurnal sap flow variation points in plants based on a piecewise linear model, characterized in that, The method includes the following steps: S1. Collect continuous time-series data of various environmental variables and plant sap flow as raw time-series data, and preprocess the raw time-series data to construct the initial dataset; S2. Perform Pearson correlation test on the initial dataset to obtain the correlation results between each environmental variable and the plant sap flow data. Based on the correlation results, select several environmental variables and then construct the training sample dataset. S3. Use the maximum likelihood method to detect change points in the training dataset and construct a likelihood function containing change points. Solve the likelihood function containing change points to obtain the diurnal sap flow variation points of the plant.
2. The method for measuring diurnal sap flow variation points in plants based on a piecewise linear model according to claim 1, characterized in that: Environmental variables include wind speed, wind direction, temperature, soil temperature at different depths, humidity, solar radiation, precipitation, and saturated water vapor pressure difference.
3. The method for measuring diurnal sap flow variation points in plants based on a piecewise linear model according to claim 1, characterized in that: The preprocessing in step S1 includes outlier removal, missing value filling, error correction, standardization, and temporal alignment of plant sap flow with continuous time-series data of environmental variables.
4. The method for measuring diurnal sap flow variation points in plants based on a piecewise linear model according to claim 1, characterized in that: Step S2 specifically involves: S2.
1. Pre-set a reference time period, and perform Pearson correlation tests on each environmental variable and plant sap flow in the reference time period of the training sample dataset to obtain the correlation coefficients between each environmental variable and plant sap flow. S2.
2. Combine the correlation coefficients between various environmental variables and plant sap flow to select several environmental features as several input features; S2.3 Align the plant sap flow data with each input feature in time as a candidate training dataset, and then perform a generalized fluctuation test on the candidate training dataset to obtain the test result. If the test result is greater than the preset threshold, the candidate training dataset is used as the training dataset. Otherwise, return to step S1.
5. The method for measuring diurnal sap flow variation points in plants based on a piecewise linear model according to claim 1, characterized in that: Step S3 specifically involves: S3.
1. Traverse each time point in the training dataset as a candidate variable point, establish a linear fitting model for the data in the training dataset before and after the candidate variable point, and calculate the sum of squared residuals and standard deviation before and after the variable point. S3.
2. Solve the likelihood function containing the change point based on the sum of squares and standard deviation of the residuals before and after the change point. Calculate the value of the likelihood function containing the change point and take the candidate change point with the maximum value of the likelihood function containing the change point as the point of change of plant diurnal sap flow.
6. The method for measuring the diurnal sap flow variation points of plants based on a piecewise linear model according to claim 1, characterized in that: The likelihood function containing the change point in step S3 is set according to the following formula: = in, Let represent the likelihood function value at the k-th time point as a candidate change point, and let i represent the sample index at that time point. , This represents the fluid flow observation value at the i-th time point in the training dataset. and These represent the mean parameters of the fluid flow before and after the change point, respectively. This represents the variance of the error term.
7. The method for measuring diurnal sap flow variation points in plants based on a piecewise linear model according to claim 5, characterized in that: In step S3.2, the value of the likelihood function containing the variable point is obtained by converting the likelihood function containing the variable point into a negative logarithmic form.
8. The method for measuring the diurnal sap flow variation points of plants based on a piecewise linear model according to claim 5, characterized in that: Specifically, step S2.2 involves using the correlation coefficients between various environmental variables and plant sap flow, as well as the environmental characteristics corresponding to the diurnal variation in the correlation between plant sap flow and the same environmental factor, as input features, where both are greater than a preset threshold.