A pest prediction method and system based on a language large model

By using a large language model-based pest prediction method, the state of the time series model is dynamically corrected, which solves the problem that existing technologies cannot integrate unstructured text events. This enables real-time response to external interventions, improves the accuracy and stability of predictions, and is applicable to agricultural pest management.

CN121168445BActive Publication Date: 2026-03-03MIANJI (ZHEJIANG) SENSING TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-21
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

Existing time-series forecasting models cannot effectively integrate external, asynchronous intervention events that exist in the form of unstructured text, such as regional pesticide spraying or sudden extreme weather reports, when processing continuous, structured historical data, leading to deviations between forecast results and real-world conditions.

Method used

By using a large language model-based pest prediction method, historical feature data is acquired and iteratively calculated using a pre-set time-series prediction model. Combined with a pre-trained language model, unstructured event text is parsed, and a causal parameter database is accessed to determine the initial impact factor, effect decay coefficient, and causal significance score. An event state vector is generated through an encoding network, and an injection gating vector is calculated using a gating network. A weighted update operation is performed to dynamically correct the hidden state to reflect the impact of the intervention event.

Benefits of technology

It achieves dynamic fusion of causal effects of unstructured text events, enabling the model to respond instantly to external interventions, improving the accuracy and stability of predictions. It can simulate real-world processes such as pesticide efficacy reduction and pest density rebound, enhancing the timeliness and accuracy of predictions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121168445B_ABST
    Figure CN121168445B_ABST
Patent Text Reader

Abstract

This invention relates to the fields of time-series data prediction and natural language processing technology, specifically a pest prediction method and system based on a large language model. The method includes: in response to the asynchronous acquisition of raw event text, an event injection process is triggered, comprising: parsing the raw event text using a pre-trained language model and accessing a pre-set causal parameter database to determine the initial impact factor, effect decay coefficient, maximum effective duration, and causal significance score; performing feature fusion through a pre-set encoding network to generate an event state vector; calculating the injection gating vector through a pre-set gating network; solving for the corrected hidden state through a weighted update operation; and outputting a future pest prediction sequence reflecting the impact of the intervention event. This invention significantly improves the physical realism of the model and the accuracy of long-term predictions, and can fully simulate real-world processes such as pesticide efficacy reduction and pest density rebound.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of time series data prediction and natural language processing technology, specifically to a pest prediction method and system based on a large language model. Background Technology

[0002] Existing time series forecasting models lack an effective mechanism to integrate external, asynchronous intervention events that exist in the form of unstructured text when processing continuous, structured historical data. These intervention events include regional pesticide spraying, sudden extreme weather reports, and observation records of pest migrations not seen locally. This deficiency causes the model to fail to reflect the causal effects of the intervention events in a timely manner, resulting in a deviation between the forecast results and the real-world state after the intervention.

[0003] The core problems of traditional models are: the challenge of heterogeneous data fusion: it is difficult to effectively integrate unstructured text data, such as event reports, with structured historical time-series data, such as temperature, humidity, and pest density; the problem of asynchronicity: the occurrence of intervention events is not constrained by the time steps of the time-series model, and sudden events cannot be captured by the model state in real time; and the lack of quantification of causal effects: there is a lack of conversion of the a priori causal effects contained in text events, such as efficacy intensity and decay rate, into mathematical quantitative indicators that the model can process. Therefore, how to dynamically correct the internal state of the time-series model so that it can reflect the causal impact of external asynchronous intervention events in real time, thereby outputting more accurate prediction sequences, has become a technical problem that urgently needs to be solved in this field. Summary of the Invention

[0004] To address the aforementioned technical problems, this invention provides a pest prediction method and system based on a large language model. Specifically, the technical solution of this invention is as follows:

[0005] A pest prediction method based on a large language model includes:

[0006] Historical feature data is acquired, and the hidden state of the previous moment and the current original hidden state are obtained through iterative calculation using a preset time series prediction model.

[0007] In response to the asynchronous acquisition of raw event text, the event injection process is triggered, including:

[0008] S1, based on the original event text, is parsed using a pre-trained language model and accesses a pre-defined causal parameter database to determine the initial impact factor, effect decay coefficient, maximum effective duration, and causal significance score.

[0009] S2 combines the initial impact factor, effect decay coefficient, maximum effective duration, and causal significance score, and performs feature fusion through a pre-set encoding network to generate an event state vector;

[0010] S3, combining the hidden state and event state vector of the previous moment, calculates the injection gating vector through a preset gating network;

[0011] S4, based on the injection gate vector, the current original hidden state, and the event state vector, calculates the corrected hidden state through a weighted update operation;

[0012] S5, based on the corrected hidden state, continues to iterate using the time series prediction model, and outputs a future pest prediction sequence that reflects the impact of the intervention event.

[0013] Optionally, the injection gate vector is determined by calculation using a preset gate network, including:

[0014] The hidden state from the previous moment is concatenated with the event state vector to form a concatenated vector.

[0015] The concatenated vector is linearly transformed by the weights and biases of the gating network and then processed by the Sigmoid activation function to output the injected gating vector.

[0016] Optionally, the corrected hidden state can be calculated through a weighted update operation, including:

[0017] By injecting gating vectors, the forgetting weight of the current original hidden state and the injection weight of the event state vector are determined respectively.

[0018] Before injection, the event state vector is dimension-matched using a state mapping matrix.

[0019] The corrected hidden state is obtained by summing the weighted original hidden state and the weighted event state vector through element-wise multiplication.

