Agricultural twinborn model construction method and system based on time series data

Through the method based on time series data, the construction process of agricultural twin models is simplified, the complex problems of existing methods are solved, the accuracy of the model is improved, and the visual display of the numerical evolution of greenhouse land humidity is realized.

CN119830530APending Publication Date: 2025-04-15HEBEI QINXUN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411798816.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

The existing agricultural twin model construction methods are complex and it is difficult to simplify the process without affecting the accuracy of the model.

Method used

Using a time-series data-based method, a top view of the greenhouse land was taken through a camera unit, combined with soil sensor data, and used pretreatment and noise reduction technology to identify the sub-land area, construct an initial map and perform grid operations to generate a soil moisture evolution model.

Benefits of technology

The process of building agricultural twin models is simplified, the accuracy of model construction is improved, and the visual display of the numerical evolution of greenhouse land humidity is realized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119830530A_ABST
    Figure CN119830530A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of agricultural data processing, in particular to an agricultural twinborn model construction method and system based on time series data, and the method comprises the steps: shooting a top view of a greenhouse land through a camera unit, obtaining an initial greenhouse map, carrying out the preprocessing operation of the initial greenhouse map, obtaining a binary image, carrying out the noise reduction operation of the binary image, and obtaining an agricultural twinborn model. The method comprises the steps of obtaining a noise-reduced land image, identifying image areas corresponding to a plurality of sub-land areas in the noise-reduced land image, obtaining a plurality of land image sub-areas and a non-land image area, and obtaining a grid map according to the plurality of land image sub-areas and the non-land image area. Generating a soil humidity evolution model based on the time sequence, the historical data set and the grid map, and completing the construction of the agricultural twinborn model based on the time sequence data based on the soil humidity evolution model. According to the method, the construction process of the agricultural twinborn model can be simplified, and the construction accuracy of the agricultural twinborn model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of agricultural data processing technology, and in particular to a method and system for constructing an agricultural twin model based on time series data. Background Art

[0002] The agricultural twin model is a model that can visualize the agricultural environment, agricultural crops, etc. in real-life scenarios. Analyzing the evolution of parameters during the growth of agricultural crops plays an important role in the subsequent efficient planting of agricultural crops.

[0003] At present, the construction of agricultural twin models is mostly based on sensor data processing methods, especially for soil moisture after irrigation. Sensors are mostly used for detection, and multiple data obtained from the detection are recorded. Multiple data are fitted into curves to realize the parameter evolution during the growth of agricultural crops, or agricultural twin models are intelligently constructed using neural network models.

[0004] Although the above method can realize the parameter evolution during the growth of agricultural crops, the fitting curve cannot express the humidity detected by the soil sensor as intuitively as an image. If the agricultural twin model is constructed intelligently using a neural network model, it is very complicated. Therefore, it is crucial to simplify the process of building the agricultural twin model without affecting the accuracy of the model. Summary of the invention

[0005] The present invention provides a method for constructing an agricultural twin model based on time series data, the main purpose of which is to simplify the process of constructing the agricultural twin model and improve the accuracy of the agricultural twin model construction.

[0006] To achieve the above purpose, the present invention provides a method for constructing an agricultural twin model based on time series data, comprising:

[0007] Greenhouse land is confirmed based on a soil detection environment, wherein the soil detection environment includes: a camera unit, a plurality of soil sensors, and greenhouse land, wherein the plurality of soil sensors are dispersed in the greenhouse land, the greenhouse land includes a plurality of sub-land areas, and the agricultural crops in each of the plurality of sub-land areas are different, and each sub-land area includes at least two soil sensors, and the camera in the camera unit is a binocular camera;

[0008] Using a camera unit to capture a bird's-eye view of the greenhouse land to obtain an initial greenhouse map, and performing a preprocessing operation on the initial greenhouse map to obtain a binary image;

[0009] Performing a denoising operation on the binary image to obtain a denoised land image, identifying image regions corresponding to a plurality of sub-land regions in the denoised land image based on a pre-constructed connected domain algorithm, and obtaining a plurality of land image sub-regions and a non-land image region;

[0010] An initial map is constructed based on the multiple land image sub-regions and non-land image regions, land image sub-regions are sequentially extracted from the initial map, and gridding operations are performed on the extracted land image sub-regions to obtain grid sub-regions, and after confirming that all land image sub-regions in the initial map are grid sub-regions, a grid map is obtained;

[0011] Obtain historical data sets from multiple soil sensors, generate a soil moisture evolution model based on pre-built time series, historical data sets, and grid maps, and complete the construction of an agricultural twin model based on time series data based on the soil moisture evolution model.

[0012] Optionally, performing a preprocessing operation on the initial greenhouse map to obtain a binary image includes:

[0013] Graying the initial greenhouse map to obtain a grayscale image, and performing denoising on the grayscale image using a pre-built Gaussian filter to obtain a denoised image, wherein the convolution kernel size of the Gaussian filter is 4×4;

[0014] Generate a map grayscale histogram based on the denoised image, wherein the abscissa of the map grayscale histogram is the grayscale level, and the ordinate is the number of pixels at the corresponding grayscale level;

[0015] Generate a land grayscale histogram using a pre-constructed soil image, and calculate a land grayscale mean of the soil image according to the land grayscale histogram, wherein the land grayscale mean is the mean of the grayscale values ​​of all pixels in the soil image;

[0016] Extract multiple grayscales whose grayscales are greater than or equal to the grayscale mean of the land from the map grayscale histogram to obtain multiple target grayscales, and extract the number of pixels corresponding to each target grayscale in the multiple target grayscales from the map grayscale histogram to obtain multiple target pixel numbers, and calculate the reference grayscale mean and the reference grayscale standard deviation based on the multiple target pixel numbers and the multiple target grayscales, wherein the calculation formula of the reference grayscale mean is as follows:

[0017]

[0018] in, represents the reference grayscale mean, g i Indicates the i-th target gray level among multiple target gray levels, n irepresents the i-th target pixel number in the multiple target pixel numbers, m represents the total number of target gray levels in the multiple target gray levels, and the target gray level corresponds to the target pixel number one by one;

[0019] The binarization threshold is calculated based on the reference grayscale mean and the reference grayscale standard deviation, and the denoised image is binarized using the binarization threshold to obtain a binarized image, wherein the pixel values ​​of the pixels in the denoised image that are greater than or equal to the binarization threshold are all 255 in the binarized image, and the pixel values ​​of the pixels in the denoised image that are less than the binarization threshold are all 0 in the binarized image, and the binarization threshold is:

[0020]

[0021] Where T represents the binary division threshold, and σ represents the reference grayscale standard deviation.

[0022] Optionally, the pre-constructed connected domain algorithm is used to identify image regions corresponding to a plurality of sub-land regions in the denoised land image, and obtain a plurality of land image sub-regions and non-land image regions, including:

[0023] Acquire multiple sub-land sizes based on multiple sub-land areas, wherein the sub-land sizes correspond to the sub-land areas one by one, and the sub-land sizes are the length×width of the sub-land areas obtained in actual survey;

[0024] Calculate the area of ​​each of the multiple sub-land sizes to obtain multiple sub-land areas, extract the minimum land area and the maximum land area from the multiple sub-land areas, extract camera parameters and distortion coefficients based on the camera unit, and calculate the total number of pixels corresponding to the extracted minimum land area and the maximum land area in the denoised land image based on the camera parameters and the distortion coefficient to obtain the total number of large land pixels and the total number of small land pixels;

[0025] The pixel number interval is constructed with the total number of pixels in the large area as the upper limit of the interval and the total number of pixels in the small area as the lower limit of the interval;

[0026] Based on the connected domain algorithm and the pixel quantity interval, multiple land image sub-regions and non-land image regions are obtained.

[0027] Optionally, the acquiring of a plurality of land image sub-regions and non-land image regions based on a connected domain algorithm and a pixel quantity interval includes:

[0028] The connected domain algorithm is used to extract multiple connected domains from the denoised land image to obtain multiple connected domains to be analyzed. The following operations are performed on each of the multiple connected domains to be analyzed:

[0029] The total number of pixels in the connected domain to be analyzed is obtained. If the total number of pixels in the connected domain is within the pixel quantity interval, the connected domain to be analyzed is identified as a land image sub-region.

[0030] The land image sub-regions are aggregated to obtain a plurality of land image sub-regions, and the image region in the denoised land image except for the image region corresponding to the plurality of land image sub-regions is identified as a non-land image region.

[0031] Optionally, constructing an initial map based on the multiple land image sub-regions and non-land image regions includes:

[0032] The following operations are performed on each of the multiple land image sub-regions:

[0033] Using a pre-constructed maximum inscribed rectangle model to solve the maximum inscribed rectangle of a land image sub-region, obtaining a rectangular image sub-region, obtaining agricultural crops corresponding to the land image sub-region, and identifying the agricultural crops corresponding to the land image sub-region in the rectangular image sub-region to obtain an identified sub-region;

[0034] After confirming that all land image sub-regions in the denoised land image are identification sub-regions, an identification image is obtained, and a basic map is constructed based on the identification image and the non-land image region;

[0035] Soil sensors are extracted from multiple soil sensors in sequence, and the following operations are performed on the extracted soil sensors:

[0036] Obtaining the actual sensor coordinates of the extracted soil sensor in the pre-constructed world coordinate system, calculating the pixel coordinates of the extracted soil sensor in the base map based on the camera parameters and the actual sensor coordinates, and obtaining the image sensor coordinates;

[0037] The image sensor coordinates are aggregated to obtain an image sensor coordinate set, and the image sensor coordinate set is marked in a base map to obtain an initial map.

[0038] Optionally, the method of using a pre-built maximum inscribed rectangle model to solve the maximum inscribed rectangle of the land image sub-region to obtain the rectangular image sub-region includes:

[0039] The boundary point set and the internal area of ​​the boundary of the land image sub-region in the denoised land image are obtained, and the maximum inscribed rectangle of the land image sub-region is solved based on the boundary point set, the internal area of ​​the boundary and the maximum inscribed rectangle model to obtain the rectangular image sub-region, where the maximum inscribed rectangle model is solved as follows:

[0040]

[0041] (y2-y1)(y4-y1)-(x2-x1)(x1-x4)=0

[0042] (y4-y1)(x3-x2)-(y3-y2)(x4-x1)=0

[0043] (y2-y1)(x4-x3)-(y4-y3)(x2-x1)=0

[0044] Among them, S max represents the objective function of the maximum inscribed rectangle model, x1 represents the abscissa of the first rectangle vertex of the maximum inscribed rectangle, y1 represents the ordinate of the first rectangle vertex of the maximum inscribed rectangle, and the coordinate of the first rectangle vertex is (x1, y1), x2 represents the abscissa of the second rectangle vertex of the maximum inscribed rectangle, y2 represents the ordinate of the second rectangle vertex of the maximum inscribed rectangle, and the coordinate of the second rectangle vertex is (x2, y2), x3 represents the abscissa of the third rectangle vertex of the maximum inscribed rectangle, y3 represents the ordinate of the third rectangle vertex of the maximum inscribed rectangle, and the coordinate of the third rectangle vertex is (x3, y3), x4 represents the abscissa of the fourth rectangle vertex of the maximum inscribed rectangle, y4 represents the ordinate of the first rectangle vertex of the maximum inscribed rectangle, and the coordinate of the fourth rectangle vertex is (x4, y4);

[0045] Among them, the first rectangular vertex, the second rectangular vertex, the third rectangular vertex and the fourth rectangular vertex are all in the internal area of ​​the boundary, and any boundary point in the boundary point set is not in the rectangular area formed by the first rectangular vertex, the second rectangular vertex, the third rectangular vertex and the fourth rectangular vertex.

[0046] Optionally, the acquiring of historical data sets of multiple soil sensors includes:

[0047] Extract soil sensors from multiple soil sensors in sequence to obtain target sensors, and perform the following operations on the target sensors:

[0048] Obtain a unit initial data set and a historical detection time of the target sensor, divide the historical detection time according to a detection frequency preset by the target sensor, obtain a historical detection time series, associate the historical detection time series with the unit initial data set, and obtain a humidity time series group set, wherein the humidity time series group set includes multiple humidity time series groups, and the humidity time series group includes: a historical detection time and unit initial data corresponding to the historical detection time, and the multiple humidity time series groups in the humidity time series group set are sorted according to the historical detection time;

[0049] Identify a blank humidity group set in the humidity time series group set, fill the humidity time series group set according to the blank humidity group set, and obtain a complete humidity time series group set, wherein the blank humidity group set includes zero, one or more blank humidity groups, and the blank humidity group is a humidity time series group whose unit initial data is blank;

[0050] Verify the integrity of the complete humidity time series group set. If there is no erroneous data in the complete humidity time series group set, confirm the complete humidity time series group set as the standard historical humidity time series group set. Otherwise, remove all erroneous data in the complete humidity time series group set, and use the complete humidity time series group set after removing all erroneous data as the humidity time series group set. Return to the step of identifying the blank humidity group set in the humidity time series group set until the complete humidity time series group set is confirmed as the standard historical humidity time series group set. Use the target sensor to perform an identification operation on the standard historical humidity time series group set to obtain a unit data set.

[0051] Aggregate the unit datasets to obtain historical datasets of multiple soil sensors.

[0052] Optionally, the step of filling the humidity time sequence set according to the blank humidity set to obtain a complete humidity time sequence set includes:

[0053] If the blank humidity group set is an empty set, the humidity time series group set is confirmed as a complete humidity time series group set;

[0054] Otherwise, perform the following operations for each blank humidity group in the blank humidity group set:

[0055] Extracting multiple adjacent humidity groups based on a blank humidity group and a unit initial data set, extracting multiple humidity values ​​based on the multiple adjacent humidity groups, and fitting the extracted multiple humidity values ​​into a curve equation using a pre-built fitting method to obtain a humidity curve equation, wherein the horizontal axis in the humidity curve equation is continuous time, and the vertical axis is the humidity value;

[0056] Extract the historical detection time in the blank humidity group to obtain the target time, input the target time into the humidity curve equation to obtain the humidity prediction value, and use the humidity prediction value to update the blank humidity group to obtain the complete humidity group;

[0057] After confirming that each blank humidity group in the blank humidity group set is a complete humidity group, a complete humidity group set is obtained, and the humidity time series group set is updated using the complete humidity group set to obtain a complete humidity time series group set.

[0058] Optionally, generating a soil moisture evolution model based on a pre-constructed time series, historical data set, and grid map includes:

[0059] Based on the time series, the target evolution duration is obtained, and the unit data sets are extracted from the historical data sets in sequence. The following operations are performed on the extracted unit data sets:

[0060] Based on the extracted unit data set, the historical detection time is confirmed to obtain the time to be analyzed. If the time to be analyzed is less than the target evolution time, the missing detection point set corresponding to the unit data set is constructed based on the target evolution time and the detection frequency corresponding to the unit data set, and each missing detection point in the missing detection point set is assigned a value of 0 to obtain a corrected data set. If the time to be analyzed is greater than or equal to the target evolution time, all unit data in the unit data set that are outside the target evolution time are eliminated to obtain a corrected data set.

[0061] Aggregate the corrected data sets to obtain multiple corrected data sets;

[0062] Extract target times from the time series in sequence, and perform the following operations on the extracted target times:

[0063] Extracting multiple evolution data groups from multiple correction data sets based on the target time, wherein the evolution data group is a data group consisting of a soil sensor at the target time and a moisture value of a soil sensor at the target time, and the correction data set corresponds to the evolution data group one by one;

[0064] Importing multiple evolution data groups into a grid map to obtain an initial evolution map, wherein the initial evolution map includes multiple true value nodes and multiple prediction nodes, and the true value nodes correspond to the evolution data groups one by one;

[0065] Using a pre-built grid interpolation method, interpolation operations are performed on multiple prediction nodes in the initial evolution map to obtain a map to be colored;

[0066] Extracting node values ​​of multiple real value nodes and multiple predicted nodes from the map to be colored to obtain multiple node values, performing a color normalization operation on the multiple node values ​​to obtain multiple color grayscale values, and performing a colorization operation on the map to be colored based on the multiple color grayscale values ​​and preset colors to obtain a visualized map at a target time;

[0067] The visualization maps are aggregated to obtain a plurality of visualization maps, a sorting operation is performed on the plurality of visualization maps based on a time series to obtain a visualization map sequence, and the visualization map sequence is input into a pre-built evolution model to obtain a soil moisture evolution model.

[0068] To achieve the above purpose, the present invention also provides an agricultural twin model construction system based on time series data, comprising:

[0069] A binary image acquisition module is used to identify greenhouse land based on a soil detection environment, wherein the soil detection environment includes: a camera unit, a plurality of soil sensors, and greenhouse land, wherein the plurality of soil sensors are dispersed in the greenhouse land, the greenhouse land includes a plurality of sub-land areas, and the agricultural crops in each of the plurality of sub-land areas are different, and each sub-land area includes at least two soil sensors, the camera in the camera unit is a binocular camera, and the camera unit is used to shoot a bird's-eye view of the greenhouse land to obtain an initial greenhouse map, and a preprocessing operation is performed on the initial greenhouse map to obtain a binary image;

[0070] An initial map acquisition module is used to perform a noise reduction operation on the binary image to obtain a noise-reduced land image, identify image regions corresponding to a plurality of sub-land regions in the noise-reduced land image based on a pre-constructed connected domain algorithm, obtain a plurality of land image sub-regions and non-land image regions, and construct an initial map based on the plurality of land image sub-regions and non-land image regions;

[0071] A grid map acquisition module is used to extract land image sub-regions from the initial map in sequence, and perform grid operations on the extracted land image sub-regions to obtain grid sub-regions, and after confirming that all land image sub-regions in the initial map are grid sub-regions, obtain a grid map;

[0072] The soil moisture evolution model acquisition module is used to obtain historical data sets of multiple soil sensors, generate a soil moisture evolution model based on pre-built time series, historical data sets and grid maps, and complete the construction of an agricultural twin model based on time series data based on the soil moisture evolution model.

[0073] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:

[0074] a memory storing at least one instruction; and

[0075] A processor executes instructions stored in the memory to implement the above-mentioned method for constructing an agricultural twin model based on time series data.

[0076] In order to solve the above problems, the present invention also provides a computer-readable storage medium, in which at least one instruction is stored. The at least one instruction is executed by a processor in an electronic device to implement the above-mentioned method for constructing an agricultural twin model based on time series data.

[0077] The present invention solves the problems described in the background technology. First, the greenhouse land is confirmed based on the soil detection environment, and the top view of the greenhouse land is photographed by a camera unit to obtain an initial greenhouse map. The initial greenhouse map is preprocessed to obtain a binary image, and the soil image is used as a reference for the grayscale to identify the area where the greenhouse land is located from the initial greenhouse map. The present invention performs a denoising operation on the binary image to obtain a denoised land image, and performs a denoising operation on the binary image using a Gaussian filter, which can effectively remove noise points in the binary image, especially effectively remove white points in the sub-land area of ​​the binary image to obtain a denoised land image. The present invention identifies the image areas corresponding to multiple sub-land areas in the denoised land image based on a pre-constructed connected domain algorithm, obtains multiple land image sub-areas and non-land image areas, constructs an initial map based on the multiple land image sub-areas and non-land image areas, and uses the pixel number interval to screen multiple connected domains in the denoised land image, thereby avoiding the problem of mistakenly identifying agricultural machinery as land image sub-areas and improving the accuracy of initial map construction. The shape of the land image sub-region is simplified using the maximum inscribed rectangle to obtain a rectangular image sub-region. The rectangular image sub-region is used to represent the land image sub-region, which can reduce the amount of calculation for building an agricultural twin model. The present invention obtains historical data sets of multiple soil sensors, generates a soil moisture evolution model based on a pre-constructed time series, historical data set, and grid map, completes the construction of an agricultural twin model based on time series data based on the soil moisture evolution model, and realizes a visual demonstration of the evolution of humidity values ​​in greenhouse land. Therefore, the present invention can simplify the process of building an agricultural twin model and improve the accuracy of building an agricultural twin model. BRIEF DESCRIPTION OF THE DRAWINGS

