Honeycomb weight temperature drift removal system and method based on statistical model and Kalman filter

Through a honeycomb weight temperature drift removal system based on statistical models and Kalman filtering, the problem of insufficient measurement accuracy caused by the temperature drift of the smart beehive weight sensor is solved, achieving higher measurement accuracy and more accurate support for bee colony activities.

CN116305864BActive Publication Date: 2025-05-30HUAZHONG AGRI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310162891.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-22
Publication Date
2025-05-30
Estimated Expiration
2043-02-22

AI Technical Summary

Technical Problem

The temperature drift problem of the smart hive weight sensor leads to insufficient measurement accuracy, affecting the accuracy of colony activity diagnosis and prediction.

Method used

A honeycomb weight temperature drift removal system based on statistical model and Kalman filtering is used to remove the weight data drift caused by temperature through the construction of the temperature drift statistical model, the Kalman filtered state equation and observation equation construction, hyperparameter setting and iterative calculation.

Benefits of technology

Effectively remove the weight data drift caused by temperature, improve the measurement accuracy of the weight sensor, and enhance the basic research on bee colony activities and support for precise beekeeping.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116305864B_ABST
    Figure CN116305864B_ABST
Patent Text Reader

Abstract

The present invention discloses a honeycomb weight temperature drift removal system based on a statistical model and Kalman filtering, which includes a temperature drift statistical model construction module, a Kalman filter state equation construction module, a Kalman filter observation equation construction module, a Kalman filter equation hyperparameter setting module, and an iterative calculation module; The method provided by the embodiments of the present invention uses polynomial fitting to give a statistical model related to temperature, solves the problem of obtaining the dynamic model, and then combines with Kalman filtering to correct the cumulative error caused by inaccurate modeling, so as to achieve the removal of the weight data drift caused by temperature, avoid the problem of insufficient reading accuracy of the weight sensor, and has important significance for the basic research of bee colony activities and precision beekeeping, and has broad application prospects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of sensing measurement, and particularly to a honeycomb weight temperature drift removal system and method based on a statistical model and Kalman filtering. Background Art

[0002] The development of electronic information technology has promoted the intelligence of the beekeeping industry. Among many effective bee colony detection eigenvalues, the most commonly used one is the weight of the honeycomb. The weight of the honeycomb is highly correlated with the growth and activities of the bee colony. For research such as diagnosing and predicting bee colony activities, the measurement accuracy of the weight sensor has a crucial impact on the correctness of the results. However, the readings of the weight sensors used in intelligent beehives are easily affected by the ambient temperature, and there is a lack of relevant means for effectively removing the temperature drift of the weight sensors. Therefore, in the development trend of intelligent beekeeping, how to remove the temperature drift of the weight sensors in intelligent beehives has become an urgent problem to be solved. Summary of the Invention

[0003] The purpose of the present invention is to provide a honeycomb weight temperature drift removal system and method based on a statistical model and Kalman filtering, aiming to solve the problem of insufficient accuracy in obtaining honeycomb weight data by the weight sensors of existing intelligent beehives.

[0004] To achieve this purpose, the honeycomb weight temperature drift removal system based on a statistical model and Kalman filtering designed by the present invention includes a temperature drift statistical model construction module, a Kalman filter state equation construction module, a Kalman filter observation equation construction module, a Kalman filter equation hyperparameter setting module, and an iterative calculation module;

[0005] The temperature drift statistical model construction module is used to fit a temperature drift statistical model by using the weight reading fluctuations of the weight sensor according to the characteristic that the weight of the honeycomb should not change when there are no bees in the beehive;

[0006] The Kalman filter state equation construction module is used to construct a Kalman filter state equation according to the true value of the honeycomb weight, the time variation of the true value of the honeycomb weight, the ambient temperature inside the box, and the time variation of the ambient temperature inside the box;

[0007] The Kalman filter observation equation construction module is used to select the measured value of the honeycomb weight, the time variation of the measured value of the honeycomb weight, the ambient temperature inside the box, and the time variation of the ambient temperature inside the box, and combine with the temperature drift statistical model to construct a Kalman filter observation equation;

[0008] The Kalman filter equation hyperparameter setting module is used to determine the observation noise covariance matrix and the process noise covariance matrix in the Kalman filter state space equation by combining the residuals of the temperature drift statistical model and the measured data of the honeycomb weight and the ambient temperature. The Kalman filter state space equation includes a Kalman filter state equation and a Kalman filter observation equation;

[0009] The iterative calculation module is used to iteratively update the state variables of the Kalman filter state space equation by using the observation noise covariance matrix and the process noise covariance matrix, predict the state estimate value of the state variables of the Kalman filter state space equation at the current moment with the optimal estimate value of the state variables of the Kalman filter state space equation at the previous moment, and then correct the state estimate value at the current moment with the measured value of the honeycomb weight.

[0010] Advantages of the present invention:

[0011] The method provided by the embodiment of the present invention uses polynomial fitting to give a temperature-related statistical model, solves the problem of obtaining the dynamic model, and then combines with the Kalman filter to correct the cumulative error caused by inaccurate modeling, so as to achieve the removal of the weight data drift caused by temperature, avoid the problem of insufficient reading accuracy of the weight sensor, and has important significance for the basic research of bee colony activities and precision beekeeping, and has a wide application prospect. Description of the drawings

[0012] Figure 1 is the principle block diagram of the present invention;

