Motor-pumped well pump state recognition model training method and agricultural irrigation electric quantity calculation method
Through the combined wavelet transformation and CUSUM algorithm combined with the SVM classifier method, the problems of well pump status recognition and agricultural irrigation power calculation are solved, more accurate identification and calculation are achieved, and the efficiency and accuracy of agricultural irrigation management are improved.
Patent Information
- Application Number
- CN202510098639.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-22
- Publication Date
- 2025-06-06
AI Technical Summary
The prior art is difficult to accurately identify the state of the well pump and calculate the agricultural irrigation power, especially when a single table measures agricultural irrigation and production electricity consumption, which makes it difficult to classify and identify electricity.
By obtaining the historical power data of agricultural irrigation users, wavelet transformation is performed to extract the approximate coefficients and detailed coefficient features, combining with the CUSUM algorithm for data abnormality detection, building a data set and training an SVM classifier to obtain a well pump state recognition model.
It realizes more accurately identifying the status of the well pump, thereby accurately calculating agricultural irrigation power, and improving water resource utilization efficiency and resource allocation optimization capabilities.
Smart Images

Figure CN120105210A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of agricultural irrigation data processing, and in particular to a method for training a pump well state recognition model and a method for calculating agricultural irrigation electricity. Background Art
[0002] In the agricultural irrigation management system, accurate measurement and differentiation of agricultural irrigation electricity and other electricity are of great significance for optimizing resource allocation, improving water resource utilization efficiency, and achieving energy conservation and emission reduction goals. However, due to historical reasons or economic conditions, it is common to use a single meter to measure agricultural irrigation and production electricity at the same time, which greatly increases the difficulty of electricity classification and identification.
[0003] At present, the methods for dealing with the problem of measuring agricultural irrigation and production electricity with a single meter mainly include simple division based on time periods, pattern recognition based on load characteristics, and anomaly detection based on statistics. However, the simple division method is too rough and cannot meet the needs of accurate measurement. Although the pattern recognition method is flexible, it relies on a large amount of data and complex feature engineering. The anomaly detection method performs poorly in complex electricity usage scenarios and is difficult to accurately distinguish electricity for different purposes. Therefore, a more accurate, robust and adaptable method is needed to solve this problem. Summary of the invention
[0004] The embodiments of the present invention provide a method for training a pump well pump state recognition model and a method for calculating agricultural irrigation power, so as to solve the problem of accurately identifying the state of a pump well pump and calculating agricultural irrigation power.
[0005] In a first aspect, an embodiment of the present invention provides a method for training a pump state recognition model, comprising:
[0006] Obtaining historical electricity data of agricultural irrigation users; wherein the historical electricity data is electricity data at set intervals;
[0007] The historical electricity data is subjected to wavelet transformation, and feature extraction is performed according to the result of the wavelet transformation; wherein the feature includes an approximate coefficient and a detail coefficient;
[0008] Performing data anomaly detection on the historical power data according to the CUSUM algorithm to obtain a data anomaly detection result; wherein the data anomaly detection result includes a data anomaly point indicating the possibility of a state change of the pump-well pump;
[0009] A data set is constructed according to the approximate coefficient, the detail coefficient, the data anomaly detection result and the state data of the machine-well pump, and an SVM classifier is trained according to the data set to obtain a machine-well pump state recognition model; wherein the machine-well pump state recognition model takes the approximate coefficient, the detail coefficient and the anomaly detection result as input, and takes the state of the machine-well pump at each set time as output, and the state of the machine-well pump includes opening and closing.
[0010] In a possible implementation, constructing a data set according to the approximation coefficient, the detail coefficient, the data anomaly detection result, and the state data of the pump-well pump includes:
[0011] The data set is classified according to different data anomaly detection results, and sub-data sets corresponding to different abnormal data are constructed.
[0012] In a possible implementation, performing data anomaly detection on the historical power data according to the CUSUM algorithm includes:
[0013] Get the CUSUM statistics of the previous data point, the historical power data of the current data point, and the reference threshold;
[0014] Calculate the CUSUM statistic of the current data point based on the CUSUM statistic of the previous data point, the historical power data of the current data point, and the reference threshold;
[0015] When the CUSUM statistic of the current data point is greater than the data anomaly threshold, the data point is determined as a data anomaly point.
[0016] In a possible implementation, the historical electric quantity data includes one or more of current, voltage and power.
[0017] In a possible implementation, before obtaining the historical electricity consumption data of agricultural irrigation users, the following steps are also included:
[0018] Obtain initial electricity consumption data of agricultural irrigation users;
[0019] removing noise from the initial electrical quantity data;
[0020] The missing values and abnormal values of the initial electric quantity data are processed to obtain the historical electric quantity data.
[0021] In a possible implementation, removing noise from the initial power data includes:
[0022] Create a sliding window and determine the window width;
[0023] For each position in the window, calculating the average value of all data in the window;
[0024] Overwriting the initial power data of the location with the average value;
[0025] Move the window forward by one data point, repeatedly calculate the average value of all data, and cover the entire data sequence;
[0026] Output all average values to obtain the initial power data after removing noise.
[0027] In a possible implementation, processing missing values and abnormal values of the initial power data includes:
[0028] Calculating an abnormal threshold value according to the initial power data;
[0029] Determine an abnormal value in the initial power data according to the abnormal threshold;
[0030] Missing values were filled and outliers were replaced based on linear interpolation.
[0031] In a possible implementation, calculating the abnormal threshold according to the initial power data includes:
[0032] Calculate the average value and standard deviation of the initial electric quantity data;
[0033] The abnormal threshold is calculated according to the mean value and the standard deviation.
[0034] In a second aspect, an embodiment of the present invention provides a method for calculating agricultural irrigation electricity, which is based on the pump state recognition model obtained by the pump state recognition model training method described above and is used for calculation, including:
[0035] Acquire the electricity data of agricultural irrigation users; wherein the electricity data is the electricity data at set intervals;
[0036] The electric quantity data is subjected to wavelet transformation, and feature extraction is performed according to the result of the wavelet transformation; wherein the feature includes an approximate coefficient and a detail coefficient;
[0037] Performing data anomaly detection on the electric quantity data according to the CUSUM algorithm to obtain a data anomaly detection result; wherein the data anomaly detection result includes a data anomaly point indicating the possibility of a state change of the pump-well pump;
[0038] Input the approximate coefficient, the detail coefficient, and the data anomaly detection result into the pump state recognition model, and output the state of the pump at each set time; wherein the state of the pump includes on and off;
[0039] The agricultural irrigation power is calculated according to the state of the pump.
[0040] In a possible implementation, calculating the agricultural irrigation electricity according to the state of the pump-well pump includes:
[0041] Determine the time period for starting the pump according to the state of the pump at each set time;
[0042] The agricultural irrigation power is calculated according to the time period when the pump is turned on.
[0043] The embodiment of the present invention provides a method for training a pump state recognition model and a method for calculating agricultural irrigation electricity. The method performs wavelet transform on historical electricity data and extracts approximate coefficients and detail coefficient features based on the results of the wavelet transform, wherein the approximate coefficients represent the low-frequency components or trends of the signal and the detail coefficients represent the high-frequency components or details of the signal. The data can be decomposed into sub-bands of different scales to capture subtle changes in the signal, making the algorithm more flexible and accurate in processing complex and changeable electricity consumption data. Multi-scale analysis is performed through wavelet transform to effectively extract key features in the signal and reduce dependence on the dimensions of the original data. According to the CUSUM algorithm, data anomaly detection is performed on historical electricity data. The data anomaly detection results include data anomaly points indicating the possibility of a change in the state of the pump. The data anomaly points provide important information about changes in electricity data. Changes in electricity data can reflect changes in the state of the pump, which helps to improve the accuracy of the model in classifying the state of the pump. A data set is constructed according to the approximation coefficient, detail coefficient, data anomaly detection results and the status data of the machine-well pump. The SVM classifier is trained according to the data set to obtain the machine-well pump status recognition model. The SVM classifier improves the model's prediction ability for unseen data by maximizing the classification interval. Its strong generalization ability ensures consistency in performance on different data sets and reduces the occurrence of false positives and negatives, so that the machine-well pump status recognition model can more accurately identify the status of the machine-well pump, thereby accurately calculating the agricultural irrigation electricity. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0045] Figure 1 It is a flow chart of the implementation of the pump well state recognition model training method provided by the embodiment of the present invention;
[0046] Figure 2 is a schematic diagram of a method for identifying outliers provided by an embodiment of the present invention;
[0047] Figure 3is a flow chart of the implementation of the agricultural irrigation electricity calculation method provided by an embodiment of the present invention;
[0048] Figure 4 It is a structural schematic diagram of a pump well state recognition model training device provided by an embodiment of the present invention;
[0049] Figure 5 It is a structural schematic diagram of an agricultural irrigation electricity calculation device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0050] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.
[0051] In order to make the purpose, technical solutions and advantages of the present invention more clear, specific embodiments will be described below in conjunction with the accompanying drawings.
[0052] Figure 1 The implementation flow chart of the pump well state recognition model training method provided by the embodiment of the present invention is detailed as follows:
[0053] Step 101, obtaining historical electricity data of agricultural irrigation users; wherein the historical electricity data is electricity data at set intervals.
[0054] The historical electricity data of agricultural irrigation users is 96 points of current, voltage, power and other data per day, providing basic data support for a variety of analyses and decisions.
[0055] Step 102, performing wavelet transform on the historical electricity data, and extracting features according to the result of the wavelet transform; wherein the features include approximate coefficients and detail coefficients.
[0056] Wavelet transform can decompose data into approximate coefficients and detail coefficients at different scales, which can be used as features to describe the time series characteristics and changing trends of data. Approximate coefficients and detail coefficients can reveal the behavior of data at different time scales, which is very useful for analyzing the time series characteristics of agricultural irrigation. Detail coefficients can capture rapid changes and anomalies in data, which is very important for detecting abnormal conditions that may occur during irrigation (such as equipment failure, water leakage, etc.). By analyzing approximate coefficients and detail coefficients, irrigation electricity consumption patterns can be identified, such as irrigation cycles, irrigation intensity, etc. Wavelet transform can also be used to remove noise from data and improve data quality, which is crucial for accurately analyzing and predicting irrigation electricity consumption. The extracted features can be used as part of an intelligent decision support system to help agricultural managers make more scientific irrigation decisions.
[0057] Specifically, wavelet transform is used to perform multi-layer decomposition on the power data to extract the features of different frequency bands. Wavelet transform is:
[0058]
[0059] Where x(t) is the original signal, is the mother wavelet function, a is the scale parameter (control frequency), and b is the translation parameter (control time position).
[0060] The approximation coefficient represents the low-frequency component or trend of the signal. The formula is:
[0061]
[0062] Where x[t] is the original signal and h[t] is the filter coefficient used to calculate the approximate coefficient.
[0063] The detail coefficient represents the high-frequency components or details of the signal. The formula is:
[0064]
[0065] Where g[t] is the filter coefficient used to calculate the detail coefficient.
[0066] Each time point corresponds to the calculation results of the approximate coefficient and the detail coefficient.
[0067] Step 103, performing data anomaly detection on the historical electricity data according to the CUSUM algorithm to obtain a data anomaly detection result; wherein the data anomaly detection result includes a data anomaly point indicating the possibility of a state change of the pump well.
[0068] The CUSUM algorithm detects anomalies in the data by calculating the difference between historical power data and expected values and accumulating these differences. When the cumulative sum exceeds the preset threshold, it indicates that the data is abnormal.
[0069] Data anomaly detection results include abnormal points that may indicate that the state of the well pump has changed. For example, if the electricity consumption of an agricultural irrigation user suddenly increases or decreases, this may mean that the operating state of the pump has changed, such as turning on or off.
[0070] The historical electricity data is analyzed by the CUSUM algorithm to identify possible changes in the state of the pump (such as opening or closing), thereby improving the accuracy of the pump state identification model.
[0071] Step 104, construct a data set based on the approximate coefficient, the detail coefficient, the data anomaly detection result and the state data of the machine-well pump, train the SVM classifier based on the data set, and obtain a machine-well pump state recognition model; wherein the machine-well pump state recognition model takes the approximate coefficient, the detail coefficient, and the anomaly detection result as input, and takes the state of the machine-well pump at each set time as output, and the state of the machine-well pump includes on and off.
[0072] By integrating the approximate coefficient, detail coefficient, data anomaly detection results and pump status data, a comprehensive dataset is constructed. This dataset contains multi-dimensional information about the pump status, providing rich features for subsequent machine learning model training.
[0073] The approximation coefficient and detail coefficient provide multi-scale features of the time series data, and the anomaly detection results provide indications of abnormal states. These features are very useful for identifying the state (on or off) of the pump.
[0074] The constructed dataset is used to train the SVM classifier so that the model can learn how to predict the status of the well pump based on the input features.
[0075] The trained pump state recognition model can detect the state (on or off) of the pump at each set time point by taking the approximate coefficient, detail coefficient and abnormal detection result as input.
[0076] The time period when the well pump is turned on is calculated based on the status of the well pump at each time point, thereby calculating the agricultural irrigation power consumption, which helps to accurately calculate the agricultural irrigation power consumption.
[0077] The decision function of the SVM classifier is:
[0078]
[0079] In the formula, α i is the Lagrange multiplier, y i is the label of the support vector (i.e. the state of the pump: on or off), K(x i ,x) is the kernel function and b is the bias term.
[0080] The embodiment of the present invention performs wavelet transform on the historical electricity data, and extracts the approximate coefficient and detail coefficient features according to the result of the wavelet transform, wherein the approximate coefficient represents the low-frequency component or trend of the signal, and the detail coefficient represents the high-frequency component or detail of the signal, and can decompose the data into sub-bands of different scales, and capture the subtle changes in the signal, so that the algorithm is more flexible and accurate in processing complex and changeable electricity consumption data. Multi-scale analysis through wavelet transform can effectively extract key features in the signal and reduce dependence on the original data dimension. According to the CUSUM algorithm, data anomaly detection is performed on the historical electricity data, and the data anomaly detection result includes data anomaly points indicating the possibility of state change of the machine well pump. The data anomaly points provide important information about the change of electricity data. The change of electricity data can reflect the change of the state of the machine well pump, which helps to improve the accuracy of the model in classifying the state of the machine well pump. A data set is constructed according to the approximation coefficient, detail coefficient, data anomaly detection results and the status data of the machine-well pump. The SVM classifier is trained according to the data set to obtain the machine-well pump status recognition model. The SVM classifier improves the model's prediction ability for unseen data by maximizing the classification interval. Its strong generalization ability ensures consistency in performance on different data sets and reduces the occurrence of false positives and negatives, so that the machine-well pump status recognition model can more accurately identify the status of the machine-well pump, thereby accurately calculating the agricultural irrigation electricity.
[0081] In a possible implementation, a data set is constructed according to the approximation coefficient, the detail coefficient, the data anomaly detection result, and the state data of the pump-well pump, including:
[0082] The data set is classified according to different data anomaly detection results, and sub-data sets corresponding to different abnormal data are constructed.
[0083] In this embodiment, the data set is classified according to different data anomaly detection results to identify normal and abnormal data points. This helps to distinguish normal operation from potential failures or abnormal states in subsequent analysis and model training.
[0084] Constructing sub-datasets is a part of feature engineering that allows the model to focus on specific anomaly types, potentially improving the model's accuracy in identifying specific anomaly types.
[0085] By constructing different sub-datasets, different machine learning models can be trained and validated to identify and predict different states of well pumps, including normal states and various abnormal states.
[0086] Classifying anomalous data can help the model learn how to make accurate predictions in the face of abnormal situations, thereby improving the robustness of the model in real-world applications.
[0087] In a possible implementation, performing data anomaly detection on historical power data according to the CUSUM algorithm includes:
[0088] Get the CUSUM statistics of the previous data point, the historical power data of the current data point, and the reference threshold;
[0089] Calculate the CUSUM statistic of the current data point based on the CUSUM statistic of the previous data point, the historical power data of the current data point, and the reference threshold;
[0090] When the CUSUM statistic of the current data point is greater than the data anomaly threshold, the data point is determined as a data anomaly point.
[0091] Define the CUSUM statistic as:
[0092] S n =max(0,S n-1 +(x n -k))
[0093] In the formula, x n is the current power data value, S n is the CUSUM statistic at the nth time point, S n-1 is the CUSUM statistic at the n-1th time point, and k is the reference threshold, which is determined comprehensively based on historical data, on-site survey conditions, and business logic.
[0094] In this embodiment, the abnormal change points detected by the CUSUM algorithm for power data anomaly can be input into the SVM classifier as additional features. These features provide important information about data changes and help improve the accuracy of the model in classifying the pump status.
[0095] In a possible implementation manner, the historical electric quantity data includes one or more of current, voltage and power.
[0096] In this embodiment, the historical electricity data corresponding to the abnormal data point is power. It provides necessary data support for the monitoring, analysis, management and optimization of the power system and is the basis for the operation and maintenance of the power system.
[0097] In a possible implementation manner, before obtaining the historical electricity consumption data of agricultural irrigation users, the method further includes:
[0098] Obtain initial electricity consumption data of agricultural irrigation users;
[0099] Remove noise from the initial power data;
[0100] The missing values and outliers of the initial electricity data are processed to obtain historical electricity data.
[0101] In a possible implementation, removing noise from the initial power data includes:
[0102] Create a sliding window and determine the window width;
[0103] For each position in the window, calculate the average of all the data in the window;
[0104] Overwrite the initial power data of the location with the average value;
[0105] Move the window forward by one data point, repeatedly calculate the average of all data, and cover the entire data series;
[0106] Output all average values to obtain the initial power data after removing noise.
[0107] In this embodiment, the quality and availability of data are improved by removing noise, laying a good foundation for subsequent data analysis and modeling.
[0108] Specifically, the smoothed power value is:
[0109]
[0110] In the formula, is the smoothed power value at time point t, and w is the window width.
[0111] In a possible implementation, processing missing values and abnormal values of initial power data includes:
[0112] Calculate the abnormal threshold value based on the initial power data;
[0113] Determine an abnormal value in the initial power data according to an abnormal threshold;
[0114] Missing values were filled and outliers were replaced based on linear interpolation.
[0115] In a possible implementation, calculating the abnormal threshold value according to the initial power data includes:
[0116] Calculate the mean and standard deviation of the initial electricity data;
[0117] Calculate anomaly threshold based on mean and standard deviation.
[0118] In this embodiment, if Figure 2 , based on the 3sigma criterion, outliers are identified, the mean μ and standard deviation σ of the data are calculated, and values outside the range of μ±3σ are considered outliers and processed. The formula is:
[0119] |X i -μ|>3σ
[0120] Where, X i is a single data point, μ is the mean, and σ is the standard deviation.
[0121] The values in the data that are beyond the range of the mean plus or minus three standard deviations (i.e., μ±3σ) are considered abnormal values. This method is based on the characteristics of the normal distribution. In the normal distribution, the probability of a data point falling within one, two, and three standard deviations from the mean is 68.27%, 95.45%, and 99.73%, respectively. Therefore, the proportion of values beyond three standard deviations is extremely small and can be regarded as abnormal values. Among them, the standard deviation is a key indicator for measuring the degree of dispersion of data, reflecting the degree of deviation of data points from the mean. The larger the standard deviation, the more dispersed the data distribution; the smaller the standard deviation, the more concentrated the data.
[0122] Use linear interpolation to fill missing values and outliers. The formula is:
[0123]
[0124] Where P n is the missing point agricultural irrigation well load, P a , P b is the known agricultural irrigation well load before and after the missing point, ΔP=|na|(P n To P a point difference), ΔP 1 =|ba|(P b To P a point difference).
[0125] Through this method, missing values and outliers in the data set can be filled, making the data set more complete and convenient for subsequent analysis and processing.
[0126] Figure 3 The implementation flow chart of the agricultural irrigation electricity calculation method provided by the embodiment of the present invention is detailed as follows:
[0127] In step 301, the electricity consumption data of agricultural irrigation users is obtained; wherein the electricity consumption data is electricity consumption data at set time intervals.
[0128] The electricity consumption data of agricultural irrigation users is the current, voltage, power and other data at 96 points per day, which provides basic data support for various analyses and decisions.
[0129] In step 302, the electric quantity data is subjected to wavelet transformation, and feature extraction is performed based on the result of the wavelet transformation; wherein the feature includes an approximate coefficient and a detail coefficient.
[0130] Wavelet transform can decompose data into approximate coefficients and detail coefficients at different scales, which can be used as features to describe the time series characteristics and changing trends of data. Approximate coefficients and detail coefficients can reveal the behavior of data at different time scales, which is very useful for analyzing the time series characteristics of agricultural irrigation. Detail coefficients can capture rapid changes and anomalies in data, which is very important for detecting abnormal conditions that may occur during irrigation (such as equipment failure, water leakage, etc.). By analyzing approximate coefficients and detail coefficients, irrigation electricity consumption patterns can be identified, such as irrigation cycles, irrigation intensity, etc. Wavelet transform can also be used to remove noise from data and improve data quality, which is crucial for accurately analyzing and predicting irrigation electricity consumption. The extracted features can be used as part of an intelligent decision support system to help agricultural managers make more scientific irrigation decisions.
[0131] In step 303, data anomaly detection is performed on the electric quantity data according to the CUSUM algorithm to obtain a data anomaly detection result; wherein the data anomaly detection result includes a data anomaly point indicating the possibility of a state change of the pump-well pump.
[0132] The CUSUM algorithm detects anomalies in the data by calculating the difference between the power data and the expected value and accumulating these differences. When the cumulative sum exceeds the preset threshold, it indicates that the data is abnormal.
[0133] Data anomaly detection results include abnormal points that may indicate that the state of the well pump has changed. For example, if the electricity consumption of an agricultural irrigation user suddenly increases or decreases, this may mean that the operating state of the pump has changed, such as turning on or off.
[0134] The historical electricity data is analyzed by the CUSUM algorithm to identify possible changes in the state of the pump (such as opening or closing), thereby improving the accuracy of the pump state identification model.
[0135] In step 304, the approximate coefficient, the detail coefficient, and the data anomaly detection result are input into the pump state recognition model, and the state of the pump at each set time is output; wherein the state of the pump includes on and off.
[0136] By integrating the approximate coefficient, detail coefficient, data anomaly detection results and pump status data, a comprehensive dataset is constructed. This dataset contains multi-dimensional information about the pump status, providing rich features for subsequent machine learning model training.
[0137] The approximation coefficient and detail coefficient provide multi-scale features of the time series data, and the anomaly detection results provide indications of abnormal states. These features are very useful for identifying the state (on or off) of the pump.
[0138] The constructed dataset is used to train the SVM classifier so that the model can learn how to predict the status of the well pump based on the input features.
[0139] The trained pump state recognition model can detect the state (on or off) of the pump at each set time point by taking the approximate coefficient, detail coefficient and abnormal detection result as input.
[0140] The time period when the well pump is turned on is calculated based on the status of the well pump at each time point, thereby calculating the agricultural irrigation power consumption, which helps to accurately calculate the agricultural irrigation power consumption.
[0141] In step 305, the agricultural irrigation electricity is calculated according to the state of the pump well.
[0142] In a possible implementation, calculating the agricultural irrigation electricity according to the state of the pump well includes:
[0143] Determine the time period for the pump to be turned on according to the state of the pump at each set time;
[0144] Calculate the agricultural irrigation electricity based on the time period when the well pump is turned on.
[0145] If the status of the pump is identified as "on", the power consumption during this time period is accumulated:
[0146]
[0147] Where, T on is the time set when the pump is turned on, P t It is the power of the well pump.
[0148] In a possible implementation, evaluating the accuracy of the pump state recognition model includes:
[0149] Acquire mixed power data; wherein the mixed power data includes power data of non-agricultural irrigation users and agricultural irrigation users in the same area;
[0150] Calculate agricultural irrigation electricity based on mixed electricity data and pump state identification model;
[0151] Obtain the actual agricultural irrigation electricity consumption of agricultural irrigation users in the mixed electricity data;
[0152] The accuracy is calculated based on the agricultural irrigation power consumption and the actual agricultural irrigation power consumption.
[0153] The daily 96-point power and daily 96-point electric energy indications of non-agricultural irrigation users (including residential electricity consumption, pure breeding electricity consumption, ordinary industrial electricity consumption, etc.) and agricultural irrigation users in the same area are superimposed to form mixed electricity data.
[0154] After the model has been running for a period of time, the accuracy of the machine-well pump status identification model is evaluated, and the model is adjusted according to the accuracy to facilitate accurate identification of the machine-well pump status, thereby accurately calculating agricultural irrigation electricity.
[0155] The present invention firstly integrates the CUSUM algorithm optimized by wavelet transform and SVM, and can more accurately identify the time periods of irrigation electricity and production electricity, thus overcoming the problem of low precision of traditional methods; secondly, it enhances robustness, and the combination of the multi-scale analysis capability of wavelet transform and the strong generalization capability of SVM makes the present invention more robust and reliable when processing complex and changeable electricity consumption data, thus reducing the occurrence of false positives and false negatives; thirdly, it reduces data dependence, and although a certain amount of labeled data is still required for model training, the present invention reduces the dependence on a large amount of labeled data by optimizing the algorithm structure and parameter settings, thereby improving the practicality and operability of the algorithm; fourthly, it improves management efficiency, and accurate classification and identification of electricity provides strong support for agricultural irrigation management, making irrigation scheduling more scientific and reasonable, water resource utilization more efficient and economical, and production costs further reduced. At the same time, it also provides strong guarantees for the intelligent and refined management of agricultural production.
[0156] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0157] The following is an embodiment of the device of the present invention. For details not described in detail therein, reference may be made to the corresponding method embodiment described above.
[0158] Figure 4 The structural diagram of the pump state recognition model training device provided by the embodiment of the present invention is shown. For the convenience of explanation, only the part related to the embodiment of the present invention is shown, which is described in detail as follows:
[0159] like Figure 4 As shown, the pump well state recognition model training device 4 includes:
[0160] The historical power data acquisition module 41 is used to acquire the historical power data of agricultural irrigation users; wherein the historical power data is the power data at set intervals;
[0161] The feature extraction module 42 is used to perform wavelet transformation on the historical power data and extract features according to the results of the wavelet transformation; wherein the features include approximate coefficients and detail coefficients;
[0162] The data anomaly detection module 43 is used to perform data anomaly detection on the historical power data according to the CUSUM algorithm to obtain data anomaly detection results; wherein the data anomaly detection results include data anomaly points indicating the possibility of state change of the pump well;
[0163] The machine-well pump state recognition model training module 44 is used to construct a data set based on the approximate coefficient, the detail coefficient, the data anomaly detection result and the state data of the machine-well pump, and train the SVM classifier based on the data set to obtain the machine-well pump state recognition model; wherein the machine-well pump state recognition model takes the approximate coefficient, the detail coefficient, and the anomaly detection result as input, and takes the state of the machine-well pump at each set time as output, and the state of the machine-well pump includes opening and closing.
[0164] In a possible implementation, the data anomaly detection module 43 is used to:
[0165] Get the CUSUM statistics of the previous data point, the historical power data of the current data point, and the reference threshold;
[0166] Calculate the CUSUM statistic of the current data point based on the CUSUM statistic of the previous data point, the historical power data of the current data point, and the reference threshold;
[0167] When the CUSUM statistic of the previous data point is greater than the data anomaly threshold, the data point is determined as a data anomaly point.
[0168] In a possible implementation, the pump state recognition model training module 44 is used to:
[0169] The data set is constructed based on the approximate coefficient, detail coefficient, data anomaly detection results and the status data of the pump, including:
[0170] The data set is classified according to different data anomaly detection results, and sub-data sets corresponding to different abnormal data are constructed.
[0171] The embodiment of the present invention performs wavelet transform on the historical electricity data, and extracts the approximate coefficient and detail coefficient features according to the result of the wavelet transform, wherein the approximate coefficient represents the low-frequency component or trend of the signal, and the detail coefficient represents the high-frequency component or detail of the signal, and can decompose the data into sub-bands of different scales, and capture the subtle changes in the signal, so that the algorithm is more flexible and accurate in processing complex and changeable electricity consumption data. Multi-scale analysis through wavelet transform can effectively extract key features in the signal and reduce dependence on the original data dimension. According to the CUSUM algorithm, data anomaly detection is performed on the historical electricity data, and the data anomaly detection result includes data anomaly points indicating the possibility of state change of the machine well pump. The data anomaly points provide important information about the change of electricity data. The change of electricity data can reflect the change of the state of the machine well pump, which helps to improve the accuracy of the model in classifying the state of the machine well pump. A data set is constructed according to the approximation coefficient, detail coefficient, data anomaly detection results and the status data of the machine-well pump. The SVM classifier is trained according to the data set to obtain the machine-well pump status recognition model. The SVM classifier improves the model's prediction ability for unseen data by maximizing the classification interval. Its strong generalization ability ensures consistency in performance on different data sets and reduces the occurrence of false positives and negatives, so that the machine-well pump status recognition model can more accurately identify the status of the machine-well pump, thereby accurately calculating the agricultural irrigation electricity.
[0172] Figure 5 As shown, the agricultural irrigation electricity calculation device 5 includes:
[0173] The power data acquisition module 51 is used to acquire the power data of agricultural irrigation users; wherein the power data is the power data at set intervals;
[0174] The feature extraction module 52 is used to perform wavelet transform on the electric quantity data and extract features according to the result of the wavelet transform; wherein the features include approximate coefficients and detail coefficients;
[0175] The data anomaly detection module 53 is used to perform data anomaly detection on the power data according to the CUSUM algorithm to obtain a data anomaly detection result; wherein the data anomaly detection result includes a data anomaly point indicating the possibility of a state change of the pump well;
[0176] The state identification module 54 of the pump well is used to input the approximate coefficient, the detail coefficient and the data anomaly detection result into the pump well state identification model, and output the state of the pump well at each set time; wherein the state of the pump well includes on and off;
[0177] The agricultural irrigation electricity calculation module 55 is used to calculate the agricultural irrigation electricity according to the state of the pump-well pump.
[0178] In a possible implementation, the agricultural irrigation electricity calculation module 55 is used to:
[0179] Calculate the agricultural irrigation electricity based on the status of the well pump, including:
[0180] Determine the time period for the pump to be turned on according to the state of the pump at each set time;
[0181] Calculate the agricultural irrigation electricity based on the time period when the well pump is turned on.
[0182] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0183] Those of ordinary skill in the art will appreciate that the templates, units, and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0184] If the module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, it can implement the steps of the above-mentioned various pump well state recognition model training methods and agricultural irrigation electricity calculation method embodiments. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory, random access memory, electrical carrier signal, telecommunication signal and software distribution medium.
[0185] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A method for training a pump well state recognition model, characterized in that: include: Obtain historical electricity data of agricultural irrigation users; wherein the historical electricity data is electricity data at set intervals; perform wavelet transform on the historical electricity data, and perform feature extraction based on the result of the wavelet transform; wherein the feature includes an approximate coefficient and a detail coefficient; perform data anomaly detection on the historical electricity data according to the CUSUM algorithm to obtain a data anomaly detection result; wherein the data anomaly detection result includes a data anomaly point indicating the possibility of a state change of the pump-well pump; construct a data set according to the approximate coefficient, the detail coefficient, the data anomaly detection result and the state data of the pump-well pump, train an SVM classifier according to the data set, and obtain a pump-well pump state recognition model; wherein the pump-well pump state recognition model takes the approximate coefficient, the detail coefficient and the anomaly detection result as input, and takes the state of the pump-well pump at each set time as output, and the state of the pump-well pump includes on and off.
2. The pump well pump state recognition model training method according to claim 1, characterized in that: The step of constructing a data set according to the approximate coefficient, the detail coefficient, the data anomaly detection result and the state data of the pump-well pump comprises: The data set is classified according to different data anomaly detection results, and sub-data sets corresponding to different abnormal data are constructed.
3. The pump well pump state recognition model training method according to claim 1, characterized in that: The performing data anomaly detection on the historical power data according to the CUSUM algorithm includes: Get the CUSUM statistics of the previous data point, the historical power data of the current data point, and the reference threshold; Calculate the CUSUM statistic of the current data point based on the CUSUM statistic of the previous data point, the historical power data of the current data point, and the reference threshold; When the CUSUM statistic of the current data point is greater than the data anomaly threshold, the data point is determined as a data anomaly point.
4. The pump well pump state recognition model training method according to claim 1, characterized in that: The historical electric quantity data includes one or more of current, voltage and power.
5. The pump well pump state recognition model training method according to claim 1, characterized in that: Before obtaining the historical electricity consumption data of agricultural irrigation users, it also includes: Obtain initial electricity consumption data of agricultural irrigation users; removing noise from the initial electrical quantity data; The missing values and abnormal values of the initial electric quantity data are processed to obtain the historical electric quantity data.
6. The method for training a pump well state recognition model according to claim 5, characterized in that: The removing noise from the initial electric quantity data comprises: Create a sliding window and determine the window width; For each position in the window, calculating the average value of all data in the window; Overwriting the initial power data of the location with the average value; The window is moved forward by one data point, and the average value of all data is repeatedly calculated to cover the entire data sequence; Output all average values to obtain the initial power data after removing noise.
7. The method for training a pump well state recognition model according to claim 5, characterized in that: The processing of missing values and abnormal values of the initial electric quantity data includes: Calculating an abnormal threshold value according to the initial power data; Determine an abnormal value in the initial power data according to the abnormal threshold; Missing values were filled and outliers were replaced based on linear interpolation.
8. The method for training a pump well state recognition model according to claim 7, characterized in that: The calculating the abnormal threshold value according to the initial power data includes: Calculate the average value and standard deviation of the initial electric quantity data; The abnormal threshold is calculated according to the mean value and the standard deviation.
9. A method for calculating agricultural irrigation electricity, which is based on the pump state recognition model obtained by the pump state recognition model training method according to any one of claims 1 to 8, and is characterized in that: include: Obtaining electricity data of agricultural irrigation users; wherein the electricity data is electricity data at set intervals; The electric quantity data is subjected to wavelet transformation, and feature extraction is performed according to the result of the wavelet transformation; wherein the feature includes an approximate coefficient and a detail coefficient; Performing data anomaly detection on the electric quantity data according to the CUSUM algorithm to obtain a data anomaly detection result; wherein the data anomaly detection result includes a data anomaly point indicating the possibility of a state change of the pump-well pump; Input the approximate coefficient, the detail coefficient, and the data anomaly detection result into the pump state recognition model, and output the state of the pump at each set time; wherein the state of the pump includes on and off; The agricultural irrigation power is calculated according to the state of the pump.
10. The agricultural irrigation electricity calculation method according to claim 9, characterized in that: The calculating of agricultural irrigation power according to the state of the pump-well pump comprises: Determine the time period for starting the pump according to the state of the pump at each set time; The agricultural irrigation power is calculated according to the time period when the pump is turned on.