[0020] Optionally, the event injection process may also include:

[0021] Simulate event effectiveness decay within the maximum effective duration of the event state vector;

[0022] include:

[0023] Based on the effect decay coefficient and the duration after the event, the decayed event vector is calculated using the exponential decay model.

[0024] At each subsequent time step, the decayed event vector is used to replace the event state vector, and the injected gating vector and the corrected hidden state are recalculated.

[0025] Optionally, the decayed event vector is calculated, including:

[0026] Within the interval from the moment the event occurs to the maximum effective duration, the event state vector is multiplied by an exponential decay term to obtain the decayed event vector.

[0027] The exponential decay term is calculated based on the effect decay coefficient and the time difference between the current time and the time when the event occurred.

[0028] At the moment when the maximum effective duration is exceeded, the decayed event vector is set to zero.

[0029] Optionally, the event injection process may also include:

[0030] Based on the causal significance score, a causal ranking judgment is performed to filter out non-causal disturbances;

[0031] include:

[0032] Compare the causal significance score with the preset causal trigger threshold;

[0033] When the causal significance score is greater than the causal triggering threshold, a causal gating scalar with a value of 1 is generated, and it is determined to be a strong causal event.

[0034] When the causal significance score is not greater than the causal trigger threshold, a causal gating scalar with a value of 0 is generated and determined to be a non-causal disturbance.

[0035] Optionally, the corrected hidden state is calculated, specifically including:

[0036] Multiply the causal gating scalar with the recalculated injection gating vector to obtain the final injection gating;

[0037] Based on the final injection gate, the original hidden state, and the decayed event vector, the final corrected state is calculated through a weighted update operation.

[0038] When the causal gating scalar is 0, the final injection gating is 0, and the final corrected state is equal to the original hidden state, thus achieving perturbation filtering.

[0039] A pest prediction system based on a large language model includes:

[0040] The temporal state module is used to acquire historical feature data and iteratively calculate the hidden state of the previous moment and the current original hidden state through a preset temporal prediction model.

[0041] The event parsing and encoding module is used to respond to the asynchronously acquired raw event text and trigger the event injection process. The event parsing and encoding module includes:

[0042] The event parsing unit is used to parse the original event text using a pre-trained language model and access a pre-set causal parameter database to determine the initial impact factor, effect decay coefficient, maximum effective duration, and causal significance score.

[0043] The feature encoding unit is used to combine the initial impact factor, effect decay coefficient, maximum effective duration and causal significance score, and perform feature fusion through a pre-set encoding network to generate an event state vector;

[0044] The state injection prediction module includes:

[0045] The gating calculation unit is used to combine the hidden state and event state vector of the previous moment, and calculate through a preset gating network to determine the injection gating vector;

[0046] The state correction unit is used to calculate the corrected hidden state based on the injection gate vector, the current original hidden state, and the event state vector through a weighted update operation.

[0047] The re-prediction unit is used to continue iterative calculations using a time-series prediction model based on the corrected hidden state, and outputs a future pest prediction sequence that reflects the impact of the intervention event.

[0048] Compared with the prior art, the present invention has the following beneficial effects:

[0049] 1. This invention successfully solves the challenge of heterogeneous data fusion by introducing language model parsing and causal parameter database; it can transform external asynchronous, unstructured text-based intervention events, such as pesticide spraying, into structured and quantifiable causal parameters such as initial influencing factors and effect decay coefficients, thus achieving effective integration of unstructured event information with the internal state of the time series prediction model.

[0050] 2. The core of this invention lies in the event injection process, which calculates the injection gate vector through a gating network and performs a weighted update operation to solve the corrected hidden state. This process enables the model to dynamically and instantly correct its internal state, thereby capturing the causal effects of asynchronous sudden events and solving the problem that traditional models cannot respond to external interventions in time, leading to deviations between predictions and reality.

[0051] 3. This invention, by simulating the decay of event effectiveness within the maximum effective duration, for example using an exponential decay model, and dynamically updating the injection process with the decayed event vector, upgrades the model's simulation of external events from instantaneous impact to sustained influence. This greatly enhances the model's physical realism and long-term prediction accuracy, enabling a complete simulation of real-world processes such as diminishing efficacy and pest density rebound.

[0052] 4. This invention achieves causal level discrimination and gating based on causal significance scores, such as generating a causal gating scalar, to filter out non-causal perturbations. This mechanism ensures that only strong causal events, such as pesticide spraying, can trigger state correction, avoiding unnecessary perturbations to the model's hidden states caused by low-causal correlation data noise, such as routine inspections, significantly improving prediction stability and focus on key events. Attached Figure Description

[0053] The present invention will be further explained below with reference to the accompanying drawings and embodiments:

[0054] Figure 1 This is a flowchart of the method of the present invention;

[0055] Figure 2 This is a structural diagram of the system of the present invention. Detailed Implementation

[0056] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments.

[0057] Example 1:

[0058] Please see Figure 1 A pest prediction method based on a large language model includes:

[0059] Historical feature data is acquired, and the hidden state of the previous moment and the current original hidden state are obtained through iterative calculation using a preset time series prediction model.

[0060] In response to the asynchronous acquisition of raw event text, the event injection process is triggered, including:

[0061] S1, based on the original event text, is parsed using a pre-trained language model and accesses a pre-defined causal parameter database to determine the initial impact factor, effect decay coefficient, maximum effective duration, and causal significance score.