[0013] Figure 2 is the flow chart of the present invention;

[0014] Figure 3 is the schematic diagram of the application effect of the present invention during the period without bees in the beehive;

[0015] Figure 4 is the schematic diagram of the application effect of the present invention during the period with bees in the beehive. Detailed implementation manners

[0016] The following further describes the present invention in detail with reference to the drawings and specific embodiments:

[0017] As Figure 1 and 2 shown, the honeycomb weight temperature drift removal system based on a statistical model and the Kalman filter includes a temperature drift statistical model construction module, a Kalman filter state equation construction module, a Kalman filter observation equation construction module, a Kalman filter equation hyperparameter setting module, and an iterative calculation module;

[0018] The temperature drift statistical model construction module is used to fit a temperature drift statistical model based on the characteristic that the weight of the honeycomb should not change when there are no bees in the beehive, using the weight reading fluctuations of the weight sensor;

[0019] The Kalman filter state equation construction module is used to construct a Kalman filter state equation based on the true value of the honeycomb weight, the time variation of the true value of the honeycomb weight, the temperature inside the box, and the time variation of the temperature inside the box;

[0020] The Kalman filter observation equation construction module is used to select the measured value of the honeycomb weight, the time variation of the measured value of the honeycomb weight, the temperature inside the box, and the time variation of the temperature inside the box, and combine them with the temperature drift statistical model to construct a Kalman filter observation equation;

[0021] The Kalman filter equation hyperparameter setting module is used to determine the observation noise covariance matrix and the process noise covariance matrix in the Kalman filter state space equation respectively by combining the residuals of the temperature drift statistical model and the measured data of the honeycomb weight and the environmental temperature. The observation noise covariance matrix and the process noise covariance matrix are used to characterize the confidence of the drift removal system in the observed value and the predicted value. The Kalman filter state space equation includes the Kalman filter state equation and the Kalman filter observation equation;

[0022] The iterative calculation module is used to iteratively update the state variables of the Kalman filter state space equation using the observation noise covariance matrix and the process noise covariance matrix, predict the state estimate value of the state variables of the Kalman filter state space equation at the current moment using the optimal estimate value of the state variables of the Kalman filter state space equation at the previous moment, and then correct the state estimate value at the current moment with the measured value of the honeycomb weight (the state estimate value at the current moment is the predicted honeycomb weight), that is, the honeycomb weight data with temperature drift removed is obtained.

[0023] In the above technical solution, the specific method for fitting the temperature drift statistical model is: extract the analytical expression of the temperature drift part from multiple groups of measurement data of the weight and temperature of the honeycomb weight sensor when there are no bees. Since the activities of the bee colony will interfere with the model fitting, the measurement data during the period without bees should be selected for fitting. At this time, the true value of the honeycomb weight should remain unchanged, and the fluctuations of the weight measurement values can be regarded as the interference part of the temperature on the weight sensor. The fitted function model is the temperature drift part of the weight sensor, and the analytical expression of the temperature drift part is:

[0024]

[0025] where, W k represents the temperature drift part of the weight sensor at the kth moment; represents the temperature inside the box at the kth moment, Represents the time-varying quantity of the internal environment temperature of the box at time k; a, b, and c are the first regression coefficient, the second regression coefficient, and the third regression coefficient;

[0026] Since the measured data usually cannot match the model exactly, it is necessary to determine the model coefficients by least squares fitting. Assume that the optimal solutions of the first regression coefficient, the second regression coefficient, and the third regression coefficient to be obtained are a * , b * , c * , then the optimal temperature drift regression model expression can be obtained:

[0027]

[0028] Among them, Represents the optimal temperature drift regression model at time k;

[0029] Therefore, the time-varying quantity of the temperature drift part is:

[0030]

[0031] Among them, Represents the time-varying quantity of the temperature drift part at time k, Represents the internal environment temperature of the box at time k - 1, Represents the time-varying quantity of the internal environment temperature of the box at time k - 1;

[0032] Ignoring the second-order change of the internal environment temperature of the box, that is, The value of approaches zero, and the above formula is rewritten as:

[0033]

[0034] The time variable is obtained by subtracting the temperature regression models at different times. Through the regression model of temperature drift, the part of the weight reading affected by temperature can be solved under the known temperature, and then the weight value after removing the temperature drift can be obtained through the difference operation between the weight measurement value and the temperature drift part. However, in practical applications, since there is also noise interference in the reading of the internal environment temperature of the beehive, it is necessary to introduce the temperature drift model into the observation equation of the Kalman filter to achieve the optimal estimation of the above uncertainties.

[0035] In the above technical solution, the specific process of constructing the Kalman filter state space equation is as follows:

[0036] To solve the problem of beehive weight noise reduction using the Kalman filter algorithm, first, appropriate state variables should be selected and the state equation of the system should be established. For the bee colony system, the selected state variables are the true value x of the honeycomb weight W , the time-varying quantity x of the true value of the honeycomb weight ΔW , the internal environment temperature x of the box TThe time variation x of the temperature inside the box ΔT , since within a short period, the changes in the honeycomb weight and the temperature inside the box are relatively stable. Therefore, the time variation of the true value of the honeycomb weight at time k is equal to the sum of the time variation of the true value of the honeycomb weight at time k - 1 and the process noise of the time variation of the honeycomb weight at time k; the time variation of the temperature inside the box at time k is equal to the sum of the time variation of the temperature inside the box at time k - 1 and the process noise of the time variation of the temperature inside the box at time k, and the formulas are as follows respectively:

[0037]

[0038] For the true weight x of the honeycomb W and the temperature x inside the box T , the state equation can be expressed as:

[0039]

[0040] Wherein, represents the true value of the honeycomb weight at time k, represents the true value of the honeycomb weight at time k - 1, represents the time variation of the true value of the honeycomb weight at time k - 1, represents the process noise of the true value of the honeycomb weight at time k; represents the temperature inside the box at time k, represents the temperature inside the box at time k - 1, represents the time variation of the temperature inside the box at time k - 1, represents the process noise of the temperature inside the box at time k;

[0041] In summary, the Kalman filter state equation can be expressed in matrix form:

[0042]

[0043] In the above technical solution, the construction method of the Kalman filter observation equation introducing the temperature drift model is specifically as follows: The observation equation of the Kalman filter is essentially a simulation process of the sensor measurement. The selected observation variables are the measured value z W of the honeycomb weight, the time variation z ΔW of the measured value of the honeycomb weight, the measured value z T of the temperature inside the box, and the time variation z ΔT of the measured value of the temperature inside the box. The weight measurement value The true value of the honeycomb weight at time k The optimal temperature drift regression model at time k And the observation noise at time k The sum, observation noise According to the analysis of the temperature drift model, it is considered that the observation noise of the honeycomb weight at any time is numerically approximately equal to the deviation between the temperature drift model and the measurement data of the honeycomb weight when there are no bees in the box; the time variation of the measured value of the honeycomb weight at time k Is the time variation of the true value of the honeycomb weight at time k The time variation of the temperature drift part at time k And the observation noise The sum; the observation equations of the ambient temperature in the box and its time variation are expressed as follows respectively:

[0044]

[0045] Among them, Represents the measured value of the honeycomb weight at time k, Represents the observation noise of the honeycomb weight at time k, Represents the time variation of the measured value of the honeycomb weight at time k, Represents the time variation of the ambient temperature in the box at time k, Represents the measured value of the ambient temperature in the box at time k, Represents the ambient temperature in the box at time k, Represents the observation noise of the ambient temperature in the box at time k, Represents the time variation of the measured value of the ambient temperature in the box at time k, Represents the observation noise of the time variation of the ambient temperature in the box at time k;

[0046] The matrix form of the Kalman filter observation equation is obtained as:

[0047]

[0048] In the above technical solution, the method for obtaining the observation noise covariance matrix R is: for the observation noise covariance matrix R, the expression form of the observation noise covariance matrix R is obtained from the Kalman filter observation equation and the correlation between noise variables as:

[0049]

[0050] Among them, ν W 、ν ΔW 、ν T And ν ΔT Represent the observation noise of the honeycomb weight, the observation noise of the time variation of the honeycomb weight, the observation noise of the ambient temperature in the box, and the observation noise of the time variation of the ambient temperature in the box respectively;

[0051] Based on the analysis of the temperature drift model, it is considered that the observation noise of the honeycomb weight at time k is numerically approximately equal to the deviation δ between the temperature drift model and the measurement data of the honeycomb weight when there are no bees in the box k . The weighted average of the measurement data of n groups of honeycomb weights and the change amount of the honeycomb weight over time is taken to obtain the optimal value v of the observation noise of the honeycomb weight at each moment W . The expression is as follows:

[0052]

[0053] where represents the measured value of the honeycomb weight at time k;

[0054] The observation noise v of the change amount of the honeycomb weight over time is obtained ΔW as:

[0055]

[0056] where represents the change amount over time of the measured value of the honeycomb weight at time k, represents the change amount over time of the ambient temperature in the box at time k;

[0057] The observation noise v of the ambient temperature in the box T and the observation noise ν of the change amount of the ambient temperature in the box ΔT are directly given by the basic error of the temperature sensor. Thus, the observation noise v of the honeycomb weight W , the observation noise v of the change amount of the honeycomb weight over time ΔW , the observation noise v of the ambient temperature in the box T and the observation noise v of the change amount of the ambient temperature in the box ΔT are all solved, and thus the observation noise covariance matrix R is obtained.

[0058] In the above technical solution, the method for obtaining the process noise covariance matrix Q is as follows: For the process noise covariance matrix Q, since the state variables cannot be directly obtained, its value is usually difficult to determine. In the problem of removing the temperature drift of the beehive weight, the output result of the Kalman filter depends on the accuracy of the state equation. Therefore, the value range of the process noise covariance matrix Q is 0 < Q < 1. An appropriate Q value is selected in combination with the measured values of the state variables to increase the correction effect of the measured values on the state estimation;

[0059] Since the measurement data when there are no bees in the beehive and when there are bees in the beehive are both read by the same weight sensor, and the expression of the prediction equation is the same in both scenarios, the Q value is estimated under the condition of no bees. Because there is no bee colony activity in the box, the state variable x ΔWThe value is 0, and the hive weight at time k is rewritten as:

[0060]

[0061] is the true value of the hive weight at time k, represents the true value of the hive weight at time k - 1, represents the process noise of the hive weight at time k;

[0062] When there are no bees, the predicted hive weight does not change with time. Let the true value of the hive weight during the period without bees in the box be a constant C, then:

[0063]