[0078] Figure 1 A schematic diagram of a flow chart of a method for constructing an agricultural twin model based on time series data provided by an embodiment of the present invention;

[0079] Figure 2 A functional module diagram of an agricultural twin model construction system based on time series data provided by an embodiment of the present invention;

[0080] Figure 3 A schematic diagram of the structure of an electronic device for implementing the method for constructing an agricultural twin model based on time series data provided in one embodiment of the present invention.

[0081] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0082] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0083] The embodiment of the present application provides a method for constructing an agricultural twin model based on time series data. The execution subject of the method for constructing an agricultural twin model based on time series data includes but is not limited to at least one of the electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiment of the present application. In other words, the method for constructing an agricultural twin model based on time series data can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc.

[0084] Reference Figure 1 FIG. 1 is a flow chart of a method for constructing an agricultural twin model based on time series data provided by an embodiment of the present invention. In this embodiment, the method for constructing an agricultural twin model based on time series data includes:

[0085] S1. Confirm the greenhouse land based on the soil testing environment.

[0086] Furthermore, the soil detection environment includes: a camera unit, multiple soil sensors, and greenhouse land, wherein the multiple soil sensors are dispersed in the greenhouse land, the greenhouse land includes multiple sub-land areas, and the agricultural crops in each of the multiple sub-land areas are different, and each sub-land area includes at least two soil sensors, and the camera in the camera unit is a binocular camera.

[0087] It is understandable that in the embodiment of the present invention, the agricultural twin model is constructed by monitoring the evolution of soil moisture in a greenhouse with multiple agricultural crops, so the soil detection environment is a real environment in which the agricultural twin model can be constructed. The greenhouse land is all the land in the greenhouse with multiple agricultural crops.

[0088] It should be noted that the soil sensor is a sensor that can be buried deep in the soil and detect soil moisture in real time. There are many existing sensors that can realize the function of the soil sensor. The embodiment of the present invention does not limit the model of the soil sensor. The sub-land area is a land area where the same agricultural crop is planted. In the embodiment of the present invention, only one agricultural crop is planted in a sub-land area, and different sub-land areas are not connected.

[0089] For example, there is a greenhouse with two plots of land. The agricultural crops on the two plots of land are strawberry and tomato respectively. The sum of the two plots of land is the greenhouse land, and the two plots of land for planting strawberries and tomatoes are two sub-land areas respectively.

[0090] S2. Use a camera unit to capture a bird's-eye view of the greenhouse land to obtain an initial greenhouse map, and perform a preprocessing operation on the initial greenhouse map to obtain a binary image.

[0091] Furthermore, the preprocessing operation is performed on the initial greenhouse map to obtain a binary image, including:

[0092] Graying the initial greenhouse map to obtain a grayscale image, and performing denoising on the grayscale image using a pre-built Gaussian filter to obtain a denoised image, wherein the convolution kernel size of the Gaussian filter is 4×4;

[0093] Generate a map grayscale histogram based on the denoised image, wherein the abscissa of the map grayscale histogram is the grayscale level, and the ordinate is the number of pixels at the corresponding grayscale level;

[0094] Generate a land grayscale histogram using a pre-constructed soil image, and calculate a land grayscale mean of the soil image according to the land grayscale histogram, wherein the land grayscale mean is the mean of the grayscale values ​​of all pixels in the soil image;

[0095] Extract multiple grayscales whose grayscales are greater than or equal to the grayscale mean of the land from the map grayscale histogram to obtain multiple target grayscales, and extract the number of pixels corresponding to each target grayscale in the multiple target grayscales from the map grayscale histogram to obtain multiple target pixel numbers, and calculate the reference grayscale mean and the reference grayscale standard deviation based on the multiple target pixel numbers and the multiple target grayscales, wherein the calculation formula of the reference grayscale mean is as follows:

[0096]

[0097] in, represents the reference grayscale mean, g i Indicates the i-th target gray level among multiple target gray levels, n i represents the i-th target pixel number in the multiple target pixel numbers, m represents the total number of target gray levels in the multiple target gray levels, and the target gray level corresponds to the target pixel number one by one;

[0098] The binarization threshold is calculated based on the reference grayscale mean and the reference grayscale standard deviation, and the denoised image is binarized using the binarization threshold to obtain a binarized image, wherein the pixel values ​​of the pixels in the denoised image that are greater than or equal to the binarization threshold are all 255 in the binarized image, and the pixel values ​​of the pixels in the denoised image that are less than the binarization threshold are all 0 in the binarized image, and the binarization threshold is:

[0099]

[0100] Where T represents the binary division threshold, and σ represents the reference grayscale standard deviation.

[0101] It should be noted that grayscale processing is a prior art and will not be described in detail here. The map grayscale histogram is a grayscale histogram generated based on all grayscale levels in the denoised image. The soil image is an image that only includes soil and is taken by a camera unit, and the soil in the soil image is the same as the soil in the greenhouse land. The land grayscale histogram is a grayscale histogram generated based on the soil image, and the method for obtaining the land grayscale histogram using the soil image is consistent with the step of obtaining the map grayscale histogram using the initial greenhouse map.

[0102] It can be understood that since the steps for obtaining the land grayscale histogram and the map grayscale histogram are consistent, and the soil used in the greenhouse land is the same, the grayscale level in the land grayscale histogram and the grayscale level of the soil in the map grayscale histogram should be basically similar. Therefore, the embodiment of the present invention uses the soil image as a reference for the grayscale level to identify the area where the greenhouse land is located from the initial greenhouse map.

[0103] Furthermore, the reference grayscale standard deviation is the standard deviation of multiple target pixel numbers and multiple target grayscale levels, and the calculation method is prior art and will not be described in detail here.

[0104] It is understandable that the darker the soil color, the smaller the grayscale level in the grayscale histogram, that is, the closer the grayscale level is to 0. This is determined by the fact that when the grayscale value is 0, the pixel is black, and when the grayscale value is 255, the pixel is white. Therefore, in order to make the color corresponding to the greenhouse land in the binary image black and the color corresponding to the non-greenhouse land white, the embodiment of the present invention uses a binary division threshold to binarize the denoised image, and the pixels greater than or equal to the binary division threshold have pixel values ​​255 in the binary image, and the pixels less than the binary division threshold have pixel values ​​0 in the binary image.

[0105] It should be noted that the binarization threshold is a value calculated using the reference grayscale mean of the reference grayscale standard deviation set as a reference, which can retain the grayscale data of the soil in the soil image while further eliminating interference.

[0106] For example, in the greenhouse land, the soil is nutrient soil doped with perlite. The perlite is approximately white, while the soil is approximately black. Therefore, when the soil image is taken, the grayscale corresponding to the soil tends to 0, while the grayscale corresponding to the perlite tends to 255. If the calculated reference grayscale standard deviation is 14, and the reference grayscale mean is 50, the binary division threshold is 92, and the pixel values ​​of pixels with grayscales greater than or equal to 92 are all set to 255, and the pixel values ​​of pixels with grayscales less than 92 are all set to 0, so that in the binary image, the color corresponding to the soil is black, and the color corresponding to the non-soil is white. However, relying solely on this method is easily affected by other debris in the soil detection environment, so that the sub-land area is not completely black in the binary image. For example, the pixels corresponding to perlite are white. At the same time, it may also make other dark objects in non-greenhouse land in the initial greenhouse map appear black in the binary image. Therefore, it is also necessary to reduce the noise of the binary image.

[0107] S3. Perform a denoising operation on the binary image to obtain a denoised land image, identify image regions corresponding to a plurality of sub-land regions in the denoised land image based on a pre-constructed connected domain algorithm, and obtain a plurality of land image sub-regions and non-land image regions.

[0108] For example, in the example corresponding to S2, an example is given in which the pixels corresponding to perlite are white, and the color corresponding to soil is black. Therefore, there will be a phenomenon that multiple white spots exist in the sub-land area in the binary image. Therefore, the binary image needs to be denoised. In an embodiment of the present invention, a Gaussian filter is used to perform a denoising operation on the binary image, which can effectively remove the noise points in the binary image, especially effectively remove the white spots in the sub-land area in the binary image, and obtain a denoised land image.

[0109] Furthermore, the pre-constructed connected domain algorithm identifies image regions corresponding to multiple sub-land regions in the denoised land image, and obtains multiple land image sub-regions and non-land image regions, including:

[0110] Acquire multiple sub-land sizes based on multiple sub-land areas, wherein the sub-land sizes correspond to the sub-land areas one by one, and the sub-land sizes are the length×width of the sub-land areas obtained in actual survey;

[0111] Calculate the area of ​​each of the multiple sub-land sizes to obtain multiple sub-land areas, extract the minimum land area and the maximum land area from the multiple sub-land areas, extract camera parameters and distortion coefficients based on the camera unit, and calculate the total number of pixels corresponding to the extracted minimum land area and the maximum land area in the denoised land image based on the camera parameters and the distortion coefficient to obtain the total number of large land pixels and the total number of small land pixels;

[0112] The pixel number interval is constructed with the total number of pixels in the large area as the upper limit of the interval and the total number of pixels in the small area as the lower limit of the interval;

