Farm ammonia management method and electronic device
By constructing feature vectors and the spatiotemporal distribution field of ammonia, and using a large language model for causal reasoning and trend prediction, the problems of limited ammonia monitoring sensor deployment and data silos in farms have been solved, thus improving the reliability and accuracy of ammonia management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-01
- Publication Date
- 2026-03-27
AI Technical Summary
The limited number of ammonia monitoring sensors in the farm makes it difficult to fully reflect the dynamic changes in ammonia levels. The failure to effectively integrate multi-source heterogeneous data results in insufficient accuracy and comprehensiveness in ammonia management.
By acquiring multi-source heterogeneous data from the farm, feature vectors and ammonia spatiotemporal distribution fields are constructed. A large language model is then used for causal reasoning and trend prediction to generate ammonia monitoring reports or control target equipment.
It improves the reliability of ammonia management in livestock farms, can characterize the spatiotemporal distribution characteristics of ammonia and the causal relationship of its influencing factors, and realizes proactive early warning and explainable decision support.
Smart Images

Figure CN121210940B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of ammonia management in farms, and in particular to a method for ammonia management in farms and an electronic device. BACKGROUND
[0002] Ammonia is the main pollutant in intensive farms, and its effective monitoring is an important link to protect the health of livestock and poultry and control the production environment. However, the related ammonia management technology has some deficiencies in practical application: on the one hand, the related sensors for monitoring ammonia in the farm have limited distribution, which makes it difficult to fully reflect the dynamic changes of ammonia in the farm. On the other hand, various data related to ammonia monitoring are usually independent of each other and cannot be effectively integrated. In view of the above-mentioned defects of the related ammonia management technology, how to improve the reliability of ammonia management in the farm has become a technical problem to be solved. SUMMARY
[0003] The embodiments of the present application provide a method for ammonia management in a farm and an electronic device to solve the problem of how to improve the reliability of ammonia management in the farm.
[0004] In a first aspect, the embodiments of the present application provide a method for ammonia management in a farm, comprising:
[0005] Obtaining first multi-source heterogeneous data related to ammonia monitoring in the farm, and performing vector construction and preprocessing on the first multi-source heterogeneous data to obtain feature vectors and second multi-source heterogeneous data;
[0006] Constructing an ammonia spatio-temporal distribution field based on the second multi-source heterogeneous data, and constructing a spatio-temporal three-dimensional dynamic spectrum based on the ammonia spatio-temporal distribution field;
[0007] Based on the feature vectors, the ammonia spatio-temporal distribution field and the spatio-temporal three-dimensional dynamic spectrum, calling a pre-set large language model to obtain an analysis result, and using the analysis result to generate an ammonia monitoring report corresponding to the farm and / or control a target device in the farm.
[0008] In combination with the first aspect, in some possible implementation manners, the vector construction and preprocessing on the first multi-source heterogeneous data to obtain the feature vectors and the second multi-source heterogeneous data comprises:
[0009] Performing data extraction and encoding on the first multi-source heterogeneous data to obtain the feature vectors, and the feature vectors are used to represent the environmental parameters and the breeding process parameters corresponding to the farm, the environmental parameters include at least one of ammonia concentration, temperature, humidity and wind speed, and the breeding process parameters include at least one of animal density, feeding process parameters and manure removal mode;
[0010] Based on a pre-set first spatio-temporal kriging algorithm, interpolating the missing data in the first multi-source heterogeneous data to obtain the interpolated first multi-source heterogeneous data;
[0011] The interpolated first multi-source heterogeneous data is standardized to obtain the second multi-source heterogeneous data.
[0012] Combining the first aspect and the above implementation methods, in some possible implementation methods, the spatiotemporal distribution field of ammonia is constructed based on the second multi-source heterogeneous data, including:
[0013] Based on the preset second spatiotemporal kriging algorithm, the ammonia concentration data collected by sparse sensors in the second multi-source heterogeneous data are interpolated and reconstructed to obtain the spatiotemporal distribution field of ammonia.
[0014] The formula for the second spacetime Kriging algorithm is:
[0015] ;
[0016] in, The target spatiotemporal point to be reconstructed in the spatiotemporal distribution field of ammonia gas. The concentration value of the target spatiotemporal point middle, The spatial location of the target spatiotemporal point. The time point of the target spatiotemporal point; The ammonia concentration data collected by the sparse sensor at spatiotemporal points The concentration value, the spatiotemporal point middle, For the first The spatial location of the sparse sensor. For the first The sparse sensors are located in space. The time point for data collection; the installation location of the sparse sensor is determined based on the ammonia source in the farm and the diffusion boundary of the ammonia source in the farm, and the ammonia source is determined based on the types of farmed animals and the key operating processes associated with the types of farmed animals; These are the weighting coefficients; The number of sparse sensors;
[0017] Weighting coefficient The following system of equations was solved to obtain the following:
[0018] ;
[0019] ;
[0020] in, For the first The spatial location of the sparse sensor. For the first The sparse sensor is located at a spatial position The time point of collecting data; The variogram for describing the spatio-temporal autocorrelation; For spatial position difference, corresponding Or ; For time difference, corresponding Or ; The Lagrange multiplier.
[0021] In combination with the first aspect and the above implementation manners, in some possible implementation manners, based on the feature vector, the ammonia spatio-temporal distribution field, and the spatio-temporal three-dimensional dynamic spectrum diagram, a preset large language model is called for analysis to obtain an analysis result, including:
[0022] According to the feature vector, the ammonia spatio-temporal distribution field, and the spatio-temporal three-dimensional dynamic spectrum diagram, a natural language prompt word containing a causal inference request and a trend prediction request is constructed, the causal inference request is used to inquire the root cause of the ammonia concentration change, and the trend prediction request is used to predict the ammonia concentration change at a future time point;
[0023] The preset large language model is called based on the natural language prompt word to perform causal inference and trend prediction, and an analysis result is obtained.
[0024] In combination with the first aspect and the above implementation manners, in some possible implementation manners, the preset large language model is called based on the natural language prompt word to perform causal inference and trend prediction, and an analysis result is obtained, including:
[0025] The natural language prompt word is input into the preset large language model to trigger the large language model to perform causal inference and trend prediction;
[0026] The causal inference result and the trend prediction result output by the large language model are received, the causal inference result includes at least one root cause and a weight corresponding to each root cause, and the trend prediction result includes an ammonia concentration prediction value at a future time point;
[0027] Based on the causal inference result and the trend prediction result, an analysis result is integrated and generated;
[0028] Wherein, the attention mechanism of the large language model when performing causal inference is defined as:
[0029] ;
[0030] Wherein, is a function for calculating the importance weight of different parts in the input information; is a query vector, is a key vector, is a value vector; representing the query vector and the key vector transformed form dot product for calculating a similarity score between the query vector and the key vector; is a factor for scaling the similarity score, is the vector dimension of the query vector and the key vector ; is a normalization function for converting the scaled similarity score into an importance weight distribution with a total sum of 1; the importance weight distribution is multiplied by the value vector for weighted summation of the value vector.
[0031] With reference to the first aspect and the above implementation manners, in some possible implementation manners, the three-dimensional dynamic spectrum graph is constructed based on the ammonia space-time distribution field, including:
[0032] performing fast Fourier transform on the time series of each of the plurality of local spatial points in the ammonia space-time distribution field to obtain frequency spectrum data corresponding to each local spatial point, wherein the frequency spectrum data is used to represent the frequency domain characteristics of the ammonia concentration change over time of the corresponding local spatial point;
[0033] constructing the three-dimensional dynamic spectrum graph based on the frequency spectrum data and a spatial wave number component extracted from the ammonia space-time distribution field.
[0034] With reference to the first aspect and the above implementation manners, in some possible implementation manners, the fast Fourier transform is performed on the time series of each of the plurality of local spatial points in the ammonia space-time distribution field to obtain frequency spectrum data corresponding to each local spatial point, which is implemented based on the following formula:
[0035] ;
[0036] wherein, is the frequency spectrum data, representing the ammonia concentration spectrum of the local spatial point at time ; is the frequency; is the ammonia concentration value of the local time series, derived from the time series data of the ammonia space-time distribution field at the local spatial point ; is the x-axis position of the preset three-dimensional grid coordinate in the farm, is the y-axis position of the preset three-dimensional grid coordinate in the farm, is the z-axis position of the preset three-dimensional grid coordinate in the farm; the value range of the axis is determined based on the type of the farmed animals in the farm; window function, used for windowing the local time series to reduce spectral leakage; FFT is fast Fourier transform, used for converting the local time series from time domain to frequency domain.
[0037] With reference to the first aspect and the above implementation manners, in some possible implementation manners, the method further includes:
[0038] Based on the analysis result and the feature vector, a large language model is called to dynamically correct a basic ammonia emission flux model of the farm, to obtain an adaptive ammonia emission flux model;
[0039] According to the adaptive ammonia emission flux, a device control instruction corresponding to a target device in the farm is generated;
[0040] According to the device control instruction, the running state of the target device is controlled.
[0041] With reference to the first aspect and the above implementation manners, in some possible implementation manners, a calculation formula of the adaptive ammonia emission flux model is:
[0042] ;
[0043] wherein, is the adaptive ammonia emission flux of the farm at time ; is an empirical coefficient of the basic ammonia emission flux model; , are an upwind ammonia concentration and a downwind ammonia concentration of the farm, respectively; is a wind speed; is a dynamic comprehensive influence coefficient with a dimension of 1, and the dynamic comprehensive influence coefficient is used to comprehensively represent a nonlinear correction effect of at least one of the following information on the basic ammonia emission flux model: nonlinear enhancement or inhibition effect information of environmental temperature and humidity on the basic ammonia release rate; correction effect information of the current ventilation mode on the linear wind speed transport efficiency; dynamic influence information of the current state of the farm manure on ammonia volatilization; contribution information of instantaneous disturbance caused by animal activity to local ammonia concentration.
[0044] In a second aspect, an embodiment of the present application provides an electronic device, including a processor and a memory storing a computer program, and the processor implements the steps of the farm ammonia management method of the first aspect when executing the program.
[0045] In a third aspect, an embodiment of the present application provides a non-transitory computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the farm ammonia management method of the first aspect.
[0046] In a fourth aspect, an embodiment of the present application provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the farm ammonia management method of the first aspect.
[0047] The farm ammonia management method and the electronic device provided by the embodiments of the present application first acquire first multi-source heterogeneous data related to ammonia monitoring in the farm, and perform vector construction and preprocessing to obtain a feature vector and second multi-source heterogeneous data, thereby avoiding the problems of single data source and lack of structured representation in ammonia monitoring. Then, based on the second multi-source heterogeneous data, an ammonia spatiotemporal distribution field is constructed, and a spatiotemporal three-dimensional dynamic spectrum is further constructed, thereby overcoming the problem of insufficient spatiotemporal representation caused by limited fixed sensor distribution points. Finally, based on the feature vector, the ammonia spatiotemporal distribution field, and the spatiotemporal three-dimensional dynamic spectrum, a preset large language model is called to analyze and obtain an analysis result, which can be used to generate an ammonia monitoring report or control a target device. This process breaks through the island restriction of multi-source heterogeneous data by using the multi-modal fusion capability of the large language model, so that the analysis result can represent the ammonia spatiotemporal distribution characteristics of the farm and the causal relationship of influencing factors, thereby improving the reliability of the farm ammonia management. BRIEF DESCRIPTION OF DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the present application or prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.
[0049] Figure 1 is a flowchart of the farm ammonia management method provided by the embodiments of the present application;
[0050] Figure 2 is a flowchart of acquiring the feature vector and the second multi-source heterogeneous data provided by the embodiments of the present application;
[0051] Figure 3 is a flowchart of acquiring the analysis result provided by the embodiments of the present application;
[0052] Figure 4 is a flowchart of constructing the spatiotemporal three-dimensional dynamic spectrum provided by the embodiments of the present application;
[0053] Figure 5 is a flowchart of regulating and controlling the target device provided by the embodiments of the present application;
[0054] Figure 6 is a comprehensive flowchart of the farm ammonia management provided by the embodiments of the present application;
[0055] Figure 7 FIG. 1 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0056] In order to make the objectives, technical solutions, and advantages of the present application clearer, the technical solutions in the present application will be described clearly and completely below with reference to the drawings in the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0057] Ammonia is a major pollutant in intensive farms, and its effective monitoring is an important link to ensure the health of livestock and poultry and the control of production environment. Ammonia management in a farm can be manifested as obtaining a corresponding ammonia monitoring report to assess the environmental status of the farm and provide a basis for management decisions, or as controlling certain equipment in the farm to actively adjust the environmental parameters in the farm.
[0058] However, the related ammonia management technology has the following deficiencies in practical application: on the one hand, the related sensors for monitoring ammonia in the farm are limited in distribution, and it is difficult to fully reflect the dynamic changes of ammonia in the farm. Specifically, the limited fixed sensor network cannot fully cover all key areas of the farm, resulting in sparseness and discontinuity of the collected ammonia concentration data in the spatial dimension, and it is difficult to accurately reflect the dynamic evolution law of ammonia concentration in the farm. On the other hand, various data related to ammonia monitoring are usually independent of each other and cannot be effectively fused. Specifically, various data related to ammonia monitoring are usually collected and stored by independent subsystems, forming a data island; due to the lack of effective alignment and fusion analysis mechanism for these multi-source heterogeneous data, it is difficult to mine the internal correlation and causal relationship between them, for example, it is difficult to accurately quantify the dynamic influence of a specific farming operation on ammonia concentration changes.
[0059] In view of the above-mentioned defects of the related ammonia management technology, it can lead to insufficient accuracy and comprehensiveness of the generated ammonia monitoring report of the farm, and it is difficult to accurately reflect the distribution characteristics of ammonia in the farm and its causes, or it can lead to hysteresis and lack of basis for the control of the target equipment, and it is difficult to achieve accurate and efficient active intervention. Therefore, how to improve the reliability of ammonia management in the farm has become a technical problem to be solved.
[0060] To solve the above problems, the scheme provided by the embodiments of the present application mainly includes: first, the first multi-source heterogeneous data related to ammonia monitoring in the breeding farm is acquired, and vector construction and preprocessing are performed to obtain a feature vector and second multi-source heterogeneous data, thereby avoiding the problems of single data source and lack of structured representation in ammonia monitoring; then, an ammonia spatiotemporal distribution field is constructed based on the second multi-source heterogeneous data, and a spatiotemporal three-dimensional dynamic spectrum is further constructed, thereby overcoming the problem of insufficient spatiotemporal representation caused by limited fixed sensor distribution points; finally, based on the feature vector, the ammonia spatiotemporal distribution field and the spatiotemporal three-dimensional dynamic spectrum, a preset large language model is called to analyze and obtain an analysis result, which can be used to generate an ammonia monitoring report or control a target device. This process breaks through the island restriction of multi-source heterogeneous data by using the multi-modal fusion capability of the large language model, so that the analysis result can represent the ammonia spatiotemporal distribution characteristics of the breeding farm and the causal relationship of the influencing factors, thereby improving the reliability of ammonia management in the breeding farm.
[0061] The breeding farm ammonia management method provided by the embodiments of the present application will be described in detail below.
[0062] Please refer to Figure 1 , Figure 1 The flowchart of the breeding farm ammonia management method provided by the embodiments of the present application is shown in FIG. 1. As shown in FIG. 1, the method of the embodiments of the present application can include the following steps S101-S103. Figure 1
[0063] S101, acquiring first multi-source heterogeneous data related to ammonia monitoring in the breeding farm, and performing vector construction and preprocessing on the first multi-source heterogeneous data to obtain a feature vector and second multi-source heterogeneous data.
[0064] Specifically, the first multi-source heterogeneous data related to the embodiments of the present application refers to a set of original data collected in the breeding farm through multiple channels, which are different in format and source, including but not limited to structured data collected by a fixed sensor network and a mobile monitoring unit, and unstructured data such as device operation and maintenance logs, breeder work records, and text description summaries of monitoring videos; the feature vector refers to a vector constructed by extracting and encoding the first multi-source heterogeneous data, which is used to quantitatively represent the environmental parameters and breeding process parameters of the breeding farm, wherein the environmental parameters at least include one of ammonia concentration, temperature, humidity and wind speed, and the breeding process parameters at least include one of animal density, feeding process parameters and manure removal method; the second multi-source heterogeneous data refers to a clean data set obtained after missing value interpolation and standardization processing of the first multi-source heterogeneous data, which can be used for subsequent analysis and calculation.
[0065] In order to solve the problems of single data source and lack of structured characterization in ammonia monitoring, and to provide a data basis for subsequent spatiotemporal reconstruction and intelligent analysis, it is necessary to obtain first multi-source heterogeneous data related to ammonia monitoring in the farm, and to construct and preprocess the first multi-source heterogeneous data to obtain feature vectors and second multi-source heterogeneous data.
[0066] Regarding this step, in some possible implementations, the first multi-source heterogeneous data can be obtained through a related data acquisition module; a related vector construction operation is performed on the first multi-source heterogeneous data to obtain feature vectors; and a related preprocessing operation is performed on the first multi-source heterogeneous data to obtain second multi-source heterogeneous data. In some possible implementations, the first multi-source heterogeneous data can be obtained first; and then the first multi-source heterogeneous data is integrated and processed to generate feature vectors and second multi-source heterogeneous data in parallel.
[0067] S102, constructing an ammonia spatiotemporal distribution field based on the second multi-source heterogeneous data, and constructing a spatiotemporal three-dimensional dynamic spectrum based on the ammonia spatiotemporal distribution field.
[0068] Specifically, the ammonia spatiotemporal distribution field referred to in this embodiment refers to a distribution field that can represent the continuous change of ammonia concentration in three-dimensional space and time in the entire breeding area, which is reconstructed by an interpolation algorithm based on sparse sensor observation data; and the spatiotemporal three-dimensional dynamic spectrum refers to a data structure containing time, frequency and space dimensions, which is used to dynamically represent the diffusion mode and periodic fluctuation rule of ammonia concentration from the frequency domain and the spatial domain.
[0069] In order to solve the problem of insufficient spatiotemporal representation caused by limited fixed sensor distribution points, and to represent the dynamic evolution rule of ammonia in the farm, it is necessary to construct an ammonia spatiotemporal distribution field based on the second multi-source heterogeneous data, and to construct a spatiotemporal three-dimensional dynamic spectrum based on the ammonia spatiotemporal distribution field.
[0070] Regarding this step, in some possible implementations, the ammonia spatiotemporal distribution field can be constructed based on the second multi-source heterogeneous data using a related interpolation algorithm; and the spatiotemporal three-dimensional dynamic spectrum can be constructed based on the ammonia spatiotemporal distribution field using a related spectrum analysis technique. In some possible implementations, the second multi-source heterogeneous data can be subjected to unified spatiotemporal feature analysis processing to synchronously generate the ammonia spatiotemporal distribution field and the spatiotemporal three-dimensional dynamic spectrum.
[0071] S103, based on the feature vectors, the ammonia spatiotemporal distribution field and the spatiotemporal three-dimensional dynamic spectrum, calling a pre-set large language model to obtain an analysis result, the analysis result being used to generate an ammonia monitoring report corresponding to the farm and / or to control a target device in the farm.
[0072] Specifically, the analysis result referred to in the embodiment refers to a comprehensive analysis conclusion generated by a large language model, which includes causal reasoning for the cause of ammonia concentration change and trend prediction for future concentration change, specifically including at least one root cause and an attention weight corresponding to each root cause, and an ammonia concentration prediction value at a future time point; the target device refers to an execution device for environmental regulation in the farm, such as but not limited to a fan, a heating device, a manure cleaning device, etc.
[0073] In order to utilize the multi-modal fusion and causal reasoning capabilities of the large language model, solve the island problem of multi-source heterogeneous data, realize active early warning and interpretable decision support, and improve the reliability of ammonia management in the farm, it is necessary to call the preset large language model based on the feature vector, ammonia spatio-temporal distribution field and spatio-temporal three-dimensional dynamic spectrum diagram to obtain the analysis result, and the analysis result is used to generate the ammonia monitoring report corresponding to the farm and / or control the target device in the farm.
[0074] Regarding this step, in some possible implementations, the feature vector, ammonia spatio-temporal distribution field and spatio-temporal three-dimensional dynamic spectrum diagram can be input into the preset large language model for analysis to obtain the analysis result, and the target device is controlled according to the analysis result. In some possible implementations, relevant analysis instructions can be generated based on the feature vector, ammonia spatio-temporal distribution field and spatio-temporal three-dimensional dynamic spectrum diagram, and the analysis instructions are sent to the preset large language model to receive the analysis result fed back by the large language model, which contains relevant instructions for controlling the target device.
[0075] In the embodiment, first, the first multi-source heterogeneous data related to ammonia monitoring in the farm is obtained, and vector construction and preprocessing are performed to obtain the feature vector and the second multi-source heterogeneous data, thereby avoiding the problem of single data source and lack of structured representation in ammonia monitoring; then, the ammonia spatio-temporal distribution field is constructed based on the second multi-source heterogeneous data, and the spatio-temporal three-dimensional dynamic spectrum diagram is further constructed, thereby overcoming the problem of insufficient spatio-temporal representation caused by limited fixed sensor distribution points; finally, based on the feature vector, ammonia spatio-temporal distribution field and spatio-temporal three-dimensional dynamic spectrum diagram, the preset large language model is called for analysis to obtain the analysis result, which can be used to generate the ammonia monitoring report or control the target device. This process utilizes the multi-modal fusion capability of the large language model to break through the island limitation of multi-source heterogeneous data, so that the analysis result can represent the spatio-temporal distribution characteristics of ammonia in the farm and the causal relationship of influencing factors, thereby improving the reliability of ammonia management in the farm.
[0076] Please refer to Figure 2 A flowchart for obtaining the feature vector and the second multi-source heterogeneous data is provided for the embodiment of the present application, as shown in Figure 2As shown, the method of the embodiment of the present application can include steps S201-S203, which can be further detailed to the above step "performing vector construction and preprocessing on the first multi-source heterogeneous data respectively to obtain the feature vector and the second multi-source heterogeneous data".
[0077] S201, performing data extraction and encoding on the first multi-source heterogeneous data to obtain a feature vector, the feature vector being used to represent the corresponding environmental parameters and breeding process parameters of the farm, the environmental parameters including at least one of ammonia concentration, temperature, humidity, and wind speed, and the breeding process parameters including at least one of animal density, feeding process parameters, and manure removal method;
[0078] S202, based on a preset first spatiotemporal Kriging algorithm, performing interpolation processing on the missing data in the first multi-source heterogeneous data to obtain interpolated first multi-source heterogeneous data;
[0079] S203, performing standardization processing on the interpolated first multi-source heterogeneous data to obtain second multi-source heterogeneous data.
[0080] Specifically, the multi-source heterogeneous data has differences in format, source, and precision, and direct fusion may lead to information loss or analysis deviation. The embodiment constructs a unified data representation through the vectorization and preprocessing steps to provide a data basis for subsequent spatiotemporal analysis and intelligent reasoning.
[0081] First, in order to convert structured data and unstructured data into quantifiable analysis units and structure the key parameters, data extraction and encoding are performed on the first multi-source heterogeneous data to obtain a feature vector, the feature vector being used to represent the corresponding environmental parameters and breeding process parameters of the farm, the environmental parameters including at least one of ammonia concentration, temperature, humidity, and wind speed, and the breeding process parameters including at least one of animal density, feeding process parameters, and manure removal method. Among them, the environmental parameters refer to data reflecting the real-time physical state of the farm obtained by direct measurement or indirect calculation through sensors; the breeding process parameters refer to parameters describing the operation process and state of breeding management, and the data sources include management system records or manual input; the ammonia concentration refers to the mass or volume of ammonia contained in a unit volume of air; the temperature refers to the Celsius or Fahrenheit temperature value of the air in the farm; the humidity refers to the relative value of the water vapor content in the air; the wind speed refers to the speed of air flow; the animal density refers to the number of animals per unit area or volume; the feeding process parameters refer to parameters related to feeding activities including feed types, feeding amount, feeding frequency, etc.; and the manure removal method refers to parameters describing the type and frequency of manure removal operation, which is usually converted into a numerical form through one-hot encoding.
[0082] As to this step, in some possible implementation ways, the numerical fields and the text descriptions related to the feature vector can be extracted from the first multi-source heterogeneous data through a preset data interface or protocol, the numerical fields are directly assigned values, and the text descriptions are encoded, where the encoding operation includes converting the text descriptions into numerical vectors, so as to integrate the results of the encoding operation into the feature vector.
[0083] Further, in order to ensure the continuity of data in time series and the integrity of data in spatial distribution, it is necessary to interpolate the missing data in the first multi-source heterogeneous data based on a preset first spatiotemporal Kriging algorithm to obtain the interpolated first multi-source heterogeneous data. The first spatiotemporal Kriging algorithm refers to an interpolation method based on the theory of geostatistics, combining spatial autocorrelation and temporal autocorrelation for optimal unbiased estimation; the missing data refers to data points that are not recorded due to sensor failure, transmission interruption or inconsistent collection period; the interpolation processing refers to a process of estimating the data value of an unknown spatiotemporal point by using the data value of a known spatiotemporal point; and the interpolated first multi-source heterogeneous data refers to a complete data set without missing points in time and spatial dimensions after spatiotemporal interpolation.
[0084] As to this step, in some possible implementation ways, the spatiotemporal variogram can be calculated based on the spatiotemporal positions and values of the known data points in the first multi-source heterogeneous data, and then the Kriging equation set is constructed and solved to obtain the weight coefficient, which is applied to the values of the known data points to estimate the values of the missing data points, and the estimated values of the missing data points are filled into the missing positions in the original data to obtain the interpolated first multi-source heterogeneous data.
[0085] Further, in order to eliminate the calculation bias introduced by the differences in dimension and order of magnitude between different data sources, and to improve the convergence speed and prediction stability of the model training, the interpolated first multi-source heterogeneous data needs to be standardized to obtain the second multi-source heterogeneous data. The standardization processing refers to scaling data of different dimensions by a certain proportion to make them fall within a small specific interval, so as to eliminate the influence of dimension.
[0086] As to this step, in some possible implementation ways, the mean and standard deviation of each numerical feature in the interpolated first multi-source heterogeneous data can be calculated, and the standardization can be performed by subtracting the mean of each numerical feature and dividing by the standard deviation, and the data after standardization is combined into the second multi-source heterogeneous data.
[0087] In this embodiment, through data extraction and encoding steps, unstructured text data and structured numerical data are uniformly converted into feature vectors, enabling the large language model to handle factors such as aquaculture processes. Through spatiotemporal kriging interpolation, a spatiotemporally continuous dataset is reconstructed based on limited observational data, providing input data for constructing the ammonia spatiotemporal distribution field. Through standardization, the dimensional differences between different parameters are eliminated, ensuring that subsequent spatiotemporal analysis models and the large language model are operated on a unified data scale, improving the numerical stability of the model calculations. The combination of these three steps constitutes the transformation process from raw, multi-source heterogeneous data to a standardized, computable dataset, providing data support for the subsequent reconstruction and causal analysis of the ammonia spatiotemporal distribution.
[0088] In one embodiment, the step of "constructing the spatiotemporal distribution field of ammonia based on second multi-source heterogeneous data" can be further refined and may include the following steps:
[0089] Based on the preset second spatiotemporal kriging algorithm, the ammonia concentration data collected by sparse sensors in the second multi-source heterogeneous data are interpolated and reconstructed to obtain the spatiotemporal distribution field of ammonia.
[0090] The formula for the second spacetime Kriging algorithm is:
[0091] ;
[0092] in, The target spatiotemporal point to be reconstructed in the spatiotemporal distribution field of ammonia gas. The concentration value of the target spatiotemporal point middle, The spatial location of the target spatiotemporal point. The time point of the target spatiotemporal point; The ammonia concentration data collected by the sparse sensor at spatiotemporal points The concentration value, the spatiotemporal point middle, For the first The spatial location of the sparse sensor. For the first The sparse sensors are located in space. The time point for data collection; the installation location of the sparse sensor is determined based on the ammonia source in the farm and the diffusion boundary of the ammonia source in the farm, and the ammonia source is determined based on the types of farmed animals and the key operating processes associated with the types of farmed animals; These are the weighting coefficients; The number of sparse sensors;
[0093] The weighting coefficient The following system of equations was solved to obtain the following:
[0094] ;
[0095] ;
[0096] in, For the first The spatial location of the sparse sensor. For the first The sparse sensors are located in space. The time point at which the data was collected; A variogram function describing spatiotemporal autocorrelation; For spatial location difference, corresponding or ; For time difference, corresponding or ; It is a Lagrange multiplier.
[0097] Specifically, considering the spatiotemporal continuity of ammonia concentration distribution in a farm and the limitations of traditional interpolation methods in handling complex environmental influences, this embodiment proposes to use the Kriging interpolation method that considers the spatiotemporal variability function to construct the ammonia spatiotemporal distribution field.
[0098] To achieve high-precision spatiotemporal interpolation reconstruction of ammonia concentration data acquired by sparse sensors and obtain a continuous spatiotemporal distribution field of ammonia, it is necessary to calculate... The corresponding formula is:
[0099] ;
[0100] in, The target spatiotemporal point to be reconstructed in the spatiotemporal distribution field of ammonia gas. The concentration value of the target spatiotemporal point middle, The spatial location of the target spatiotemporal point. The time point of the target spatiotemporal point; The ammonia concentration data collected by the sparse sensor at spatiotemporal points The concentration value, the spatiotemporal point middle, For the first The spatial location of the sparse sensor. For the first The sparse sensors are located in space. a time point at which the data is collected; the installation position of the sparse sensor is determined based on an ammonia source in the farm and a diffusion boundary of the ammonia source in the farm, the ammonia source being determined based on a kind of farmed animal in the farm and a key operation process associated with the kind of farmed animal; is a weight coefficient; is the number of the sparse sensors.
[0101] It should be noted that the installation position of the sparse sensor is achieved based on identification of the ammonia source in the farm and determination of the diffusion boundary thereof, so as to guarantee representativeness of the sparse data. The identification of the ammonia source firstly depends on the kind of farmed animal in the farm and the key operation process associated with the kind of farmed animal. For example, in a pig farm, the main ammonia sources include a discharge area in a pig house, a manure treatment area and a daily flushing operation area; in a dairy or beef cattle farm, the main ammonia sources include a cow house bed, a manure stacking area and a feed scattering area. The division of these areas is related to the key operation processes such as manure cleaning frequency, ventilation mode and feeding mode, and determines the release intensity and spatio-temporal characteristics of ammonia. The determination of the diffusion boundary is achieved by environmental simulation or empirical model analysis, and comprehensively considers factors such as farm layout, wind speed, temperature and humidity. Exemplarily, the installation position of the sparse sensor is determined as three levels: first, a core area of the ammonia source, such as directly above the pig house manure trench or the center of the manure stacking area in the cattle farm, for capturing the basic release rate; second, a transition area of the diffusion boundary, such as a key area downwind in the breeding house or a buffer zone between the manure stacking area and the office area, for monitoring the concentration decay law; third, at the boundary of the entire farm, for evaluating the overall impact on the surrounding environment. The determination of the installation position based on the ammonia source and the diffusion boundary ensures that the limited sparse sensors can cover the key nodes from release to diffusion, providing data input for subsequent construction of the ammonia spatio-temporal distribution field.
[0102] Regarding the above formula, in some possible implementations, based on the second multi-source heterogeneous data, the weight coefficient is first obtained by solving the Kriging equation set, then the weight coefficient is multiplied by the concentration value of the ammonia concentration data collected by the sparse sensor at the spatio-temporal point , and finally all products are summed up to obtain the concentration value of the target spatio-temporal point to be reconstructed in the ammonia spatio-temporal distribution field, so as to construct the continuous ammonia spatio-temporal distribution field.
[0103] Based on the above formula, in order to obtain the weight coefficient , the following Kriging equation set needs to be solved. Specifically, the involves a variogram function for describing spatio-temporal autocorrelation. is a Lagrange multiplier; is a spatial position of the i-th sparse sensor; is a spatial position of the i-th sparse sensor; is a time point at which the i-th sparse sensor collects data at the spatial position ; is a time point at which the i-th sparse sensor collects data at the spatial position ; is a spatial position difference corresponding to ; is a time difference corresponding to ; is a weight coefficient, wherein the weight coefficient satisfies an equation group:
[0104] ;
[0105] ;
[0106] Regarding the equation group, in some possible implementations, the values of the spatiotemporal variation functions and may be calculated based on the spatial distance and the time difference between the spatiotemporal point at which the sparse sensor is located in the second multi-source heterogeneous data and the target spatiotemporal point , and then an equation group containing the weight coefficient and the Lagrange multiplier is constructed, and finally the equation group is solved through matrix operation to obtain the weight coefficient .
[0107] In this embodiment, the weight coefficient is solved through the equation group based on the spatiotemporal variation function, so that the estimation of the concentration value of the target spatiotemporal point to be reconstructed in the ammonia spatiotemporal distribution field can fully utilize the autocorrelation information of the known data in the spatiotemporal domain, and compared with the interpolation method without considering the spatiotemporal correlation, the reconstruction accuracy is significantly improved, thereby providing a high-reliability data basis for subsequent dynamic spectrum construction and intelligent analysis.
[0108] Please refer to Figure 3 , which provides a flowchart for obtaining an analysis result, as shown in Figure 3 , the method of the embodiment of the present application can include the following steps S301-S302, which can be further refined as the above-mentioned step “calling a pre-set large language model based on the feature vector, the ammonia spatiotemporal distribution field, and the spatiotemporal three-dimensional dynamic spectrum to obtain an analysis result”.
[0109] S301, constructing a natural language prompt word containing a causal reasoning request and a trend prediction request according to the feature vector, the ammonia spatial-temporal distribution field and the spatial-temporal three-dimensional dynamic spectrum, the causal reasoning request being used to inquire the root cause of the ammonia concentration change, and the trend prediction request being used to predict the ammonia concentration change at a future time point;
[0110] S302, calling a preset large language model based on the natural language prompt word to perform causal reasoning and trend prediction, and obtaining an analysis result.
[0111] Specifically, considering the complexity of multi-source heterogeneous data and the characteristics of large language models in processing natural language tasks, the embodiment uniformly converts structured spatial-temporal data and analysis requests into natural language prompt words.
[0112] First, in order to input multi-modal data into a large language model and guide it to perform an analysis task, a natural language prompt word containing a causal reasoning request and a trend prediction request needs to be constructed according to the feature vector, the ammonia spatial-temporal distribution field and the spatial-temporal three-dimensional dynamic spectrum, the causal reasoning request being used to inquire the root cause of the ammonia concentration change, and the trend prediction request being used to predict the ammonia concentration change at a future time point. The natural language prompt word is a text structure containing a description of the state of the farm and an analysis instruction, which meets the input requirements of the large language model. The causal reasoning request is an instruction part contained in the natural language prompt word, which is used to drive the large language model to analyze and output the key factors causing the ammonia concentration change and their correlation. The trend prediction request is an instruction part contained in the natural language prompt word, which is used to drive the large language model to infer the spatial distribution state of the ammonia concentration at a specific future time point based on the current and historical states.
[0113] Regarding this step, in some possible implementations, the feature vector, the ammonia spatial-temporal distribution field and the spatial-temporal three-dimensional dynamic spectrum can be first formatted, and key numerical information and topological features are extracted therefrom; then the key numerical information and topological features are filled into the description part of the natural language prompt word according to a preset template; finally, the causal reasoning request and the trend prediction request are added to the natural language prompt word as instruction parts to form a complete prompt text.
[0114] Further, after the natural language prompt word is constructed, a preset large language model is called based on the natural language prompt word to perform causal reasoning and trend prediction, and an analysis result is obtained. The causal reasoning and trend prediction are the judgment process of the large language model in comprehensively analyzing the multi-source data of the farm and outputting the attribution of the ammonia concentration change and the future state, after receiving the natural language prompt word, by using the pre-trained knowledge and context learning ability in the large language model.
[0115] As to this step, in some possible implementation manners, a natural language prompt word can be taken as an input parameter to call a preset large language model through an application program interface; in the calling process, the feature vector, the ammonia space-time distribution field and the summary information of the space-time three-dimensional dynamic spectrum are transmitted to the large language model as a context; a text response returned by the large language model is received and parsed, the text response containing a causal reasoning result and a trend prediction result; and the parsed text response is integrated into a structured analysis result.
[0116] In this embodiment, the numerical data, spatial distribution information and time sequence change mode carried by the feature vector, the ammonia space-time distribution field and the space-time three-dimensional dynamic spectrum are uniformly converted into a natural language form processable by the preset large language model by constructing a natural language prompt word containing a causal reasoning request and a trend prediction request. The conversion process establishes an association between multi-source heterogeneous data and analysis tasks, so that the preset large language model can process information based on a unified text context. The preset large language model is called based on the natural language prompt word to perform causal reasoning and trend prediction, which utilizes the learning ability of the preset large language model for non-linear relationships to extract the correlation between different factors from the textual data, and then realizes the causal attribution of the ammonia concentration change and the inference of the future space-time evolution state. The generated analysis result has a deduction process that integrates multi-dimensional information, and compared with the analysis of a single data source, can reflect the driving factors and future trends of the ammonia concentration change, and provides a data basis for generating an ammonia monitoring report and equipment control.
[0117] In an embodiment, the step of "calling the preset large language model based on the natural language prompt word to perform causal reasoning and trend prediction to obtain an analysis result" is further refined and can include the following steps:
[0118] inputting the natural language prompt word into the preset large language model to trigger the large language model to perform causal reasoning and trend prediction;
[0119] receiving a causal reasoning result and a trend prediction result output by the large language model, the causal reasoning result including at least one root cause and a weight corresponding to each root cause, and the trend prediction result including an ammonia concentration prediction value at a future time point;
[0120] integrating the causal reasoning result and the trend prediction result to generate an analysis result;
[0121] wherein the attention mechanism of the large language model in performing causal reasoning is defined as:
[0122] ;
[0123] wherein, is a function for calculating the importance weight of different parts in the input information; is a query vector, is a key vector, is a value vector; represents the dot product of the query vector and the key vector in the transformed form , which is used to calculate the similarity score between the query vector and the key vector; is a factor used to scale the similarity score, is the vector dimension of the query vector and the key vector ; is a normalization function used to convert the scaled similarity score into an importance weight distribution with a total sum of 1; the importance weight distribution is multiplied by the value vector to perform a weighted sum of the value vector.
[0124] Specifically, considering that traditional models have difficulty quantifying the contribution of different factors to the change in ammonia concentration when processing multi-source heterogeneous data, and lack interpretability, the embodiment proposes using the internal attention mechanism of a pre-set large language model to identify and quantify key factors affecting ammonia concentration by calculating attention weights, to achieve causal reasoning.
[0125] In this embodiment, the variables in the formula are assigned specific meanings related to the current analysis task to achieve interpretable causal reasoning. is a query vector, specifically encoded by a causal reasoning request (for example, "What is the root cause of the current high ammonia concentration?") ; is a key vector, and is a value vector, which are respectively encoded by each potential influencing factor (such as "temperature rise" and "wind speed decrease" in environmental parameters, "cleaning operation" in breeding process parameters, and specific high concentration area characteristics in the spatiotemporal distribution field) in multi-source heterogeneous data, for relevance matching with the query vector. is the vector dimension of the query vector and the key vector .
[0126] Exemplarily, to generate a causal reasoning result containing quantified weights based on natural language prompt words and multi-source heterogeneous data, a function for calculating the importance weights of different parts of the input information needs to be calculated:
[0127] First, the similarity score between the query vector "Why is the ammonia concentration high?" and the key vector "temperature rise" and other factor encodings is calculated by , the higher the score, the stronger the relevance of the factor to the current problem.
[0128] Next, using The similarity score is scaled to ensure numerical stability and prevent calculation errors caused by excessively large or small vector dimensions.
[0129] Then, through This normalization function converts the scaled score into an importance weight distribution that sums to 1. For example, the mechanism might output: M1 represents "increased temperature", M2 represents "reduced ventilation", and M3 represents "manure removal operation", where M1, M2, and M3 are all values greater than 0 and less than 1, and M1>M2>M3.
[0130] Finally, this importance weight distribution is compared with the value vector. Multiplication completes the weighted summation of the information content of each factor in the value vector. This step integrates the information of all factors, but assigns greater weight to the more important factors, thereby generating an output vector that gives higher weight to the key reasons.
[0131] This output vector is ultimately used to generate causal inference results containing quantized weights. For example, a large language model would use this output to state in natural language: "The reason for the high ammonia concentration is the increase in temperature (weight M1) and the decrease in ventilation (weight M2)." It should be noted that the above examples are only for the purpose of understanding this embodiment and do not constitute a limitation on the specific numerical values, data types, etc. of this embodiment.
[0132] In this embodiment, through the computational process of the aforementioned attention mechanism, the pre-defined large language model can identify the root causes affecting ammonia concentration changes from multi-source information such as feature vectors, the spatiotemporal distribution field of ammonia, and the spatiotemporal three-dimensional dynamic spectrum. It then outputs causal inference results containing quantified weighting factors in natural language. This interpretable output based on attention weights can support managers in understanding the causes of anomalies, provide a basis for formulating control strategies, and improve the interpretability and reliability of decision support.
[0133] Please see Figure 4 This application provides a flowchart illustrating the process of constructing a spatiotemporal three-dimensional dynamic spectrum, as shown in the embodiments. Figure 4 As shown, the method of this application embodiment may include the following steps S401-S402, which can be used as a further refinement of the above step "constructing a spatiotemporal three-dimensional dynamic spectrum based on the spatiotemporal distribution field of ammonia".
[0134] S401, respectively perform fast Fourier transform on time series of a plurality of local space points in the ammonia space-time distribution field to obtain frequency spectrum data corresponding to each local space point, wherein the frequency spectrum data is used to represent frequency domain characteristics of ammonia concentration change over time of the corresponding local space point;
[0135] S402, based on the frequency spectrum data and the spatial wave number component extracted from the ammonia space-time distribution field, constructing a three-dimensional dynamic spectrum graph.
[0136] Specifically, considering that the ammonia concentration has periodic fluctuations in the time dimension and diffusion patterns in the spatial dimension, it is difficult for traditional time domain analysis methods to reveal the joint characteristics of time and frequency domains simultaneously, and the embodiment proposes to extract time-frequency characteristics by fast Fourier transform and construct a three-dimensional dynamic spectrum graph combining spatial wave number components.
[0137] First, in order to extract the periodic fluctuation characteristics of ammonia concentration in the time dimension, fast Fourier transform needs to be performed on the time series of a plurality of local space points in the ammonia space-time distribution field to obtain frequency spectrum data corresponding to each local space point, wherein the frequency spectrum data is used to represent the frequency domain characteristics of the ammonia concentration change over time of the corresponding local space point. Among them, the local space point in the ammonia space-time distribution field refers to the discrete spatial coordinate point selected according to the preset spatial resolution in the reconstructed continuous ammonia concentration field; the time series of the local space point refers to the ordered sequence composed of ammonia concentration values collected at a fixed spatial coordinate point according to the set time sampling frequency; the frequency spectrum data refers to the data set obtained by performing fast Fourier transform on the time series of the local space point, with frequency as the independent variable and energy or amplitude as the dependent variable.
[0138] Regarding this step, in some possible implementation manners, firstly, for each selected local space point in the ammonia space-time distribution field, time series data of the local space point in a preset time window can be extracted, which is the sequence of ammonia concentration change over time of the local space point. Then, a window function is applied to the time series data. Next, fast Fourier transform is performed on the windowed time series data to obtain frequency spectrum results. Finally, the amplitude square of the frequency spectrum results is calculated to obtain the power spectral density, which is taken as the frequency spectrum data corresponding to the local space point. By traversing all selected local space points, the frequency spectrum data corresponding to each local space point can be obtained.
[0139] Further, after obtaining the frequency spectrum data, based on the frequency spectrum data and the spatial wave number component extracted from the ammonia space-time distribution field, a three-dimensional dynamic spectrum graph is constructed. The spatial wave number component extracted from the ammonia space-time distribution field refers to a data set obtained by performing spatial Fourier transform on the two-dimensional spatial distribution of the ammonia space-time distribution field at a specific time, with spatial wave number as the independent variable and energy or amplitude as the dependent variable.
[0140] Regarding this step, in some possible implementations, the spectral data corresponding to each local spatial point can be first organized according to its spatial coordinates to form a three-dimensional data body indexed by time, frequency, and spatial coordinates. Then, one or more representative time instants are selected from the ammonia spatiotemporal distribution field, and the spatial Fourier transform is performed on the ammonia concentration spatial distribution data at each time instant to extract the spatial wave number component. Next, the spectral data and the spatial wave number component are fused and associated. Finally, the data set fused with the time dimension, the frequency dimension, and the spatial wave number dimension is constructed into a spatiotemporal three-dimensional dynamic spectrum.
[0141] In this embodiment, the time series of each local spatial point is converted from the time domain to the frequency domain by the fast Fourier transform, and the periodic characteristics of the ammonia concentration change over time are extracted; the spatial wave number component is extracted from the ammonia spatiotemporal distribution field by the spatial Fourier transform, and the distribution characteristics of the ammonia concentration in space are represented. The fusion of the spectral data and the spatial wave number component to construct the spatiotemporal three-dimensional dynamic spectrum can simultaneously represent the time characteristics, periodic rules, and spatial characteristics of ammonia diffusion in one data structure, providing data support for subsequent analysis.
[0142] In an embodiment, the above-mentioned step of “performing fast Fourier transform on the time series of multiple local spatial points in the ammonia spatiotemporal distribution field to obtain spectral data corresponding to each local spatial point” is implemented based on the following formula:
[0143] ;
[0144] wherein, is the spectral data, representing the ammonia concentration spectrum of the local spatial point at time ; is the frequency; is the ammonia concentration value of the local time series, derived from the time series data of the ammonia spatiotemporal distribution field at the local spatial point ; is the x-axis position of the preset three-dimensional grid coordinate in the farm, is the y-axis position of the preset three-dimensional grid coordinate in the farm, is the z-axis position of the preset three-dimensional grid coordinate in the farm; the value range of the axis is determined based on the type of the farmed animals in the farm; is the window function, used for windowing the local time series to reduce spectral leakage; FFT is the fast Fourier transform, used for converting the local time series from the time domain to the frequency domain.
[0145] Specifically, considering that the ammonia concentration has periodic fluctuations in the time dimension, and its distribution characteristics also differ in the vertical space, i.e., different height levels. This embodiment extracts the frequency characteristics of the local spatial point in the preset three-dimensional grid by performing a fast Fourier transform on the time series of the local spatial point, and introduces height dimension information to adapt the spectrum analysis to the needs of the actual breeding environment. In this embodiment, the farm or a designated area in the farm is divided into a preset three-dimensional grid for spatial positioning. The local spatial point refers to a specific coordinate point in the preset three-dimensional grid, where is the x-axis position of the preset three-dimensional grid coordinate in the farm, is the y-axis position of the preset three-dimensional grid coordinate in the farm, is the z-axis position of the preset three-dimensional grid coordinate in the farm; The value range of the z-axis is determined based on the type of livestock in the farm. In particular, The value range of the z-axis is determined according to the type of livestock in the farm, for example, for different animal species such as chickens, cows, and pigs, because the activity area, breathing height range, and ammonia diffusion height range of different animal species differ.
[0146] The is a window function used to window the local time series to reduce spectral leakage; is the ammonia concentration value of the local time series, which is derived from the time series data of the ammonia spatio-temporal distribution field at the local spatial point ; FFT is a fast Fourier transform used to convert the local time series from the time domain to the frequency domain.
[0147] First, in order to extract the frequency domain characteristics of the local spatial point in the preset three-dimensional grid at a specific time window and a specific height level, we need to calculate , where is the frequency spectrum data representing the ammonia concentration spectrum of the local time series at the local spatial point at time , and is the frequency satisfying the relationship:
[0148] ;
[0149] Regarding this formula, in some possible implementations, the monitored z-axis height range can be first determined according to the type of livestock in the farm (e.g., chickens, cows, pigs, etc.), for example, for a chicken coop, the height range of 0.1-1.5 meters is usually concerned, and for a cowshed, the height range of 0.5-2.5 meters may be concerned; then, the local spatial point and obtain the ammonia concentration value of the local time sequence ; then, the window function is multiplied by the ammonia concentration value of the local time sequence , and windowing processing is performed; then, fast Fourier transform (FFT) is performed on the windowed time sequence data to obtain a frequency spectrum result in complex form; finally, the square of the amplitude of each frequency component in the frequency spectrum result is calculated to obtain the frequency spectrum data .
[0150] In this embodiment, by introducing the z-axis height dimension information and determining the monitoring height range in the preset three-dimensional grid based on the types of farmed animals in the farm, and combining the fast Fourier transform, the ammonia concentration value of the local time sequence of the local space point in the three-dimensional space is converted from the time domain to the frequency domain to obtain the energy distribution characteristics in the frequency domain. The energy distribution characteristics can not only reflect the periodicity of the ammonia concentration change, but also reflect the frequency characteristics of ammonia diffusion at different height levels, providing accurate data support for analyzing the spatiotemporal distribution law of ammonia concentration in different farming environments, and helping to develop differentiated ammonia control strategies for different animal farming environments.
[0151] Please refer to Figure 5 , a flowchart for regulating the target device is provided, as shown in Figure 5 , the method of the present application can further include the following steps S501-S503.
[0152] S501, based on the analysis result and the feature vector, calling a large language model to dynamically correct the basic ammonia emission flux model of the farm to obtain an adaptive ammonia emission flux model;
[0153] S502, generating a device control instruction corresponding to the target device in the farm according to the adaptive ammonia emission flux;
[0154] S503, regulating the running state of the target device according to the device control instruction.
[0155] Specifically, considering that the basic ammonia emission flux model has insufficient generalization ability in complex farming environments, and its fixed parameters are difficult to dynamically respond to the change of ammonia emission rate under the coupling of multiple factors, this embodiment proposes to use the context understanding ability of the large language model to perform real-time parameter correction on the basic ammonia emission flux model to construct an adaptive emission flux model.
[0156] First, in order to realize the accurate estimation and dynamic regulation of ammonia emission flux, it is necessary to call a large language model to dynamically modify the basic ammonia emission flux model of the farm based on the analysis results and feature vectors, and obtain an adaptive ammonia emission flux model. Among them, the basic ammonia emission flux model refers to a static model based on physical mechanism or empirical formula for calculating ammonia emission rate, which contains one or more fixed empirical coefficients; the adaptive ammonia emission flux model refers to a flux calculation model that can more accurately reflect the real-time emission characteristics after dynamically adjusting the internal parameters according to the current spatio-temporal context.
[0157] Regarding this step, in some possible implementations, the causal reasoning results and trend prediction results contained in the analysis results, as well as the environmental parameters and breeding process parameters contained in the feature vectors, can be used as input information together to generate a dynamic modification request through a preset prompt word template; then, the dynamic modification request is input into a preset large language model, triggering the preset large language model to calculate the modification value of the empirical coefficient in the basic ammonia emission flux model based on its built-in expert knowledge base and the current input information; finally, the calculated modification value is applied to the basic ammonia emission flux model to generate an adaptive ammonia emission flux model.
[0158] Further, after obtaining the adaptive ammonia emission flux model, a device control instruction corresponding to a target device in the farm is generated according to the adaptive ammonia emission flux. Among them, the target device in the farm refers to a mechanical device used to adjust the environmental parameters of the farm or to perform breeding operations, including but not limited to fans, heating devices, manure removal devices, and feeding devices. It can be understood that the type and number of target devices can be one or more; the device control instruction corresponding to the target device refers to an instruction for instructing the target device to adjust its operating state or operating parameters, which is associated with the emission flux value calculated by the adaptive ammonia emission flux model.
[0159] Regarding this step, in some possible implementations, the type of target device that needs to be regulated and the expected regulation effect can be determined based on the output of the adaptive ammonia emission flux model and in combination with a preset environmental regulation strategy; then, the type of target device that needs to be regulated and the expected regulation effect are used as input parameters to call a preset instruction generation module; the preset instruction generation module converts the regulation requirement into a device control instruction conforming to the communication protocol of the target device according to the input parameters; finally, the device control instruction is output.
[0160] Next, the operating state of the target device is regulated according to the device control instruction.
[0161] As to this step, in some possible implementation manners, the device regulation instruction can be sent to the corresponding device controller through an application program interface (API); the device controller receives and analyzes the device regulation instruction, converts it into an electric signal for driving an execution mechanism (such as a motor or a valve) in the target device; based on the electric signal, the execution mechanism changes its operating parameters (such as rotation speed or opening degree), thereby regulating the operating state of the target device.
[0162] In this embodiment, the basic ammonia emission flux model is dynamically corrected by calling a large language model, so that the flux model can adapt to the complex and changeable environmental conditions and breeding processes in the farm, and the estimation accuracy of the ammonia emission flux is improved; the device regulation instruction is generated based on the corrected adaptive ammonia emission flux model, and the target device is directly controlled to operate, realizing integrated management from data sensing to intelligent decision-making to closed-loop control, and improving the timeliness and accuracy of the environmental regulation of the farm.
[0163] In an embodiment, the calculation formula of the adaptive ammonia emission flux model is:
[0164] ;
[0165] Among them, is the adaptive ammonia emission flux of the farm at time ; is an empirical coefficient of the basic ammonia emission flux model; , are the ammonia concentration in the upwind direction and the ammonia concentration in the downwind direction of the farm, respectively; is the wind speed; is a dimensionless dynamic comprehensive influence coefficient, and the dynamic comprehensive influence coefficient is used to comprehensively represent the nonlinear correction effect of at least one of the following information on the basic ammonia emission flux model: information on the nonlinear enhancement or inhibition effect of environmental temperature and humidity on the basic ammonia release rate; information on the correction effect of the current ventilation mode on the linear wind speed transport efficiency; information on the dynamic influence of the current state of the farm manure on ammonia volatilization; information on the contribution of instantaneous disturbance caused by animal activity to local ammonia concentration.
[0166] Specifically, considering that the basic ammonia emission flux model is difficult to dynamically respond to the change of ammonia emission rate under the coupling action of multiple factors, the large language model is pre-set in this embodiment to perform real-time parameter correction on the basic ammonia emission flux model, so as to construct an adaptive ammonia emission flux model.
[0167] The parameter mentioned in this embodiment refers to a dimensionless dynamic comprehensive influence coefficient; the parameter refers to the fixed empirical coefficient in the basic ammonia emission flux model; parameter refers to the ammonia concentration value measured at the upwind position of the farm; parameter refers to the ammonia concentration value measured at the downwind position of the farm; parameter refers to the wind speed measurement value in the farm environment;
[0168] First, in order to estimate the ammonia emission flux and carry out regulation, the parameter needs to be calculated, where the parameter is the value representing the actual ammonia emission rate of the farm at time t, which is dynamically corrected based on the current spatio-temporal context.
[0169] Regarding the formula, in some possible implementations, first, the empirical coefficient of the basic ammonia emission flux model, the upwind ammonia concentration of the farm, the downwind ammonia concentration , and the wind speed are obtained; then, based on the analysis results and the feature vector, a preset large language model is called to perform dynamic correction calculation, and the value of the dynamic comprehensive influence coefficient is output; finally, the value of the dynamic comprehensive influence coefficient , the empirical coefficient of the basic ammonia emission flux model, the difference between the upwind ammonia concentration and the downwind ammonia concentration , and the wind speed are substituted into the calculation formula of the adaptive ammonia emission flux model to obtain the final adaptive ammonia emission flux .
[0170] In this embodiment, by introducing the dynamic comprehensive influence coefficient calculated by the large language model, the adaptive ammonia emission flux model can be adjusted according to various factors such as real-time environmental temperature and humidity, ventilation mode, manure state, and animal activity in the farm. Compared with the basic ammonia emission flux model with fixed parameters, this scheme improves the adaptability and prediction ability of the model, and provides data support for subsequent generation of equipment regulation instructions.
[0171] In combination with Figure 6 , the present application also proposes a comprehensive embodiment. Specifically, first, a first multi-source heterogeneous data related to ammonia monitoring in the farm is obtained; the first multi-source heterogeneous data refers to a set of original data collected through various channels in the farm, which are different in format and source, including but not limited to structured data collected by fixed sensor networks and mobile monitoring units, and unstructured data such as device operation logs, breeder work records, and text description summaries of monitoring videos.
[0172] Data extraction and encoding are performed on the first multi-source heterogeneous data to obtain a feature vector; specifically, numerical fields and text descriptions related to the feature vector are extracted from the first multi-source heterogeneous data through a pre-set data interface or protocol, the numerical fields are directly assigned, and the text descriptions are encoded, wherein the encoding operation includes converting the text descriptions into numerical vectors, and the results of the encoding operation are integrated into the feature vector; the feature vector is used to represent the corresponding environmental parameters and breeding process parameters of the farm, the environmental parameters include at least one of ammonia concentration, temperature, humidity, and wind speed, and the breeding process parameters include at least one of animal density, feeding process parameters, and manure removal method.
[0173] Based on a pre-set first spatio-temporal Kriging algorithm, interpolation processing is performed on the missing data in the first multi-source heterogeneous data; the first spatio-temporal Kriging algorithm is an interpolation method based on the theory of geostatistics, combined with spatial autocorrelation and temporal autocorrelation, for processing data points that are not recorded due to sensor failure, transmission interruption, or inconsistent collection period; specifically, based on the spatio-temporal position and value of the known data points in the first multi-source heterogeneous data, a spatio-temporal variation function is calculated, and then a Kriging equation set is constructed and solved to obtain a weight coefficient, which is applied to the values of the known data points to estimate the values of the missing data points.
[0174] The interpolated first multi-source heterogeneous data is standardized to obtain second multi-source heterogeneous data; the standardization processing refers to scaling data of different dimensions by a certain proportion to make it fall within a small specific interval, so as to eliminate the influence of dimension; specifically, the mean and standard deviation of each numerical feature in the interpolated first multi-source heterogeneous data are calculated, and the standardized data is obtained by subtracting the mean of each numerical feature and dividing by the standard deviation, and the standardized data is combined into the second multi-source heterogeneous data.
[0175] Based on the second multi-source heterogeneous data, an ammonia spatio-temporal distribution field is constructed; the ammonia spatio-temporal distribution field refers to a distribution field that can represent the continuous change of ammonia concentration in three-dimensional space and time within the entire breeding area, reconstructed by an interpolation algorithm based on sparse sensor observation data; specifically, based on a pre-set second spatio-temporal Kriging algorithm, the ammonia concentration data collected by the sparse sensors in the second multi-source heterogeneous data are interpolated and reconstructed; the installation position of the sparse sensors is determined based on the ammonia sources in the farm and the diffusion boundary of the ammonia sources in the farm, and the ammonia sources are determined based on the types of breeding animals in the farm and the key operation processes associated with the types of breeding animals.
[0176] The spectral data are obtained by performing Fast Fourier Transform on the time series of multiple local spatial points in the spatiotemporal distribution field of ammonia. Local spatial points refer to discrete spatial coordinate points selected according to a preset spatial resolution in the reconstructed continuous ammonia concentration field. Spectral data refers to the dataset obtained by performing Fast Fourier Transform on the time series of local spatial points, with frequency as the independent variable and energy or amplitude as the dependent variable.
[0177] A spatiotemporal three-dimensional dynamic spectrum is constructed based on spectral data and spatial wavenumber components extracted from the spatiotemporal distribution field of ammonia. The spatiotemporal three-dimensional dynamic spectrum refers to a data structure containing three dimensions: time, frequency, and space, used to dynamically characterize the diffusion pattern and periodic fluctuation law of ammonia concentration in the frequency domain and spatial domain. Specifically, this step involves first selecting one or more representative moments from the spatiotemporal distribution field of ammonia, performing a spatial Fourier transform on the spatial distribution data of ammonia concentration at each moment, and extracting spatial wavenumber components; then, the spectral data and spatial wavenumber components are fused and correlated to construct the spatiotemporal three-dimensional dynamic spectrum.
[0178] Based on feature vectors, the spatiotemporal distribution field of ammonia, and the spatiotemporal three-dimensional dynamic spectrum, a natural language prompt word containing causal inference requests and trend prediction requests is constructed. This natural language prompt word is a text structure that contains a description of the farm's status and analysis instructions, conforming to the input requirements of a large language model. Specifically, the steps are as follows: first, the feature vectors, the spatiotemporal distribution field of ammonia, and the spatiotemporal three-dimensional dynamic spectrum are formatted to extract key numerical information and topological features; then, the key numerical information and topological features are filled into the description part of the natural language prompt word according to a preset template; finally, the causal inference request and trend prediction request are added as instruction parts to the natural language prompt word.
[0179] The analysis results are obtained by calling a pre-set large language model based on natural language prompts to perform causal reasoning and trend prediction. The analysis results refer to the comprehensive analysis conclusions generated by the large language model, which include causal reasoning on the causes of ammonia concentration changes and trend predictions of future concentration changes. Specifically, the natural language prompts are input into the pre-set large language model to trigger the large language model to perform causal reasoning and trend prediction. The causal reasoning results and trend prediction results output by the large language model are received. The causal reasoning results include at least one root cause and the weight corresponding to each root cause. The trend prediction results include the predicted ammonia concentration values at future time points. When performing causal reasoning, the large language model calculates the importance weights of different factors through an internal attention mechanism.
[0180] Based on the analysis results and feature vectors, the basic ammonia emission flux model of the aquaculture farm is dynamically modified using a large language model to obtain an adaptive ammonia emission flux model. The basic ammonia emission flux model refers to a static model built based on physical mechanisms or empirical formulas to calculate the ammonia emission rate. Specifically, this step involves taking the causal inference results and trend prediction results contained in the analysis results, as well as the environmental parameters and aquaculture process parameters contained in the feature vectors, as input information. A dynamic modification request is generated through a preset prompt word template and then input into the preset large language model. This triggers the preset large language model to calculate the modification value of the empirical coefficients in the basic ammonia emission flux model based on its built-in expert knowledge base and the current input information.
[0181] Based on the adaptive ammonia emission flux, equipment control instructions corresponding to target equipment in the farm are generated. Target equipment refers to the execution equipment used for environmental control in the farm, including but not limited to fans, heating equipment, manure removal equipment, and feeding equipment. Specifically, based on the output of the adaptive ammonia emission flux model and combined with the preset environmental control strategy, the type of target equipment to be controlled and the expected control effect are determined. Then, the type of target equipment to be controlled and the expected control effect are used as input parameters to call the preset instruction generation module to convert the control requirements into equipment control instructions that conform to the target equipment communication protocol.
[0182] The operating status of the target equipment is controlled according to the equipment control instructions. Specifically, the equipment control instructions are sent to the corresponding equipment controller through the application programming interface (API); the equipment controller receives and parses the equipment control instructions, converting them into electrical signals that drive the actuators (such as motors and valves) in the target equipment; based on the electrical signals, the actuators change their operating parameters (such as speed and opening degree), thereby realizing the control of the operating status of the target equipment.
[0183] The effects achievable in this embodiment can be found in the relevant embodiments of the above-mentioned ammonia management method for livestock farms, and will not be repeated here.
[0184] Figure 7 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 7 As shown, the electronic device may include: a processor 1301, a communication interface 1302, a memory 1303, and a communication bus 1304. The processor 1301, communication interface 1302, and memory 1303 communicate with each other via the communication bus 1304. The processor 1301 can call a computer program stored in the memory 1303 to execute steps of a method for managing ammonia in a livestock farm, such as:
[0185] Acquire the first multi-source heterogeneous data related to ammonia monitoring in the farm, and perform vector construction and preprocessing on the first multi-source heterogeneous data to obtain feature vectors and second multi-source heterogeneous data.
[0186] A spatiotemporal distribution field of ammonia was constructed based on the second multi-source heterogeneous data, and a spatiotemporal three-dimensional dynamic spectrum was constructed based on the spatiotemporal distribution field of ammonia.
[0187] Based on feature vectors, the spatiotemporal distribution field of ammonia, and the spatiotemporal three-dimensional dynamic spectrum, a preset large language model is called to perform analysis to obtain analysis results. The analysis results are used to generate ammonia monitoring reports for the farm and / or control target equipment in the farm.
[0188] Furthermore, when the logical instructions in the aforementioned memory can be implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0189] On the other hand, this application also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can perform the steps of the ammonia management method for livestock farms provided in the above embodiments, such as including:
[0190] Acquire the first multi-source heterogeneous data related to ammonia monitoring in the farm, and perform vector construction and preprocessing on the first multi-source heterogeneous data to obtain feature vectors and second multi-source heterogeneous data.
[0191] A spatiotemporal distribution field of ammonia was constructed based on the second multi-source heterogeneous data, and a spatiotemporal three-dimensional dynamic spectrum was constructed based on the spatiotemporal distribution field of ammonia.
[0192] Based on feature vectors, the spatiotemporal distribution field of ammonia, and the spatiotemporal three-dimensional dynamic spectrum, a preset large language model is called to perform analysis to obtain analysis results. The analysis results are used to generate ammonia monitoring reports for the farm and / or control target equipment in the farm.
[0193] On the other hand, embodiments of this application also provide a non-transitory computer-readable storage medium storing a computer program. The computer program is used to cause a processor to execute the steps of the methods provided in the above embodiments, including, for example:
[0194] Acquire the first multi-source heterogeneous data related to ammonia monitoring in the farm, and perform vector construction and preprocessing on the first multi-source heterogeneous data to obtain feature vectors and second multi-source heterogeneous data.
[0195] A spatiotemporal distribution field of ammonia was constructed based on the second multi-source heterogeneous data, and a spatiotemporal three-dimensional dynamic spectrum was constructed based on the spatiotemporal distribution field of ammonia.
[0196] Based on feature vectors, the spatiotemporal distribution field of ammonia, and the spatiotemporal three-dimensional dynamic spectrum, a preset large language model is called to perform analysis to obtain analysis results. The analysis results are used to generate ammonia monitoring reports for the farm and / or control target equipment in the farm.
[0197] Non-transitory computer-readable storage media can be any available medium or data storage device that can be accessed by a processor, including but not limited to magnetic storage (e.g., floppy disks, hard disks, magnetic tapes, magneto-optical disks (MOs), etc.), optical storage (e.g., CDs, DVDs, BDs, HVDs, etc.), and semiconductor storage (e.g., ROMs, EPROMs, EEPROMs, non-volatile memory (NAND flash), solid-state drives (SSDs)).
[0198] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units 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. Those skilled in the art can understand and implement this without any creative effort.
[0199] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.
[0200] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method of ammonia management in a farm, characterized in that, The method comprises the following steps: acquiring first multi-source heterogeneous data related to ammonia gas monitoring in a farm, respectively constructing vectors and preprocessing the first multi-source heterogeneous data to obtain feature vectors and second multi-source heterogeneous data; constructing an ammonia gas spatiotemporal distribution field based on the second multi-source heterogeneous data, and constructing a spatiotemporal three-dimensional dynamic spectrum based on the ammonia gas spatiotemporal distribution field; based on the feature vectors, the ammonia gas spatiotemporal distribution field and the spatiotemporal three-dimensional dynamic spectrum, calling a preset large language model for analysis to obtain an analysis result, which is used to generate an ammonia gas monitoring report corresponding to the farm and / or control a target device in the farm; the step of constructing a spatiotemporal three-dimensional dynamic spectrum based on the ammonia gas spatiotemporal distribution field comprises: respectively performing fast Fourier transform on the time series of a plurality of local spatial points in the ammonia gas spatiotemporal distribution field to obtain frequency spectrum data corresponding to each local spatial point, wherein the frequency spectrum data is used to represent the frequency domain characteristics of the ammonia gas concentration change of the corresponding local spatial point with time; based on the frequency spectrum data and the spatial wave number component extracted from the ammonia gas spatiotemporal distribution field, constructing the spatiotemporal three-dimensional dynamic spectrum.
2. The method of claim 1, wherein, the step of respectively constructing vectors and preprocessing the first multi-source heterogeneous data to obtain feature vectors and second multi-source heterogeneous data comprises: extracting and encoding the first multi-source heterogeneous data to obtain feature vectors, wherein the feature vectors are used to represent environmental parameters and breeding process parameters corresponding to the farm, the environmental parameters include at least one of ammonia gas concentration, temperature, humidity and wind speed, and the breeding process parameters include at least one of animal density, feeding process parameters and manure removal method; based on a preset first spatiotemporal kriging algorithm, interpolating the missing data in the first multi-source heterogeneous data to obtain interpolated first multi-source heterogeneous data; standardizing the interpolated first multi-source heterogeneous data to obtain second multi-source heterogeneous data.
3. The method of claim 1, wherein, the step of constructing an ammonia gas spatiotemporal distribution field based on the second multi-source heterogeneous data comprises: based on a preset second spatiotemporal kriging algorithm, interpolating and reconstructing the ammonia gas concentration data collected by the sparse sensor in the second multi-source heterogeneous data to obtain the ammonia gas spatiotemporal distribution field; the formula of the second spatiotemporal kriging algorithm is: ; wherein, is a concentration value of ammonia gas at a target space-time point to be reconstructed in the ammonia gas space-time distribution field, is a concentration value of ammonia gas at a target space-time point to be reconstructed in the ammonia gas space-time distribution field, is a concentration value of ammonia gas at a target space-time point to be reconstructed in the ammonia gas space-time distribution field, is a spatial position of the target space-time point, is a time point of the target space-time point; is a concentration value of ammonia gas data collected by the sparse sensor at a space-time point is a concentration value of ammonia gas data collected by the sparse sensor at a space-time point is a concentration value of ammonia gas data collected by the sparse sensor at a space-time point is a spatial position of the i-th sparse sensor, is a spatial position of the i-th sparse sensor, is a time point at which the i-th sparse sensor collects data at the spatial position is a time point at which the i-th sparse sensor collects data at the spatial position is a time point at which the i-th sparse sensor collects data at the spatial position is a weight coefficient; is a number of the sparse sensors; the weight coefficients By solving the following system of equations: ; ; wherein, is the spatial position of the th sparse sensor, is the spatial position of the th sparse sensor, is the time point at which the th sparse sensor at spatial position collected data; is the variogram describing the spatio-temporal autocorrelation; is the spatial position difference, corresponding to or ; is the time difference, corresponding to or ; is the Lagrange multiplier. 4. The method of claim 1, wherein, the step of calling a preset large language model based on the feature vectors, the ammonia gas spatiotemporal distribution field and the spatiotemporal three-dimensional dynamic spectrum to obtain an analysis result comprises: constructing natural language prompt words containing causal reasoning requests and trend prediction requests according to the feature vectors, the ammonia gas spatiotemporal distribution field and the spatiotemporal three-dimensional dynamic spectrum, wherein the causal reasoning requests are used to inquire the root cause of the ammonia gas concentration change, and the trend prediction requests are used to predict the ammonia gas concentration change at a future time point; calling a preset large language model based on the natural language prompt words to perform causal reasoning and trend prediction to obtain an analysis result.
5. The method of claim 4, wherein, the step of calling a preset large language model based on the natural language prompt words to perform causal reasoning and trend prediction to obtain an analysis result comprises: inputting the natural language prompt word into a preset large language model to trigger the large language model to perform causal reasoning and trend prediction; receiving a causal reasoning result and a trend prediction result output by the large language model, the causal reasoning result including at least one root cause and a weight corresponding to each root cause, and the trend prediction result including an ammonia concentration prediction value at a future time point; integrating to generate an analysis result based on the causal reasoning result and the trend prediction result; wherein the attention mechanism of the large language model when performing causal reasoning is defined as: ; in, It is a function used to calculate the importance weights of different parts of the input information; For query vector, For key vectors, It is a value vector; Represents the query vector With the key vector Transformation The dot product is used to calculate the similarity score between the query vector and the key vector; This is a factor used to scale the similarity score. For the query vector and the key vector The vector dimension; It is used to convert the scaled similarity scores into a sum. The normalization function of the importance weight distribution; the importance weight distribution and the value vector Multiplication is used to perform a weighted summation of the value vector.
6. The method of claim 1, wherein, the time series of a plurality of local spatial points in the ammonia spatio-temporal distribution field are respectively subjected to fast Fourier transform to obtain frequency spectrum data corresponding to each local spatial point, which is realized based on the following formula: ; wherein, is the frequency spectrum data, representing the local spatial point of the local time series of ammonia concentration, is the frequency; is the ammonia concentration value of the local time series, derived from the time series data of the ammonia spatio-temporal distribution field at the local spatial point is the x-axis position of the preset three-dimensional grid coordinates within the farm, is the y-axis position of the preset three-dimensional grid coordinates within the farm, is the z-axis position of the preset three-dimensional grid coordinates within the farm; the value range of the axis is determined based on the type of the farmed animals within the farm; is a window function, used for windowing processing of the local time series to reduce spectrum leakage; is a fast Fourier transform, used for converting the local time series from time domain to frequency domain. 7. The method of claim 1, wherein, the method further includes: based on the analysis result and the feature vector, calling the large language model to dynamically correct a basic ammonia emission flux model of the farm to obtain an adaptive ammonia emission flux model; generating a device control instruction corresponding to a target device in the farm according to the adaptive ammonia emission flux; controlling the operation state of the target device according to the device control instruction.
8. The method of claim 7, wherein, the calculation formula of the adaptive ammonia emission flux model is: ; wherein, is the adaptive ammonia emission flux of the farm at time ; is an empirical coefficient of the basic ammonia emission flux model; , are respectively the upwind ammonia concentration and the downwind ammonia concentration of the farm; is the wind speed; is a dimensionless dynamic comprehensive influence coefficient, the dynamic comprehensive influence coefficient is used to comprehensively characterize the nonlinear correction effect of at least one of the following information on the basic ammonia emission flux model: information on the nonlinear enhancement or inhibition effect of environmental temperature and humidity on the basic ammonia release rate; information on the correction effect of the current ventilation mode on the linear wind speed transport efficiency; information on the dynamic influence of the current state of the farm manure on ammonia volatilization; information on the contribution of instantaneous disturbance caused by animal activity to local ammonia concentration.
9. An electronic device comprising a processor and a memory having a computer program stored therein, characterized in that, the processor executes the computer program to realize the steps of the ammonia management method of the farm in any one of claims 1 to 8.
Citation Information
Patent Citations
Intelligent-based early warning system capable of automatically identifying abnormal carbon emission data
CN120744560A
Multi-mode laser radar networked atmospheric parameter collaborative monitoring system and monitoring method
CN120908825A