[0064] In actual measurement, the true value C of the hive weight cannot be obtained. However, through the above analysis, a specific measured value can be used as the prediction of the true value of the hive weight. From the measurement data set, the measured values z of the hive weight at each time are obtained W , because there is no bee colony activity in the box, calculate z W The mathematical expectation of is obtained as:

[0065]

[0066] Among them, represents the mean value of the measured values of the hive weight at each time, represents the measured value of the hive weight at time k;

[0067] Since both the observation noise and the process noise conform to the Gaussian distribution, taking the value of as the prediction of the true value of the hive weight when there are no bees, then the difference between the measured value of the hive weight at time k and and the observation noise and process noise of the hive weight at time k conform to the following relationship:

[0068]

[0069] represents the observation noise of the hive weight at time k, represents the process noise of the hive weight at time k;

[0070] Therefore, the process noise ω of the hive weight W is expressed as:

[0071]

[0072] Similarly, the process noise ω of the change amount of the hive weight ΔW , the process noise ω of the ambient temperature in the box TThe process noise ω of the time variation of the temperature inside the box ΔT Are respectively expressed as:

[0073]

[0074]

[0075] Among them, Represents the mean value of the time variation of the measured value of the honeycomb weight at each moment, Represents the observation noise of the time variation of the measured value of the honeycomb weight at the k-th moment, Represents the measured value of the temperature inside the box at the k-th moment, Represents the measured value of the temperature inside the box at the (k - 1)-th moment, Represents the measured value of the time variation of the temperature inside the box at the (k - 1)-th moment, Represents the observation noise of the temperature inside the box at the k-th moment, Represents the time variation of the measured value of the temperature inside the box at the k-th moment, Represents the time variation of the measured value of the temperature inside the box at the (k - 1)-th moment, Represents the observation noise of the time variation of the measured value of the temperature inside the box at the k-th moment;

[0076] Write the process noise of the honeycomb weight, the process noise of the time variation of the honeycomb weight, the process noise of the temperature inside the box, and the process noise of the time variation of the temperature inside the box in matrix form to obtain the process noise covariance matrix Q.

[0077] In the above technical solution, the specific method for iteratively updating the Kalman filter observation equation and finally calculating the honeycomb weight data after removing the temperature drift is as follows:

[0078] For the matrix form of the Kalman filter state equation;

[0079]

[0080] Let A is called the state matrix;

[0081] Thus, the prediction equation in the Kalman filter iterative calculation process is obtained, and at the same time, the covariance calculation equation including the time recurrence relationship is obtained:

[0082]

[0083] In the formula, And Are the predicted value of the bee colony system state and the Kalman prediction error covariance matrix at the k-th moment;

[0084] represents the optimal state estimate of the system at time k-1 after update, P k-1 represents the Kalman optimal estimation error covariance matrix at time k-1 after update, T represents transpose, A is the state matrix, and Q is the process noise covariance matrix;

[0085] Regarding the matrix form of the Kalman filter observation equation;

[0086]

[0087] Let

[0088] Based on the Kalman filter state equation and the Kalman filter observation equation, the iterative update process of the Kalman filter is given. The update process includes the update of the honeycomb system measurement, the expression of the Kalman gain, and the update of the noise covariance, which is expressed in equation form:

[0089]

[0090]

[0091] In the formula, K k is the Kalman gain; R is the observation noise covariance matrix; and are the predicted value of the system state at time k and the Kalman prediction error covariance matrix; and P k are the optimal state estimate of the system at time k after update (i.e., the honeycomb weight data after removing the temperature drift) and the Kalman optimal estimation error covariance matrix; I is the identity matrix, H represents the gain matrix, z k represents the observation variable, H T represents the transpose of the gain matrix.

[0092] It can be seen from the above formula that in the iterative update process, the predicted value of the state variable at the current time is first predicted from the optimal estimate of the state variable at the previous time, and then the predicted value is corrected by combining the measured value of the state variable at the current time, so as to complete the optimal estimate of the state variable at the current time. Iterate in this way to the subsequent times, and finally complete the optimal estimate of the state variable values at all target times.

[0093] The method for removing the temperature drift of the honeycomb weight based on statistics and the Kalman filter provided by the present invention is verified respectively during the period without bees in the hive and the period with bees in the hive, including the following steps:

[0094] Randomly select an intelligent beehive in the intelligent bee farm, and determine the time without bees and with bees in the hive respectively;

[0095] Select 15 days as the cycle for the experiment because long-term monitoring is usually carried out in actual beekeeping operations. Therefore, choosing 15 days as the observation cycle can make the results more valuable for application;

[0096] Apply the honeycomb weight temperature drift removal method based on statistics and Kalman filtering to the target beehive and observe the application effect;

[0097] The results show that this method not only ensures the accuracy of the Kalman observation equation, but also combines the respective advantages of the statistical model fitting algorithm and the Kalman filtering algorithm. On the basis of Kalman filtering, it can minimize the value of the observation noise matrix and make the updated correction result of Kalman filtering reach the optimal.

[0098] A honeycomb weight temperature drift removal method based on the above system, which includes the following steps:

[0099] Step 1: The temperature drift statistical model construction module fits the temperature drift statistical model using the weight reading fluctuations of the weight sensor according to the characteristic that the honeycomb weight should not change when there are no bees in the beehive;