[0113] Based on the connected domain algorithm and the pixel quantity interval, multiple land image sub-regions and non-land image regions are obtained.

[0114] It is understandable that in the embodiment of the present invention, the size of each of the multiple sub-land areas is not exactly the same, but according to the actual greenhouse construction situation, for the convenience of management, the sizes of different sub-land areas are basically similar, and the sub-land size corresponding to the sub-land area has been determined before the soil detection environment is built. The sub-land area is calculated by multiplying the length of the sub-land area by the width. For example, the sub-land size is 5×1, where 5 is the length of the sub-land area and 1 is the width of the sub-land area, in meters, so the sub-land area is 5 square meters. The minimum land area is the smallest sub-land area in terms of value among the multiple sub-land areas, and the maximum land area is the largest sub-land area in terms of value among the multiple sub-land areas.

[0115] It should be noted that the camera parameters are parameters used to describe the characteristics of the camera and are determined during the camera calibration process. The camera parameters include focal length, principal point coordinates, image size, and pixel size. Through the camera parameters, the coordinates of the three-dimensional world can be converted into pixel coordinates in a two-dimensional image. In the process of imaging by the camera unit, due to the manufacturing error and installation error of the lens of the camera unit itself, the imaging of the camera unit is distorted. The distortion coefficient is used to calculate the extracted minimum and maximum ground areas, which can correct the distortion generated in the imaging process.

[0116] Specifically, the camera unit used in the embodiment of the present invention is a binocular camera. Therefore, according to the imaging principle, camera parameters and distortion coefficient of the binocular camera, the total number of large ground pixels and the total number of small ground pixels can be calculated according to the area of ​​the minimum ground area and the maximum ground area in the initial greenhouse map, wherein, in the de-noised land image, the minimum ground area corresponds to the total number of small ground pixels, and the total number of large ground pixels corresponds to the maximum ground area. The total number of large ground pixels is the total number of pixels corresponding to the maximum ground area in the de-noised land image, and the total number of small ground pixels is the total number of pixels corresponding to the minimum ground area in the de-noised land image.

[0117] Furthermore, the method of obtaining a plurality of land image sub-regions and non-land image regions based on the connected domain algorithm and the pixel quantity interval includes:

[0118] The connected domain algorithm is used to extract multiple connected domains from the denoised land image to obtain multiple connected domains to be analyzed. The following operations are performed on each of the multiple connected domains to be analyzed:

[0119] The total number of pixels in the connected domain to be analyzed is obtained. If the total number of pixels in the connected domain is within the pixel quantity interval, the connected domain to be analyzed is identified as a land image sub-region.

[0120] The land image sub-regions are aggregated to obtain a plurality of land image sub-regions, and the image region in the denoised land image except for the image region corresponding to the plurality of land image sub-regions is identified as a non-land image region.

[0121] It should be noted that the connected domain algorithm is an algorithm for identifying and marking connected domains in an image. The algorithm is a prior art and will not be described in detail here. The total number of pixels in the connected domain is the total number of pixels in the connected domain to be analyzed. The identification operation is to set a label for the connected domain to be analyzed, and the set label is a land image sub-region.

[0122] It can be understood that the embodiment of the present invention uses the pixel number interval to screen multiple connected domains in the denoised land image, identifies the connected domain whose total pixel value is within the pixel number interval as a land image sub-region, and identifies the connected domain whose total pixel value is not within the pixel number interval as a non-land image region, which can effectively distinguish the land image sub-region from the non-land image region in the denoised land image.

[0123] It should be noted that the noise points in the binary image are effectively removed in the denoised land image, especially the white points in the sub-land area of ​​the binary image are effectively removed. However, the black areas retained in the denoised land image are not all areas corresponding to the greenhouse land. This is because in addition to the greenhouse land, there are many agricultural machines used for agricultural operations in the greenhouse. The materials of these agricultural machines are not uniform, and among the commonly used agricultural machines, such as shovels and rakes, there are agricultural machines with grayscales similar to the soil color, so that after the above-mentioned operations of this embodiment, the agricultural machines may still exist in the denoised land image. If these agricultural machines are mistakenly identified as sub-areas of the land image, the initial map constructed based on the denoised land image will be inaccurate. Therefore, the embodiment of the present invention uses the pixel number interval to screen multiple connected domains in the denoised land image.

[0124] S4. Constructing an initial map based on the multiple land image sub-regions and non-land image regions.

[0125] Furthermore, constructing an initial map based on the multiple land image sub-regions and non-land image regions includes:

[0126] The following operations are performed on each of the multiple land image sub-regions:

[0127] Using a pre-constructed maximum inscribed rectangle model to solve the maximum inscribed rectangle of a land image sub-region, obtaining a rectangular image sub-region, obtaining agricultural crops corresponding to the land image sub-region, and identifying the agricultural crops corresponding to the land image sub-region in the rectangular image sub-region to obtain an identified sub-region;

[0128] After confirming that all land image sub-regions in the denoised land image are identification sub-regions, an identification image is obtained, and a basic map is constructed based on the identification image and the non-land image region;

[0129] Soil sensors are extracted from multiple soil sensors in sequence, and the following operations are performed on the extracted soil sensors:

[0130] Obtaining the actual sensor coordinates of the extracted soil sensor in the pre-constructed world coordinate system, calculating the pixel coordinates of the extracted soil sensor in the base map based on the camera parameters and the actual sensor coordinates, and obtaining the image sensor coordinates;

[0131] The image sensor coordinates are aggregated to obtain an image sensor coordinate set, and the image sensor coordinate set is marked in a base map to obtain an initial map.

[0132] It is understandable that the maximum inscribed rectangle model is a model for solving the maximum inscribed rectangle of an irregular closed figure. The identification sub-region is the region obtained by marking the rectangular image sub-region with a label. The identification image is an image after all the land image sub-regions in the denoised land image are identified sub-regions. The difference between the basic map and the identification map is that after confirming that all the land image sub-regions in the denoised land image are identified sub-regions, the pixel values ​​of all pixels in the non-land image area are assigned to 255, that is, in the basic map, all sub-land areas are represented as rectangles, and the pixel values ​​of all pixels in the rectangles are 0, and the pixel values ​​of all pixels in the non-land image area are 255.

[0133] It should be noted that in the greenhouse land, the shape of the sub-land area planned at the beginning of construction is a rectangle, but due to distortion during shooting by the camera unit, influence of light, noise in the image, and errors caused by multiple image processing, all land image sub-areas in the denoised land image are not regular rectangles. The embodiment of the present invention uses gridding to visualize the humidity conditions of the sub-land areas, and in actual use, the measurement and prediction of soil humidity do not need to be accurate to every centimeter or millimeter. Therefore, in the final map corresponding to the agricultural twin model, it is not necessary to be accurate to every pixel. Therefore, in order to simplify the process of constructing the agricultural twin model, the embodiment of the present invention uses the maximum inscribed rectangle to simplify the shape of the land image sub-area to obtain a rectangular image sub-area, and uses the rectangular image sub-area to represent the land image sub-area, which can reduce the amount of calculation for constructing the agricultural twin model.

[0134] It should be noted that the actual sensor coordinates are the coordinates of the soil sensor in the world coordinate system. The world coordinate system is the coordinate system obtained by using the geographic information system in the real scene of the greenhouse. This technology is prior art and will not be repeated here. The image sensor coordinates are the pixel coordinates obtained by mapping the actual sensor coordinates to the base map using the camera parameters in the camera unit. In the embodiment of the present invention, a binocular camera is used. Using a binocular camera to convert the coordinates in the world coordinate system into the pixel coordinates in the image is a prior art and is consistent with the technology of converting the actual sensor coordinates into the image sensor coordinates. It will not be repeated here.

[0135] It can be understood that identifying the image sensor coordinate set is: extracting the image sensor coordinates from the image sensor coordinate set in sequence, identifying the soil sensor corresponding to the image sensor coordinates, obtaining the unique identifier of the soil sensor corresponding to the image sensor coordinates, and using the unique identifier as a label to identify the image sensor coordinates. Therefore, there are multiple identified image sensor coordinates in the initial map.

[0136] Furthermore, the method of using the pre-built maximum inscribed rectangle model to solve the maximum inscribed rectangle of the land image sub-region to obtain the rectangular image sub-region includes:

[0137] The boundary point set and the internal area of ​​the boundary of the land image sub-region in the denoised land image are obtained, and the maximum inscribed rectangle of the land image sub-region is solved based on the boundary point set, the internal area of ​​the boundary and the maximum inscribed rectangle model to obtain the rectangular image sub-region, where the maximum inscribed rectangle model is solved as follows:

[0138]

[0139] (y2-y1)(y4-y1)-(x2-x1)(x1-x4)=0

[0140] (y4-y1)(x3-x2)-(y3-y2)(x4-x1)=0

[0141] (y2-y1)(x4-x3)-(y4-y3)(x2-x1)=0

[0142] Among them, S max represents the objective function of the maximum inscribed rectangle model, x1 represents the abscissa of the first rectangle vertex of the maximum inscribed rectangle, y1 represents the ordinate of the first rectangle vertex of the maximum inscribed rectangle, and the coordinate of the first rectangle vertex is (x1, y1), x2 represents the abscissa of the second rectangle vertex of the maximum inscribed rectangle, y2 represents the ordinate of the second rectangle vertex of the maximum inscribed rectangle, and the coordinate of the second rectangle vertex is (x2, y2), x3 represents the abscissa of the third rectangle vertex of the maximum inscribed rectangle, y3 represents the ordinate of the third rectangle vertex of the maximum inscribed rectangle, and the coordinate of the third rectangle vertex is (x3, y3), x4 represents the abscissa of the fourth rectangle vertex of the maximum inscribed rectangle, y4 represents the ordinate of the first rectangle vertex of the maximum inscribed rectangle, and the coordinate of the fourth rectangle vertex is (x4, y4);

