Automatic feeding method and system based on electromagnetic valve flowmeter data
By collecting and analyzing the water pressure characteristics of the drinking water pipe, and adjusting the feeding volume of the solenoid valve flowmeter using cluster analysis, the problem of inaccurate feeding caused by fluctuations in the drinking water pipe is solved, and precise drinking water management is achieved, reducing labor costs and management difficulty.
Patent Information
- Application Number
- CN202510716996.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-08-15
AI Technical Summary
In the automatic drinking water feeding system of the solenoid valve flowmeter in the livestock industry, the pressure fluctuations in the drinking water pipeline cause significant differences between the actual water volume and the preset water volume, and the water feeding volume cannot be accurately controlled.
The historical water pressure time series and flowmeter data of the drinking water pipeline are collected, the static and dynamic characteristics of the water pressure characteristics are calculated, the weight is assigned to the characteristics through clustering analysis, the evaluation function is constructed, and the clustering results are optimized to adjust the real-time feeding amount.
Accurate control of the amount of water consumed by livestock has been achieved, water waste and manual intervention have been reduced, and water resource utilization efficiency and animal health have been improved.
Smart Images

Figure CN120477090A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of animal husbandry feeding control technology, and more particularly to an automatic feeding method and system based on electromagnetic valve flow meter data. Background Art
[0002] With the continuous development of animal husbandry, scientific breeding has gradually become an important way to improve breeding efficiency. In the breeding process, water and feed are important factors affecting livestock growth. In particular, the rational feeding of water and feed is particularly important in improving breeding efficiency and ensuring animal health.
[0003] Traditional manual feeding and water management methods are inefficient, time-consuming, and labor-intensive, and lack precise and automated management. Modern, intelligent equipment, such as automated drinking and feed systems, are becoming an important tool for addressing this issue.
[0004] The livestock industry's automatic drinking water and feeding system, featuring a solenoid valve and flowmeter, is an advanced solution based on automated control technology, combining solenoid valves and flowmeters. This solution enables precise control and management of drinking water and feed on farms. By combining the solenoid valve and flowmeter, the flow rate in the drinking water pipes can be precisely adjusted to ensure that animals receive their desired amount of water, avoiding water waste and health issues. This system not only improves water efficiency and animal health, but also reduces manual intervention in the farming process, thereby reducing labor costs and management complexity.
[0005] However, when the drinking water pipe pressure in the livestock solenoid valve flowmeter automatic drinking water feeding system fluctuates, the actual water pressure is significantly different from the preset or historical average water pressure, and the feeding water volume collected by the flowmeter cannot reach the expected target feeding water volume. Summary of the Invention
[0006] In order to solve the technical problem of inaccurate feeding amount caused by the pressure fluctuation of the drinking water pipeline, the present invention provides solutions in the following aspects.
[0007] In a first aspect, an automatic feeding method based on solenoid valve flow meter data includes: Collecting the historical water pressure time series of the drinking water pipeline and the target feeding water volume and actual feeding water volume collected by the flow meter; The static and dynamic characteristics of each water pressure feature in the water pressure time series are calculated, and the feeding error is calculated based on the target feeding water volume and the actual feeding water volume at each feeding time. The water pressure features are clustered, and corresponding initial weights are assigned to the static and dynamic features during the clustering process. After the clustering is completed, multiple clusters are obtained. An evaluation function is constructed based on the difference in feeding error in each cluster. The clustering operation is repeated based on the evaluation function. When the evaluation function value reaches the minimum, the optimal clustering result is obtained, and the corresponding weight distribution is the optimal weight distribution. The amount of water used in real-time feeding is adjusted according to the optimal clustering results to complete the drinking water management of livestock.
[0008] The present invention first collects the historical water pressure time series of the drinking water pipeline to obtain the change of water pressure over time, further calculates the static and dynamic characteristics of each water pressure feature of the water pressure time series, and more carefully evaluates the impact of water pressure on feeding; then clusters the water pressure features, and assigns initial weights to the static and dynamic features during the clustering process. By repeating the clustering operation and constructing the evaluation function, the optimal clustering result and the optimal weight assignment are finally obtained, so that the clustering result is more in line with the actual situation and can more accurately reflect the relationship between water pressure characteristics and feeding errors. Based on the optimal clustering result, the water volume during real-time feeding is adjusted, which can achieve precise control of livestock drinking water management.
[0009] Preferably, the static characteristic is the average value of the water pressure time series.
[0010] By calculating the average value of the water pressure time series, the overall level of water pressure in the drinking water pipeline over a longer period of time can be intuitively reflected.
[0011] Preferably, the dynamic feature is the variance of the water pressure time series.
[0012] The variance of a water pressure time series reflects the degree of water pressure fluctuation over a period of time. A larger variance indicates more dramatic changes in water pressure; a smaller variance indicates relatively stable water pressure. By using variance as a dynamic feature, we can quickly determine whether the water pressure system is stable.
[0013] Preferably, the dynamic feature is the average value of the difference sequence corresponding to the water pressure time series.
[0014] The difference sequence of a water pressure time series represents the change in water pressure at adjacent time points, and its average value reflects the average trend of water pressure change over a period of time. If the average value of the difference sequence is positive, it indicates that the water pressure is generally increasing; if it is negative, it indicates that the water pressure is decreasing; if it is close to zero, the water pressure change is small.
[0015] Preferably, after assigning corresponding initial weights to the static features and the dynamic features in the clustering process, the method further includes: Calculate the difference between the static characteristics and the dynamic characteristics of any two water pressure characteristics, multiply these two differences by the corresponding initial weights, and square them. Add the weighted squared static and dynamic feature differences and take the square root to obtain the clustering distance between the two water pressure characteristics.
[0016] Static and dynamic features represent different aspects of water pressure. Static features may indicate the stable state of water pressure at a given moment, while dynamic features may indicate the rate of change or fluctuation of water pressure over time. Incorporating both into the cluster distance calculation provides a more comprehensive measure of the similarities or differences between two water pressure features. Assigning initial weights to static and dynamic features allows for flexible adjustment of their importance in the clustering process.
[0017] Preferably, the clustering process further includes: The deviations of any two collected water pressure time series at each moment are summed up, and the static distance between the two water pressure time series is obtained by normalization; Calculate the normalized value of the ratio of the covariance of the difference series corresponding to the two water pressure time series to their respective standard deviations, and then obtain the dynamic distance between the two water pressure time series; The weighted sum of the static distance and the dynamic distance is taken as the clustering distance between two water pressure features.
[0018] The static distance reflects the difference between the two time series at the overall level by summing the deviations of any two water pressure time series at each moment and normalizing them. The dynamic distance reflects the difference in the changing trend of the two time series by calculating the normalized value of the ratio of the covariance of the difference series corresponding to the two water pressure time series to their respective standard deviations. By calculating the weighted sum of the static distance and the dynamic distance, the clustering distance obtained can quantify the similarity or difference between the two water pressure time series.
[0019] Preferably, the process of obtaining the evaluation function includes: Calculate the sum of the intersections of the feeding error sets between all pairs of clusters; Calculate the union of all cluster feeding error sets; The ratio of the sum of the intersections of the feeding error sets between all cluster pairs to the union of the feeding error sets of all clusters is used as the evaluation function.
[0020] The ratio of the sum of intersections to the union is used as the evaluation function. The smaller the ratio is, the smaller the overlapping error between clusters is relative to the entire error range, the higher the clarity and distinction of the clusters are, and the better the clustering effect is; conversely, the larger the ratio is, the worse the clustering effect is.
[0021] Preferably, the step of adjusting the amount of water used in real-time feeding according to the optimal clustering result to complete the drinking water management of livestock includes: The static and dynamic characteristics of the pipeline water pressure in the real-time feeding time period are calculated, and the static and dynamic characteristics of the real-time water pressure are weighted and summed according to the optimal weight distribution to obtain the real-time water pressure characteristics. The historical cluster to which the real-time water pressure characteristics belong is found, and the mean of the feeding errors in the historical cluster is used as the real-time feeding error. When the real-time feeding error is greater than a set threshold, the value of the real-time feeding error is used as the amount of re-feeding.
[0022] Determining the feeding amount based on real-time water pressure characteristics and the mean feeding error in historical clusters can more accurately control the water volume, reduce water overflow caused by overfeeding, further improve the utilization efficiency of water resources, and reduce breeding costs.
[0023] Preferably, the clustering is K-means clustering.
[0024] In a second aspect, an automatic feeding system based on solenoid valve flowmeter data includes: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, any one of the livestock solenoid valve flowmeter drinking water automatic feeding methods is implemented.
[0025] The beneficial effects of the present invention are: The present invention first collects the historical water pressure time series of the drinking water pipe and the target feeding water volume and actual feeding water volume collected by the flow meter, calculates the feeding error, and then clusters the water pressure characteristics. In the clustering process, initial weights are assigned to static characteristics and dynamic characteristics. The clustering operation is repeated by constructing an evaluation function to finally obtain the optimal clustering result and the optimal weight distribution. The real-time feeding water volume is adjusted based on the optimal weight distribution obtained by cluster analysis, which can more accurately control the water consumption of livestock, making it closer to the target feeding water volume, and avoiding insufficient drinking water for livestock or waste of water resources due to insufficient or excessive feeding. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 This is a method flow chart of steps S1 to S3 in the automatic feeding method based on solenoid valve flow meter data in an embodiment of the present invention. DETAILED DESCRIPTION
[0027] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, but not all of the embodiments.
[0028] The basic principle of the feeding method of this invention is to control the water flow through a solenoid valve. When feeding is required, the solenoid valve opens, allowing water to flow through a pipe into the feeding area. When the set feeding water volume is reached, the solenoid valve closes, stopping feeding. A flow meter measures the amount of water flowing through the pipe, i.e., the feeding water volume. The flow meter data is used to determine whether the set target feeding volume has been achieved.
[0029] Reference Figure 1 The automatic feeding method based on the electromagnetic valve flow meter data includes steps S1 to S3, which are as follows: S1: Collecting the historical water pressure time series of the drinking water pipeline and the target feeding water volume and the actual feeding water volume collected by the flow meter.
[0030] In one embodiment, a pressure sensor is used to record the change in water pipe pressure over time during each feeding process, constructing a time series of water pressure in the water pipe during each feeding process. A flow meter is then used to collect the target feeding volume (i.e., the desired feeding volume set in advance) and the actual feeding volume (i.e., the actual water volume recorded by the flow meter). In other words, the data collected at one time includes the corresponding water pressure time series, target feeding volume, and actual feeding volume within the collection period.
[0031] The collection time is the same each time.
[0032] Furthermore, all collected data are cleaned and normalized, which is the existing technology and will not be described in detail.
[0033] S2: Calculate the static and dynamic characteristics of each water pressure feature in the water pressure time series, and calculate the feeding error based on the target feeding water volume and the actual feeding water volume at each feeding time; cluster the water pressure features, and assign corresponding initial weights to the static and dynamic features during the clustering process. After the clustering is completed, multiple clusters are obtained. An evaluation function is constructed based on the difference in feeding errors in each cluster. The clustering operation is repeated according to the evaluation function. When the evaluation function value reaches the minimum, the optimal clustering result is obtained, and the corresponding weight distribution is the optimal weight distribution.
[0034] In pipeline systems, feeding rates (e.g., the delivery rate of liquids or gases) must be precisely controlled to meet specific target requirements. However, there is often an error between the actual feeding rate and the target feeding rate. This error can be affected by variations in pipeline water pressure. By analyzing the relationship between pipeline water pressure characteristics and feeding error, we can identify the key factors affecting feeding error, thereby optimizing feeding control strategies, reducing error, and improving system stability and reliability.
[0035] Furthermore, the static and dynamic characteristics of pipeline water pressure have different impacts on feeding errors. The static characteristic reflects the average level of pipeline pressure, while the dynamic characteristic reflects pressure fluctuations. By extracting these two characteristics separately, we can more comprehensively describe the changes in pipeline water pressure.
[0036] In one embodiment, the average value of the water pressure time series obtained in S1 is calculated and used as a static feature, that is, reflecting the overall level or baseline value of the pipeline pressure over a period of time. Then, the variance of the water pressure time series is calculated and used as a dynamic feature.
[0037] In another embodiment, the average value of the difference sequence corresponding to the water pressure time series can also be calculated and used as the dynamic feature. The dynamic feature reflects the fluctuation or change trend of the pipeline pressure over time.
[0038] By combining static and dynamic features, a pipeline pressure feature vector containing two dimensions can be obtained.
[0039] In one embodiment, a feeding error is calculated based on the target feeding water volume (i.e., the feeding volume collected by the flow meter) and the actual feeding water volume during each feeding. That is, the error is obtained by subtracting the target feeding water volume from the actual feeding water volume. The error reflects the accuracy of the flow meter measurement.
[0040] The static and dynamic characteristics of pipeline pressure have different impacts on feeding errors. For example, if the static characteristics show consistently high pipeline pressure, the flow meter may continuously collect high water volumes, resulting in excessive feeding amounts. If the dynamic characteristics show frequent fluctuations in pipeline pressure over a short period of time, the water volume collected by the flow meter will also fluctuate, potentially causing the feeding amount to fluctuate, affecting the animals' normal drinking water. Static and dynamic characteristics have different impacts on feeding errors. During the actual feeding process, they work together to control feeding amounts by providing different information (long-term trends and short-term fluctuations).
[0041] Cluster analysis is the process of grouping similar data points into clusters. Both static and dynamic features play an important role in this process. However, different features may have different impacts on the clustering results. By assigning optimal weights to static and dynamic features, we can ensure that their contributions to the clustering process are appropriately reflected, thereby improving clustering accuracy.
[0042] In one embodiment, clustering is performed using a K-means clustering algorithm. First, an initial weight is assigned to the static and dynamic features of the pipeline water pressure. Then, the difference between the static features and the difference between the dynamic features are calculated. These two differences are then multiplied by the corresponding initial weights and squared. Next, the weighted squared static feature differences and dynamic feature differences are added together. Finally, the square root of the sum is taken to obtain the cluster distance between the two pipeline pressures.
[0043] Then the above cluster distance satisfies the relationship: Where, For the The water pressure and The cluster distance between water pressures, 、 Respectively The static and dynamic characteristics of water pressure, 、 Respectively The dynamic characteristics of water pressure, is the initial weight of the static feature, is the initial weight of the dynamic feature.
[0044] In another embodiment, instead of directly processing the static and dynamic characteristics of water pressure, the deviations of any two collected water pressure time series at each moment are first summed, and the static distance between the two water pressure time series is obtained by normalization.
[0045] Then the static distance between the two water pressure time series mentioned above satisfies the relationship: Where, is the static distance between two water pressure time series, The first water pressure time series of one of the two selected water pressure time series is The pressure value at the time of collection, The other water pressure time series is selected from the two water pressure time series. The pressure value at the time of collection, is the total time of collection, Indicates normalization processing.
[0046] Then, the normalized value of the ratio of the covariance of the difference series corresponding to the two selected water pressure time series to their respective standard deviations is calculated, and the dynamic distance between the two water pressure time series is obtained.
[0047] Then the dynamic distance between the two water pressure time series mentioned above satisfies the relationship: Where, is the dynamic distance between two water pressure time series, represents the difference sequence of one of the two selected water pressure time series, represents the difference sequence of the other water pressure time series among the two selected water pressure time series, represents the covariance, represents the standard deviation, Indicates normalization processing.
[0048] Finally, the weighted sum of the static distance and the dynamic distance is taken as the clustering distance between the two water pressure features.
[0049] Then the above cluster distance satisfies the relationship: Where, For the The water pressure and The cluster distance between water pressures, is the static distance between two water pressure time series, is the dynamic distance between two water pressure time series, is the initial weight of the static feature, is the initial weight of the dynamic feature.
[0050] The water pressure is clustered based on the cluster distance between the two water pressure features calculated above, and similar data are grouped into one cluster. After clustering is completed, each cluster has a corresponding feeding error set, which contains the feeding errors of all data points in the cluster.
[0051] In order to quantify the clustering effect, the evaluation function after clustering is constructed, that is, the constructed evaluation function satisfies the relationship: Where, represents the evaluation function after clustering, is the sum of the intersection of the feeding error sets between all cluster pairs, For the The feeding error set corresponding to the clusters, is the total number of clusters, Represents a union.
[0052] The smaller the value of the above evaluation function is, the smaller the intersection of the feeding error sets between different clusters is, that is, the better the clustering effect is, that is, the feeding errors in different clusters have better discrimination.
[0053] Furthermore, by adjusting the weights of static and dynamic features, clustering is performed multiple times, and the evaluation function value after each clustering is calculated. When the evaluation function value reaches a minimum, the clustering result at that time is considered the optimal clustering result. This weight distribution is also the optimal weight distribution that can most effectively reflect the impact of static and dynamic features on feeding error.
[0054] S3: Adjust the amount of water during real-time feeding based on the optimal clustering results to complete the livestock drinking water management.
[0055] In one embodiment, the static and dynamic characteristics of the pipeline water pressure during the real-time feeding period are calculated, and the real-time static and dynamic characteristics of the water pressure are weighted and summed according to the optimal weight distribution to obtain the real-time water pressure characteristic. The historical cluster to which the real-time water pressure characteristic belongs is found (the distance between the real-time water pressure characteristic and each historical cluster is calculated), and the mean of the feeding errors in the historical cluster is used as the real-time feeding error. When the real-time feeding error is greater than a set threshold, the value of the real-time feeding error is used as the re-feeding amount. When the feeding error is less than the set threshold, it indicates that the current feeding error is within an acceptable range. At this time, there is no need to re-feed or correct the feeding amount, and the current feeding status is maintained.
[0056] It should be noted that the threshold is set according to the actual feeding situation, or certain livestock are selected for experiments, different feeding error thresholds are set, and changes in indicators such as livestock growth performance and health status are observed, and the most appropriate threshold is determined based on the test results.
[0057] The system includes a processor and a memory, wherein the memory stores computer program instructions. When the computer program instructions are executed by the processor, the automatic drinking water feeding method of the livestock solenoid valve flowmeter according to the first aspect of the present invention is implemented.
[0058] The system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface. The configuration and functions of these components are known in the art and therefore will not be described in detail here.
[0059] It should be noted that those skilled in the art may make various modifications and improvements without departing from the scope of the present invention, and these modifications and improvements fall within the scope of protection of the present invention. Therefore, the scope of protection of the patent for this invention shall be based on the appended claims.
Claims
1. An automatic feeding method based on electromagnetic valve flow meter data, characterized in that: include: Collecting the historical water pressure time series of the drinking water pipeline and the target feeding water volume and actual feeding water volume collected by the flow meter; The static and dynamic characteristics of each water pressure feature in the water pressure time series are calculated, and the feeding error is calculated based on the target feeding water volume and the actual feeding water volume at each feeding time. The water pressure features are clustered, and corresponding initial weights are assigned to the static and dynamic features during the clustering process. After the clustering is completed, multiple clusters are obtained. An evaluation function is constructed based on the difference in feeding error in each cluster. The clustering operation is repeated based on the evaluation function. When the evaluation function value reaches the minimum, the optimal clustering result is obtained, and the corresponding weight distribution is the optimal weight distribution. The amount of water used in real-time feeding is adjusted according to the optimal clustering results to complete the drinking water management of livestock.
2. The automatic feeding method based on electromagnetic valve flowmeter data according to claim 1, characterized in that: The static characteristic is the average value of the water pressure time series.
3. The automatic feeding method based on electromagnetic valve flowmeter data according to claim 2, characterized in that: The dynamic feature is the variance of the water pressure time series.
4. The automatic feeding method based on electromagnetic valve flowmeter data according to claim 1, characterized in that: The dynamic characteristic is the average value of the difference sequence corresponding to the water pressure time series.
5. The automatic feeding method based on electromagnetic valve flowmeter data according to claim 3, characterized in that: After assigning corresponding initial weights to the static features and the dynamic features in the clustering process, the method further includes: Calculate the difference between the static characteristics and the dynamic characteristics of any two water pressure characteristics, multiply these two differences by the corresponding initial weights, and square them. Add the weighted squared static and dynamic feature differences and take the square root to obtain the clustering distance between the two water pressure characteristics.
6. The automatic feeding method based on electromagnetic valve flowmeter data according to claim 3, characterized in that: The clustering process also includes: The deviations of any two collected water pressure time series at each moment are summed up, and the static distance between the two water pressure time series is obtained by normalization; Calculate the normalized value of the ratio of the covariance of the difference series corresponding to the two water pressure time series to their respective standard deviations, and then obtain the dynamic distance between the two water pressure time series; The weighted sum of the static distance and the dynamic distance is taken as the clustering distance between two water pressure features.
7. The automatic feeding method based on electromagnetic valve flowmeter data according to claim 5, characterized in that: The process of obtaining the evaluation function includes: Calculate the sum of the intersections of the feeding error sets between all pairs of clusters; Calculate the union of all cluster feeding error sets; The ratio of the sum of the intersections of the feeding error sets between all cluster pairs to the union of the feeding error sets of all clusters is used as the evaluation function.
8. The automatic feeding method based on electromagnetic valve flowmeter data according to claim 7, characterized in that: The method of adjusting the amount of water during real-time feeding according to the optimal clustering result to complete the livestock drinking water management includes: The static and dynamic characteristics of the pipeline water pressure in the real-time feeding time period are calculated, and the static and dynamic characteristics of the real-time water pressure are weighted and summed according to the optimal weight distribution to obtain the real-time water pressure characteristics. The historical cluster to which the real-time water pressure characteristics belong is found, and the mean of the feeding errors in the historical cluster is used as the real-time feeding error. When the real-time feeding error is greater than a set threshold, the value of the real-time feeding error is used as the amount of re-feeding.
9. The automatic feeding method based on electromagnetic valve flowmeter data according to claim 8, characterized in that: The clustering is K-means clustering.
10. Automatic feeding system based on electromagnetic valve flow meter data, characterized in that: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the automatic feeding method of drinking water of the livestock solenoid valve flowmeter according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Big data processing method based on ultralow power solenoid valve
CN109210268A
Livestock and poultry water dispensing management system and water dispensing control method thereof
CN110024705A
Abnormal water consumption data monitoring method for full-automatic livestock drinking water system
CN118861739A
Electromagnetic valve accurate control method based on flow dynamic adjustment
CN119244805A
Cited By
Self-adaptive electric energy metering algorithm and system based on dynamic environment compensation
CN120804748A
An adaptive electric energy metering algorithm and system based on dynamic environment compensation
CN120804748B