[0100] Step 2: The Kalman filter state equation construction module constructs the Kalman filter state equation according to the true value of the honeycomb weight, the time variation of the true value of the honeycomb weight, the ambient temperature inside the box and the time variation of the ambient temperature inside the box;

[0101] Step 3: The Kalman filter observation equation construction module selects the measured value of the honeycomb weight, the time variation of the measured value of the honeycomb weight, the ambient temperature inside the box and the time variation of the ambient temperature inside the box, and combines with the temperature drift statistical model to construct the Kalman filter observation equation;

[0102] Step 4: The Kalman filter equation hyperparameter setting module determines the observation noise covariance matrix and the process noise covariance matrix in the Kalman filter state space equation respectively by combining the residuals of the temperature drift statistical model (the difference between the observed value and the predicted value of the regression model) and the measurement data of the honeycomb weight and the ambient temperature. The Kalman filter state space equation includes the Kalman filter state equation and the Kalman filter observation equation;

[0103] Step 5: The iterative calculation module iteratively updates the state variables of the Kalman filter state space equation using the observation noise covariance matrix and the process noise covariance matrix, predicts the state estimate value of the state variables of the Kalman filter state space equation at the current moment using the optimal estimate value of the state variables of the Kalman filter state space equation at the previous moment, and then corrects the state estimate value at the current moment using the measured value of the honeycomb weight, that is, obtains the honeycomb weight data with temperature drift removed.

[0104] The detailed process of the honeycomb weight temperature drift removal method in the present invention is as follows:

[0105] First, according to the measured data of the honeycomb weight and the temperature inside the box, an analytical expression for the temperature drift part is extracted. Since the activities of the bee colony will interfere with the model fitting, the measured data during the period without bees should be selected for fitting. At this time, the true value of the honeycomb weight should remain unchanged, and the fluctuations in the weight measurement values can be regarded as the interference part of the temperature on the weight sensor. The fitted function model is the temperature drift of the weight sensor. Since there are deviations between the measured data of the honeycomb weight and the temperature inside the box and the model, the model coefficients need to be determined by least squares fitting;

[0106] After obtaining the statistical model of the temperature drift, theoretically, when the temperature is known, the part of the weight reading affected by the temperature can be solved, and then the weight value after removing the temperature drift can be obtained through the difference operation between the weight measurement value and the temperature drift part. However, in practice, since there is also noise interference in the reading of the temperature inside the box, the temperature drift model needs to be introduced into the observation equation of the Kalman filter to achieve the optimal estimation of the above uncertainties;

[0107] To construct the Kalman filter, appropriate state variables and observation variables need to be selected, and the state equation and observation equation of the system need to be established. For the state equation of the Kalman filter, it is constructed according to the characteristics that the honeycomb weight and the temperature inside the box change smoothly in a short period of time; for the observation equation of the Kalman filter, the statistical model of the temperature drift model needs to be introduced; the state equation and observation equation of the Kalman filter are respectively:

[0108]

[0109] Among them, x W represents the true value of the honeycomb weight, x ΔW represents the time variation of the true value of the honeycomb weight, x T represents the temperature inside the box, x ΔT represents the time variation of the temperature inside the box. The matrix form of the above four state variables is called the state variable matrix; z W represents the measured value of the honeycomb weight, z ΔW represents the time variation of the measured value of the honeycomb weight, z T represents the measured value of the temperature inside the box, z ΔT represents the time variation of the measured value of the temperature inside the box. The matrix composed of the above four observation variables is called the observation variable matrix; ω W represents the process noise of the honeycomb weight, ω ΔW represents the process noise of the time variation of the honeycomb weight, ω T represents the process noise of the temperature inside the box, ω ΔT represents the process noise of the time variation of the temperature inside the box. The matrix composed of the above four process noise terms is called the process noise covariance matrix; vW Observation noise representing the weight of the honeycomb, v ΔW Observation noise representing the change in the weight of the honeycomb over time, v T Observation noise representing the ambient temperature inside the hive, v ΔT Observation noise representing the change in the ambient temperature inside the hive over time. The matrix formed by the above four observation noise terms is called the observation noise covariance matrix.

[0110] After the construction of the Kalman filter introducing the statistical model of temperature drift is completed, the values of the hyperparameters need to be determined; according to the analysis of the temperature drift model, the value of the observation noise of the honeycomb weight is numerically equal to the deviation between the temperature drift model and the measurement data of the honeycomb weight when there are no bees in the hive. By taking the weighted average of the honeycomb weight measurement data, the optimal value of the observation noise of the honeycomb weight at each moment can be obtained; for the process noise covariance matrix, it needs to be selected in combination with the measured values of the state variables. Since the measurement data when there are no bees in the hive and when there are bees in the hive are both read by the same weight sensor, and the expressions of the prediction equations in the two scenarios are the same, for convenience, the condition without bees is selected for estimating the process noise value. The estimation method is as follows: Select the mean value of the honeycomb weight measurement values during the period without bees as the prediction of the true value of the honeycomb weight without bees. The difference between the honeycomb weight measurement value and the mean value is the superposition of the observation noise and the process noise, so that the process noise value can be calculated and solved through calculation;

[0111] Based on the swarm state equation and the observation equation, the iterative update equation of the Kalman filter can be given:

[0112]