[0143] Among them, the first rectangular vertex, the second rectangular vertex, the third rectangular vertex and the fourth rectangular vertex are all in the internal area of ​​the boundary, and any boundary point in the boundary point set is not in the rectangular area formed by the first rectangular vertex, the second rectangular vertex, the third rectangular vertex and the fourth rectangular vertex.

[0144] It is understandable that the boundary point set is a set constructed by the pixel coordinates of all boundary points of the land image sub-region in the denoised land image. The boundary internal area is the internal area of ​​the closed area formed by the boundary point set. In the embodiment of the present invention, there is no order between the first rectangular vertex, the second rectangular vertex, the third rectangular vertex and the fourth rectangular vertex, and they are only used to distinguish the four vertices of the largest inscribed rectangle. The interior of the rectangular area formed by the first rectangular vertex, the second rectangular vertex, the third rectangular vertex and the fourth rectangular vertex is: the rectangle formed by the first rectangular vertex, the second rectangular vertex, the third rectangular vertex and the fourth rectangular vertex is a closed area, and the interior of the closed area of ​​this rectangle is the interior of the rectangular area formed by the first rectangular vertex, the second rectangular vertex, the third rectangular vertex and the fourth rectangular vertex.

[0145] It should be noted that the coordinates of the boundary point set, the first rectangular vertex, the second rectangular vertex, the third rectangular vertex and the fourth rectangular vertex in the embodiment of the present invention are all coordinates in the image coordinate system corresponding to the denoised land image, and the construction of the image coordinate system is a prior art and will not be repeated here.

[0146] S5. Extracting land image sub-regions from the initial map in sequence, and performing gridding operations on the extracted land image sub-regions to obtain grid sub-regions, and after confirming that all land image sub-regions in the initial map are grid sub-regions, obtaining a grid map.

[0147] It is understandable that the gridding method in performing the gridding operation is a prior art. Optionally, a rasterization method is used to perform the gridding operation on the extracted land image sub-region, which will not be described in detail here.

[0148] S6. Obtain historical data sets from multiple soil sensors, generate a soil moisture evolution model based on the pre-built time series, historical data sets and grid maps, and complete the construction of an agricultural twin model based on time series data based on the soil moisture evolution model.

[0149] Furthermore, the acquisition of historical data sets of multiple soil sensors includes:

[0150] Extract soil sensors from multiple soil sensors in sequence to obtain target sensors, and perform the following operations on the target sensors:

[0151] Obtain a unit initial data set and a historical detection time of the target sensor, divide the historical detection time according to a detection frequency preset by the target sensor, obtain a historical detection time series, associate the historical detection time series with the unit initial data set, and obtain a humidity time series group set, wherein the humidity time series group set includes multiple humidity time series groups, and the humidity time series group includes: a historical detection time and unit initial data corresponding to the historical detection time, and the multiple humidity time series groups in the humidity time series group set are sorted according to the historical detection time;

[0152] Identify a blank humidity group set in the humidity time series group set, fill the humidity time series group set according to the blank humidity group set, and obtain a complete humidity time series group set, wherein the blank humidity group set includes zero, one or more blank humidity groups, and the blank humidity group is a humidity time series group whose unit initial data is blank;

[0153] Verify the integrity of the complete humidity time series group set. If there is no erroneous data in the complete humidity time series group set, confirm the complete humidity time series group set as the standard historical humidity time series group set. Otherwise, remove all erroneous data in the complete humidity time series group set, and use the complete humidity time series group set after removing all erroneous data as the humidity time series group set. Return to the step of identifying the blank humidity group set in the humidity time series group set until the complete humidity time series group set is confirmed as the standard historical humidity time series group set. Use the target sensor to perform an identification operation on the standard historical humidity time series group set to obtain a unit data set.

[0154] Aggregate the unit datasets to obtain historical datasets of multiple soil sensors.

[0155] It should be noted that the historical detection duration is the sum of the usage duration of the target sensor after it is put into use, and the detection frequency is the frequency at which the target sensor collects soil moisture. The unit initial data set is a set of unit initial data obtained by the target sensor detecting humidity, and the unit initial data in the embodiment of the present invention is a humidity value.

[0156] Exemplary, for ease of understanding, assume that the historical detection duration is 10 days, and these 10 days are from January 1st to January 10th, the detection frequency is once every 24 hours, and the time of the first detection is 0:00 on January 1st, then the historical detection time series is: [1-1-0:00, 1-2-0:00, 1-3-0:00, 1-4-0:00, 1-5-0:00, 1-6-0:00, 1-7-0:00, 1-8-0:00, 1-9-0:00, 1-10-0:00]. The historical detection time series is associated with the unit initial data set to obtain the humidity time series group set. If the unit initial data set is: [a, b, c, d, e, f, g, h, i, j], and each unit initial data in the unit initial data set is a humidity value, then the humidity time series group set is: [1-1-0:00-a, 1-2-0:00-b, 1-3-0:00-c, 1-4-0:00-d, 1-5-0:00-e, 1-6-0:00-f, 1-7-0:00-g, 1-8-0:00-h, 1-9-0:00-i, 1-10-0:00-j], among which 1-1-0:00-a is a humidity time series group, and the corresponding historical detection time is 1-1-0:00, that is, 0:00 on January 1, and the unit initial data corresponding to the historical detection time is a.

[0157] It should be noted that the blank humidity group set is a set of humidity time series groups with missing data in the humidity time series group set. For example, in the humidity time series group set [1-1-0:00-a, 1-2-0:00-b, 1-3-0:00-c, 1-4-0:00-d, 1-5-0:00-e, 1-6-0:00-f, 1-7-0:00-g, 1-8-0:00-h, 1-9-0:00-i, 1-10-0:00-j], there is a humidity time series group with zero missing data. , then the blank humidity group set corresponding to the humidity time series group set at this time is an empty set. If the humidity time series group set is [1-1-0:00-NaN, 1-2-0:00-b, 1-3-0:00-c, 1-4-0:00-d, 1-5-0:00-e, 1-6-0:00-f, 1-7-0:00-g, 1-8-0:00-h, 1-9-0:00-NaN, 1-10-0:00-j], there are two humidity time series groups with missing data, that is, the blank humidity group set is:

[0158] [1-1-0:00-NaN, 1-9-0:00-NaN], then it is necessary to complete the missing blank humidity group set in the humidity time series group set, so that the blank humidity group set corresponding to the completed humidity time series group set is an empty set, and a complete humidity time series group set is obtained.

[0159] Further, the integrity of the complete humidity time series group set is verified to verify whether there is erroneous data in the complete humidity time series group set. The erroneous data refers to data with spelling errors, format errors or abnormal values. For example, if the complete humidity time series group set is [1-1-0:00-surprise!, 1-2-0:00-b, 1-3-0:00-c], [1-1-0:00-surprise!] includes both spelling errors and format errors. Therefore, [1-1-0:00-surprise!] is erroneous data, so it is necessary to remove "surprise!" from [1-1-0:00-surprise!]. The complete humidity time series group set after removing the erroneous data is: [1-1-0:00-NaN, 1-2-0:00-b, 1-3-0:00-c]. In the embodiment of the present invention, an outlier is defined as: the unit initial data in the humidity time series group exceeds the error interval. There are many existing technologies that can be used to identify and eliminate outliers, such as the interquartile range method, etc., which will not be described in detail here.

[0160] It should be noted that the method for performing the identification operation on the standard historical humidity time series set is: identifying the unique identifier of the soil sensor corresponding to the target sensor, using the unique identifier as a label to identify the standard historical humidity time series set. Therefore, the standard historical humidity time series set corresponding to the soil sensor can be extracted from the historical data set according to the unique identifier of the soil sensor, and the image sensor coordinates corresponding to the soil sensor can also be confirmed from the initial map according to the unique identifier of the soil sensor, so as to facilitate the association of the standard historical humidity time series set of the same soil sensor with the image sensor coordinates, thereby establishing a visualized soil humidity evolution model.

[0161] Furthermore, the step of filling the humidity time sequence set according to the blank humidity set to obtain a complete humidity time sequence set includes:

[0162] If the blank humidity group set is an empty set, the humidity time series group set is confirmed as a complete humidity time series group set;

[0163] Otherwise, perform the following operations for each blank humidity group in the blank humidity group set:

[0164] Extracting multiple adjacent humidity groups based on a blank humidity group and a unit initial data set, extracting multiple humidity values ​​based on the multiple adjacent humidity groups, and fitting the extracted multiple humidity values ​​into a curve equation using a pre-built fitting method to obtain a humidity curve equation, wherein the horizontal axis in the humidity curve equation is continuous time, and the vertical axis is the humidity value;

[0165] Extract the historical detection time in the blank humidity group to obtain the target time, input the target time into the humidity curve equation to obtain the humidity prediction value, and use the humidity prediction value to update the blank humidity group to obtain the complete humidity group;

[0166] After confirming that each blank humidity group in the blank humidity group set is a complete humidity group, a complete humidity group set is obtained, and the humidity time series group set is updated using the complete humidity group set to obtain a complete humidity time series group set.

[0167] It is understandable that the humidity in the greenhouse land changes periodically. This is because after the moisture in the soil is absorbed, the greenhouse land needs to be irrigated. Therefore, in the historical detection time, the unit initial data set does not change monotonically. Therefore, when interpolating the unit initial data in the blank humidity group, it is necessary to intercept multiple adjacent humidity groups in a cycle for interpolation. The adjacent humidity group is a humidity time series group adjacent to the blank humidity group. The fitting method is a prior art, such as polynomial fitting, etc., which will not be repeated here.

