Farming action planning model training method, farming action planning method and equipment
Through the deep learning model, the feature extraction of historical agricultural action and environmental data is automatically recommended, and the types and time of agricultural action are solved, which solves the accuracy and efficiency of agricultural operation planning caused by manual observation, and improves the efficiency and rationality of agricultural production.
Patent Information
- Application Number
- CN202411294176.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2025-01-03
AI Technical Summary
The existing technology relies on manual observation in agricultural management, which makes it difficult to ensure the accuracy and efficiency of agricultural operation planning and the optimal crop cultivation process cannot be achieved.
By obtaining historical agricultural action data and environmental monitoring data, combining it into a multi-type data sequence, using deep learning models for feature extraction and prediction, automatically recommending agricultural action types and start time, and forming a trained agricultural action planning model.
Accurate prediction and automatic recommendation of agricultural operations are achieved, the efficiency and rationality of agricultural production are improved, and the orderly progress of agricultural operations is ensured.
Smart Images

Figure CN119250420A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a farming action planning model training method, a farming action planning method and a device. Background Art
[0002] Farming action planning is an important part of agricultural management, which involves the entire process and all aspects of agricultural production. It refers to the advance arrangement and organization of various specific activities in the agricultural production process. Through scientific and reasonable planning and management measures, it can ensure the orderly and efficient progress of agricultural production.
[0003] In terms of agricultural management, the planning of agricultural actions has always been a technical problem. At present, agricultural management often relies on manual observation of agricultural conditions to determine when to carry out which subsequent actions. This method is not only time-consuming and laborious, but also due to the complexity of the agricultural operation environment, its accuracy cannot be guaranteed and may not achieve the optimal crop cultivation process. Summary of the invention
[0004] The present invention provides an agricultural action planning model training method, an agricultural action planning method and an agricultural action planning device. By combining historical data into multi-type data sequences, a deep learning model is used to learn and extract features of the multi-type data sequences. The method can accurately predict the most necessary agricultural actions and the start time of agricultural operations, so as to realize automatic recommendation of agricultural action types.
[0005] In order to achieve the above purpose and other advantages, the present invention adopts the following technical solutions:
[0006] In a first aspect, the present invention provides a method for training a farming action planning model, comprising:
[0007] Acquire historical farming action data and historical environmental monitoring data of the observed farmland during the farming operation process, wherein the historical farming action data includes the farming action type and the farming start time;
[0008] Combining the historical farming action data and the historical environmental monitoring data into a multi-type data sequence;
[0009] Based on the multi-type data sequence, outputting the prediction result of the action type and the corresponding start time prediction result of the next agricultural action through the agricultural action planning model;
[0010] Based on the action type prediction results, the start time prediction results, and the actual action type and actual start time of the next agricultural activity, a loss value is generated through the loss function of the agricultural action planning model, and the agricultural action planning model is updated until convergence to obtain the trained agricultural action planning model.
[0011] According to a method for training a farming action planning model provided by the present invention, the observed farmland is composed of a plurality of farmland plots, and for different farmland plots, the step of forming the historical farming action data and the historical environmental monitoring data into a multi-type data sequence comprises:
[0012] Define an interaction item representing an agricultural action or an environmental monitoring data record, wherein the interaction item includes: action type, occurrence time and interaction content;
[0013] For the interactive item representing the historical farming action data, the action type is set as a farming action, and the interactive content is set as a fixed value;
[0014] For the interaction item representing the historical environmental monitoring data, the action type is set as data observation, and the interaction content is set as data observation value;
[0015] The interaction items are arranged in the order of occurrence time to generate a multi-type data sequence consisting of various farming actions and environmental monitoring data representing the farmland plot.
[0016] According to a method for training a farming action planning model provided by the present invention, the farming action planning model comprises: an embedding representation module and a multi-behavior mode aggregation module;
[0017] The step of outputting the action type prediction result and the corresponding start time prediction result of the next agricultural activity based on the multi-type data sequence through the agricultural activity planning model includes:
[0018] The embedding representation module extracts features of the interaction content and action type of each interaction item of the multi-type data sequence;
[0019] The multi-behavior pattern aggregation module learns the relationship between each action type and predicts the next farming activity.
[0020] According to a method for training a farming action planning model provided by the present invention, the embedding representation module includes: an action embedding layer and an item dependency module;
[0021] The step of extracting features of the interaction content and action type of each interaction item of the multi-type data sequence by the embedding representation module includes:
[0022] The action embedding layer uses a multi-dimensional vector to represent the action type, occurrence time and interaction content of each interaction item respectively, and fuses the vectors representing the action type, the occurrence time and the interaction content to obtain a first feature vector representing each interaction item;
[0023] The project dependency module uses a multi-head attention mechanism to segment the first feature vector, calculates the degree of correlation between different interaction items as the attention weight of the attention head, and concatenates the outputs of multiple attention heads and fuses them through linear transformation to obtain a second feature vector that represents the dependency relationship information between different actions.
[0024] According to a method for training a farming action planning model provided by the present invention, the steps of the multi-behavior mode aggregation module learning the relationship between the action types and predicting the next farming activity include:
[0025] According to the second feature vector, obtaining information representation generated during the interaction between the action type of different behaviors and the farmland plot, and semantically encoding the information representation to obtain behavior features;
[0026] Embedding the behavior feature into the aggregation layer, and obtaining a feature representation of the farmland plot through a feature embedding operation, wherein the feature representation of the farmland plot expresses feature information of the multi-type data sequence;
[0027] An adaptive attention mechanism is introduced into the aggregation layer to predict the action type prediction result and the start time prediction result of the next farming activity based on the feature representation of the farmland plot.
[0028] According to a method for training a farming action planning model provided by the present invention, the step of the multi-behavior mode aggregation module learning the relationship between the action types and predicting the next farming activity also includes:
[0029] Based on the feature representation of the farmland plot, the cross-time feature representation generated during the interaction between the action types of different behaviors and the farmland plot is obtained again to simulate the mutual influence between farming actions and environmental monitoring data in the scene of the farmland plot.
[0030] According to a farming action planning model training method provided by the present invention, the loss value includes a first loss value and a second loss value;
[0031] Generating the loss value includes:
[0032] Taking the actual action type of the next farming activity as the target action type, calculating the probability value of the predicted farming action type being close to the target action type as the first loss value;
[0033] Calculating the predicted next agricultural action as the first time difference between the start time of the target action type and the start time of the last agricultural action in the multi-type data sequence;
[0034] Calculating a second time difference between the actual start time of the next farming action and the start time of the last farming action in the multi-type data sequence;
[0035] A difference between the first time difference and the second time difference is calculated as a second loss value.
[0036] In a second aspect, the present invention provides a farming action planning method, comprising:
[0037] Obtain historical farming action data and historical environmental monitoring data of the target farmland plot;
[0038] Inputting the historical farming action data and the historical environmental monitoring data into a pre-trained farming action planning model to obtain the action type and start time of the next farming action output by the farming action planning model, wherein the pre-trained farming action planning model is trained by any of the farming action planning model training methods described above;
[0039] According to the action type and starting time of the next farming activity, assist in formulating the next stage of agricultural production plan for the target farmland.
[0040] In a third aspect, the present invention provides an electronic device, the electronic device comprising:
[0041] One or more processors; and a memory storing computer program instructions, wherein the computer program instructions, when executed by the processor, implement the steps of the agricultural action planning model training method as described in any one of the above, or implement the steps of the agricultural action planning method as described in the above.
[0042] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program / instruction stored thereon, characterized in that when the computer program / instruction is executed by a processor, the steps of the agricultural action planning model training method as described in any one of the above are implemented, or the steps of the agricultural action planning method as described in the above are implemented.
[0043] The present invention provides a method for training a farming action planning model, a method for farming action planning and a device, which obtain historical farming action data and historical environmental monitoring data of an observed farmland during farming operations, wherein the historical farming action data include farming action types and farming start times; the historical farming action data and the historical environmental monitoring data are combined into a multi-type data sequence; based on the multi-type data sequence, an action type prediction result and a corresponding start time prediction result of the next farming activity are output through an agricultural action planning model; based on the action type prediction result, the start time prediction result and the actual action type and actual start time of the next farming activity, a loss value is generated through a loss function of the agricultural action planning model, and the agricultural action planning model is updated until convergence to obtain a trained agricultural action planning model. The present invention combines historical data into multi-type data sequences, and uses deep learning models to learn and extract features from multi-type data sequences. It can accurately predict the most necessary agricultural actions and the start time of agricultural operations, so as to realize automatic recommendation of agricultural action types in combination with site characteristics, and assist in formulating the next stage of agricultural production plans based on the recommended agricultural actions, so as to carry out subsequent cultivation work more effectively and reasonably and ensure the rational development of agricultural operations. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other implementation methods can be obtained based on these drawings without paying any creative work.
[0045] Figure 1 This is one of the flow charts of the agricultural action planning model training method provided by an embodiment of the present invention;
[0046] Figure 2 This is the second flow chart of the agricultural action planning model training method provided by the embodiment of the present invention;
[0047] Figure 3 It is a flowchart of a farming action planning method provided by an embodiment of the present invention;
[0048] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0049] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the following specifically cites a preferred embodiment and describes it in detail with the accompanying drawings as follows.
[0050] It should be noted that it is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in the present invention can be combined with other embodiments without conflict. Unless otherwise defined, the technical terms or scientific terms involved in the present invention should be the usual meanings understood by people with ordinary skills in the technical field to which the present invention belongs. The words "one", "a", "a", "the" and the like involved in the present invention do not indicate a quantitative limitation and may represent the singular or plural. The terms "including", "comprising", "having" and any of their variations involved in the present invention are intended to cover non-exclusive inclusions; the terms "first", "second", "third", etc. involved in the present invention are merely to distinguish similar objects and do not represent a specific ordering of objects.
[0051] When it comes to method steps, the sequence illustrated in this document represents an exemplary solution, but does not mean a limitation on the sequence.
[0052] The applicant has found that in the process of agricultural management, effective planning of agricultural operations is very important. However, the current manual observation method has great limitations. Due to the complexity of farmland operation scenes, the manual observation method cannot guarantee the accuracy of planning agricultural behavior actions and cannot achieve the optimal crop cultivation process. Therefore, the present invention provides a method for training an agricultural action planning model, a method and a device for agricultural action planning, which can automatically recommend subsequent agricultural action types and specific times, and has great practical significance in agricultural management.
[0053] Embodiment 1
[0054] Reference Figure 1-2 As shown, an embodiment of the present invention provides a method for training a farming action planning model, comprising:
[0055] Step S1: Acquire historical farming action data and historical environmental monitoring data of the observed farmland during the farming operation process, wherein the historical farming action data includes the farming action type and the farming start time.
[0056] Specifically, crops are planted normally and agricultural operations are carried out in the observed farmland, and various environmental data of the farmland are continuously and effectively observed and recorded through detection devices (such as soil pH sensors, soil temperature and humidity sensors, air temperature and humidity sensors, light sensors, etc.) set around the farmland to obtain historical environmental monitoring data. Exemplarily, the historical environmental monitoring data includes observation data such as soil pH, soil temperature, soil humidity, air temperature, and air humidity recorded at different time points.
[0057] The historical agricultural action data is obtained by manually recording a certain agricultural action at a certain time point, or by taking video images of farmers performing agricultural operations through cameras arranged from multiple perspectives, and then identifying agricultural actions through a neural network model. For example, agricultural action types refer to the classification of actions performed by people in agricultural production activities, including transplanting, sowing, watering, fertilizing, spraying pesticides, harvesting, and other action types.
[0058] Step S2: Combining historical farming action data and historical environmental monitoring data into a multi-type data sequence.
[0059] In this embodiment, the observed farmland consists of multiple farmland plots. For different farmland plots i, step S2 specifically includes:
[0060] Step S201: defining an interaction item representing an agricultural action or an environmental monitoring data record, wherein the interaction item includes: action type, occurrence time and interaction content;
[0061] Step S202: for the interactive item representing the historical farming action data, the action type is set to the farming action, and the interactive content is set to a fixed value;
[0062] Step S203: for the interaction item representing the historical environmental monitoring data, the action type is set to data observation, and the interaction content is set to data observation value;
[0063] Step S204: Arrange the interaction items in the order of occurrence time to generate a multi-type data sequence consisting of various farming actions and environmental monitoring data representing the farmland plot.
[0064] Specifically, for farmland plot i, its multi-type data sequence consisting of various farming action data and environmental monitoring data is recorded as S i . Record sequence S i The length of the sequence S is K. i The kth interaction term in time is expressed as (v k,i , b k,i , t k,i ), whose action type is b k,i , the occurrence time is t k,i , the interactive content is v k,i Each interaction item represents an agricultural action (such as watering, fertilizing, etc.) or a data observation (such as soil pH, humidity, etc.). If the action type b is an agricultural action, the interaction content v is a fixed value (such as set to 1); if the action type b is an environmental monitoring data record, the interaction content v is a data observation value (the value of soil pH and humidity).
[0065] It should be noted that all the farmland plots mentioned are assumed to be i, and the subscript i is omitted below to simplify the expression.
[0066] Step S3: Based on the multi-type data sequence, the agricultural action planning model outputs the action type prediction result and the corresponding start time prediction result of the next agricultural action.
[0067] In this embodiment, the farming action planning model includes: an embedding representation module and a multi-behavior mode aggregation module; step S3 specifically includes:
[0068] Step S301: The embedded representation module extracts features of the interaction content and action type of each interaction item in the multi-type data sequence.
[0069] The embedding representation module includes: an action embedding layer and a project dependency module; step S301 specifically includes:
[0070] Step S3011: the action embedding layer uses a multi-dimensional vector to represent the action type, occurrence time and interaction content of each interaction item, and fuses the vectors representing the action type, occurrence time and interaction content to obtain a first feature vector representing each interaction item;
[0071] Step S3012: The project dependency module uses a multi-head attention mechanism to segment the first feature vector, calculates the degree of correlation between different interaction items as the attention weight of the attention head, and concatenates the outputs of multiple attention heads and fuses them through linear transformation to obtain a second feature vector that represents the dependency relationship information between different actions.
[0072] Specifically, a multidimensional vector with dimension d is used to describe each action type b, interaction content v and occurrence time t, and e v =W v v,e b =W b b Record, where W v , W b , W t is a parameter matrix. The action embedding layer maps each action type b, interaction content v, and occurrence time t into a vector space of size d, realizing feature extraction and numerical representation of these elements. This representation method enables information that is originally abstract or difficult to process directly (such as action type b, interaction content v, and occurrence time t) to be understood and processed by the machine learning model in the form of a numerical vector. In order to capture and integrate the complex relationship between action type, interaction content, and occurrence time, the action embedding layer calculates the composite signal of multiple behavior patterns and interaction dynamics. E k represents the feature vector of each interaction term, It is the element-by-element addition of the vector. The corresponding embedding vector (e v ,e b ,e t ) performs element-wise addition Thus, a first feature vector is generated that can fully reflect the characteristics of each interaction item. The action embedding layer is usually implemented through a fully connected layer or an embedding matrix to convert each feature into a vector of fixed length.
[0073] Therefore, the design of the action embedding layer is highly flexible and scalable. As the task requirements change or new data are introduced, the parameter matrix W can be easily adjusted. v , W b , W t The size or structure of the model can be changed to adapt to different data distributions and task characteristics. At the same time, the input features of the model can be further enriched by introducing more embedding vectors (such as user embedding, environment embedding, etc.).
[0074] The project dependency module samples a multi-head attention mechanism to capture the dependencies between different actions. Specifically, it refers to the mutual influence and association between these actions or events when processing a series of actions or events. These dependencies can be reflected at multiple levels, including but not limited to time sequence, causality, logical association, etc. The order in which agricultural actions occur on the timeline constitutes the basic time sequence dependency. For example, in the process of agricultural operations, sowing must be completed before watering begins. This order is a manifestation of time sequence dependency. For another example, when solving complex pest problems, it may be necessary to perform a series of steps in a specific logical order, such as increasing lighting, covering soil, fertilizing, spraying pesticides, etc. The association between these steps is the logical association dependency. The first feature vector of the input is split into multiple attention heads. Each attention head performs attention calculations independently, allowing the model to capture dependencies from different subspaces. The outputs of all attention heads are concatenated and then fused through a linear transformation layer to obtain the final output. This output vector contains the dependency information between related actions after being processed by the multi-head attention mechanism.
[0075] For the kth interaction content of the interaction item The second feature vector of the dependency information between its actions is expressed as:
[0076]
[0077] Among them, α k,k′ is a learnable parameter that represents the degree of association between the kth and k′th interaction terms,
[0078] σ represents the sigma function represents the learnable parameter matrix in the attention mechanism, d is the dimension of the vector, H represents the number of attention heads in the multi-head attention mechanism, which is a predefined value, usually set to 8, the ∪ operator represents the direct connection of the vector, and K is the multi-type data sequence S i Length.
[0079] Step S302: The multi-behavior pattern aggregation module learns the relationship between each action type and predicts the next farming activity
[0080] In this embodiment, step S302 specifically includes:
[0081] Step S3021: obtaining information representations generated during the interaction between action types of different behaviors and farmland plots according to the second feature vector, and performing semantic coding on the information representations to obtain behavior features;
[0082] Step S3022: embedding the behavior features into the aggregation layer, and obtaining feature representation of the farmland plot through feature embedding operation, wherein the feature representation of the farmland plot expresses feature information of multiple types of data sequences;
[0083] Step S3023: Introduce an adaptive attention mechanism in the aggregation layer to predict the action type prediction result and the start time prediction result of the next farming activity based on the feature representation of the farmland plots.
[0084] Specifically, we learn the differences between different action types, use a behavior-aware representation to distinguish the features of different action types, and semantically encode specific types of actions. The information generated during the interaction between the action and the farmland is semantically encoded to obtain the behavioral feature representation as follows:
[0085]
[0086] in, represents the feature representation of the b-th behavior type, W b is a learnable parameter, σ(·) is the ReLU activation function, σ(x) = max(0, x), [·] is a truth function, the value is 1 if the content is true, otherwise it is 0, and K is a multi-type data sequence S i The Aggre function represents aggregation, which calculates the association between an action and a certain type of behavior.
[0087] After semantic encoding of the behavior of a specific action type, the behavior feature H bThe feature embedding operation can be used to embed the features of farmland plots into the aggregation layer, thereby showing the hidden relationship between different types of behaviors. The feature information of multiple types of data is expressed in . To distinguish the influence of different action types on the prediction of target agricultural actions, the feature representation of farmland plots for:
[0088]
[0089] Among them, γ b represents the weight value of the b-th action type, H b Represents the feature representation of the b-th behavior type.
[0090] γ b Calculated by the following formula:
[0091]
[0092] in, is the learnable parameter of the aggregation layer, σ1 is the softmax function, σ2 is the ReLU function, Yes H b The device matrix.
[0093] Through feature embedding operations, various types of data features are integrated and expressed in the feature representation of this farmland plot. In this way, the feature representation It contains comprehensive, multi-dimensional feature information about the land, which can be used for subsequent agricultural action planning model training and prediction.
[0094] In this embodiment, step S302 further includes:
[0095] Based on the feature representation of the farmland plots, the cross-temporal feature representation generated during the interaction between the action types of different behaviors and the farmland plots is obtained again to simulate the mutual influence between farming actions and environmental monitoring data in the farmland plot scene.
[0096] Specifically, in order to simulate the mutual influence of various types of data in the farmland scene, it is necessary to represent the above-mentioned aggregated features The information is transferred from the farmland scene to the single interaction action again to obtain the cross-time feature representation generated during the interaction between the action types of different behaviors and the farmland plots, as shown below:
[0097]
[0098] in, is a learnable parameter, is the cross-temporal feature representation of the interaction action of type j, which can better express the action over the entire time span, σ(·) is the ReLU activation function, σ(x) = max(0, x), and K is the multi-type data sequence S i Length.
[0099] Step S4: Based on the action type prediction results, the start time prediction results, and the actual action type and actual start time of the next agricultural activity, a loss value is generated through the loss function of the agricultural action planning model, and the agricultural action planning model is updated until convergence to obtain a trained agricultural action planning model.
[0100] Specifically, the next agricultural action is predicted by the historical interaction term. For farmland plot i, the predicted probability value of the next agricultural action being action j is
[0101] Among them, z is the learnable parameter matrix, and the ° operator represents the element-by-element multiplication between matrices. represents the i-th plot The value j ensures that only the agricultural action type is selected from the set representing agricultural actions. is the cross-temporal feature representation of interaction actions of type j.
[0102] At the same time, the next farming action is predicted to be the farming start time when j, and the farming start time and the current multi-type data sequence S are calculated. i The time difference between the last farming action Among them, w is a learnable parameter matrix, and other parameters are defined the same as those in the agricultural action probability prediction formula.
[0103] In this embodiment, the loss value includes a first loss value and a second loss value;
[0104] Generate loss values, including:
[0105] The actual action type of the next farming activity is taken as the target action type, and the probability value of the predicted farming action type being close to the target action type is calculated as the first loss value Loss1.
[0106]
[0107] Calculate the predicted next agricultural action as the first time difference between the start time of the target action type and the start time of the last agricultural action in the multi-type data sequence;
[0108] Calculate the second time difference between the actual start time of the next farming action and the start time of the last farming action in the multi-type data sequence;
[0109] The difference between the first time difference and the second time difference is calculated as the second loss value Loss2.
[0110] Loss2=|Δt i,tar -Δt gt |
[0111] The total loss function of the final agricultural action planning model is:
[0112]
[0113] Where N represents the total number of plots in the training data, tar represents the predicted target action type, and we hope that its corresponding probability is as high as possible, and Δt gt Indicates the second time difference of the next actual farming action, Δt i,tar represents the first time difference predicted when the next agricultural action of the i-th plot is tar, Θ represents the set of all parameters in the network, represents the sum of L2 regularization of all parameters in the network (the calculation formula for the sum of L2 regularization of parameter x is That is, the sum of the squares of all the numbers in it), β, λ are the predefined loss function weights.
[0114] In the process of training the agricultural action planning model, the model parameters are adjusted to optimize the performance. The goal is to minimize the loss function, which helps to determine whether the model converges to obtain a well-trained agricultural action planning model.
[0115] Embodiment 2
[0116] Reference Figure 3 As shown, an embodiment of the present invention provides a farming action planning method, comprising:
[0117] Step A1: Obtain historical farming action data and historical environmental monitoring data of the target farmland plot;
[0118] Step A2: inputting historical farming action data and historical environmental monitoring data into a pre-trained farming action planning model to obtain the action type and start time of the next farming action output by the farming action planning model, wherein the pre-trained farming action planning model is trained by any of the above-mentioned farming action planning model training methods;
[0119] Step A3: Assist in formulating the next stage of agricultural production plan for the target farmland according to the action type and start time of the next agricultural activity.
[0120] Specifically, historical agricultural action data and historical environmental monitoring data are input into a pre-trained agricultural action planning model. The model can accurately predict the best action type and start time for the next agricultural activity based on the historical laws of the data and the current environmental status, so as to carry out subsequent cultivation work more effectively and reasonably and ensure the reasonable development of agricultural operations. Formulating the next stage of agricultural production plan for the target farmland plot according to the best action type and start time predicted by the model will help improve agricultural production efficiency and increase crop yields. Therefore, through such a multi-type data sequence agricultural action planning model, a system that can automatically combine the characteristics of the farmland plot to recommend the next agricultural action is realized.
[0121] In summary, the embodiments of the present invention provide an agricultural action planning model training method and an agricultural action planning method, which obtains historical agricultural action data and historical environmental monitoring data of the observed farmland during the agricultural operation process, the historical agricultural action data including agricultural action types and agricultural start times; the historical agricultural action data and the historical environmental monitoring data are combined into a multi-type data sequence; based on the multi-type data sequence, the action type prediction result and the corresponding start time prediction result of the next agricultural activity are output through the agricultural action planning model; based on the action type prediction result, the start time prediction result and the actual action type and actual start time of the next agricultural activity, a loss value is generated through the loss function of the agricultural action planning model, and the agricultural action planning model is updated until convergence to obtain a trained agricultural action planning model. The present invention combines historical data into multi-type data sequences, and uses deep learning models to learn and extract features from multi-type data sequences. It can accurately predict the most necessary agricultural actions and the start time of agricultural operations, so as to realize automatic recommendation of agricultural action types in combination with site characteristics, and assist in formulating the next stage of agricultural production plans based on the recommended agricultural actions, so as to carry out subsequent cultivation work more effectively and reasonably and ensure the rational development of agricultural operations.
[0122] In addition, some embodiments of the present application also provide an electronic device. The electronic device may be a digital computer in various forms, such as a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, etc. The electronic device may also be a mobile device in various forms, such as a personal digital processing, a cellular phone, a smart phone, a wearable device, and other similar computing devices.
[0123] The electronic device includes: one or more processors; and a memory storing computer program instructions, and when the computer program instructions are executed, the processor executes the steps of the agricultural action planning model training method provided in the above-mentioned embodiment 1, or executes the steps of the agricultural action planning method provided in the above-mentioned embodiment 2. Figure 4 An exemplary structural diagram of the electronic device is disclosed. Figure 4 As shown, the electronic device includes: one or more processors 1101, memory 1102, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Among them, the components shown in this article, their connections and relationships, and their functions are only used as examples, and are not intended to limit the implementation of the present application described and / or required herein.
[0124] The electronic device may further include: an input device 1103 and an output device 1104. The processor 1101, the memory 1102, the input device 1103 and the output device 1104 may be connected via a bus or other means. Figure 4 The example of connecting through bus is taken in the following.
[0125] The input device 1103 can receive input digital or character information, and generate key signal input related to the user settings and function control of the electronic device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick and other input devices. The output device 1104 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display and a plasma display. In some embodiments, the display device may be a touch screen.
[0126] To provide interaction with a user, the electronic device may be a computer. The computer has: 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 a pointing device (e.g., a mouse or a trackball), through which the user can provide input to the computer. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0127] In an embodiment of the present application, a computer program / instruction is stored on a computer-readable medium, and when the computer program / instruction is executed by a processor, the steps of the agricultural action planning model training method provided in the above-mentioned embodiment 1 are implemented, or the steps of the agricultural action planning method provided in the above-mentioned embodiment 2 are executed. The computer-readable medium may be included in the electronic device described in the above-mentioned embodiment; or it may exist independently without being assembled into the device. The above-mentioned computer-readable medium carries one or more computer-readable instructions.
[0128] The memory 1102 can be used as a non-transient computer-readable storage medium, which can be used to store non-transient software programs, non-transient computer executable programs and modules. The processor 1101 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 1102, so as to implement the program instructions / modules corresponding to the method provided by any one or more embodiments in the embodiments of the present application.
[0129] The memory 1102 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 1102 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 1102 may optionally include a memory remotely arranged relative to the processor 1101, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0130] It should be noted that more specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0131] Computer readable storage media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, modules of programs or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
[0132] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0133] In the above-described embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. For example, it can be implemented by using an application specific integrated circuit (ASIC), a general-purpose computer or any other similar hardware device. In certain embodiments, the software program of the present application can be executed by a processor to implement the above steps or functions. Similarly, the software program of the present application (including relevant data structures) can be stored in a computer-readable recording medium, for example, a RAM memory, a magnetic or optical drive or a floppy disk and similar devices. In addition, some steps or functions of the present application can be implemented by hardware, for example, as a circuit that cooperates with a processor to perform each step or function.
[0134] The computer program product provided in the embodiment of the present application includes one or more computer programs / instructions, and when the computer program / instructions are executed by the processor, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from a computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.
[0135] The flow chart or block diagram in the accompanying drawings shows the possible architecture, function and operation of the equipment, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated system for hardware that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0136] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily mention changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims, and the above embodiments should be regarded as exemplary and non-restrictive.
Claims
1. A method for training a farming action planning model, characterized in that: include: Acquire historical farming action data and historical environmental monitoring data of the observed farmland during the farming operation process, wherein the historical farming action data includes the farming action type and the farming start time; Combining the historical farming action data and the historical environmental monitoring data into a multi-type data sequence; Based on the multi-type data sequence, outputting the prediction result of the action type and the corresponding start time prediction result of the next agricultural action through the agricultural action planning model; Based on the action type prediction results, the start time prediction results, and the actual action type and actual start time of the next agricultural activity, a loss value is generated through the loss function of the agricultural action planning model, and the agricultural action planning model is updated until convergence to obtain the trained agricultural action planning model.
2. The agricultural action planning model training method according to claim 1, characterized in that: The observed farmland is composed of a plurality of farmland plots. For different farmland plots, the step of forming the historical farming action data and the historical environmental monitoring data into a multi-type data sequence comprises: Define an interaction item representing an agricultural action or an environmental monitoring data record, wherein the interaction item includes: action type, occurrence time and interaction content; For the interactive item representing the historical farming action data, the action type is set as a farming action, and the interactive content is set as a fixed value; For the interaction item representing the historical environmental monitoring data, the action type is set as data observation, and the interaction content is set as data observation value; The interaction items are arranged in the order of occurrence time to generate a multi-type data sequence consisting of various farming actions and environmental monitoring data representing the farmland plot.
3. The agricultural action planning model training method according to claim 2, characterized in that: The farming action planning model includes: an embedding representation module and a multi-behavior mode aggregation module; The step of outputting the action type prediction result and the corresponding start time prediction result of the next agricultural activity based on the multi-type data sequence through the agricultural activity planning model includes: The embedding representation module extracts features of the interaction content and action type of each interaction item of the multi-type data sequence; The multi-behavior pattern aggregation module learns the relationship between each action type and predicts the next farming activity.
4. The agricultural action planning model training method according to claim 3, characterized in that: The embedding representation module includes: an action embedding layer and an item dependency module; The step of extracting features of the interaction content and action type of each interaction item of the multi-type data sequence by the embedding representation module includes: The action embedding layer uses a multi-dimensional vector to represent the action type, occurrence time and interaction content of each interaction item respectively, and fuses the vectors representing the action type, the occurrence time and the interaction content to obtain a first feature vector representing each interaction item; The project dependency module uses a multi-head attention mechanism to segment the first feature vector, calculates the degree of correlation between different interaction items as the attention weight of the attention head, and concatenates the outputs of multiple attention heads and fuses them through linear transformation to obtain a second feature vector that represents the dependency relationship information between different actions.
5. The agricultural action planning model training method according to claim 4, characterized in that: The steps of the multi-behavior mode aggregation module learning the relationship between each action type and predicting the next farming activity include: According to the second feature vector, obtaining information representation generated during the interaction between the action type of different behaviors and the farmland plot, and semantically encoding the information representation to obtain behavior features; Embedding the behavior feature into the aggregation layer, and obtaining a feature representation of the farmland plot through a feature embedding operation, wherein the feature representation of the farmland plot expresses feature information of the multi-type data sequence; An adaptive attention mechanism is introduced into the aggregation layer to predict the action type prediction result and the start time prediction result of the next farming activity based on the feature representation of the farmland plot.
6. The agricultural action planning model training method according to claim 5, characterized in that: The step of the multi-behavior mode aggregation module learning the relationship between the action types and predicting the next farming activity also includes: Based on the feature representation of the farmland plot, the cross-time feature representation generated during the interaction between the action types of different behaviors and the farmland plot is obtained again to simulate the mutual influence between farming actions and environmental monitoring data in the scene of the farmland plot.
7. The agricultural action planning model training method according to claim 1, characterized in that: The loss value includes a first loss value and a second loss value; Generating the loss value includes: Taking the actual action type of the next farming activity as the target action type, calculating the probability value of the predicted farming action type being close to the target action type as the first loss value; Calculating the predicted next agricultural action as a first time difference between the start time of the target action type and the start time of the last agricultural action in the multi-type data sequence; Calculating a second time difference between the actual start time of the next farming action and the start time of the last farming action in the multi-type data sequence; A difference between the first time difference and the second time difference is calculated as a second loss value.
8. A method for planning agricultural activities, characterized in that: include: Obtain historical farming action data and historical environmental monitoring data of the target farmland plot; Inputting the historical farming action data and the historical environmental monitoring data into a pre-trained farming action planning model to obtain the action type and start time of the next farming action output by the farming action planning model, wherein the pre-trained farming action planning model is trained by the farming action planning model training method according to any one of claims 1 to 7; According to the action type and starting time of the next farming activity, assist in formulating the next stage of agricultural production plan for the target farmland.
9. An electronic device, characterized in that: The electronic device comprises: One or more processors; and a memory storing computer program instructions, wherein the computer program instructions, when executed by the processor, implement the steps of the agricultural action planning model training method as described in any one of claims 1 to 7, or implement the steps of the agricultural action planning method as described in claim 8.
10. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by the processor, the steps of the agricultural action planning model training method as described in any one of claims 1 to 7 are implemented, or the steps of the agricultural action planning method as described in claim 8 are implemented.