[0062] S2 combines the initial impact factor, effect decay coefficient, maximum effective duration, and causal significance score, and performs feature fusion through a pre-set encoding network to generate an event state vector;

[0063] S3, combining the hidden state and event state vector of the previous moment, calculates the injection gating vector through a preset gating network;

[0064] S4, based on the injection gate vector, the current original hidden state, and the event state vector, calculates the corrected hidden state through a weighted update operation;

[0065] S5, based on the corrected hidden state, continues to iterate using the time series prediction model, and outputs a future pest prediction sequence that reflects the impact of the intervention event.

[0066] This embodiment provides a pest prediction method based on a large language model. The core objective of this invention is to address the problem that existing time-series prediction models cannot effectively integrate external, asynchronous intervention events that exist in the form of unstructured text, such as regional spraying of type A pesticides, when processing continuous, structured historical data. This causes the model's prediction results to deviate from the real-world state after the intervention. This invention uses an event injection process to dynamically correct the internal state of the time-series model, enabling it to reflect the causal effects of the intervention event in real time, thereby outputting a more accurate prediction sequence.

[0067] The method specifically includes:

[0068] Historical feature data is acquired, and the hidden state of the previous moment and the current original hidden state are obtained through iterative calculation using a preset time series prediction model.

[0069] The preset time series prediction model aims to learn the time series dependencies of historical data and generate baseline predictions. In this embodiment, the model can be a recurrent neural network (RNN), preferably a long short-term memory network (LSTM) or a gated recurrent unit (GRU). These models have well-known technical advantages in processing time series data.

[0070] This model is based on historical feature data. Perform iterative calculations; it is important to emphasize that historical feature data... It already includes routine, continuously collected environmental information, such as daily average temperature, cumulative rainfall, sunshine duration, air pressure, and phenological data based on latitude and longitude information. The problem that this invention aims to solve is not how to process these known structured time-series data, but rather how to additionally integrate those asynchronous, unstructured, and sudden intervention events that exist in the form of unstructured text.

[0071] The hidden state in the previous time step refers to the time series model in... The internal state vector at time t is represented in this embodiment as: It encapsulates model pairs The memory of all historical information prior to this moment;

[0072] The current original hidden state refers to the model's current hidden state. At any time, only according to Regular input at any time and the state at the previous moment The calculated baseline state, unaffected by any external events, is represented in this embodiment as: This state Through the model's own recursive units Calculated;

[0073] In response to the asynchronous acquisition of raw event text, the event injection process is triggered;

[0074] Asynchronous acquisition refers to the timing of event occurrence. Not affected by the time step of the time series model The constraints allow it to be captured by the system at any point in time; the original event text is unstructured or semi-structured text data, such as "On October 28, 2025, type B natural enemies were released in plot A"; the original event text not only includes the above-mentioned human intervention events, but also other unstructured text reports that have a significant causal impact on pest outbreaks, such as environmental mutation events, such as "The meteorological bureau issued a red rainstorm warning, which is expected to affect plot A in 3 hours" or "Frost occurred in plot A this morning, and the temperature dropped sharply by 10 degrees"; or biological invasion events, such as "Migratory pest X was observed for the first time in plot B" or "A large-scale pest outbreak occurred around plot C, posing a risk of migration"; the event injection process of this invention aims to uniformly quantify and inject these different sources of text information containing causal effects into the state of the time series model;

[0075] Based on the original event text, it is parsed using a pre-trained language model and accesses a pre-set causal parameter database to determine the initial impact factor, effect decay coefficient, maximum effective duration, and causal significance score.

[0076] Pre-trained language models, such as well-known models like BERT and GPT, are used to parse unstructured raw event text into structured event elements, such as: {time:...,location:A,event:deploying predators,type:B};

[0077] The pre-defined causal parameter database serves to label the inherent causal effect parameters of each structured event based on prior knowledge of biology, agronomy, or physics. This database not only stores parameters related to human intervention events, such as the initial influencing factors of different pesticide types, but also... sum effect attenuation coefficient It also identifies parameters of environmental and biological events; for example, rainstorm events may have a high instantaneous impact factor. (e.g., physical flushing to remove insect eggs) but maximum effective duration Shorter; while pest migration events may have a time-varying impact factor or a longer one. The database and encoding network of the present invention It can provide a unified model for these complex causal patterns;

[0078] This step involves accessing the database to determine four key parameters for the current event: the initial impact factor. Its definition of an event is the instant it occurs. Instantaneous effect intensity on the pest system; effect attenuation coefficient It is defined as the rate at which the intensity of this effect decreases over time, and its dimensions are... Maximum effective duration It defines how long after which the causal effect of an event can be considered to have completely disappeared, and its dimension is... Causal significance score One in Scalars within an interval are used to technically distinguish intervention events with strong causal relationships, such as pesticide spraying. Non-causal disturbances such as routine inspections ;

[0079] By combining the initial impact factor, effect decay coefficient, maximum effective duration, and causal significance score, feature fusion is performed through a pre-set encoding network to generate an event state vector.

[0080] To further clarify, the method for constructing the preset causal parameter database preferably includes:

[0081] For causal significance score and initial impact factor The method employs a structured expert scoring approach; for example, at least three experts in agronomy or pest control are organized to independently score each event type predefined in the database, such as spraying type A pesticides or releasing type B natural enemies, based on their known biological effects. and exist Scoring is performed within the interval, and the average value is used as the calibration parameter for the event;