[0168] For example, there is a blank humidity group in the humidity time series group set, and the unit initial data set corresponding to the humidity time series group set is: [100, 90, NaN, 70, 60, 50, 150, 141, 134, 120, 110]. It can be judged from the pre-built irrigation system that an irrigation was performed at the unit initial data 150. Therefore, the multiple humidity values ​​of multiple adjacent humidity groups corresponding to the blank humidity group are: [100, 90, 70, 60, 50]. The humidity curve equation is obtained using multiple humidity values. After the target time corresponding to the blank humidity group is input into the humidity curve equation, the humidity prediction value obtained is 80. Then, 80 is used to replace the missing humidity value in the blank humidity group to obtain a complete humidity group.

[0169] Specifically, the complete humidity group set is used to replace the blank humidity group set in the humidity time sequence group set to obtain the complete humidity time sequence group set, that is, any blank humidity group cannot be identified in the complete humidity time sequence group set.

[0170] Furthermore, the generation of a soil moisture evolution model based on a pre-constructed time series, historical data set, and grid map includes:

[0171] Based on the time series, the target evolution duration is obtained, and the unit data sets are extracted from the historical data sets in sequence. The following operations are performed on the extracted unit data sets:

[0172] Based on the extracted unit data set, the historical detection time is confirmed to obtain the time to be analyzed. If the time to be analyzed is less than the target evolution time, the missing detection point set corresponding to the unit data set is constructed based on the target evolution time and the detection frequency corresponding to the unit data set, and each missing detection point in the missing detection point set is assigned a value of 0 to obtain a corrected data set. If the time to be analyzed is greater than or equal to the target evolution time, all unit data in the unit data set that are outside the target evolution time are eliminated to obtain a corrected data set.

[0173] Aggregate the corrected data sets to obtain multiple corrected data sets;

[0174] Extract target times from the time series in sequence, and perform the following operations on the extracted target times:

[0175] Extracting multiple evolution data groups from multiple correction data sets based on the target time, wherein the evolution data group is a data group consisting of a soil sensor at the target time and a moisture value of a soil sensor at the target time, and the correction data set corresponds to the evolution data group one by one;

[0176] Importing multiple evolution data groups into a grid map to obtain an initial evolution map, wherein the initial evolution map includes multiple true value nodes and multiple prediction nodes, and the true value nodes correspond to the evolution data groups one by one;

[0177] Using a pre-built grid interpolation method, interpolation operations are performed on multiple prediction nodes in the initial evolution map to obtain a map to be colored;

[0178] Extracting node values ​​of multiple real value nodes and multiple predicted nodes from the map to be colored to obtain multiple node values, performing a color normalization operation on the multiple node values ​​to obtain multiple color grayscale values, and performing a colorization operation on the map to be colored based on the multiple color grayscale values ​​and preset colors to obtain a visualized map at a target time;

[0179] The visualization maps are aggregated to obtain a plurality of visualization maps, a sorting operation is performed on the plurality of visualization maps based on a time series to obtain a visualization map sequence, and the visualization map sequence is input into a pre-built evolution model to obtain a soil moisture evolution model.

[0180] It can be understood that the target evolution duration is the corresponding time length in the time series.

[0181] Exemplarily, the target evolution time is 5 days, and the 5 days are January 5, January 6, January 7, January 8, and January 9 respectively. The detection frequency is once every 24 hours. The historical detection time is 3 days, namely January 7, January 8, and January 9. The corresponding unit data sets are: [1-7-0:00-80, 1-8-0:00-70, 1-9-0:00-60]. That is to say, the historical detection time is shorter than the target evolution time. Therefore, the missing detection points corresponding to the missing detection point set should be the points where data needs to be supplemented in the historical detection time, that is, January 5 and January 6. Assign the unit initial data corresponding to January 5 and January 6 to 0, then the revised data set is: [1-5-0:00-0, 1-6-0:00-0, 1-7-0:00-80, 1-8-0:00-70, 1-9-0:00-60], which corresponds to January 5, January 6, January 7, January 8, and January 9.

[0182] It should be noted that each of the multiple corrected data sets corresponds to a soil sensor one by one. At the target time, the humidity value of each of the multiple soil sensors is extracted, and the data composed of the extracted soil sensors and the humidity values ​​is the evolution data set. The true value node is the node corresponding to the soil sensor in the initial evolution map, and the predicted node is the node corresponding to the image sensor coordinates where the non-soil sensor is located in the grid map.

[0183] It is understandable that the grid interpolation method is a method for calculating the humidity value of each prediction node in a plurality of prediction nodes. In order to ensure the accuracy of soil sensor detection of soil humidity, at least one soil sensor is included in the area that can be directly sprayed in the pre-constructed irrigation system. Optionally, in an embodiment of the present invention, if the soil sensor is in the area that can be directly sprayed in the pre-constructed irrigation system, the humidity values ​​of all prediction nodes in the direct spraying area are consistent with the humidity values ​​in the corresponding evolution data group of the soil sensor. Outside the direct spraying area, the prediction nodes are predicted using existing technologies such as spline interpolation method.

[0184] It should be noted that the node values ​​are humidity traces corresponding to multiple real value nodes or multiple predicted nodes, and the color normalization operation is to normalize the multiple node values ​​to the range of [0, 255], and then perform colorization operations on the colorized map using preset colors according to multiple color grayscale values. For example, if the preset color is blue, when converting multiple color grayscale values ​​to RGB, the red channel is 0, the green channel is 0, and the blue channel value is the color grayscale value, so that the colorized map is subjected to colorization operations to obtain a visualized map. The specific implementation steps are prior art and will not be repeated here.

[0185] It can be understood that the evolution model is a three-dimensional model established based on the real scene of the greenhouse. After the visualization map sequence is input into the evolution model, the evolution of the humidity values ​​in the greenhouse land can be visualized. The soil moisture evolution model can intuitively demonstrate the evolution of the humidity values ​​in the greenhouse land according to the time series.

[0186] The present invention solves the problems described in the background technology. First, the greenhouse land is confirmed based on the soil detection environment, and the top view of the greenhouse land is photographed by a camera unit to obtain an initial greenhouse map. The initial greenhouse map is preprocessed to obtain a binary image, and the soil image is used as a reference for the grayscale to identify the area where the greenhouse land is located from the initial greenhouse map. The present invention performs a denoising operation on the binary image to obtain a denoised land image, and performs a denoising operation on the binary image using a Gaussian filter, which can effectively remove noise points in the binary image, especially effectively remove white points in the sub-land area of ​​the binary image to obtain a denoised land image. The present invention identifies the image areas corresponding to multiple sub-land areas in the denoised land image based on a pre-constructed connected domain algorithm, obtains multiple land image sub-areas and non-land image areas, constructs an initial map based on the multiple land image sub-areas and non-land image areas, and uses the pixel number interval to screen multiple connected domains in the denoised land image, thereby avoiding the problem of mistakenly identifying agricultural machinery as land image sub-areas and improving the accuracy of initial map construction. And the shape of the land image sub-region is simplified using the maximum inscribed rectangle to obtain a rectangular image sub-region. The rectangular image sub-region is used to represent the land image sub-region, which can reduce the amount of calculation for building an agricultural twin model. The present invention obtains historical data sets of multiple soil sensors, generates a soil moisture evolution model based on a pre-constructed time series, historical data set and grid map, completes the construction of an agricultural twin model based on time series data based on the soil moisture evolution model, realizes a visual demonstration of the evolution of humidity values ​​in greenhouse land, and can intuitively demonstrate the evolution of humidity values ​​in greenhouse land. Therefore, the present invention can simplify the process of building an agricultural twin model and improve the accuracy of building an agricultural twin model.

[0187] like Figure 2 As shown, it is a functional module diagram of an agricultural twin model construction system based on time series data provided by one embodiment of the present invention.

[0188] The agricultural twin model construction system 100 based on time series data of the present invention can be installed in an electronic device. According to the functions implemented, the agricultural twin model construction system 100 based on time series data can include a binary image acquisition module 101, an initial map acquisition module 102, a grid map acquisition module 103 and a soil moisture evolution model acquisition module 104. The module of the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.

[0189] The binary image acquisition module 101 is used to identify the greenhouse land based on the soil detection environment, wherein the soil detection environment includes: a camera unit, a plurality of soil sensors, and a greenhouse land, wherein the plurality of soil sensors are dispersed in the greenhouse land, the greenhouse land includes a plurality of sub-land areas, and the agricultural crops in each of the plurality of sub-land areas are different, and each sub-land area includes at least two soil sensors, the camera in the camera unit is a binocular camera, and the camera unit is used to shoot a bird's-eye view of the greenhouse land to obtain an initial greenhouse map, and a preprocessing operation is performed on the initial greenhouse map to obtain a binary image;

[0190] The initial map acquisition module 102 is used to perform a noise reduction operation on the binary image to obtain a noise-reduced land image, identify image regions corresponding to a plurality of sub-land regions in the noise-reduced land image based on a pre-constructed connected domain algorithm, obtain a plurality of land image sub-regions and non-land image regions, and construct an initial map based on the plurality of land image sub-regions and non-land image regions;

[0191] The grid map acquisition module 103 is used to extract land image sub-regions from the initial map in sequence, and perform gridding operations on the extracted land image sub-regions to obtain grid sub-regions, and obtain a grid map after confirming that all land image sub-regions in the initial map are grid sub-regions;

[0192] The soil moisture evolution model acquisition module 104 is used to acquire historical data sets of multiple soil sensors, generate a soil moisture evolution model based on pre-constructed time series, historical data sets and grid maps, and complete the construction of an agricultural twin model based on time series data based on the soil moisture evolution model.

[0193] In detail, each module in the agricultural twin model construction system 100 based on time series data in the embodiment of the present invention is used in the same manner as above. Figure 1 The technical means are the same as the method for building an agricultural twin model based on time series data described in , and can produce the same technical effects, so I will not go into details here.