[0113] In the formula, and are the predicted value of the swarm system state and the Kalman prediction error covariance matrix at time k; and P k are the optimal state estimate value of the system and the Kalman optimal estimate error covariance matrix at time k after update; A is the state matrix; Q is the process noise covariance matrix; K k is the Kalman gain; R is the observation noise covariance matrix; I is the identity matrix, H represents the gain matrix, z k represents the observation variable, and H T represents the transpose of the gain matrix.

[0114] Based on the linear Kalman filter introducing the temperature drift model, iterative operations are performed to obtain the filtered honeycomb weight;

[0115] To further illustrate the effectiveness of the method for removing the temperature drift of the honeycomb weight provided by the embodiments of the present invention based on statistics and Kalman filtering, the verification experiment process is described below with reference to the accompanying drawings and in combination with specific examples:

[0116] In the verification experiment of the method for removing the temperature drift of the honeycomb weight based on statistics and Kalman filtering, to avoid the contingency of the experiment, the two situations of no bee colony activity in the hive and bee colony activity in the hive should be analyzed separately. In the verification experiment of the method provided in the embodiments of the present invention, 15 days are selected as the cycle for the experiment because long-term monitoring is usually carried out in actual beekeeping operations, so the results are more valuable for practical applications.

[0117] As Figure 3 shown, in the verification experiment of the method provided by the present invention, 15 days from 0:00 on March 5, 2021 to 0:00 on March 20, 2021 are selected as the experimental verification period when there are no bees in the hive. Figure 3 In the figure, the curve with a large amplitude represents the honeycomb weight measurement value obtained by the weight sensor, and the curve with a small amplitude represents the honeycomb weight data processed by the method of the present invention. It can be seen that when the method provided in the embodiments of the present invention is applied to the situation where there are no bees in the hive, it has a good temperature drift deduction effect, that is, it can be closest to the fact that the honeycomb weight remains unchanged during the period without bees to the greatest extent.

[0118] Furthermore, as Figure 4 shown, in the verification experiment of the method provided by the present invention, 15 days from 0:00 on May 1, 2021 to 0:00 on May 16, 2021 are selected as the experimental verification period when there are bees in the hive. Figure 4 In the figure, the curve with a large amplitude still represents the honeycomb weight measurement value obtained by the weight sensor, and the curve with a small amplitude still represents the honeycomb weight data processed by the method of the present invention. It can be seen that when the method provided in the embodiments of the present invention is applied to the situation where there are bees in the hive, it can effectively alleviate the weight mutation caused by temperature and more obviously reflect the change trend of the honeycomb weight.

[0119] To sum up, compared with the prior art, the present invention has the following advantages:

[0120] The method provided in the embodiments of the present invention uses polynomial fitting to give a statistical model related to temperature, solves the problem of obtaining the dynamic model, and then combines with Kalman filtering to correct the cumulative error caused by inaccurate modeling, so as to achieve the removal of the weight data drift caused by temperature, avoid the problem of insufficient reading accuracy of the weight sensor, and has important significance for the basic research of bee colony activities and precision beekeeping, and has a wide application prospect.

[0121] The content not described in detail in this specification belongs to the prior art well known to those skilled in the art.

Claims

1. A honeycomb weight temperature drift removal system based on a statistical model and Kalman filtering, characterized in that: it includes a temperature drift statistical model construction module, a Kalman filter state equation construction module, a Kalman filter observation equation construction module, a Kalman filter equation hyperparameter setting module, and an iterative calculation module; The temperature drift statistical model construction module is used to fit a temperature drift statistical model using the weight reading fluctuations of the weight sensor according to the characteristic that the honeycomb weight should not change when there are no bees in the beehive; The Kalman filter state equation construction module is used to construct a Kalman filter state equation based on the true value of the honeycomb weight, the time variation of the true value of the honeycomb weight, the ambient temperature inside the box, and the time variation of the ambient temperature inside the box; The Kalman filter observation equation construction module is used to select the measured value of the honeycomb weight, the time variation of the measured value of the honeycomb weight, the ambient temperature inside the box, and the time variation of the ambient temperature inside the box, and combine them with the temperature drift statistical model to construct a Kalman filter observation equation; The Kalman filter equation hyperparameter setting module is used to determine the observation noise covariance matrix and the process noise covariance matrix in the Kalman filter state space equation respectively by combining the residuals of the temperature drift statistical model and the measurement data of the honeycomb weight and the ambient temperature. The Kalman filter state space equation includes a Kalman filter state equation and a Kalman filter observation equation; The iterative calculation module is used to iteratively update the state variables of the Kalman filter state space equation using the observation noise covariance matrix and the process noise covariance matrix, predict the state estimate value of the state variables of the Kalman filter state space equation at the current moment using the optimal estimate value of the state variables of the Kalman filter state space equation at the previous moment, and then correct the state estimate value at the current moment using the measured value of the honeycomb weight; The specific method for fitting the temperature drift statistical model is: extract the analytical expression of the temperature drift part from multiple groups of measurement data of the weight and temperature of the honeycomb weight sensor when there are no bees. The analytical expression of the temperature drift part is: Among them, W k represents the temperature drift part of the weight sensor at time k; represents the temperature inside the box at time k, represents the time variation of the temperature inside the box at time k; a, b, and c are the first regression coefficient, the second regression coefficient, and the third regression coefficient; Suppose the optimal solutions of the first regression coefficient, the second regression coefficient, and the third regression coefficient to be found are a * , b * , c * , then the optimal temperature drift regression model expression can be obtained: The time variation of the temperature drift part is: Ignoring the second-order change in the ambient temperature inside the box, that is The value of approaches zero, and the above equation is rewritten as: Through the regression model of the temperature drift, when the temperature is known, the part of the weight reading affected by the temperature is solved, and then the weight value after removing the temperature drift is obtained through the difference operation between the weight measurement value and the temperature drift part.

