Livestock breeding water quality detection method
By collecting and analyzing the water quality index data and interference data of livestock breeding water, calculating its distinction and credibility, and performing fit interpolation processing, the problem of insufficient water quality detection in the existing technology is solved, and more accurate water quality monitoring is achieved .
Patent Information
- Application Number
- CN202411595198.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2024-12-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing water quality detection methods for livestock farming are not accurate enough in the interpolation fitting algorithm due to noise interference, which affects the accuracy of water quality monitoring.
By collecting water quality index data and interference data within the preset number of days, we obtain the relative distinction and preliminary credibility of each water quality index data, and calculate the performance difference of each water quality index data based on the division of feed delivery and exhaust time nodes. , obtain the interpolation deviation value, and perform fitting interpolation processing, adjust the fitting curve to reduce the noise influence.
The accuracy of water quality index data has been improved, making the water quality test results more reliable and accurate, and can reflect the water quality status of aquaculture water more timely.
Smart Images

Figure CN119147719A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of water quality detection, and in particular to a method for detecting the quality of water used for animal husbandry. Background Art
[0002] With the large-scale and intensive development of animal husbandry, the dependence of farms on water resources has increased day by day. The quality of water is directly related to the growth and development of livestock, disease prevention and product quality. Therefore, the existing animal husbandry water monitoring usually uses a variety of water quality monitoring sensors and integrates the acquired data to build a animal husbandry water quality monitoring platform to monitor animal husbandry water in real time and judge the quality of current aquaculture water based on preset water quality indicators.
[0003] In the livestock breeding water scenario, the usual practice is to use a variety of sensors to monitor the various water quality index data in the aquaculture water body in real time, and use some prediction algorithms or statistical models to predict the water quality changes in the water body based on the time series, so that the water quality of the water body can be grasped in time. However, due to the difference in sampling frequency of different sensors, the time intervals between parameters will be different, which will lead to incomplete matching in time series. Therefore, it is often necessary to enhance the water quality index data through a pre-interpolation algorithm. When performing interpolation fitting processing on the aquaculture water quality index data, the existing interpolation algorithm requires that the fitting curve must pass through the original data points, but because the water quality index is usually obtained based on sensors, its data inevitably has certain noise interference, which leads to certain unreliable features in the water quality index data, and directly using the denoising algorithm will destroy the trend information in the original data. Therefore, the enhanced processing of the water quality index data is not accurate enough. Summary of the invention
[0004] In order to solve the technical problem that the existing interpolation fitting algorithm is not accurate enough when enhancing the water quality index data during the water quality detection of animal husbandry, the purpose of the present invention is to provide a method for detecting the water quality of animal husbandry water. The technical scheme adopted is as follows: Collect water quality index data and interference data within a preset number of days; Based on the water quality index data and the interference data, the relative discrimination of each water quality index data is obtained, and then the preliminary credibility of each water quality index data at a preset time point is obtained; Obtaining a first performance difference of each water quality index data obtained based on the feed delivery time node as the basis for dividing the water quality treatment stage, and obtaining a second performance difference of each water quality index data obtained based on the excretion cleaning time node as the basis for dividing the water quality treatment stage; Obtaining an interpolation deviation value of each water quality indicator data at each moment based on the preliminary credibility, the first performance difference and the second performance difference; Fitting and interpolating the water quality index data, and taking the interpolation deviation value of each water quality index data at each moment as the deviation tolerance between the fitting curve and the water quality index data; The water quality index data after fitting and interpolation is input into a preset water quality detection model to obtain the water quality detection value of livestock breeding water.
[0005] Furthermore, obtaining the relative discrimination of each water quality index data based on the water quality index data and the interference data includes: Obtain the mean feed consumption and feces excretion within a preset number of days respectively; Selecting one day from the preset days as the preset day, calculating a first difference between the feed consumption and the average feed consumption and a second difference between the feces excretion and the average feces excretion on the preset day, and performing linear normalization processing on the first difference and the second difference to obtain a first difference linear normalization value and a second difference linear normalization value respectively; Calculate the normalized first standard deviation of the preset water quality index data on the preset day; Adding the first difference linear normalized value and the second difference linear normalized value to obtain a sum of difference linear normalized values, and multiplying the sum of difference linear normalized values by the first standard deviation to obtain a first product; Repeating the process of obtaining the first product to obtain the first product corresponding to each day of the preset number of days, adding the first products in sequence to obtain a sum of first products, and linearly normalizing the sum of the first products to obtain a linear normalized value of the sum of first products; Negatively correlating the linear normalized value of the sum of the first products to obtain the relative discrimination of the preset water quality index data; The relative discrimination degree acquisition process is repeated to obtain the relative discrimination degree of each water quality index data.
[0006] Furthermore, the obtaining of the preliminary credibility of each water quality index data at a preset time point includes: Obtain the second standard deviation of the preset water quality index data within a local range centered at the preset time point; Multiplying the second standard deviation by the relative discrimination of the preset water quality index data to obtain a second product, and normalizing the second product to obtain a second product normalized value; Performing negative correlation on the second product normalized value to obtain the preliminary credibility of the preset water quality index data at the preset time point; By repeating the process of obtaining the preliminary credibility, the preliminary credibility of each water quality index data at a preset time point can be obtained.
[0007] Furthermore, the first performance difference of each water quality index data obtained based on the feed delivery time node as the basis for dividing the water quality treatment stage includes: Obtaining a linear relationship value between a preset water quality index data and another water quality index data; Acquire a first fluctuation degree of the preset water quality index data within a local data range at a preset time and a second fluctuation degree of the other water quality index data within a local data range at a preset time; Obtaining an absolute value of a sampling frequency difference between the preset water quality index data and the another water quality index data; Obtaining a first performance difference of the preset item water quality index data at a preset time point based on the first fluctuation degree, the second fluctuation degree, the linear relationship value and the absolute value of the sampling frequency difference; The first performance difference acquisition process is repeated to acquire the first performance difference of each water quality indicator data at a preset time point.
[0008] Furthermore, the process of obtaining the linear relationship value includes: Obtaining the Pearson correlation coefficient corresponding to the preset water quality index data and the other water quality index data at each water quality treatment stage; The Pearson correlation coefficients are added in sequence to obtain the sum of the Pearson correlation coefficients; Obtaining a first self-processing stability performance of the preset water quality index data and a second self-processing stability performance of the another water quality index data; The sum of the Pearson correlation coefficient, the first self-processing stability performance, and the second self-processing stability performance are multiplied in sequence to obtain a third product, and the third product is divided by the number of the water quality treatment stages and then linearly normalized to obtain the linear relationship value.
[0009] Furthermore, the process of obtaining the self-processing stability performance includes: Obtaining the matching similarity of two preset water quality treatment stages in the preset water quality index data; The absolute value of the difference between the feed feeding amounts in the two preset water quality treatment stages is linearly normalized to obtain a linear normalized absolute value of the difference; Multiplying the linear normalized absolute value of the difference by the matching similarity to obtain a fourth product; Repeat the process of obtaining the fourth product to obtain the fourth product corresponding to each feeding of the feed; After the fourth products are added in sequence, they are divided by the number of combinations of the two water quality treatment stages to obtain the self-processing stability performance of the preset water quality index data.
[0010] Furthermore, the process of obtaining the matching similarity includes: Obtaining the distances of the preset group matching points of the preset water quality index data obtained in the preset two water quality processing stages; Obtaining a preliminary credibility mean value of a preset group of matching points obtained from the preset water quality index data in two preset water quality processing stages; Multiplying the distance by the preliminary credibility mean to obtain a fifth product, and subtracting the fifth product from the distance to obtain a third difference; The third difference acquisition process is repeated to acquire the third difference of each group of matching points, and the third difference is added together and then the reciprocal is taken to acquire the matching similarity of the two water quality treatment stages preset in the preset water quality index data.
[0011] Further, obtaining a first performance difference of the preset item water quality index data at a preset time point based on the first fluctuation degree, the second fluctuation degree, the linear relationship value and the absolute value of the sampling frequency difference includes: Subtracting the second volatility from the first volatility and taking the absolute value to obtain the absolute value of the volatility difference; Performing linear normalization processing on the absolute value of the sampling frequency difference to obtain an absolute normalized value of the sampling frequency difference; The absolute value of the fluctuation degree difference, the absolute normalized value of the sampling frequency difference and the linear relationship value are multiplied in sequence to obtain a single performance difference between the preset water quality index data and another water quality index data; Repeat the process of obtaining the single performance difference to obtain the single performance difference between the preset water quality index data and the remaining water quality index data; The single performance differences are sequentially added and then divided by the number of the remaining water quality index data to obtain the performance difference.
[0012] Further, obtaining the interpolation deviation value of each water quality indicator data at each moment based on the preliminary credibility, the first performance difference and the second performance difference includes: adding the first performance difference to the second performance difference and then normalizing to obtain a performance difference normalized value; The preliminary credibility is multiplied by the normalized value of the performance difference to obtain a sixth product, and the sixth product is subtracted from the preliminary credibility to obtain the interpolation deviation value.
[0013] Furthermore, the water quality index data include: pH data, dissolved oxygen data, conductivity data, turbidity data, ammonia nitrogen data, nitrite data, and nitrate data.
[0014] The present invention has the following beneficial effects: In the present invention, first, water quality index data and interference data within a preset number of days are collected. This is the basis for subsequent data analysis. Secondly, the relative discrimination of each water quality index data is obtained based on the water quality index data and the interference data, and then the preliminary credibility of each water quality index data at the preset time point is obtained. The lower the preliminary credibility, the less reliable the water quality index data is, and the greater the possibility of noise data. In addition, the first performance difference of each water quality index data obtained based on the feed delivery time node as the basis for water quality treatment stage division is obtained, and the second performance difference of each water quality index data obtained based on the excretion cleaning time node as the basis for water quality treatment stage division is obtained. The greater the first performance difference and the second performance difference, the less reliable the water quality index data is, and the greater the possibility of noise data is. Then, the interpolation deviation value of each water quality index data at each moment is obtained based on the preliminary credibility, the first performance difference and the second performance difference. The interpolation deviation value is obtained as the deviation allowance between the fitting curve and the water quality index data when the water quality index data is fitted and interpolated. Next, the water quality index data is fitted and interpolated, and the interpolation deviation value of each water quality index data at each moment is used as the deviation tolerance between the fitting curve and the water quality index data. More accurate water quality index data is obtained after fitting and interpolation. Finally, the water quality index data after fitting and interpolation is input into a preset water quality detection model to obtain the water quality detection value of the current water for animal husbandry. The water quality index data after fitting and interpolation is input into an existing water quality detection model to obtain more accurate and timely water quality detection results. The present invention uses fitting and interpolation to enhance the water quality index data, making it more accurate, so that the water quality detection value of the current water for animal husbandry is also more accurate when the water quality index data after fitting and interpolation is input into a preset water quality detection model. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0016] Figure 1 A flow chart of a method for detecting water quality for livestock breeding provided by the first embodiment of the present invention; Figure 2 A flowchart of a process for obtaining relative discrimination provided by the second embodiment of the present invention; Figure 3 A flowchart of a process for obtaining preliminary credibility provided by a third embodiment of the present invention; Figure 4 A flowchart of a process for obtaining a first performance difference provided by a fourth embodiment of the present invention; Figure 5 A flowchart of a process for obtaining a linear relationship value provided in a fifth embodiment of the present invention; Figure 6 A flowchart of a process for obtaining the self-processing stability performance provided by a sixth embodiment of the present invention; Figure 7 A flowchart of a process for obtaining matching similarity provided by the seventh embodiment of the present invention; Figure 8 This is a flow chart of a process for obtaining an interpolation deviation value provided in the eighth embodiment of the present invention. DETAILED DESCRIPTION
[0017] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the water quality detection method for livestock breeding water proposed by the present invention, its specific implementation method, structure, characteristics and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0018] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0019] The specific scheme of the method for detecting the quality of water for animal husbandry provided by the present invention is described in detail below in conjunction with the accompanying drawings.
[0020] See also Figure 1, which shows a flow chart of a method for detecting water quality for livestock breeding water provided by a first embodiment of the present invention, the method comprising: S101. Collect water quality index data and interference data within a preset number of days.
[0021] By placing a variety of sensors in aquaculture water bodies, including but not limited to: 1. pH sensor: monitors the acidity and alkalinity of water.
[0022] 2. Dissolved oxygen sensor: monitors the concentration of dissolved oxygen in water, which is essential for maintaining the respiration of aquatic organisms.
[0023] 3. Conductivity sensor: measures the conductivity of water, reflecting the content of dissolved salt in water.
[0024] 4. Turbidity sensor: measures the turbidity of water and reflects the content of suspended matter in water.
[0025] 5. Ammonia, nitrite, and nitrate sensors: monitor the concentrations of these chemicals that are harmful to aquatic life.
[0026] The water quality index data include: pH data, dissolved oxygen data, conductivity data, turbidity data, ammonia nitrogen data, nitrite data, and nitrate data.
[0027] The interference data are related data parameters such as daily feed consumption and feces excretion in the current livestock farm that will affect the water quality components of livestock breeding water. Daily feed consumption and feces excretion are usually multiple times a day, not just once a day, so it is also necessary to obtain the daily feed delivery time node and excretion time node as well as the single feed delivery amount and feces excretion amount.
[0028] The water quality index data and the interference data are both standardized, and the standardized processing method includes: Z-score standardization method, so that the processed data values are all between 0 and 1.
[0029] S102. Obtain the relative discrimination of each water quality index data based on the water quality index data and the interference data, and then obtain the preliminary credibility of each water quality index data at a preset time point.
[0030] In livestock breeding water use scenarios, the noise interference that usually exists is random interference caused by sensors. The degree of differentiation of this type of interference in different water quality index data is different. For example, the turbidity obtained by a turbidity sensor is usually the turbidity in the local range of the water body that the sensor contacts. This characteristic usually fluctuates relatively large when the turbidity in the water body is uneven and the water body is unstable. At this time, the differentiation of noise in this type of data is relatively weak. However, for detection data such as pH value and conductivity, it is usually more uniform, and the differentiation of noise in this type of data is relatively strong.
[0031] Based on the fact that noise has different degrees of differentiation in different water quality index data, we first need to analyze the characteristics of each water quality index data to obtain the relative differentiation between it and random noise.
[0032] The higher the relative discrimination, the more obvious the discrimination between the data features representing the water quality index data and the noise.
[0033] The process of obtaining the relative discrimination will be described in detail in the second embodiment and will not be repeated here.
[0034] When analyzing noise interference or the correlation between different water quality index data, it is necessary to use a local range centered on a certain data as the basis for analysis, so it is usually necessary to select a suitable local range here.
[0035] The sampling frequency of each sensor is obtained to obtain the time interval of each type of water quality index data, the lowest common multiple is calculated based on the time interval of each type of water quality index data, and the lowest common multiple is set as the time span of each data point in each water quality index data as the local range in the future.
[0036] The process of obtaining the preliminary credibility will be described in detail in the third embodiment and will not be repeated here.
[0037] The lower the preliminary credibility is, the more it indicates that the fluctuation performance of the local range of the current data point is more inclined to noise performance compared with similar water quality index data.
[0038] S103. Obtain the first performance difference of each water quality index data obtained based on the feed delivery time node as the basis for dividing the water quality treatment stage, and obtain the second performance difference of each water quality index data obtained based on the excretion cleaning time node as the basis for dividing the water quality treatment stage.
[0039] The water quality treatment stages are divided according to each feed delivery time node, that is, from the first feed delivery time node as the starting point to the second feed delivery time node as the end point, and the period between the starting point and the end point is a water quality treatment stage. Repeat this operation to obtain the preset number of days, such as thirty days, to obtain all water quality treatment stages.
[0040] The water quality treatment stages are divided according to each discharge cleaning time node, that is, from the first discharge cleaning time node as the starting point to the second discharge cleaning time node as the end point, and the period between the starting point and the end point is a water quality treatment stage. Repeat this operation to obtain the preset number of days, such as thirty days, to obtain all water quality treatment stages.
[0041] The process of obtaining the first expression difference will be described in detail in the fourth embodiment and will not be repeated here.
[0042] The process of obtaining the second expression difference is the same as the process of obtaining the first expression difference, and will not be repeated here.
[0043] S104. Obtain an interpolation deviation value of each water quality indicator data at each moment based on the preliminary credibility, the first performance difference and the second performance difference.
[0044] The process of obtaining the interpolation deviation value will be described in detail in the eighth embodiment and will not be repeated here.
[0045] S105. Fitting and interpolating the water quality index data, and using the interpolation deviation value of each water quality index data at each moment as the deviation tolerance between the fitting curve and the water quality index data.
[0046] The conventional fitting method is Lagrange polynomial fitting interpolation, or other fitting interpolation methods are all acceptable. The principle of fitting interpolation is that the fitting curve must pass through all the original data points to constrain the overall trend obtained by fitting. However, due to the different water quality index data mentioned above, their actual credibility is different, so adjustments are needed here, that is, the fitting curve in the fitting interpolation must be adjusted to pass through the original data points: the interpolation deviation value based on each water quality index data point is the deviation value allowance between the fitting curve and the original data point, so that the fitting curve can represent a higher overall trend through a higher deviation at water quality index data points with weaker credibility, thereby reducing the influence of such data points on the interpolation results.
[0047] S106. Input the water quality index data after fitting and interpolation into a preset water quality detection model to obtain the water quality detection value of current livestock breeding water.
[0048] Based on the adjusted interpolation method, the data of each water quality index is more accurate, and the water quality of current livestock breeding water can be tested more timely and accurately through existing prediction models or water quality index standards.
[0049] It should be noted that the preset water quality detection model is existing technology.
[0050] Figure 2 The flowchart of the relative discrimination acquisition process provided in the second embodiment of the present invention, wherein the relative discrimination of each water quality index data is acquired based on the water quality index data and the interference data, comprises: S201. Obtain the average feed consumption and the average feces excretion within a preset number of days respectively.
[0051] The preset number of days may be 30 days. The average feed consumption is the total feed consumption within the preset number of days divided by the preset number of days. The average feces excretion is the total feces excretion within the preset number of days divided by the preset number of days.
[0052] S202. Select any one day from the preset days as the preset day, calculate the first difference between the feed consumption and the average feed consumption and the second difference between the feces excretion and the average feces excretion on the preset day, and perform linear normalization processing on the first difference and the second difference to obtain a first difference linear normalization value and a second difference linear normalization value.
[0053] The first difference linear normalized value can be expressed as: , wherein the represents the first difference.
[0054] The second difference linear normalized value can be expressed as: , wherein the represents the second difference.
[0055] S203. Calculate the first standard deviation of the normalized water quality index data of the preset item on the preset day.
[0056] The first standard deviation can be expressed as: .
[0057] S204. Add the first difference linear normalized value and the second difference linear normalized value to obtain a sum of difference linear normalized values, and multiply the sum of difference linear normalized values by the first standard deviation to obtain a first product.
[0058] The first product can be expressed as: ; in, is a linear normalization function.
[0059] S205. Repeat the process of obtaining the first product to obtain the first product corresponding to each day in the preset number of days, add the first products in sequence to obtain the sum of the first products, and linearly normalize the sum of the first products to obtain a linear normalized value of the sum of the first products.
[0060] The linear normalized value of the sum of the first products can be expressed as: ; Wherein, m is the preset number of days, which can be set to 30 days.
[0061] S206. Perform negative correlation on the linear normalized value of the sum of the first products to obtain the relative discrimination of the preset water quality index data.
[0062] The relative discrimination can be expressed as: ; Among them, the Indicates the relative discrimination of the preset water quality index data.
[0063] This is done because when the current aquaculture water is circulated, the daily feed and excrement volume will have a direct impact on the water body. When the circulating water treatment device is operating normally, if the feed and excrement volume change, it may usually cause the water quality index data to change accordingly. Therefore, it is necessary to constrain the change to obtain a more accurate relative discrimination. The higher the relative discrimination, the more obvious the discrimination between the data characteristics representing the water quality index data and the noise.
[0064] S207. Repeat the relative discrimination acquisition process to obtain the relative discrimination of each water quality index data.
[0065] Each time feed is added, it will cause interference and pollution to the water quality. At this time, the aquaculture water will be recycled and treated. Before the next feed is added, the water quality index data will gradually fall within the standard range, otherwise the abnormal water quality index data will gradually accumulate and grow. Under the condition that the treatment method remains unchanged, the change process of the same water quality index data should be similar after each feed is added. Furthermore, the stronger the correlation between different water quality index data, the more similar the change process between them. Therefore, first of all, for a single water quality index data, it is necessary to obtain whether the change trend of the water quality index data is relatively stable during multiple water quality treatment processes. This stable feature will directly affect whether there is a relatively stable linear feature when analyzing the water quality index data with other water quality index data. Figure 3 The flowchart of the process of obtaining the preliminary credibility provided by the third embodiment of the present invention, wherein obtaining the preliminary credibility of each water quality index data at a preset time point includes: S301. Obtain the second standard deviation of the preset water quality index data within a local range centered at a preset time point.
[0066] The second standard deviation can be expressed as: .
[0067] S302. Multiply the second standard deviation by the relative discrimination of the preset water quality index data to obtain a second product, and normalize the second product to obtain a second product normalized value.
[0068] The second product normalized value can be expressed as: ; Among them, the is the relative discrimination of the preset water quality index data, is a normalization function, and the normalization function includes a range normalization method.
[0069] S303. Perform negative correlation on the second product normalized value to obtain the preliminary credibility of the preset water quality index data at the preset time point.
[0070] The preliminary credibility can be expressed as: ; Among them, the It is the preliminary credibility of the preset water quality index data at the preset time point.
[0071] S304. Repeating the process of obtaining the preliminary credibility can obtain the preliminary credibility of each water quality index data at a preset time point.
[0072] Figure 4 The flowchart of the process of obtaining the first performance difference provided by the fourth embodiment of the present invention, wherein obtaining the first performance difference of each water quality index data obtained based on the feed delivery time node as the basis for dividing the water quality treatment stage includes: S401. Obtain a linear relationship value between the preset water quality index data and another water quality index data.
[0073] The linear relationship value can be expressed as: , represents the preset water quality index data, the It is another water quality index data, and the another water quality index data represents one of the remaining water quality index data except the preset water quality index data.
[0074] S402. Obtain a first fluctuation degree of the preset water quality index data in a local data range at a preset time and a second fluctuation degree of the other water quality index data in a local data range at a preset time.
[0075] The first fluctuation degree can be expressed as: , the second fluctuation degree can be expressed as .
[0076] S403. Obtain the absolute value of the sampling frequency difference between the preset water quality index data and the another water quality index data.
[0077] The absolute value of the sampling frequency difference can be expressed as: .
[0078] S404. Obtain a first performance difference of the preset item water quality index data at a preset time point based on the first fluctuation degree, the second fluctuation degree, the linear relationship value and the absolute value of the sampling frequency difference.
[0079] Specifically, obtaining the first performance difference of the preset item water quality index data at a preset time point based on the first fluctuation degree, the second fluctuation degree, the linear relationship value and the absolute value of the sampling frequency difference includes: The absolute value of the fluctuation degree difference is obtained by subtracting the second fluctuation degree from the first fluctuation degree. The absolute value of the fluctuation degree difference can be expressed as: .
[0080] The absolute value of the sampling frequency difference is subjected to linear normalization processing to obtain an absolute normalized value of the sampling frequency difference, and the absolute normalized value of the sampling frequency difference can be expressed as: .
[0081] The absolute value of the fluctuation degree difference, the absolute normalized value of the sampling frequency difference and the linear relationship value are multiplied in sequence to obtain a single performance difference between the preset water quality index data and another water quality index data. The single performance difference can be expressed as: .
[0082] The single performance difference degree acquisition process is repeated to acquire the single performance difference degree between the preset water quality index data and the remaining water quality index data.
[0083] The single performance differences are sequentially added and then divided by the number of the remaining water quality index data to obtain the performance difference, which can be expressed as: ; Among them, the represents the number of the remaining water quality index data, It represents the first performance difference of the preset water quality index data at the preset time point.
[0084] S405. Repeat the first performance difference acquisition process to acquire the first performance difference of each water quality indicator data at a preset time point.
[0085] Figure 5 This is a flow chart of a process for obtaining a linear relationship value provided by a fifth embodiment of the present invention. The process for obtaining a linear relationship value includes: S501. Obtain the Pearson correlation coefficient corresponding to the preset water quality index data and another water quality index data at each water quality treatment stage.
[0086] The preset water quality index data can be used Indicates that the other water quality index data can be used To express.
[0087] Can be used to represent water quality index data as well as The Pearson correlation coefficient in the bth water quality treatment stage. The calculation method of the Pearson correlation coefficient is prior art and will not be repeated here.
[0088] S502. Add the Pearson correlation coefficients in sequence to obtain the sum of the Pearson correlation coefficients.
[0089] The sum of the Pearson correlation coefficients can be expressed as: ; Wherein, B represents the number of water quality treatment stages.
[0090] S503. Obtain a first self-processing stability performance of the preset water quality index data and a second self-processing stability performance of the other water quality index data.
[0091] The first self-processing stability performance can be expressed as: , the second self-processing stability performance can be expressed as: .
[0092] S504. The sum of the Pearson correlation coefficient, the first self-processing stability performance, and the second self-processing stability performance are multiplied in sequence to obtain a third product, and the third product is divided by the number of the water quality treatment stages and then linear normalization is performed to obtain the linear relationship value.
[0093] The linear relationship value can be expressed as: ; Among them, the represents the linear relationship value, the is a linear normalization function.
[0094] Figure 6 This is a flow chart of a process for obtaining the self-processing stability performance provided by a sixth embodiment of the present invention, wherein the process for obtaining the self-processing stability performance includes: S601. Obtain the matching similarity of two preset water quality treatment stages in the preset water quality index data.
[0095] The matching similarity can be To represent, wherein the preset water quality index data can be used Indicates that Indicates the middle of two water treatment stages In other words, there are many ways to combine the two water treatment stages. Here we choose the kind.
[0096] S602. Linearly normalize the absolute value of the difference between the feed feeding amounts in the two preset water quality treatment stages to obtain a linear normalized absolute value of the difference.
[0097] The linear normalized absolute value of the difference can be expressed as: ; Among them, the represents the absolute value of the difference.
[0098] S603. Multiply the linear normalized absolute value of the difference by the matching similarity to obtain a fourth product.
[0099] The fourth product can be expressed as: .
[0100] S604. Repeat the process of obtaining the fourth product to obtain the fourth product corresponding to each feeding of the feed.
[0101] S605. After sequentially adding the fourth products, the fourth products are divided by the number of combinations of the two water quality treatment stages to obtain the self-processing stability performance of the preset water quality index data.
[0102] The self-processing stability performance can be expressed as: ; Among them, the For the self-processing stability performance, the Represents the number of combinations of two water treatment stages.
[0103] Large differences in feed amounts may lead to differences in the corresponding processing processes, such as longer actual processing time or greater differences in longitudinal amplitudes. Therefore, the DTW matching degree obtained at this time needs to be weighted down to a certain extent. The larger the value is, the stronger the stability of the water quality index data in the continuous water quality treatment process. This stability is usually due to the strong linear relationship between this type of water quality index data and other water quality index data, such as pH value and some heavy metal ions. Therefore, the credibility of this type of water quality index data in the linear relationship analysis of subsequent water quality index data is relatively high.
[0104] Figure 7 This is a flow chart of a process for obtaining matching similarity provided by the seventh embodiment of the present invention. The process for obtaining matching similarity includes: S701. Obtain the distances between preset group matching points of preset water quality index data obtained in two preset water quality processing stages.
[0105] The distance can be To represent, wherein the preset water quality index data can be used Indicates that Indicates the middle of two water treatment stages In other words, there are many ways to combine the two water treatment stages. Here we choose the species, Indicates a preset group of matching points.
[0106] S702. Obtain the preliminary credibility mean of the preset group matching points obtained from the preset water quality index data in the preset two water quality processing stages.
[0107] The preliminary credibility mean can be To express.
[0108] S703. Multiply the distance by the preliminary credibility mean to obtain a fifth product, and subtract the fifth product from the distance to obtain a third difference.
[0109] The third difference can be expressed as: ; S704. Repeat the third difference acquisition process to acquire the third difference of each group of matching points, add up all the third differences and take the reciprocal to acquire the matching similarity of the two preset water quality treatment stages in the preset water quality index data.
[0110] The matching similarity can be expressed as: ; Among them, the is the matching similarity, and L represents the number of groups.
[0111] DTW matching is a well-known technology, so how to obtain matching points is not described in detail here. It should be noted that the higher the initial credibility of the point, the higher the credibility of the distance between it and the corresponding matching point. However, since the denominator is in the opposite logic at this time, the weight needs to be reversed by 1 minus.
[0112] Figure 8 The flowchart of the process of obtaining the interpolation deviation value provided in the eighth embodiment of the present invention, obtaining the interpolation deviation value of each water quality index data at each moment based on the preliminary credibility, the first performance difference and the second performance difference includes: S801. Add the first representation difference to the second representation difference and then normalize to obtain a representation difference normalization value.
[0113] The normalized value of the performance difference can be expressed as: , wherein the is a normalization function, and the normalization function includes a range normalization method. represents the first performance difference, the Indicates the second performance difference.
[0114] S802. Multiply the preliminary credibility by the normalized value of the performance difference to obtain a sixth product, and subtract the sixth product from the preliminary credibility to obtain the interpolation deviation value.
[0115] The interpolation deviation value can be expressed as: ; Among them, the represents the difference deviation value, the Indicates the preliminary credibility.
[0116] The present invention has the following beneficial effects: In the present invention, first, water quality index data and interference data within a preset number of days are collected. This is the basis for subsequent data analysis. Secondly, the relative discrimination of each water quality index data is obtained based on the water quality index data and the interference data, and then the preliminary credibility of each water quality index data at the preset time point is obtained. The lower the preliminary credibility, the less reliable the water quality index data is, and the greater the possibility of noise data. In addition, the first performance difference of each water quality index data obtained based on the feed delivery time node as the basis for water quality treatment stage division is obtained, and the second performance difference of each water quality index data obtained based on the excretion cleaning time node as the basis for water quality treatment stage division is obtained. The greater the first performance difference and the second performance difference, the less reliable the water quality index data is, and the greater the possibility of noise data is. Then, the interpolation deviation value of each water quality index data at each moment is obtained based on the preliminary credibility, the first performance difference and the second performance difference. The interpolation deviation value is obtained as the deviation allowance between the fitting curve and the water quality index data when the water quality index data is fitted and interpolated. Next, the water quality index data is fitted and interpolated, and the interpolation deviation value of each water quality index data at each moment is used as the deviation tolerance between the fitting curve and the water quality index data. More accurate water quality index data is obtained through fitting and interpolation. Finally, the water quality index data after fitting and interpolation is input into a preset water quality detection model to obtain the water quality detection value of the current livestock breeding water. The water quality index data after fitting and interpolation is input into an existing water quality detection model to obtain more accurate and timely water quality detection results. With the present invention, the enhanced processing of the water quality index data by fitting and interpolation is more accurate, so that the water quality detection value of the current livestock breeding water obtained by inputting the water quality index data after fitting and interpolation into a preset water quality detection model is also more accurate.
[0117] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0118] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
Claims
1. A method for detecting the quality of water used in animal husbandry, characterized in that: The method comprises: Collect water quality index data and interference data within a preset number of days; Based on the water quality index data and the interference data, the relative discrimination of each water quality index data is obtained, and then the preliminary credibility of each water quality index data at a preset time point is obtained; Obtaining a first performance difference of each water quality index data obtained based on the feed delivery time node as the basis for dividing the water quality treatment stage, and obtaining a second performance difference of each water quality index data obtained based on the excretion cleaning time node as the basis for dividing the water quality treatment stage; Obtaining an interpolation deviation value of each water quality indicator data at each moment based on the preliminary credibility, the first performance difference and the second performance difference; Fitting and interpolating the water quality index data, and taking the interpolation deviation value of each water quality index data at each moment as the deviation tolerance between the fitting curve and the water quality index data; The water quality index data after fitting and interpolation is input into a preset water quality detection model to obtain the water quality detection value of livestock breeding water.
2. The method for detecting the quality of water used in animal husbandry and breeding as claimed in claim 1, characterized in that: Obtaining the relative discrimination of each water quality index data based on the water quality index data and the interference data includes: Obtain the mean feed consumption and feces excretion within a preset number of days respectively; Selecting one day from the preset days as the preset day, calculating a first difference between the feed consumption and the average feed consumption and a second difference between the feces excretion and the average feces excretion on the preset day, and performing linear normalization processing on the first difference and the second difference to obtain a first difference linear normalization value and a second difference linear normalization value respectively; Calculate the normalized first standard deviation of the preset water quality index data on the preset day; Adding the first difference linear normalized value and the second difference linear normalized value to obtain a sum of difference linear normalized values, and multiplying the sum of difference linear normalized values by the first standard deviation to obtain a first product; Repeating the process of obtaining the first product to obtain the first product corresponding to each day of the preset number of days, adding the first products in sequence to obtain a sum of first products, and linearly normalizing the sum of the first products to obtain a linear normalized value of the sum of first products; Negatively correlating the linear normalized value of the sum of the first products to obtain the relative discrimination of the preset water quality index data; The relative discrimination degree acquisition process is repeated to obtain the relative discrimination degree of each water quality index data.
3. The method for detecting the quality of water used in animal husbandry and breeding as claimed in claim 1, characterized in that: The preliminary credibility of the water quality index data at the preset time point is obtained as follows: Obtain the second standard deviation of the preset water quality index data within a local range centered at the preset time point; Multiplying the second standard deviation by the relative discrimination of the preset water quality index data to obtain a second product, and normalizing the second product to obtain a second product normalized value; Performing negative correlation on the second product normalized value to obtain the preliminary credibility of the preset water quality index data at the preset time point; By repeating the process of obtaining the preliminary credibility, the preliminary credibility of each water quality index data at a preset time point can be obtained.
4. The method for detecting the quality of water used in animal husbandry and breeding as claimed in claim 1, characterized in that: The first performance difference of each water quality index data obtained based on the feed delivery time node as the basis for dividing the water quality treatment stage includes: Obtaining a linear relationship value between a preset water quality index data and another water quality index data; Acquire a first fluctuation degree of the preset water quality index data within a local data range at a preset time and a second fluctuation degree of the other water quality index data within a local data range at a preset time; Obtaining an absolute value of a sampling frequency difference between the preset water quality index data and the another water quality index data; Obtaining a first performance difference of the preset item water quality index data at a preset time point based on the first fluctuation degree, the second fluctuation degree, the linear relationship value and the absolute value of the sampling frequency difference; The first performance difference acquisition process is repeated to acquire the first performance difference of each water quality indicator data at a preset time point.
5. The method for detecting the quality of water used in animal husbandry and breeding as claimed in claim 4, characterized in that: The process of obtaining the linear relationship value includes: Obtaining the Pearson correlation coefficient corresponding to the preset water quality index data and the other water quality index data at each water quality treatment stage; The Pearson correlation coefficients are added in sequence to obtain the sum of the Pearson correlation coefficients; Obtaining a first self-processing stability performance of the preset water quality index data and a second self-processing stability performance of the another water quality index data; The sum of the Pearson correlation coefficient, the first self-processing stability performance, and the second self-processing stability performance are multiplied in sequence to obtain a third product, and the third product is divided by the number of the water quality treatment stages and then linearly normalized to obtain the linear relationship value.
6. The method for detecting the quality of water used in animal husbandry and breeding as claimed in claim 5, characterized in that: The process of obtaining the self-processing stability performance includes: Obtaining the matching similarity of two preset water quality treatment stages in the preset water quality index data; The absolute value of the difference between the feed feeding amounts in the two preset water quality treatment stages is linearly normalized to obtain a linear normalized absolute value of the difference; Multiplying the linear normalized absolute value of the difference by the matching similarity to obtain a fourth product; Repeat the process of obtaining the fourth product to obtain the fourth product corresponding to each feeding of the feed; After the fourth products are added in sequence, they are divided by the number of combinations of the two water quality treatment stages to obtain the self-processing stability performance of the preset water quality index data.
7. The method for detecting the quality of water used in animal husbandry and breeding as claimed in claim 6, characterized in that: The process of obtaining the matching similarity includes: Obtaining the distances of the preset group matching points of the preset water quality index data obtained in the preset two water quality processing stages; Obtaining a preliminary credibility mean value of a preset group of matching points obtained from the preset water quality index data in two preset water quality processing stages; Multiplying the distance by the preliminary credibility mean to obtain a fifth product, and subtracting the fifth product from the distance to obtain a third difference; The third difference acquisition process is repeated to acquire the third difference of each group of matching points, and the third difference is added together and then the reciprocal is taken to acquire the matching similarity of the two water quality treatment stages preset in the preset water quality index data.
8. The method for detecting the quality of water used in animal husbandry and breeding as claimed in claim 4, characterized in that: Acquiring a first performance difference of the preset item water quality index data at a preset time point based on the first fluctuation degree, the second fluctuation degree, the linear relationship value, and the absolute value of the sampling frequency difference includes: Obtain an absolute value of the fluctuation degree difference by subtracting the second fluctuation degree from the first fluctuation degree; and taking the absolute value; Performing linear normalization processing on the absolute value of the sampling frequency difference to obtain an absolute normalized value of the sampling frequency difference; The absolute value of the fluctuation degree difference, the absolute normalized value of the sampling frequency difference and the linear relationship value are multiplied in sequence to obtain a single performance difference between the preset water quality index data and another water quality index data; Repeat the process of obtaining the single performance difference to obtain the single performance difference between the preset water quality index data and the remaining water quality index data; The single performance differences are sequentially added and then divided by the number of the remaining water quality index data to obtain the performance difference.
9. The method for detecting the quality of water used in animal husbandry and breeding as claimed in claim 1, characterized in that: Obtaining the interpolation deviation value of each water quality indicator data at each moment based on the preliminary credibility, the first performance difference and the second performance difference includes: adding the first performance difference to the second performance difference and then normalizing to obtain a performance difference normalized value; The preliminary credibility is multiplied by the normalized value of the performance difference to obtain a sixth product, and the sixth product is subtracted from the preliminary credibility to obtain the interpolation deviation value.
10. The method for detecting the quality of water used in animal husbandry and breeding as claimed in claim 1, characterized in that: The water quality index data include: pH data, dissolved oxygen data, conductivity data, turbidity data, ammonia nitrogen data, nitrite data, and nitrate data.
Citation Information
Cited By
Livestock breeding water quality detection method
CN119827438A
Water source sampling detection analysis method and device applied to animal husbandry
CN120009498A