[0194] like Figure 3 The figure is a schematic diagram of the structure of an electronic device for implementing a method for constructing an agricultural twin model based on time series data provided by one embodiment of the present invention.

[0195] The electronic device 1 may include a processor 10, a memory 11 and a bus 12, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a method program for constructing an agricultural twin model based on time series data.

[0196] Among them, the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of the electronic device 1, such as a mobile hard disk of the electronic device 1. In other embodiments, the memory 11 can also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Further, the memory 11 also includes an internal storage unit of the electronic device 1 and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device 1, such as the code of the agricultural twin model construction method program based on time series data, but also can be used to temporarily store data that has been output or is to be output.

[0197] The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or a plurality of integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect the various components of the entire electronic device, and executes or executes the programs or modules stored in the memory 11 (such as the agricultural twin model construction method program based on time series data, etc.), and calls the data stored in the memory 11 to execute various functions of the electronic device 1 and process data.

[0198] The bus 12 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus 12 may be divided into an address bus, a data bus, a control bus, etc. The bus 12 is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.

[0199] Figure 3 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 3 The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0200] For example, although not shown, the electronic device 1 may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, etc. The electronic device 1 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

[0201] Furthermore, the electronic device 1 may also include a network interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device 1 and other electronic devices.

[0202] Optionally, the electronic device 1 may further include a user interface, which may be a display, an input unit (such as a keyboard), or a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device 1 and to display a visual user interface.

[0203] The agricultural twin model construction method program based on time series data stored in the memory 11 of the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can achieve:

[0204] Greenhouse land is confirmed based on a soil detection environment, wherein the soil detection environment includes: a camera unit, a plurality of soil sensors, and greenhouse land, wherein the plurality of soil sensors are dispersed in the greenhouse land, the greenhouse land includes a plurality of sub-land areas, and the agricultural crops in each of the plurality of sub-land areas are different, and each sub-land area includes at least two soil sensors, and the camera in the camera unit is a binocular camera;

[0205] Using a camera unit to capture a bird's-eye view of the greenhouse land to obtain an initial greenhouse map, and performing a preprocessing operation on the initial greenhouse map to obtain a binary image;

[0206] Performing a denoising operation on the binary image to obtain a denoised land image, identifying image regions corresponding to a plurality of sub-land regions in the denoised land image based on a pre-constructed connected domain algorithm, and obtaining a plurality of land image sub-regions and a non-land image region;

[0207] An initial map is constructed based on the multiple land image sub-regions and non-land image regions, land image sub-regions are sequentially extracted from the initial map, and gridding operations are performed on the extracted land image sub-regions to obtain grid sub-regions, and after confirming that all land image sub-regions in the initial map are grid sub-regions, a grid map is obtained;

[0208] Obtain historical data sets from multiple soil sensors, generate a soil moisture evolution model based on pre-built time series, historical data sets, and grid maps, and complete the construction of an agricultural twin model based on time series data based on the soil moisture evolution model.

[0209] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to Figures 1 to 3 The description of the relevant steps in the corresponding embodiments will not be repeated here.

[0210] Furthermore, if the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).

[0211] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program can implement:

[0212] Greenhouse land is confirmed based on a soil detection environment, wherein the soil detection environment includes: a camera unit, a plurality of soil sensors, and greenhouse land, wherein the plurality of soil sensors are dispersed in the greenhouse land, the greenhouse land includes a plurality of sub-land areas, and the agricultural crops in each of the plurality of sub-land areas are different, and each sub-land area includes at least two soil sensors, and the camera in the camera unit is a binocular camera;

[0213] Using a camera unit to capture a bird's-eye view of the greenhouse land to obtain an initial greenhouse map, and performing a preprocessing operation on the initial greenhouse map to obtain a binary image;

[0214] Performing a denoising operation on the binary image to obtain a denoised land image, identifying image regions corresponding to a plurality of sub-land regions in the denoised land image based on a pre-constructed connected domain algorithm, and obtaining a plurality of land image sub-regions and a non-land image region;

[0215] An initial map is constructed based on the multiple land image sub-regions and non-land image regions, land image sub-regions are sequentially extracted from the initial map, and gridding operations are performed on the extracted land image sub-regions to obtain grid sub-regions, and after confirming that all land image sub-regions in the initial map are grid sub-regions, a grid map is obtained;

[0216] Obtain historical data sets from multiple soil sensors, generate a soil moisture evolution model based on pre-built time series, historical data sets, and grid maps, and complete the construction of an agricultural twin model based on time series data based on the soil moisture evolution model.

[0217] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, systems and methods can be implemented in other ways. For example, the system embodiments described above are only illustrative, and actual implementation may have other division methods.

[0218] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0219] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0220] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0221] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. A method for constructing an agricultural twin model based on time series data, characterized in that: The method comprises: Greenhouse land is confirmed based on a soil detection environment, wherein the soil detection environment includes: a camera unit, a plurality of soil sensors, and greenhouse land, wherein the plurality of soil sensors are dispersed in the greenhouse land, the greenhouse land includes a plurality of sub-land areas, and the agricultural crops in each of the plurality of sub-land areas are different, and each sub-land area includes at least two soil sensors, and the camera in the camera unit is a binocular camera; Using a camera unit to capture a bird's-eye view of the greenhouse land to obtain an initial greenhouse map, and performing a preprocessing operation on the initial greenhouse map to obtain a binary image; Performing a denoising operation on the binary image to obtain a denoised land image, identifying image regions corresponding to a plurality of sub-land regions in the denoised land image based on a pre-constructed connected domain algorithm, and obtaining a plurality of land image sub-regions and a non-land image region; An initial map is constructed based on the multiple land image sub-regions and non-land image regions, land image sub-regions are sequentially extracted from the initial map, and gridding operations are performed on the extracted land image sub-regions to obtain grid sub-regions, and after confirming that all land image sub-regions in the initial map are grid sub-regions, a grid map is obtained; Obtain historical data sets from multiple soil sensors, generate a soil moisture evolution model based on pre-built time series, historical data sets, and grid maps, and complete the construction of an agricultural twin model based on time series data based on the soil moisture evolution model.

2. The method for constructing an agricultural twin model based on time series data according to claim 1, characterized in that: The preprocessing operation is performed on the initial greenhouse map to obtain a binary image, including: Graying the initial greenhouse map to obtain a grayscale image, and performing denoising on the grayscale image using a pre-built Gaussian filter to obtain a denoised image, wherein the convolution kernel size of the Gaussian filter is 4×4; Generate a map grayscale histogram based on the denoised image, wherein the horizontal axis of the map grayscale histogram is the grayscale level, and the vertical axis is the number of pixels at the corresponding grayscale level; Generate a land grayscale histogram using a pre-constructed soil image, and calculate a land grayscale mean of the soil image according to the land grayscale histogram, wherein the land grayscale mean is the mean of the grayscale values ​​of all pixels in the soil image; Extract multiple grayscales whose grayscales are greater than or equal to the grayscale mean of the land from the map grayscale histogram to obtain multiple target grayscales, and extract the number of pixels corresponding to each target grayscale in the multiple target grayscales from the map grayscale histogram to obtain multiple target pixel numbers, and calculate the reference grayscale mean and the reference grayscale standard deviation based on the multiple target pixel numbers and the multiple target grayscales, wherein the calculation formula of the reference grayscale mean is as follows: in, represents the reference grayscale mean, g i Indicates the i-th target gray level among multiple target gray levels, n i represents the i-th target pixel number in the multiple target pixel numbers, m represents the total number of target gray levels in the multiple target gray levels, and the target gray level corresponds to the target pixel number one by one; The binarization threshold is calculated based on the reference grayscale mean and the reference grayscale standard deviation, and the denoised image is binarized using the binarization threshold to obtain a binarized image, wherein the pixel values ​​of the pixels in the denoised image that are greater than or equal to the binarization threshold are all 255 in the binarized image, and the pixel values ​​of the pixels in the denoised image that are less than the binarization threshold are all 0 in the binarized image, and the binarization threshold is: Where T represents the binary division threshold, and σ represents the reference grayscale standard deviation.

3. The method for constructing an agricultural twin model based on time series data according to claim 2, characterized in that: The pre-constructed connected domain algorithm is used to identify image regions corresponding to multiple sub-land regions in the denoised land image, and obtain multiple land image sub-regions and non-land image regions, including: Acquire multiple sub-land sizes based on multiple sub-land areas, wherein the sub-land sizes correspond to the sub-land areas one by one, and the sub-land sizes are the length×width of the sub-land areas obtained in actual survey; Calculate the area of ​​each of the multiple sub-land sizes to obtain multiple sub-land areas, extract the minimum land area and the maximum land area from the multiple sub-land areas, extract camera parameters and distortion coefficients based on the camera unit, and calculate the total number of pixels corresponding to the extracted minimum land area and the maximum land area in the denoised land image based on the camera parameters and the distortion coefficient to obtain the total number of large land pixels and the total number of small land pixels; The pixel number interval is constructed with the total number of pixels in the large area as the upper limit of the interval and the total number of pixels in the small area as the lower limit of the interval; Based on the connected domain algorithm and the pixel quantity interval, multiple land image sub-regions and non-land image regions are obtained.

4. The method for constructing an agricultural twin model based on time series data according to claim 3, characterized in that: The method of obtaining a plurality of land image sub-regions and non-land image regions based on a connected domain algorithm and a pixel quantity interval includes: The connected domain algorithm is used to extract multiple connected domains from the denoised land image to obtain multiple connected domains to be analyzed. The following operations are performed on each of the multiple connected domains to be analyzed: The total number of pixels in the connected domain to be analyzed is obtained. If the total number of pixels in the connected domain is within the pixel quantity interval, the connected domain to be analyzed is identified as a land image sub-region. The land image sub-regions are aggregated to obtain a plurality of land image sub-regions, and the image region in the denoised land image except for the image region corresponding to the plurality of land image sub-regions is identified as a non-land image region.