2. The honeycomb weight temperature drift removal system based on a statistical model and Kalman filtering according to claim 1, characterized in that: The specific process of constructing the Kalman filter space state equation is: For the swarm system, the selected state variables are the true value x of the hive weight W , the time-varying quantity x of the true value of the hive weight ΔW , the internal environment temperature x of the box T and the time-varying quantity x of the internal environment temperature of the box ΔT . The time-varying quantity of the true value of the hive weight at time k is equal to the time-varying quantity of the true value of the hive weight at time k - 1 plus the process noise of the time-varying quantity of the hive weight at time k . The time-varying quantity of the internal environment temperature of the box at time k is equal to the time-varying quantity of the internal environment temperature of the box at time k - 1 plus the process noise of the time-varying quantity of the internal environment temperature of the box at time k . The obtained formulas are as follows respectively: True weight x of the honeycomb W The state equation with the ambient temperature x inside the box T is expressed as: Among them, represents the true value of the honeycomb weight at time k, represents the true value of the honeycomb weight at time k-1, represents the time variation of the true value of the honeycomb weight at time k-1, represents the process noise of the true value of the honeycomb weight at time k; represents the temperature of the internal environment of the box at time k, represents the temperature of the internal environment of the box at time k-1, represents the time variation of the temperature of the internal environment of the box at time k-1, represents the process noise of the temperature of the internal environment of the box at time k; In summary, express the Kalman filter state equation in matrix form:

3. The honeycomb weight temperature drift removal system based on a statistical model and Kalman filtering according to claim 2, characterized in that: The construction method of the Kalman filter observation equation introducing the temperature drift model is specifically as follows: The observation equation of the Kalman filter is essentially a simulation process of sensor measurement. The selected observation variables are the measured value z of the honeycomb weight W , the time variation z of the measured value of the honeycomb weight ΔW , the measured value z of the temperature inside the box T and the time variation z of the measured value of the temperature inside the box ΔT . The weight measurement value obtained by the weight sensor at time k is the true value of the honeycomb weight at time k the optimal temperature drift regression model at time k and the observation noise at time k summed up; The time variation of the measured value of the honeycomb weight at time k is the time variation of the true value of the honeycomb weight at time k the time variation of the temperature drift part at time k and the observation noise summed up; The observation equations of the temperature inside the box and its time variation are expressed as follows respectively: Among them, represents the measured value of the honeycomb weight at time k, represents the observation noise of the honeycomb weight at time k, represents the time variation of the measured value of the honeycomb weight at time k, represents the time variation of the internal environment temperature of the box at time k, represents the measured value of the internal environment temperature of the box at time k, represents the internal environment temperature of the box at time k, represents the observation noise of the internal environment temperature of the box at time k, represents the time variation of the measured value of the internal environment temperature of the box at time k, represents the observation noise of the time variation of the internal environment temperature of the box at time k; The matrix form of the obtained Kalman filter observation equation is:

4. The honeycomb weight temperature drift removal system based on a statistical model and Kalman filtering according to claim 3, characterized in that: The method for obtaining the observation noise covariance matrix R is: for the observation noise covariance matrix R, the expression form of the observation noise covariance matrix R is obtained from the Kalman filter observation equation and the correlation between noise variables as: where, ν W , ν ΔW , ν T and ν ΔT respectively represent the observation noise of the honeycomb weight, the observation noise of the change amount of the honeycomb weight over time, the observation noise of the ambient temperature inside the box, and the observation noise of the change amount of the ambient temperature inside the box over time; Based on the analysis of the temperature drift model, it is considered that the observation noise of the honeycomb weight at time k is numerically approximately equal to the deviation δ between the temperature drift model and the measured data of the honeycomb weight when there are no bees in the hive k . By weighted averaging the measurement data of the honeycomb weight and the change amount of the honeycomb weight at n moments, the optimal value v of the observation noise of the honeycomb weight at each moment is obtained W . The expression is as follows: Among them, represents the measured value of the honeycomb weight at time k; Observation noise v of the change amount when obtaining the honeycomb weight ΔW is as follows: Among them, represents the time-varying quantity of the honeycomb weight measurement value at time k, represents the time-varying quantity of the internal environment temperature of the box at time k; Observation noise v of the internal environment temperature of the box T Observation noise ν of the time variation of the internal environment temperature of the box ΔT It is directly given by the basic error of the temperature sensor.

