Pig house environment optimization method and system based on multi-source data fusion
By constructing an environmental factor prediction model through multi-source data fusion, the problem of inaccurate prediction and comprehensive evaluation of future changes in pig house environment optimization was solved, realizing coordinated and precise control of pig house environment, and improving the quality of environmental monitoring data and breeding efficiency.
Patent Information
- Application Number
- CN202511809815.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-03
- Publication Date
- 2026-02-06
AI Technical Summary
Existing pig house environmental optimization systems lack the ability to predict future environmental change trends, and their comprehensive environmental assessments are not accurate enough, making it difficult to achieve coordinated, precise, and forward-looking control of multiple environmental factors in pig houses.
By fusing multi-source data, an environmental factor prediction model is constructed. Data filtering technology is used to remove noise, and the environmental quality level is calculated and precisely controlled to achieve synergistic optimization of the pig house environment.
It enables precise and forward-looking control of the pig house environment, improves the quality and reliability of environmental monitoring data, and can promptly identify potential problems and take targeted measures to maximize breeding efficiency and improve animal welfare.
Smart Images

Figure CN121478049A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of pig house environment optimization technology, and in particular to a method and system for optimizing pig house environment based on multi-source data fusion. Background Technology
[0002] Multi-source data fusion refers to combining data from different sensors and different representations about the same environment or object. Pig house environment optimization refers to maintaining various environmental parameters (such as temperature, humidity, air quality, light, ventilation, etc.) within the pig house within the range most suitable for pig growth, development, reproduction, and health through human intervention and regulation, while maximizing resource utilization efficiency, ultimately achieving the goals of maximizing breeding benefits and improving animal welfare.
[0003] Most existing systems rely on real-time monitoring of environmental parameters for control, lacking the ability to predict future environmental trends. Secondly, in terms of comprehensive environmental assessment, they often depend on simple weighted averages or fuzzy reasoning, failing to effectively address the ambiguity of evaluation boundaries for various environmental factors and the subjectivity of indicator weight allocation. This results in inaccurate evaluation results, making it difficult to support optimal collaborative control decisions. Therefore, how to achieve coordinated, precise, and forward-looking control of multiple environmental factors in pigsties is an urgent technical problem to be solved. Summary of the Invention
[0004] This invention provides a method for optimizing the pig house environment based on multi-source data fusion and a computer-readable storage medium. Its main purpose is to achieve coordinated, precise and forward-looking control of multiple environmental factors in pig houses.
[0005] To achieve the above objectives, this invention provides a method for optimizing pigsty environments based on multi-source data fusion, comprising:
[0006] The pigsty to be tested is identified, the pigsty environmental testing instruction is received, and the environmental parameters of the pigsty to be tested are tested according to the pigsty environmental testing instruction to obtain the environmental monitoring sequence set and the tested pigsty.
[0007] Perform data filtering on the environmental monitoring sequence set to obtain a filtered environmental monitoring value sequence set;
[0008] An environmental factor prediction model is constructed based on a filtered environmental monitoring value sequence set.
[0009] Determine the extraction order, and extract the filter environment monitoring parameter set from the filter environment monitoring value sequence set according to the extraction order;
[0010] The environmental quality level at the current moment is calculated based on the filtered environmental monitoring parameter set. The environmental control of the detected pigsty is then carried out according to the environmental quality level at the current moment to obtain a healthy pigsty.
[0011] By compiling a set of healthy pigsties, an environmental optimization of pigsty environment based on multi-source data fusion was completed, using an environmental factor prediction model and the set of healthy pigsties.
[0012] Optionally, the pigsty to be tested includes: a pigsty air outlet, a pigsty air inlet, and a gas mixing chamber. Sensors are installed at both the pigsty air outlet and the pigsty air inlet, and the sensors are preset with a sampling period. The gas mixing chamber includes: a refrigeration compressor, an air heating pipe, an exhaust gas valve, a fresh air valve, and a main ventilation valve.
[0013] Optionally, performing data filtering on the environmental monitoring sequence set to obtain a filtered environmental monitoring value sequence set includes:
[0014] Set the basic smoothness and change sensitivity, extract environmental monitoring sequences from the environmental monitoring sequence set sequentially, and perform the following operations on each extracted environmental monitoring sequence:
[0015] Environmental monitoring values are extracted sequentially from the extracted environmental monitoring sequences, and the target window monitoring value sequence is identified based on the extracted environmental monitoring values.
[0016] The first derivative of the extracted environmental monitoring values is calculated, and the initial adaptive standard deviation is calculated based on the basic smoothness, change sensitivity, and first derivative value.
[0017] The adaptive standard deviation is determined from the initial adaptive standard deviation and the preset lower limit of the standard deviation. The set of neighborhood point weight values is calculated based on the extracted environmental monitoring values, the adaptive standard deviation, and the target window monitoring value sequence.
[0018] Calculate the initial filtered environmental monitoring value based on the domain point weight value set and the target window monitoring value sequence, and summarize the initial filtered environmental monitoring value to obtain the initial filtered environmental monitoring value set corresponding to the environmental monitoring sequence;
[0019] Calculate the filtering variance and original variance of the initial filtered environmental monitoring value set and the extracted environmental monitoring sequence respectively, and calculate the variance change rate based on the original variance and the filtering variance;
[0020] If the variance change rate is within the preset variance change rate range, then the initial filter environment monitoring value is used as the filter environment monitoring value.
[0021] If the variance change rate is not within the preset variance change rate interval, the basic smoothness and change sensitivity are adjusted to obtain updated basic smoothness and updated change sensitivity. The updated basic smoothness and updated change sensitivity are used as the basic smoothness and change sensitivity, respectively. The process returns to the step of calculating the initial adaptive standard deviation based on the basic smoothness, change sensitivity and first derivative value until the variance change rate is within the variance change rate interval.
[0022] By summarizing the filtered environmental monitoring value sequences, we obtain the filtered environmental monitoring value sequence set corresponding to the environmental monitoring sequence set.
[0023] Optionally, the step of calculating the neighborhood point weight value set based on the extracted environmental monitoring values, adaptive standard deviation, and target window monitoring value sequence includes:
[0024] For each target window monitoring value in the target window monitoring value sequence, perform the following operation:
[0025] The neighborhood point weights are calculated based on the adaptive standard deviation, the target window monitoring value, and the extracted environmental monitoring values. The calculation formula is as follows:
[0026]
[0027] in, Indicates the neighborhood point weight value. This represents the natural exponential function. Indicates the target window monitoring value. This represents the extracted environmental monitoring values. Indicates adaptive standard deviation;
[0028] Summarize the domain point weight values to obtain the domain point weight value set.
[0029] Optionally, the construction of the environmental factor prediction model based on the filtered environmental monitoring value sequence set includes:
[0030] Set the prediction target, historical window length, and prediction window length, divide the filtered environmental monitoring value sequence set, and obtain the training sample set;
[0031] The training sample set is divided into training set and test set according to time order. Both training set and test set are normalized to obtain normalized training set and normalized test set.
[0032] Input the normalized training set, prediction target, historical window length, and prediction window length into the pre-constructed initial LSTM-AGF hybrid prediction model to obtain the trained hybrid prediction model.
[0033] The prediction performance of the trained hybrid prediction model was tested using a normalized test set to obtain the prediction accuracy index.
[0034] If the prediction accuracy index is within the preset optimal prediction accuracy index range, then the trained hybrid prediction model will be used as the environmental factor prediction model.
[0035] Optionally, the calculation of the current environmental quality level based on the filtered environmental monitoring parameter set includes:
[0036] Multiple sets of pig house environmental quality assessment levels were identified. Based on these sets, multiple sets of linear unknown measure functions were identified. The sets of pig house environmental quality assessment levels include multiple pig house environmental quality assessment levels, and the sets of linear unknown measure functions include multiple linear unknown measure functions. There is a one-to-one correspondence between the pig house environmental quality assessment levels and the linear unknown measure functions. The number of sets of pig house environmental quality assessment levels is the same as the number of environmental monitoring sequences in the environmental monitoring sequence set.
[0037] The filter environment monitoring parameters are extracted sequentially from the filter environment monitoring parameter set, and the target linear unknown measure function set is identified from multiple linear unknown measure function sets based on the extracted filter environment monitoring parameters;
[0038] Substituting the filtered environmental monitoring parameters into each target linear unknown measure function in the target linear unknown measure function set yields a single index measure vector, which includes multiple function values.
[0039] A single index measurement matrix is constructed based on the index measurement vectors corresponding to all the filtering environment monitoring parameters. The single index measurement matrix includes multiple row vectors and multiple column vectors, and the row vectors correspond one-to-one with the single index measurement vectors.
[0040] The environmental quality level at the current moment is calculated using a single-index measurement matrix.
[0041] Optionally, the step of calculating the environmental quality level at the current moment using a single-index measurement matrix includes:
[0042] Obtain the comprehensive weight set, extract column vectors from the single index measurement matrix in sequence, and calculate the membership degree of the level based on the extracted column vectors and the comprehensive weight set;
[0043] Summarize the membership degrees of different levels to obtain a comprehensive measure set, and arrange the comprehensive measure set to obtain a comprehensive measure sequence;
[0044] The final evaluation level is calculated based on the comprehensive measurement sequence and the preset confidence threshold. The formula for calculating the final evaluation level is as follows:
[0045]
[0046] in, Indicates the final evaluation level. This represents a function that takes the minimum value. The serial number indicates the evaluation level of the pigsty's environmental quality. An index representing the degree of membership. Indicates the first in the comprehensive measure sequence Each level of membership degree, This represents the confidence threshold.
[0047] Optionally, obtaining the comprehensive weight set includes:
[0048] The subjective weight set of environmental parameters is obtained based on the pre-constructed analytic hierarchy process, and the set of historical pig house environmental sequences is obtained. A historical data matrix is constructed based on the set of historical pig house environmental sequences. The historical data matrix includes multiple historical column vectors, and each historical column vector corresponds one-to-one with a historical pig house environmental sequence.
[0049] Data normalization is performed on each historical column vector in the historical data matrix to obtain a standard historical data matrix. The standard historical data matrix includes multiple standard column vectors, and each standard column vector includes multiple normalized sample values.
[0050] Extract standard column vectors sequentially from the standard historical data matrix;
[0051] Calculate the sample weight of each normalized sample value in the extracted standard column vector to obtain multiple sample weights, calculate the parameter information entropy based on the multiple sample weights, and calculate the parameter difference coefficient based on the parameter information entropy.
[0052] Summarize the parameter difference coefficients to obtain the parameter difference coefficient set, calculate the comprehensive difference coefficient based on the parameter difference coefficient set, and calculate the objective weight set of environmental parameters based on the comprehensive difference coefficient and the parameter difference coefficient set.
[0053] The subjective weights of environmental parameters are extracted sequentially from the set of subjective weights of environmental parameters, and the objective weights of the target environmental parameters are confirmed from the set of objective weights of environmental parameters based on the extracted subjective weights of environmental parameters.
[0054] The comprehensive weights are calculated based on the subjective weights of the extracted environmental parameters and the objective weights of the target environmental parameters. The comprehensive weights are then summarized to obtain the comprehensive weight set.
[0055] Optionally, the step of adjusting the environment of the tested pigsty according to the current environmental quality level to obtain a healthy pigsty includes:
[0056] An environmental control strategy is matched based on the current environmental quality level. The environmental control strategy includes temperature control, humidity control, carbon dioxide concentration control, or toxic gas control.
[0057] Environmental control strategies were applied to the tested pig houses to achieve healthy pig farming conditions.
[0058] To achieve the above objectives, the present invention also provides a pigsty environment optimization system based on multi-source data fusion, comprising:
[0059] The multi-source environmental data acquisition module is used to identify the pigsty to be tested, receive the pigsty environmental testing instructions, perform environmental parameter testing on the pigsty to be tested according to the pigsty environmental testing instructions, obtain the environmental monitoring sequence set and the tested pigsty, and perform data filtering operation on the environmental monitoring sequence set to obtain the filtered environmental monitoring value sequence set.
[0060] The environmental prediction model building module is used to build environmental factor prediction models based on filtered environmental monitoring value sequence sets.
[0061] The pigsty environmental quality assessment module is used to determine the extraction order and extract the set of filtered environmental monitoring parameters from the set of filtered environmental monitoring values according to the extraction order.
[0062] The pigsty environment optimization module is used to calculate the current environmental quality level based on the filtered environmental monitoring parameter set, adjust the environment of the detected pigsties according to the current environmental quality level, obtain healthy pigsties, summarize the healthy pigsties to obtain a healthy pigsty set, and complete the pigsty environment optimization based on multi-source data fusion based on the environmental factor prediction model and the healthy pigsty set.
[0063] To address the above problems, the present invention also provides an electronic device, the electronic device comprising:
[0064] Memory, storing at least one instruction;
[0065] The processor executes the instructions stored in the memory to implement the above-described method for optimizing the pigsty environment based on multi-source data fusion.
[0066] To address the aforementioned problems, the present invention also provides a computer-readable storage medium storing at least one instruction, which is executed by a processor in an electronic device to implement the aforementioned method for optimizing pigsty environment based on multi-source data fusion.
[0067] To address the problems described in the background section, this invention identifies the pigsty to be inspected, receives environmental monitoring instructions, and performs environmental parameter monitoring on the pigsty according to these instructions, obtaining an environmental monitoring sequence set and the inspected pigsty data. This invention's multi-source data comprehensively reflects the environmental conditions of the pigsty, providing rich and accurate basic information for subsequent environmental analysis and optimization. Data filtering is performed on the environmental monitoring sequence set to obtain a filtered environmental monitoring value sequence set. During environmental monitoring, various factors may interfere with the data, leading to noise. Data filtering effectively removes this noise, making the filtered temperature, humidity, ammonia concentration, and carbon dioxide concentration sequences smoother and more accurate, improving data quality and reliability. An environmental factor prediction model is constructed based on the filtered environmental monitoring value sequence set. This model can predict the future environmental conditions of the pigsty based on historical filtered environmental monitoring data, helping to identify potential environmental problems in advance. By predicting changes in environmental factors, more scientific and reasonable environmental control measures can be formulated. This invention employs a strategy to determine the extraction order. Based on this order, a set of filtered environmental monitoring parameters is extracted from the filtered environmental monitoring value sequence set. This invention extracts key parameters such as filtered temperature monitoring values, filtered humidity monitoring values, filtered ammonia concentration, and filtered carbon dioxide concentration from the filtered environmental monitoring value sequence set. This simplifies complex sequence data into specific environmental indicators, facilitating subsequent environmental quality assessment and control decisions. The current environmental quality level is calculated based on the filtered environmental monitoring parameter set. Environmental control measures are then implemented in the inspected pigsties based on this current environmental quality level to obtain healthy pigsties. This invention quantifies the environmental condition of pigsties by calculating environmental quality levels, allowing farmers to intuitively understand the environmental quality level of the pigsties. This helps in the timely detection of environmental problems and the implementation of targeted improvement measures. Simultaneously, environmental control based on the environmental quality level enables precise environmental management. A set of healthy pigsties is compiled, and environmental optimization of pigsties based on multi-source data fusion is completed based on the environmental factor prediction model and the healthy pigsty set. Therefore, this invention can achieve coordinated, precise, and forward-looking control of multiple environmental factors in pigsties. Attached Figure Description
[0068] Figure 1 This is a flowchart illustrating a method for optimizing a pigsty environment based on multi-source data fusion, provided in an embodiment of the present invention.
[0069] Figure 2 This is a functional block diagram of a pigsty environment optimization system based on multi-source data fusion provided in an embodiment of the present invention;
[0070] Figure 3 This is a schematic diagram of the structure of an electronic device for implementing the pigsty environment optimization method based on multi-source data fusion, according to an embodiment of the present invention.
[0071] Explanation of reference numerals in the attached figures:
[0072] 10. Electronic device; 11. Processor; 12. Memory; 13. Bus.
[0073] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0074] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0075] This application provides a method for optimizing pigsty environments based on multi-source data fusion. The executing entity of this method includes, but is not limited to, at least one electronic device that can be configured to execute the method provided in this application, such as a server or a terminal. In other words, the method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes, but is not limited to, a single server, a server cluster, a cloud server, or a cloud server cluster.
[0076] Reference Figure 1 The diagram shown is a flowchart illustrating a pigsty environment optimization method based on multi-source data fusion according to an embodiment of the present invention. In this embodiment, the pigsty environment optimization method based on multi-source data fusion includes:
[0077] S1. Identify the pigsty to be tested, receive the pigsty environmental testing instruction, and perform environmental parameter testing on the pigsty to be tested according to the pigsty environmental testing instruction to obtain the environmental monitoring sequence set and the tested pigsty.
[0078] Specifically, the environmental monitoring sequence set includes: temperature value sequence, humidity value sequence, ammonia concentration sequence, and carbon dioxide concentration sequence.
[0079] It should be explained that the pigsty environment monitoring command refers to the command issued by the host computer to start the sampling task of all sensors in the pigsty to be tested, and to provide a time reference for the subsequent generation of environmental monitoring parameter sets.
[0080] In detail, the pigsty to be tested includes: a pigsty air outlet, a pigsty air inlet, and a gas mixing box. Sensors are installed at both the pigsty air outlet and the pigsty air inlet, and the sensors are preset with a sampling period. The gas mixing box includes: a refrigeration compressor, an air heating pipe, an exhaust gas valve, a fresh air valve, and a main ventilation valve.
[0081] It should be explained that the pigsty air outlet refers to the opening at the top or upper side wall of the pigsty being tested, which connects to the external exhaust duct. This opening is used to expel polluted air from the pigsty, creating a negative pressure zone. The pigsty air inlet refers to the opening at the lower side wall of the pigsty being tested, which connects to the outlet of the gas mixing chamber. This inlet is used to supply mixed air that has been regulated for temperature, humidity, and composition. It should also be noted that the pigsty being tested includes multiple pigs. Pigs refer to the individual pigs kept inside the pigsty being tested; their breathing, excretion, and heat production constitute the heat and pollution sources within the pigsty, and are the primary source of sensor data. Sensors include, but are not limited to, temperature sensors, humidity sensors, etc. Concentration sensor and A concentration sensor continuously generates environmental parameter data in the form of electrical signals within a preset sampling period. The sampling period refers to the pre-set time interval for sampling. A refrigeration compressor is the core component of a vapor compression refrigeration circuit, installed on the side wall of the gas mixing chamber. It is used to cool the circulating air under high-temperature conditions to provide cooling and reduce the temperature inside the pigsty. An air heating pipe is an electrically heated finned tube assembly arranged along the airflow direction of the gas mixing chamber. It is used to heat the mixed air under low-temperature conditions with equal humidity, ensuring the supply air temperature reaches the set value for the pigs' comfort zone. An exhaust gas valve is an electrically controlled proportional regulating valve, connected at one end to the pigsty's air outlet and at the other end to the gas mixing chamber's return air inlet. It is used to regulate the flow rate of recycled exhaust gas, achieving heat recovery and... Preliminary dilution. The fresh air damper is a regulating valve installed at the fresh air intake of the gas mixing chamber, used to adjust the air intake according to the ambient temperature. concentration, The concentration and preset humidity target values are used to adjust the amount of fresh outdoor air introduced to ensure sufficient oxygen in the pigsty and control the concentration of pollutants. The main ventilation valve is a regulating valve located between the outlet of the gas mixing chamber and the air inlet of the pigsty. It is used to adjust the total air supply to establish the required number of air exchanges and static pressure difference in the pigsty, provide a stable flow field for sensor sampling, and ensure that the mixed gas is evenly delivered into the pigsty.
[0082] S2. Perform data filtering operation on the environmental monitoring sequence set to obtain a filtered environmental monitoring value sequence set.
[0083] Specifically, the filtered environmental monitoring value sequence set includes: filtered temperature monitoring value sequence, filtered humidity monitoring value sequence, filtered ammonia concentration sequence, and filtered carbon dioxide concentration sequence.
[0084] Specifically, the step of performing data filtering on the environmental monitoring sequence set to obtain a filtered environmental monitoring value sequence set includes:
[0085] Set the basic smoothness and change sensitivity, extract environmental monitoring sequences from the environmental monitoring sequence set sequentially, and perform the following operations on each extracted environmental monitoring sequence:
[0086] Environmental monitoring values are extracted sequentially from the extracted environmental monitoring sequences, and the target window monitoring value sequence is identified based on the extracted environmental monitoring values.
[0087] The first derivative of the extracted environmental monitoring values is calculated, and the initial adaptive standard deviation is calculated based on the basic smoothness, change sensitivity, and first derivative value.
[0088] The adaptive standard deviation is determined from the initial adaptive standard deviation and the preset lower limit of the standard deviation. The set of neighborhood point weight values is calculated based on the extracted environmental monitoring values, the adaptive standard deviation, and the target window monitoring value sequence.
[0089] Calculate the initial filtered environmental monitoring value based on the domain point weight value set and the target window monitoring value sequence, and summarize the initial filtered environmental monitoring value to obtain the initial filtered environmental monitoring value set corresponding to the environmental monitoring sequence;
[0090] Calculate the filtering variance and original variance of the initial filtered environmental monitoring value set and the extracted environmental monitoring sequence respectively, and calculate the variance change rate based on the original variance and the filtering variance;
[0091] If the variance change rate is within the preset variance change rate range, then the initial filter environment monitoring value is used as the filter environment monitoring value.
[0092] If the variance change rate is not within the preset variance change rate interval, the basic smoothness and change sensitivity are adjusted to obtain updated basic smoothness and updated change sensitivity. The updated basic smoothness and updated change sensitivity are used as the basic smoothness and change sensitivity, respectively. The process returns to the step of calculating the initial adaptive standard deviation based on the basic smoothness, change sensitivity and first derivative value until the variance change rate is within the variance change rate interval.
[0093] By summarizing the filtered environmental monitoring value sequences, we obtain the filtered environmental monitoring value sequence set corresponding to the environmental monitoring sequence set.
[0094] It should be explained that an environmental monitoring sequence refers to a sequence of environmental data collected in chronological order. For example, an environmental monitoring sequence may be a temperature value sequence, a humidity value sequence, an ammonia concentration sequence, or a carbon dioxide concentration sequence. An environmental monitoring value refers to a single data point within the environmental monitoring sequence. A target window monitoring value sequence refers to a subsequence obtained centered on the extracted environmental monitoring value, based on a preset window size (e.g., 3), used for local analysis and filtering. For example, if the window size is 3 and the extracted environmental monitoring value is the 5th value (30), then the target window monitoring value sequence is [22, 25, 30, 28, 27]. The base smoothness and change sensitivity are pre-set values. A higher base smoothness results in a smoother filtering result. A higher change sensitivity is more sensitive to abrupt changes and retains more details. The first derivative value measures the rate of change of the current monitoring value, reflecting data fluctuations. The calculation of the initial adaptive standard deviation based on the base smoothness, change sensitivity, and first derivative approximation value refers to the value obtained by multiplying the change sensitivity by the first derivative approximation value and then adding the first derivative approximation value; this is the initial adaptive standard deviation. The lower limit of standard deviation is a pre-set value to prevent the filter from failing due to an excessively small adaptive standard deviation.
[0095] Importantly, calculating the initial filtered environment monitoring value based on the neighborhood point weight value set and the target window monitoring value sequence means multiplying each target window monitoring value in the target window monitoring value sequence by its corresponding neighborhood point weight value, and using this sum as the initial filtered environment monitoring value. The initial filtered environment monitoring value set refers to the collection of all initial filtered environment monitoring values. The filtering variance refers to the variance of the initial filtered environment monitoring value set, reflecting the degree of fluctuation in the filtered data. The original variance refers to the variance of the original environment monitoring sequence, reflecting the degree of fluctuation in the original data. The variance change rate refers to the value obtained by subtracting the filtering variance from the original variance and then dividing it by the original variance. The variance change rate interval refers to a pre-defined interval used to determine whether the variance change rate falls within the variance change rate interval. The filtered environment monitoring value refers to the initial filtered environment monitoring value corresponding to a variance change rate falling within the preset variance change rate interval. Adjusting the basic smoothness and change sensitivity means increasing the basic smoothness using a preset increase value (e.g., 0.1) and simultaneously decreasing the change sensitivity using a preset decrease value (e.g., 0.05). Updated base smoothness and updated change sensitivity refer to the adjusted base smoothness value and change sensitivity, respectively. The filtered environmental monitoring value sequence set refers to the set obtained by summing up each environmental monitoring sequence in the environmental monitoring sequence set after adaptive filtering.
[0096] It should be noted that if the variance change rate is within the preset variance change rate interval, it indicates that the currently set basic smoothness and change sensitivity parameters have achieved an ideal balance. The filtering operation effectively suppresses noise interference while fully preserving the true changing trend and key features of the environmental data, meeting the data quality requirements for subsequent environmental quality analysis and predictive modeling. If the variance change rate is not within the preset variance change rate interval, it indicates that the current parameter settings have not achieved the optimal filtering effect: when the variance change rate is lower than the lower limit of the interval, it reflects insufficient basic smoothness or excessive change sensitivity, resulting in insufficient noise filtering; when the variance change rate is higher than the upper limit of the interval, it indicates that the basic smoothness is too strong or the change sensitivity is too low, causing loss of effective signal and feature distortion. At this time, the system will automatically start the parameter optimization loop, adjusting the basic smoothness and change sensitivity parameters and re-executing the filtering calculation until the variance change rate is within the variance change rate interval, ensuring that the output data has a high signal-to-noise ratio and high fidelity.
[0097] In detail, the step of calculating the neighborhood point weight value set based on the extracted environmental monitoring values, adaptive standard deviation, and target window monitoring value sequence includes:
[0098] For each target window monitoring value in the target window monitoring value sequence, perform the following operation:
[0099] The neighborhood point weights are calculated based on the adaptive standard deviation, the target window monitoring value, and the extracted environmental monitoring values. The calculation formula is as follows:
[0100]
[0101] in, Indicates the neighborhood point weight value. This represents the natural exponential function. Indicates the target window monitoring value. This represents the extracted environmental monitoring values. Indicates adaptive standard deviation;
[0102] Summarize the domain point weight values to obtain the domain point weight value set.
[0103] It should be explained that adaptive standard deviation refers to taking the maximum value between the initial adaptive standard deviation and the lower limit of standard deviation. The neighborhood point weight value set refers to the set composed of neighborhood point weight values.
[0104] S3. Construct an environmental factor prediction model based on the filtered environmental monitoring value sequence set.
[0105] In detail, the construction of the environmental factor prediction model based on the filtered environmental monitoring value sequence set includes:
[0106] Set the prediction target, historical window length, and prediction window length, divide the filtered environmental monitoring value sequence set, and obtain the training sample set;
[0107] The training sample set is divided into training set and test set according to time order. Both training set and test set are normalized to obtain normalized training set and normalized test set.
[0108] Input the normalized training set, prediction target, historical window length, and prediction window length into the pre-constructed initial LSTM-AGF hybrid prediction model to obtain the trained hybrid prediction model.
[0109] The prediction performance of the trained hybrid prediction model was tested using a normalized test set to obtain the prediction accuracy index.
[0110] If the prediction accuracy index is within the preset optimal prediction accuracy index range, then the trained hybrid prediction model will be used as the environmental factor prediction model.
[0111] It should be explained that the prediction target refers to the type of output variable specified before training the environmental factor prediction model, including but not limited to at least one of temperature, humidity, ammonia concentration, or carbon dioxide concentration. The historical window length refers to how long of past data the model needs to review during prediction; this length determines the sequence step size of each model input and directly affects the temporal dependency range of the LSTM network's memory units. The prediction window length refers to how long of future data the model predicts at once. Dividing the filtered environmental monitoring value sequence set refers to dividing the filtered environmental monitoring value sequence set using a sliding window method. For example, samples from the first 80% of the time period in the training sample set are used as the training set, and samples from the last 20% of the time period are used as the test set. The normalized training set and normalized test set refer to the normalized training set and test set, respectively. The purpose of normalization is to eliminate the influence of different environmental factor dimensions and orders of magnitude, and also to accelerate the convergence of the model training process. The trained hybrid prediction model refers to an LSTM neural network with only random initial weights that has not yet learned any data patterns. A trained hybrid prediction model refers to an initial LSTM-AGF hybrid prediction model that has learned to map patterns from historical data to future data after millions of weight adjustments through optimization algorithms, by inputting a normalized training set into the model. The prediction accuracy metric is a weighted average of the mean absolute error and root mean square error calculated on the normalized test set. The optimal prediction accuracy metric range refers to a pre-defined error range. If the prediction accuracy metric falls within the pre-defined optimal prediction accuracy metric range, the trained hybrid prediction model is considered qualified and can be confirmed as an environmental factor prediction model for online prediction. If the prediction accuracy metric does not fall within the pre-defined optimal prediction accuracy metric range, the model structure or parameters need to be adjusted, and retraining is required. The model training steps of the environmental factor prediction model in this invention are existing technologies and will not be described in detail here.
[0112] S4. Determine the extraction order and extract the filter environment monitoring parameter set from the filter environment monitoring value sequence set according to the extraction order.
[0113] Specifically, the set of environmental monitoring parameters for filtering includes: filtered temperature monitoring value, filtered humidity monitoring value, filtered ammonia concentration, and filtered carbon dioxide concentration.
[0114] It should be explained that the extraction order refers to the pre-defined sequence in which data at the same time point are extracted from the filtered environmental monitoring value sequence set, specifically the filtered temperature monitoring value sequence, filtered humidity monitoring value sequence, filtered ammonia concentration sequence, and filtered carbon dioxide concentration sequence, from earliest to latest according to the timestamp. The filtered temperature monitoring value, filtered humidity monitoring value, filtered ammonia concentration, and filtered carbon dioxide concentration refer to the temperature value, humidity value, ammonia concentration, and carbon dioxide concentration after the filtering operation, respectively.
[0115] S5. Calculate the current environmental quality level based on the filtered environmental monitoring parameter set, and adjust the environment of the detected pigsty according to the current environmental quality level to obtain a healthy pigsty.
[0116] In detail, the calculation of the current environmental quality level based on the filtered environmental monitoring parameter set includes:
[0117] Multiple sets of pig house environmental quality assessment levels were identified. Based on these sets, multiple sets of linear unknown measure functions were identified. The sets of pig house environmental quality assessment levels include multiple pig house environmental quality assessment levels, and the sets of linear unknown measure functions include multiple linear unknown measure functions. There is a one-to-one correspondence between the pig house environmental quality assessment levels and the linear unknown measure functions. The number of sets of pig house environmental quality assessment levels is the same as the number of environmental monitoring sequences in the environmental monitoring sequence set.
[0118] The filter environment monitoring parameters are extracted sequentially from the filter environment monitoring parameter set, and the target linear unknown measure function set is identified from multiple linear unknown measure function sets based on the extracted filter environment monitoring parameters;
[0119] Substituting the filtered environmental monitoring parameters into each target linear unknown measure function in the target linear unknown measure function set yields a single index measure vector, which includes multiple function values.
[0120] A single index measurement matrix is constructed based on the index measurement vectors corresponding to all the filtering environment monitoring parameters. The single index measurement matrix includes multiple row vectors and multiple column vectors, and the row vectors correspond one-to-one with the single index measurement vectors.
[0121] The environmental quality level at the current moment is calculated using a single-index measurement matrix.
[0122] It should be explained that the pigsty environmental quality evaluation level set refers to a pre-defined set of environmental quality levels for a single environmental indicator (such as temperature, humidity, ammonia concentration, or carbon dioxide concentration) to characterize the quality state of that indicator. The pigsty environmental quality evaluation level set contains at least five ordered levels: Excellent, Good, Medium, Pass, and Poor. Each level has a one-to-one mapping relationship with a linear unknown measure function, and its number is equal to the number of environmental monitoring sequences contained in the environmental monitoring sequence set. The linear unknown measure function set is a set of functions specifically constructed for a particular environmental monitoring indicator. It contains multiple linear unknown measure functions designed to calculate the membership degree of the measured value of that indicator (such as temperature, humidity, ammonia concentration, or carbon dioxide concentration) relative to all predefined environmental quality levels. The number of linear unknown measure functions in the linear unknown measure function set is equal to the number of levels in the corresponding pigsty environmental quality evaluation level set. Each function is used to calculate the membership probability of the indicator value to the corresponding quality level and satisfies the normalization constraint: the sum of all function values under the same indicator is always equal to 1. The mathematical expression of the linear unknown measure function is a first-order polynomial, used to map the real values of filtered environmental monitoring parameters to the interval [0, 1], quantifying the degree of membership of the parameter to a specific quality level. The filtered environmental monitoring parameter refers to the value corresponding to a specific environmental indicator and the current moment after denoising by a digital filtering algorithm. The target linear unknown measure function set refers to a subset uniquely selected from the entire set of linear unknown measure functions, corresponding to the indicator type of the currently extracted filtered environmental monitoring parameter. The single-indicator measure vector is a row vector obtained by substituting the current filtered environmental monitoring parameter into its corresponding target linear unknown measure function set, arranged by all level membership values. The single-indicator measure matrix is a numerical matrix formed by stacking the single-indicator measure vectors of several different environmental indicators row by row. Each row of the matrix corresponds to an environmental indicator, and each column corresponds to a quality level. Its dimension is n×m, where n is the number of environmental indicators included in the evaluation, m is the number of levels, and it is used for subsequent weight fusion and comprehensive calculation of the environmental quality level at the current moment.
[0123] In detail, the calculation of the environmental quality level at the current moment using a single-index measurement matrix includes:
[0124] Obtain the comprehensive weight set, extract column vectors from the single index measurement matrix in sequence, and calculate the membership degree of the level based on the extracted column vectors and the comprehensive weight set;
[0125] Summarize the membership degrees of different levels to obtain a comprehensive measure set, and arrange the comprehensive measure set to obtain a comprehensive measure sequence;
[0126] The final evaluation level is calculated based on the comprehensive measurement sequence and the preset confidence threshold. The formula for calculating the final evaluation level is as follows:
[0127]
[0128] in, Indicates the final evaluation level. This represents a function that takes the minimum value. The serial number indicates the evaluation level of the pigsty's environmental quality. An index representing the degree of membership. Indicates the first in the comprehensive measure sequence Each level of membership degree, This represents the confidence threshold.
[0129] It should be explained that a column vector refers to a vector extracted column by column from a single-index measurement matrix, and each column vector includes multiple function values under the same level. The step of calculating the level membership degree based on the extracted column vectors and the comprehensive weight set is as follows: the sum of the product of the function values corresponding to the indicators in the extracted column vectors and the corresponding comprehensive weights in the comprehensive weight set is used as the level membership degree. The comprehensive measurement set refers to the set composed of all comprehensive measures. The comprehensive measurement sequence refers to the sequence obtained by arranging the level membership degrees according to the level sequence number. The confidence threshold is a pre-set value used to determine the minimum cumulative membership degree in the confidence criterion to ensure the reliability and stability of the final evaluation level. For example, the confidence threshold is 0.8. The sequence number of the pig house environmental quality evaluation level refers to mapping the discrete evaluation levels of Excellent, Good, Medium, Pass, and Poor to sequence numbers 1, 2, 3, 4, and 5 in sequence, where sequence number 1 corresponds to Excellent, sequence number 2 corresponds to Good, sequence number 3 corresponds to Medium, sequence number 4 corresponds to Pass, and sequence number 5 corresponds to Poor. The calculation is based on the environmental quality belonging to the first category. The cumulative confidence level of the highest-ranking level and all levels better than the previous level. The purpose of the final rating calculation formula is to find the highest-ranking level that meets the confidence threshold requirement. For example, when hour, In The sum of the membership degrees corresponding to levels 1 and 2 is used to make a judgment with the confidence threshold.
[0130] Specifically, obtaining the comprehensive weight set includes:
[0131] The subjective weight set of environmental parameters is obtained based on the pre-constructed analytic hierarchy process, and the set of historical pig house environmental sequences is obtained. A historical data matrix is constructed based on the set of historical pig house environmental sequences. The historical data matrix includes multiple historical column vectors, and each historical column vector corresponds one-to-one with a historical pig house environmental sequence.
[0132] Data normalization is performed on each historical column vector in the historical data matrix to obtain a standard historical data matrix. The standard historical data matrix includes multiple standard column vectors, and each standard column vector includes multiple normalized sample values.
[0133] Extract standard column vectors sequentially from the standard historical data matrix;
[0134] Calculate the sample weight of each normalized sample value in the extracted standard column vector to obtain multiple sample weights, calculate the parameter information entropy based on the multiple sample weights, and calculate the parameter difference coefficient based on the parameter information entropy.
[0135] Summarize the parameter difference coefficients to obtain the parameter difference coefficient set, calculate the comprehensive difference coefficient based on the parameter difference coefficient set, and calculate the objective weight set of environmental parameters based on the comprehensive difference coefficient and the parameter difference coefficient set.
[0136] The subjective weights of environmental parameters are extracted sequentially from the set of subjective weights of environmental parameters, and the objective weights of the target environmental parameters are confirmed from the set of objective weights of environmental parameters based on the extracted subjective weights of environmental parameters.
[0137] The comprehensive weights are calculated based on the subjective weights of the extracted environmental parameters and the objective weights of the target environmental parameters. The comprehensive weights are then summarized to obtain the comprehensive weight set.
[0138] It should be explained that the set of subjective weights for environmental parameters refers to the collection of subjective weights for four environmental parameters—temperature, humidity, ammonia concentration, and carbon dioxide concentration—obtained through pairwise comparisons using the analytic hierarchy process (AHP). This set is used to quantify the subjective judgment of expert experience regarding the importance of each parameter. The historical pigsty environmental sequence set refers to the collection of data corresponding one-to-one with temperature, humidity, ammonia concentration, and carbon dioxide concentration, continuously recorded at a fixed sampling period within a set time window. A historical pigsty environmental sequence refers to a sequence of environmental parameters (temperature, humidity, ammonia concentration, carbon dioxide concentration) collected within a set time window. A historical data matrix is a matrix formed by concatenating the historical pigsty environmental sequence set column by column. Data normalization refers to performing a minimum-maximum linear transformation on each column of the historical data matrix, mapping the sample values of each column to the interval [0, 1]. Since different indicators have different dimensions and orders of magnitude, data normalization must be performed to eliminate dimensional differences. A standard historical data matrix is a matrix of all normalized historical column vectors. A standard column vector is a single environmental parameter column extracted from the standard historical data matrix. A normalized sample value refers to any element in the standard column vector. The steps for calculating the sample weight of each normalized sample value in the extracted standard column vector are as follows: obtain the number of normalized sample values based on the extracted standard column vector, and calculate the sample weight based on the number of normalized sample values and the normalized sample values. The calculation formula is as follows:
[0139]
[0140] in, Indicates the proportion of the sample. Represents normalized sample values. Indicates the number of normalized sample values. This represents the first column in the extracted standard column vector. A normalized sample value. The formula for calculating the parameter information entropy in the step of calculating the parameter information entropy based on the proportion of multiple samples is as follows:
[0141]
[0142] in, Represents parameter information entropy. Represents the logarithmic function. Indicates the proportion of multiple samples. The proportion of each sample. The parameter difference coefficient is the value obtained by subtracting the parameter information entropy from 1. The parameter difference coefficient set is the set of parameter difference coefficients corresponding to all standard column vectors. The comprehensive difference coefficient is the sum of the parameter difference coefficient sets. The steps for calculating the objective weight set of environmental parameters based on the comprehensive difference coefficient and the parameter difference coefficient set are as follows: extract parameter difference coefficients sequentially from the parameter difference coefficient set, calculate the objective weight of environmental parameters based on the comprehensive difference coefficient and the extracted parameter difference coefficients, summarize the objective weight of environmental parameters, and obtain the objective weight set of environmental parameters. The objective weight of an environmental parameter is the value obtained by dividing the extracted parameter difference coefficient by the comprehensive difference coefficient. The objective weight set of environmental parameters is the set of all objective weights of environmental parameters. The objective weight of a target environmental parameter is the objective weight of the same environmental parameter corresponding to the objective weight set of environmental parameters and the current subjective weight of environmental parameters. The comprehensive weight is the value obtained by multiplying the extracted subjective weight of environmental parameters and the objective weight of target environmental parameters. The comprehensive weight set is the set obtained by summing the comprehensive weights corresponding to temperature, humidity, ammonia concentration, and carbon dioxide concentration.
[0143] In detail, the process of adjusting the environment of the tested pigsty based on the current environmental quality level to obtain a healthy pigsty includes:
[0144] An environmental control strategy is matched based on the current environmental quality level. The environmental control strategy includes temperature control, humidity control, carbon dioxide concentration control, or toxic gas control.
[0145] Environmental control strategies were applied to the tested pig houses to achieve healthy pig farming conditions.
[0146] Furthermore, the step of controlling the environment of the tested pigsty according to the environmental control strategy to obtain a healthy pigsty is as follows:
[0147] If the environmental control strategy is temperature control, then the tested pig house will be controlled until a preset stop control command is received, resulting in a healthy pig house.
[0148] If the environmental control strategy is humidity control, then the refrigeration compressor and air heating pipe are used to perform a combined dehumidification operation on the tested pig house until a stop control command is received, resulting in a healthy pig house.
[0149] If the environmental control strategy is carbon dioxide concentration control, then the pre-built air volume regulating valve is used to regulate the tested pig house until a stop control command is received, resulting in a healthy pig house.
[0150] If the environmental control strategy is to control toxic gases, then exhaust gas valves and fresh air valves are used to control the tested pig houses until a stop control command is received, resulting in healthy pig houses.
[0151] It should be explained that matching the environmental control strategy based on the current environmental quality level refers to obtaining the environmental control strategy by performing a lookup operation on a preset level-strategy mapping table. The fields in this table include the level ID and the type of parameter exceeding the standard. The steps for controlling the detected pigsty are as follows: if the temperature is higher than the preset upper temperature limit, the refrigeration compressor is activated to send cold air into the pigsty until the temperature sensor reports that the temperature has dropped to the preset normal temperature range (e.g., 22℃-24℃); if the temperature is lower than the preset lower temperature limit, the air heater is activated to send warm air into the pigsty until the temperature rises to the normal temperature range. For example, the upper temperature limit is 24℃, and the lower temperature limit is 22℃. The stop control command refers to the command issued by the host computer. A healthy pigsty refers to a pigsty where, after receiving the stop control command, the system collects environmental parameters again and confirms the temperature, humidity, and other parameters. , The pigsty was simultaneously within a preset comfort zone and remained stable for 10 minutes. The steps for performing combined dehumidification of the tested pigsty using a refrigeration compressor and air heating pipes are as follows: The refrigeration compressor cools the humid air, lowering its temperature below the dew point. Water vapor in the air condenses into water droplets and is thus removed. However, the air temperature after cooling and dehumidification is too low; directly introducing it into the pigsty would cause cold stress. Therefore, heating pipes are used to reheat it to a suitable supply air temperature. The airflow regulating valve refers to a multi-leaf butterfly valve with a linear actuator, used for... The concentration control phase involves rapidly changing the ventilation volume. The regulation of the tested pigsty using a pre-built airflow control valve refers to adjusting the airflow control valve and fan speed to increase the fresh air intake into the tested pigsty. The purpose of this step is to introduce a large amount of oxygen-rich fresh air from outside the pigsty, while simultaneously reducing the high concentration of pollutants inside. Air is discharged through the vents, achieving rapid dilution. The regulation of the tested pigsty using exhaust gas and fresh air valves refers to adjusting the opening degree of these valves to control the pigsty's condition.
[0152] S6. Summarize the healthy pigsties to obtain a set of healthy pigsties. Based on the environmental factor prediction model and the set of healthy pigsties, complete the pigsty environment optimization based on multi-source data fusion.
[0153] It should be explained that the "healthy pigsty set" refers to a collection of all healthy pigsties. This invention, by analyzing environmental data and control strategies from healthy pigsties, can summarize optimal environmental parameters and management experience, providing a better environment for the entire pig farming population. Simultaneously, by combining environmental factor prediction models with the healthy pigsty set, continuous optimization of the pigsty environment can be achieved. Environmental control strategies can be adjusted in advance based on the prediction model, and by referencing the successful experiences of healthy pigsties, environmental management of the pigsties can be continuously improved, thereby increasing farming efficiency and the health of the pigs.
[0154] To address the problems described in the background section, this invention identifies the pigsty to be inspected, receives environmental monitoring instructions, and performs environmental parameter monitoring on the pigsty according to these instructions, obtaining an environmental monitoring sequence set and the inspected pigsty data. This invention's multi-source data comprehensively reflects the environmental conditions of the pigsty, providing rich and accurate basic information for subsequent environmental analysis and optimization. Data filtering is performed on the environmental monitoring sequence set to obtain a filtered environmental monitoring value sequence set. During environmental monitoring, various factors may interfere with the data, leading to noise. Data filtering effectively removes this noise, making the filtered temperature, humidity, ammonia concentration, and carbon dioxide concentration sequences smoother and more accurate, improving data quality and reliability. An environmental factor prediction model is constructed based on the filtered environmental monitoring value sequence set. This model can predict the future environmental conditions of the pigsty based on historical filtered environmental monitoring data, helping to identify potential environmental problems in advance. By predicting changes in environmental factors, more scientific and reasonable environmental control measures can be formulated. This invention employs a strategy to determine the extraction order. Based on this order, a set of filtered environmental monitoring parameters is extracted from the filtered environmental monitoring value sequence set. This invention extracts key parameters such as filtered temperature monitoring values, filtered humidity monitoring values, filtered ammonia concentration, and filtered carbon dioxide concentration from the filtered environmental monitoring value sequence set. This simplifies complex sequence data into specific environmental indicators, facilitating subsequent environmental quality assessment and control decisions. The current environmental quality level is calculated based on the filtered environmental monitoring parameter set. Environmental control measures are then implemented in the inspected pigsties based on this current environmental quality level to obtain healthy pigsties. This invention quantifies the environmental condition of pigsties by calculating environmental quality levels, allowing farmers to intuitively understand the environmental quality level of the pigsties. This helps in the timely detection of environmental problems and the implementation of targeted improvement measures. Simultaneously, environmental control based on the environmental quality level enables precise environmental management. A set of healthy pigsties is compiled, and environmental optimization of pigsties based on multi-source data fusion is completed based on the environmental factor prediction model and the healthy pigsty set. Therefore, this invention can achieve coordinated, precise, and forward-looking control of multiple environmental factors in pigsties.
[0155] like Figure 2 The diagram shown is a functional block diagram of a pigsty environment optimization system based on multi-source data fusion provided in an embodiment of the present invention.
[0156] The pigsty environment optimization system 100 based on multi-source data fusion described in this invention can be installed in an electronic device. Depending on the functions implemented, the pigsty environment optimization system 100 based on multi-source data fusion may include a multi-source environmental data acquisition module 101, an environmental prediction model construction module 102, a pigsty environmental quality assessment module 103, and a pigsty environment optimization module 104. The module described in this invention can also be called a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can perform a fixed function, and which are stored in the memory of the electronic device.
[0157] The multi-source environmental data acquisition module 101 is used to identify the pig house to be tested, receive the pig house environmental testing instruction, perform environmental parameter testing on the pig house to be tested according to the pig house environmental testing instruction, obtain the environmental monitoring sequence set and the tested pig house, and perform data filtering operation on the environmental monitoring sequence set to obtain the filtered environmental monitoring value sequence set.
[0158] The environmental prediction model construction module 102 is used to construct an environmental factor prediction model based on the filtered environmental monitoring value sequence set.
[0159] The pigsty environmental quality assessment module 103 is used to determine the extraction order and extract the filtered environmental monitoring parameter set from the filtered environmental monitoring value sequence set according to the extraction order;
[0160] The pigsty environment optimization module 104 is used to calculate the environmental quality level at the current moment based on the filtered environmental monitoring parameter set, to regulate the environment of the detected pigsties according to the environmental quality level at the current moment, to obtain healthy pigsties, to summarize the healthy pigsties, to obtain a set of healthy pigsties, and to complete the pigsty environment optimization based on multi-source data fusion based on the environmental factor prediction model and the set of healthy pigsties.
[0161] In detail, the modules in the pigsty environment optimization system 100 based on multi-source data fusion described in this embodiment of the invention employ the same methods as described above. Figure 1 The method used is the same as the pigsty environment optimization method based on multi-source data fusion described in the article, and can produce the same technical effect, so it will not be repeated here.
[0162] like Figure 3 The diagram shown is a schematic representation of an electronic device for implementing a method for optimizing a pigsty environment based on multi-source data fusion, according to an embodiment of the present invention.
[0163] The electronic device 1 may include a processor 10, a memory 11 and a bus 12, and may also include a computer program stored in the memory 11 and capable of running on the processor 10, such as a method program for optimizing pigsty environment based on multi-source data fusion.
[0164] The memory 11 includes at least one type of readable storage medium, including flash memory, portable hard drive, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of the electronic device 1, such as the portable hard drive of the electronic device 1. In other embodiments, the memory 11 can be an external storage device of the electronic device 1, such as a plug-in portable hard drive, smart media card (SMC), secure digital card (SD), flash card, etc., equipped on the electronic device 1. Furthermore, the memory 11 includes both internal storage units and external storage devices of the electronic device 1. The memory 11 can be used not only to store application software and various types of data installed on the electronic device 1, such as the code of a pigsty environment optimization method program based on multi-source data fusion, but also to temporarily store data that has been output or will be output.
[0165] In some embodiments, the processor 10 may be composed of integrated circuits, such as a single packaged integrated circuit or multiple integrated circuits with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 10 is the control unit of the electronic device, connecting various components of the entire electronic device through various interfaces and lines. It executes programs or modules stored in the memory 11 (e.g., a method for optimizing a pigsty environment based on multi-source data fusion) and calls data stored in the memory 11 to perform various functions of the electronic device 1 and process data.
[0166] The bus 12 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus 12 can be divided into an address bus, a data bus, a control bus, etc. The bus 12 is configured to realize the connection and communication between the memory 11 and at least one processor 10, etc.
[0167] Figure 3 Only electronic devices with components are shown; it will be understood by those skilled in the art that... Figure 3The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown, or combine certain components, or have different component arrangements.
[0168] For example, although not shown, the electronic device 1 may also include a power supply (such as a battery) to power the various components. Preferably, the power supply can be logically connected to the at least one processor 10 through a power management device, thereby enabling functions such as charging management, discharging management, and power consumption management. The power supply may also include one or more DC or AC power supplies, recharging devices, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device 1 may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be described in detail here.
[0169] Furthermore, the electronic device 1 may also include a network interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a Wi-Fi interface, a Bluetooth interface, etc.), which is typically used to establish communication connections between the electronic device 1 and other electronic devices.
[0170] Optionally, the electronic device 1 may further include a user interface, which may be a display, an input unit (such as a keyboard), and optionally, a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen, etc. The display may also be appropriately referred to as a screen or display unit, used to display information processed in the electronic device 1 and to display a visual user interface.
[0171] The program for optimizing the pigsty environment based on multi-source data fusion, stored in the memory 11 of the electronic device 1, is a combination of multiple instructions. When run in the processor 10, it can achieve the following:
[0172] The pigsty to be tested is identified, the pigsty environmental testing instruction is received, and the environmental parameters of the pigsty to be tested are tested according to the pigsty environmental testing instruction to obtain the environmental monitoring sequence set and the tested pigsty.
[0173] Perform data filtering on the environmental monitoring sequence set to obtain a filtered environmental monitoring value sequence set;
[0174] An environmental factor prediction model is constructed based on a filtered environmental monitoring value sequence set.
[0175] Determine the extraction order, and extract the filter environment monitoring parameter set from the filter environment monitoring value sequence set according to the extraction order;
[0176] The environmental quality level at the current moment is calculated based on the filtered environmental monitoring parameter set. The environmental control of the detected pigsty is then carried out according to the environmental quality level at the current moment to obtain a healthy pigsty.
[0177] By compiling a set of healthy pigsties, an environmental optimization of pigsty environment based on multi-source data fusion was completed, using an environmental factor prediction model and the set of healthy pigsties.
[0178] Specifically, the processor 10's implementation method for the above instructions can be found in [reference needed]. Figures 1 to 3 The descriptions of the relevant steps in the corresponding embodiments are not repeated here.
[0179] Furthermore, if the modules / units integrated in the electronic device 1 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, or a read-only memory (ROM).
[0180] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor of an electronic device, can perform the following:
[0181] The pigsty to be tested is identified, the pigsty environmental testing instruction is received, and the environmental parameters of the pigsty to be tested are tested according to the pigsty environmental testing instruction to obtain the environmental monitoring sequence set and the tested pigsty.
[0182] Perform data filtering on the environmental monitoring sequence set to obtain a filtered environmental monitoring value sequence set;
[0183] An environmental factor prediction model is constructed based on a filtered environmental monitoring value sequence set.
[0184] Determine the extraction order, and extract the filter environment monitoring parameter set from the filter environment monitoring value sequence set according to the extraction order;
[0185] The environmental quality level at the current moment is calculated based on the filtered environmental monitoring parameter set. The environmental control of the detected pigsty is then carried out according to the environmental quality level at the current moment to obtain a healthy pigsty.
[0186] By compiling a set of healthy pigsties, an environmental optimization of pigsty environment based on multi-source data fusion was completed, using an environmental factor prediction model and the set of healthy pigsties.
[0187] In the embodiments provided by this invention, it should be understood that the disclosed devices, systems, and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative, and actual implementations may have other classification methods.
[0188] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0189] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.
[0190] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0191] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. A method for optimizing pigsty environment based on multi-source data fusion, characterized in that, The method includes: The pigsty to be tested is identified, the pigsty environmental testing instruction is received, and the environmental parameters of the pigsty to be tested are tested according to the pigsty environmental testing instruction to obtain the environmental monitoring sequence set and the tested pigsty. Perform data filtering on the environmental monitoring sequence set to obtain a filtered environmental monitoring value sequence set; An environmental factor prediction model is constructed based on a filtered environmental monitoring value sequence set. Determine the extraction order, and extract the filter environment monitoring parameter set from the filter environment monitoring value sequence set according to the extraction order; The environmental quality level at the current moment is calculated based on the filtered environmental monitoring parameter set. The environmental control of the detected pigsty is then carried out according to the environmental quality level at the current moment to obtain a healthy pigsty. By compiling a set of healthy pigsties, an environmental optimization of pigsty environment based on multi-source data fusion was completed, using an environmental factor prediction model and the set of healthy pigsties.
2. The method for optimizing pigsty environment based on multi-source data fusion as described in claim 1, characterized in that, The pigsty to be tested includes: a pigsty air outlet, a pigsty air inlet, and a gas mixing chamber. Sensors are installed at both the pigsty air outlet and the pigsty air inlet, and the sensors are preset with a sampling period. The gas mixing chamber includes: a refrigeration compressor, an air heating pipe, an exhaust gas valve, a fresh air valve, and a main ventilation valve.
3. The method for optimizing pigsty environment based on multi-source data fusion as described in claim 2, characterized in that, The step of performing data filtering on the environmental monitoring sequence set to obtain a filtered environmental monitoring value sequence set includes: Set the basic smoothness and change sensitivity, extract environmental monitoring sequences from the environmental monitoring sequence set sequentially, and perform the following operations on each extracted environmental monitoring sequence: Environmental monitoring values are extracted sequentially from the extracted environmental monitoring sequences, and the target window monitoring value sequence is identified based on the extracted environmental monitoring values. The first derivative of the extracted environmental monitoring values is calculated, and the initial adaptive standard deviation is calculated based on the basic smoothness, change sensitivity, and first derivative value. The adaptive standard deviation is determined from the initial adaptive standard deviation and the preset lower limit of the standard deviation. The set of neighborhood point weight values is calculated based on the extracted environmental monitoring values, the adaptive standard deviation, and the target window monitoring value sequence. Calculate the initial filtered environmental monitoring value based on the domain point weight value set and the target window monitoring value sequence, and summarize the initial filtered environmental monitoring value to obtain the initial filtered environmental monitoring value set corresponding to the environmental monitoring sequence; Calculate the filtering variance and original variance of the initial filtered environmental monitoring value set and the extracted environmental monitoring sequence respectively, and calculate the variance change rate based on the original variance and the filtering variance; If the variance change rate is within the preset variance change rate range, then the initial filter environment monitoring value is used as the filter environment monitoring value. If the variance change rate is not within the preset variance change rate interval, the basic smoothness and change sensitivity are adjusted to obtain updated basic smoothness and updated change sensitivity. The updated basic smoothness and updated change sensitivity are used as the basic smoothness and change sensitivity, respectively. The process returns to the step of calculating the initial adaptive standard deviation based on the basic smoothness, change sensitivity and first derivative value until the variance change rate is within the variance change rate interval. By summarizing the filtered environmental monitoring value sequences, we obtain the filtered environmental monitoring value sequence set corresponding to the environmental monitoring sequence set.
4. The method for optimizing pigsty environment based on multi-source data fusion as described in claim 3, characterized in that, The step of calculating the neighborhood point weight value set based on the extracted environmental monitoring values, adaptive standard deviation, and target window monitoring value sequence includes: For each target window monitoring value in the target window monitoring value sequence, perform the following operation: The neighborhood point weights are calculated based on the adaptive standard deviation, the target window monitoring value, and the extracted environmental monitoring values. The calculation formula is as follows: ; in, Indicates the neighborhood point weight value. This represents the natural exponential function. Indicates the target window monitoring value. This represents the extracted environmental monitoring values. Indicates adaptive standard deviation; Summarize the domain point weight values to obtain the domain point weight value set.
5. The method for optimizing pigsty environment based on multi-source data fusion as described in claim 4, characterized in that, The environmental factor prediction model constructed based on the filtered environmental monitoring value sequence set includes: Set the prediction target, historical window length, and prediction window length, divide the filtered environmental monitoring value sequence set, and obtain the training sample set; The training sample set is divided into training set and test set according to time order. Both training set and test set are normalized to obtain normalized training set and normalized test set. Input the normalized training set, prediction target, historical window length, and prediction window length into the pre-constructed initial LSTM-AGF hybrid prediction model to obtain the trained hybrid prediction model. The prediction performance of the trained hybrid prediction model was tested using a normalized test set to obtain the prediction accuracy index. If the prediction accuracy index is within the preset optimal prediction accuracy index range, then the trained hybrid prediction model will be used as the environmental factor prediction model.
6. The method for optimizing pigsty environment based on multi-source data fusion as described in claim 5, characterized in that, The calculation of the current environmental quality level based on the filtered environmental monitoring parameter set includes: Multiple sets of pig house environmental quality assessment levels were identified. Based on these sets, multiple sets of linear unknown measure functions were identified. The sets of pig house environmental quality assessment levels include multiple pig house environmental quality assessment levels, and the sets of linear unknown measure functions include multiple linear unknown measure functions. There is a one-to-one correspondence between the pig house environmental quality assessment levels and the linear unknown measure functions. The number of sets of pig house environmental quality assessment levels is the same as the number of environmental monitoring sequences in the environmental monitoring sequence set. The filter environment monitoring parameters are extracted sequentially from the filter environment monitoring parameter set, and the target linear unknown measure function set is identified from multiple linear unknown measure function sets based on the extracted filter environment monitoring parameters; Substituting the filtered environmental monitoring parameters into each target linear unknown measure function in the target linear unknown measure function set yields a single index measure vector, which includes multiple function values. A single index measurement matrix is constructed based on the index measurement vectors corresponding to all the filtering environment monitoring parameters. The single index measurement matrix includes multiple row vectors and multiple column vectors, and the row vectors correspond one-to-one with the single index measurement vectors. The environmental quality level at the current moment is calculated using a single-index measurement matrix.
7. The method for optimizing pigsty environment based on multi-source data fusion as described in claim 6, characterized in that, The calculation of the current environmental quality level using a single-index measurement matrix includes: Obtain the comprehensive weight set, extract column vectors from the single index measurement matrix in sequence, and calculate the membership degree of the level based on the extracted column vectors and the comprehensive weight set; Summarize the membership degrees of different levels to obtain a comprehensive measure set, and arrange the comprehensive measure set to obtain a comprehensive measure sequence; The final evaluation level is calculated based on the comprehensive measurement sequence and the preset confidence threshold. The formula for calculating the final evaluation level is as follows: ; in, Indicates the final evaluation level. This represents a function that takes the minimum value. The serial number indicates the evaluation level of the pigsty's environmental quality. An index representing the degree of membership. Indicates the first in the comprehensive measure sequence Each level of membership degree, This represents the confidence threshold.
8. The method for optimizing pigsty environment based on multi-source data fusion as described in claim 7, characterized in that, The process of obtaining the comprehensive weight set includes: The subjective weight set of environmental parameters is obtained based on the pre-constructed analytic hierarchy process, and the set of historical pig house environmental sequences is obtained. A historical data matrix is constructed based on the set of historical pig house environmental sequences. The historical data matrix includes multiple historical column vectors, and each historical column vector corresponds one-to-one with a historical pig house environmental sequence. Data normalization is performed on each historical column vector in the historical data matrix to obtain a standard historical data matrix. The standard historical data matrix includes multiple standard column vectors, and each standard column vector includes multiple normalized sample values. Extract standard column vectors sequentially from the standard historical data matrix; Calculate the sample weight of each normalized sample value in the extracted standard column vector to obtain multiple sample weights, calculate the parameter information entropy based on the multiple sample weights, and calculate the parameter difference coefficient based on the parameter information entropy. Summarize the parameter difference coefficients to obtain the parameter difference coefficient set, calculate the comprehensive difference coefficient based on the parameter difference coefficient set, and calculate the objective weight set of environmental parameters based on the comprehensive difference coefficient and the parameter difference coefficient set. The subjective weights of environmental parameters are extracted sequentially from the set of subjective weights of environmental parameters, and the objective weights of the target environmental parameters are confirmed from the set of objective weights of environmental parameters based on the extracted subjective weights of environmental parameters. The comprehensive weights are calculated based on the subjective weights of the extracted environmental parameters and the objective weights of the target environmental parameters. The comprehensive weights are then summarized to obtain the comprehensive weight set.
9. The method for optimizing pigsty environment based on multi-source data fusion as described in claim 8, characterized in that, The process of adjusting the environment of the inspected pigsty based on the current environmental quality level to obtain a healthy pigsty includes: An environmental control strategy is matched based on the current environmental quality level. The environmental control strategy includes temperature control, humidity control, carbon dioxide concentration control, or toxic gas control. Environmental control strategies were applied to the tested pig houses to achieve healthy pig farming conditions.
10. A pigsty environment optimization system based on multi-source data fusion, characterized in that, The system includes: The multi-source environmental data acquisition module is used to identify the pigsty to be tested, receive the pigsty environmental testing instructions, perform environmental parameter testing on the pigsty to be tested according to the pigsty environmental testing instructions, obtain the environmental monitoring sequence set and the tested pigsty, and perform data filtering operation on the environmental monitoring sequence set to obtain the filtered environmental monitoring value sequence set. The environmental prediction model building module is used to build environmental factor prediction models based on filtered environmental monitoring value sequence sets. The pigsty environmental quality assessment module is used to determine the extraction order and extract the set of filtered environmental monitoring parameters from the set of filtered environmental monitoring values according to the extraction order. The pigsty environment optimization module is used to calculate the current environmental quality level based on the filtered environmental monitoring parameter set, adjust the environment of the detected pigsties according to the current environmental quality level, obtain healthy pigsties, summarize the healthy pigsties to obtain a healthy pigsty set, and complete the pigsty environment optimization based on multi-source data fusion based on the environmental factor prediction model and the healthy pigsty set.