5. The method for constructing an agricultural twin model based on time series data according to claim 4, characterized in that: The constructing of the initial map based on the plurality of land image sub-regions and the non-land image region comprises: The following operations are performed on each of the multiple land image sub-regions: Using a pre-constructed maximum inscribed rectangle model to solve the maximum inscribed rectangle of a land image sub-region, obtaining a rectangular image sub-region, obtaining agricultural crops corresponding to the land image sub-region, and identifying the agricultural crops corresponding to the land image sub-region in the rectangular image sub-region to obtain an identified sub-region; After confirming that all land image sub-regions in the denoised land image are identification sub-regions, an identification image is obtained, and a basic map is constructed based on the identification image and the non-land image region; Soil sensors are extracted from multiple soil sensors in sequence, and the following operations are performed on the extracted soil sensors: Obtaining the actual sensor coordinates of the extracted soil sensor in the pre-constructed world coordinate system, calculating the pixel coordinates of the extracted soil sensor in the base map based on the camera parameters and the actual sensor coordinates, and obtaining the image sensor coordinates; The image sensor coordinates are aggregated to obtain an image sensor coordinate set, and the image sensor coordinate set is marked in a base map to obtain an initial map.

6. The method for constructing an agricultural twin model based on time series data according to claim 5, characterized in that: The method of using the pre-built maximum inscribed rectangle model to solve the maximum inscribed rectangle of the land image sub-region to obtain the rectangular image sub-region includes: The boundary point set and the internal area of ​​the boundary of the land image sub-region in the denoised land image are obtained, and the maximum inscribed rectangle of the land image sub-region is solved based on the boundary point set, the internal area of ​​the boundary and the maximum inscribed rectangle model to obtain the rectangular image sub-region, where the maximum inscribed rectangle model is solved as follows: (y2-y1)(y4-y1)-(x2-x1)(x1-x4)=0 (y4-y1)(x3-x2)-(y3-t2)(x4-x1)=0 (t2-y1)(x4-x3)-(y4-y3)(x2-x1)=0 Among them, S max represents the objective function of the maximum inscribed rectangle model, x1 represents the abscissa of the first rectangle vertex of the maximum inscribed rectangle, y1 represents the ordinate of the first rectangle vertex of the maximum inscribed rectangle, and the coordinate of the first rectangle vertex is (x1, y1), x2 represents the abscissa of the second rectangle vertex of the maximum inscribed rectangle, y2 represents the ordinate of the second rectangle vertex of the maximum inscribed rectangle, and the coordinate of the second rectangle vertex is (x2, y2), x3 represents the abscissa of the third rectangle vertex of the maximum inscribed rectangle, y3 represents the ordinate of the third rectangle vertex of the maximum inscribed rectangle, and the coordinate of the third rectangle vertex is (x3, y3), x4 represents the abscissa of the fourth rectangle vertex of the maximum inscribed rectangle, y4 represents the ordinate of the first rectangle vertex of the maximum inscribed rectangle, and the coordinate of the fourth rectangle vertex is (x4, y4); Among them, the first rectangular vertex, the second rectangular vertex, the third rectangular vertex and the fourth rectangular vertex are all in the internal area of ​​the boundary, and any boundary point in the boundary point set is not in the rectangular area formed by the first rectangular vertex, the second rectangular vertex, the third rectangular vertex and the fourth rectangular vertex.

7. The method for constructing an agricultural twin model based on time series data according to claim 6, characterized in that: The method of obtaining historical data sets of multiple soil sensors includes: Extract soil sensors from multiple soil sensors in sequence to obtain target sensors, and perform the following operations on the target sensors: Obtain a unit initial data set and a historical detection time of the target sensor, divide the historical detection time according to a detection frequency preset by the target sensor, obtain a historical detection time series, associate the historical detection time series with the unit initial data set, and obtain a humidity time series group set, wherein the humidity time series group set includes multiple humidity time series groups, and the humidity time series group includes: a historical detection time and unit initial data corresponding to the historical detection time, and the multiple humidity time series groups in the humidity time series group set are sorted according to the historical detection time; Identify a blank humidity group set in the humidity time series group set, fill the humidity time series group set according to the blank humidity group set, and obtain a complete humidity time series group set, wherein the blank humidity group set includes zero, one or more blank humidity groups, and the blank humidity group is a humidity time series group whose unit initial data is blank; Verify the integrity of the complete humidity time series group set. If there is no erroneous data in the complete humidity time series group set, confirm the complete humidity time series group set as the standard historical humidity time series group set. Otherwise, remove all erroneous data in the complete humidity time series group set, and use the complete humidity time series group set after removing all erroneous data as the humidity time series group set. Return to the step of identifying the blank humidity group set in the humidity time series group set until the complete humidity time series group set is confirmed as the standard historical humidity time series group set. Use the target sensor to perform an identification operation on the standard historical humidity time series group set to obtain a unit data set. Aggregate the unit datasets to obtain historical datasets of multiple soil sensors.

8. The method for constructing an agricultural twin model based on time series data according to claim 7, characterized in that: The step of filling the humidity time sequence set according to the blank humidity set to obtain a complete humidity time sequence set includes: If the blank humidity group set is an empty set, the humidity time series group set is confirmed as a complete humidity time series group set; Otherwise, perform the following operations for each blank humidity group in the blank humidity group set: Extracting multiple adjacent humidity groups based on a blank humidity group and a unit initial data set, extracting multiple humidity values ​​based on the multiple adjacent humidity groups, and fitting the extracted multiple humidity values ​​into a curve equation using a pre-built fitting method to obtain a humidity curve equation, wherein the horizontal axis in the humidity curve equation is continuous time, and the vertical axis is the humidity value; Extract the historical detection time in the blank humidity group to obtain the target time, input the target time into the humidity curve equation to obtain the humidity prediction value, and use the humidity prediction value to update the blank humidity group to obtain the complete humidity group; After confirming that each blank humidity group in the blank humidity group set is a complete humidity group, a complete humidity group set is obtained, and the humidity time series group set is updated using the complete humidity group set to obtain a complete humidity time series group set.

9. The method for constructing an agricultural twin model based on time series data according to claim 8, characterized in that: The soil moisture evolution model is generated based on the pre-built time series, historical data set and grid map, including: Based on the time series, the target evolution duration is obtained, and the unit data sets are extracted from the historical data sets in sequence. The following operations are performed on the extracted unit data sets: Based on the extracted unit data set, the historical detection time is confirmed to obtain the time to be analyzed. If the time to be analyzed is less than the target evolution time, the missing detection point set corresponding to the unit data set is constructed based on the target evolution time and the detection frequency corresponding to the unit data set, and each missing detection point in the missing detection point set is assigned a value of 0 to obtain a corrected data set. If the time to be analyzed is greater than or equal to the target evolution time, all unit data in the unit data set that are outside the target evolution time are eliminated to obtain a corrected data set. Aggregate the corrected data sets to obtain multiple corrected data sets; Extract target times from the time series in sequence, and perform the following operations on the extracted target times: Extracting multiple evolution data groups from multiple correction data sets based on the target time, wherein the evolution data group is a data group consisting of a soil sensor at the target time and a moisture value of a soil sensor at the target time, and the correction data set corresponds to the evolution data group one by one; Importing multiple evolution data groups into a grid map to obtain an initial evolution map, wherein the initial evolution map includes multiple true value nodes and multiple prediction nodes, and the true value nodes correspond to the evolution data groups one by one; Using a pre-built grid interpolation method, interpolation operations are performed on multiple prediction nodes in the initial evolution map to obtain a map to be colored; Extracting node values ​​of multiple real value nodes and multiple predicted nodes from the map to be colored to obtain multiple node values, performing a color normalization operation on the multiple node values ​​to obtain multiple color grayscale values, and performing a colorization operation on the map to be colored based on the multiple color grayscale values ​​and preset colors to obtain a visualized map at a target time; The visualization maps are aggregated to obtain a plurality of visualization maps, a sorting operation is performed on the plurality of visualization maps based on a time series to obtain a visualization map sequence, and the visualization map sequence is input into a pre-built evolution model to obtain a soil moisture evolution model.

10. An agricultural twin model construction system based on time series data, characterized in that: The system comprises: A binary image acquisition module is used to identify greenhouse land based on a soil detection environment, wherein the soil detection environment includes: a camera unit, a plurality of soil sensors, and greenhouse land, wherein the plurality of soil sensors are dispersed in the greenhouse land, the greenhouse land includes a plurality of sub-land areas, and the agricultural crops in each of the plurality of sub-land areas are different, and each sub-land area includes at least two soil sensors, the camera in the camera unit is a binocular camera, and the camera unit is used to shoot a bird's-eye view of the greenhouse land to obtain an initial greenhouse map, and a preprocessing operation is performed on the initial greenhouse map to obtain a binary image; An initial map acquisition module is used to perform a noise reduction operation on the binary image to obtain a noise-reduced land image, identify image regions corresponding to a plurality of sub-land regions in the noise-reduced land image based on a pre-constructed connected domain algorithm, obtain a plurality of land image sub-regions and non-land image regions, and construct an initial map based on the plurality of land image sub-regions and non-land image regions; A grid map acquisition module is used to extract land image sub-regions from the initial map in sequence, and perform grid operations on the extracted land image sub-regions to obtain grid sub-regions, and after confirming that all land image sub-regions in the initial map are grid sub-regions, obtain a grid map; The soil moisture evolution model acquisition module is used to obtain historical data sets of multiple soil sensors, generate a soil moisture evolution model based on pre-built time series, historical data sets and grid maps, and complete the construction of an agricultural twin model based on time series data based on the soil moisture evolution model.