An agricultural planting environment data processing method and system
By obtaining multiple time series data in the agricultural planting environment, calculating correlation coefficients and correcting soil pH and other data, the problem of external environmental changes affecting the accuracy of soil monitoring data is solved, and the credibility of the data is improved.
Patent Information
- Application Number
- CN202510387960.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2045-03-31
AI Technical Summary
In application scenarios where the external environment changes greatly, the accuracy of soil monitoring data is low, which affects the credibility of the data.
By obtaining various timing data of the agricultural planting environment, including soil acid-base value, soil moisture content, air temperature, etc., the correlation coefficient between the first timing data and the second timing data is calculated, and the first timing data is corrected based on this to improve its accuracy.
By verifying the correlation between the first time series data and other time series data, abnormal data are corrected, thereby improving the accuracy and credibility of monitoring data such as soil pH.
Smart Images

Figure CN119885050B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data processing, and specifically provides a method and system for processing agricultural planting environment data. Background Art
[0002] With the growth of the global population, the intensification of resource constraints, and the challenges brought by climate change, agricultural production is facing unprecedented pressure. In order to achieve the goals of food security, efficient resource utilization, and sustainable development, the traditional agricultural management mode that relies on human experience and intuition has been difficult to meet the requirements. The rise of agricultural planting environment data processing technology is precisely in response to the call for the development of precision agriculture and intelligent agriculture. By scientifically collecting and analyzing data, it creates optimal conditions for crop growth, improves yield and quality, while reducing input costs and environmental burdens.
[0003] In modern agricultural planting, due to the progress of modern Internet of Things and sensing technologies, agricultural producers will collect the planting environment data of crops during the agricultural planting process, analyze the planting environment of crops, and then provide a scientific basis for the scientific planting of crops according to the characteristics of the crop growth environment. Taking the monitoring of the soil acid-base environment in the agricultural planting environment as an example, for instance: by monitoring the pH value of the soil where the crops are planted, the soil acid-base information is grasped, providing a theoretical support for soil fertilization. When the prior art conducts soil acid-base environment monitoring, it usually directly measures the pH value of the soil through an inserted pH sensor and then transmits the data. However, because the soil pH detection sensor is often on the soil surface, in the agricultural planting environment, farmland soil is located in the wild, not in a constant temperature and humidity environment, and the soil is greatly affected by external environmental changes. The accuracy of the data collected by its soil pH sensor is easily interfered. This results in a relatively low accuracy of the collected data for the soil pH value, affecting the credibility of the data. Summary of the Invention
[0004] The purpose of this application is to provide a method and system for processing agricultural planting environment data to solve the technical problem of relatively low accuracy of soil monitoring data in application scenarios with large external environmental changes.
[0005] To achieve the above purpose, this application provides the following technical solutions:
[0006] In the first aspect, this application proposes a technical solution for a method of processing agricultural planting environment data. The method for processing agricultural planting environment data includes:
[0007] Obtain the environmental data of agricultural planting; the environmental data at least includes the time-series data of soil pH value, soil moisture content, air temperature, air humidity, wind speed, sunshine duration, and precipitation;
[0008] Based on the environmental data, obtain first time-series data and second time-series data; the first time-series data is any type of time-series data in the environmental data; the second time-series data is any type of time-series data in the environmental data that is different from the first time-series data;
[0009] Based on the first time-series data and the second time-series data, obtain a current correlation coefficient; the current correlation coefficient is at least used to represent the influence of the data values in the second time-series data on the data value magnitudes in the first time-series data;
[0010] Based on the current correlation coefficient, correct the data values in the first time-series data.
[0011] As a specific solution in the technical solution of this application, the obtaining the current correlation coefficient based on the first time-series data and the second time-series data includes:
[0012] Based on the first time-series data, obtain a first data value; the first data value is the time-series value of any time-series in the first time-series data;
[0013] Based on the second time-series data, obtain a second data value; the second data value is the data value in the second time-series data that has the same time-series as the first data value;
[0014] Based on the first data value and the second data value, obtain an initial correlation coefficient;
[0015] Based on the initial correlation coefficient, obtain the current correlation coefficient.
[0016] As a specific solution in the technical solution of this application, the obtaining the current correlation coefficient based on the initial correlation coefficient includes:
[0017] Based on the first time-series data, obtain a first time-series change curve;
[0018] Based on the first time-series change curve, obtain multiple first time-series data segments; the slope of each first time-series data segment is greater than or equal to the average slope of each data point of the first time-series change curve;
[0019] Based on the second time-series data, obtain a second time-series change curve;
[0020] Based on the second time-series change curve, obtain multiple second time-series data segments; the slope of each second time-series data segment is greater than or equal to the average slope of each data point of the second time-series change curve;
[0021] Based on each first timing data segment and each second timing data segment, obtain a first coefficient; the first coefficient is at least used to characterize the magnitude of the time correlation between the first timing data segment and the second timing data segment with the same timing.
[0022] Based on the first coefficient and the initial correlation coefficient, obtain the current correlation coefficient.
[0023] As a specific solution in the technical solution of this application, the calculation formula for obtaining the first coefficient based on each first timing data segment and each second timing data segment is as follows:
[0024] ;
[0025] where represents the first coefficient of the z-th first timing data segment and the z-th second timing data segment; represents the start time of the z-th first timing data segment; represents the start time of the z-th second timing data segment; represents the difference in the duration of the z-th first timing data segment and the z-th second timing data segment; represents taking the absolute value; represents the exponential function with the natural constant as the base.
[0026] As a specific solution in the technical solution of this application, the obtaining of the current correlation coefficient based on the first coefficient and the initial correlation coefficient includes:
[0027] Based on each first timing data segment and each second timing data segment, obtain a second coefficient; the second coefficient is at least used to characterize the magnitude of the fluctuation correlation between the first timing data segment and the second timing data segment with the same timing.
[0028] Based on the first coefficient and the second coefficient, obtain a third coefficient;
[0029] Based on the third coefficient and the initial correlation coefficient, obtain the current correlation coefficient.
[0030] As a specific solution in the technical solution of this application, the calculation formula for obtaining the second coefficient based on each first timing data segment and each second timing data segment is as follows:
[0031] ;
[0032] where represents the second coefficient of the z-th first timing data segment and the z-th second timing data segment; X represents the smallest number of data points in the z-th first timing data segment and the z-th second timing data segment; represents the slope corresponding to the i-th data point in the z-th first timing data segment; represents the slope corresponding to the i-th data point in the z-th second timing data segment; represents taking the absolute value; represents the exponential function with the natural constant as the base.
[0033] As a specific solution in the technical solution of this application, the calculation formula for obtaining the third coefficient based on the first coefficient and the second coefficient is as follows:
[0034] ;
[0035] where m represents the third coefficient; n represents the number of pairs of the first timing data segment and the second timing data segment with equal timings; represents the first coefficient of the z-th first timing data segment and the z-th second timing data segment; represents the second coefficient of the z-th first timing data segment and the z-th second timing data segment.
[0036] As a specific solution in the technical solution of this application, the calculation formula for obtaining the current correlation coefficient based on the third coefficient and the initial correlation coefficient is as follows:
[0037] ;
[0038] where q represents the current correlation coefficient; m represents the third coefficient; represents the initial correlation coefficient; represents the normalization function, which is used to map the value within the parentheses to the range of [0, 1].
[0039] As a specific solution in the technical solution of this application, the modification of the data value in the first timing data based on the current correlation coefficient includes:
[0040] Obtaining a third data value based on the first timing data; the third data value is the timing value of any timing in the first timing data;
[0041] Obtaining a fourth data value and multiple fifth data values based on the second timing data; the fourth data value is the data value with the same timing as the third data value in the second timing data; the fifth data value is the data value equal to the fourth data value in the second timing data;
[0042] Obtaining multiple historical correlation coefficients corresponding one-to-one to the multiple fifth data values based on the multiple fifth data values;
[0043] Obtaining the average value of the correlation coefficients based on the multiple historical correlation coefficients;
[0044] If the current correlation coefficient is less than the average value of the correlation coefficients, correct the third data value.
[0045] In a second aspect, the present application proposes a technical solution for an agricultural planting environment data processing system, which includes:
[0046] A reader for obtaining environmental data of agricultural planting; the environmental data at least includes time-series data of soil pH value, soil moisture content, air temperature, air humidity, wind speed, sunshine duration, and precipitation.
[0047] A server for obtaining first time-series data and second time-series data based on the environmental data; the first time-series data is time-series data of any type in the environmental data; the second time-series data is time-series data of any type different from the first time-series data in the environmental data.
[0048] And, based on the first time-series data and the second time-series data, obtain a current correlation coefficient; the current correlation coefficient is at least used to represent the influence of the data value in the second time-series data on the data value size in the first time-series data.
[0049] And, based on the current correlation coefficient, correct the data value in the first time-series data.
[0050] As a specific solution in the technical solution of the present application, the server is further configured to obtain a first data value based on the first time-series data; the first data value is the time-series value of any time series in the first time-series data.
[0051] And, obtain a second data value based on the second time-series data; the second data value is the data value in the second time-series data with the same time series as the first data value.
[0052] And, obtain an initial correlation coefficient based on the first data value and the second data value.
[0053] And, obtain the current correlation coefficient based on the initial correlation coefficient.
[0054] As a specific solution in the technical solution of the present application, the server is further configured to obtain a first time-series change curve based on the first time-series data.
[0055] And, obtain a plurality of first time-series data segments based on the first time-series change curve; the slope of each first time-series data segment is greater than or equal to the average slope of each data point of the first time-series change curve.
[0056] And, based on the second timing data, obtain a second timing change curve;
[0057] And, based on the second timing change curve, obtain a plurality of second timing data segments; the slope of each second timing data segment is greater than or equal to the average slope of each data point of the second timing change curve;
[0058] And, based on each first timing data segment and each second timing data segment, obtain a first coefficient; the first coefficient is at least used to characterize the magnitude of the time correlation between the first timing data segment and the second timing data segment with the same timing;
[0059] And, based on the first coefficient and the initial correlation coefficient, obtain the current correlation coefficient.
[0060] As a specific solution in the technical solution of this application, the calculation formula for the server to obtain the first coefficient based on each first timing data segment and each second timing data segment is as follows:
[0061] ;
[0062] Wherein, represents the first coefficient of the z-th first timing data segment and the z-th second timing data segment; represents the start time of the z-th first timing data segment; represents the start time of the z-th second timing data segment; represents the difference in the duration of the z-th first timing data segment and the z-th second timing data segment; represents taking the absolute value; represents the exponential function with the natural constant as the base.
[0063] As a specific solution in the technical solution of this application, the server is further configured to obtain a second coefficient based on each first timing data segment and each second timing data segment; the second coefficient is at least used to characterize the magnitude of the fluctuation correlation between the first timing data segment and the second timing data segment with the same timing;
[0064] And, based on the first coefficient and the second coefficient, obtain a third coefficient;
[0065] And, based on the third coefficient and the initial correlation coefficient, obtain the current correlation coefficient.
[0066] As a specific solution in the technical solution of this application, the calculation formula for the server to obtain the second coefficient based on each first timing data segment and each second timing data segment is as follows:
[0067] ;
[0068] Among them, represents the second coefficient of the z-th first time-series data segment and the z-th second time-series data segment; X represents the minimum number of data points in the z-th first time-series data segment and the z-th second time-series data segment; represents the slope corresponding to the i-th data point in the z-th first time-series data segment; represents the slope corresponding to the i-th data point in the z-th second time-series data segment; represents taking the absolute value; represents the exponential function with the natural constant as the base.
[0069] As a specific solution in the technical solution of this application, the server obtains the calculation formula of the third coefficient based on the first coefficient and the second coefficient as follows:
[0070] ;
[0071] Among them, m represents the third coefficient; n represents the logarithm of the first time-series data segment and the second time-series data segment with equal time series; represents the first coefficient of the z-th first time-series data segment and the z-th second time-series data segment; represents the second coefficient of the z-th first time-series data segment and the z-th second time-series data segment.
[0072] As a specific solution in the technical solution of this application, the server obtains the calculation formula of the current correlation coefficient based on the third coefficient and the initial correlation coefficient as follows:
[0073] ;
[0074] Among them, q represents the current correlation coefficient; m represents the third coefficient; represents the initial correlation coefficient; represents the normalization function, which is used to map the value within the parentheses to the range of [0, 1].
[0075] As a specific solution in the technical solution of this application, the server is further configured to obtain a third data value based on the first time-series data; the third data value is the time-series value of any time series in the first time-series data;
[0076] And, based on the second time-series data, obtain a fourth data value and multiple fifth data values; the fourth data value is the data value with the same time series as the third data value in the second time-series data; the fifth data value is the data value equal to the fourth data value in the second time-series data;
[0077] Further, based on a plurality of fifth data values, obtain a plurality of historical correlation coefficients corresponding one-to-one to the plurality of fifth data values;
[0078] Further, based on the plurality of historical correlation coefficients, obtain an average correlation coefficient;
[0079] Further, if the current correlation coefficient is less than the average correlation coefficient, correct the third data value.
[0080] Compared with the prior art, the beneficial effects of the present application are:
[0081] In the present application, the accuracy of the first time-series data is verified by using the second time-series data (such as soil moisture content) different from the first time-series data (such as soil pH value) in the environmental data of agricultural planting. If the first time-series data is abnormal, the first time-series data is corrected to improve the accuracy of the first time-series data, that is, to improve the credibility of the first time-series data. BRIEF DESCRIPTION OF THE DRAWINGS
[0082] Figure 1 It is a schematic flowchart of a method for processing agricultural planting environment data proposed by an embodiment of the present application;
[0083] Figure 2 It is a schematic structural diagram of a system for processing agricultural planting environment data proposed by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0084] Next, the technical solutions in the embodiments of the present application will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the protection scope of the present application.
[0085] In the description of the embodiments of the present application and the above-mentioned drawings, terms such as "first" and "second" are used to distinguish similar objects and do not necessarily describe a specific order or sequence. For example, the first time-series data and the second time-series data mentioned below belong to different time-series data. It should be understood that the time-series data used in this way can be interchanged under appropriate circumstances so that the embodiments described here can be implemented in an order other than that illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or modules does not necessarily have to be limited to those steps or modules clearly listed, but may include other steps or modules that are not clearly listed or are inherent to these processes, methods, products, or devices. The division of modules in the embodiments of the present application is only a logical division, and there may be other division methods in actual implementation. For example, multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the shown or discussed coupling, direct coupling, or communication connection to each other can be through some interfaces. The indirect coupling or communication connection between modules can be electrical or other similar forms, which are not limited in the embodiments of the present application. And the modules or sub-modules described as separate components may or may not be physically separated, may or may not be physical modules, or may be distributed to multiple circuit modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of the embodiments of the present application.
[0086] In order to solve the technical problem of low accuracy of soil monitoring data in application scenarios with large changes in the external environment proposed in the background art, the present application proposes an agricultural planting environment data processing method, as Figure 1 shown, the agricultural planting environment data processing method includes steps S100 to S400.
[0087] Step S100: Obtain the environmental data of agricultural planting.
[0088] It should be clear that in the embodiments of the present application, the environmental data at least includes but is not limited to time-series data such as soil pH value, soil moisture content, air temperature, air humidity, wind speed, sunshine duration, and precipitation.
[0089] Step S200: Based on the environmental data, obtain the first time-series data and the second time-series data.
[0090] It should be clear that in the embodiments of the present application, the first time-series data is any type of time-series data in the environmental data, and the second time-series data is any type of time-series data different from the first time-series data in the environmental data. That is to say, in the embodiments of the application, it is determined whether the first time-series data needs to be corrected according to the second time-series data (the specific method is described below).
[0091] It should be noted that in the embodiments of the present application, the first time-series data and the second time-series data are a combination of any two data in the environmental data. However, to avoid redundancy, in the embodiments of the present application, taking a single agricultural planting area as an example, the environmental data of this agricultural planting area is collected. In order to comprehensively master the environmental data of agricultural planting and make as scientific and reasonable decisions as possible. The present application takes the time-series data of the soil pH value (i.e., the first time-series data) and the time-series data of the soil moisture content (i.e., the second time-series data) of the agricultural planting environmental data as an example to illustrate the present application. It does not mean that the method for processing agricultural planting environmental data proposed in the present application is only applicable to correcting the soil pH value based on the soil moisture content. It should be understood that this method can also be applicable to correcting the soil pH value based on the precipitation, or correcting the air humidity based on the precipitation, etc., and will not be listed and elaborated one by one here.
[0092] In the embodiments of the present application, an insertable pH value sensor is set in a single agricultural planting area, and the sensing electrode of the sensor is inserted into the open and flat farmland soil in the farmland. At the same time, the soil moisture is collected to obtain the soil moisture content. The data collection frequency is 1 time / s, and then the time-series data of the soil moisture content and the time-series data of the soil pH value are obtained. And a time series curve is formed according to the actual acquired data in the order of collection time. In the embodiments of the present application, the on-line real-time detection system for soil pH value includes two parts: a sensor and a collector. The sensor part has a time-sharing power supply module, a pH value detection module, a moisture content detection module, and the measurement results are collected by a single-chip microcomputer. The collector part includes an STM32 single-chip microcomputer, a power management module, a clock module, an SD storage module, and an OLED display module, which can realize data collection, storage, and real-time display. In the technical field, the on-line real-time detection system for soil pH value is a mature technology and will not be elaborated here.
[0093] Step S300: Obtain the current correlation coefficient based on the first time-series data and the second time-series data.
[0094] It should be clear that the current correlation coefficient is at least used to represent the influence of the data values in the second time series data on the data values in the first time series data. It is easy to understand that if the correlation between the first time series data and the second time series data is large, the influence of the second time series data on the first time series data is large; if the correlation between the first time series data and the second time series data is small, the influence of the second time series data on the first time series data is small. It is easy to understand that if the correlation between the first time series data and the second time series data is large, and a certain time series data value in the first time series data is abnormal (for example: suddenly increasing or decreasing without human interference), then based on the corresponding time series data value in the second time series data, it can be determined whether this time series data value in the first time series data is abnormal.
[0095] It should be clear that in the embodiments of the present application, any reasonable method can be adopted to obtain the current correlation coefficient based on the first time series data and the second time series data. For example, in an embodiment of the present application, step S300, obtaining the current correlation coefficient based on the first time series data and the second time series data, includes steps S310 to S340.
[0096] Step S310: Obtain a first data value based on the first time series data.
[0097] It should be clear that in this embodiment, the first data value is the time series value of any time series in the first time series data. Obtaining any one data value from multiple data values is a mature technology and will not be elaborated here.
[0098] Step S320: Obtain a second data value based on the second time series data.
[0099] It should be clear that in this embodiment, the second data value is the data value in the second time series data that has the same time series as the first data value. Obtaining any one data value from multiple data values is a mature technology and will not be elaborated here.
[0100] Step S330: Obtain an initial correlation coefficient based on the first data value and the second data value.
[0101] It should be clear that in the embodiments of the present application, the initial correlation coefficient is a correlation coefficient that reflects the relationship between the first data value and the second data value. In the embodiments of the present application, the initial correlation coefficient between the first data value and the second data value can be obtained by using a cross-correlation function, a Pearson correlation coefficient, or an autocorrelation function. For example, in a specific embodiment of the present application, the calculation formula for obtaining the initial correlation coefficient in step S330 based on the first data value and the second data value is as follows:
[0102]
[0103] Among them, represents the initial correlation coefficient; w represents the Pearson equation function; represents the first data value; D represents the second data value.
[0104] Step S340: Obtain the current correlation coefficient based on the initial correlation coefficient.
[0105] In the embodiments of the present application, the initial correlation coefficient can be directly used as the current correlation coefficient. However, it should be noted that the pH value of the soil is related to the concentration of inorganic salt ions in the soil, and the change in the concentration of inorganic salts (that is, the ratio of the mass of the solute to the mass of the solvent) mainly depends on the change in the water content in the soil. That is to say, the change in soil moisture content can cause the concentration of inorganic salts in the soil to change, thereby causing the pH value of the soil to change. In other words, the change in the pH value of the soil is correlated with the soil moisture content. Therefore, by analyzing the correlation between the change in soil moisture content and the change in soil pH value, it is possible to judge the abnormal data of the soil pH value and correct the pH value of the abnormal soil. Relevant personnel in the industry have also shown that the correlation between soil pH value and soil moisture content change has a scientific basis. The online real-time detection system for soil pH value based on moisture content and temperature compensation (doi: 106041 / jissn.000-1298.19.3.017) pointed out that on the basis of analyzing and improving the soil pH value measurement method, the influence of moisture content on the measurement was used by the least squares method to realize the real-time detection of soil pH value. Experiments show that the linear fitting determination coefficient between soil pH value and moisture content is greater than 0.99, indicating that there is a high correlation between soil pH value and moisture content change, and the correlation is relatively high. Because the Pearson function equation is sensitive to outliers when calculating the correlation, a few extreme data may significantly affect the correlation coefficient between the pH values and water contents of two soils. Especially in the agricultural planting environment, the change range of soil moisture content in farmland is large. For example, during precipitation, the soil moisture content increases rapidly; during high-temperature irradiation, the water in the soil evaporates rapidly, and the soil moisture content drops rapidly. The rapid change in moisture content can produce non-linear changes, which will cause a large error in the correlation coefficient, thus affecting the judgment of the accuracy of soil pH value. Therefore, in view of the change characteristics of soil pH value when the soil moisture content changes violently, it is necessary to calculate the correlation between their changes. That is to say, in the embodiments of the present application, it is difficult to accurately characterize the correlation between the first time-series data and the second time-series data only by using the Pearson correlation coefficient as the current correlation coefficient.
[0106] In order to more accurately characterize the correlation between the first time-series data and the second time-series data, in an embodiment of the present application, step S340, obtaining the current correlation coefficient based on the initial correlation coefficient, includes steps S341 to S346.
[0107] Step S341: Obtain a first time-series change curve based on the first time-series data.
[0108] It should be clear that obtaining the corresponding curve based on multiple time-series data values is a mature technology and will not be elaborated here.
[0109] Step S342: Obtain a plurality of first time-series data segments based on the first time-series change curve.
[0110] In the present application, the slope of each first time-series data segment is greater than or equal to the average slope of each data point of the first time-series change curve. In a specific embodiment of the present application, taking the saline-alkali land in the northwest region as an example, when the water content in the soil rises rapidly, the concentration of inorganic salt particles in the soil drops rapidly, and the pH value of the soil drops rapidly. On the contrary, when the water content in the soil drops rapidly, the concentration of inorganic salt particles in the soil rises rapidly, and the pH value of the soil rises rapidly. That is to say, the change trends of the water content and the pH value in the soil are inversely proportional.
[0111] In this embodiment, calculate the mean of the instantaneous change rates of their respective time-series change curves , and the calculation formula is expressed as , where represents the slope of the numerical change between the z-th moment and the (z - 1)-th moment adjacent to the z-th moment before. Respectively select the change curve segments of the time-series curve whose continuous slopes are greater than the mean value, that is . Obtain several change segments of the pH value and water content of the soil with a relatively large local change rate on the time-series change curve.
[0112] Step S343: Obtain a second time-series change curve based on the second time-series data.
[0113] It should be clear that obtaining the corresponding curve based on multiple time-series data values is a mature technology and will not be elaborated here.
[0114] Step S344: Obtain a plurality of second time-series data segments based on the second time-series change curve.
[0115] In the present application, the slope of each second time-series data segment is greater than or equal to the average slope of each data point of the second time-series change curve. The method for obtaining each second time-series data segment is similar to the method for obtaining each first time-series data segment and will not be elaborated here.
[0116] Step S345: Obtain a first coefficient based on each first time-series data segment and each second time-series data segment.
[0117] It should be clear that the first coefficient is at least used to characterize the magnitude of the time correlation between the first time-series data segment and the second time-series data segment with the same time series.
[0118] It should be clear that if the correlation between each first time-series data segment and each second time-series data segment is large, then the change trends of each first time-series data segment and the corresponding second time-series data segment are correlated. For example, as described above, if the soil moisture content rises rapidly, the soil pH value drops rapidly.
[0119] In a specific embodiment of the present application, in step S345, the calculation formula for obtaining the first coefficient based on each first time-series data segment and each second time-series data segment is as follows:
[0120] ;
[0121] Wherein, represents the first coefficient of the z-th first time-series data segment and the z-th second time-series data segment; represents the start time of the z-th first time-series data segment; represents the start time of the z-th second time-series data segment; represents the difference in the duration of the z-th first time-series data segment and the z-th second time-series data segment; represents taking the absolute value; represents the exponential function with the natural constant as the base.
[0122] As can be seen from the above, when the soil moisture content (i.e., the second time-series data segment) changes drastically, the inorganic salt concentration in the soil changes rapidly, that is, the soil pH value (i.e., the first time-series data segment) changes rapidly, showing synchrony. That is to say, when the local curve of the soil moisture content fluctuates, the local curve of the soil pH value should also fluctuate drastically at this time, that is, the time when the local fluctuation curve produces abnormal fluctuations has a certain synchronous correlation.
[0123] In the embodiment of the present application, when the start times of the z-th first time-series data segment and the z-th second time-series data segment are closer, that is, is smaller, it indicates that the start times of their changes and fluctuations are more consistent. If is smaller, it indicates that the durations of their changes and fluctuations are more consistent. That is to say, it shows that when the second time-series data changes, the first time-series data also changes accordingly, and there is a certain consistency in their time changes. That is, the correlation between their change times is greater, that is, is larger.
[0124] Step S346: Obtain the current correlation coefficient based on the first coefficient and the initial correlation coefficient.
[0125] It should be clear that in the embodiments of the present application, any reasonable method can be adopted to obtain the current correlation coefficient based on the first coefficient and the initial correlation coefficient. For example, the current correlation coefficient can be obtained by adding the first coefficient and the initial correlation coefficient, or by multiplying the first coefficient and the initial correlation coefficient.
[0126] It should be noted that in the embodiments of the present application, the correlation between the z-th first time-series data segment and the z-th second time-series data segment is also reflected in the correlation of fluctuations. For example: The change in the soil pH value changes due to the change in the soil moisture content. That is to say, the change in the soil pH value fluctuation is affected by the soil moisture content. When the soil moisture content changes rapidly, the soil pH value should also change rapidly, and the change in its fluctuation has a certain correlation. Therefore, in order to more accurately obtain the current correlation coefficient, in an embodiment of the present application, step S346, obtaining the current correlation coefficient based on the first coefficient and the initial correlation coefficient, includes steps S347 to S349.
[0127] Step S347: Obtain a second coefficient based on each first time-series data segment and each second time-series data segment.
[0128] It should be clear that in the embodiments of the present application, the second coefficient is at least used to characterize the magnitude of the fluctuation correlation between the first time-series data segment and the second time-series data segment with the same time series. In the embodiments of the present application, the slopes of each first time-series data segment and each second time-series data segment can be used to characterize the magnitude of the fluctuation correlation between the two. For example, in a specific embodiment of the present application, in step S347, the calculation formula for obtaining the second coefficient based on each first time-series data segment and each second time-series data segment is as follows:
[0129] ;
[0130] Wherein, represents the second coefficient of the z-th first time-series data segment and the z-th second time-series data segment; X represents the smallest number of data points in the z-th first time-series data segment and the z-th second time-series data segment; represents the slope corresponding to the i-th data point in the z-th first time-series data segment; represents the slope corresponding to the i-th data point in the z-th second time-series data segment; represents taking the absolute value; represents the exponential function with the base of the natural constant.
[0131] It should be noted that in this embodiment and respectively represent the change trends of the z-th first time-series data segment and the z-th second time-series data segment. For example: Since the change in moisture content (i.e., the z-th second time-series data segment) has an inverse effect on the change in pH value (i.e., the z-th first time-series data segment), that is, the higher the soil moisture content, the lower the soil pH value. Therefore, the closer the change trends of the z-th first time-series data segment and the z-th second time-series data segment are, the closer it is to 1, that is The smaller, the more similar the trend of its change, that is, the final is larger.
[0132] Step S348: Obtain a third coefficient based on the first coefficient and the second coefficient;
[0133] It should be clear that in the embodiments of the present application, the first coefficient and the second coefficient can be added as the third coefficient, or the first coefficient and the second coefficient can be multiplied as the third coefficient. In a specific embodiment of the present application, in step S348, the calculation formula for obtaining the third coefficient based on the first coefficient and the second coefficient is as follows:
[0134] ;
[0135] where m represents the third coefficient; n represents the number of pairs of the first time-series data segment and the second time-series data segment with equal time series; represents the first coefficient of the z-th first time-series data segment and the z-th second time-series data segment; represents the second coefficient of the z-th first time-series data segment and the z-th second time-series data segment.
[0136] Step S349: Obtain the current correlation coefficient based on the third coefficient and the initial correlation coefficient.
[0137] It should be clear that in the embodiments of the present application, the third coefficient and the initial correlation coefficient can be added to obtain the current correlation coefficient, or the third coefficient and the initial correlation coefficient can be multiplied to obtain the current correlation coefficient. In a specific embodiment of the present application, in step S349, the calculation formula for obtaining the current correlation coefficient based on the third coefficient and the initial correlation coefficient is as follows:
[0138] ;
[0139] where q represents the current correlation coefficient; m represents the third coefficient; represents the initial correlation coefficient; Represents a normalization function for mapping the value within the brackets to the range of [0, 1].
[0140] It is easy to understand that when the correlation between the moisture content and the pH value of the soil is higher, it indicates that the accuracy of monitoring the pH value at this time is higher. On the contrary, when the correlation between the moisture content and the pH value of the soil is lower, it indicates that the accuracy of monitoring the pH value at this time is lower. If the accuracy of monitoring the pH value is low, the pH value needs to be corrected.
[0141] Step S400: Based on the current correlation coefficient, correct the data value in the first time-series data.
[0142] It should be clear that in the embodiments of the present application, any suitable method can be used to correct the data value in the first time-series data based on the current correlation coefficient. For example, the data value in the first time-series data can be adjusted based on historical data. In a specific embodiment of the present application, step S400, correcting the data value in the first time-series data based on the current correlation coefficient, includes steps S410 to S450.
[0143] Step S410: Based on the first time-series data, obtain a third data value.
[0144] It should be clear that in this embodiment, the third data value is the time-series value of any time series in the first time-series data. That is to say, in the embodiments of the present application, any data in the first time-series data can be checked to confirm whether the data is abnormal and whether it needs to be corrected.
[0145] Step S420: Based on the second time-series data, obtain a fourth data value and multiple fifth data values.
[0146] It should be clear that in this embodiment, the fourth data value is the data value in the second time-series data with the same time series as the third data value. The fifth data value is the data value in the second time-series data equal to the fourth data value.
[0147] Step S430: Based on multiple fifth data values, obtain multiple historical correlation coefficients corresponding to the multiple fifth data values one by one.
[0148] It should be clear that obtaining the historical correlation coefficient corresponding to the fifth data value based on the fifth data value is as described in steps S100 to S300, which will not be elaborated here.
[0149] Step S440: Based on multiple historical correlation coefficients, obtain an average correlation coefficient.
[0150] It should be clear that, based on multiple values, obtaining the average value of these values is a mature technology.
[0151] Step S450: If the current correlation coefficient is less than the average correlation coefficient, correct the third data value.
[0152] It is easy to understand that if the current correlation coefficient corresponding to the third data value is less than the average correlation coefficient, it indicates that the third data value is inaccurate and needs to be corrected. In the embodiments of the present application, the average value of the data values corresponding to the first time-series data and multiple fifth data values in time series can be used as the corrected third data value. In a specific embodiment of the present application, in step S450: If the current correlation coefficient is less than the average correlation coefficient, the formula for correcting the third data value is as follows:
[0153] ;
[0154] where represents the third data value after correction; represents the third data value before correction; represents the current correlation coefficient; represents the average value of the data values corresponding to the first time-series data and multiple fifth data values in time series.
[0155] It should be clear that in the embodiments of the agricultural planting environment data processing method proposed in the present application, the accuracy of the first time-series data (e.g., soil pH value) is verified by the second time-series data (e.g., soil moisture content) different from the first time-series data in the environmental data of agricultural planting. If the first time-series data is abnormal, the first time-series data is corrected to improve the accuracy of the first time-series data, that is, to improve the credibility of the first time-series data.
[0156] After introducing the agricultural planting environment data processing method proposed in the embodiments of the present application, the following introduces an embodiment of an agricultural planting environment data processing system proposed in the present application, as Figure 2 shown, the agricultural planting environment data processing system includes:
[0157] Reader 11, used to obtain the environmental data of agricultural planting; the environmental data at least includes time-series data of soil pH value, soil moisture content, air temperature, air humidity, wind speed, sunshine duration, and precipitation;
[0158] Server 12, used to obtain the first time-series data and the second time-series data based on the environmental data; the first time-series data is any type of time-series data in the environmental data; the second time-series data is any type of time-series data different from the first time-series data in the environmental data;
[0159] And, based on the first time-series data and the second time-series data, obtain a current correlation coefficient; the current correlation coefficient is at least used to represent the influence of the data values in the second time-series data on the magnitudes of the data values in the first time-series data;
[0160] And, based on the current correlation coefficient, correct the data values in the first time-series data.
[0161] As a specific embodiment in the present application, the server 12 is further configured to obtain a first data value based on the first time-series data; the first data value is the time-series value of any time sequence in the first time-series data;
[0162] And, obtain a second data value based on the second time-series data; the second data value is the data value in the second time-series data that has the same time sequence as the first data value;
[0163] And, obtain an initial correlation coefficient based on the first data value and the second data value;
[0164] And, obtain the current correlation coefficient based on the initial correlation coefficient.
[0165] As a specific embodiment in the present application, the server 12 is further configured to obtain a first time-series change curve based on the first time-series data;
[0166] And, obtain a plurality of first time-series data segments based on the first time-series change curve; the slope of each first time-series data segment is greater than or equal to the average slope of each data point of the first time-series change curve;
[0167] And, obtain a second time-series change curve based on the second time-series data;
[0168] And, obtain a plurality of second time-series data segments based on the second time-series change curve; the slope of each second time-series data segment is greater than or equal to the average slope of each data point of the second time-series change curve;
[0169] And, obtain a first coefficient based on each first time-series data segment and each second time-series data segment; the first coefficient is at least used to characterize the magnitude of the time correlation between the first time-series data segment and the second time-series data segment with the same time sequence;
[0170] And, obtain the current correlation coefficient based on the first coefficient and the initial correlation coefficient.
[0171] As a specific embodiment in the present application, the formula for the server 12 to obtain the first coefficient based on each first time-series data segment and each second time-series data segment is as follows:
[0172] ;
[0173] Wherein, represents the first coefficient of the z-th first time-series data segment and the z-th second time-series data segment; represents the start time of the z-th first time-series data segment; represents the start time of the z-th second time-series data segment; represents the difference in the duration of the z-th first time-series data segment and the z-th second time-series data segment; represents taking the absolute value; represents the exponential function with the natural constant as the base.
[0174] As a specific embodiment in the present application, the server 12 is further configured to obtain a second coefficient based on each first time-series data segment and each second time-series data segment; the second coefficient is at least used to characterize the magnitude of the fluctuation correlation between the first time-series data segment and the second time-series data segment with the same time series;
[0175] And, based on the first coefficient and the second coefficient, obtain a third coefficient;
[0176] And, based on the third coefficient and the initial correlation coefficient, obtain the current correlation coefficient.
[0177] As a specific embodiment in the present application, the formula for the server 12 to obtain the second coefficient based on each first time-series data segment and each second time-series data segment is as follows:
[0178] ;
[0179] Wherein, represents the second coefficient of the z-th first time-series data segment and the z-th second time-series data segment; X represents the minimum number of data points in the z-th first time-series data segment and the z-th second time-series data segment; represents the slope corresponding to the i-th data point in the z-th first time-series data segment; represents the slope corresponding to the i-th data point in the z-th second time-series data segment; represents taking the absolute value; represents the exponential function with the natural constant as the base.
[0180] As a specific embodiment in the present application, the formula for the server 12 to obtain the third coefficient based on the first coefficient and the second coefficient is as follows:
[0181] ;
[0182] Wherein, m represents the third coefficient; n represents the number of pairs of the first time-series data segments and the second time-series data segments with equal time series; represents the first coefficient of the z-th first time-series data segment and the z-th second time-series data segment; represents the second coefficient of the z-th first time-series data segment and the z-th second time-series data segment.
[0183] As a specific embodiment in this application, the server 12 obtains the calculation formula of the current correlation coefficient based on the third coefficient and the initial correlation coefficient as follows:
[0184] ;
[0185] Wherein, q represents the current correlation coefficient; m represents the third coefficient; represents the initial correlation coefficient; represents a normalization function, which is used to map the value within the brackets to the range of [0, 1].
[0186] As a specific embodiment in this application, the server 12 is further configured to obtain a third data value based on the first time-series data; the third data value is the time-series value of any time series in the first time-series data;
[0187] And, obtain a fourth data value and a plurality of fifth data values based on the second time-series data; the fourth data value is the data value in the second time-series data with the same time series as the third data value; the fifth data value is the data value in the second time-series data equal to the fourth data value;
[0188] And, obtain a plurality of historical correlation coefficients corresponding to the plurality of fifth data values based on the plurality of fifth data values;
[0189] And, obtain an average correlation coefficient based on the plurality of historical correlation coefficients;
[0190] And, if the current correlation coefficient is less than the average correlation coefficient, correct the third data value.
[0191] It should be clear that in the embodiment of the agricultural planting environment data processing system proposed in this application, the accuracy of the first time-series data (e.g., soil pH value) is verified by the second time-series data (e.g., soil moisture content) different from the first time-series data in the environmental data of agricultural planting. If the first time-series data is abnormal, the first time-series data is corrected to improve the accuracy of the first time-series data, that is, to improve the credibility of the first time-series data.
[0192] After introducing the agricultural planting environment data processing system proposed in the embodiments of the present application, the following introduces a computer-readable storage medium proposed by the present application. A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, it implements the agricultural planting environment data processing method described in any one of the above embodiments.
[0193] It should be clear that the computer-readable storage medium in the present application includes permanent and non-permanent, removable and non-removable media, and information storage can be achieved by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory, static random access memory, dynamic random access memory, other types of random access memory, read-only memory, electrically erasable programmable read-only memory, flash memory, or other memory technologies, compact disc read-only memory, digital versatile disc, or other optical storage, magnetic cassette tapes, disk storage, or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media such as modulated data signals and carrier waves.
[0194] In the above embodiments, the descriptions of the various embodiments have their own focuses. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0195] Those skilled in the art can clearly understand that for the sake of convenience and brevity of description, the specific working processes of the methods, devices, and equipment described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0196] In several embodiments provided by the embodiments of the present application, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division. In actual implementation, there can be other division methods. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings, direct couplings, or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the devices or modules can be in electrical, mechanical, or other forms.
[0197] The modules described as separate components may or may not be physically separated. The components displayed as modules may or may not be physical modules, that is, they can be located in one place or distributed to multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0198] In addition, in each embodiment of this application, each functional module can be integrated into one processing module, or each module can exist physically alone, or two or more modules can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium.
[0199] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product.
[0200] The computer program product includes one or more computer instructions. When the computer program is loaded and executed on a computer, the processes or functions described in the embodiments of this application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from a website, computer, server, or data center to another website, computer, server, or data center in a wired manner (such as coaxial cable, optical fiber, digital subscriber line) or a wireless manner (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can store, or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a digital video disc), or a semiconductor medium (for example, a solid state disk (SSD)).
[0201] Although the embodiments of this application have been shown and described, for those of ordinary skill in the art, it can be understood that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles of this application.
Claims
1. A method for processing agricultural planting environment data, characterized in that: include: Acquire environmental data for agricultural planting; the environmental data at least includes time series data of soil pH, soil moisture content, air temperature, air humidity, wind speed, sunshine duration and precipitation; Based on the environmental data, first time series data and second time series data are acquired; the first time series data is any type of time series data in the environmental data; The second time series data is any type of time series data in the environment data that is different from the first time series data; Based on the first time series data and the second time series data, a current correlation coefficient is obtained; the current correlation coefficient is at least used to represent the influence of the data value in the second time series data on the size of the data value in the first time series data; Based on the current correlation coefficient, correct the data value in the first time series data; The acquiring a current correlation coefficient based on the first time series data and the second time series data includes: Based on the first time series data, a first data value is acquired; the first data value is a time series value of any time series in the first time series data; Based on the second time series data, a second data value is acquired; the second data value is a data value in the second time series data having the same time series as the first data value; Based on the first data value and the second data value, obtaining an initial correlation coefficient; Based on the initial correlation coefficient, obtaining the current correlation coefficient; The acquiring the current correlation coefficient based on the initial correlation coefficient comprises: Based on the first time series data, obtaining a first time series change curve; Based on the first time series change curve, a plurality of first time series data line segments are acquired; the slope of each first time series data line segment is greater than or equal to the average slope of each data point of the first time series change curve; Based on the second time series data, obtaining a second time series change curve; Based on the second time series change curve, a plurality of second time series data line segments are acquired; the slope of each second time series data line segment is greater than or equal to the average slope of each data point of the second time series change curve; Based on each first time series data line segment and each second time series data line segment, a first coefficient is obtained; the first coefficient is at least used to characterize the time correlation between the first time series data line segment and the second time series data line segment with the same time sequence; The current correlation coefficient is obtained based on the first coefficient and the initial correlation coefficient.
2. The agricultural planting environment data processing method according to claim 1, characterized in that: The calculation formula for obtaining the first coefficient based on each first time series data line segment and each second time series data line segment is as follows: ; in, A first coefficient representing the zth first time series data line segment and the zth second time series data line segment; Indicates the start time of the zth first time series data segment; Indicates the start time of the zth second time series data segment; represents the difference between the duration of the zth first time series data line segment and the zth second time series data line segment; Indicates taking the absolute value; Represents an exponential function with a natural constant as its base.
3. The agricultural planting environment data processing method according to claim 1, characterized in that: The acquiring the current correlation coefficient based on the first coefficient and the initial correlation coefficient includes: Based on each first time series data line segment and each second time series data line segment, a second coefficient is obtained; the second coefficient is at least used to characterize the magnitude of the fluctuation correlation between the first time series data line segment and the second time series data line segment with the same time series; Based on the first coefficient and the second coefficient, obtaining a third coefficient; The current correlation coefficient is obtained based on the third coefficient and the initial correlation coefficient.
4. The agricultural planting environment data processing method according to claim 3 is characterized in that: Based on each first time series data line segment and each second time series data line segment, the calculation formula for obtaining the second coefficient is as follows: ; in, represents the second coefficient of the zth first time series data line segment and the zth second time series data line segment; X represents the minimum number of data points in the zth first time series data line segment and the zth second time series data line segment; represents the slope corresponding to the i-th data point in the z-th first time series data segment; represents the slope corresponding to the i-th data point in the z-th second time series data segment; Indicates taking the absolute value; Represents an exponential function with a natural constant as its base.
5. The agricultural planting environment data processing method according to claim 4, characterized in that: The calculation formula for obtaining the third coefficient based on the first coefficient and the second coefficient is as follows: ; Wherein, m represents the third coefficient; n represents the logarithm of the first time series data line segment and the second time series data line segment with equal time series; A first coefficient representing the zth first time series data line segment and the zth second time series data line segment; The second coefficient representing the zth first timing data segment and the zth second timing data segment.
6. The agricultural planting environment data processing method according to claim 3, characterized in that: Based on the third coefficient and the initial correlation coefficient, the calculation formula for obtaining the current correlation coefficient is as follows: ; Wherein, q represents the current correlation coefficient; m represents the third coefficient; represents the initial correlation coefficient; Represents a normalization function, which is used to map the values in the brackets to the range of [0, 1].
7. The agricultural planting environment data processing method according to any one of claims 1 to 6, characterized in that: The step of correcting the data value in the first time series data based on the current correlation coefficient includes: Based on the first time series data, a third data value is acquired; the third data value is a time series value of any time series in the first time series data; Based on the second time series data, a fourth data value and a plurality of fifth data values are acquired; the fourth data value is a data value in the second time series data having the same time series as the third data value; the fifth data value is a data value in the second time series data equal to the fourth data value; Based on the plurality of fifth data values, obtaining a plurality of historical correlation coefficients corresponding one-to-one to the plurality of fifth data values; Based on multiple historical correlation coefficients, obtain the average correlation coefficient; If the current correlation coefficient is less than the correlation coefficient average value, the third data value is corrected.
8. An agricultural planting environment data processing system, characterized in that: include: A reader for obtaining environmental data for agricultural planting; the environmental data at least includes time series data of soil pH, soil moisture content, air temperature, air humidity, wind speed, sunshine duration and precipitation; A server, configured to obtain first time series data and second time series data based on the environment data; the first time series data is any type of time series data in the environment data; The second time series data is any type of time series data in the environment data that is different from the first time series data; And, based on the first time series data and the second time series data, a current correlation coefficient is obtained; the current correlation coefficient is at least used to represent the influence of the data value in the second time series data on the size of the data value in the first time series data; and, based on the current correlation coefficient, correcting the data value in the first time series data; The acquiring a current correlation coefficient based on the first time series data and the second time series data includes: Based on the first time series data, a first data value is acquired; the first data value is a time series value of any time series in the first time series data; Based on the second time series data, a second data value is acquired; the second data value is a data value in the second time series data having the same time series as the first data value; Based on the first data value and the second data value, obtaining an initial correlation coefficient; Based on the initial correlation coefficient, obtaining the current correlation coefficient; The acquiring the current correlation coefficient based on the initial correlation coefficient comprises: Based on the first time series data, obtaining a first time series change curve; Based on the first time series change curve, a plurality of first time series data line segments are acquired; the slope of each first time series data line segment is greater than or equal to the average slope of each data point of the first time series change curve; Based on the second time series data, obtaining a second time series change curve; Based on the second time series change curve, a plurality of second time series data line segments are acquired; the slope of each second time series data line segment is greater than or equal to the average slope of each data point of the second time series change curve; Based on each first time series data line segment and each second time series data line segment, a first coefficient is obtained; the first coefficient is at least used to characterize the time correlation between the first time series data line segment and the second time series data line segment with the same time sequence; The current correlation coefficient is obtained based on the first coefficient and the initial correlation coefficient.
Citation Information
Patent Citations
Environment monitoring method and system
CN111414586A
Field environment control method and device based on Internet of Things
CN118348900A