Gateway data processing method based on edge algorithm and irrigation wireless decoder gateway
By adopting the gateway data processing method based on edge algorithm in the intelligent irrigation system, irrigation activities and timing implicit representations are constructed, and pattern matching is combined with the irrigation pattern list, the shortcomings of the existing system in irrigation demand identification are solved, and more accurate and reliable irrigation demand identification is achieved.
Patent Information
- Application Number
- CN202411989042.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-31
AI Technical Summary
The existing intelligent irrigation system lacks a comprehensive analysis and understanding of farmland irrigation activities in the identification of irrigation demands, and cannot accurately identify farmland irrigation needs, which can easily lead to errors in irrigation decisions.
Using the gateway data processing method based on edge algorithm, the implicit representation of irrigation activities in the farmland IoT sensing data is constructed, and the pattern matching is combined with the irrigation pattern list to identify the irrigation needs of the farmland.
It improves the reliability and accuracy of irrigation demand identification, can more comprehensively understand the complexity of farmland irrigation activities, provide more reasonable irrigation decisions, and support the effective promotion of smart agriculture.
Smart Images

Figure CN119766845A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and more specifically, to a gateway data processing method based on edge algorithm and an irrigation wireless decoder gateway. Background Art
[0002] With the continuous development of science and technology, smart agriculture, as an important development direction of modern agriculture, has received widespread attention and attention. In the field of smart agriculture, precise irrigation management is of vital importance to increasing crop yields, saving water resources and ensuring the sustainable development of agriculture. In traditional farmland irrigation systems, irrigation decisions often rely on farmers' experience and manual monitoring, which has many limitations. For example, manual monitoring cannot obtain real-time and comprehensive information on the irrigation needs of farmland, which can easily lead to problems such as insufficient or excessive irrigation. Insufficient irrigation will affect the growth and development of crops and reduce yields; while excessive irrigation will not only waste water resources, but may also lead to problems such as soil waterlogging and soil nutrient loss, affecting soil quality and the growth environment of crops.
[0003] In order to solve the shortcomings of traditional irrigation methods, intelligent irrigation systems based on Internet of Things technology have gradually emerged in recent years. These systems deploy a large number of sensor nodes in farmland to collect soil moisture, temperature, meteorological data and other information of farmland in real time, and transmit these data to the central control system for analysis and processing, so as to realize intelligent control of irrigation. However, the existing intelligent irrigation systems still have some problems in data processing and irrigation demand identification. In terms of irrigation demand identification, the existing intelligent irrigation systems often only focus on single sensor data or simple threshold judgments, and lack a comprehensive analysis and understanding of farmland irrigation activities. Farmland irrigation activities are a complex process, which is affected by many factors, such as irrigation location, duration, water volume, time series distribution, etc. Relying solely on single sensor data or simple threshold judgments, it is impossible to accurately identify the irrigation needs of farmland, which is easy to lead to errors in irrigation decisions. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a gateway data processing method based on an edge algorithm and an irrigation wireless decoder gateway.
[0005] According to one aspect of the present invention, a gateway data processing method based on an edge algorithm is provided, which is applied to an irrigation wireless decoder gateway. The method comprises: detecting various farmland irrigation activities in farmland IoT sensor data to obtain farmland irrigation activity detection data, wherein the farmland IoT sensor data is collected and uploaded in a target time period by using multiple irrigation sensor nodes deployed in a target farmland area, and the multiple irrigation sensor nodes are communicatively connected with the irrigation wireless decoder gateway; constructing an implicit representation of the irrigation activities of the various farmland irrigation activities based on the farmland irrigation activity detection data; and constructing an implicit representation of the irrigation activities of the various farmland irrigation activities based on the farmland irrigation activity detection data. The implicit representation of irrigation activities mines the time series distribution between each farmland irrigation activity in the farmland IoT sensor data to obtain the implicit representation of the farmland irrigation activity time series; based on the implicit representation of irrigation activities and the implicit representation of the farmland irrigation activity time series, detect whether the farmland IoT sensor data and the pattern example sensor data in the irrigation pattern list meet the commonality condition; when the pattern example sensor data whose pattern commonality coefficient with the farmland IoT sensor data meets the commonality condition is detected in the irrigation pattern list, the irrigation demand corresponding to the pattern example sensor data that meets the commonality condition is determined as the irrigation demand of the target farmland area.
[0006] According to another aspect of the present invention, an irrigation wireless decoder gateway is provided, comprising: a processor; and a memory, wherein the memory stores a computer-readable code, and when the computer-readable code is executed by the processor, the processor executes the method described above.
[0007] The present invention constructs an implicit representation of irrigation activities for each farmland irrigation activity based on farmland irrigation activity detection data, mines the time series distribution between each farmland irrigation activity in farmland Internet of Things sensor data based on the implicit representation of irrigation activities for each farmland irrigation activity, obtains the implicit representation of farmland irrigation activity time series, and then detects whether farmland Internet of Things sensor data and pattern example sensor data in an irrigation pattern list meet common conditions based on the implicit representation of irrigation activities for each farmland irrigation activity and the implicit representation of farmland irrigation activity time series. In the process of mining the implicit representation of data for pattern matching, the implicit representation of irrigation activities for each farmland irrigation activity in the data and the time series distribution between each farmland irrigation activity are measured. The implicit representation of irrigation activities for farmland irrigation activities and the implicit representation of farmland irrigation activity time series are used to more accurately represent the feature information of the data, and the accuracy of pattern recognition is guaranteed, thereby increasing the reliability of irrigation demand recognition, which is conducive to the effective promotion of smart agriculture.
[0008] Based on the following detailed description of specific embodiments of the present invention in conjunction with the accompanying drawings, those skilled in the art will become more aware of the above and other objects, advantages and features of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] Hereinafter, some specific embodiments of the present invention will be described in detail in an exemplary and non-limiting manner with reference to the accompanying drawings. The same reference numerals in the accompanying drawings indicate the same or similar components or parts. It should be understood by those skilled in the art that these drawings are not necessarily drawn to scale. In the accompanying drawings:
[0010] Figure 1 It is a schematic diagram of the architecture of an application environment provided by the present invention;
[0011] Figure 2 It is a flow chart of a gateway data processing method based on edge algorithm provided by the present invention;
[0012] Figure 3 It is a main structural diagram of an irrigation wireless decoder gateway provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0013] In order to facilitate a clearer understanding of the present invention, the application environment of the gateway data processing method based on the edge algorithm of the present invention is first introduced. Figure 1 As shown, the application environment includes an irrigation wireless decoder gateway 10 and a sensor node cluster. The sensor node cluster may include one or more sensor nodes, and the number of sensor nodes is not limited. Figure 1 As shown, the sensor node cluster can specifically include sensor node 1, sensor node 2, ..., sensor node n; it can be understood that sensor node 1, sensor node 2, sensor node 3, ..., sensor node n can all be connected to the irrigation wireless decoder gateway 10 through a network connection, so that each sensor node can exchange data with the irrigation wireless decoder gateway 10 through a network connection.
[0014] It is understandable that the irrigation wireless decoder gateway 10 may refer to an edge device for executing the method of the present invention, in which a computer program corresponding to the gateway data processing method based on the edge algorithm provided in an embodiment of the present invention is provided (for example, provided in a memory).
[0015] For further information, see Figure 2 , is a flow chart of a gateway data processing method based on an edge algorithm provided by an embodiment of the present invention. The gateway data processing method based on an edge algorithm may include the following steps:
[0016] Step S110: Detect various farmland irrigation activities in the farmland IoT sensor data to obtain farmland irrigation activity detection data. The farmland IoT sensor data is collected and uploaded during the target time period by multiple irrigation sensor nodes deployed in the target farmland area. The multiple irrigation sensor nodes are communicatively connected with the irrigation wireless decoder gateway.
[0017] In an embodiment of the present invention, farmland IoT sensor data is collected and uploaded during a target time period by multiple irrigation sensor nodes deployed in the target farmland area. These irrigation sensor nodes are connected to the irrigation wireless decoder gateway to form an effective data collection and transmission network. For example, in a large area of farmland, multiple irrigation sensor nodes may be deployed evenly or according to a specific plan in different areas, different crop planting plots, etc. These nodes can be different types of sensors such as soil moisture sensors, water flow sensors, meteorological sensors, etc., each of which is responsible for collecting different types of data related to farmland irrigation.
[0018] For example, the soil moisture sensor can monitor the moisture content in the soil in real time. It senses the change in the dielectric constant of the soil through the built-in sensing element, and then converts it into the corresponding soil moisture value according to a specific formula. Assuming that it uses the capacitance method to measure soil moisture, the specific formula can be expressed as: θ = a × C + b, where θ represents soil moisture, C is the capacitance value measured by the sensor, and a and b are constants obtained through calibration. The water flow sensor can be installed in the irrigation pipe to determine the amount of irrigation water by measuring the speed and flow of the water flow. For example, the water flow sensor using the principle of electromagnetic induction, its flow calculation formula can be: Q = k × V × D 2 , where Q represents the flow rate, k is the coefficient, V is the water velocity, and D is the pipe diameter. Meteorological sensors can collect meteorological information such as temperature, humidity, and wind speed.
[0019] The irrigation wireless decoder gateway uses wireless LORA signals to connect field wireless decoders and wireless sensors in the downlink, and uses 4G signals for uplink transmission. Wireless LORA signals have the advantages of long transmission distance and low power consumption, and are suitable for data transmission in vast areas such as farmland. For example, when an irrigation sensor node collects soil moisture data, it sends the data to the wireless receiving module of the irrigation wireless decoder gateway through wireless LORA signals. The 4G signal is used to upload the data processed by the gateway to the cloud or central control system to ensure that the data can be remotely transmitted and analyzed in a timely and efficient manner.
[0020] Farm irrigation activities refer to various specific events that occur during farm irrigation, covering multiple aspects of information. For example, the location of irrigation can be determined by the deployment location of the sensor node. Assuming that sensor nodes are deployed in a grid pattern in the farmland, each node has a unique identifier and corresponding geographic location information. When a node detects an irrigation operation, the specific location where the irrigation occurs can be determined. Irrigation duration is also one of the important farm irrigation activity information. The irrigation wireless decoder gateway can calculate the irrigation duration by recording the time when the irrigation equipment is turned on and off. For example, when the solenoid valve of the irrigation system is turned on, the sensor node can detect the water flow signal and record the time point; when the solenoid valve is closed, the time point is recorded again, and the difference between the two time points is the irrigation duration. The amount of irrigation water is also a key farm irrigation activity information. The amount of water flowing through the pipe can be measured by a water flow sensor, such as the water flow sensor based on the electromagnetic induction principle mentioned above. According to the measured flow rate and irrigation duration, the irrigation water volume can be calculated. The calculation formula is: W = Q × t, where W represents the amount of irrigation water, Q is the flow rate, and t is the irrigation duration.
[0021] In addition, farmland irrigation activities may also include information such as irrigation frequency and irrigation method (such as drip irrigation, sprinkler irrigation, etc.). For the detection of irrigation frequency, the irrigation wireless decoder gateway can count the number of irrigations in each area within a certain period of time. The identification of irrigation methods can be achieved by analyzing the data characteristics collected by the sensor. For example, the change of soil moisture during drip irrigation is relatively slow and uniform, while sprinkler irrigation may cause soil moisture to rise rapidly in a short period of time.
[0022] The irrigation wireless decoder gateway sinks data processing capabilities to edge devices, which is of great significance. By preliminarily processing the collected farmland IoT sensor data locally, the pressure on transmission bandwidth can be reduced. For example, when the data processing capability is not sunk, a large amount of raw sensor data needs to be directly uploaded to the cloud or central control system for processing, which will occupy a large amount of network bandwidth, causing data transmission delays and even network congestion. After preprocessing on the edge device, only the processed key data needs to be uploaded, which greatly reduces the amount of data transmission and improves data transmission efficiency.
[0023] At the same time, sinking data processing capabilities can also improve the real-time nature of data analysis. In farmland irrigation scenarios, real-time nature is very important. For example, when soil moisture drops rapidly, irrigation decisions need to be made in a timely manner. If data is uploaded to the cloud for analysis and decision-making, decisions may not be made in a timely manner due to network delays and other reasons. Real-time processing on edge devices allows local decisions to be made quickly and the corresponding irrigation operations to be performed.
[0024] In addition, the irrigation wireless decoder gateway can run offline when there is no 4G signal to ensure system stability. In some remote farmland areas, the 4G signal may be unstable or no signal. At this time, the gateway can rely on local computing resources and stored data to continue to operate, make irrigation decisions according to preset rules and algorithms, and ensure that farmland irrigation work is not affected by network signals.
[0025] The irrigation wireless decoder gateway mainly includes a wireless receiving module, a data decoding module, an edge computing module, and a communication interface module. The wireless receiving module is responsible for receiving wireless LORA signals from multiple irrigation sensor nodes. For example, when the soil moisture sensor collects data and sends it via a wireless LORA signal, the wireless receiving module will accurately receive these signals to ensure reliable data reception.
[0026] The data decoding module decodes the received signal and converts it into a digital signal that can be recognized and processed by the computer. For example, for sensor data in a specific encoding format, the data decoding module will decode it according to the corresponding decoding algorithm and restore the original sensor data, such as soil moisture value, water flow velocity, etc.
[0027] The edge computing module preprocesses the decoded data, performs data analysis or model inference, thereby achieving preliminary decision-making and data compression locally. For example, the edge computing module can analyze the collected soil moisture data to determine whether irrigation is needed. If the soil moisture is lower than the preset threshold, a decision can be made to start the irrigation equipment, and the data can be compressed to extract key information, such as average humidity, humidity change trend, etc., for subsequent upload and analysis.
[0028] The communication interface module transmits the processed results to the cloud or central control system via 4G or wired network. When the 4G signal is normal, the communication interface module will upload the processed data through the 4G network; when there is wired network access, data can also be transmitted through the wired network to ensure that the data can reach the cloud or central control system accurately and timely, providing support for further data analysis and decision-making.
[0029] Step S120: constructing an implicit representation of irrigation activities for each farmland irrigation activity based on the farmland irrigation activity detection data.
[0030] In step S110, the irrigation wireless decoder gateway has acquired farmland irrigation activity detection data, which contains rich farmland irrigation activity information, such as irrigation location, duration, water volume, frequency, and irrigation method. These specific data information are the basis for constructing implicit representation of irrigation activities. For example, assuming that in a certain target farmland area, the data collected by multiple irrigation sensor nodes show that in a specific time period, the irrigation duration of a certain area is 30 minutes, the irrigation water volume is 50 cubic meters, the irrigation frequency is 2 times a week, and the irrigation method is drip irrigation. These specific data are part of the farmland irrigation activity detection data.
[0031] Implicit representation of irrigation activities is an abstract and general description of the characteristics of farmland irrigation activities. It extracts and transforms the key information contained in the detection data of farmland irrigation activities in a certain way to form a form that is easier to process and analyze, such as an array, such as a vector or a matrix. This representation can capture the inherent characteristics and laws of farmland irrigation activities and provide more effective support for subsequent data analysis and decision-making. For example, for different irrigation activities, there may be some potential associations and patterns. These relationships can be better discovered through implicit representation, so as to more accurately understand the essence of farmland irrigation activities.
[0032] There are many ways to implement the irrigation wireless decoder gateway when constructing an implicit representation of irrigation activities. One of the feasible methods is to use a feature extraction algorithm. For example, the principal component analysis (PCA) algorithm can be used. The main purpose of the PCA algorithm is to project the original data into a low-dimensional space through linear transformation, while retaining the variance information of the original data as much as possible. Assuming that the farmland irrigation activity detection data contains multiple feature dimensions, such as irrigation duration, water volume, soil moisture changes, etc., the PCA algorithm can be used to calculate the principal components of these features, that is, the direction with the largest variance in the data. The specific calculation formula is as follows:
[0033] First, the original data is standardized. Assume that the original data matrix is X, where X ij represents the jth eigenvalue of the i-th sample, the standardized matrix is Z, and the calculation formula is: Among them, μ j is the mean of the jth feature, σ j is the standard deviation of the jth feature. Then, calculate the covariance matrix C of the standardized data: Where n is the number of samples and ZT is the transposed matrix of Z. Next, the covariance matrix C is subjected to eigenvalue decomposition to obtain the eigenvalues λ1≥λ2≥…≥λ p and the corresponding eigenvectors v1,v2,…,v p, where p is the number of feature dimensions. Select the eigenvectors corresponding to the first k largest eigenvalues to form the projection matrix P: P = (v1, v2, ..., v k ), finally, the original data X is projected into the low-dimensional space to obtain the implicit representation Y after dimensionality reduction: Y = ZP.
[0034] Through the PCA algorithm, the irrigation wireless decoder gateway can reduce the dimensionality of multiple features in the farmland irrigation activity detection data, extract the principal components that best represent the data characteristics, and thus construct an implicit representation of the irrigation activity.
[0035] In addition, the autoencoder in deep learning can also be used to construct an implicit representation of irrigation activities. The autoencoder is an unsupervised learning model that consists of an encoder and a decoder. The encoder compresses the input data into a low-dimensional implicit representation, and the decoder attempts to reconstruct the original data from this implicit representation. The irrigation wireless decoder gateway can use the farmland irrigation activity detection data as the input of the autoencoder. By training the autoencoder, it can learn the intrinsic characteristics of the data and obtain an implicit representation of the irrigation activity.
[0036] Step S130: mining the time series distribution between various farmland irrigation activities in the farmland IoT sensor data based on the implicit representation of the irrigation activities of each farmland irrigation activity to obtain the implicit representation of the time series of the farmland irrigation activities.
[0037] In step S120, the irrigation wireless decoder gateway has constructed implicit representations of irrigation activities for various farmland irrigation activities. These implicit representations are abstractions and generalizations of the characteristics of farmland irrigation activities. They contain key information of farmland irrigation activities, such as the location, duration, and water volume of irrigation. For example, for a certain irrigation activity, its implicit representation may be a multidimensional vector, in which each dimension corresponds to different features. In this way, complex irrigation activity information is effectively compressed and represented. These implicit representations provide basic data for mining the temporal distribution between farmland irrigation activities.
[0038] Time series distribution refers to the arrangement and distribution of various farmland irrigation activities in the time series. In the process of farmland irrigation, different irrigation activities have a certain sequence and interval pattern in time, which is of great significance for understanding the needs and patterns of farmland irrigation. For example, in the growth cycle of some crops, there may be specific irrigation stages, such as frequent and small amount of irrigation in the seedling stage, and relatively less but large amount of irrigation in the mature stage. By analyzing the time series distribution between farmland irrigation activities, these patterns can be discovered, thus providing a basis for formulating reasonable irrigation strategies.
[0039] There are many ways to mine the time series distribution between farm irrigation activities. One of the feasible methods is time series analysis. Time series analysis is a statistical method used to process and analyze data that changes over time. It predicts future trends and patterns by analyzing historical data. In the farm irrigation scenario, the occurrence time of each farm irrigation activity can be used as time series data, and the time series distribution pattern can be mined by analyzing the autocorrelation, seasonality and other characteristics of these data.
[0040] For example, the autocorrelation function (ACF) of time series data can be calculated to measure the correlation of data at different time lags. The calculation formula of the autocorrelation function is:
[0041]
[0042] Among them, r k represents the autocorrelation coefficient when the time lag is k, x t represents the tth observation in the time series, x ′ represents the mean of the time series, and n represents the length of the time series. By calculating the autocorrelation coefficient at different time lags, the periodicity and correlation characteristics in the time series data can be found, thereby revealing the temporal distribution law between farmland irrigation activities.
[0043] Another implementation method is based on machine learning methods, such as Hidden Markov Model (HMM). Hidden Markov Model is a statistical model used to describe time series data with hidden states. In the farmland irrigation scenario, the state of the farmland irrigation activity (such as different irrigation stages) can be used as a hidden state, and the observed irrigation activity implicit representation can be used as the observed value. By training the hidden Markov model, the transition probability between different states and the probability distribution of the observed values under each state can be learned, so as to mine the temporal distribution law between farmland irrigation activities. After mining the temporal distribution law between farmland irrigation activities, the irrigation wireless decoder gateway constructs an implicit representation of the farmland irrigation activity time series. This implicit representation is an abstract and general description of the temporal distribution law, which can more effectively capture the characteristics of farmland irrigation activities in time series.
[0044] One method to construct an implicit temporal representation of farmland irrigation activities is to encode the temporal distribution law. For example, different irrigation activities can be numbered according to the time sequence of their occurrence, and then these numbers can be combined into a sequence as an implicit temporal representation. Assuming that within a certain period of time, the order of occurrence of farmland irrigation activities is irrigation activity A, irrigation activity B, and irrigation activity C, then the corresponding implicit temporal representation can be (1,2,3), where 1, 2, and 3 represent the numbers of irrigation activities A, B, and C, respectively.
[0045] Another method is to use the recurrent neural network (RNN) or long short-term memory network (LSTM) in deep learning to learn the temporal characteristics of farmland irrigation activities.
[0046] Assume that in a farmland area, the irrigation sensor nodes collect data on farmland irrigation activities over a period of time, including the occurrence time, irrigation duration, water volume, etc. of the irrigation activities. After the processing of step S120, an implicit representation of each irrigation activity is obtained.
[0047] First, the time series analysis method is used to calculate the autocorrelation function of the time when irrigation activities occur. Assume that after calculation, it is found that the autocorrelation coefficient has obvious peaks when the time lag is 7 days and 14 days, which indicates that farmland irrigation activities may have a regularity with a cycle of 7 days and 14 days. This may be related to the growth cycle of crops and the law of water demand.
[0048] Then, further analysis is performed based on the hidden Markov model. Assume that farmland irrigation activities are divided into three hidden states: irrigation during the seedling stage, irrigation during the growing stage, and irrigation during the mature stage. By training the hidden Markov model, the transition probabilities between different states and the probability distribution of observations in each state are learned. For example, the probability of transitioning from the seedling stage irrigation state to the growing stage irrigation state is 0.6, and the probability of transitioning from the growing stage irrigation state to the mature stage irrigation state is 0.4, etc.
[0049] Finally, an implicit representation of the time series of farmland irrigation activities is constructed. For example, by using a numbering coding method, the irrigation activities in the seedling stage are numbered 1, the irrigation activities in the growing stage are numbered 2, and the irrigation activities in the mature stage are numbered 3. If the order of irrigation activities in a certain period of time is irrigation in the seedling stage, irrigation in the growing stage, and irrigation in the mature stage, then the corresponding implicit representation of the time series is (1,2,3).
[0050] Step S140: Based on the implicit representation of irrigation activities and the implicit representation of farmland irrigation activity timing, detect whether the farmland IoT sensor data and the mode example sensor data in the irrigation mode list meet the commonality condition.
[0051] In the previous steps, the irrigation wireless decoder gateway has obtained the implicit representation of farmland irrigation activities and the implicit representation of farmland irrigation activity time series. The implicit representation of irrigation activities is an abstract and general description of the characteristics of farmland irrigation activities. It contains the key information of irrigation activities, such as the comprehensive embodiment of irrigation location, duration, water volume and other characteristics.
[0052] The irrigation mode list is a predefined list or a list that is continuously updated and improved during the operation of the system, which contains a variety of different irrigation modes and corresponding mode example sensor data. The irrigation mode is a series of irrigation strategies and methods formulated based on factors such as soil type, crop type, and climatic conditions of the farmland. The mode example sensor data is the farmland IoT sensor data collected under a specific irrigation mode, which represents the typical characteristics and laws of farmland irrigation activities under this irrigation mode.
[0053] For example, for wheat fields, there may be a "water-saving irrigation mode", and the corresponding mode example sensor data includes information such as irrigation time, irrigation water volume, soil moisture changes, etc. at different growth stages. These data are obtained through actual irrigation operations and sensor collection under the premise of following the principle of water conservation, and can reflect the characteristics and effects of this irrigation mode.
[0054] The irrigation wireless decoder gateway can use multiple implementation methods to detect whether the farmland IoT sensor data and the pattern example sensor data meet the commonality conditions. One feasible method is similarity calculation. By calculating the similarity between the implicit representation of irrigation activities and the implicit representation of farmland irrigation activities in time series and the implicit representation corresponding to the pattern example sensor data, it is judged whether the commonality conditions are met.
[0055] For example, cosine similarity can be used to calculate the similarity between two vectors. Assume that the implicit representation vector of irrigation activity of farmland IoT sensor data is A = (a1, a2, ..., a n ), the implicit representation vector of irrigation activity corresponding to the sensor data of the pattern example is B = (b1, b2, …, b n ), then the cosine similarity calculation formula between them is:
[0056]
[0057] Among them, cos(θ) represents cosine similarity, and its value range is between [-1,1]. The closer the value is to 1, the more similar the two vectors are.
[0058] For the implicit representation of the time series of farm irrigation activities, a similar method can also be used to calculate the similarity. For example, the implicit representation of the time series of farm irrigation activities is represented as a sequence, and their similarity is measured by calculating indicators such as the edit distance or the longest common subsequence between two sequences. The edit distance refers to the minimum number of operations required to transform one sequence into another, and the operations include insertion, deletion, and substitution.
[0059] In the specific detection process, the irrigation wireless decoder gateway first obtains the implicit representation of irrigation activities and the implicit representation of the timing of farmland irrigation activities from the farmland IoT sensor data, and then traverses the pattern example sensor data in the irrigation pattern list, and calculates their similarity with the farmland IoT sensor data respectively.
[0060] In step S140, the irrigation wireless decoder gateway uses the implicit representation of irrigation activities and the implicit representation of the timing of farmland irrigation activities, and adopts similarity calculation and other implementation methods to detect whether the farmland IoT sensor data and the pattern example sensor data in the irrigation pattern list meet the common conditions, thereby providing an important basis for the subsequent determination of the irrigation needs of the farmland.
[0061] Step S150: When pattern example sensor data whose pattern commonality coefficients meet the commonality condition with the farmland IoT sensor data is detected in the irrigation pattern list, the irrigation demand corresponding to the pattern example sensor data meeting the commonality condition is determined as the irrigation demand of the target farmland area.
[0062] The pattern commonality coefficient is a quantitative indicator used to measure the similarity between farmland IoT sensor data and pattern example sensor data in the irrigation pattern list. It comprehensively considers the characteristics of the implicit representation of irrigation activities and the implicit representation of farmland irrigation activity timing. In step S140, the irrigation wireless decoder gateway calculates the similarity between farmland IoT sensor data and pattern example sensor data through various implementation methods (such as the similarity calculation method mentioned above), and this similarity value can be used as a manifestation of the pattern commonality coefficient.
[0063] The commonality condition is a pre-set judgment standard used to determine whether the farmland IoT sensor data and the pattern example sensor data are similar enough to determine whether the two belong to the same irrigation mode. The setting of the commonality condition needs to comprehensively consider factors such as the actual situation of farmland irrigation, data characteristics, and system accuracy requirements. For example, based on historical data and actual experience, a reasonable similarity threshold is set as the commonality condition. When the pattern commonality coefficient is greater than or equal to this threshold, it is considered that the two meet the commonality condition.
[0064] When determining the irrigation needs of the target farmland area, the irrigation wireless decoder gateway mainly relies on the pattern example sensor data that meets the common conditions found in the irrigation pattern list. This involves the association and matching of the pattern example sensor data and its corresponding irrigation needs.
[0065] One feasible implementation method is to establish a database or data table to store the information in the irrigation mode list. In this database, each mode example sensor data is associated with the corresponding irrigation demand information. The irrigation demand information may include specific parameters such as the irrigation time interval, irrigation water volume, and irrigation method. When the mode example sensor data that meets the common conditions is detected, the irrigation wireless decoder gateway obtains the irrigation demand information corresponding to the mode example sensor data by querying the database, and determines it as the irrigation demand of the target farmland area.
[0066] For example, a relational database can be used to store this information. The database contains two main tables: one is the pattern example sensor data table, which is used to store various pattern example sensor data and their characteristic information, such as implicit representation of irrigation activities, implicit representation of farmland irrigation activity timing, etc.; the other is the irrigation demand table, which is used to store irrigation demand information corresponding to different irrigation modes. The two tables are associated through a unique pattern identification field. When it is necessary to determine the irrigation demand of the target farmland area, the irrigation wireless decoder gateway finds the pattern identification of the pattern example sensor data that meets the commonality conditions based on the calculated pattern commonality coefficient, and then queries the corresponding irrigation demand information in the irrigation demand table through this pattern identification.
[0067] After determining the irrigation needs, the irrigation wireless decoder gateway can send this information to the irrigation control system to control the irrigation equipment to perform irrigation operations according to the determined irrigation needs. For example, it can control the opening time of the irrigation nozzle, water flow rate and other parameters to achieve an automated and intelligent irrigation process.
[0068] In one implementation, step S130, based on the implicit representation of irrigation activities of each farmland irrigation activity, mining the time series distribution between each farmland irrigation activity in the farmland IoT sensor data to obtain the implicit representation of the farmland irrigation activity time series, includes:
[0069] Step S131: based on the implicit representation of irrigation activities of each farmland irrigation activity, quantify the characteristics of each farmland irrigation activity to obtain a characteristic code of each farmland irrigation activity;
[0070] Step S132: constructing a feature code sequence corresponding to the farmland IoT sensor data based on the time series distribution of each farmland irrigation activity in the farmland IoT sensor data and the feature code of each farmland irrigation activity;
[0071] Step S133: mining implicit temporal representation of farmland irrigation activities from the feature code sequence.
[0072] In step S131, the irrigation wireless decoder gateway converts the abstract implicit representation of irrigation activities into a specific, quantifiable feature code, so as to analyze and process the temporal distribution of farmland irrigation activities in the future. The feature quantization process is to extract the key information from the implicit representation of irrigation activities and represent it as a feature code through some encoding method.
[0073] One feasible implementation method is to adopt the idea of cluster analysis. The irrigation wireless decoder gateway can implicitly represent the irrigation activities of all farmland irrigation activities as data samples, and divide these samples into different categories through clustering algorithms. Each category can be regarded as a set of farmland irrigation activities with similar characteristics, and then a unique numerical number is assigned to each category as a feature code.
[0074] For example, suppose there is an implicit representation of irrigation activities for a series of farmland irrigation activities. These implicit representations are multidimensional vectors obtained through a certain feature extraction algorithm. The irrigation wireless decoder gateway can cluster these vectors using the K-Means clustering algorithm. The basic idea of the K-Means algorithm is to divide the data samples into K clusters so that the distance from each sample to the center of the cluster to which it belongs is minimized. The specific steps are as follows:
[0075] First, randomly select K initial cluster centers. Assume that K = 3, that is, the farmland irrigation activities are to be divided into 3 categories. The initial cluster centers can be 3 irrigation activity implicit representation vectors randomly selected from the data sample.
[0076] Then, the distance from each data sample (implicit representation vector of irrigation activity) to each cluster center is calculated. The feasible distance measurement method is the Euclidean distance. For two n-dimensional vectors x = (x1, x2, ..., x n ) and y=(y1,y2,…,y n ), the calculation formula of Euclidean distance is: According to the calculated distance, each data sample is assigned to the cluster to which the closest cluster center belongs. Then, the cluster center of each cluster is updated. The new cluster center is the mean vector of all data samples in the cluster. Repeat the above steps until the cluster center no longer changes or the predetermined number of iterations is reached.
[0077] After cluster analysis, three different clusters were obtained, corresponding to three different types of farmland irrigation activities. Then a numerical number was assigned to each cluster, such as the characteristic code of cluster 1 is 1, the characteristic code of cluster 2 is 2, and the characteristic code of cluster 3 is 3. In this way, each farmland irrigation activity can obtain the corresponding characteristic code according to the cluster to which it belongs, realizing the quantification of the characteristics of farmland irrigation activities.
[0078] In step S132, after obtaining the characteristic code of each farmland irrigation activity, the irrigation wireless decoder gateway combines the characteristic codes into a characteristic code sequence according to the temporal distribution of the farmland irrigation activities in the farmland IoT sensor data, so as to more clearly reflect the time sequence and regularity of the farmland irrigation activities.
[0079] Specifically, the irrigation wireless decoder gateway determines the position of each farmland irrigation activity in the time series according to the occurrence time of each farmland irrigation activity in the farmland IoT sensor data. Then, the feature codes of each farmland irrigation activity are arranged in chronological order to form a feature code sequence.
[0080] For example, suppose that farmland IoT sensor data records five farmland irrigation activities that occurred within a period of time, which are marked as activity A, activity B, activity C, activity D, and activity E. After the feature quantization in step S131, their corresponding feature codes are 2, 1, 3, 2, and 1. According to the time information recorded in the farmland IoT sensor data, the order of occurrence of these irrigation activities is activity B, activity A, activity D, activity C, and activity E. Then, the feature code sequence constructed by the irrigation wireless decoder gateway is (1, 2, 2, 3, 1).
[0081] When constructing the feature code sequence, it is also necessary to consider the data processing of the time period without farmland irrigation activities. One feasible method is to set the data items of these time periods to a predefined value, such as 0. Assuming that the time span of farmland IoT sensor data is 10 time units, and the above five farmland irrigation activities occurred in time units 2, 4, 6, 8, and 9 respectively, then the constructed feature code sequence can be expressed as (0, 1, 0, 2, 0, 2, 0, 3, 1, 0), where 0 means that no farmland irrigation activities occurred in the time unit.
[0082] In step S133, on the basis of constructing the feature code sequence, the implicit representation of farmland irrigation activity time series contained therein is further mined. The implicit representation of farmland irrigation activity time series can reflect the law and characteristics of farmland irrigation activity in a more abstract and essential way.
[0083] One implementation method is to use an activity temporal relationship to extract edge algorithms. This algorithm usually includes multiple temporal filters connected in sequence, and extracts temporal features from the feature code sequence by filtering and processing it.
[0084] Specifically, the irrigation wireless decoder gateway passes the signature sequence to the first timing filter in the activity timing relationship extraction edge algorithm. The timing filter can be a linear filter, such as a finite impulse response (FIR) filter. The output y(n) of the FIR filter is the convolution of the input sequence x(n) and the filter coefficient h(n), calculated as: Where N is the order of the filter, h(k) is the filter coefficient, and x(n) is the input feature code sequence.
[0085] After being processed by the first time series filter, a preliminary filtering result is obtained. Then, this result is passed as input to the next time series filter, and is processed by multiple time series filters in turn. Each time series filter can filter and extract different frequency components of the feature code sequence.
[0086] After being processed by multiple time series filters, the irrigation wireless decoder gateway downsamples the outputs of these time series filters. Downsampling is an operation that reduces the data sampling rate, which can reduce the amount of data while retaining the main features of the data. For example, for a sequence of length N, after a downsampling operation with a downsampling factor of M, the length of the new sequence obtained is N / M, and each element in the new sequence is obtained by selecting one every M elements in the original sequence. Finally, the outputs of multiple time series filters after downsampling are integrated, such as by weighted summation or splicing, to obtain an implicit representation of the time series of farm irrigation activities.
[0087] For example, suppose there is a feature code sequence (1,2,2,3,1,0,2,3,2,1). After being processed by three temporal filters, the output sequences are (1.2,1.5,1.8,2.1,1.4,0.8,1.6,1.9,1.7,1.3), (0.9,1.1,1.3,1.6,1.0,0.6,1.2,1.5,1.4,1.1) and (1.1,1.3,1.5,1.8,1.2,0.7,1.4,1.7,1.6,1.2). Then, the three output sequences are downsampled, assuming that the downsampling factor is 2, and the downsampled sequences are (1.2, 1.8, 1.4, 1.6, 1.3), (0.9, 1.3, 1.0, 1.5, 1.1), and (1.1, 1.5, 1.2, 1.7, 1.2). Finally, the three downsampled sequences are integrated by weighted summation, assuming that the weights are 0.3, 0.3, and 0.4, respectively, and the implicit representation of the farmland irrigation activity time series is (1.11, 1.47, 1.21, 1.64, 1.22).
[0088] In one implementation, step S131, based on the implicit representation of irrigation activities of each farmland irrigation activity, quantifying the characteristics of each farmland irrigation activity to obtain a characteristic code of each farmland irrigation activity includes:
[0089] Step S1311: obtaining a plurality of cluster representative points, where the cluster representative points are obtained by cluster analysis of implicit representations of irrigation activities of farmland irrigation activities covered in the pattern example sensing data;
[0090] Step S1312: determining a cluster representative point that is most similar to the implicit representation of the irrigation activity of each farmland irrigation activity based on the feature similarity between the implicit representation of the irrigation activity of each farmland irrigation activity and a plurality of cluster representative points;
[0091] Step S1313: constructing a feature code for each farmland irrigation activity according to the numerical number corresponding to the cluster representative point that is most similar to the implicit representation of the irrigation activity of each farmland irrigation activity.
[0092] In step S1311, the irrigation wireless decoder gateway obtains a plurality of cluster representative points, which are obtained by cluster analysis of the implicit representation of irrigation activities of farmland irrigation activities in the pattern example sensor data. Cluster analysis is a data analysis technique that groups data objects into multiple classes or clusters, so that data objects within the same cluster have high similarity, while data objects between different clusters have large differences.
[0093] When implementing cluster analysis, the irrigation wireless decoder gateway can use a variety of clustering algorithms, such as the K-Means algorithm. Assume that the model example sensor data contains a large number of implicit representations of irrigation activities for farmland irrigation activities, and these implicit representations can be represented as multi-dimensional vectors. For example, each irrigation activity implicit representation vector may contain feature values of multiple dimensions such as irrigation duration, irrigation water volume, soil moisture changes, etc. The following is the specific process of using the K-Means algorithm to obtain cluster representative points:
[0094] First, determine the number of clusters K. The selection of K usually needs to be determined based on the characteristics of the data and actual needs. For example, the appropriate K value can be determined by observing the distribution of the data, business knowledge, or using some evaluation indicators (such as silhouette coefficient, etc.). Assume that based on experience and data characteristics, K=5 is determined, that is, farm irrigation activities are to be divided into 5 different clusters. Then, randomly select K initial cluster centers. These initial cluster centers can be K irrigation activity implicit representation vectors randomly selected from the pattern example sensor data.
[0095] Next, the distance from each irrigation activity implicit representation vector to each cluster center is calculated. After that, the cluster center of each cluster is updated. The new cluster center is the mean vector of all irrigation activity implicit representation vectors in the cluster. Repeat the above steps of calculating distance, assigning clusters, and updating cluster centers until the cluster center no longer changes or the predetermined number of iterations is reached.
[0096] After many iterations, the K-Means algorithm converged and obtained 5 stable cluster centers, which are the representative points of the clusters.
[0097] In step S1312, after obtaining multiple cluster representative points, the irrigation wireless decoder gateway calculates the feature similarity between the implicit representation of the irrigation activity of each farmland irrigation activity and these cluster representative points to determine the most similar cluster representative point. The feature similarity can be calculated using a variety of methods, including cosine similarity and Euclidean distance similarity.
[0098] In step S1313, after determining the cluster representative points that are most similar to the implicit representation of the irrigation activities of each farmland irrigation activity, the irrigation wireless decoder gateway constructs the feature code of each farmland irrigation activity according to the numerical numbers corresponding to these cluster representative points.
[0099] Assume that among the five cluster representative points obtained above, numerical numbers are assigned to them respectively, p1 corresponds to number 1, p2 corresponds to number 2, p3 corresponds to number 3, p4 corresponds to number 4, and p5 corresponds to number 5.
[0100] For the irrigation activity implicit representation vector of the farmland irrigation activity calculated above Since the most similar cluster representative point is p1, and the numerical number corresponding to p1 is 1, the characteristic code of the farmland irrigation activity is 1.
[0101] Assume that there is another implicit representation vector of irrigation activity for farmland irrigation: By calculating the cosine similarity between it and the representative points of the five clusters, it is found that it is most similar to p4, so the characteristic code of the farmland irrigation activity is 4.
[0102] In this way, the irrigation wireless decoder gateway can construct corresponding feature codes for each farmland irrigation activity, and realize the quantification of the features of farmland irrigation activities. These feature codes can more concisely and effectively represent the features of farmland irrigation activities, and provide a basis for the subsequent mining of the time series distribution between farmland irrigation activities and the construction of implicit representation of farmland irrigation activity time series.
[0103] In one implementation, the gateway data processing method based on the edge algorithm also includes a process of determining a cluster representative point, including:
[0104] Step S131a: obtaining the number of predefined farmland irrigation activities and the number of farmland irrigation activities related to the predefined farmland irrigation activities, and obtaining implicit representations of irrigation activities of the farmland irrigation activities covered in the sensing data of the pattern example;
[0105] Step S131b: determining the number of cluster representative points based on the number of predefined farmland irrigation activities and the number of related farmland irrigation activities;
[0106] Step S131c: Based on the number of cluster representative points, cluster analysis is performed on the implicit representation of irrigation activities of the farmland irrigation activities covered in the pattern example sensing data to obtain multiple cluster representative points.
[0107] In step S131a, the irrigation wireless decoder gateway collects various data information. The first is the number of predefined farmland irrigation activities, which is the number of some typical irrigation activities predetermined based on the specific conditions of the farmland, the growth requirements of the crops, and previous irrigation experience. For example, in a specific farmland area, according to the type and growth cycle of the crops planted, 5 feasible farmland irrigation activities are predefined, such as irrigation during the seedling stage, irrigation during the growth period, irrigation during the flowering period, irrigation during the fruit expansion period, and irrigation during the ripening period, then the number of predefined farmland irrigation activities is 5.
[0108] The number of related farmland irrigation activities of predefined farmland irrigation activities is the number of other irrigation activities that are related to or affect these predefined irrigation activities. For example, during irrigation in the seedling stage, additional supplementary irrigation may be required due to changes in soil moisture. This supplementary irrigation activity is the farmland irrigation activity related to seedling irrigation. Assuming that there are two types of farmland irrigation activities related to seedling irrigation, namely supplementary irrigation during mild drought and emergency supplementary irrigation during severe drought, the number of related farmland irrigation activities for seedling irrigation is 2. For other predefined farmland irrigation activities, there may also be related farmland irrigation activities, and the numbers of these related farmland irrigation activities are statistically summarized.
[0109] At the same time, the irrigation wireless decoder gateway also needs to obtain the implicit representation of irrigation activities for farmland irrigation activities covered in the pattern example sensor data. The pattern example sensor data is farmland IoT sensor data collected under a specific irrigation mode, which contains rich information about farmland irrigation activities. The implicit representation of irrigation activities is an abstract and general description of the characteristics of these irrigation activities, which can usually be expressed as a multi-dimensional vector. For example, for an irrigation activity, its implicit representation vector of irrigation activities may contain characteristic values of multiple dimensions such as irrigation duration, irrigation water volume, soil moisture during irrigation, and ambient temperature. Assuming that there are 100 records of farmland irrigation activities in the pattern example sensor data, there will be 100 corresponding implicit representation vectors of irrigation activities.
[0110] In step S131b, after obtaining the number of predefined farmland irrigation activities and the number of related farmland irrigation activities, the irrigation wireless decoder gateway determines the number of cluster representative points based on these data. The determination of the number of cluster representative points needs to comprehensively consider the diversity and complexity of the predefined farmland irrigation activities and their related activities.
[0111] One feasible method is to add the number of predefined farmland irrigation activities and the number of related farmland irrigation activities to get a sum value, and then determine the number of cluster representative points based on this sum value, the distribution characteristics of the data, and the analysis requirements. For example, the number of predefined farmland irrigation activities mentioned above is 5, and the number of related farmland irrigation activities is 8 after statistical aggregation, so the sum value is 13. Assuming that based on experience and data characteristics, it is believed that each different type of irrigation activity and its related activities may form a relatively independent cluster, then the number of cluster representative points can be preliminarily determined to be 13.
[0112] However, in practical applications, the distribution of data also needs to be considered. If the differences between some irrigation activities and their related activities are small, they may be combined into one cluster. In this case, the number of cluster representative points needs to be appropriately reduced. For example, after further analysis of the data, it was found that some supplementary irrigation activities during mild droughts and conventional irrigation activities during a specific growth period are similar in terms of irrigation duration, water volume and other characteristics. In this case, they can be combined into one cluster, and accordingly, the number of cluster representative points can be adjusted from 13 to 12.
[0113] In step S131c, after determining the number of cluster representative points, the irrigation wireless decoder gateway starts cluster analysis on the implicit representation of irrigation activities of farmland irrigation activities covered in the pattern example sensing data to obtain multiple cluster representative points. Cluster analysis is a data analysis technique that groups data objects into multiple classes or clusters, so that data objects within the same cluster have high similarity, while data objects between different clusters have large differences. The above content has been introduced and will not be repeated here.
[0114] In one implementation, step S132, based on the time series distribution of each farmland irrigation activity in the farmland IoT sensor data and the feature code of each farmland irrigation activity, constructs a feature code sequence corresponding to the farmland IoT sensor data, including:
[0115] Step S1321: Based on the time series distribution of each farmland irrigation activity in the farmland IoT sensor data, the feature code of each farmland irrigation activity is used to replace the data item at the time series distribution of each farmland irrigation activity;
[0116] Step S1322: Change the data items in the farmland IoT sensor data, except for the time series distribution of each farmland irrigation activity, to predefined values, so as to construct a feature code sequence corresponding to the farmland IoT sensor data.
[0117] In step S1321, the irrigation wireless decoder gateway replaces the corresponding data items in the time series distribution position with the feature codes of each farmland irrigation activity according to the time series distribution information of the farmland irrigation activity in the farmland IoT sensor data. The farmland IoT sensor data is a series of data related to farmland irrigation recorded in chronological order, which includes the time points of each farmland irrigation activity and other relevant information. The time series distribution of farmland irrigation activities clarifies the specific position of each irrigation activity in the entire time series.
[0118] For example, suppose there is a piece of farmland IoT sensor data that records the irrigation conditions of a farmland in a week. The time series is in hours, and the total duration is 168 hours (7 days a week, 24 hours a day). In this time series, three farmland irrigation activities are recorded, which occurred at the 24th hour, the 72nd hour, and the 120th hour respectively. After the processing in the previous steps, the feature codes corresponding to these three farmland irrigation activities are 1, 2, and 3 respectively.
[0119] In the original farmland IoT sensor data, each time point may record data collected by multiple sensors, such as soil moisture, temperature, etc. Assume that the original data item corresponding to the 24th hour is (humidity: 30%, temperature: 25°C), the original data item corresponding to the 72nd hour is (humidity: 28%, temperature: 26°C), and the original data item corresponding to the 120th hour is (humidity: 26%, temperature: 27°C). When the irrigation wireless decoder gateway executes step S1321, it will replace the data item at the 24th hour with feature code 1, the data item at the 72nd hour with feature code 2, and the data item at the 120th hour with feature code 3. After the replacement, in the new data sequence, the data corresponding to the 24th hour becomes 1, the data corresponding to the 72nd hour becomes 2, and the data corresponding to the 120th hour becomes 3, while the data items at other time points where farmland irrigation activities do not occur remain unchanged.
[0120] The irrigation wireless decoder gateway can be implemented by traversing the time series. Specifically, the gateway starts from the starting point of the time series and checks whether there is any farmland irrigation activity at each time point. If a farmland irrigation activity is detected at a certain time point, the feature code corresponding to the irrigation activity is found and the data item at that time point is replaced with the feature code.
[0121] In step S1322, after completing the replacement of the data items at the time series distribution of the farmland irrigation activities in step S1321, the irrigation wireless decoder gateway processes the remaining unreplaced data items in the farmland IoT sensor data, that is, changes these data items to predefined values, thereby finally constructing a feature code sequence corresponding to the farmland IoT sensor data.
[0122] The predefined value is a specific value set in advance during the system design phase, which is used to indicate that no farm irrigation activity occurred at that time point. The selection of this value is usually different from the characteristic code of the farm irrigation activity, so that in the subsequent data analysis and processing, it can be clearly identified at which time points the irrigation activity occurred and which time points did not occur. For example, the predefined value can be set to 0.
[0123] Continuing with the above example, after the processing of step S1321, except for the data items at the 24th hour, the 72nd hour and the 120th hour in the time series being replaced with feature codes, the data items at other time points still retain the original sensor data. Now, the irrigation wireless decoder gateway will change all these remaining data items to the predefined value 0. In this way, the feature code sequence finally constructed clearly reflects the distribution of farmland irrigation activities in the time series, where the feature code represents the time point where irrigation activities occur, and the predefined value 0 represents the time point where no irrigation activities occur.
[0124] For example, after this step, the feature code sequence may be as follows (only part of the data is shown): (0,0,…,0,1,0,0,…,0,2,0,0,…,0,3,0,0,…,0), where 1, 2, and 3 correspond to feature codes of different farmland irrigation activities, and the middle 0 indicates that no farmland irrigation activity occurred at the corresponding time point. In the actual implementation process, the irrigation wireless decoder gateway can traverse the time series again and assign predefined values to those data items that are not replaced by feature codes.
[0125] Through the operations of steps S1321 to S1322, the irrigation wireless decoder gateway successfully constructs the feature code sequence corresponding to the farmland IoT sensor data. This feature code sequence not only contains the characteristic information of farmland irrigation activities, but also reflects their distribution in the time series, providing an important data basis for the subsequent mining of implicit representations of farmland irrigation activities from the feature code sequence.
[0126] In one implementation, step S133, mining the implicit representation of the farmland irrigation activity time sequence from the feature code sequence, includes:
[0127] Step S1331: passing the feature code sequence into the activity temporal relationship extraction edge algorithm, the activity temporal relationship extraction edge algorithm includes a plurality of sequentially connected temporal filters, and the feature code sequence is passed into the first temporal filter among the plurality of temporal filters;
[0128] Step S1332: down-sample the outputs of multiple time series filters in the multiple time series filters and then integrate them to obtain an implicit representation of the farmland irrigation activity time series.
[0129] In step S1331, the irrigation wireless decoder gateway inputs the constructed feature code sequence into the activity time series relationship extraction edge algorithm to further mine the implicit representation of the farmland irrigation activity time series contained therein. The activity time series relationship extraction edge algorithm is an algorithm specially designed for processing and analyzing time series data. It gradually processes the input feature code sequence through multiple sequentially connected time series filters to extract the feature information related to the farmland irrigation activity time series.
[0130] A time series filter is a tool that can filter time series data. It can perform weighting, smoothing, feature extraction and other operations on the input sequence data according to specific filtering rules and parameters, thereby highlighting or suppressing certain specific frequency components or characteristic patterns in the data. Each time series filter has its own specific functions and parameter settings. Multiple time series filters are connected in sequence to form a processing chain to process the feature code sequence step by step.
[0131] For example, suppose there is a feature code sequence that represents the irrigation activity of a certain farmland over a period of time. The feature code sequence is (0, 1, 0, 2, 0, 0, 3, 0, 1, 0), where 0 represents no irrigation activity, and 1, 2, and 3 represent different types of farmland irrigation activities. When the irrigation wireless decoder gateway passes this feature code sequence to the activity timing relationship extraction edge algorithm, it will first pass it to the first timing filter.
[0132] The first time series filter is, for example, a simple moving average filter, which smoothes the input feature code sequence to reduce the impact of noise and short-term fluctuations. The basic principle of the moving average filter is to calculate the average value of each data point in the sequence and the data points within a certain range around it as the filtered output of the data point. Assume that the window size of the moving average filter is 3, that is, the average value of each data point and the data points before and after it is calculated. For the second data point 1 in the feature code sequence, its filtered output is (0+1+0) / 3=1 / 3; for the third data point 0, its filtered output is (1+0+2) / 3=1; and so on. After being processed by the first time series filter, a preliminary filtered sequence is obtained.
[0133] In step S1332, after being processed by multiple time series filters, the irrigation wireless decoder gateway further processes the outputs of these time series filters to obtain the final implicit representation of the farmland irrigation activity time series. Downsampling is a data downsampling technology that reduces the amount of data by reducing the sampling frequency of the data while retaining the main features of the data. In time series data processing, downsampling usually extracts data at a certain sampling interval to obtain a new data sequence with a lower sampling frequency. For example, for a time series data with an original sampling frequency of 10Hz, after downsampling with a downsampling factor of 2, the sampling frequency of the new data sequence becomes 5Hz, that is, one data point is extracted every other data point. Assume that after being processed by multiple time series filters, three output sequences are obtained, namely sequence A: (0.2, 0.4, 0.6, 0.8, 1.0), sequence B: (0.3, 0.5, 0.7, 0.9, 1.1), and sequence C: (0.1, 0.3, 0.5, 0.7, 0.9). If a downsampling process with a downsampling factor of 2 is used, then after downsampling sequence A, a new sequence A' is obtained: (0.2, 0.6, 1.0); after downsampling sequence B, a new sequence B' is obtained: (0.3, 0.7, 1.1); after downsampling sequence C, a new sequence C' is obtained: (0.1, 0.5, 0.9).
[0134] Integration processing is to merge and synthesize multiple sequences after downsampling processing to generate the final implicit representation of farmland irrigation activity time series. There are many methods of integration processing, including weighted summation, splicing, etc.
[0135] Weighted summation is to assign a weight to each downsampled sequence, and then perform weighted summation of the data points at the corresponding positions in each sequence according to the weight to obtain the final integration result. For example, assuming that the weights 0.3, 0.4, and 0.3 are assigned to the new sequences A', B', and C' respectively, then the result sequence after integration is: (0.2×0.3+0.3×0.4+0.1×0.3, 0.6×0.3+0.7×0.4+0.5×0.3, 1.0×0.3+1.1×0.4+0.9×0.3)=(0.21, 0.65, 1.01).
[0136] Splicing is to directly connect the downsampled sequences together to form a longer sequence as the final integration result. For example, the resulting sequence obtained by splicing the new sequences A', B', and C' is: (0.2, 0.6, 1.0, 0.3, 0.7, 1.1, 0.1, 0.5, 0.9).
[0137] In practical applications, the irrigation wireless decoder gateway can select the appropriate integration processing method according to specific needs and data characteristics. For example, if you want to highlight the output results of certain time series filters, you can use the weighted summation method and assign larger weights to important sequences; if you want to retain more original information, you can use the splicing method.
[0138] In one implementation, the gateway data processing method based on the edge algorithm also includes a training process of the activity temporal relationship extraction edge algorithm, including:
[0139] Step S133a: obtaining a learning sample set for training an activity temporal relationship extraction edge algorithm, the learning sample set comprising reference IoT sensor data samples, similar IoT sensor data samples, and heterogeneous IoT sensor data samples; wherein the reference IoT sensor data samples, similar IoT sensor data samples, and heterogeneous IoT sensor data samples are all feature code sequences;
[0140] Step S133b: passing the learning sample set into the activity temporal relationship extraction edge algorithm, executing the activity temporal relationship extraction edge algorithm to obtain a first coded implicit representation of the reference IoT sensor data sample, a second coded implicit representation of the heterogeneous IoT sensor data sample, and a third coded implicit representation of the homogeneous IoT sensor data sample;
[0141] Step S133c: based on the first feature similarity between the first coded implicit representation and the second coded implicit representation, and the second feature similarity between the first coded implicit representation and the third coded implicit representation, obtaining a difference result between the first feature similarity and the second feature similarity;
[0142] Step S133d: Taking the difference result being less than or equal to a predefined value as a learning criterion, the algorithm weight of the activity time series relationship extraction edge algorithm is modified.
[0143] In step S133a, the irrigation wireless decoder gateway collects a learning sample set for training the activity temporal relationship extraction edge algorithm. The learning sample set is composed of different types of IoT sensor data samples, which are of great significance for the algorithm to learn and understand the temporal relationship of farmland irrigation activities.
[0144] The reference IoT sensor data sample is a feature code sequence used as a reference standard, which represents a specific time sequence pattern of farmland irrigation activities. For example, in a certain farmland area, based on historical data and expert experience, an ideal time sequence pattern of irrigation activities at a specific stage of crop growth is determined, such as irrigation every 3 days, each irrigation lasting 2 hours. The corresponding feature code sequence is (0,0,1,0,0,1,0,0,1,...), where 1 indicates irrigation activity and 0 indicates no irrigation activity. This sequence can be used as a reference IoT sensor data sample.
[0145] The similar IoT sensor data samples have similar farmland irrigation activity time series characteristics with the reference IoT sensor data samples, and they are close to the reference IoT sensor data samples in terms of the time interval and duration of irrigation activities. For example, the irrigation activity time series pattern of another farmland area is irrigation every 2.8 days, and each irrigation lasts for 2.1 hours. The corresponding feature code sequence is (0,0,1,0,0,1,0,0,1,...). This sequence is similar to the previous reference IoT sensor data sample in terms of overall time series characteristics and can be used as a similar IoT sensor data sample.
[0146] The heterogeneous IoT sensor data samples have significantly different time series characteristics of farmland irrigation activities from the reference IoT sensor data samples. For example, due to special soil conditions or crop requirements, a farmland area adopts an irrigation mode of irrigation every 7 days, with each irrigation lasting 4 hours. The corresponding feature code sequence is (0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,...), which is quite different from the previous reference IoT sensor data samples and can be used as heterogeneous IoT sensor data samples.
[0147] In order to obtain these learning sample sets, the irrigation wireless decoder gateway can retrieve relevant farmland IoT sensor data records from the historical database, and obtain different feature code sequences as learning samples after the data processing and feature code sequence construction process in the previous steps. At the same time, it is also possible to determine which feature code sequences belong to reference IoT sensor data samples, similar IoT sensor data samples, and heterogeneous IoT sensor data samples through manual annotation based on expert knowledge and actual needs.
[0148] In step S133b, after obtaining the learning sample set, the irrigation wireless decoder gateway transmits these samples to the activity temporal relationship extraction edge algorithm for processing. The activity temporal relationship extraction edge algorithm encodes different types of IoT sensor data samples and generates corresponding encoded implicit representations.
[0149] Encoded implicit representation is a representation that is obtained after algorithm processing and can reflect data characteristics more abstractly. It extracts the key information contained in the input feature code sequence through a series of calculations and transformations.
[0150] For example, for the reference IoT sensor data sample (0,0,1,0,0,1,0,0,1,...), the activity temporal relationship extraction edge algorithm may be processed through a multi-layer neural network structure. First, the input layer receives the feature code sequence, and then after calculations in several hidden layers, the neurons in each hidden layer perform weighted summation and activation function processing on the input data, and finally obtain a low-dimensional vector as the first encoded implicit representation in the output layer, assuming it is (0.8, 0.6, 0.4).
[0151] Similarly, for the heterogeneous IoT sensor data sample (0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,...), after being processed by the activity temporal relationship extraction edge algorithm, the second coded implicit representation is obtained, which is assumed to be (0.2, 0.1, 0.9). For the homogeneous IoT sensor data sample (0,0,1,0,0,1,0,0,1,...), the third coded implicit representation is obtained, which is assumed to be (0.7, 0.5, 0.3).
[0152] In step S133c, after obtaining the coded implicit representations of different types of IoT sensor data samples, the irrigation wireless decoder gateway calculates the feature similarity between them and obtains the difference between the similarities. Feature similarity is an indicator used to measure the similarity between two coded implicit representations. The feasible calculation methods include cosine similarity, Euclidean distance, etc. It will not be described here.
[0153] In step S133d, after obtaining the difference result of feature similarity, the irrigation wireless decoder gateway uses whether the difference result is less than or equal to the predefined value as a learning criterion to determine whether the performance of the activity time series relationship extraction edge algorithm meets the requirements. The predefined value is a threshold set according to actual needs and experience, which is used to measure the algorithm's ability to distinguish different types of IoT sensor data samples.
[0154] If the difference result is less than or equal to the predefined value, it means that the algorithm can better distinguish between similar and heterogeneous IoT sensor data samples, that is, the learning effect of the temporal relationship of farmland irrigation activities is better; if the difference result is greater than the predefined value, it means that the performance of the algorithm needs to be improved and the algorithm weight needs to be corrected.
[0155] The algorithm weights are the parameters of each computing unit (such as the neuron connection weights in a neural network) in the activity temporal relationship extraction edge algorithm, which determine how data flows and is processed in the algorithm. The purpose of correcting the algorithm weights is to enable the algorithm to better learn and extract the temporal characteristics of farmland irrigation activities and improve the ability to distinguish different types of IoT sensor data samples. A feasible method for weight correction is to use a gradient descent algorithm. The gradient descent algorithm calculates the gradient of the loss function (such as the mean square error loss function) with respect to the weight, and then updates the weight according to the direction of the gradient and a certain learning rate. For example, assuming the loss function is L, the weight is w, and the learning rate is α, the weight update formula is:
[0156]
[0157] in, It represents the partial derivative of the loss function with respect to the weight, which can be calculated by the back propagation algorithm. In each iterative training process, the irrigation wireless decoder gateway determines whether it is necessary to use the gradient descent algorithm to correct the algorithm weights according to the comparison between the calculated difference result and the predefined value, until the performance of the algorithm meets the requirements.
[0158] In one implementation, step S133d, taking the difference result being less than or equal to a predefined value as a learning criterion, the algorithm weight of the activity time series relationship extraction edge algorithm is modified, including:
[0159] Step S133d1: constructing a training error corresponding to the learning sample set based on the difference result and the predefined value;
[0160] Step S133d2: Integrate the training errors corresponding to a predefined number of learning sample sets to determine a combined error for one training;
[0161] Step S133d3: Extracting the algorithm weight of the edge algorithm based on the combined error correction activity timing relationship.
[0162] In step S133d1, the irrigation wireless decoder gateway constructs the training error corresponding to the learning sample set based on the difference result and the predefined value. The training error is an indicator that measures the performance gap between the activity temporal relationship extraction edge algorithm on the current learning sample set and the expected target. The difference result is the difference between the first feature similarity and the second feature similarity calculated in step S133c, which reflects the algorithm's ability to distinguish between similar IoT sensor data samples and heterogeneous IoT sensor data samples. The predefined value is a threshold value pre-set based on actual needs and experience, which is used to determine whether the performance of the algorithm meets the requirements.
[0163] One possible way to construct the training error is to use the mean squared error (MSE). The mean squared error is the average of the squares of the differences between the predicted value and the true value, which can reflect the degree of deviation between the predicted value and the true value. In this step, the calculation formula for the training error can be expressed as: Among them, E represents the training error, n is the number of learning sample sets, di is the difference result of the i-th learning sample, and p is a predefined value.
[0164] By calculating the training error, the irrigation wireless decoder gateway can quantify the gap between the performance of the activity temporal relationship extraction edge algorithm on the current learning sample set and the expected target, providing a basis for subsequent weight correction.
[0165] In step S133d2, after obtaining the training error corresponding to a single learning sample set, the irrigation wireless decoder gateway integrates the training errors of a predefined number of multiple learning sample sets to obtain a combined error for one training. The combined error is a comprehensive measure of the algorithm performance on multiple learning sample sets, which can more comprehensively reflect the overall performance of the activity temporal relationship extraction edge algorithm under different data conditions.
[0166] There are many ways to integrate training errors, and the simple average method is feasible. That is, the training errors of multiple learning sample sets of a predefined number are added together, and then divided by the number of learning sample sets to obtain the combined error. By calculating the combined error, the irrigation wireless decoder gateway can comprehensively consider the training conditions on multiple learning sample sets, more accurately evaluate the performance of the activity timing relationship extraction edge algorithm, and provide a more comprehensive basis for subsequent weight correction.
[0167] In step S133d3, after obtaining the merged error of a training, the irrigation wireless decoder gateway corrects the algorithm weight of the activity time series relationship extraction edge algorithm according to the size of the merged error. The algorithm weight is a parameter used to calculate and process data in the activity time series relationship extraction edge algorithm, which has an important impact on the output results of the algorithm. The purpose of correcting the algorithm weight is to enable the algorithm to better adapt to the data characteristics and improve the mining ability of the implicit representation of the farmland irrigation activity time series.
[0168] A feasible weight correction method is based on the gradient descent algorithm. The basic idea of the gradient descent algorithm is to calculate the gradient of the loss function (in this step, the combined error can be regarded as the loss function) to the weight, and then update the weight according to the direction of the gradient and a certain learning rate, so that the value of the loss function gradually decreases. Please refer to the above content for details, which will not be repeated here.
[0169] In one implementation, the gateway data processing method based on the edge algorithm also includes a process of determining a learning sample set, including the following steps:
[0170] Step S133aI: obtaining a plurality of feature code sequences and a farmland irrigation activity identification list corresponding to each feature code sequence, wherein the farmland irrigation activity identification list is obtained by arranging the feature codes of the farmland irrigation activities covered by the feature code sequence in a set order;
[0171] Step S133aII: selecting a target feature code sequence from a plurality of feature code sequences, and based on a target farmland irrigation activity identification list corresponding to the target feature code sequence, searching for a first feature code sequence whose corresponding farmland irrigation activity identification list is consistent with the target farmland irrigation activity identification list or has the target farmland irrigation activity identification list from a plurality of feature code sequences;
[0172] Step S133aIII: Use the target feature code sequence as a reference IoT sensor data sample, use the first feature code sequence as a similar IoT sensor data sample corresponding to the target feature code sequence, and use the remaining feature code sequences among multiple feature code sequences except the target feature code sequence and the first feature code sequence as heterogeneous IoT sensor data samples corresponding to the target feature code sequence to construct a learning sample set.
[0173] In step S133aI, the irrigation wireless decoder gateway first needs to obtain multiple feature code sequences from relevant data sources. These feature code sequences are obtained after processing the farmland IoT sensor data, and represent the feature coding of farmland irrigation activities in the time series. For example, suppose that the IoT sensor data of three different farmland areas are processed to obtain three feature code sequences, namely: Feature code sequence A: (1, 0, 2, 0, 1, 0, 3, 0); Feature code sequence B: (0, 2, 0, 1, 0, 3, 0, 1); Feature code sequence C: (2, 0, 1, 0, 3, 0, 1, 0). Among them, different numbers represent different types of farmland irrigation activities, and 0 means that no irrigation activity occurs at that time point.
[0174] At the same time, for each feature code sequence, the irrigation wireless decoder gateway must obtain its corresponding farmland irrigation activity identification list. This identification list is obtained by arranging the feature codes of the farmland irrigation activities covered in the feature code sequence in a set order. The set order can be based on chronological order or on rules such as the numerical size of the feature code. For example, for feature code sequence A, assuming that it is in chronological order, its corresponding farmland irrigation activity identification list is [(1, t1), (2, t3), (1, t5), (3, t7)], where t1, t3, t5, and t7 respectively represent the time position of the corresponding irrigation activities in the feature code sequence.
[0175] In order to obtain these feature code sequences and farm irrigation activity identification lists, the irrigation wireless decoder gateway can read relevant data from the database storing farm IoT sensor data, and process and extract it through specific algorithms and program logic. For example, use database query statements to retrieve the required farm IoT sensor data records from the database, and then construct feature code sequences and generate farm irrigation activity identification lists for these data.
[0176] In step S133aII, after obtaining multiple feature code sequences and their corresponding farmland irrigation activity identification lists, the irrigation wireless decoder gateway selects a target feature code sequence from these feature code sequences. This selection process can be a random selection or a selection based on specific rules or conditions. For example, the target feature code sequence is determined based on factors such as the importance of the farmland area and the integrity of the data.
[0177] Assume that the feature code sequence A is selected as the target feature code sequence, and its corresponding target farmland irrigation activity identification list is [(1, t1), (2, t3), (1, t5), (3, t7)]. Next, the irrigation wireless decoder gateway will search for the first feature code sequence that meets specific conditions in the remaining feature code sequences based on this target farmland irrigation activity identification list. These conditions are that the corresponding farmland irrigation activity identification list is consistent with the target farmland irrigation activity identification list or has the target farmland irrigation activity identification list.
[0178] The consistent situation means that the elements in the two farmland irrigation activity identification lists are exactly the same, including the characteristic code of the irrigation activity and the corresponding time position. For example, if there is another characteristic code sequence D, and its corresponding farmland irrigation activity identification list is also [(1, t1), (2, t3), (1, t5), (3, t7)], then the characteristic code sequence D is the first characteristic code sequence that meets the conditions.
[0179] The case of having a target farmland irrigation activity identification list indicates that the farmland irrigation activity identification list of another feature code sequence contains some or all elements in the target farmland irrigation activity identification list. For example, the farmland irrigation activity identification list of feature code sequence B is [(2, t2), (1, t4), (3, t6), (1, t8)]. Although the time position is not exactly the same as the target farmland irrigation activity identification list, it contains the same feature codes 1, 2, and 3. Therefore, feature code sequence B can also be considered as the first feature code sequence that meets the conditions.
[0180] In order to realize the search process, the irrigation wireless decoder gateway can adopt the implementation method of traversal comparison, that is, compare the farmland irrigation activity identification list of each feature code sequence with the target farmland irrigation activity identification list element by element to determine whether the conditions of consistency or possession are met.
[0181] In step S133aIII, after determining the target feature code sequence and the first feature code sequence, the irrigation wireless decoder gateway will construct a learning sample set based on these sequences. The learning sample set is a data set used to train the activity temporal relationship extraction edge algorithm, which includes reference IoT sensor data samples, similar IoT sensor data samples, and heterogeneous IoT sensor data samples.
[0182] The target feature code sequence is used as a reference IoT sensor data sample because it is the reference standard of the entire learning sample set. For example, the selected target feature code sequence A is used as a reference IoT sensor data sample, representing a specific time series pattern of farmland irrigation activities.
[0183] The first feature code sequence is used as a sample of the same type of IoT sensor data corresponding to the target feature code sequence because its corresponding farmland irrigation activity identification list and the target farmland irrigation activity identification list meet specific conditions. The sample of the same type of IoT sensor data has similarities with the reference IoT sensor data sample in the temporal characteristics of farmland irrigation activities. For example, the feature code sequence B or D (if any) mentioned above can be used as a sample of the same type of IoT sensor data, which has certain similarities with the target feature code sequence A in the type and time distribution of irrigation activities.
[0184] For the remaining feature code sequences except the target feature code sequence and the first feature code sequence among the multiple feature code sequences, the irrigation wireless decoder gateway uses them as heterogeneous IoT sensor data samples corresponding to the target feature code sequence. There are obvious differences between the heterogeneous IoT sensor data samples and the reference IoT sensor data samples in the temporal characteristics of farmland irrigation activities. For example, feature code sequence C and target feature code sequence A have significant differences in feature code arrangement and time position of irrigation activities, so they can be used as heterogeneous IoT sensor data samples.
[0185] In this way, the irrigation wireless decoder gateway builds a learning sample set. This learning sample set contains different types of IoT sensor data samples, which can provide rich and diverse data support for the training of the activity time series relationship extraction edge algorithm, enabling the algorithm to learn the differences and characteristics between different farmland irrigation activity time series patterns, thereby improving the performance and generalization ability of the algorithm.
[0186] In summary, steps S133aI to S133aIII constitute the process of determining the learning sample set. The irrigation wireless decoder gateway obtains multiple feature code sequences and their corresponding farmland irrigation activity identification lists, selects the target feature code sequence and searches for the first feature code sequence, and finally constructs a learning sample set based on these sequences, which provides basic data for the training of the activity time series relationship extraction edge algorithm, and helps to improve the algorithm's mining ability and accuracy of the implicit representation of farmland irrigation activity time series.
[0187] In one implementation, step S133a, obtaining a learning sample set for training an activity temporal relationship extraction edge algorithm, includes:
[0188] Step S133a1: Obtain the selected reference IoT sensor data sample.
[0189] In step S133a1, the irrigation wireless decoder gateway obtains the selected reference IoT sensor data sample from a large number of candidate data. It can be screened and selected from the historical farmland IoT sensor data. These historical data record various irrigation activities related information in different time periods and different farmland areas. After preliminary data processing and feature extraction, they have been converted into feature code sequences.
[0190] Assume that a feature code sequence found from the database is (1,0,0,2,0,0,1,0,0), where 1 represents a specific irrigation activity (such as drip irrigation), 2 represents another irrigation activity (such as sprinkler irrigation), and 0 represents no irrigation activity at that time point. The irrigation activity timing pattern represented by this feature code sequence conforms to the typical irrigation pattern of the farmland at a specific stage, so the irrigation wireless decoder gateway can select it as a reference IoT sensor data sample.
[0191] Step S133a2: Based on the fixed time sequence of the farmland irrigation activities in the reference IoT sensor data samples, sample augmentation is performed on the reference IoT sensor data samples to obtain IoT sensor data samples of the same type corresponding to the reference IoT sensor data samples.
[0192] In step S133a2, after obtaining the reference IoT sensor data sample, the irrigation wireless decoder gateway performs sample augmentation on the basis of keeping the farmland irrigation activity time sequence in the reference IoT sensor data sample fixed, so as to obtain the corresponding similar IoT sensor data sample. The purpose of sample augmentation is to increase the diversity of the learning sample set, so that the algorithm can learn more farmland irrigation activity time sequence patterns with similar characteristics, thereby improving the generalization ability and robustness of the algorithm.
[0193] Similar IoT sensor data samples and reference IoT sensor data samples should have high similarity in the temporal characteristics of farmland irrigation activities, but not completely the same, so as to reflect the diversity of the data.
[0194] For example, based on the fixed time sequence of farm irrigation activities in the reference IoT sensor data sample, sample augmentation is performed on the reference IoT sensor data sample, including one or more of the following augmentation strategies:
[0195] 1. Globally transfer the reference IoT sensor data sample or all farmland irrigation activities possessed by the reference IoT sensor data sample.
[0196] Global shifting means shifting the entire irrigation activity sequence on the time axis while keeping the relative timing of the farmland irrigation activity unchanged. For example, for the reference IoT sensor data sample (1,0,0,2,0,0,1,0,0) selected earlier, assume that it is shifted backward by 2 time units as a whole to obtain a new feature code sequence (0,0,1,0,0,2,0,0,1). This new feature code sequence is the same as the farmland irrigation activity timing of the original reference IoT sensor data sample, but there is an overall shift in time, so it can be used as a similar IoT sensor data sample.
[0197] For example, the irrigation wireless decoder gateway can achieve global transfer by adjusting the index of the feature code sequence. For example, using loops and index operations in a programming language, the elements in the original feature code sequence are rearranged according to the specified offset to obtain a new feature code sequence.
[0198] 2. Downsample or upsample the reference IoT sensor data samples.
[0199] Downsampling refers to reducing the sampling frequency of data, that is, selecting data points at a certain interval to obtain a new sequence with a reduced data volume but still retaining the main features; upsampling refers to increasing the sampling frequency of data, inserting new data points between the original data points through interpolation and other methods, to obtain a new sequence with an increased data volume.
[0200] For example, for the reference IoT sensor data sample (1,0,0,2,0,0,1,0,0), downsampling is performed, assuming that the sampling interval is 2, that is, one data point is selected every other data point, and a new feature code sequence (1,0,2,0,1,0) is obtained. This new sequence retains the time series characteristics of the original sequence of farmland irrigation activities to a certain extent, and can be used as a similar IoT sensor data sample.
[0201] Upsampling can be implemented using interpolation methods, such as linear interpolation. Assume that the above reference IoT sensor data sample is to be upsampled by 2 times, that is, a new data point is inserted between each data point, and the value of the inserted point is calculated by linear interpolation. For example, the value inserted between 1 and 0 can be calculated by the linear interpolation formula: Among them, y1=1, y2=0, and the calculated inserted value is 0.5. Similarly, the new feature code sequence after upsampling is (1,0.5,0,0,2,1,0,0,1,0.5,0,0), which can also be used as a sample of similar IoT sensor data.
[0202] 3. Downsample or upsample the scheduled farm irrigation activities in the reference IoT sensor data samples.
[0203] Unlike downsampling or upsampling the entire reference IoT sensor data sample, this strategy operates on a specific farm irrigation activity. For example, for the reference IoT sensor data sample (1,0,0,2,0,0,1,0,0), assuming that the predetermined farm irrigation activity is the irrigation activity represented by feature code 2, downsampling is performed, that is, feature code 2 and some data points around it are deleted according to certain rules. For example, 2 and its adjacent 0 are deleted to obtain a new feature code sequence (1,0,0,0,1,0,0), which can be used as a similar IoT sensor data sample. The upsampling operation is similar. For example, for the irrigation activity represented by feature code 2, new data points can be inserted around it. Assuming that a feature code identical to 2 is inserted, a new feature code sequence (1,0,0,2,2,0,1,0,0) is obtained, which can also be used as a similar IoT sensor data sample.
[0204] 4. Retain the farmland irrigation activities in the reference IoT sensor data samples, and perform data trimming on the reference IoT sensor data samples.
[0205] Data trimming refers to adjusting the length of the feature code sequence while retaining the farm irrigation activities. For example, for the reference IoT sensor data sample (1,0,0,2,0,0,1,0,0), the sequence can be trimmed from both ends. Assuming that a data point at the beginning and the end is removed, a new feature code sequence (0,0,2,0,0,1,0) is obtained. This new sequence still retains the farm irrigation activities in the original sequence, and the time series relationship remains unchanged, so it can be used as a similar IoT sensor data sample.
[0206] In another implementation, step S133a, obtaining a learning sample set for training an activity temporal relationship extraction edge algorithm, includes:
[0207] Step S133a': obtaining the selected reference IoT sensor data sample.
[0208] This step can refer to step S133a1 and will not be described in detail here.
[0209] Step S133a”: change one or all of the farmland irrigation activities and farmland irrigation activity time sequences in the reference IoT sensor data sample to obtain a heterogeneous IoT sensor data sample corresponding to the reference IoT sensor data sample.
[0210] After obtaining the reference IoT sensor data sample, the irrigation wireless decoder gateway generates the corresponding heterogeneous IoT sensor data sample by changing one or all of the farm irrigation activities and farm irrigation activity timing. The heterogeneous IoT sensor data samples and the reference IoT sensor data samples have obvious differences in the characteristics or timing of farm irrigation activities, which are used to train the activity timing relationship extraction edge algorithm so that it can better learn and distinguish different irrigation activity modes.
[0211] For example, changing one or all of the farmland irrigation activities and the farmland irrigation activity time series in the reference IoT sensor data sample to obtain a heterogeneous IoT sensor data sample corresponding to the reference IoT sensor data sample includes one or more of the following augmentation strategies:
[0212] 1. Transport the local farmland irrigation activities in the reference IoT sensor data samples.
[0213] This strategy refers to moving one or some farm irrigation activities in the reference IoT sensor data sample in the time series to change the time position of their occurrence, thereby generating heterogeneous IoT sensor data samples. For example, for the reference IoT sensor data sample (1,0,2,0,1,0,3,0,1) selected earlier, the farm irrigation activity represented by feature code 2 is moved from the original third time point to the sixth time point, and a new feature code sequence (1,0,0,0,1,2,3,0,1) is obtained. Compared with the original reference IoT sensor data sample, the time sequence of farm irrigation activities in this new sequence has changed, so it can be used as a heterogeneous IoT sensor data sample.
[0214] For example, the irrigation wireless decoder gateway can realize the movement of local farm irrigation activities by modifying the index of a specific element in the signature sequence. For example, in a programming language, array operations can be used to achieve the adjustment of element positions.
[0215] 2. Replace the activity content of at least one farm irrigation activity in the reference IoT sensor data sample.
[0216] This strategy refers to replacing one or more farm irrigation activities in the reference IoT sensor data sample with other different types of irrigation activities, thereby generating heterogeneous IoT sensor data samples. For example, for the reference IoT sensor data sample (1,0,2,0,1,0,3,0,1), replace the farm irrigation activity represented by feature code 2 with another type of irrigation activity, assuming that it is represented by feature code 4, to obtain a new feature code sequence (1,0,4,0,1,0,3,0,1). This new sequence differs from the original reference IoT sensor data sample in the content of farm irrigation activities, so it can be used as a heterogeneous IoT sensor data sample.
[0217] The implementation method of replacing the active content can be to directly assign values to the corresponding elements in the feature code sequence. In a programming language, the element to be replaced can be located by index, and then its value can be modified to a new feature code.
[0218] 3. Use the predetermined farmland irrigation activities in the same type of IoT sensor data as the reference IoT sensor data sample to replace other farmland irrigation activities in the reference IoT sensor data sample that are different from the predetermined farmland irrigation activities.
[0219] Assume that similar IoT sensor data samples of the reference IoT sensor data samples have been obtained through the method described above, for example, the similar IoT sensor data samples are (1, 0, 2, 0, 2, 0, 3, 0, 1). Now select a predetermined farmland irrigation activity, such as the irrigation activity represented by feature code 2, and use it to replace other farmland irrigation activities that are different from the reference IoT sensor data sample (1, 0, 2, 0, 1, 0, 3, 0, 1). For example, replace feature code 1 with feature code 2 to obtain a new feature code sequence (2, 0, 2, 0, 2, 0, 3, 0, 2). This new sequence has changed from the original reference IoT sensor data sample in the composition of farmland irrigation activities, so it can be used as a heterogeneous IoT sensor data sample.
[0220] The technical implementation of this change strategy can be completed by comparing the elements in the two signature sequences, finding the different elements and performing replacement operations.
[0221] 4. Swap the time series distribution of multiple farm irrigation activities in the reference IoT sensor data sample.
[0222] This strategy refers to changing the time sequence between multiple farm irrigation activities in the reference IoT sensor data sample to generate heterogeneous IoT sensor data samples. For example, for the reference IoT sensor data sample (1,0,2,0,1,0,3,0,1), the time series distribution of the farm irrigation activities represented by feature code 2 and feature code 3 are swapped to obtain a new feature code sequence (1,0,3,0,1,0,2,0,1). This new sequence has obvious differences in the time series of farm irrigation activities from the original reference IoT sensor data sample, so it can be used as a heterogeneous IoT sensor data sample. The implementation method of swapping the time series distribution can be completed by exchanging the positions of the corresponding elements in the feature code sequence.
[0223] 5. Modify the time series distribution of the scheduled farmland irrigation activities in the reference IoT sensor data sample to the set time series distribution.
[0224] For example, for the reference IoT sensor data sample (1,0,2,0,1,0,3,0,1), assuming that the scheduled farmland irrigation activity is the irrigation activity represented by feature code 3, its time series distribution is modified to occur every 2 time points, and a new feature code sequence (1,0,2,3,1,0,3,0,1) is obtained. This new sequence has changed from the original reference IoT sensor data sample in the time series distribution of the scheduled farmland irrigation activity, so it can be used as a heterogeneous IoT sensor data sample.
[0225] In one implementation, step S140, based on the implicit representation of irrigation activities and the implicit representation of farmland irrigation activity time sequence, detects whether farmland IoT sensor data and mode example sensor data in the irrigation mode list meet commonality conditions, including:
[0226] Step S141: if the implicit representation of the irrigation activity and the implicit representation of the irrigation activity corresponding to the predetermined pattern example sensor data satisfy the commonality condition, and the implicit representation of the farmland irrigation activity timing and the implicit representation of the farmland irrigation activity timing corresponding to the predetermined pattern example sensor data satisfy the commonality condition, then it is determined that the farmland IoT sensor data and the predetermined pattern example sensor data correspond to the same irrigation demand;
[0227] Step S142: If the implicit representation of the irrigation activity and the implicit representation of the irrigation activity corresponding to the predetermined pattern example sensor data do not meet the commonality condition, or the implicit representation of the farmland irrigation activity timing and the implicit representation of the farmland irrigation activity timing corresponding to the predetermined pattern example sensor data do not meet the commonality condition, it is determined that the farmland IoT sensor data and the predetermined pattern example sensor data correspond to different irrigation needs.
[0228] In step S141, if the irrigation activity implicitly represents that the irrigation activity corresponding to the predetermined pattern example sensor data implicitly represents that the commonality condition is satisfied, and the farmland irrigation activity timing implicitly represents that the farmland irrigation activity timing corresponding to the predetermined pattern example sensor data implicitly represents that the commonality condition is satisfied, then it is determined that the farmland IoT sensor data and the predetermined pattern example sensor data correspond to the same irrigation demand.
[0229] For the judgment that the implicit representation of irrigation activities meets the commonality condition, the irrigation wireless decoder gateway can adopt the implementation method of feature similarity measurement. For example, it can be measured by calculating the cosine similarity between the two. For the judgment that the implicit representation of the farmland irrigation activity time series meets the commonality condition, a similar similarity measurement method can also be used. For example, the dynamic time warping (DTW) algorithm is used to calculate the similarity between the two. The DTW algorithm measures the similarity between two time series by finding the best matching path between them. Assume that the implicit representation sequence of the farmland irrigation activity time series of farmland IoT sensor data is X=(x1,x2,x3,…,x n ), the implicit representation sequence of the farmland irrigation activity time series corresponding to the sensor data of the predetermined mode example is Y = (y1, y2, y3, ..., y m ), the DTW algorithm will calculate a distance value D. When D is less than the set threshold, it is considered that the two meet the commonality condition.
[0230] For example, the implicit representation sequence X of the farmland irrigation activity time series of the farmland IoT sensor data is (1, 3, 5, 7, 9), and the implicit representation sequence Y of the farmland irrigation activity time series corresponding to the predetermined pattern example sensor data is (1, 2, 4, 6, 8). The distance value D calculated by the DTW algorithm is small (assuming it is less than the set threshold), indicating that the commonality condition is met in the implicit representation of the farmland irrigation activity time series. When both the implicit representation of the irrigation activity and the implicit representation of the farmland irrigation activity time series meet the commonality condition, the irrigation wireless decoder gateway can determine that the farmland IoT sensor data and the predetermined pattern example sensor data correspond to the same irrigation demand. For example, the irrigation demand corresponding to the predetermined pattern example sensor data is to irrigate a certain area of the farmland quantitatively within a specific time period. Then, according to the judgment result, the target farmland area corresponding to the farmland IoT sensor data also has the same irrigation demand.
[0231] In step S142, if the implicit representation of the irrigation activity and the implicit representation of the irrigation activity corresponding to the predetermined pattern example sensor data do not meet the commonality condition, or the implicit representation of the farmland irrigation activity timing and the implicit representation of the farmland irrigation activity timing corresponding to the predetermined pattern example sensor data do not meet the commonality condition, the irrigation wireless decoder gateway determines that the farmland IoT sensor data and the predetermined pattern example sensor data correspond to different irrigation requirements.
[0232] When the irrigation activity implicitly indicates that the commonality condition is not met, still taking the cosine similarity as an example, if the calculated cosine similarity value is less than the set threshold (such as 0.8), it is considered that the commonality condition is not met.
[0233] When the implicit representation of the farmland irrigation activity time series does not meet the commonality condition, if the distance value D calculated by the DTW algorithm is greater than the set threshold, it means that the similarity of the two implicit time series representation sequences is low. For example, the implicit representation sequence of the farmland irrigation activity time series of the farmland IoT sensor data is X = (1, 3, 5, 7, 9), and the implicit representation sequence of the farmland irrigation activity time series corresponding to the predetermined pattern example sensor data is Y = (9, 7, 5, 3, 1). The distance value D calculated by the DTW algorithm is large (assuming it is greater than the set threshold), indicating that the farmland irrigation activity time series distribution of the two is quite different.
[0234] At this time, the irrigation wireless decoder gateway determines that the farmland IoT sensor data and the predetermined pattern example sensor data correspond to different irrigation requirements. For example, the irrigation requirement corresponding to the predetermined pattern example sensor data is to irrigate the farmland in the morning, while the irrigation activity time sequence corresponding to the farmland IoT sensor data implicitly indicates that the irrigation time is mainly concentrated in the afternoon, so the irrigation requirements of the two are considered different.
[0235] In one implementation, the method provided by the embodiment of the present invention may further include:
[0236] Step S160: if it is identified that the pattern example sensor data needs to be added to the irrigation pattern list, then each farmland irrigation activity in the pattern example sensor data is detected to obtain the farmland irrigation activity detection data corresponding to the pattern example sensor data;
[0237] Step S170: constructing an irrigation activity implicit representation of each farmland irrigation activity in the pattern example sensor data based on the farmland irrigation activity detection data corresponding to the pattern example sensor data, and obtaining the irrigation activity implicit representation corresponding to the pattern example sensor data;
[0238] Step S180: mining the time series distribution between the various farmland irrigation activities in the pattern example sensor data based on the implicit representation of irrigation activities corresponding to the various farmland irrigation activities in the pattern example sensor data, and obtaining the implicit representation of the farmland irrigation activity time series corresponding to the pattern example sensor data;
[0239] Step S190: associating the pattern example sensor data with the implicit representation of the irrigation activity corresponding to the pattern example sensor data and the implicit representation of the farmland irrigation activity timing in the irrigation pattern list.
[0240] In step S160, when the irrigation wireless decoder gateway recognizes that the pattern example sensor data needs to be added to the irrigation pattern list, it will detect each farmland irrigation activity in the pattern example sensor data, so as to obtain the farmland irrigation activity detection data corresponding to the pattern example sensor data. For example, the pattern example sensor data may be a series of data collected from a specific farmland area within a certain period of time, which contains various irrigation-related information, such as irrigation duration and irrigation water volume at different locations. The irrigation wireless decoder gateway can detect farmland irrigation activities by analyzing the feature information in these data. Specific implementation methods may include data filtering, feature extraction, etc. For example, by filtering the data, removing noise and interference information, and then extracting features related to irrigation activities, such as changes in water volume within a specific period of time, changes in signal strength of sensor nodes, etc., the occurrence of farmland irrigation activities is determined. Assuming that the water volume data recorded by a sensor node in the model example sensor data over a period of time shows an obvious upward trend, and at the same time other related sensor nodes also have corresponding signal changes, then the irrigation wireless decoder gateway can determine that an irrigation activity has occurred in the area during this time period, thereby integrating this information into farmland irrigation activity detection data.
[0241] In step S170, the irrigation wireless decoder gateway constructs an implicit representation of irrigation activities for each farmland irrigation activity in the pattern example sensor data based on the farmland irrigation activity detection data corresponding to the pattern example sensor data, and obtains the implicit representation of irrigation activities corresponding to the pattern example sensor data. The implicit representation of irrigation activities is an abstract representation of the characteristics of farmland irrigation activities, which can express the essential characteristics of irrigation activities more concisely. The implementation method for constructing the implicit representation of irrigation activities can adopt a feature coding method. For example, for each irrigation activity in the farmland irrigation activity detection data, its key features can be extracted, such as irrigation location, duration, water volume, etc., and then these features can be encoded to form a feature vector as an implicit representation of the irrigation activity. In this way, the irrigation wireless decoder gateway can convert each farmland irrigation activity in the pattern example sensor data into a corresponding implicit representation of irrigation activities.
[0242] In step S180, the irrigation wireless decoder gateway mines the time series distribution between each farmland irrigation activity in the pattern example sensor data based on the implicit representation of irrigation activities corresponding to each farmland irrigation activity in the pattern example sensor data, and obtains the implicit representation of farmland irrigation activity time series corresponding to the pattern example sensor data. The implementation method of mining time series distribution can refer to the method of constructing feature code sequence and mining implicit representation from feature code sequence mentioned above. Specifically, first, based on the time series distribution of each farmland irrigation activity in the pattern example sensor data and their feature codes (the feature codes here can be determined by the similarity with the cluster representative point according to the method introduced previously), the feature code sequence corresponding to the pattern example sensor data is constructed. Then, this feature code sequence is passed into the activity time series relationship extraction edge algorithm, which includes multiple time series filters connected in sequence. By passing the feature code sequence into the first time series filter, and then integrating the outputs of multiple time series filters after downsampling, the implicit representation of farmland irrigation activity time series is finally obtained.
[0243] Finally, step S190, the irrigation wireless decoder gateway records the pattern example sensor data with the implicit representation of the irrigation activity corresponding to the pattern example sensor data and the implicit representation of the farmland irrigation activity sequence in the irrigation pattern list. This association record can be achieved by establishing a database table. For example, an irrigation pattern list table is created in the database, and the table contains three fields: the pattern example sensor data field, the irrigation activity implicit representation field, and the farmland irrigation activity sequence implicit representation field. When new pattern example sensor data and its corresponding implicit representation need to be added to the irrigation pattern list, the irrigation wireless decoder gateway stores these data in the corresponding fields respectively, thereby completing the association record. In this way, when it is necessary to perform pattern matching on the farmland IoT sensor data in the future, the irrigation wireless decoder gateway can retrieve the relevant pattern example sensor data and its implicit representation from the irrigation pattern list to accurately identify the irrigation needs.
[0244] Through the processing of steps S160 to S190, the irrigation wireless decoder gateway can continuously enrich the irrigation mode list to include more mode example sensor data and its corresponding implicit representation. This not only helps to improve the accuracy and reliability of irrigation demand identification, but also provides richer data support for irrigation scheduling and decision-making in smart agriculture, further promoting the development of smart agriculture. For example, with the continuous improvement of the irrigation mode list, the irrigation wireless decoder gateway can more accurately identify the irrigation needs of different farmland areas in different time periods, thereby achieving more scientific and reasonable irrigation management, improving the utilization efficiency of water resources, and promoting the growth and yield of crops.
[0245] See also Figure 3, is a schematic diagram of the structure of an irrigation wireless decoder gateway provided by an embodiment of the present invention. Figure 3 As shown, the above-mentioned irrigation wireless decoder gateway 10 may include: a processor 1001, a network interface 1004 and a memory 1005, in which a computer-readable code is stored. When the computer-readable code is executed by the processor, the processor executes the gateway data processing method based on the edge algorithm provided by the present invention.
[0246] In addition, the above-mentioned irrigation wireless decoder gateway 10 may also include: a user interface 1003, and at least one communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. Among them, the user interface 1003 may include a display screen (Display), a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or it may be a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 1005 may optionally also be at least one storage device away from the aforementioned processor 1001. Figure 3 As shown, the memory 1005 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a device control application program.
[0247] exist Figure 3 In the irrigation wireless decoder gateway 1000 shown, the network interface 1004 can provide network communication functions; the user interface 1003 is mainly used to provide an input interface; and the processor 1001 can be used to call the device control application stored in the memory 1005 to implement the method provided in the above embodiment.
[0248] At this point, those skilled in the art should recognize that, although multiple exemplary embodiments of the present invention have been shown and described in detail herein, many other variations or modifications that conform to the principles of the present invention can still be directly determined or derived based on the content disclosed in the present invention without departing from the spirit and scope of the present invention. Therefore, the scope of the present invention should be understood and recognized as covering all these other variations or modifications.
Claims
1. A gateway data processing method based on edge algorithm, characterized in that: Applied to an irrigation wireless decoder gateway, the method comprises: Detecting various farmland irrigation activities in farmland IoT sensor data to obtain farmland irrigation activity detection data, wherein the farmland IoT sensor data is collected and uploaded in a target time period by using multiple irrigation sensor nodes deployed in a target farmland area, and the multiple irrigation sensor nodes are communicatively connected with the irrigation wireless decoder gateway; Constructing an implicit representation of irrigation activities for each of the farmland irrigation activities based on the farmland irrigation activity detection data; Mining the time series distribution between the various farmland irrigation activities in the farmland IoT sensor data based on the implicit representation of the irrigation activities of the various farmland irrigation activities to obtain the implicit representation of the time series of the farmland irrigation activities; Based on the implicit representation of the irrigation activity and the implicit representation of the farmland irrigation activity time sequence, detecting whether the farmland IoT sensor data and the mode example sensor data in the irrigation mode list meet a commonality condition; When pattern example sensor data whose pattern commonality coefficients satisfy the commonality condition with the farmland IoT sensor data is detected in the irrigation pattern list, the irrigation demand corresponding to the pattern example sensor data satisfying the commonality condition is determined as the irrigation demand of the target farmland area.
2. The gateway data processing method based on edge algorithm according to claim 1 is characterized in that: Mining the time series distribution between the various farmland irrigation activities in the farmland IoT sensor data based on the implicit representation of the irrigation activities of the various farmland irrigation activities to obtain the implicit representation of the time series of the farmland irrigation activities includes: Based on the implicit representation of the irrigation activities of the respective farmland irrigation activities, quantifying the characteristics of the respective farmland irrigation activities to obtain characteristic codes of the respective farmland irrigation activities; Based on the time series distribution of each farmland irrigation activity in the farmland IoT sensor data and the feature code of each farmland irrigation activity, construct a feature code sequence corresponding to the farmland IoT sensor data; The implicit representation of the farmland irrigation activity time series is mined from the feature code sequence.
3. The gateway data processing method based on edge algorithm according to claim 2 is characterized in that: Based on the implicit representation of the irrigation activities of each farmland irrigation activity, the characteristics of each farmland irrigation activity are quantified to obtain the characteristic code of each farmland irrigation activity, including: Acquire a plurality of cluster representative points, wherein the cluster representative points are obtained by cluster analysis of implicit representations of irrigation activities of farmland irrigation activities covered in the pattern example sensing data; Determining a cluster representative point that is most similar to the implicit representation of the irrigation activity of each farmland irrigation activity based on the feature similarity between the implicit representation of the irrigation activity of each farmland irrigation activity and the plurality of cluster representative points; A feature code of each farmland irrigation activity is constructed according to the numerical number corresponding to the cluster representative point that is most similar to the implicit representation of the irrigation activity of each farmland irrigation activity.
4. The gateway data processing method based on edge algorithm according to claim 3 is characterized in that: The gateway data processing method based on the edge algorithm also includes: Acquire the number of predefined farmland irrigation activities and the number of farmland irrigation activities related to the predefined farmland irrigation activities, and acquire implicit representations of irrigation activities of the farmland irrigation activities covered by the pattern example sensing data; Determining the number of cluster representative points based on the number of the predefined farmland irrigation activities and the number of the related farmland irrigation activities; Based on the number of cluster representative points, cluster analysis is performed on the implicit representation of the irrigation activities of the farmland irrigation activities covered in the pattern example sensing data to obtain the multiple cluster representative points.
5. The gateway data processing method based on edge algorithm according to claim 2 is characterized in that: Based on the time series distribution of each farmland irrigation activity in the farmland IoT sensor data and the feature code of each farmland irrigation activity, a feature code sequence corresponding to the farmland IoT sensor data is constructed, including: Based on the time series distribution of each farmland irrigation activity in the farmland IoT sensor data, the data item at the time series distribution of each farmland irrigation activity is replaced by a feature code of each farmland irrigation activity; Changing the data items in the farmland IoT sensor data, except for the time series distribution of each farmland irrigation activity, to predefined values, thereby constructing a feature code sequence corresponding to the farmland IoT sensor data; The step of mining the implicit representation of the farmland irrigation activity time sequence from the feature code sequence comprises: The feature code sequence is passed into an activity timing relationship extraction edge algorithm, wherein the activity timing relationship extraction edge algorithm includes a plurality of sequentially connected timing filters, and the feature code sequence is passed into the first timing filter among the plurality of timing filters; The outputs of multiple time series filters in the multiple time series filters are respectively subjected to downsampling processing and then integrated to obtain the implicit representation of the farmland irrigation activity time series; The training process of the activity temporal relationship extraction edge algorithm includes: Acquire a learning sample set for training the activity temporal relationship extraction edge algorithm, wherein the learning sample set includes reference IoT sensor data samples, similar IoT sensor data samples, and heterogeneous IoT sensor data samples; wherein the reference IoT sensor data samples, similar IoT sensor data samples, and heterogeneous IoT sensor data samples are all feature code sequences; The learning sample set is passed into the activity timing relationship extraction edge algorithm, and the activity timing relationship extraction edge algorithm is executed to obtain a first coded implicit representation of the reference IoT sensor data sample, a second coded implicit representation of the heterogeneous IoT sensor data sample, and a third coded implicit representation of the homogeneous IoT sensor data sample; Based on a first feature similarity between the first coded implicit representation and the second coded implicit representation, and a second feature similarity between the first coded implicit representation and the third coded implicit representation, obtaining a difference result between the first feature similarity and the second feature similarity; The algorithm weight of the activity time series relationship extraction edge algorithm is modified based on the learning criterion that the difference result is less than or equal to a predefined value.
6. The gateway data processing method based on edge algorithm according to claim 5 is characterized in that: Taking the difference result being less than or equal to a predefined value as a learning criterion, the algorithm weight of the activity time series relationship extraction edge algorithm is modified, including: Constructing a training error corresponding to the learning sample set based on the difference result and the predefined value; Integrate the training errors corresponding to a predefined number of learning sample sets to determine the combined error of one training; Correcting the algorithm weight of the activity timing relationship extraction edge algorithm based on the merging error; The construction process of the learning sample set includes: Acquire multiple feature code sequences and a farmland irrigation activity identification list corresponding to each feature code sequence, wherein the farmland irrigation activity identification list is obtained by arranging the feature codes of the farmland irrigation activities covered by the feature code sequence in a set order; Selecting a target feature code sequence from the plurality of feature code sequences, and based on a target farmland irrigation activity identifier list corresponding to the target feature code sequence, searching the plurality of feature code sequences for a first feature code sequence whose corresponding farmland irrigation activity identifier list is consistent with the target farmland irrigation activity identifier list or has the target farmland irrigation activity identifier list; The target feature code sequence is used as a reference IoT sensor data sample, the first feature code sequence is used as a similar IoT sensor data sample corresponding to the target feature code sequence, and the remaining feature code sequences among the multiple feature code sequences except the target feature code sequence and the first feature code sequence are used as heterogeneous IoT sensor data samples corresponding to the target feature code sequence to construct the learning sample set.
7. The gateway data processing method based on edge algorithm according to claim 5, characterized in that: Obtaining a learning sample set for training the activity temporal relationship extraction edge algorithm, including: Obtain selected reference IoT sensor data samples; On the basis that the farmland irrigation activity time sequence in the reference IoT sensor data sample is fixed, the reference IoT sensor data sample is augmented to obtain a similar IoT sensor data sample corresponding to the reference IoT sensor data sample; At this time, based on the fixed time sequence of the farmland irrigation activities in the reference IoT sensor data sample, the reference IoT sensor data sample is augmented, including one or more of the following augmentation strategies: Globally transporting the reference IoT sensor data sample or all farmland irrigation activities possessed by the reference IoT sensor data sample; Downsampling or upsampling the reference IoT sensor data sample; Downsampling or upsampling the predetermined farmland irrigation activity in the reference IoT sensor data sample; Retaining the farmland irrigation activities in the reference IoT sensor data sample, and performing data cutting on the reference IoT sensor data sample; or; The step of acquiring a learning sample set for training the activity temporal relationship extraction edge algorithm comprises: Obtain selected reference IoT sensor data samples; Changing one or all of the farmland irrigation activities and the farmland irrigation activity timing in the reference IoT sensor data sample to obtain a heterogeneous IoT sensor data sample corresponding to the reference IoT sensor data sample; At this time, changing one or all of the farmland irrigation activities and the farmland irrigation activity timing in the reference IoT sensor data sample to obtain a heterogeneous IoT sensor data sample corresponding to the reference IoT sensor data sample includes one or more of the following augmentation strategies: Carrying out the local farmland irrigation activities in the reference IoT sensor data sample; Replace the activity content of at least one farmland irrigation activity in the reference IoT sensor data sample; Using the predetermined farmland irrigation activity in the same type of IoT sensor data of the reference IoT sensor data sample to replace other farmland irrigation activities in the reference IoT sensor data sample that are different from the predetermined farmland irrigation activity; Swapping the time series distribution of multiple farmland irrigation activities in the reference IoT sensor data sample; The time series distribution of the predetermined farmland irrigation activity in the reference IoT sensor data sample is modified into a set time series distribution.
8. The gateway data processing method based on edge algorithm according to any one of claims 1 to 7, characterized in that: Based on the implicit representation of the irrigation activity and the implicit representation of the farmland irrigation activity time sequence, detecting whether the farmland IoT sensor data and the mode example sensor data in the irrigation mode list meet the commonality condition, including: If the irrigation activity implicitly represents that the irrigation activity corresponding to the predetermined pattern example sensor data implicitly represents that the commonality condition is satisfied, and the farmland irrigation activity timing implicitly represents that the farmland irrigation activity timing corresponding to the predetermined pattern example sensor data implicitly represents that the commonality condition is satisfied, then it is determined that the farmland IoT sensor data and the predetermined pattern example sensor data correspond to the same irrigation demand; If the implicit representation of the irrigation activity and the implicit representation of the irrigation activity corresponding to the predetermined pattern example sensor data do not satisfy the commonality condition, or the implicit representation of the farmland irrigation activity timing and the implicit representation of the farmland irrigation activity timing corresponding to the predetermined pattern example sensor data do not satisfy the commonality condition, it is determined that the farmland IoT sensor data and the predetermined pattern example sensor data correspond to different irrigation requirements.
9. The gateway data processing method based on edge algorithm according to any one of claims 1 to 7, characterized in that: The method further comprises: If it is identified that the pattern example sensor data needs to be added to the irrigation pattern list, each farmland irrigation activity in the pattern example sensor data is detected to obtain the farmland irrigation activity detection data corresponding to the pattern example sensor data; constructing an implicit representation of irrigation activities of each farmland irrigation activity in the pattern example sensor data based on the farmland irrigation activity detection data corresponding to the pattern example sensor data, and obtaining an implicit representation of irrigation activities corresponding to the pattern example sensor data; Based on the implicit representation of irrigation activities corresponding to each farmland irrigation activity in the pattern example sensor data, mining the time series distribution between each farmland irrigation activity in the pattern example sensor data, and obtaining the implicit representation of the farmland irrigation activity time series corresponding to the pattern example sensor data; The pattern example sensor data, the implicit representation of the irrigation activity corresponding to the pattern example sensor data, and the implicit representation of the farmland irrigation activity timing are associated and recorded in the irrigation pattern list.
10. An irrigation wireless decoder gateway, characterized in that: include: processor; and a memory, wherein the memory stores a computer-readable code, and when the computer-readable code is executed by the processor, the processor executes the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Gateway edge calculation method and device based on singular value detection
CN112261610A
Intelligent irrigation system for high-standard farmland
CN118318713A
Edge computing gateway data processing method and gateway
CN118736847A
Personalized precise irrigation method based on Internet of Things and deep learning
CN119026082A
Road intelligent lighting control method and system based on vehicle-road cloud cooperation
CN119052984A
Cited By
Intelligent agricultural water-saving irrigation system based on Internet of Things
CN121241888A