[0082] Regarding the effect attenuation coefficient and maximum effective duration : A historical data statistical fitting method is used; for example, for events involving the spraying of type A pesticides, selection is made from historical data. Find one instance of the event and extract the events following each instance. time, Preferred is greater than expected The pest density sequence within the region was analyzed; these sequences were then fitted to an exponential decay model using a nonlinear least squares method. ,in for Time density, For baseline density, The initial impact strength of the event; multiple values ​​obtained through statistical fitting. The average value determines the attenuation coefficient of the event's effect; through analysis decay to of The time required for the confidence interval is used to determine the maximum valid duration. ;

[0083] Preset encoding network The purpose is to transform the four heterogeneous parameters with different physical meanings and dimensions obtained in the previous step. Mapped to a unified, high-dimensional semantic state space; in this embodiment, the network is a multilayer perceptron (MLP), and its network weights... Obtained through pre-training;

[0084] Event State Vector , is the output of the encoding network, and its calculation method is as follows: ; It is a complete mathematical representation of the asynchronous event, which will be injected into the timing model as the core information carrier;

[0085] The network weights Obtained through pre-training, the specific pre-training methods preferably include:

[0086] Construct a pre-trained dataset: Based on historical data, construct a dataset for an agent task;

[0087] Define the pre-training objective: in the encoding network output terminal Then, attach one or more regression heads, for example, a simple fully connected layer;

[0088] Perform pre-training: Using the dataset from step 1, minimize the predicted values ​​of the regression head, such as the predicted values. With real labels The error between them, for example, mean square error With the goal of encoding networks weight The regression head and its weights are used for training. After pre-training, the regression head is discarded, and the remaining weights are retained. and their weights Used for subsequent event injection processes;

[0089] By combining the hidden state and event state vector from the previous moment, the injection gating vector is determined through a pre-defined gating network.

[0090] The pre-defined gated network aims to solve the problems of model gradient collapse or state pollution that may be caused by asynchronous data injection; it dynamically determines how much event information should be injected by introducing a gating mechanism.

[0091] Injection gate vector This is the output of the gating network; the calculation process incorporates the hidden state from the previous time step. With event state vector This allows the injection decision to take into account the current context state of the model. and the nature of the event itself This ensures the intelligence and stability of the injected technology.

[0092] Based on the injection gate vector, the current original hidden state, and the event state vector, the corrected hidden state is calculated through a weighted update operation;

[0093] The purpose of weighted update operations is to integrate event information into the backbone state of the model;

[0094] Hidden state after correction This is the output of this step; this operation utilizes the injection gating vector. As a weight, for the current original hidden state and event state vector By performing a weighted summation, a result is obtained that incorporates the causal effects of the events. ;

[0095] Based on the corrected hidden state, the time series prediction model is used to continue iterative calculations and output a future pest prediction sequence that reflects the impact of the intervention event.

[0096] Re-prediction: Time Series Forecasting Model From the occurrence of the event From this moment on, the original will no longer be used. Instead, it uses the corrected hidden state. As its new starting state, it continues with subsequent time steps. Iterative calculation;

[0097] Future pest prediction sequences reflecting the impact of intervention events , is the final output of this method; since the initial state of the model has been corrected, the entire prediction sequence generated subsequently will naturally reflect the impact of the intervention event, such as pesticide spraying, such as a decrease in pest density.

[0098] The method described in this embodiment, by constructing a complete event injection process including language model parsing, causal parameterization, encoding network fusion, and gated injection, successfully integrates the causal effects inherent in unstructured, asynchronous external intervention events into the hidden state of the time series prediction model. This solves the major technical defect of traditional time series models being unable to respond to sudden events, leading to predictions deviating from reality. This method enables pest prediction systems to reflect real-world human interventions in real time, greatly improving the accuracy and timeliness of prediction sequences after intervention events occur, providing strong decision support for precision agriculture and disaster management. In this way, the differences between this invention and existing technologies are further highlighted: existing technologies either only treat environmental factors as another source of structured time series data for synchronous input, or completely ignore asynchronous text events; while this invention, through a unified event injection process, incorporates all unstructured text events from various sources such as human intervention, environmental mutations, and biological invasions, realizing the integration of these events into the model's hidden state. Dynamic and real-time correction; this solves the technical problem that existing technologies can only handle structured data when dealing with multiple factors, and cannot respond to sudden, asynchronous causal events in text form.

[0099] Example 2:

[0100] The injection gate vector is determined through calculation using a pre-defined gated network, including:

[0101] The hidden state from the previous moment is concatenated with the event state vector to form a concatenated vector.

[0102] The concatenated vector is linearly transformed by the weights and biases of the gating network and then processed by the Sigmoid activation function to output the injected gating vector.

[0103] The hidden state from the previous moment is concatenated with the event state vector to form a concatenated vector.

[0104] Vector concatenation, in this embodiment, is represented as It is a feature fusion operation; it hides the state from the previous time step. and event state vector The vectors are concatenated along the dimension to form a longer concatenated vector. The purpose of this operation is to obtain the current context information of the model. and external event information These components, as complete inputs, are collectively provided to the gating network for decision-making.

[0105] The concatenated vector is linearly transformed through the weights and biases of a gating network, and then processed by the Sigmoid activation function to output the injected gating vector.

[0106] In this embodiment, the injection gate vector The calculation method is as follows ;