5. The honeycomb weight temperature drift removal system based on a statistical model and Kalman filtering according to claim 4, characterized in that: The method for obtaining the process noise covariance matrix Q is as follows: For the process noise covariance matrix Q, in the problem of removing the temperature drift of the honeycomb weight, the result output by the Kalman filter depends on the accuracy of the state equation. Therefore, the value range of the process noise covariance matrix Q is 0 < Q < 1; Since the measurement data when there are no bees in the beehive and when there are bees in the beehive are both read by the same weight sensor, and the expressions of the prediction equations in the two scenarios are the same, the Q value estimation is selected under the condition of no bees. Because there is no bee colony activity in the hive, the state variable x ΔW takes the value of 0, and the weight of the honeycomb at time k is rewritten as: is the true value of the honeycomb weight at time k, represents the true value of the honeycomb weight at time k-1, represents the process noise of the honeycomb weight at time k; When there are no bees, the predicted weight of the honeycomb does not change with time. Let the true value of the honeycomb weight during the period without bees in the hive be a constant C. Then there is: By measuring the data set, the measured value z of the weight of the honeycomb at each moment is obtained W , since there is no bee colony activity in the box, calculate z W The mathematical expectation of is obtained as follows: Among them, represents the mean value of the measured honeycomb weights at each moment, represents the measured value of the honeycomb weight at the k-th moment; Since both the observation noise and the process noise conform to the Gaussian distribution, taking the value as the prediction of the true value of the honeycomb weight without bees, the measured value of the honeycomb weight at time k and have the following relationship with the observation noise and process noise of the honeycomb weight at time k: represents the observation noise of the honeycomb weight at time k, represents the process noise of the honeycomb weight at time k; Therefore, the process noise ω of the honeycomb weight W is expressed as: Similarly, the process noise ω of the change amount of the honeycomb weight ΔW , the process noise ω of the temperature inside the box T and the process noise ω of the change amount of the temperature inside the box over time are respectively expressed as: ΔT ​ Among them, represents the mean value of the change amount of the honeycomb weight measurement at each moment, represents the observation noise of the change amount of the honeycomb weight measurement at the k-th moment, represents the measured value of the internal environment temperature of the box at the k-th moment, represents the measured value of the internal environment temperature of the box at the (k - 1)-th moment, represents the measured value of the change amount of the internal environment temperature of the box at the (k - 1)-th moment, represents the observation noise of the internal environment temperature of the box at the k-th moment, represents the change amount of the measured value of the internal environment temperature of the box at the k-th moment, represents the change amount of the measured value of the internal environment temperature of the box at the (k - 1)-th moment, represents the observation noise of the change amount of the measured value of the internal environment temperature of the box at the k-th moment; The process noise of the honeycomb weight, the process noise of the time variation of the honeycomb weight, the process noise of the ambient temperature in the hive, and the process noise of the time variation of the ambient temperature in the hive are written in matrix form to obtain the process noise covariance matrix Q.

6. The honeycomb weight temperature drift removal system based on a statistical model and Kalman filtering according to claim 5, characterized in that: The specific method for iteratively updating the Kalman filter observation equation and finally calculating the honeycomb weight data after removing the temperature drift is as follows: For the matrix form of the Kalman filter state equation; Let At this point, the prediction equation in the Kalman filter iterative calculation process is obtained, and at the same time, the covariance calculation equation including the time recurrence relationship is obtained: Wherein, and are the predicted values of the bee colony system state and the Kalman prediction error covariance matrix at time k; represents the optimal state estimate of the system at time k-1 after update, P k-1 represents the Kalman optimal estimation error covariance matrix at time k-1 after update, T represents transpose, A is the state matrix, and Q is the process noise covariance matrix; For the matrix form of the Kalman filter observation equation; Let Based on the Kalman filter state equation and the Kalman filter observation equation, the iterative update process of the Kalman filter is given. The update process includes the update of the honeycomb system measurement, the expression of the Kalman gain, and the update of the noise covariance, which is expressed in equation form: where K k is the Kalman gain; R is the observation noise covariance matrix; and are the predicted system state and the Kalman prediction error covariance matrix at time k; and P k are the updated optimal system state estimate and the Kalman optimal estimation error covariance matrix at time k; I is the identity matrix, H represents the gain matrix, and z k represents the observation variable, and H T represents the transpose of the gain matrix.

7. A method for removing the temperature drift of the honeycomb weight based on the system described in claim 1, characterized in that, it includes the following steps: Step 1: The temperature drift statistical model construction module fits a temperature drift statistical model using the weight reading fluctuations of the weight sensor according to the characteristic that the honeycomb weight should not change when there are no bees in the hive; Step 2: The Kalman filter state equation construction module constructs a Kalman filter state equation based on the true value of the honeycomb weight, the time variation of the true value of the honeycomb weight, the ambient temperature in the hive, and the time variation of the ambient temperature in the hive; Step 3: The Kalman filter observation equation construction module selects the measured value of the honeycomb weight, the time variation of the measured value of the honeycomb weight, the ambient temperature in the hive, and the time variation of the ambient temperature in the hive, and combines with the temperature drift statistical model to construct a Kalman filter observation equation; Step 4: The Kalman filter equation hyperparameter setting module determines the observation noise covariance matrix and the process noise covariance matrix in the Kalman filter state space equation respectively by combining the residuals of the temperature drift statistical model and the measurement data of the honeycomb weight and the ambient temperature. The Kalman filter state space equation includes the Kalman filter state equation and the Kalman filter observation equation; Step 5: The iterative calculation module iteratively updates the state variables of the Kalman filter state space equation using the observation noise covariance matrix and the process noise covariance matrix, predicts the state estimate of the state variables of the Kalman filter state space equation at the current moment using the optimal estimate of the state variables of the Kalman filter state space equation at the previous moment, and then corrects the state estimate at the current moment using the measured value of the honeycomb weight.

Citation Information

Patent Citations

  • Blood relationship spectrum imaging method and device

    CN106510763A

  • SOC estimation method based on Kalman filtering method

    CN109669134A