An irrigation prediction method, apparatus, device, and medium
By iteratively denoising the irrigation prediction model by alternating historical irrigation action sequences and updated feature distribution information, the problem that human-operated irrigation equipment cannot accurately meet the water requirements of crops is solved, achieving precision irrigation and improving crop quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI ZHIWEI ROBOT CO LTD
- Filing Date
- 2025-03-19
- Publication Date
- 2026-04-21
AI Technical Summary
When irrigation equipment is manually operated to irrigate crops, the amount of irrigation water or the irrigation time may not accurately meet the growth needs of the crops, resulting in the inability to guarantee the quality of the crops.
By acquiring the initial noisy action sequence, the irrigation prediction model is used to determine the parity of the number of iteration steps. Different conditions are used alternately to denoise the initial noisy action sequence, including historical irrigation action sequences and updated feature distribution information, thereby improving the denoising accuracy.
It improves the accuracy of irrigation forecasting, ensures that the water requirements of crops at different soil depths are accurately met, and enhances the growth quality of crops.
Smart Images

Figure CN120202905B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to an irrigation prediction method, apparatus, equipment, and medium. Background Technology
[0002] With the rapid development of agriculture, the variety of crops has gradually increased. In order to ensure the normal growth of crops, growers need to irrigate all kinds of crops in a timely manner.
[0003] Currently, irrigation equipment is operated manually to irrigate various crops in a timely and quantitative manner.
[0004] However, when irrigation equipment is manually operated to irrigate crops, the amount of water or the timing of irrigation may not accurately meet the growth needs of the crops, and the quality of the crops cannot be guaranteed. Summary of the Invention
[0005] This invention provides an irrigation forecasting method, apparatus, equipment, and medium to improve the accuracy of irrigation forecasting.
[0006] In a first aspect, embodiments of the present invention provide an irrigation prediction method, the method comprising:
[0007] Obtain the initial noisy action sequence;
[0008] When the current iteration step size is less than or equal to the total number of model iteration steps, the current noise action sequence corresponding to the current iteration step size is determined based on the initial noise action sequence.
[0009] Determine the current supplementary data corresponding to the current iteration step size based on whether the current iteration step size is parity or even.
[0010] Input the current supplementary data and the current noise action sequence into the irrigation prediction model to determine the predicted noise action sequence corresponding to the current iteration step size;
[0011] When the current iteration step size is greater than the total number of model iteration steps, obtain the predicted action sequence corresponding to the current iteration step size and determine the predicted irrigation data;
[0012] In response to the current iteration step number being less than or equal to the total number of model iteration steps, the predicted action sequence corresponding to the current iteration step number is used as the current noise action sequence corresponding to the next iteration step number, and 1 is incremented on the current iteration step number.
[0013] Secondly, embodiments of the present invention also provide an irrigation prediction device, the device comprising:
[0014] The sequence acquisition module is used to acquire the initial noisy action sequence;
[0015] The current sequence acquisition module is used to determine the current noise action sequence corresponding to the current iteration step size when the acquired current iteration step size is less than or equal to the total number of model iteration steps, based on the initial noise action sequence.
[0016] The data acquisition module is used to determine the current supplementary data corresponding to the current iteration step size based on the parity of the current iteration step size.
[0017] The data input module is used to input the current supplementary data and the current noise action sequence into the irrigation prediction model to determine the predicted noise action sequence corresponding to the current iteration step number.
[0018] The prediction data acquisition module is used to acquire the prediction action sequence corresponding to the current iteration step number and determine the prediction irrigation data when the current iteration step number is greater than the total number of model iteration steps.
[0019] The step size accumulation module is used to respond to the current iteration step size being less than or equal to the total number of model iteration steps by taking the predicted action sequence corresponding to the current iteration step size as the current noise action sequence corresponding to the next iteration step size, and incrementing the current iteration step size by 1.
[0020] Thirdly, embodiments of the present invention also provide an irrigation prediction device, the irrigation prediction device comprising:
[0021] At least one processor; and
[0022] A memory that is communicatively connected to at least one processor; wherein,
[0023] The memory stores a computer program that can be executed by at least one processor, such that the at least one processor is able to perform the irrigation prediction method of any embodiment of the present invention.
[0024] According to another aspect of the present invention, a computer-readable storage medium is provided, which stores computer instructions for causing a processor to execute and implement the irrigation prediction method of any embodiment of the present invention.
[0025] The technical solution of this invention involves: acquiring an initial noise action sequence; when the acquired current iteration step number is less than or equal to the total number of model iteration steps, determining the current noise action sequence corresponding to the current iteration step number based on the initial noise action sequence; determining the current supplementary data corresponding to the current iteration step number based on the parity of the current iteration step number; inputting the current supplementary data and the current noise action sequence into the irrigation prediction model to determine the predicted noise action sequence corresponding to the current iteration step number; and when the current iteration step number is greater than the total number of model iteration steps, acquiring the current iteration step number pair. The system predicts the action sequence and determines the predicted irrigation data. When the current iteration step number is less than or equal to the total number of model iteration steps, the predicted action sequence corresponding to the current iteration step number is used as the current noise action sequence corresponding to the next iteration step number. The system also increments the current iteration step number by 1. By judging the parity of the current iteration step number, different data are used alternately as conditions to denoise the initial noise action sequence. This avoids the mutual influence of different conditions corresponding to different iteration step numbers on the denoising process of the initial noise action sequence, thus improving the accuracy of denoising the initial noise action sequence.
[0026] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0027] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0028] Figure 1 This is a flowchart of an irrigation prediction method provided according to an embodiment of the present invention;
[0029] Figure 2 This is a flowchart of an irrigation prediction method provided according to an embodiment of the present invention;
[0030] Figure 3 This is a flowchart of an irrigation prediction method provided according to an embodiment of the present invention;
[0031] Figure 4 This is a structural diagram of an irrigation prediction device provided according to an embodiment of the present invention;
[0032] Figure 5 This is a schematic diagram of the structure of an irrigation prediction device provided in an embodiment of the present invention. Detailed Implementation
[0033] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0034] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0035] The acquisition, storage, and application of initial noise action sequences and other related technologies in the technical solutions of this invention comply with relevant laws and regulations and do not violate public order and good morals.
[0036] Example 1
[0037] Figure 1 This is a flowchart illustrating an irrigation prediction method provided in Embodiment 1 of the present invention. This embodiment of the invention is applicable to irrigation prediction scenarios, and the method can be executed by an irrigation prediction device, which can be implemented in hardware and / or software.
[0038] See Figure 1 The irrigation prediction method shown includes:
[0039] S101, Obtain the initial noise action sequence.
[0040] The initial noise action sequence can be used to describe a set of data representing preset irrigation action instructions.
[0041] Specifically, crop roots are distributed at different soil depths. Shallow roots absorb readily available water, while deeper roots absorb water that gradually seeps into the deeper soil layers. Relying solely on surface irrigation makes it impossible to accurately determine whether the moisture levels in the deeper soil meet the crop's needs, which may restrict crop growth or reduce its resilience. Therefore, precise monitoring and irrigation adjustments at different soil depths are crucial to meet the water requirements of crops at each growth stage. The installation depth of irrigation nozzles in the soil can be preset. An irrigation device may include at least one nozzle, with a temperature sensor and a humidity sensor installed at each nozzle location. Each nozzle can perform water spraying operations.
[0042] This system can acquire irrigation data necessary for performing irrigation operations on crops. The irrigation data includes at least one parameter related to the irrigation operation. For example, this parameter might include sprinkler identification, current time, the burial depth of the sprinkler corresponding to the identification in the soil, the required soil moisture level, the required soil temperature, the start time of irrigation, and the duration of irrigation. Each parameter in the irrigation data can be obtained through industry expert experience. Based on at least one parameter in the irrigation data, parameter values corresponding to each parameter can be randomly generated. Based on these parameter values, an initial noise action sequence is determined. This initial noise sequence can be input into the model, and by using different feature datasets as conditional tokens for the model, the initial noise sequence is modulated to generate the desired action sequence. The model can be a DiffusionTransformer (DiT) model.
[0043] S102. When the current iteration step size is less than or equal to the total number of model iteration steps, the current noise action sequence corresponding to the current iteration step size is determined based on the initial noise action sequence.
[0044] The current iteration step size describes the number of iterations to be performed on the initial noise action sequence at the current time. The total number of model iteration steps describes the total number of iterations to be performed on the initial noise action sequence at the current time.
[0045] Specifically, when the current iteration step size is less than or equal to the total number of iteration steps in the model, it indicates that the iteration termination condition has not been met, and the denoising process needs to continue. Therefore, based on the initial noise action sequence, the noise action sequence after denoising the initial noise action sequence in the previous iteration is determined. Determining the noise action sequence after denoising in the previous iteration as the current noise action sequence corresponding to the current iteration step size facilitates subsequent denoising operations for the current noise sequence corresponding to the current iteration step size in this iteration.
[0046] S103. Determine the current supplementary data corresponding to the current iteration step size based on the parity of the current iteration step size.
[0047] The supplementary data can be used to describe the modulation data for which the initial noisy action sequence is to be denoised.
[0048] Specifically, the current supplementary data corresponding to the current iteration step size is determined based on whether the current iteration step size is odd or even. The current supplementary data when the current iteration step size is odd differs from the current supplementary data when the current iteration step size is even. The parity of the current iteration step size is judged in ascending order, and the current supplementary data corresponding to the current iteration step size is determined based on the judgment result. The next round of iteration operations only begins after the iteration operation corresponding to the current iteration step size has been completed.
[0049] S104. Input the current supplementary data and the current noise action sequence into the irrigation prediction model to determine the prediction noise action sequence corresponding to the current iteration step number.
[0050] Among them, the irrigation prediction model can be used to describe the model for predicting the noisy action sequence.
[0051] Specifically, the current supplementary data and the current noise action sequence are input into the irrigation prediction model. The current noise action sequence is modulated using the current supplementary data as the tuning condition to determine the predicted noise action sequence corresponding to the current iteration step number. The predicted noise action sequence corresponding to the current iteration step number can be used as the current noise action sequence to be processed in the next round.
[0052] S105. When the current iteration step size is greater than the total number of model iteration steps, obtain the predicted action sequence corresponding to the current iteration step size and determine the predicted irrigation data.
[0053] Among them, predicted irrigation data can be used to describe the operations that irrigation equipment needs to perform.
[0054] Specifically, when the current iteration step size is greater than the total number of iteration steps in the model, there is no need to continue denoising the initial noisy action sequence. The predicted action sequence corresponding to the current iteration step size can be obtained, which is the predicted action sequence obtained after the last iteration denoising operation. By identifying the predicted action sequence, the data characteristics of the predicted action sequence are determined, and the predicted irrigation data is determined based on the data characteristics of the predicted action sequence.
[0055] S106. In response to the current iteration step number being less than or equal to the total number of model iteration steps, the predicted action sequence corresponding to the current iteration step number is used as the current noise action sequence corresponding to the next iteration step number, and 1 is incremented on the current iteration step number.
[0056] Specifically, if the current iteration step size is less than or equal to the total number of iteration steps in the model, it indicates that the termination condition for ending the iteration has not been met, and the predicted action sequence corresponding to the current iteration step size still needs to be denoised. Therefore, the predicted action sequence corresponding to the current iteration step size is used as the current noisy action sequence corresponding to the next iteration step size. Since the iteration operation is completed sequentially, 1 is incremented on the current iteration step size. The parity of the current iteration step size is determined based on the incremented value to identify the supplementary data corresponding to the incremented current iteration step size. The supplementary data is used as the modulation condition data to denoise the predicted action sequence corresponding to the current iteration step size before the increment, until the current iteration step size is less than or equal to the total number of iteration steps in the model, thus meeting the termination condition for ending the iteration.
[0057] The technical solution of this invention involves: acquiring an initial noise action sequence; when the acquired current iteration step number is less than or equal to the total number of model iteration steps, determining the current noise action sequence corresponding to the current iteration step number based on the initial noise action sequence; determining the current supplementary data corresponding to the current iteration step number based on the parity of the current iteration step number; inputting the current supplementary data and the current noise action sequence into the irrigation prediction model to determine the predicted noise action sequence corresponding to the current iteration step number; and when the current iteration step number is greater than the total number of model iteration steps, acquiring the current iteration step number pair. The system predicts the action sequence and determines the predicted irrigation data. When the current iteration step number is less than or equal to the total number of model iteration steps, the predicted action sequence corresponding to the current iteration step number is used as the current noise action sequence corresponding to the next iteration step number. The system also increments the current iteration step number by 1. By judging the parity of the current iteration step number, different data are used alternately as conditions to denoise the initial noise action sequence. This avoids the mutual influence of different conditions corresponding to different iteration step numbers on the denoising process of the initial noise action sequence, thus improving the accuracy of denoising the initial noise action sequence.
[0058] Example 2
[0059] Figure 2 This is a flowchart illustrating an irrigation prediction method provided in Embodiment 2 of the present invention. Based on the above embodiments, this embodiment optimizes and improves the irrigation prediction operation.
[0060] Furthermore, the step of "determining the current supplementary data corresponding to the current iteration step size based on the parity of the current iteration step size" is refined into "obtaining the historical irrigation action sequence; obtaining the update spatial feature distribution information and update temporal feature distribution information; if the current iteration step size is odd, determining the update spatial feature distribution information and update temporal feature distribution information as the current supplementary data corresponding to the current iteration step size; if the current iteration step size is even, determining the historical irrigation action sequence as the current supplementary data corresponding to the current iteration step size", in order to improve the operation of irrigation prediction.
[0061] It should be noted that for parts not described in detail in the embodiments of the present invention, please refer to the descriptions in other embodiments.
[0062] See Figure 2 The irrigation prediction method shown includes:
[0063] S201. Obtain the initial noise action sequence.
[0064] S202. When the current iteration step size is less than or equal to the total number of iteration steps of the model, the current noise action sequence corresponding to the current iteration step size is determined according to the initial noise action sequence.
[0065] S203, Obtain the historical irrigation action sequence.
[0066] Among them, the historical irrigation action sequence can be used to describe the data corresponding to the irrigation operation of the irrigation device in the past time period.
[0067] Specifically, a preset historical time period is obtained, and irrigation data corresponding to the irrigation device within that period is collected. This data may include sprinkler identification, current time, the burial depth of the sprinkler corresponding to the identification in the soil, the required soil humidity, the required soil temperature, the start time of water spraying, and the duration of water spraying. The historical irrigation data is then converted to obtain a historical irrigation action sequence. Acquisition methods include, but are not limited to, reading records from the irrigation management system, collecting data through sensors, or acquiring equipment logs or monitoring records; this embodiment of the invention does not impose any limitations on these methods.
[0068] S204. Obtain the update spatial feature distribution information and the update time feature distribution information.
[0069] The updated spatial feature distribution information can be used to describe the spatial feature data set acquired at the current time. The updated temporal feature distribution information can be used to describe the temporal feature data set acquired at the current time.
[0070] Specifically, updating spatial feature distribution information (spatial global token) is a special token that globally represents the model input or features in the spatial dimension. Updating temporal feature distribution information (temporal global token) is a special token that globally represents the model input or features in the temporal dimension. Updating spatial feature distribution information can be obtained by updating spatial feature distribution information. Updating temporal feature distribution information can also be obtained by updating temporal feature distribution information. Cross-attention calculations can be performed on spatial or temporal feature distribution information. Through the learned cross-attention mechanism, key information in the spatial and temporal distributions can be selectively extracted and condensed, focusing on important regions and features to improve decision-making accuracy. Therefore, updating cross-attention calculations are performed on the initial spatial or temporal feature distribution information to obtain updated spatial and temporal feature distribution information.
[0071] S205. If the current iteration step size is odd, update the spatial feature distribution information and update the temporal feature distribution information as the current supplementary data corresponding to the current iteration step size.
[0072] Specifically, if the current iteration step size is odd, the updated spatial feature distribution information and the updated temporal feature distribution information are determined as the current supplementary data corresponding to the current iteration step size. Through different condition tokens, the model can incorporate various external information, thereby better capturing the complex relationships in the data, reasonably adjusting the generation strategy, controlling the progress of the generation process, and using the updated spatial feature distribution information and the updated temporal feature distribution information as conditions to input into the model. For example, the model can be a DiT model.
[0073] S206. If the current iteration step size is even, the historical irrigation action sequence is determined as the current supplementary data corresponding to the current iteration step size.
[0074] Specifically, if the current iteration step size is even, the historical irrigation action sequence is determined as the current supplementary data corresponding to the current iteration step size. The historical irrigation action sequence is used as a conditional feature input into the model to modulate the current noise action sequence corresponding to the current iteration step size. For example, the model can be a DiT model.
[0075] S207. Input the current supplementary data and the current noise action sequence into the irrigation prediction model to determine the prediction noise action sequence corresponding to the current iteration step number.
[0076] S208. When the current iteration step size is greater than the total number of model iteration steps, obtain the predicted action sequence corresponding to the current iteration step size and determine the predicted irrigation data.
[0077] S209. In response to the current iteration step number being less than or equal to the total number of model iteration steps, the predicted action sequence corresponding to the current iteration step number is used as the current noise action sequence corresponding to the next iteration step number, and 1 is incremented on the current iteration step number.
[0078] This invention, through obtaining historical irrigation action sequences, acquiring updated spatial feature distribution information and updated temporal feature distribution information, and determining the updated spatial feature distribution information and updated temporal feature distribution information as the current supplementary data corresponding to the current iteration step number if the current iteration step number is odd, and determining the historical irrigation action sequence as the current supplementary data corresponding to the current iteration step number if the current iteration step number is even, avoids mutual interference between them during the learning process by alternately using updated spatial feature distribution information, updated temporal feature distribution information and historical irrigation action sequences as conditions in different steps. This improves the model's learning effect on spatiotemporal features while ensuring the model's feature acquisition of previous actions, thereby improving the accuracy of irrigation prediction.
[0079] Optionally, obtaining updated spatial feature distribution information and updated temporal feature distribution information includes: obtaining spatial feature distribution information and temporal feature distribution information; obtaining the update matrix corresponding to the spatial feature distribution information and temporal feature distribution information; performing cross-attention calculation on the spatial feature distribution information and the update matrix to update the spatial feature distribution information, thereby obtaining updated spatial feature distribution information; and performing cross-attention calculation on the temporal feature distribution information and the update matrix to update the temporal feature distribution information, thereby obtaining updated temporal feature distribution information.
[0080] Spatial feature distribution information can be used to describe the dataset of initial spatial feature information of the model before iterative operations. Temporal feature distribution information can be used to describe the dataset of initial temporal feature information of the model before iterative operations.
[0081] Specifically, the spatial and temporal feature distribution information of the model is obtained. For example, the model can be a DiT model. The spatial and temporal feature distribution information can be generated through initialization, which includes, but is not limited to, random initialization or pre-set initialization. This embodiment of the invention does not impose any restrictions on this. The spatial feature distribution information can be expanded and processed in the temporal dimension to obtain the update matrix corresponding to the spatial feature distribution information. The temporal feature distribution information can also be expanded and processed in the spatial dimension to obtain the update matrix corresponding to the temporal feature distribution information. After obtaining the spatial and temporal feature distribution information and the corresponding update matrix, cross-attention calculation is performed on the spatial feature distribution information and the update matrix to obtain the spatial cross result. The spatial cross result is used to replace the spatial feature distribution information, and the spatial feature distribution information is updated to obtain the updated spatial feature distribution information. The spatial feature data is then determined. At this point, the updated spatial feature distribution information and the data from the spatial cross result are the same. Similarly, cross-attention calculation is performed on the temporal feature distribution information and the update matrix to obtain the temporal cross result. The temporal cross result is used to replace the temporal feature distribution information, and the temporal feature information is updated to obtain the updated temporal feature distribution information. The temporal feature data is then determined. At this point, the updated temporal feature distribution information and the data from the temporal cross result are the same.
[0082] By acquiring spatial and temporal feature distribution information, obtaining corresponding update matrices, performing cross-attention calculations between the spatial feature distribution information and the update matrices to update the spatial feature distribution information, and performing cross-attention calculations between the temporal feature distribution information and the update matrices to update the temporal feature distribution information, the spatial feature extraction model captures the spatial distribution characteristics of soil moisture at different depths. Temporal feature extraction enables the model to capture the dynamic characteristics of soil moisture changes over time, facilitating irrigation decision identification based on spatiotemporal features and resulting in more accurate irrigation decisions.
[0083] Optionally, obtaining the update matrix corresponding to the spatial feature distribution information and the temporal feature distribution information includes: obtaining historical data, which includes: the collection time period, the collection depth, collection temperature, collection humidity, and historical irrigation action sequence corresponding to the collection time period; obtaining the feature matrix corresponding to the historical depth and historical temperature in the historical data; expanding and processing the feature matrix corresponding to the historical depth and historical temperature in the historical data in the time dimension to obtain the update matrix corresponding to the spatial feature distribution information; and expanding and processing the feature matrix corresponding to the historical depth and historical temperature in the historical data in the spatial dimension to obtain the update matrix corresponding to the temporal feature distribution information.
[0084] Among them, the feature matrix can be used to describe the feature matrix of the collection information distribution determined based on historical collection data.
[0085] Specifically, multiple humidity and temperature sensors are deployed at different depths in the soil. As the sensors accumulate data over time, historical data is acquired, including the collection period, the corresponding collection depth, the collected temperature, the collected humidity, and historical irrigation sequence, forming a data matrix. This enables real-time monitoring of soil humidity at different depths, obtaining comprehensive soil moisture information and providing high-quality data support for subsequent precise irrigation decisions. The process involves obtaining feature matrices corresponding to historical depths and temperatures from the historical data; expanding these feature matrices along the time dimension to obtain an update matrix corresponding to spatial feature distribution information; and expanding these feature matrices along the spatial dimension to obtain an update matrix corresponding to temporal feature distribution information, facilitating the acquisition of both temporal and spatial feature information from the historical data.
[0086] By acquiring historical data, including the acquisition time period, the acquisition depth corresponding to the acquisition time period, the acquisition temperature, the acquisition humidity, and the historical irrigation action sequence; obtaining the feature matrices corresponding to the historical depth and historical temperature in the historical acquisition data; expanding and processing the feature matrices corresponding to the historical depth and historical temperature in the historical acquisition data in the time dimension to obtain the update matrix corresponding to the spatial feature distribution information; and expanding and processing the feature matrices corresponding to the historical depth and historical temperature in the historical acquisition data in the spatial dimension to obtain the update matrix corresponding to the temporal feature distribution information, global data features in both time and space can be extracted from the historical acquisition data, thereby improving the accuracy of irrigation decisions.
[0087] Optionally, the feature matrix corresponding to historical depth and historical temperature in the historical data is obtained, including: performing high-dimensional mapping processing on the historical data to obtain the mapping matrix corresponding to historical depth and historical temperature in the historical data; obtaining spatial location code and temporal location code; and fusing the spatial location code and temporal location code with the mapping matrix to obtain the feature matrix corresponding to historical depth and historical temperature.
[0088] Specifically, high-dimensional mapping processing is performed on historically collected data, mapping the data matrix to a high-dimensional feature space through the model's embedding layer to obtain the mapping matrix corresponding to historical depth and historical temperature in the historically collected data; spatial location codes and temporal location codes are obtained, with spatial location codes representing the depth location information of each sensor on the irrigation device and temporal location codes representing time step information; the spatial location codes, temporal location codes, and mapping matrix are added together to perform data fusion, resulting in the feature matrix corresponding to historical depth and historical temperature.
[0089] By performing high-dimensional mapping processing on historical data, a mapping matrix corresponding to historical depth and historical temperature is obtained; spatial location codes and temporal location codes are acquired; the spatial location codes and temporal location codes are fused with the mapping matrix to obtain the feature matrix corresponding to historical depth and historical temperature. This allows for accurate determination of the depth, temperature, humidity, and time characteristics of different sensors. Through multi-dimensional data analysis, the accuracy of irrigation prediction is improved.
[0090] Optionally, the predicted action sequence corresponding to the current iteration step number is obtained, and the predicted irrigation data is determined, including: obtaining the target decoder trained on the initial decoder based on historical data; determining the correspondence between the predicted action sequence and the irrigation operation based on the target decoder; and determining the predicted irrigation data based on the correspondence between the predicted action sequence and the irrigation operation.
[0091] The target decoder can be used to describe the network layer that predicts the results from feature data.
[0092] Specifically, the initial decoder is trained based on historical data to generate a correspondence between different feature data and irrigation operation time, resulting in a target decoder trained on the initial decoder. The target decoder is then acquired, and based on it, the correspondence between each feature data in the predicted action sequence and the irrigation operation can be determined. Based on this correspondence, predicted irrigation data is determined, which can be used to describe the set of data for the irrigation equipment to perform operations.
[0093] By acquiring a target decoder trained on the initial decoder based on historical data, determining the correspondence between predicted action sequences and irrigation operations based on the target decoder, and determining predicted irrigation data based on the correspondence between predicted action sequences and irrigation operations, the changing patterns of corresponding features between predicted action sequences and irrigation operations can be determined through historical data. This facilitates model verification and improvement, thereby enhancing the model's prediction accuracy.
[0094] Optionally, after obtaining the target decoder trained on the initial decoder based on historical data, the method further includes: obtaining real-time data and random noise action sequences, wherein the real-time data includes: the collection time period, the collection depth corresponding to the collection time period, the collection temperature, the collection humidity, and historical irrigation action sequences; determining the target action sequence based on the random noise action sequence and the real-time data; inputting the target action sequence into the target decoder to obtain real-time irrigation data; and sending the real-time irrigation data to the irrigation device so that the irrigation device performs irrigation operations according to the real-time irrigation data.
[0095] Specifically, real-time data acquisition is used to collect environmental data related to irrigation. This data reflects the current soil moisture status, providing a basis for subsequent irrigation decisions. Random noise action sequences are also acquired. These sequences are generated by randomly producing parameter values for each parameter in an initial noise action sequence, and the sequence is determined based on these parameter values. Random noise action sequences can simulate uncertainties or increase the robustness of the model. For example, in actual irrigation, unpredictable factors may affect the model, such as slight changes in wind direction leading to uneven water evaporation or minor differences in soil texture. Random noise action sequences can reflect these uncertainties to some extent. Based on random noise action sequences and real-time acquired data, temporal and spatial feature data extracted from the real-time acquired data, along with historical irrigation action sequences, are used as modulation conditions to denoise the random noise action sequences until the iteration termination condition is met. The modulation then ends, and the target action sequence is determined. This target action sequence is input into the target decoder. Based on the correspondence between the feature information in the target action sequence and the irrigation actions, real-time irrigation data is obtained. This real-time irrigation data is sent to the irrigation device, enabling it to perform irrigation operations according to the real-time data. The irrigation device can control each sprinkler head to irrigate crops. The irrigation prediction method can be as follows: Figure 3 As shown.
[0096] By acquiring real-time data and random noise action sequences, including the acquisition time period, the corresponding acquisition depth, acquisition temperature, acquisition humidity, and historical irrigation action sequences, a target action sequence is determined based on the random noise action sequence and real-time data. This target action sequence is then input into a target decoder to obtain real-time irrigation data. The real-time irrigation data is then sent to the irrigation device, enabling it to perform irrigation operations according to the data. Real-time monitoring data can be analyzed to predict irrigation data, allowing the irrigation device to irrigate crops automatically. Furthermore, it allows for refined analysis at different depths, temperatures, and humidity levels, ensuring crop quality.
[0097] Example 3
[0098] Figure 4 This is a schematic diagram of an irrigation prediction device provided in Embodiment 3 of the present invention. This embodiment of the present invention is applicable to irrigation prediction scenarios. The device can execute an irrigation prediction method and can be implemented in hardware and / or software.
[0099] See Figure 4The irrigation prediction device shown includes: a sequence acquisition module 401, a current sequence acquisition module 402, a data acquisition module 403, a data input module 404, a prediction data acquisition module 405, and a step size accumulation module 406, wherein...
[0100] Sequence acquisition module 401 is used to acquire the initial noisy action sequence;
[0101] The current sequence acquisition module 402 is used to determine the current noise action sequence corresponding to the current iteration step number when the acquired current iteration step number is less than or equal to the total number of model iteration steps, based on the initial noise action sequence.
[0102] The data acquisition module 403 is used to determine the current supplementary data corresponding to the current iteration step number based on the parity of the current iteration step number.
[0103] The data input module 404 is used to input the current supplementary data and the current noise action sequence into the irrigation prediction model to determine the prediction noise action sequence corresponding to the current iteration step number;
[0104] The prediction data acquisition module 405 is used to acquire the prediction action sequence corresponding to the current iteration step number and determine the prediction irrigation data when the current iteration step number is greater than the total number of model iteration steps.
[0105] The step size accumulation module 406 is used to respond to the current iteration step size being less than or equal to the total number of model iteration steps by taking the predicted action sequence corresponding to the current iteration step size as the current noise action sequence corresponding to the next iteration step size, and incrementing the current iteration step size by 1.
[0106] The technical solution of this invention involves: acquiring an initial noise action sequence; when the acquired current iteration step number is less than or equal to the total number of model iteration steps, determining the current noise action sequence corresponding to the current iteration step number based on the initial noise action sequence; determining the current supplementary data corresponding to the current iteration step number based on the parity of the current iteration step number; inputting the current supplementary data and the current noise action sequence into the irrigation prediction model to determine the predicted noise action sequence corresponding to the current iteration step number; and when the current iteration step number is greater than the total number of model iteration steps, acquiring the current iteration step number pair. The system predicts the action sequence and determines the predicted irrigation data. When the current iteration step number is less than or equal to the total number of model iteration steps, the predicted action sequence corresponding to the current iteration step number is used as the current noise action sequence corresponding to the next iteration step number. The system also increments the current iteration step number by 1. By judging the parity of the current iteration step number, different data are used alternately as conditions to denoise the initial noise action sequence. This avoids the mutual influence of different conditions corresponding to different iteration step numbers on the denoising process of the initial noise action sequence, thus improving the accuracy of denoising the initial noise action sequence.
[0107] Optionally, the data acquisition module 403 includes:
[0108] The historical sequence acquisition submodule is used to acquire historical irrigation action sequences;
[0109] The multidimensional information acquisition submodule is used to acquire update spatial feature distribution information and update temporal feature distribution information;
[0110] The odd-number supplementary value acquisition submodule is used to determine the updated spatial feature distribution information and the updated temporal feature distribution information as the current supplementary data corresponding to the current iteration step number if the current iteration step number is odd.
[0111] The even-number supplementary value acquisition submodule is used to determine the historical irrigation action sequence as the current supplementary data corresponding to the current iteration step if the current iteration step number is even.
[0112] Optional, multi-dimensional information acquisition submodule, including:
[0113] The spatiotemporal information acquisition unit is used to acquire spatial feature distribution information and temporal feature distribution information;
[0114] The matrix acquisition unit is used to acquire the update matrix corresponding to the spatial feature distribution information and the temporal feature distribution information.
[0115] The spatial information update unit is used to perform cross-attention calculation on the spatial feature distribution information and the update matrix to update the spatial feature distribution information and obtain updated spatial feature distribution information.
[0116] The time information update unit is used to perform cross-attention calculation on the time feature distribution information and the update matrix to update the time feature distribution information and obtain the updated time feature distribution information.
[0117] Optionally, the matrix acquisition unit includes:
[0118] The historical data acquisition subunit is used to acquire historical data, which includes: the acquisition time period, the acquisition depth corresponding to the acquisition time period, the acquisition temperature, the acquisition humidity, and the historical irrigation action sequence.
[0119] The feature matrix acquisition sub-unit is used to acquire the feature matrices corresponding to historical depth and historical temperature in the historical data.
[0120] The time dimension expansion subunit is used to expand the feature matrices corresponding to historical depth and historical temperature in the historical data in the time dimension to obtain the update matrix corresponding to the spatial feature distribution information.
[0121] The spatial dimension expansion sub-unit is used to expand the feature matrices corresponding to historical depth and historical temperature in the historical data in the spatial dimension to obtain the update matrix corresponding to the time feature distribution information.
[0122] Optionally, the feature matrix is used to obtain sub-units, specifically for:
[0123] High-dimensional mapping processing is performed on historical data to obtain the mapping matrix corresponding to historical depth and historical temperature in the historical data.
[0124] Obtain spatial location code and temporal location code;
[0125] By fusing spatial location coding and temporal location coding with the mapping matrix, feature matrices corresponding to historical depth and historical temperature are obtained.
[0126] Optionally, the prediction data acquisition module 405 includes:
[0127] The decoder acquisition submodule is used to acquire the target decoder that has been trained on the initial decoder based on historical data.
[0128] The relationship determination submodule is used to determine the correspondence between the predicted action sequence and the irrigation operation based on the target decoder;
[0129] The irrigation data acquisition submodule is used to determine the predicted irrigation data based on the correspondence between the predicted action sequence and the irrigation operation.
[0130] Optionally, the prediction data acquisition module 405 also includes:
[0131] The real-time data acquisition submodule is used to acquire real-time collected data and random noise action sequences. The real-time collected data includes: the collection time period, the collection depth corresponding to the collection time period, the collection temperature, the collection humidity, and the historical irrigation action sequences.
[0132] The target sequence acquisition submodule is used to determine the target action sequence based on the random noise action sequence and real-time acquired data;
[0133] The information acquisition submodule is used to input the target action sequence into the target decoder to obtain real-time irrigation data;
[0134] The information sending submodule is used to send real-time irrigation data to the irrigation device so that the irrigation device can perform irrigation operations according to the real-time irrigation data.
[0135] The irrigation prediction device provided in the embodiments of the present invention can execute the irrigation prediction method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the irrigation prediction method.
[0136] Example 4
[0137] Figure 5 A schematic diagram of the structure of an irrigation prediction device 500 that can be used to implement an embodiment of the present invention is shown.
[0138] like Figure 5 As shown, the irrigation prediction device 500 includes at least one processor 501 and a memory, such as a read-only memory (ROM) 502 and a random access memory (RAM) 503, communicatively connected to the at least one processor 501. The memory stores computer programs executable by the at least one processor. The processor 501 can perform various appropriate actions and processes based on the computer program stored in the ROM 502 or loaded into the RAM 503 from storage unit 508. The RAM 503 can also store various programs and data required for the operation of the irrigation prediction device 500. The processor 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0139] Multiple components in the irrigation forecasting device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, optical disk, etc.; and a communication unit 509, such as a network card, modem, wireless transceiver, etc. The communication unit 509 allows the irrigation forecasting device 500 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0140] Processor 501 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 501 performs the various methods and processes described above, such as irrigation prediction methods.
[0141] In some embodiments, the irrigation prediction method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the irrigation prediction device 500 via ROM 502 and / or communication unit 509. When the computer program is loaded into RAM 503 and executed by processor 501, one or more steps of the irrigation prediction method described above may be performed. Alternatively, in other embodiments, processor 501 may be configured to perform the irrigation prediction method by any other suitable means (e.g., by means of firmware).
[0142] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0143] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0144] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0145] To provide user interaction, the systems and techniques described herein can be implemented on irrigation forecasting devices, which include: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the irrigation forecasting device. Other types of devices can also be used to provide user interaction; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0146] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0147] A computing system can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system. It addresses the shortcomings of traditional physical hosts and VPS (Virtual Private Server) services, such as high management difficulty and weak business scalability.
[0148] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and no limitation is imposed herein.
[0149] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. An irrigation prediction method, characterized in that, The method includes: Obtain an initial noise action sequence, which is used to describe a data set representing a preset irrigation action command; When the current iteration step size is less than or equal to the total number of model iteration steps, the current noise action sequence corresponding to the current iteration step size is determined based on the initial noise action sequence. Based on the parity of the current iteration step number, determine the current supplementary data corresponding to the current iteration step number; The current supplementary data and the current noise action sequence are input into the irrigation prediction model to determine the predicted noise action sequence corresponding to the current iteration step number; When the current iteration step size is greater than the total number of model iteration steps, the predicted action sequence corresponding to the current iteration step size is obtained, and the predicted irrigation data is determined. In response to the current iteration step size being less than or equal to the total number of model iteration steps, the predicted action sequence corresponding to the current iteration step size is used as the current noise action sequence corresponding to the next iteration step size, and 1 is incremented on the current iteration step size. The step of determining the current supplementary data corresponding to the current iteration step size based on the parity of the current iteration step size includes: Obtain the historical irrigation action sequence; Obtain update spatial feature distribution information and update temporal feature distribution information; If the current iteration step size is odd, the update spatial feature distribution information and the update time feature distribution information are determined as the current supplementary data corresponding to the current iteration step size; If the current iteration step size is even, the historical irrigation action sequence is determined as the current supplementary data corresponding to the current iteration step size; The acquisition of update spatial feature distribution information and update temporal feature distribution information includes: Obtain spatial and temporal feature distribution information; Obtain the update matrix corresponding to the spatial feature distribution information and the temporal feature distribution information; The spatial feature distribution information is cross-attention calculated with the update matrix to update the spatial feature distribution information, thus obtaining updated spatial feature distribution information. The time feature distribution information is cross-attention calculated with the update matrix to update the time feature distribution information, thus obtaining updated time feature distribution information; The step of obtaining the update matrix corresponding to the spatial feature distribution information and the temporal feature distribution information includes: Acquire historical data, which includes: the collection period, the historical depth, historical temperature, collection humidity, and historical irrigation action sequence corresponding to the collection period; Obtain the feature matrix corresponding to the historical depth and historical temperature from the historical data collected; The feature matrices corresponding to the historical depth and historical temperature in the historical data are expanded and processed in the time dimension to obtain the update matrix corresponding to the spatial feature distribution information. The feature matrices corresponding to the historical depth and historical temperature in the historical data are expanded in the spatial dimension to obtain the update matrix corresponding to the time feature distribution information. The acquisition of the feature matrix corresponding to the historical depth and historical temperature in the historical data includes: Based on the historical data, a high-dimensional mapping process is performed to obtain the mapping matrix corresponding to the historical depth and historical temperature in the historical data. Obtain spatial location code and temporal location code; The spatial location code and the temporal location code are fused with the mapping matrix to obtain the feature matrix corresponding to the historical depth and historical temperature. The step of obtaining the predicted action sequence corresponding to the current iteration step number and determining the predicted irrigation data includes: Obtain the target decoder trained on the initial decoder based on the historical data; Based on the target decoder, the correspondence between the predicted action sequence and the irrigation operation is determined; Based on the correspondence between the predicted action sequence and irrigation operations, the predicted irrigation data is determined; After obtaining the target decoder trained on the initial decoder based on the historical data, the method further includes: Acquire real-time data and random noise action sequences. The real-time data includes: the acquisition time period, the acquisition depth corresponding to the acquisition time period, the acquisition temperature, the acquisition humidity, and the historical irrigation action sequence. The target action sequence is determined based on the random noise action sequence and the real-time acquired data; The target action sequence is input into the target decoder to obtain real-time irrigation data; The real-time irrigation data is sent to the irrigation device so that the irrigation device performs irrigation operations according to the real-time irrigation data.
2. An irrigation prediction device, characterized in that, The apparatus for implementing the irrigation prediction method of claim 1 includes: The sequence acquisition module is used to acquire the initial noisy action sequence; The current sequence acquisition module is used to determine the current noise action sequence corresponding to the current iteration step size when the acquired current iteration step size is less than or equal to the total number of iteration steps of the model, based on the initial noise action sequence. The data acquisition module is used to determine the current supplementary data corresponding to the current iteration step size based on the parity of the current iteration step size. The data input module is used to input the current supplementary data and the current noise action sequence into the irrigation prediction model to determine the prediction noise action sequence corresponding to the current iteration step number; The prediction data acquisition module is used to acquire the prediction action sequence corresponding to the current iteration step number and determine the prediction irrigation data when the current iteration step number is greater than the total number of model iteration steps. The step size accumulation module is used to, in response to the current iteration step size being less than or equal to the total number of model iteration steps, take the predicted action sequence corresponding to the current iteration step size as the current noise action sequence corresponding to the next iteration step size, and increment the current iteration step size by 1.
3. An irrigation prediction device, characterized in that, The irrigation prediction equipment includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor to enable the at least one processor to perform the irrigation prediction method of claim 1.
4. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the irrigation prediction method of claim 1.
Citation Information
Patent Citations
Irrigation control method and device, electronic equipment and storage medium
CN115530054A
Irrigation control method, system, device and equipment and storage medium
CN117958121A