[0107] Here, That is, inject the gate vector; This refers to the Sigmoid activation function, a well-known technique in the field, whose key function is to compress the result of a linear transformation to a smaller value. Within the range, this makes Each element has the physical meaning of a gate, that is, it represents what percentage of information in the corresponding dimension should be injected; These are the weights and biases of the gating network, which are trainable parameters obtained by training the model on historical datasets. The goal is to teach the network how to intelligently generate the optimal injection ratio based on different contexts and events. ; This is the concatenated vector formed in the previous step; The source is the calculation output of the timing state module. The source is the output of the event parsing and encoding module;

[0108] This embodiment employs an improved design derived from the LSTM gating mechanism—a splicing-linear transformation-Sigmoid activation—to provide a stable and trainable control switch for event injection; the Sigmoid function... Output characteristics ensure The effectiveness of vectors as weights prevents numerical explosion or gradient instability problems that may result from the direct addition of asynchronous data, greatly enhancing the robustness of the model when fusing heterogeneous data.

[0109] Example 3:

[0110] The corrected hidden state is calculated through a weighted update operation, including:

[0111] By injecting gating vectors, the forgetting weight of the current original hidden state and the injection weight of the event state vector are determined respectively.

[0112] Before injection, the event state vector is dimension-matched using a state mapping matrix.

[0113] The corrected hidden state is obtained by summing the weighted original hidden state and the weighted event state vector through element-wise multiplication.

[0114] By injecting gating vectors, the forgetting weight of the current original hidden state and the injection weight of the event state vector are determined respectively.

[0115] Injection gate vector Its element value is The scope is used to control two aspects simultaneously: It is itself used as the injection weight of the event state vector; The forgetting weights are used as the current original hidden state; this is a complementary design, meaning the more event information injected, the better. The larger the value, the less original state information is retained. The smaller;

[0116] Before injection, the event state vector is dimension-matched using a state mapping matrix.

[0117] State mapping matrix Its purpose is to solve a potential engineering problem: event state vectors. Its dimensions are determined by the coding network. The output layer is determined by the current original hidden state. Its dimensions are determined by the time series model. The number of hidden layer units determines that they may have different dimensions;

[0118] Dimension matching: In order for the two to perform subsequent weighted operations, especially element-wise multiplication, it is necessary to... Transform to The same dimensional space; this embodiment uses a trainable state mapping matrix. right Performing a linear transformation ,make sure Dimensions and completely consistent;

[0119] The corrected hidden state is obtained by summing the weighted original hidden state and the weighted event state vector through element-wise multiplication.

[0120] In this embodiment, the corrected hidden state The calculation method is as follows ;

[0121] Here, That is, the hidden state after correction; That is, the current original hidden state, which is derived from the baseline calculation of the temporal state module; That is, the injected gating vector is derived from the computational output of the gating network; That is, the event state vector after dimension matching, where Originating from the event parsing and coding module; This refers to element-wise multiplication. This item represents the original state information that remains after being forgotten; This represents the injected event status information;

[0122] This embodiment uses this standard weighted update operation, supplemented by a state mapping matrix. Dimension matching provides a flexible, secure, and mathematically complete state fusion mechanism; it ensures that information from different sources, namely, internal and external event encoders of the time sequence model, can be fused within a unified dimensional space, according to... Intelligent gating control, smoothly integrated proportionally, ultimately generates... It both preserves historical memory and absorbs the impact of the event.

[0123] Example 4:

[0124] The event injection process also includes:

[0125] Simulate event effectiveness decay within the maximum effective duration of the event state vector;

[0126] include:

[0127] Based on the effect decay coefficient and the duration after the event, the decayed event vector is calculated using the exponential decay model.

[0128] At each subsequent time step, the decayed event vector is used to replace the event state vector, and the injected gating vector and the corrected hidden state are recalculated.

[0129] This embodiment aims to address the state decay problem, namely, the effectiveness of most intervention events, such as pesticides, diminishes over time;

[0130] Simulate event effectiveness decay within the maximum effective duration of the event state vector;

[0131] Maximum valid duration This parameter has already been obtained from the causal parameter database in the steps of Example 1; this example clarifies that the event effectiveness simulation only occurs when... The moment the event occurred This process will be conducted within this time window;

[0132] Based on the effect decay coefficient and the duration after the event, the decayed event vector is calculated using the exponential decay model.

[0133] Effect attenuation coefficient This parameter is also obtained in the steps of Example 1; this example preferably uses the exponential decay model because this model can fit well many biological and chemical processes such as the natural decay phenomenon in drug efficacy reduction.

[0134] Decayed event vector It is at any time , Decayed vector representation;

[0135] At each subsequent time step, the decayed event vector is used to replace the event state vector, and the injected gating vector and the corrected hidden state are recalculated.

[0136] Event injection is no longer A one-time action at a specific moment; rather, in arrive Each time step between The injection process will be re-executed.

[0137] To further clarify, in time : Calculate the decayed event vector at this moment ; and use Alternative Recalculate the injection gate vector, i.e. ;use and Recalculate the corrected hidden state, i.e. ;

[0138] This embodiment introduces a time-dependent decay mechanism for event effectiveness, upgrading the model's simulation of external events from instantaneous impacts to sustained effects. This significantly enhances the model's physical realism and long-term prediction accuracy. For example, the model can not only predict the immediate decline in pests after pesticide spraying, but also... and Under control, the complete process of the gradual disappearance of pesticide efficacy and the rebound of pest density was simulated; furthermore, when the decay process of an event has not yet ended, that is... If the system receives a new asynchronous event, the system processes two or more events in parallel; preferably, in each subsequent time step... The system calculates each event that is within its validity period. decayed event vector And through a preset fusion strategy, such as vector addition. Or weighted averages are combined into a final value. Then use the merged version Instead of the decay vector for a single event, recalculate the injection gating vector and correct the hidden state.

