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
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-06-24
- 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 farmland IoT sensing data is constructed, and the pattern matching is combined with the irrigation pattern list to identify the irrigation needs of the target farmland area.
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 CN119766845B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and more particularly, to a method for processing gateway data based on an edge algorithm and an irrigation wireless decoder gateway. Background Art
[0002] With the continuous development of technology, smart agriculture, as an important development direction of modern agriculture, has received extensive attention and emphasis. In the field of smart agriculture, precise irrigation management is of crucial significance for increasing crop yields, conserving water resources, and ensuring the sustainable development of agriculture. In traditional farmland irrigation systems, irrigation decisions often rely on farmers' experience and manual monitoring, and this approach has many limitations. For example, manual monitoring cannot obtain real-time and comprehensive information on the irrigation needs of farmland, easily leading to problems such as insufficient irrigation or over-irrigation. Insufficient irrigation will affect the growth and development of crops and reduce yields; while over-irrigation not only wastes water resources, but may also cause problems such as waterlogging in the soil, loss of soil nutrients, etc., affecting soil quality and the growth environment of crops.
[0003] To address the deficiencies of traditional irrigation methods, in recent years, intelligent irrigation systems based on Internet of Things technology have gradually emerged. These systems deploy a large number of sensor nodes in farmland to collect information such as soil humidity, temperature, and meteorological data of the farmland in real time, and transmit this data to a central control system for analysis and processing, thereby realizing intelligent control of irrigation. However, there are still some problems in the existing intelligent irrigation systems in terms of data processing and irrigation demand recognition. In terms of irrigation demand recognition, the existing intelligent irrigation systems often only focus on single sensor data or simple threshold judgments, lacking a comprehensive analysis and understanding of farmland irrigation activities. Farmland irrigation activities are a complex process affected by multiple factors, such as the location, duration, water volume, and temporal distribution of irrigation. Relying solely on single sensor data or simple threshold judgments cannot accurately identify the irrigation needs of farmland and easily leads to mistakes in irrigation decisions. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a method for processing gateway data based on an edge algorithm and an irrigation wireless decoder gateway.
[0005] According to one aspect of the present invention, there is provided a method for processing gateway data based on an edge algorithm, which is applied to an irrigation wireless decoder gateway. The method includes: detecting each farmland irrigation activity in the farmland Internet of Things sensing data to obtain farmland irrigation activity detection data, where the farmland Internet of Things sensing data is collected and uploaded by a plurality of irrigation sensor nodes deployed in a target farmland area during a target time period, and the plurality of irrigation sensor nodes are communicatively connected to the irrigation wireless decoder gateway; constructing an implicit representation of the irrigation activity for each farmland irrigation activity based on the farmland irrigation activity detection data; mining the temporal distribution between each farmland irrigation activity in the farmland Internet of Things sensing data based on the implicit representation of the irrigation activity for each farmland irrigation activity to obtain an implicit representation of the farmland irrigation activity time series; detecting whether the farmland Internet of Things sensing data and the pattern example sensing data in the irrigation mode list satisfy a common condition based on the implicit representation of the irrigation activity and the implicit representation of the farmland irrigation activity time series; when pattern example sensing data whose pattern commonality coefficient with the farmland Internet of Things sensing data is detected to satisfy the common condition in the irrigation mode list, determining the irrigation requirement corresponding to the pattern example sensing data that satisfies the common condition as the irrigation requirement of the target farmland area.
[0006] According to another aspect of the present invention, there is provided an irrigation wireless decoder gateway, including: a processor; and a memory, where computer-readable code is stored in the memory, and when the computer-readable code is run by the processor, the processor executes the method described above.
[0007] The present invention constructs an implicit representation of the irrigation activity for each farmland irrigation activity based on the farmland irrigation activity detection data, mines the temporal distribution between each farmland irrigation activity in the farmland Internet of Things sensing data based on the implicit representation of the irrigation activity for each farmland irrigation activity to obtain an implicit representation of the farmland irrigation activity time series, and then detects whether the farmland Internet of Things sensing data and the pattern example sensing data in the irrigation mode list satisfy a common condition based on the implicit representation of the irrigation activity for each farmland irrigation activity and the implicit representation of the farmland irrigation activity time series. During the process of mining the implicit representation of the data for pattern matching, both the implicit representation of the irrigation activity for each farmland irrigation activity in the data and the temporal distribution between each farmland irrigation activity are measured. The feature information of the data is represented more precisely by using the implicit representation of the irrigation activity of the farmland irrigation activity and the implicit representation of the farmland irrigation activity time series, ensuring the accuracy of pattern recognition, thereby increasing the reliability of irrigation requirement recognition and facilitating the effective promotion of smart agriculture. Description of the Drawings
[0008] Figure 1 is a schematic diagram of the architecture of an application environment provided by the present invention;
[0009] Figure 2 It is a schematic flowchart of a method for processing gateway data based on an edge algorithm provided by the present invention;
[0010] Figure 3 It is a schematic diagram of the main structure of an irrigation wireless decoder gateway provided by an embodiment of the present invention. Detailed implementation manners
[0011] To facilitate a clearer understanding of the present invention, first, the application environment for implementing the method for processing gateway data based on an edge algorithm of the present invention is introduced. As Figure 1 shown, the application environment includes an irrigation wireless decoder gateway 10 and a cluster of sensing nodes. The cluster of sensing nodes can include one or more sensing nodes, and the number of sensing nodes will not be limited here. As Figure 1 shown, the cluster of sensing nodes can specifically include sensing node 1, sensing node 2,..., sensing node n. It can be understood that sensing node 1, sensing node 2, sensing node 3,..., sensing node n can all be network-connected to the irrigation wireless decoder gateway 10, so that each sensing node can perform data interaction with the irrigation wireless decoder gateway 10 through the network connection.
[0012] It can be understood that the irrigation wireless decoder gateway 10 can refer to an edge device that executes the method of the present invention, and a computer program corresponding to the method for processing gateway data based on an edge algorithm provided by an embodiment of the present invention is set therein (for example, set in the memory).
[0013] Furthermore, please refer to Figure 2 , which is a schematic flowchart of a method for processing gateway data based on an edge algorithm provided by an embodiment of the present invention. The method for processing gateway data based on an edge algorithm can include the following steps:
[0014] Step S110: Detect each farmland irrigation activity in the farmland IoT sensing data to obtain farmland irrigation activity detection data. The farmland IoT sensing data is collected and uploaded by a plurality of irrigation sensor nodes deployed in the target farmland area during the target time period, and the plurality of irrigation sensor nodes are communicatively connected to the irrigation wireless decoder gateway.
[0015] In the embodiments of the present invention, the farmland IoT sensing data is collected and uploaded by multiple irrigation sensor nodes deployed in the target farmland area during the target time period. These irrigation sensor nodes are communicatively 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 evenly or deployed according to a specific plan at different locations such as different regions and different crop planting plots. These nodes can be different types of sensors such as soil moisture sensors, water flow sensors, and meteorological sensors, each responsible for collecting different types of data related to farmland irrigation.
[0016] For example, the soil moisture sensor can continuously monitor the water content in the soil, sense the change in the dielectric constant of the soil through the built-in sensing element, and then convert 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 the 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 pipeline to determine the amount of irrigation water by measuring the water flow rate and flow. For example, a 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 a coefficient, V is the water flow velocity, and D is the pipeline diameter. The meteorological sensor can collect meteorological information such as temperature, humidity, and wind speed.
[0017] The irrigation wireless decoder gateway uses a wireless LORA signal to connect to the field wireless decoder and wireless sensors in the downlink, and uses a 4G signal for data transmission in the uplink. The wireless LORA signal has advantages such as long transmission distance and low power consumption, which is suitable for data transmission in a vast area such as farmland. For example, when a certain irrigation sensor node collects soil moisture data, it will send the data to the wireless receiving module of the irrigation wireless decoder gateway through the wireless LORA signal. The 4G signal is used to upload the data processed by the gateway to the cloud or the central control system to ensure that the data can be remotely transmitted and analyzed in a timely and efficient manner.
[0018] Farmland irrigation activities refer to various specific events that occur during the process of farmland irrigation, covering multiple aspects of information. For example, the location of irrigation can be determined by the deployment location of sensor nodes. Suppose sensor nodes are deployed in a grid pattern in the farmland, and each node has a unique identifier and corresponding geographical location information. When a certain node detects an irrigation operation, the specific location where the irrigation occurs can be determined. The irrigation duration is also one of the important pieces of information for farmland irrigation activities. 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 opened, the sensor node can detect the water flow signal and record this 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 irrigation water volume is also a crucial piece of information for farmland irrigation activities. The water volume flowing through the pipeline 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, and the calculation formula is: W = Q × t, where W represents the irrigation water volume, Q is the flow rate, and t is the irrigation duration.
[0019] In addition, farmland irrigation activities may also include information such as the irrigation frequency and the irrigation method (such as drip irrigation, sprinkler irrigation, etc.). For the detection of the irrigation frequency, the irrigation wireless decoder gateway can determine it by counting the number of irrigation times in each area within a certain period. The identification of the irrigation method can be achieved by analyzing the data characteristics collected by the sensors. For example, when using drip irrigation, the change in soil humidity is relatively slow and uniform, while when using sprinkler irrigation, the soil humidity may increase rapidly within a short period.
[0020] The fact that the irrigation wireless decoder gateway sinks the data processing ability to the edge device is of great significance. By initially processing the collected farmland IoT sensing data locally, it can reduce the pressure on the transmission bandwidth. For example, without sinking the data processing ability, a large amount of raw sensor data needs to be directly uploaded to the cloud or the central control system for processing, which will occupy a large amount of network bandwidth, resulting in data transmission delays and even network congestion. After preprocessing on the edge device, only the processed key data needs to be uploaded, greatly reducing the data transmission volume and improving the data transmission efficiency.
[0021] At the same time, sinking the data processing ability can also improve the real-time performance of data analysis. In the farmland irrigation scenario, real-time performance is very important. For example, when the soil humidity drops rapidly, timely irrigation decisions need to be made. If the data is uploaded to the cloud for analysis and decision-making, the decision may not be timely due to network delays and other reasons. By performing real-time processing on the edge device, decisions can be quickly made locally and the corresponding irrigation operations can be executed.
[0022] In addition, the irrigation wireless decoder gateway can operate offline when there is no 4G signal, ensuring the stability of the system. In some remote farmland areas, the 4G signal may be unstable or absent. At this time, the gateway can continue to operate relying on local computing resources and stored data, making irrigation decisions according to preset rules and algorithms to ensure that farmland irrigation work is not affected by network signals.
[0023] The irrigation wireless decoder gateway mainly includes a wireless reception module, a data decoding module, an edge computing module, and a communication interface module. The wireless reception 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 through a wireless LORA signal, the wireless reception module will accurately receive these signals to ensure reliable data reception.
[0024] The data decoding module decodes the received signals and converts them into digital signals that can be recognized and processed by a computer. For example, for sensor data using a specific coding format, the data decoding module will decode it according to the corresponding decoding algorithm to restore the original sensor data, such as soil moisture values, water flow rates, etc.
[0025] The edge computing module preprocesses, analyzes, or performs model inference on the decoded data to achieve 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 uploading and analysis.
[0026] The communication interface module transmits the processed results to the cloud or the central control system through 4G or a wired network. When the 4G signal is normal, the communication interface module will upload the processed data through the 4G network; in the case of a wired network connection, data can also be transmitted through the wired network to ensure that the data can reach the cloud or the central control system accurately and in a timely manner, providing support for further data analysis and decision-making.
[0027] Step S120: Construct an implicit representation of each farmland irrigation activity based on the farmland irrigation activity detection data.
[0028] 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.
[0029] 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.
[0030] 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:
[0031] 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, Z T 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,…,vp , where p is the number of feature dimensions. Select the eigenvectors corresponding to the top k largest eigenvalues to form the projection matrix P: P = (v1, v2, …, v k ), and finally, project the original data X into the low-dimensional space to obtain the reduced-dimensional implicit representation Y: Y = ZP.
[0032] Through the PCA algorithm, the irrigation wireless decoder gateway can reduce the dimensions of multiple features in the farmland irrigation activity detection data, extract the principal components that best represent the data features, and thus construct an implicit representation of the irrigation activity.
[0033] In addition, an autoencoder in deep learning can also be used to construct an implicit representation of the irrigation activity. An autoencoder is an unsupervised learning model, which consists of an encoder and a decoder. The encoder compresses the input data into a low-dimensional implicit representation, and the decoder then 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 features of the data, and thus obtain the implicit representation of the irrigation activity.
[0034] Step S130: Based on the implicit representations of the irrigation activities of each farmland irrigation activity, mine the temporal distribution among the various farmland irrigation activities in the farmland IoT sensing data to obtain the implicit temporal representation of the farmland irrigation activities.
[0035] In step S120, the irrigation wireless decoder gateway has constructed the implicit representations of the irrigation activities of each farmland irrigation activity. These implicit representations are abstractions and generalizations of the characteristics of the farmland irrigation activities. They contain the key information of the farmland irrigation activities, such as the comprehensive embodiment of features such as the location, duration, and water volume of irrigation. For example, for a certain irrigation activity, its implicit representation may be a multi-dimensional vector, where each dimension corresponds to a different feature. In this way, the complex irrigation activity information is effectively compressed and represented. These implicit representations provide the basic data for mining the temporal distribution among the farmland irrigation activities.
[0036] The temporal distribution refers to the arrangement and distribution rules of each farmland irrigation activity in the time series. During the farmland irrigation process, there are certain sequence and interval rules among different irrigation activities in time. These rules are of great significance for understanding the irrigation requirements and patterns of farmland. For example, in the growth cycle of some crops, there may be specific irrigation stages. For example, in the seedling stage, frequent and small amounts of irrigation are required, while in the mature stage, relatively less but larger amounts of irrigation are needed. By analyzing the temporal distribution among the farmland irrigation activities, these rules can be discovered, thus providing a basis for formulating reasonable irrigation strategies.
[0037] When the irrigation wireless decoder gateway explores the temporal distribution among farmland irrigation activities, multiple implementation methods can be adopted. One feasible method 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 farmland irrigation scenario, the occurrence times of various farmland irrigation activities can be regarded as time series data, and the temporal distribution pattern can be explored by analyzing features such as the autocorrelation and seasonality of these data.
[0038] For example, the autocorrelation function (ACF) of the time series data can be calculated to measure the correlation of the data at different time lags. The calculation formula of the autocorrelation function is:
[0039]
[0040] where r k represents the autocorrelation coefficient at a time lag of k, x t represents the t-th 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 coefficients at different time lags, the periodic and correlation features in the time series data can be discovered, thereby revealing the temporal distribution pattern among farmland irrigation activities.
[0041] Another implementation method is the machine learning-based method, such as the Hidden Markov Model (HMM). The Hidden Markov Model is a statistical model used to describe time series data with hidden states. In the farmland irrigation scenario, the states of farmland irrigation activities (such as different irrigation stages) can be regarded as hidden states, and the implicitly represented observed irrigation activities can be regarded as observations. By training the Hidden Markov Model, the transition probabilities between different states and the probability distribution of observations in each state can be learned, thereby exploring the temporal distribution pattern among farmland irrigation activities. After exploring the temporal distribution pattern among 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 pattern, and it can more effectively capture the features of farmland irrigation activities in the time series.
[0042] One way to construct an implicit representation of the timing sequence of farmland irrigation activities is to encode the timing distribution pattern. For example, different irrigation activities can be numbered according to their occurrence time sequence, and then these numbers are combined into a sequence as the implicit representation of the timing sequence. Suppose within a certain time period, the occurrence order of farmland irrigation activities is irrigation activity A, irrigation activity B, and irrigation activity C. Then the corresponding implicit representation of the timing sequence can be (1, 2, 3), where 1, 2, and 3 represent the numbers of irrigation activities A, B, and C respectively.
[0043] Another method is to use recurrent neural network (RNN) or long short-term memory network (LSTM) in deep learning to learn the timing characteristics of farmland irrigation activities.
[0044] Suppose within a farmland area, data on farmland irrigation activities over a period of time are collected through irrigation sensor nodes, including information such as the occurrence time, irrigation duration, and water volume of irrigation activities. After the processing in step S120, the implicit representation of each irrigation activity is obtained.
[0045] First, the autocorrelation function of the occurrence time of irrigation activities is calculated using time series analysis methods. Suppose it is found through calculation that obvious peaks appear in the autocorrelation coefficient at time lags of 7 days and 14 days, which indicates that there may be a pattern in farmland irrigation activities with periods of 7 days and 14 days. This may be related to the growth cycle of crops and the pattern of water requirements.
[0046] Then, further analysis is carried out based on the hidden Markov model. Suppose the farmland irrigation activities are divided into three hidden states: irrigation during the seedling stage, irrigation during the growth stage, and irrigation during the maturity stage. By training the hidden Markov model, the transition probabilities between different states and the probability distribution of observed values in each state are learned. For example, the probability of transitioning from the irrigation state during the seedling stage to the irrigation state during the growth stage is 0.6, and the probability of transitioning from the irrigation state during the growth stage to the irrigation state during the maturity stage is 0.4, etc.
[0047] Finally, an implicit representation of the timing sequence of farmland irrigation activities is constructed. For example, in the way of number encoding, the irrigation activities during the seedling stage are numbered 1, the irrigation activities during the growth stage are numbered 2, and the irrigation activities during the maturity stage are numbered 3. If within a certain time period, the occurrence order of irrigation activities is irrigation during the seedling stage, irrigation during the growth stage, and irrigation during the maturity stage, then the corresponding implicit representation of the timing sequence is (1, 2, 3).
[0048] Step S140: Based on the implicit representation of irrigation activities and the implicit representation of the timing sequence of farmland irrigation activities, detect whether the farmland IoT sensing data and the pattern example sensing data in the irrigation pattern list meet the common conditions.
[0049] In the previous steps, the irrigation wireless decoder gateway has obtained the implicit representation of the farmland irrigation activity and the implicit representation of the farmland irrigation activity time series. The implicit representation of the irrigation activity is an abstract and general description of the characteristics of the farmland irrigation activity, which contains the key information of the irrigation activity, such as the comprehensive embodiment of characteristics such as the location, duration, and water volume of the irrigation.
[0050] The irrigation mode list is a list that is predefined or continuously updated and improved during the operation of the system. It contains various different irrigation modes and the corresponding example sensor data of the modes. The irrigation mode is a series of irrigation strategies and methods formulated according to factors such as the soil type, crop variety, and climate conditions of the farmland. The example sensor data of the mode is the farmland IoT sensor data collected under a specific irrigation mode, which represents the typical characteristics and laws of the farmland irrigation activity under this irrigation mode.
[0051] For example, for a farmland growing wheat, there may be a "water-saving irrigation mode", and the corresponding example sensor data of the mode includes information such as the irrigation time, irrigation water volume, and soil moisture change at different growth stages. These data are obtained through actual irrigation operations and sensor collection on the premise of following the water-saving principle, and can reflect the characteristics and effects of this irrigation mode.
[0052] When the irrigation wireless decoder gateway detects whether the farmland IoT sensor data and the example sensor data of the mode meet the common conditions, multiple implementation methods can be adopted. One feasible method is similarity calculation. By calculating the similarity between the implicit representation of the irrigation activity and the implicit representation of the farmland irrigation activity time series and the implicit representation corresponding to the example sensor data of the mode, it is judged whether the common conditions are met.
[0053] For example, the cosine similarity can be used to calculate the similarity between two vectors. Suppose the implicit representation vector of the irrigation activity of the farmland IoT sensor data is A=(a1,a2,…,a n ), and the implicit representation vector of the irrigation activity corresponding to the example sensor data of the mode is B=(b1,b2,…,b n ), then the cosine similarity calculation formula between them is:
[0054]
[0055] Among them, cos(θ) represents the cosine similarity, and its value range is between [-1,1]. The closer the value is to 1, the more similar the two vectors are.
[0056] For the implicit representation of the timing sequence of farmland irrigation activities, a similar method can also be used to calculate the similarity. For example, the implicit representation of the timing sequence of farmland irrigation activities is expressed as a sequence, and the similarity between the two sequences is measured by calculating indicators such as the edit distance or the longest common subsequence between the 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.
[0057] In the specific detection process, the irrigation wireless decoder gateway first obtains the implicit representation of the irrigation activities of the farmland IoT sensing data and the implicit representation of the timing sequence of the farmland irrigation activities, and then traverses the pattern example sensing data in the irrigation mode list and calculates their similarities with the farmland IoT sensing data respectively.
[0058] In step S140, the irrigation wireless decoder gateway uses the implicit representation of the irrigation activities and the implicit representation of the timing sequence of the farmland irrigation activities, and adopts implementation methods such as similarity calculation to detect whether the farmland IoT sensing data and the pattern example sensing data in the irrigation mode list meet the common conditions, thus providing an important basis for determining the irrigation requirements of the farmland in the subsequent steps.
[0059] Step S150: When the pattern example sensing data whose pattern commonality coefficient with the farmland IoT sensing data meets the common conditions is detected in the irrigation mode list, the irrigation requirements corresponding to the pattern example sensing data that meet the common conditions are determined as the irrigation requirements of the target farmland area.
[0060] The pattern commonality coefficient is a quantitative index used to measure the similarity degree between the farmland IoT sensing data and the pattern example sensing data in the irrigation mode list. It comprehensively considers various characteristics such as the implicit representation of the irrigation activities and the implicit representation of the timing sequence of the farmland irrigation activities. In step S140, the irrigation wireless decoder gateway calculates the similarity between the farmland IoT sensing data and the pattern example sensing data through various implementation methods (such as the similarity calculation method mentioned above), and this similarity value can be regarded as an embodiment of the pattern commonality coefficient.
[0061] The common conditions are a pre-set judgment criterion used to determine whether the farmland IoT sensing data and the pattern example sensing data are similar enough to judge whether they belong to the same irrigation mode. The setting of the common conditions needs to comprehensively consider factors such as the actual situation of farmland irrigation, data characteristics, and the accuracy requirements of the system. For example, according to historical data and actual experience, a reasonable similarity threshold is set as the common condition, and when the pattern commonality coefficient is greater than or equal to this threshold, it is considered that the two meet the common conditions.
[0062] When determining the irrigation requirements of the target farmland area, the irrigation wireless decoder gateway mainly relies on the sample sensing data of the patterns that meet the common conditions found in the irrigation mode list. This involves the association and matching of the sample sensing data of the patterns and their corresponding irrigation requirements.
[0063] A feasible implementation method is to establish a database or data table to store the information in the irrigation mode list. In this database, each sample sensing data of the pattern is associated with the corresponding irrigation requirement information. The irrigation requirement information can include specific parameters such as the irrigation time interval, the amount of irrigation water, and the irrigation method. When the sample sensing data of the pattern that meets the common conditions is detected, the irrigation wireless decoder gateway queries the database to obtain the irrigation requirement information corresponding to the sample sensing data of the pattern and determines it as the irrigation requirement of the target farmland area.
[0064] For example, a relational database can be used to store this information. The database contains two main tables: one is the sample sensing data table of the pattern, which is used to store various sample sensing data of the patterns and their characteristic information, such as the implicit representation of irrigation activities and the implicit representation of the time sequence of farmland irrigation activities; the other is the irrigation requirement table, which is used to store the irrigation requirement 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 requirements of the target farmland area, the irrigation wireless decoder gateway finds the pattern identification of the sample sensing data of the pattern that meets the common conditions according to the calculated pattern commonality coefficient, and then queries the corresponding irrigation requirement information in the irrigation requirement table through this pattern identification.
[0065] After determining the irrigation requirements, 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 requirements. For example, controlling parameters such as the opening time and water flow rate of the irrigation sprinkler to achieve an automated and intelligent irrigation process.
[0066] In one implementation solution, in step S130, based on the implicit representation of irrigation activities of each farmland irrigation activity, the time sequence distribution among the various farmland irrigation activities in the farmland IoT sensing data is mined to obtain the implicit representation of the time sequence of farmland irrigation activities, including:
[0067] Step S131: Based on the implicit representation of irrigation activities of each farmland irrigation activity, the characteristics of each farmland irrigation activity are quantified to obtain the characteristic codes of each farmland irrigation activity;
[0068] Step S132: Based on the time sequence distribution of each farmland irrigation activity in the farmland IoT sensing data and the characteristic codes of each farmland irrigation activity, a characteristic code sequence corresponding to the farmland IoT sensing data is constructed;
[0069] Step S133: mining implicit temporal representation of farmland irrigation activities from the feature code sequence.
[0070] 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.
[0071] 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.
[0072] 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:
[0073] 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.
[0074] 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.
[0075] After clustering analysis, three different clusters are obtained, corresponding to three categories of farmland irrigation activities with different characteristics. Then, a numerical code is assigned to each cluster. For example, 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 it belongs to, realizing the quantification of the characteristics of farmland irrigation activities.
[0076] In step S132, after obtaining the characteristic codes of each farmland irrigation activity, the irrigation wireless decoder gateway combines the characteristic codes into a characteristic code sequence according to the time sequence distribution of the farmland irrigation activities in the farmland IoT sensing data, so as to more clearly reflect the time sequence and rules of the farmland irrigation activities.
[0077] Specifically, the irrigation wireless decoder gateway determines their positions in the time sequence according to the occurrence times of each farmland irrigation activity in the farmland IoT sensing data. Then, in chronological order, the characteristic codes of each farmland irrigation activity are arranged in sequence to form a characteristic code sequence.
[0078] For example, assume that there is farmland IoT sensing data recording 5 farmland irrigation activities occurring within a period of time, marked as activity A, activity B, activity C, activity D, and activity E respectively. After the feature quantification in step S131, their corresponding characteristic codes are 2, 1, 3, 2, 1 respectively. According to the time information recorded in the farmland IoT sensing data, the occurrence order of these irrigation activities is activity B, activity A, activity D, activity C, activity E. Then, the characteristic code sequence constructed by the irrigation wireless decoder gateway is (1, 2, 2, 3, 1).
[0079] When constructing the characteristic code sequence, it is also necessary to consider the data processing of the time periods of non-farmland irrigation activities. A feasible method is to set the data items of these time periods to a predefined value, such as 0. Assume that the time span of the farmland IoT sensing data is 10 time units, and the above 5 farmland irrigation activities occur at time units 2, 4, 6, 8, and 9 respectively. Then, the constructed characteristic code sequence can be expressed as (0, 1, 0, 2, 0, 2, 0, 3, 1, 0), where 0 indicates that no farmland irrigation activity occurs within this time unit.
[0080] In step S133, based on the constructed characteristic code sequence, further mine the implicit representation of the time sequence of farmland irrigation activities contained therein. The implicit representation of the time sequence of farmland irrigation activities can more abstractly and essentially reflect the rules and characteristics of farmland irrigation activities in the time sequence.
[0081] One implementation method is to use the edge algorithm for extracting activity time sequence relationships. This algorithm usually includes multiple time sequence filters connected in sequence, and extracts the time sequence features by filtering and processing the characteristic code sequence.
[0082] Specifically, the irrigation wireless decoder gateway passes the feature code sequence into the first timing filter in the edge algorithm for extracting the active timing relationship. 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), and the calculation formula is: where N is the order of the filter, h(k) is the filter coefficient, and x(n) is the input feature code sequence.
[0083] After being processed by the first timing filter, a preliminary filtering result is obtained. Then, this result is passed as input into the next timing filter and is successively processed by multiple timing filters. Each timing filter can filter and extract different frequency components of the feature code sequence.
[0084] After being processed by multiple timing filters, the irrigation wireless decoder gateway respectively performs downsampling on the outputs of these timing filters. Downsampling is an operation to reduce the data sampling rate. It can reduce the amount of data while retaining the main features of the data. For example, for a sequence of length N, after performing downsampling with a downsampling factor of M, the length of the new sequence obtained is N / M, and each element in the new sequence is selected from the original sequence by taking one element every M elements. Finally, the outputs of multiple timing filters after downsampling are integrally processed, such as by weighted summation or concatenation, etc., to obtain an implicit representation of the farmland irrigation activity timing.
[0085] For example, assume there is a feature code sequence (1, 2, 2, 3, 1, 0, 2, 3, 2, 1). After being processed by 3 timing filters, the obtained 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) respectively. Then, downsampling is performed on these 3 output sequences. Assume the downsampling factor is 2, and the obtained 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) respectively. Finally, these 3 downsampled sequences are integrated by weighted summation. Assume the weights are 0.3, 0.3, and 0.4 respectively, and the implicit representation of the farmland irrigation activity timing obtained is (1.11, 1.47, 1.21, 1.64, 1.22).
[0086] In one implementation, in step S131, based on the implicit representation of each farmland irrigation activity, feature quantization is performed on each farmland irrigation activity to obtain the feature codes of each farmland irrigation activity, including:
[0087] Step S1311: Obtain multiple cluster representative points, which are obtained by performing cluster analysis on the implicit representation of the farmland irrigation activities covered in the pattern example sensing data;
[0088] Step S1312: Based on the feature similarity between the implicit representation of each farmland irrigation activity and the multiple cluster representative points, determine the cluster representative point that is most similar to the implicit representation of each farmland irrigation activity;
[0089] Step S1313: Construct the feature code of each farmland irrigation activity according to the numerical number corresponding to the cluster representative point that is most similar to the implicit representation of each farmland irrigation activity.
[0090] In step S1311, the irrigation wireless decoder gateway obtains multiple cluster representative points, which are obtained by performing cluster analysis on the implicit representation of the farmland irrigation activities in the pattern example sensing 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.
[0091] When specifically implementing cluster analysis, the irrigation wireless decoder gateway can adopt various clustering algorithms, such as the K-Means algorithm. Assume that the pattern example sensing data covers a large number of implicit representations of farmland irrigation activities, and these implicit representations can be expressed as multi-dimensional vectors. For example, each implicit representation vector of an irrigation activity may contain eigenvalue features in multiple dimensions such as irrigation duration, irrigation water volume, and soil moisture change. The following is the specific process of using the K-Means algorithm to obtain cluster representative points:
[0092] First, determine the number of clusters K. The selection of K usually needs to be determined according to the characteristics of the data and actual requirements. For example, the appropriate value of K can be determined by observing the data distribution, business knowledge, or using some evaluation metrics (such as the silhouette coefficient, etc.). Assume that based on experience and data characteristics, K = 5 is determined, that is, the farmland irrigation activities are to be divided into 5 different clusters. Then, randomly select K initial cluster centers. These initial cluster centers can be K implicit representation vectors of irrigation activities randomly selected from the pattern example sensing data.
[0093] Next, calculate the distances from the implicit representation vectors of each irrigation activity to each cluster center. Then, update the cluster centers of each cluster. The new cluster center is the mean vector of all the implicit representation vectors of the irrigation activities in that cluster. Repeat the steps of calculating distances, assigning clusters, and updating the cluster centers until the cluster centers no longer change or a predetermined number of iterations is reached.
[0094] After multiple iterations, the K-Means algorithm converges, obtaining 5 stable cluster centers, which are the cluster representative points.
[0095] In step S1312, after obtaining multiple cluster representative points, the irrigation wireless decoder gateway calculates the feature similarity between the implicit representation of each farmland irrigation activity and these cluster representative points to determine the most similar cluster representative point. There are various methods for calculating the feature similarity, and feasible ones include cosine similarity and Euclidean distance similarity, etc.
[0096] In step S1313, after determining the cluster representative point that is most similar to the implicit representation of each farmland irrigation activity, the irrigation wireless decoder gateway constructs the feature code of each farmland irrigation activity according to the numerical number corresponding to these cluster representative points.
[0097] Suppose among the 5 cluster representative points obtained previously, 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.
[0098] For the implicit representation vector of the farmland irrigation activity calculated previously Since its most similar cluster representative point is p1, and the numerical number corresponding to p1 is 1, the feature code of this farmland irrigation activity is 1.
[0099] Suppose there is another implicit representation vector of a farmland irrigation activity By calculating the cosine similarity between it and the 5 cluster representative points, it is found that it is most similar to p4, then the feature code of this farmland irrigation activity is 4.
[0100] In this way, the irrigation wireless decoder gateway can construct the corresponding feature code for each farmland irrigation activity, realizing the feature quantization of the farmland irrigation activity. These feature codes can represent the features of the farmland irrigation activity more concisely and effectively, providing a basis for subsequent mining of the temporal distribution between farmland irrigation activities and constructing the temporal implicit representation of farmland irrigation activities.
[0101] In one implementation scheme, the gateway data processing method based on the edge algorithm further includes the determination process of the cluster representative points, including:
[0102] 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;
[0103] 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;
[0104] 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 a plurality of cluster representative points.
[0105] 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.
[0106] 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.
[0107] Meanwhile, the irrigation wireless decoder gateway also needs to obtain the implicit representation of irrigation activities in the farmland irrigation activities covered by the pattern example sensing data. The pattern example sensing data is the farmland IoT sensing data collected under a specific irrigation pattern, which contains rich information on 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 represented as a multi-dimensional vector. For example, for an irrigation activity, its implicit representation vector of irrigation activities may include characteristic values in multiple dimensions such as irrigation duration, irrigation water volume, soil humidity during irrigation, and ambient temperature. Suppose there are 100 records of farmland irrigation activities in the pattern example sensing data, then there will be 100 corresponding implicit representation vectors of irrigation activities.
[0108] 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 this data. Determining the number of cluster representative points requires comprehensive consideration of the diversity and complexity of the predefined farmland irrigation activities and their related activities.
[0109] A feasible determination method is to add the number of predefined farmland irrigation activities and the number of related farmland irrigation activities to obtain a total value, and then determine the number of cluster representative points based on this total value and the distribution characteristics and analysis requirements of the data. For example, as mentioned before, the number of predefined farmland irrigation activities is 5, and the number of related farmland irrigation activities after statistical summary is 8, then the total value is 13. Suppose based on experience and data characteristics, it is considered 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 initially determined to be 13.
[0110] However, in actual applications, the distribution of the data also needs to be considered. If the differences between some irrigation activities and their related activities are small, they may be merged into one cluster, and at this time, the number of cluster representative points needs to be appropriately reduced. For example, through further analysis of the data, it is found that the supplementary irrigation activities during some mild droughts and the regular irrigation activities during a specific growth period are similar in characteristics such as irrigation duration and water volume, then they can be merged into one cluster, and correspondingly, the number of cluster representative points can be adjusted from 13 to 12.
[0111] In step S131c, after determining the number of cluster representative points, the irrigation wireless decoder gateway starts to perform cluster analysis on the implicit representation of irrigation activities in the farmland irrigation activities covered by 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 the data objects within the same cluster have high similarity, while the data objects between different clusters have large differences. The above content has been introduced and will not be elaborated here.
[0112] In one implementation, step S132 is to construct a feature code sequence corresponding to the agricultural IoT sensing data based on the temporal distribution of each farmland irrigation activity in the agricultural IoT sensing data and the feature codes of each farmland irrigation activity, including:
[0113] Step S1321: Based on the temporal distribution of each farmland irrigation activity in the agricultural IoT sensing data, use the feature codes of each farmland irrigation activity to replace the data items at the temporal distribution positions where each farmland irrigation activity is located;
[0114] Step S1322: Change the data items in the agricultural IoT sensing data except for the temporal distribution positions where each farmland irrigation activity is located to predefined values, so as to construct a feature code sequence corresponding to the agricultural IoT sensing data.
[0115] In step S1321, the irrigation wireless decoder gateway replaces the data items corresponding to the temporal distribution positions of each farmland irrigation activity with the feature codes of each farmland irrigation activity according to the temporal distribution information of the farmland irrigation activity in the agricultural IoT sensing data. The agricultural IoT sensing data is a series of data related to farmland irrigation recorded in chronological order, which includes the time points when each farmland irrigation activity occurs and other relevant information. The temporal distribution of the farmland irrigation activity clarifies the specific positions of each irrigation activity in the entire time series.
[0116] For example, assume that a section of agricultural IoT sensing data records the irrigation situation of a certain farmland within 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, 3 farmland irrigation activities are recorded, which occur at the 24th hour, the 72nd hour, and the 120th hour respectively. After the processing of the previous steps, the feature codes corresponding to these 3 farmland irrigation activities are 1, 2, and 3 respectively.
[0117] In the original agricultural IoT sensing data, various sensor-collected data may be recorded at each time point, such as soil humidity, 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 the feature code 1, the data item at the 72nd hour with the feature code 2, and the data item at the 120th hour with the feature code 3. After replacement, in the new data sequence, the data corresponding to the 24th hour becomes 1, the data corresponding to the 72nd hour becomes 2, the data corresponding to the 120th hour becomes 3, and the data items at other time points where no farmland irrigation activity occurs remain unchanged.
[0118] The irrigation wireless decoder gateway can adopt an implementation method of traversing the time series. Specifically, the gateway starts from the starting point of the time series and checks each time point one by one to see if there is a farmland irrigation activity. If a farmland irrigation activity is detected at a certain time point, it looks up the corresponding feature code for this irrigation activity and replaces the data item at that time point with the feature code.
[0119] In step S1322, after completing the replacement of the data items at the time series distribution where the farmland irrigation activity is located in step S1321, the irrigation wireless decoder gateway processes the remaining data items in the farmland IoT sensing data that have not been replaced, that is, changes these data items to predefined values, so as to finally construct the feature code sequence corresponding to the farmland IoT sensing data.
[0120] The predefined value is a specific value preset during the system design stage, which is used to indicate that there is no farmland irrigation activity at that time point. The selection of this value usually needs to be distinguished from the feature code of the farmland irrigation activity, so that in subsequent data analysis and processing, it can be clearly identified which time points have irrigation activities and which time points do not. For example, the predefined value can be set to 0.
[0121] Continuing with the above example, after the processing in step S1321, except for the data items at the 24th hour, 72nd hour, and 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 finally constructed feature code sequence clearly reflects the distribution of the farmland irrigation activity in the time series, where the feature code represents the time points when irrigation activities occur, and the predefined value 0 represents the time points when no irrigation activities occur.
[0122] For example, after this step of processing, the feature code sequence may be as follows (only showing part of the data): (0, 0, …, 0, 1, 0, 0, …, 0, 2, 0, 0, …, 0, 3, 0, 0, …, 0), where 1, 2, and 3 respectively correspond to the feature codes of different farmland irrigation activities, and the 0 in the middle indicates that there is no farmland irrigation activity at the corresponding time point. In the actual implementation process, the irrigation wireless decoder gateway can traverse the time series again and assign the predefined value to those data items that have not been replaced by the feature code.
[0123] Through the operations of steps S1321 to S1322, the irrigation wireless decoder gateway has successfully constructed a characteristic code sequence corresponding to the farmland Internet of Things sensing data. This characteristic 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 subsequently mining the implicit temporal representation of farmland irrigation activities from the characteristic code sequence.
[0124] In an implementation scheme, step S133, mining the implicit temporal representation of farmland irrigation activities from the characteristic code sequence, includes:
[0125] Step S1331: Input the characteristic code sequence into the activity temporal relationship extraction edge algorithm, which includes a plurality of sequentially connected temporal filters, and the characteristic code sequence is input into the first temporal filter among the plurality of temporal filters;
[0126] Step S1332: After respectively performing downsampling processing on the outputs of the plurality of temporal filters among the plurality of temporal filters, perform integration processing to obtain the implicit temporal representation of farmland irrigation activities.
[0127] In step S1331, the irrigation wireless decoder gateway inputs the constructed characteristic code sequence into the activity temporal relationship extraction edge algorithm to further mine the implicit temporal representation of farmland irrigation activities contained therein. The activity temporal relationship extraction edge algorithm is an algorithm specifically designed for processing and analyzing time series data. It gradually processes the input characteristic code sequence through a plurality of sequentially connected temporal filters to extract the characteristic information related to the temporal sequence of farmland irrigation activities.
[0128] A temporal filter is a tool that can perform filtering processing on time series data. It can perform operations such as weighting, smoothing, and feature extraction on the input sequence data according to specific filtering rules and parameters, so as to highlight or suppress certain specific frequency components or feature patterns in the data. Each temporal filter has its specific functions and parameter settings, and a plurality of temporal filters are sequentially connected to form a processing chain to process the characteristic code sequence step by step.
[0129] For example, assume that there is a characteristic code sequence representing the irrigation activities of a certain farmland over a period of time, and the characteristic code sequence is (0, 1, 0, 2, 0, 0, 3, 0, 1, 0), where 0 represents no irrigation activity, and 1, 2, and 3 respectively represent different types of farmland irrigation activities. When the irrigation wireless decoder gateway inputs this characteristic code sequence into the activity temporal relationship extraction edge algorithm, it will first input it into the first temporal filter.
[0130] The first time series filter is, for example, a simple moving average filter that smooths the input signature sequence to reduce the influence 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 this data point. Suppose the window size of this moving average filter is 3, that is, calculate the average value of each data point and the data points before and after it by 1. For the second data point 1 in the signature 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 preliminarily filtered sequence is obtained.
[0131] 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 technique that reduces the data volume by reducing the sampling frequency of the data while retaining the main features of the data. In the processing of time series data, 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. Suppose after being processed by multiple time series filters, 3 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), sequence C: (0.1, 0.3, 0.5, 0.7, 0.9). If downsampling 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).
[0132] The integration process is to merge and comprehensively process multiple sequences after downsampling to generate the final implicit representation of the farmland irrigation activity time series. There are various methods for the integration process, and feasible ones include weighted summation, splicing, etc.
[0133] Weighted summation assigns a weight to each downsampled sequence, and then the data points at the corresponding positions in each sequence are weighted and summed according to the weights to obtain the final integrated result. For example, assume that weights 0.3, 0.4, and 0.3 are assigned to the new sequences A', B', and C' respectively. Then the integrated result sequence 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).
[0134] Concatenation is to directly connect each downsampled sequence together to form a longer sequence as the final integrated result. For example, the result sequence obtained by concatenating 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).
[0135] In practical applications, the irrigation wireless decoder gateway can select an appropriate integration processing method according to specific requirements and data characteristics. For example, if it is desired to highlight the output results of certain time series filters, the weighted summation method can be used, and larger weights can be assigned to important sequences; if it is desired to retain more original information, the concatenation method can be used.
[0136] In one implementation, the gateway data processing method based on the edge algorithm further includes the training process of the edge algorithm for extracting active time series relationships, including:[[]]
[0137] Step S133a: Obtain a learning example set for training the edge algorithm for extracting active time series relationships. The learning example set includes reference IoT sensing data examples, homogeneous IoT sensing data examples, and heterogeneous IoT sensing data examples; among them, the reference IoT sensing data examples, homogeneous IoT sensing data examples, and heterogeneous IoT sensing data examples are all feature code sequences;
[0138] Step S133b: Input the learning example set into the edge algorithm for extracting active time series relationships, and execute to obtain the first encoded implicit representation of the reference IoT sensing data examples, the second encoded implicit representation of the heterogeneous IoT sensing data examples, and the third encoded implicit representation of the homogeneous IoT sensing data examples obtained by the execution of the edge algorithm for extracting active time series relationships;
[0139] Step S133c: Based on the first feature similarity between the first encoded implicit representation and the second encoded implicit representation, and the second feature similarity between the first encoded implicit representation and the third encoded implicit representation, obtain the difference result between the first feature similarity and the second feature similarity;
[0140] Step S133d: Taking the result of the difference being less than or equal to a predefined value as the learning criterion, correct the algorithm weights of the edge algorithm for extracting the activity timing relationship.
[0141] In step S133a, the irrigation wireless decoder gateway collects a learning example set for training the edge algorithm for extracting the activity timing relationship. The learning example set is composed of different types of IoT sensing data examples, which are of great significance for the algorithm to learn and understand the timing relationship of farmland irrigation activities.
[0142] The reference IoT sensing data example is a characteristic code sequence as a reference standard, which represents a specific timing pattern of farmland irrigation activities. For example, in a certain farmland area, according to historical data and expert experience, an ideal irrigation activity timing pattern at a specific stage of crop growth is determined, such as irrigation once every 3 days, with each irrigation lasting 2 hours, and the corresponding characteristic code sequence is (0, 0, 1, 0, 0, 1, 0, 0, 1,...), where 1 represents an irrigation activity and 0 represents no irrigation activity. This sequence can be used as the reference IoT sensing data example.
[0143] The similar IoT sensing data examples have similar timing characteristics of farmland irrigation activities to the reference IoT sensing data example. They are relatively close to the reference IoT sensing data example in terms of the time interval and duration of irrigation activities. For example, the irrigation activity timing pattern in another farmland area is irrigation once every 2.8 days, with each irrigation lasting 2.1 hours, and the corresponding characteristic code sequence is (0, 0, 1, 0, 0, 1, 0, 0, 1,...). This sequence is similar to the previous reference IoT sensing data example in terms of the overall timing characteristics and can be used as a similar IoT sensing data example.
[0144] The dissimilar IoT sensing data examples have significantly different timing characteristics of farmland irrigation activities from the reference IoT sensing data example. For example, in a certain farmland area, due to special soil conditions or crop requirements, an irrigation pattern of once every 7 days, with each irrigation lasting 4 hours, is adopted, and the corresponding characteristic code sequence is (0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1,...), which is quite different from the previous reference IoT sensing data example and can be used as a dissimilar IoT sensing data example.
[0145] To obtain these learning example sets, the irrigation wireless decoder gateway can retrieve relevant farmland IoT sensing data records from the historical database. After the data processing and characteristic code sequence construction processes in the previous steps, different characteristic code sequences are obtained as learning examples. At the same time, through manual annotation, according to expert knowledge and actual needs, it can be determined which characteristic code sequences belong to the reference IoT sensing data example, similar IoT sensing data examples, and dissimilar IoT sensing data examples.
[0146] In step S133b, after obtaining the learning example set, the irrigation wireless decoder gateway transmits these examples to the edge algorithm for extracting the activity timing relationship for processing. The edge algorithm for extracting the activity timing relationship encodes different types of IoT sensing data examples to generate corresponding encoded implicit representations.
[0147] The encoded implicit representation is a form of representation that can more abstractly reflect the data characteristics after being processed by an algorithm. It extracts the key information contained therein through a series of calculations and transformations on the input feature code sequence.
[0148] For example, for the reference IoT sensing data example (0, 0, 1, 0, 0, 1, 0, 0, 1,...), the edge algorithm for extracting the activity timing relationship may be processed through a multi-layer neural network structure. First, the input layer receives this feature code sequence, and then through the calculations of several hidden layers, the neurons in each hidden layer perform operations such as weighted summation and activation function processing on the input data. Finally, a low-dimensional vector is obtained as the first encoded implicit representation at the output layer, assumed to be (0.8, 0.6, 0.4).
[0149] Similarly, for the heterogeneous IoT sensing data example (0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1,...), after being processed by the edge algorithm for extracting the activity timing relationship, a second encoded implicit representation is obtained, assumed to be (0.2, 0.1, 0.9). For the homogeneous IoT sensing data example (0, 0, 1, 0, 0, 1, 0, 0, 1,...), a third encoded implicit representation is obtained, assumed to be (0.7, 0.5, 0.3).
[0150] In step S133c, after obtaining the encoded implicit representations of different types of IoT sensing data examples, the irrigation wireless decoder gateway calculates the feature similarity between them and obtains the difference result between the similarities. The feature similarity is an index used to measure the similarity degree between two encoded implicit representations. Feasible calculation methods include cosine similarity, Euclidean distance, etc. Details are not elaborated here.
[0151] In step S133d, after obtaining the difference result of the feature similarity, the irrigation wireless decoder gateway uses whether the difference result is less than or equal to a predefined value as the learning criterion to determine whether the performance of the edge algorithm for extracting the activity timing relationship meets the requirements. The predefined value is a threshold set according to actual needs and experience and is used to measure the discrimination ability of the algorithm for different types of IoT sensing data examples.
[0152] If the result of the difference is less than or equal to the predefined value, it indicates that the algorithm can better distinguish between similar and dissimilar IoT sensing data samples, that is, the learning effect of the temporal relationship of farmland irrigation activities is better; if the result of the difference is greater than the predefined value, it indicates that the performance of the algorithm needs to be improved and the algorithm weights need to be corrected.
[0153] The algorithm weights are the parameters of each computing unit in the edge algorithm for extracting temporal relationship of activities (such as the neuron connection weights in a neural network), which determine the flow and processing mode of data in the algorithm. The purpose of correcting the algorithm weights is to enable the algorithm to better learn and extract the temporal features of farmland irrigation activities and improve the ability to distinguish different types of IoT sensing data samples. A feasible method for weight correction is to use the 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 weights, and then updates the weights 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:
[0154]
[0155] where, represents the partial derivative of the loss function with respect to the weights, which can be calculated through the backpropagation algorithm. In each iteration training process, the irrigation wireless decoder gateway determines whether 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.
[0156] In one implementation scheme, in step S133d, taking the result of the difference being less than or equal to the predefined value as the learning criterion, correcting the algorithm weights of the edge algorithm for extracting temporal relationship of activities includes:
[0157] Step S133d1: Construct the training error corresponding to the learning example set based on the result of the difference and the predefined value;
[0158] Step S133d2: Integrate the training errors corresponding to multiple learning example sets of a predefined quantity to determine the combined error for one training;
[0159] Step S133d3: Correct the algorithm weights of the edge algorithm for extracting temporal relationship of activities based on the combined error.
[0160] In step S133d1, the irrigation wireless decoder gateway constructs the training error corresponding to the learning example set based on the difference result and the predefined value. The training error is an index that measures the gap between the performance of the activity timing relationship extraction edge algorithm on the current learning example set and the expected goal. The difference result is the difference between the first feature similarity and the second feature similarity calculated in step S133c, which reflects the ability of the algorithm to distinguish between similar and dissimilar IoT sensing data examples. The predefined value is a threshold preset according to actual requirements and experience, used to determine whether the performance of the algorithm meets the requirements.
[0161] A feasible 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 values and the true values, which can reflect the degree of deviation between the predicted values and the true values. In this step, the calculation formula for the training error can be expressed as: where E represents the training error, n is the number of learning example sets, d i is the difference result of the i-th learning example, and p is the predefined value.
[0162] By calculating the training error, the irrigation wireless decoder gateway can quantify the gap between the performance of the activity timing relationship extraction edge algorithm on the current learning example set and the expected goal, providing a basis for subsequent weight correction.
[0163] In step S133d2, after obtaining the training error corresponding to a single learning example set, the irrigation wireless decoder gateway integrates the training errors of a predefined number of learning example sets to obtain the combined error for one training. The combined error is a comprehensive measure of the algorithm performance on multiple learning example sets, which can more comprehensively reflect the overall performance of the activity timing relationship extraction edge algorithm under different data conditions.
[0164] There are various methods to integrate the training errors. A feasible one is the simple average method. That is, add the training errors of a predefined number of learning example sets and then divide by the number of learning example sets to obtain the combined error. By calculating the combined error, the irrigation wireless decoder gateway can comprehensively consider the training situations on multiple learning example sets, more accurately evaluate the performance of the activity timing relationship extraction edge algorithm, and provide a more comprehensive basis for subsequent weight correction.
[0165] In step S133d3, after obtaining the combined error of one training, the irrigation wireless decoder gateway corrects the algorithm weights of the edge algorithm for extracting the activity timing relationship according to the magnitude of the combined error. The algorithm weights are the parameters used for calculating and processing data in the edge algorithm for extracting the activity timing relationship, and they have an important impact on the output results of the algorithm. The purpose of correcting the algorithm weights 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 timing.
[0166] A feasible method for weight correction 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) with respect to the weights, and then update the weights according to the direction of the gradient and a certain learning rate to gradually reduce the value of the loss function. For specific details, please refer to the foregoing content and will not be elaborated here.
[0167] In one implementation solution, the gateway data processing method based on the edge algorithm further includes a process for determining a learning example set, including the following steps:
[0168] Step S133aI: Obtain multiple feature code sequences and the corresponding farmland irrigation activity identification list for each feature code sequence. The farmland irrigation activity identification list is obtained by arranging the feature codes of the farmland irrigation activities covered in the feature code sequence in a set order;
[0169] Step S133aII: Select a target feature code sequence from the multiple feature code sequences. Based on the target farmland irrigation activity identification list corresponding to the target feature code sequence, search for the first feature code sequence in the multiple feature code sequences whose corresponding farmland irrigation activity identification list is the same as or has the target farmland irrigation activity identification list;
[0170] Step S133aIII: Construct a learning example set by taking the target feature code sequence as the reference object for the associated sensing data example, taking the first feature code sequence as the similar associated sensing data example corresponding to the target feature code sequence, and taking the remaining feature code sequences in the multiple feature code sequences except for the target feature code sequence and the first feature code sequence as the dissimilar associated sensing data examples corresponding to the target feature code sequence.
[0171] 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 by processing the farmland IoT sensing data and represent the feature encodings of farmland irrigation activities in the time series. For example, assume that the IoT sensing 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 indicates that no irrigation activity occurs at this time point.
[0172] At the same time, for each feature code sequence, the irrigation wireless decoder gateway needs to obtain its corresponding list of farmland irrigation activity identifiers. This identifier 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 the chronological order or rules such as the numerical size of the feature codes. For example, for feature code sequence A, assuming in chronological order, its corresponding list of farmland irrigation activity identifiers is [(1, t1), (2, t3), (1, t5), (3, t7)], where t1, t3, t5, and t7 respectively represent the time positions of the corresponding irrigation activities in the feature code sequence.
[0173] To obtain these feature code sequences and the list of farmland irrigation activity identifiers, the irrigation wireless decoder gateway can read relevant data from the database storing the farmland IoT sensing data and process and extract them through specific algorithms and program logics. For example, use database query statements to retrieve the required farmland IoT sensing data records from the database, and then construct the feature code sequences and generate the list of farmland irrigation activity identifiers for these data.
[0174] In step S133aII, after obtaining multiple feature code sequences and their corresponding lists of farmland irrigation activity identifiers, the irrigation wireless decoder gateway will select a target feature code sequence from these feature code sequences. This selection process can be random or based on specific rules or conditions. For example, determine the target feature code sequence according to factors such as the importance of the farmland area and the integrity of the data.
[0175] Suppose the selected signature sequence A is used as the target signature sequence, and its corresponding list of target farmland irrigation activity identifiers is [(1, t1), (2, t3), (1, t5), (3, t7)]. Next, the irrigation wireless decoder gateway will search for the first signature sequence that meets specific conditions in the remaining signature sequences based on this list of target farmland irrigation activity identifiers. These conditions are that the corresponding list of farmland irrigation activity identifiers is the same as or has the list of target farmland irrigation activity identifiers.
[0176] The same situation means that the elements in the two lists of farmland irrigation activity identifiers are exactly the same, including the signature of the irrigation activity and the corresponding time positions. For example, if there is another signature sequence D, and its corresponding list of farmland irrigation activity identifiers is also [(1, t1), (2, t3), (1, t5), (3, t7)], then the signature sequence D is the first signature sequence that meets the conditions.
[0177] The situation of having the list of target farmland irrigation activity identifiers means that the list of farmland irrigation activity identifiers of another signature sequence contains some or all of the elements in the list of target farmland irrigation activity identifiers. For example, the list of farmland irrigation activity identifiers of signature sequence B is [(2, t2), (1, t4), (3, t6), (1, t8)]. Although the time positions are not exactly the same as the list of target farmland irrigation activity identifiers, it contains the same signatures 1, 2, and 3. Then, the signature sequence B can also be considered as the first signature sequence that meets the conditions.
[0178] To implement the search process, the irrigation wireless decoder gateway can adopt a traversal and comparison implementation method. That is, compare each element of the list of farmland irrigation activity identifiers of each signature sequence with the list of target farmland irrigation activity identifiers to determine whether the conditions of being the same or having are met.
[0179] In step S133aIII, after determining the target signature sequence and the first signature sequence, the irrigation wireless decoder gateway will construct a learning example set based on these sequences. The learning example set is a data set used to train the edge algorithm for extracting activity time sequence relationships, and it includes reference object IoT sensing data examples, similar object IoT sensing data examples, and dissimilar object IoT sensing data examples.
[0180] Taking the target signature sequence as the reference object IoT sensing data example is because it is the reference standard for the entire learning example set. For example, the selected target signature sequence A is used as the reference object IoT sensing data example, representing a specific farmland irrigation activity time sequence pattern.
[0181] The first feature code sequence is used as a sample of the same type of Internet of Things sensing data corresponding to the target feature code sequence because the list of farm irrigation activity identifiers corresponding to it satisfies specific conditions. The sample of the same type of Internet of Things sensing data has similarity with the reference Internet of Things sensing data sample in the temporal characteristics of farm irrigation activities. For example, the aforementioned feature code sequences B or D (if any) can be used as samples of the same type of Internet of Things sensing data, and they have a certain similarity with the target feature code sequence A in the type and time distribution of irrigation activities.
[0182] For the remaining feature code sequences among the multiple feature code sequences, excluding the target feature code sequence and the first feature code sequence, the irrigation wireless decoder gateway uses them as samples of different types of Internet of Things sensing data corresponding to the target feature code sequence. The sample of different types of Internet of Things sensing data has obvious differences from the reference Internet of Things sensing data sample in the temporal characteristics of farm irrigation activities. For example, the feature code sequence C is quite different from the target feature code sequence A in the arrangement of feature codes and time positions of irrigation activities, so it can be used as a sample of different types of Internet of Things sensing data.
[0183] In this way, the irrigation wireless decoder gateway constructs a learning sample set. This learning sample set contains different types of Internet of Things sensing data samples, which can provide rich and diverse data support for the training of the edge algorithm for extracting activity temporal relationships, enabling the algorithm to learn the differences and characteristics between different farm irrigation activity temporal patterns, thereby improving the performance and generalization ability of the algorithm.
[0184] 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 lists of farm irrigation activity identifiers, 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, providing basic data for the training of the edge algorithm for extracting activity temporal relationships, which helps to improve the algorithm's ability to mine and accuracy of the implicit representation of farm irrigation activity timings.
[0185] In one implementation, step S133a, obtaining a learning sample set for training the edge algorithm for extracting activity temporal relationships, includes:
[0186] Step S133a1: Obtain the selected reference Internet of Things sensing data sample.
[0187] In step S133a1, the irrigation wireless decoder gateway obtains the selected reference Internet of Things sensing data sample from numerous candidate data. It can be screened and selected from historical farm Internet of Things sensing data. These historical data record various irrigation activity-related information in different time periods and different farm areas, and after previous data processing and feature extraction, they have been transformed into the form of feature code sequences.
[0188] Suppose a feature code sequence found in 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 indicates that there is no irrigation activity at this time point. The timing pattern of the irrigation activities represented by this feature code sequence conforms to the typical irrigation pattern of this farmland at a specific stage. Therefore, the irrigation wireless decoder gateway can select it as a reference for the associated sensing data sample.
[0189] Step S133a2: On the basis of the fixed timing of the farmland irrigation activities in the reference associated sensing data sample, perform sample augmentation on the reference associated sensing data sample to obtain the associated sensing data samples of the same kind corresponding to the reference associated sensing data sample.
[0190] In step S133a2, after obtaining the reference associated sensing data sample, the irrigation wireless decoder gateway performs sample augmentation on it while keeping the timing of the farmland irrigation activities in the reference associated sensing data sample fixed, in order to obtain the associated sensing data samples of the same kind corresponding to it. The purpose of sample augmentation is to increase the diversity of the learning sample set, so that the algorithm can learn more timing patterns of farmland irrigation activities with similar characteristics, thereby improving the generalization ability and robustness of the algorithm.
[0191] The associated sensing data samples of the same kind should have a high similarity in the timing characteristics of the farmland irrigation activities with the reference associated sensing data sample, but not be exactly the same, in order to reflect the diversity of the data.
[0192] For example, on the basis of the fixed timing of the farmland irrigation activities in the reference associated sensing data sample, perform sample augmentation on the reference associated sensing data sample, including one or more of the following augmentation strategies:
[0193] 1. Perform global shifting on the reference associated sensing data sample or all the farmland irrigation activities that the reference associated sensing data sample has.
[0194] Global shifting means shifting the entire irrigation activity sequence along the time axis while keeping the relative timing of the farmland irrigation activities unchanged. For example, for the previously selected reference associated sensing data sample (1, 0, 0, 2, 0, 0, 1, 0, 0), assume that it is shifted backward by 2 time units as a whole, and a new feature code sequence (0, 0, 1, 0, 0, 2, 0, 0, 1) is obtained. This new feature code sequence has the same timing of the farmland irrigation activities as the original reference associated sensing data sample, but only has an overall shift in time, so it can be used as an associated sensing data sample of the same kind.
[0195] For example, an irrigation wireless decoder gateway can achieve global relocation by adjusting the indexing of the signature sequence. For example, in a programming language, loop and indexing operations are used to rearrange the elements in the original signature sequence according to a specified offset to obtain a new signature sequence.
[0196] 2. Downsample or upsample the reference IoT sensing data sample.
[0197] Downsampling refers to reducing the sampling frequency of data, that is, selecting data points at a certain interval to obtain a new sequence with reduced data volume but still retaining the main features; upsampling is to increase the sampling frequency of data, and new data points are inserted between the original data points through methods such as interpolation to obtain a new sequence with increased data volume.
[0198] For example, for the reference IoT sensing data sample (1, 0, 0, 2, 0, 0, 1, 0, 0), perform downsampling. Assuming the sampling interval is 2, that is, select one data point every other data point, and obtain a new signature sequence (1, 0, 2, 0, 1, 0). This new sequence retains the temporal characteristics of the farmland irrigation activities of the original sequence to a certain extent and can be used as a similar IoT sensing data sample.
[0199] Upsampling can be achieved by using interpolation methods such as linear interpolation. Assume that the above reference IoT sensing data sample is to be upsampled by a factor of 2, 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: where y1 = 1, y2 = 0, and the calculated inserted value is 0.5. And so on, the new signature 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 similar IoT sensing data sample.
[0200] 3. Downsample or upsample the predetermined farmland irrigation activities in the reference IoT sensing data sample.
[0201] Different from downsampling or upsampling the entire reference object - associated sensing data sample, this strategy operates on specific farmland irrigation activities. For example, for the reference object - associated sensing data sample (1, 0, 0, 2, 0, 0, 1, 0, 0), assuming that the predetermined farmland irrigation activity is the irrigation activity represented by feature code 2, perform downsampling on it, that is, delete some data points around feature code 2 and its adjacent ones according to certain rules. For instance, delete 2 and an adjacent 0, obtaining a new feature code sequence (1, 0, 0, 0, 1, 0, 0), and this new sequence can be used as a similar object - associated sensing data sample. The operation of upsampling is similar. For example, when performing upsampling on the irrigation activity represented by feature code 2, new data points can be inserted around it. Assuming an inserted feature code identical to 2, a new feature code sequence (1, 0, 0, 2, 2, 0, 1, 0, 0) is obtained, which can also be used as a similar object - associated sensing data sample.
[0202] 4. Retain the farmland irrigation activities in the reference object - associated sensing data sample and perform data clipping on the reference object - associated sensing data sample.
[0203] Data clipping refers to adjusting the length of the feature code sequence on the basis of retaining the farmland irrigation activities. For example, for the reference object - associated sensing data sample (1, 0, 0, 2, 0, 0, 1, 0, 0), it can be clipped from both ends of the sequence. Assuming deleting one data point at the beginning and the end, a new feature code sequence (0, 0, 2, 0, 0, 1, 0) is obtained. This new sequence still retains the farmland irrigation activities in the original sequence and the temporal relationship remains unchanged, so it can be used as a similar object - associated sensing data sample.
[0204] In another implementation solution, in step S133a, obtain a learning sample set for training the edge algorithm for extracting activity temporal relationships, including:
[0205] Step S133a': Obtain the selected reference object - associated sensing data sample.
[0206] This step can refer to step S133a1 and will not be elaborated here.
[0207] Step S133a'': Change one or all of the farmland irrigation activities and the farmland irrigation activity timings in the reference object - associated sensing data sample to obtain the heterogeneous object - associated sensing data sample corresponding to the reference object - associated sensing data sample.
[0208] After obtaining the reference object IoT sensing data sample, the irrigation wireless decoder gateway generates corresponding heterogeneous IoT sensing data samples by changing one or all of the farmland irrigation activities and the timing of farmland irrigation activities therein. The heterogeneous IoT sensing data samples are significantly different from the reference object IoT sensing data samples in terms of the characteristics or timing of farmland irrigation activities, and are used to train the edge algorithm for extracting activity timing relationships, enabling it to better learn and distinguish different irrigation activity patterns.
[0209] For example, by changing one or all of the farmland irrigation activities and the timing of farmland irrigation activities in the reference object IoT sensing data sample, heterogeneous IoT sensing data samples corresponding to the reference object IoT sensing data sample are obtained, including one or more of the following augmentation strategies:
[0210] 1. Move local farmland irrigation activities in the reference object IoT sensing data sample.
[0211] This strategy means moving a certain or certain farmland irrigation activities in the reference object IoT sensing data sample in the time series, changing their occurrence time positions, so as to generate heterogeneous IoT sensing data samples. For example, for the previously selected reference object IoT sensing data sample (1, 0, 2, 0, 1, 0, 3, 0, 1), move the farmland irrigation activity represented by the feature code 2 from the original third time point to the sixth time point, and obtain a new feature code sequence (1, 0, 0, 0, 1, 2, 3, 0, 1). Compared with the original reference object IoT sensing data sample, the timing of the farmland irrigation activities in this new sequence has changed, so it can be used as a heterogeneous IoT sensing data sample.
[0212] For example, the irrigation wireless decoder gateway can achieve the movement of local farmland irrigation activities by modifying the index of specific elements in the feature code sequence. For example, in a programming language, array operations can be used to adjust the element positions.
[0213] 2. Replace no less than one farmland irrigation activity in the reference object IoT sensing data sample with different activity contents.
[0214] This strategy means replacing one or more farmland irrigation activities in the reference object IoT sensing data sample with other different types of irrigation activities, so as to generate heterogeneous IoT sensing data samples. For example, for the reference object IoT sensing data sample (1, 0, 2, 0, 1, 0, 3, 0, 1), replace the farmland irrigation activity represented by the feature code 2 with another type of irrigation activity, assuming it is represented by the feature code 4, and obtain a new feature code sequence (1, 0, 4, 0, 1, 0, 3, 0, 1). This new sequence is different from the original reference object IoT sensing data sample in terms of the content of the farmland irrigation activities, so it can be used as a heterogeneous IoT sensing data sample.
[0215] 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.
[0216] 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.
[0217] 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.
[0218] 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.
[0219] 4. Swap the time series distribution of multiple farm irrigation activities in the reference IoT sensor data sample.
[0220] 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.
[0221] 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.
[0222] 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.
[0223] 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:
[0224] 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;
[0225] 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.
[0226] 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.
[0227] 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 predetermined mode example sensing data 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 satisfy the commonality condition.
[0228] For example, the implicit representation sequence of the farmland irrigation activity time series of the farmland IoT sensing data is X = (1, 3, 5, 7, 9), and the implicit representation sequence of the farmland irrigation activity time series corresponding to the predetermined mode example sensing data is Y = (1, 2, 4, 6, 8). The distance value D calculated by the DTW algorithm is small (assuming less than the set threshold), indicating that the commonality condition is satisfied in terms of 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 satisfy the commonality condition, the irrigation wireless decoder gateway can determine that the farmland IoT sensing data and the predetermined mode example sensing data correspond to the same irrigation demand. For example, if the irrigation demand corresponding to the predetermined mode example sensing data is to perform quantitative irrigation on a certain area of the farmland within a specific time period, then according to the judgment result, the target farmland area corresponding to the farmland IoT sensing data also has the same irrigation demand.
[0229] In step S142, if the implicit representation of the irrigation activity does not satisfy the commonality condition with the implicit representation of the irrigation activity corresponding to the predetermined mode example sensing data, or the implicit representation of the farmland irrigation activity time series does not satisfy the commonality condition with the implicit representation of the farmland irrigation activity time series corresponding to the predetermined mode example sensing data, the irrigation wireless decoder gateway determines that the farmland IoT sensing data and the predetermined mode example sensing data correspond to different irrigation demands.
[0230] When the implicit representation of the irrigation activity does not satisfy the commonality condition, 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 satisfied.
[0231] When the implicit representation of the farmland irrigation activity time series does not satisfy the commonality condition, such as when the distance value D calculated by the DTW algorithm is greater than the set threshold, it indicates that the similarity degree of the two time series implicit representation sequences is low. For example, the implicit representation sequence of the farmland irrigation activity time series of the farmland IoT sensing data is X = (1, 3, 5, 7, 9), and the implicit representation sequence of the farmland irrigation activity time series corresponding to the predetermined mode example sensing data is Y = (9, 7, 5, 3, 1). The distance value D calculated by the DTW algorithm is large (assuming greater than the set threshold), indicating that the distribution of the farmland irrigation activity time series between the two is quite different.
[0232] At this time, the irrigation wireless decoder gateway determines that the farmland IoT sensing data and the sensing data of the predetermined pattern example correspond to different irrigation requirements. For example, if the irrigation requirement corresponding to the sensing data of the predetermined pattern example is to irrigate the farmland in the morning, while the timing of the irrigation activities corresponding to the farmland IoT sensing data implicitly indicates that the irrigation time is mainly concentrated in the afternoon, then it is considered that the irrigation requirements of the two are different.
[0233] In one implementation, the method provided by the embodiments of the present invention may further include:
[0234] Step S160: If it is recognized that the sensing data of the pattern example needs to be added to the irrigation pattern list, then detect each farmland irrigation activity in the sensing data of the pattern example to obtain the farmland irrigation activity detection data corresponding to the sensing data of the pattern example;
[0235] Step S170: Based on the farmland irrigation activity detection data corresponding to the sensing data of the pattern example, construct an implicit representation of each farmland irrigation activity in the sensing data of the pattern example to obtain the implicit representation of the irrigation activity corresponding to the sensing data of the pattern example;
[0236] Step S180: Based on the implicit representation of the irrigation activity corresponding to each farmland irrigation activity in the sensing data of the pattern example, mine the timing distribution between each farmland irrigation activity in the sensing data of the pattern example to obtain the implicit representation of the timing of the farmland irrigation activity corresponding to the sensing data of the pattern example;
[0237] Step S190: Associate and record the sensing data of the pattern example, the implicit representation of the irrigation activity corresponding to the sensing data of the pattern example, and the implicit representation of the timing of the farmland irrigation activity in the irrigation pattern list.
[0238] In step S160, when the irrigation wireless decoder gateway recognizes that the pattern example sensing data needs to be added to the irrigation pattern list, it will detect each farmland irrigation activity in the pattern example sensing data, so as to obtain the farmland irrigation activity detection data corresponding to the pattern example sensing data. For example, the pattern example sensing 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 the irrigation duration and irrigation water volume at different positions. The irrigation wireless decoder gateway can detect the farmland irrigation activity by analyzing the characteristic information in these data. The specific implementation methods can include data filtering, feature extraction, etc. For example, by filtering the data to remove noise and interference information, and then extracting the features related to the irrigation activity, such as the water volume change within a specific period of time and the signal strength change of the sensor nodes, to determine the occurrence of the farmland irrigation activity. Suppose the water volume data recorded by a certain sensor node in the pattern example sensing data shows an obvious upward trend within a period of time, and at the same time there are corresponding signal changes in other relevant sensor nodes, then the irrigation wireless decoder gateway can judge that an irrigation activity has occurred in this area during this period, and integrate this information into the farmland irrigation activity detection data.
[0239] In step S170, the irrigation wireless decoder gateway constructs an implicit representation of the irrigation activity for each farmland irrigation activity in the pattern example sensing data based on the farmland irrigation activity detection data corresponding to the pattern example sensing data, and obtains the implicit representation of the irrigation activity corresponding to the pattern example sensing data. The implicit representation of the irrigation activity is an abstract representation of the characteristics of the farmland irrigation activity, which can more concisely express the essential characteristics of the irrigation activity. The implementation method of constructing the implicit representation of the irrigation activity can adopt the method of feature coding. For example, for each irrigation activity in the farmland irrigation activity detection data, its key features, such as irrigation location, duration, water volume, etc., can be extracted, and then these features are encoded to form a feature vector as the implicit representation of the irrigation activity. In this way, the irrigation wireless decoder gateway can transform each farmland irrigation activity in the pattern example sensing data into the corresponding implicit representation of the irrigation activity.
[0240] In step S180, the irrigation wireless decoder gateway mines the temporal distribution among various farmland irrigation activities in the pattern example sensing data based on the implicit representation of the irrigation activities corresponding to each farmland irrigation activity in the pattern example sensing data, and obtains the implicit representation of the temporal sequence of farmland irrigation activities corresponding to the pattern example sensing data. The implementation method of mining the temporal distribution can draw on the methods of constructing the feature code sequence and mining the implicit representation from the feature code sequence mentioned above. Specifically, first, based on the temporal distribution of each farmland irrigation activity in the pattern example sensing data and their feature codes (the feature codes here can be determined according to the method introduced before, by the similarity with the cluster representative points), construct the feature code sequence corresponding to the pattern example sensing data. Then, input this feature code sequence into the activity temporal relationship extraction edge algorithm, which includes multiple temporal filters connected in sequence. By inputting the feature code sequence into the first temporal filter, and then integrating the outputs of multiple temporal filters after downsampling processing respectively, the implicit representation of the temporal sequence of farmland irrigation activities is finally obtained.
[0241] Finally, there is step S190. The irrigation wireless decoder gateway associates and records the pattern example sensing data, the implicit representation of the irrigation activities corresponding to the pattern example sensing data, and the implicit representation of the temporal sequence of farmland irrigation activities in the irrigation pattern list. This kind of association record can be realized by establishing a database table. For example, create an irrigation pattern list table in the database, and the table contains three fields: the pattern example sensing data field, the implicit representation of the irrigation activities field, and the implicit representation of the temporal sequence of farmland irrigation activities field. When new pattern example sensing data and its corresponding implicit representation need to be added to the irrigation pattern list, the irrigation wireless decoder gateway stores these data into the corresponding fields respectively, thus completing the association record. In this way, when subsequent pattern matching for the farmland IoT sensing data is required, the irrigation wireless decoder gateway can retrieve the relevant pattern example sensing data and its implicit representation from the irrigation pattern list to accurately identify the irrigation requirements.
[0242] Through the processing of steps S160 to S190, the irrigation wireless decoder gateway can continuously enrich the irrigation pattern list, making it contain more pattern example sensing data and their corresponding implicit representations. This not only helps to improve the accuracy and reliability of irrigation requirement identification, but also provides richer data support for the irrigation scheduling and decision-making of smart agriculture, further promoting the development of smart agriculture. For example, with the continuous improvement of the irrigation pattern list, the irrigation wireless decoder gateway can more accurately identify the irrigation requirements of different farmland areas at different time periods, so as to achieve more scientific and reasonable irrigation management, improve the utilization efficiency of water resources, and promote the growth of crops and the increase of yields.
[0243] Please refer to Figure 3, which is a schematic structural diagram of an irrigation wireless decoder gateway provided by an embodiment of the present invention. As Figure 3 shown, the above-mentioned irrigation wireless decoder gateway 10 may include: a processor 1001, a network interface 1004, and a memory 1005. Computer-readable code is stored in the memory. When the computer-readable code is run by the processor, the processor executes the gateway data processing method based on the edge algorithm provided by the present invention.
[0244] In addition, the above-mentioned irrigation wireless decoder gateway 10 may further 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) and a keyboard (Keyboard). Optionally, the user interface 1003 may further 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 a non-volatile memory, such as at least one disk memory. Optionally, the memory 1005 may further be at least one storage device far from the aforementioned processor 1001. As Figure 3 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.
[0245] In Figure 3 the shown irrigation wireless decoder gateway 10, the network interface 1004 can provide network communication functions; while 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 program stored in the memory 1005 to implement the method provided in the above embodiments.
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; Based on the implicit representation of the irrigation activities of each farmland irrigation activity, the time series distribution between each farmland irrigation activity in the farmland IoT sensor data is mined to obtain the implicit representation of the farmland irrigation activity time series; specifically including: 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; based on the time series distribution of each farmland irrigation activity in the farmland IoT sensor data and the characteristic code of each farmland irrigation activity, the characteristic code sequence corresponding to the farmland IoT sensor data is constructed; and the implicit representation of the farmland irrigation activity time series is mined from the characteristic code sequence; 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: 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.
3. The gateway data processing method based on edge algorithm according to claim 2 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.
4. The gateway data processing method based on edge algorithm according to claim 1 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.
5. The gateway data processing method based on edge algorithm according to claim 4 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.
6. The gateway data processing method based on edge algorithm according to claim 4 is 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.
7. The gateway data processing method based on edge algorithm according to any one of claims 1 to 6, 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.
8. The gateway data processing method based on edge algorithm according to any one of claims 1 to 6, 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.
9. 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 8.
Citation Information
Patent Citations
Gateway edge calculation method and device based on singular value detection
CN112261610A
Edge computing gateway data processing method and gateway
CN118736847A