[0139] Example 5:

[0140] The decayed event vector is calculated, including:

[0141] Within the interval from the moment the event occurs to the maximum effective duration, the event state vector is multiplied by an exponential decay term to obtain the decayed event vector.

[0142] The exponential decay term is calculated based on the effect decay coefficient and the time difference between the current time and the time when the event occurred.

[0143] At the moment when the maximum effective duration is exceeded, the decayed event vector is set to zero.

[0144] Within the interval from the moment the event occurs to the maximum effective duration, the event state vector is multiplied by an exponential decay term to obtain the decayed event vector; the exponential decay term is calculated based on the effect decay coefficient and the time difference between the current moment and the moment the event occurred.

[0145] In the time interval Internal, decayed event vector The calculation method is as follows ;

[0146] Here, The decayed event vector; The original event state vector is... The initial vector at time originates from the event parsing and encoding module; That is, the exponentially decaying term; The effect decay coefficient is derived from a causal parameter database; The time difference between the current moment and the moment the event occurred;

[0147] This formula ensures that... hour, , ,at this time That is, the initial injection is a complete event vector; with the time difference As it increases, the exponential term approaches 0. The modulus also decreases accordingly;

[0148] When the maximum effective duration is exceeded, the decayed event vector is set to zero.

[0149] In time At that time, the decayed event vector The calculation method is as follows ;

[0150] Here, It refers to a zero vector, that is, a vector in which all elements are 0;

[0151] This embodiment combines the exponential decay function and the maximum effective duration. The established hard cutoff provides a precise, controllable, and computationally efficient event decay model. This model ensures the integrity of the event's effectiveness at the initial moment, its smooth decay within the validity period, and its complete elimination outside the validity period, perfectly conforming to the real-world behavior of intervention events. When it becomes a zero vector, subsequent injection gating The value will also approach 0, the injection operation will stop automatically, and the model stability will be guaranteed.

[0152] Example 6:

[0153] The event injection process also includes:

[0154] Based on the causal significance score, a causal ranking judgment is performed to filter out non-causal disturbances;

[0155] include:

[0156] Compare the causal significance score with the preset causal trigger threshold;

[0157] When the causal significance score is greater than the causal triggering threshold, a causal gating scalar with a value of 1 is generated, and it is determined to be a strong causal event.

[0158] When the causal significance score is not greater than the causal trigger threshold, a causal gating scalar with a value of 0 is generated and determined to be a non-causal disturbance.

[0159] This embodiment aims to solve the problem of causal ambiguity or perturbation stability, that is, to filter out those events that are collected but actually have no or weak causal relationship with pest prediction;

[0160] Based on the causal significance score, a causal ranking judgment is performed to filter out non-causal disturbances;

[0161] Causal significance score This parameter has already been obtained from the causal parameter database in the steps of Example 1, and its value is in The purpose of interval; causal hierarchy determination is to utilize The value is used to classify events into strongly causal events or non-causal disturbances;

[0162] Compare the causal significance score with the preset causal trigger threshold;

[0163] Preset causal trigger threshold This is a global hyperparameter, which can be set by expert experience or obtained through model training and tuning. For example, it can be set to... It represents the minimum causal strength that the system considers sufficient to trigger a state correction.

[0164] When the causal significance score is greater than the causal triggering threshold, a causal gating scalar with a value of 1 is generated, and it is determined to be a strong causal event.

[0165] When the causal significance score is not greater than the causal trigger threshold, a causal gating scalar with a value of 0 is generated and determined to be a non-causal disturbance.

[0166] Causal Gated Scalar It is a binary scalar 0 or 1, and its calculation method is based on and The comparison; in this embodiment, this is achieved through a Heaviside step function. To achieve: ;

[0167] Here, For causal gating scalars; The causal score for an event is derived from a causal parameter database; To preset the causal threshold; when hour, The event is determined to be a strong causal event, and injection should be performed; when hour, The event was determined to be a non-causal disturbance and should be filtered out.

[0168] This embodiment introduces a causal gating scalar. This adds a main switch to the event injection process, enabling the model to intelligently identify the importance of events. It can proactively ignore events with low causal correlation, such as sensor logs and inspection records, to prevent these data noises from causing unnecessary disturbances to the model's hidden state, thereby significantly improving the stability of the model's predictions and its focus on key events.

[0169] Example 7:

[0170] The corrected hidden state is calculated, specifically including:

[0171] Multiply the causal gating scalar with the recalculated injection gating vector to obtain the final injection gating;

[0172] Based on the final injection gate, the original hidden state, and the decayed event vector, the final corrected state is calculated through a weighted update operation.

[0173] When the causal gating scalar is 0, the final injection gating is 0, and the final corrected state is equal to the original hidden state, thus achieving perturbation filtering.

[0174] This embodiment is the final fusion of the attenuation technique described in Embodiment 4 and the causal filtering technique described in Embodiment 6, and provides the final complete logic for calculating the hidden state after correction;

[0175] Multiply the causal gating scalar with the recalculated injection gating vector to obtain the final injection gating;

[0176] This step calculates the final injection gating. It combines causal gating scalars and based on Recalculated injection gate vector Its calculation method is as follows: ;

[0177] Here, For final injection gating; For causal gating scalars For follow A decaying and dynamically changing injection gating vector;

[0178] The logic of this operation is: As the main switch, it determines whether injection is allowed; As a regulating valve, it determines the specific amount to be injected, provided that injection is permitted.

[0179] Based on the final injection gate, the original hidden state, and the decayed event vector, the final corrected state is calculated through a weighted update operation.

[0180] This step calculates the final corrected state. This is the only, final state update formula in this invention. Each time step All will be executed: ;

[0181] Here, This is the final corrected state; This is the current original hidden state, which originates from the temporal state module; The final injection gate is derived from the calculation results of the previous step in this embodiment; The decayed event vector is derived from the calculation results of Example 5; This is the state mapping matrix;

[0182] When the causal gating scalar is 0, the final injection gating is 0, and the final corrected state is equal to the original hidden state, thus achieving perturbation filtering.

[0183] To clarify the perturbation filtering mechanism: when a non-causal perturbation, such as that collected during routine inspections, is analyzed, its causal significance score is... Based on this, in Example 6, the causal gating scalar It is calculated as 0; therefore, in this embodiment, the final injection gating That is, the zero vector; Substituting into the final update formula, we get ;

[0184] Final revised state Equal to the original hidden state The model state remained unchanged, the predicted sequence remained unchanged, and the perturbation filtering was successfully achieved.

[0185] The final update logic described in this embodiment is the culmination of the technical solution of this invention; it achieves this through... and Two core variables determine the causal significance of the event. Dynamic context adaptation and time decay The three key physical properties are perfectly integrated into a unified mathematical formula; this enables the method to exhibit extremely high intelligence, stability and accuracy when facing complex and ever-changing real-world event flows.

[0186] Example 8:

[0187] Please see Figure 2 A pest prediction system based on a large language model includes:

[0188] The temporal state module is used to acquire historical feature data and iteratively calculate the hidden state of the previous moment and the current original hidden state through a preset temporal prediction model.

[0189] The event parsing and encoding module is used to respond to the asynchronously acquired raw event text and trigger the event injection process. The event parsing and encoding module includes:

[0190] The event parsing unit is used to parse the original event text using a pre-trained language model and access a pre-set causal parameter database to determine the initial impact factor, effect decay coefficient, maximum effective duration, and causal significance score.

[0191] The feature encoding unit is used to combine the initial impact factor, effect decay coefficient, maximum effective duration and causal significance score, and perform feature fusion through a pre-set encoding network to generate an event state vector;

[0192] The state injection prediction module includes:

[0193] The gating calculation unit is used to combine the hidden state and event state vector of the previous moment, and calculate through a preset gating network to determine the injection gating vector;

[0194] The state correction unit is used to calculate the corrected hidden state based on the injection gate vector, the current original hidden state, and the event state vector through a weighted update operation.

[0195] The re-prediction unit is used to continue iterative calculations using a time-series prediction model based on the corrected hidden state, and outputs a future pest prediction sequence that reflects the impact of the intervention event.

[0196] This embodiment provides a pest prediction system based on a large language model. This system is used to execute the method described in any one of embodiments 1-7 above. The system can be deployed on a server, cloud computing platform, or edge computing device in terms of hardware, and logically includes:

[0197] The temporal state module aims to maintain the baseline temporal prediction. This module acquires historical feature data such as sensor data and meteorological data, and incorporates a pre-defined temporal prediction model, such as an LSTM network. It continuously iterates through calculations and provides the hidden state from the previous time step to other modules. and the current original hidden state ;

[0198] The event parsing and encoding module aims to transform unstructured text events into vectors that the model can understand. This module is used to respond to the asynchronous acquisition of raw event text and trigger the event injection process. Specifically, this module includes an event parsing unit and a feature encoding unit.

[0199] This event parsing unit aims to extract causal parameters from text. It parses the original event text using a pre-trained language model and accesses a pre-defined causal parameter database. Its output is the initial impact factor. Effect attenuation coefficient Maximum effective duration And causal significance score ;

[0200] The purpose of this feature encoding unit is to fuse parameters into a vector. This unit combines the above four parameters and performs feature fusion through a pre-defined encoding network such as an MLP to ultimately generate an event state vector. ;

[0201] The state injection prediction module is designed to perform state correction and re-prediction; the module includes a gating calculation unit, a state correction unit, and a re-prediction unit.

[0202] The purpose of this gated computation unit is to calculate the injected weights and switches; this unit is used to combine the hidden state from the previous time step. It comes from the timing state module and the event state vector. or its attenuation form The injection gate vector is determined by calculation using a pre-defined gating network. This unit also preferably incorporates causal significance scores. Calculate causal gating scalars And finally determine the final injection gating ;

[0203] The purpose of this state correction unit is to fuse events and states; this unit is used to adjust the final injection gating vector. Current original hidden state and event state vector or its decay form The corrected hidden state is calculated through a weighted update operation. ;

[0204] The purpose of this re-prediction unit is to output the final prediction result; this unit is used to determine the corrected hidden state from the state correction unit. Using a time-series prediction model, which can call the model in the time-series state module to continue iterative calculations, the output reflects the future pest prediction sequence that reflects the impact of the intervention event;

[0205] The system in this embodiment achieves complete engineering support for the aforementioned methods through clear modular division, namely, sequence processing, event parsing, and state injection. Each module performs its own function and has clear interfaces, ensuring smooth data flow between baseline prediction, event parsing, state fusion, and dynamic re-prediction. The system architecture features high cohesion and low coupling, making it easy to deploy, maintain, and expand, providing reliable system-level assurance for achieving high-precision and highly responsive intelligent pest prediction.

[0206] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A pest prediction method based on a large language model, characterized in that, include: Historical feature data is acquired, and the hidden state of the previous moment and the current original hidden state are obtained through iterative calculation using a preset time series prediction model. In response to the asynchronous acquisition of raw event text, the event injection process is triggered, including: S1, based on the original event text, is parsed using a pre-trained language model and accesses a pre-defined causal parameter database to determine the initial impact factor, effect decay coefficient, maximum effective duration, and causal significance score. S2 combines the initial impact factor, effect decay coefficient, maximum effective duration, and causal significance score, and performs feature fusion through a pre-set encoding network to generate an event state vector; S3, combining the hidden state and event state vector of the previous moment, calculates the injection gating vector through a preset gating network; S4, based on the injection gate vector, the current original hidden state, and the event state vector, calculates the corrected hidden state through a weighted update operation; S5. Based on the corrected hidden state, the time series prediction model is used to continue iterative calculation, and the output reflects the future pest prediction sequence that reflects the impact of the intervention event. The injection gate vector is determined through calculation using a pre-defined gated network, including: The hidden state from the previous moment is concatenated with the event state vector to form a concatenated vector. The concatenated vector is linearly transformed through the weights and biases of a gating network, and then processed by the Sigmoid activation function to output the injected gating vector. The corrected hidden state is calculated through a weighted update operation, including: By injecting gating vectors, the forgetting weight of the current original hidden state and the injection weight of the event state vector are determined respectively. Before injection, the event state vector is dimension-matched using a state mapping matrix. The corrected hidden state is obtained by summing the weighted original hidden state and the weighted event state vector through element-wise multiplication.

2. The pest prediction method based on a large language model according to claim 1, characterized in that, The event injection process also includes: Simulate event effectiveness decay within the maximum effective duration of the event state vector; include: Based on the effect decay coefficient and the duration after the event, the decayed event vector is calculated using an exponential decay model. At each subsequent time step, the decayed event vector is used to replace the event state vector, and the injected gating vector and the corrected hidden state are recalculated.

3. The pest prediction method based on a large language model according to claim 2, characterized in that, The decayed event vector is calculated, including: Within the interval from the moment the event occurs to the maximum effective duration, the event state vector is multiplied by an exponential decay term to obtain the decayed event vector. The exponential decay term is calculated based on the effect decay coefficient and the time difference between the current time and the time when the event occurred. At the moment when the maximum effective duration is exceeded, the decayed event vector is set to zero.

4. The pest prediction method based on a large language model according to claim 1, characterized in that, The event injection process also includes: Based on the causal significance score, a causal ranking judgment is performed to filter out non-causal disturbances; include: Compare the causal significance score with the preset causal trigger threshold; When the causal significance score is greater than the causal triggering threshold, a causal gating scalar with a value of 1 is generated, and it is determined to be a strong causal event. When the causal significance score is not greater than the causal trigger threshold, a causal gating scalar with a value of 0 is generated and determined to be a non-causal disturbance.

5. The pest prediction method based on a large language model according to claim 4, characterized in that, The corrected hidden state is calculated, specifically including: Multiply the causal gating scalar with the recalculated injection gating vector to obtain the final injection gating; Based on the final injection gate, the original hidden state, and the decayed event vector, the final corrected state is calculated through a weighted update operation. When the causal gating scalar is 0, the final injection gating is 0, and the final corrected state is equal to the original hidden state, thus achieving perturbation filtering.

6. A pest prediction system based on a large language model, applied to the pest prediction method based on a large language model as described in any one of claims 1-5, characterized in that, include: The temporal state module is used to acquire historical feature data and iteratively calculate the hidden state of the previous moment and the current original hidden state through a preset temporal prediction model. The event parsing and encoding module is used to respond to the asynchronously acquired raw event text and trigger the event injection process. The event parsing and encoding module includes: The event parsing unit is used to parse the original event text using a pre-trained language model and access a pre-set causal parameter database to determine the initial impact factor, effect decay coefficient, maximum effective duration, and causal significance score. The feature encoding unit is used to combine the initial impact factor, effect decay coefficient, maximum effective duration and causal significance score, and perform feature fusion through a pre-set encoding network to generate an event state vector; The state injection prediction module includes: The gating computation unit is used to combine the hidden state and event state vector of the previous moment, and calculate through a preset gating network to determine the injection gating vector. Specifically, it includes: concatenating the hidden state and event state vector of the previous moment to form a concatenated vector; performing a linear transformation on the concatenated vector through the weights and biases of the gating network, and applying the Sigmoid activation function to process it, and outputting the injection gating vector. The state correction unit is used to calculate the corrected hidden state based on the injection gate vector, the current original hidden state, and the event state vector through a weighted update operation. Specifically, it includes: determining the forgetting weight of the current original hidden state and the injection weight of the event state vector through the injection gate vector; wherein, before injection, the event state vector is dimension-matched through the state mapping matrix; and the corrected hidden state is obtained by summing the weighted current original hidden state and the weighted event state vector after element-wise multiplication. The re-prediction unit is used to continue iterative calculations using a time-series prediction model based on the corrected hidden state, and outputs a future pest prediction sequence that reflects the impact of the intervention event.

Citation Information

Patent Citations

  • Equipment asset depreciation prediction method based on machine learning

    CN120764798A

  • Crop insect pest intelligent identification and early warning system based on multi-mode large language model

    CN120931968A

  • Agricultural pest occurrence amount early warning and monitoring method based on artificial intelligence network model

    CN120954192A