Electric power data evaluation method and sensing system based on AI
Through the AI-based power data evaluation method, the decision tree model and Spark data processing technology are used to solve the problem of too many model parameters in power data evaluation, achieve rapid training and optimization, improve evaluation efficiency and accuracy, and help the power system Predict and optimize resource allocation to reduce energy consumption.
Patent Information
- Application Number
- CN202410739327.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-10-11
AI Technical Summary
There are too many model parameters in the existing power data evaluation process, which results in long evaluation time and high computational effort, affecting system operation efficiency.
An AI-based power data evaluation method is adopted, feature engineering and model training are performed through decision tree models, model parameters are optimized using cross-validation, and data cleaning and conversion are performed using Spark data processing technology to quickly evaluate and adjust model performance.
It achieves rapid training and optimization of decision tree models, reduces model complexity, avoids overfitting, improves the accuracy and operating efficiency of power data evaluation, helps predict and prevent power grid problems, optimize resource allocation, and reduce energy consumption.
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of power data evaluation, and specifically relates to an AI-based power data evaluation method and perception system. Background Art
[0002] Power data evaluation refers to the use of advanced data analysis technology and artificial intelligence algorithms to conduct in-depth mining and analysis of the operation data, load data, power generation data, etc. of the power system, so as to realize the functions of real-time monitoring, fault diagnosis, energy consumption analysis, load forecasting, etc. of the power system. Through the evaluation of power data, the operation efficiency of the power system can be improved, energy consumption can be reduced, the access and utilization of renewable energy can be promoted, and the sustainable development of the power industry can be promoted. Power data evaluation can also help power companies reduce energy consumption and improve energy utilization efficiency. By analyzing the energy consumption data in the power system, it is possible to find links and equipment with high energy consumption, and optimize and improve them in a targeted manner. In addition, power data evaluation can also promote the access and utilization of renewable energy. By real-time monitoring and analysis of renewable energy power generation data, the power generation capacity and stability of renewable energy can be evaluated, providing a basis for the access and dispatch of renewable energy.
[0003] In the existing power data evaluation process, there are many model parameters, which makes the entire evaluation process require a long time and computing energy, affecting the operating efficiency of the overall system. Summary of the invention
[0004] The purpose of the present invention is to provide an AI-based power data evaluation method and perception system in order to solve the above-mentioned problems.
[0005] The technical solution adopted by the present invention is as follows: an AI-based power data evaluation method, the method comprising the following steps:
[0006] S1: First, clarify the purpose of evaluating power data, such as improving the operating efficiency of the power system, reducing energy consumption, predicting power demand, etc. Based on the demand analysis, determine the input data and output results of the evaluation method;
[0007] S2: Data collection and preprocessing: According to demand analysis, collect various types of data related to power data, such as power generation, load, voltage, current, etc. Perform data cleaning and data conversion preprocessing operations on the collected data to facilitate subsequent modeling and training;
[0008] S3: Perform feature engineering: Extract features related to the evaluation task from the preprocessed data. Feature engineering has a significant impact on the performance of the model and needs to be adjusted and optimized according to the specific task;
[0009] S4: Select the appropriate AI model: Select the decision tree AI model based on the characteristics of the evaluation task;
[0010] S5: Use the collected power data and features to train the selected model. During the training process, the model performance is evaluated through cross-validation and other methods, and the model parameters are adjusted to optimize the model effect;
[0011] S6: Model evaluation and validation: Evaluate the performance of the model on an independent test set, including accuracy, recall, F1 value, etc.
[0012] S7: Deploy the trained model to actual application scenarios, such as power system operation monitoring, energy consumption analysis, etc. According to the actual application results, continuously optimize the model and algorithm to improve the accuracy and practicality of the evaluation method.
[0013] In a preferred embodiment, in step S2, the data cleaning method includes: the cloud computing server uses a pre-established distributed file data cleaning algorithm to clean the target distributed file data to obtain a first distributed file data cleaning result; the distributed file data cleaning algorithm is trained according to the first distributed file data cleaning result and the second distributed file data cleaning result to obtain an updated distributed file data cleaning algorithm that can be used for the next distributed file data cleaning; wherein the second distributed file data cleaning result is a distributed file data cleaning result obtained by manually cleaning the target distributed file data.
[0014] In a preferred embodiment, in step S2, the method for data conversion includes the following steps:
[0015] Create SparkContext and SparkSession: First, you need to create SparkContext (corresponding to the RDD programming interface) or SparkSession (corresponding to the DataFrame / DatasetAPI) as the entry point for communicating with the Spark cluster;
[0016] Read data: Use the API provided by Spark to read data from data sources (such as file systems, databases, Kafka), and load the data into RDD, DataFrame, or Dataset for processing;
[0017] Data conversion: Process and convert data by calling various conversion operations; common conversion operations include map, filter, reduce, join, and groupBy; these operations are connected in series to form a data processing pipeline;
[0018] Cache data (optional): If some data needs to be used multiple times, use the cache or persist method to cache the data in memory to improve the performance of subsequent operations;
[0019] Execute data transformation: Before calling the transformation operation, Spark will only build a logical plan for data processing and will not execute it immediately. When encountering an action operation (such as collect, count, saveAsTextFile), Spark will trigger the actual job execution.
[0020] Action operation: The final data conversion result triggers the actual calculation process through the action operation, and the result is returned to the driver or written to the external storage system;
[0021] Save results: Finally, save the converted results back to an external storage system, such as a file system or database, for subsequent analysis and application use;
[0022] Close SparkContext or SparkSession: After completing all operations, remember to close SparkContext or SparkSession to release resources.
[0023] In a preferred embodiment, in step S3, the features include: time series features, frequency features, and statistical features.
[0024] In a preferred embodiment, in step S5, the specific process method steps for model training and tuning are as follows:
[0025] ① Data preparation: Divide the collected power data into training set and test set, usually in a ratio of 70% and 30%. The training set is used to train the model, and the test set is used to evaluate the model performance.
[0026] ② Feature selection: Based on demand analysis and feature engineering, select features related to the evaluation task from the preprocessed data. For decision tree models, feature selection has an important impact on the performance of the model.
[0027] ③ Decision tree model training: Use the training set and ID3 decision tree algorithm to train the model. During the training process, the algorithm will automatically select the optimal split node based on the features and labels to generate a decision tree.
[0028] ④ Cross-validation: In order to evaluate the performance of the model, a cross-validation method is used. The training set is divided into k subsets of equal size and k-fold cross-validation is performed. The specific steps are as follows: a. Take one subset as the validation set each time, and the remaining subsets as the training set. b. Use the training set to train the decision tree model. c. Use the validation set to evaluate the performance of the model and calculate indicators such as accuracy, recall, and F1 value. d. Repeat steps ac until each subset is used as a validation set once. e. Calculate the average performance index of k validations as the evaluation result of the model.
[0029] ⑤ Adjust model parameters: According to the results of cross-validation, adjust the parameters of the decision tree model, such as maximum depth and splitting criteria. The purpose of parameter adjustment is to optimize model performance and improve indicators such as accuracy, recall rate, and F1 value.
[0030] ⑥ Retrain model: Retrain the decision tree model based on the adjusted parameters.
[0031] ⑦ Model evaluation: Evaluate the performance of the model on an independent test set and calculate indicators such as accuracy, recall, and F1 value. If the requirements are met, complete the model training and tuning; otherwise, return to step 5 and continue to adjust the parameters.
[0032] ⑧Model saving: Save the trained model for subsequent deployment and application.
[0033] In a preferred embodiment, in step S5, the accuracy calculation formula is:
[0034] Accuracy = (TP+TN) / (TP+TN+FP+FN),
[0035] Among them, TP represents a true positive example, TN represents a true negative example, FP represents a false positive example, and FN represents a false negative example;
[0036] The recall rate calculation formula is: Recall rate = TP / (TP+FN), where TP represents true positive examples, TN represents true negative examples, FP represents false positive examples, and FN represents false negative examples.
[0037] In a preferred embodiment, in step S6, it is determined whether the model meets the requirements based on the evaluation results. If not, the process returns to steps S4 and S5 to reselect the model or adjust the parameters.
[0038] In a preferred embodiment, in step S6, the above performance index is calculated based on the model prediction results and the true labels of the test set. The calculation formula is as follows:
[0039] Accuracy: number of accurately predicted samples / total number of samples;
[0040] Precision: TP / (TP+FP);
[0041] Recall rate: TP / (TP+FN);
[0042] F1 score: 2*(precision*recall) / (precision+recall);
[0043] Mean square error: Σ(y_true-y_pred)2 / n;
[0044] Root mean square error: sqrt(Σ(y_true-y_pred)2 / n);
[0045] Coefficient of determination: 1-(SS_res / SS_tot), where SS_res is the residual sum of squares and SS_tot is the total sum of squares;
[0046] Among them, TP represents true positive examples, FP represents false positive examples, FN represents false negative examples, and n is the number of samples in the test set.
[0047] In a preferred embodiment, in step S7, the process steps of deploying the model are:
[0048] Model export: Save the trained model to a file, usually a .pkl or .joblib format file, so that it can be loaded and used in different environments.
[0049] Environment preparation: Determine the target environment for model deployment, including hardware (such as servers, cloud platforms, edge devices, etc.) and software (such as operating systems, dependent libraries, API services, etc.).
[0050] Integration development: Develop an interface or service to receive input data, call the model for prediction, and return the prediction results. This may involve web service development, API writing, database integration, etc.
[0051] Model deployment: Deploy the model files and interfaces to the target environment. If it is an online service, you may need to configure load balancing, automatic expansion and other functions to ensure the stability and performance of the service.
[0052] In a preferred embodiment, the sensing system comprises:
[0053] Data acquisition module: responsible for collecting power data from various sensors, smart meters, monitoring equipment, etc. These data may include voltage, current, power, frequency, temperature, humidity, etc.
[0054] Data transmission module: The collected data is transmitted to the data processing center through a wired or wireless network. This module involves technologies such as communication protocols, network security, and data compression.
[0055] Sensor management module: responsible for managing various sensors deployed in the power system, including calibration, maintenance, fault detection, etc., to ensure the accuracy and reliability of data.
[0056] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:
[0057] 1. In the present invention, the training speed of the decision tree model is relatively fast, especially when the amount of data is large. In addition, the performance of the model can be quickly evaluated and adjusted as needed by methods such as cross-validation. The decision tree model has relatively few parameters, such as maximum depth, splitting criteria, etc., which makes the model adjustment and optimization process relatively simple. By adjusting these parameters, the complexity of the model can be effectively controlled to avoid overfitting. Decision trees are the basis of many integrated learning methods (such as random forests, gradient boosting trees, etc.). These integrated models usually have higher prediction performance and can further improve the accuracy of power data evaluation on the basis of decision trees. In summary, the selection of a decision tree AI model can provide the beneficial effects of easy understanding, strong nonlinear processing capability, strong robustness, adaptability to multiple features, rapid training and adjustment for the AI-based power data evaluation method, which helps to improve the operating efficiency of the power system, reduce energy consumption, and accurately predict power demand.
[0058] 2. In the present invention, the AI model can help predict and prevent potential problems in the power grid, such as overload, voltage instability, etc., thereby improving the stability of the power grid. By predicting electricity demand and supply, the AI model can help power companies optimize the allocation of resources, including power generation resources, transmission resources, and storage resources. The AI model can be used to analyze customer electricity usage data, provide personalized services and suggestions, and improve customer satisfaction and loyalty. The AI model can provide real-time data analysis for the electricity market, helping market participants make more informed trading decisions. By optimizing the operation of the power system, the AI model helps reduce energy consumption and environmental impact and promote sustainable development. DETAILED DESCRIPTION
[0059] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0060] Example:
[0061] An AI-based power data evaluation method, the method comprising the following steps:
[0062] S1: First, clarify the purpose of evaluating power data, such as improving the operating efficiency of the power system, reducing energy consumption, predicting power demand, etc. Based on the demand analysis, determine the input data and output results of the evaluation method;
[0063] S2: Data collection and preprocessing: According to demand analysis, collect various types of data related to power data, such as power generation, load, voltage, current, etc. Perform data cleaning and data conversion preprocessing operations on the collected data to facilitate subsequent modeling and training;
[0064] S3: Perform feature engineering: Extract features related to the evaluation task from the preprocessed data. Feature engineering has a significant impact on the performance of the model and needs to be adjusted and optimized according to the specific task;
[0065] S4: Select the appropriate AI model: Select the decision tree AI model based on the characteristics of the evaluation task;
[0066] S5: Use the collected power data and features to train the selected model. During the training process, the model performance is evaluated through cross-validation and other methods, and the model parameters are adjusted to optimize the model effect;
[0067] S6: Model evaluation and validation: Evaluate the performance of the model on an independent test set, including accuracy, recall, F1 value, etc.
[0068] S7: Deploy the trained model to actual application scenarios, such as power system operation monitoring, energy consumption analysis, etc. According to the actual application results, continuously optimize the model and algorithm to improve the accuracy and practicality of the evaluation method.
[0069] In step S2, the data cleaning method includes: the cloud computing server uses a pre-established distributed file data cleaning algorithm to clean the target distributed file data to obtain a first distributed file data cleaning result; the distributed file data cleaning algorithm is trained according to the first distributed file data cleaning result and the second distributed file data cleaning result to obtain an updated distributed file data cleaning algorithm for the next distributed file data cleaning; wherein the second distributed file data cleaning result is a distributed file data cleaning result obtained by manually cleaning the target distributed file data.
[0070] In step S2, the data conversion method includes the following steps:
[0071] Create SparkContext and SparkSession: First, you need to create SparkContext (corresponding to the RDD programming interface) or SparkSession (corresponding to the DataFrame / DatasetAPI) as the entry point for communicating with the Spark cluster;
[0072] Read data: Use the API provided by Spark to read data from data sources (such as file systems, databases, Kafka), and load the data into RDD, DataFrame, or Dataset for processing;
[0073] Data conversion: Process and convert data by calling various conversion operations; common conversion operations include map, filter, reduce, join, and groupBy; these operations are connected in series to form a data processing pipeline;
[0074] Cache data (optional): If some data needs to be used multiple times, use the cache or persist method to cache the data in memory to improve the performance of subsequent operations;
[0075] Execute data transformation: Before calling the transformation operation, Spark will only build a logical plan for data processing and will not execute it immediately. When encountering an action operation (such as collect, count, saveAsTextFile), Spark will trigger the actual job execution.
[0076] Action operation: The final data conversion result triggers the actual calculation process through the action operation, and the result is returned to the driver or written to the external storage system;
[0077] Save results: Finally, save the converted results back to an external storage system, such as a file system or database, for subsequent analysis and application use;
[0078] Close SparkContext or SparkSession: After completing all operations, remember to close SparkContext or SparkSession to release resources.
[0079] In step S3, the features include: time series features, frequency features, and statistical features.
[0080] In step S5, the specific process and steps for model training and tuning are as follows:
[0081] ① Data preparation: Divide the collected power data into training set and test set, usually in a ratio of 70% and 30%. The training set is used to train the model, and the test set is used to evaluate the model performance.
[0082] ② Feature selection: Based on demand analysis and feature engineering, select features related to the evaluation task from the preprocessed data. For decision tree models, feature selection has an important impact on the performance of the model.
[0083] ③ Decision tree model training: Use the training set and ID3 decision tree algorithm to train the model. During the training process, the algorithm will automatically select the optimal split node based on the features and labels to generate a decision tree.
[0084] ④ Cross-validation: In order to evaluate the performance of the model, a cross-validation method is used. The training set is divided into k subsets of equal size and k-fold cross-validation is performed. The specific steps are as follows: a. Take one subset as the validation set each time, and the remaining subsets as the training set. b. Use the training set to train the decision tree model. c. Use the validation set to evaluate the performance of the model and calculate indicators such as accuracy, recall, and F1 value. d. Repeat steps ac until each subset is used as a validation set once. e. Calculate the average performance index of k validations as the evaluation result of the model.
[0085] ⑤ Adjust model parameters: According to the results of cross-validation, adjust the parameters of the decision tree model, such as maximum depth and splitting criteria. The purpose of parameter adjustment is to optimize model performance and improve indicators such as accuracy, recall rate, and F1 value.
[0086] ⑥ Retrain model: Retrain the decision tree model based on the adjusted parameters.
[0087] ⑦ Model evaluation: Evaluate the performance of the model on an independent test set and calculate indicators such as accuracy, recall, and F1 value. If the requirements are met, complete the model training and tuning; otherwise, return to step 5 and continue to adjust the parameters.
[0088] ⑧Model saving: Save the trained model for subsequent deployment and application.
[0089] In step S5, the accuracy calculation formula is:
[0090] Accuracy = (TP+TN) / (TP+TN+FP+FN),
[0091] Among them, TP represents a true positive example, TN represents a true negative example, FP represents a false positive example, and FN represents a false negative example;
[0092] The recall rate calculation formula is: Recall rate = TP / (TP+FN), where TP represents true positive examples, TN represents true negative examples, FP represents false positive examples, and FN represents false negative examples.
[0093] In step S6, it is determined whether the model meets the requirements based on the evaluation results. If not, the process returns to steps S4 and S5 to reselect the model or adjust the parameters.
[0094] In step S6, the above performance indicators are calculated based on the model prediction results and the true labels of the test set. The calculation formula is as follows:
[0095] Accuracy: number of samples accurately predicted / total number of samples
[0096] Accuracy: TP / (TP+FP)
[0097] Recall rate: TP / (TP+FN)
[0098] F1 score: 2*(precision*recall) / (precision+recall)
[0099] Mean square error: Σ(y_true-y_pred)2 / n
[0100] Root mean square error: sqrt(Σ(y_true-y_pred)2 / n)
[0101] Coefficient of determination: 1-(SS_res / SS_tot), where SS_res is the residual sum of squares and SS_tot is the total sum of squares
[0102] Among them, TP represents true positive examples, FP represents false positive examples, FN represents false negative examples, and n is the number of samples in the test set.
[0103] In step S7, the process steps for deploying the model are:
[0104] Model export: Save the trained model to a file, usually a .pkl or .joblib format file, so that it can be loaded and used in different environments.
[0105] Environment preparation: Determine the target environment for model deployment, including hardware (such as servers, cloud platforms, edge devices, etc.) and software (such as operating systems, dependent libraries, API services, etc.).
[0106] Integration development: Develop an interface or service to receive input data, call the model for prediction, and return the prediction results. This may involve web service development, API writing, database integration, etc.
[0107] Model deployment: Deploy the model files and interfaces to the target environment. If it is an online service, you may need to configure load balancing, automatic expansion and other functions to ensure the stability and performance of the service.
[0108] The perception system includes:
[0109] Data acquisition module: responsible for collecting power data from various sensors, smart meters, monitoring equipment, etc. These data may include voltage, current, power, frequency, temperature, humidity, etc.
[0110] Data transmission module: The collected data is transmitted to the data processing center through a wired or wireless network. This module involves communication protocols, network security, data compression and other technologies.
[0111] Sensor management module: responsible for managing various sensors deployed in the power system, including calibration, maintenance, fault detection, etc., to ensure the accuracy and reliability of data.
[0112] In the present invention, the training speed of the decision tree model is relatively fast, especially when the amount of data is large. In addition, the performance of the model can be quickly evaluated and adjusted as needed by methods such as cross-validation. The decision tree model has relatively few parameters, such as maximum depth, splitting criteria, etc., which makes the model adjustment and optimization process relatively simple. By adjusting these parameters, the complexity of the model can be effectively controlled to avoid overfitting. Decision trees are the basis of many integrated learning methods (such as random forests, gradient boosting trees, etc.). These integrated models usually have higher prediction performance and can further improve the accuracy of power data evaluation on the basis of decision trees. In summary, the selection of a decision tree AI model can provide the beneficial effects of easy understanding, strong nonlinear processing capability, strong robustness, adaptability to multiple features, rapid training and adjustment for the AI-based power data evaluation method, which helps to improve the operating efficiency of the power system, reduce energy consumption, and accurately predict power demand.
[0113] In the present invention, the AI model can help predict and prevent potential problems in the power grid, such as overload, voltage instability, etc., thereby improving the stability of the power grid. By predicting electricity demand and supply, the AI model can help power companies optimize the allocation of resources, including power generation resources, transmission resources, and storage resources. The AI model can be used to analyze customer electricity usage data, provide personalized services and suggestions, and improve customer satisfaction and loyalty. The AI model can provide real-time data analysis for the electricity market, helping market participants make more informed trading decisions. By optimizing the operation of the power system, the AI model helps reduce energy consumption and environmental impact and promote sustainable development.
[0114] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or still includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0115] The above embodiments 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. However, these 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.
Claims
1. An AI-based power data evaluation method, characterized in that: The method comprises the following steps: S1: First, clarify the purpose of evaluating power data, such as improving the operating efficiency of the power system, reducing energy consumption, and predicting power demand; based on demand analysis, determine the input data and output results of the evaluation method; S2: Data collection and preprocessing: According to demand analysis, various data related to power data are collected, such as power generation, load, voltage, and current; data cleaning and data conversion preprocessing operations are performed on the collected data to facilitate subsequent modeling and training; S3: Perform feature engineering: Extract features related to the evaluation task from the preprocessed data. Feature engineering has an important impact on the performance of the model and needs to be adjusted and optimized according to the specific task. S4: Select the appropriate AI model: Select the decision tree AI model based on the characteristics of the evaluation task; S5: Use the collected power data and features to train the selected model; during the training process, the model performance is evaluated through the cross-validation method, the model parameters are adjusted, and the model effect is optimized; S6: Model evaluation and validation: Evaluate the performance of the model on an independent test set, including accuracy, recall, and F1 value; S7: Deploy the trained model to actual application scenarios, such as power system operation monitoring and energy consumption analysis; based on the actual application results, continuously optimize the model and algorithm to improve the accuracy and practicality of the evaluation method.
2. The AI-based power data evaluation method according to claim 1, characterized in that: In step S2, the data cleaning method includes: the cloud computing server uses a pre-established distributed file data cleaning algorithm to clean the target distributed file data to obtain a first distributed file data cleaning result; the distributed file data cleaning algorithm is trained according to the first distributed file data cleaning result and the second distributed file data cleaning result to obtain an updated distributed file data cleaning algorithm that can be used for the next distributed file data cleaning; wherein the second distributed file data cleaning result is a distributed file data cleaning result obtained by manually cleaning the target distributed file data.
3. The AI-based power data evaluation method according to claim 1, characterized in that: In step S2, the data conversion method includes the following steps: Create SparkContext and SparkSession: First, you need to create SparkContext (corresponding to the RDD programming interface) or SparkSession (corresponding to the DataFrame / DatasetAPI) as the entry point for communicating with the Spark cluster; Read data: Use the API provided by Spark to read data from data sources (such as file systems, databases, Kafka), and load the data into RDD, DataFrame, or Dataset for processing; Data conversion: Process and convert data by calling various conversion operations; common conversion operations include map, filter, reduce, join, and groupBy; these operations are connected in series to form a data processing pipeline; Cache data (optional): If some data needs to be used multiple times, use the cache or persist method to cache the data in memory to improve the performance of subsequent operations; Execute data transformation: Before calling the transformation operation, Spark will only build a logical plan for data processing and will not execute it immediately. When encountering an action operation (such as collect, count, saveAsTextFile), Spark will trigger the actual job execution. Action operation: The final data conversion result triggers the actual calculation process through the action operation, and the result is returned to the driver or written to the external storage system; Save results: Finally, save the converted results back to an external storage system, such as a file system or database, for subsequent analysis and application use; Close SparkContext or SparkSession: After completing all operations, remember to close SparkContext or SparkSession to release resources.
4. The AI-based power data evaluation method according to claim 1, characterized in that: In step S3, the features include: time series features, frequency features, and statistical features.
5. The AI-based power data evaluation method according to claim 1, characterized in that: In step S5, the specific process and steps for model training and tuning are as follows: ① Data preparation: Divide the collected power data into training set and test set, usually in a ratio of 70% and 30%; the training set is used to train the model, and the test set is used to evaluate the model performance; ② Feature selection: Based on demand analysis and feature engineering, features related to the evaluation task are selected from the preprocessed data; for decision tree models, feature selection has an important impact on the performance of the model; ③ Decision tree model training: Use the training set and the ID3 decision tree algorithm to train the model. During the training process, the algorithm will automatically select the optimal splitting node based on the features and labels to generate a decision tree. ④ Cross-validation: In order to evaluate the performance of the model, a cross-validation method is used; the training set is divided into k subsets of equal size and k-fold cross-validation is performed; the specific steps are as follows: a. Take one subset as the validation set each time, and the remaining subsets as the training set; b. Use the training set to train the decision tree model; c. Use the validation set to evaluate the model performance and calculate the accuracy, recall, and F1 value indicators; d. Repeat steps ac until each subset is used as a validation set once; e. Calculate the average performance indicator of k validations as the evaluation result of the model; ⑤ Adjust model parameters: According to the results of cross-validation, adjust the parameters of the decision tree model, such as maximum depth and splitting criteria; the purpose of parameter adjustment is to optimize model performance and improve accuracy, recall rate, and F1 value indicators; ⑥ Retrain the model: Retrain the decision tree model based on the adjusted parameters; ⑦ Model evaluation: Evaluate the performance of the model on an independent test set and calculate the accuracy, recall, and F1 value indicators; if the requirements are met, complete model training and tuning; Otherwise, return to step 5 and continue adjusting parameters; ⑧Model saving: Save the trained model for subsequent deployment and application.
6. The AI-based power data evaluation method according to claim 1, characterized in that: In step S5, the accuracy calculation formula is: Accuracy = (TP+TN) / (TP+TN+FP+FN), Among them, TP represents a true positive example, TN represents a true negative example, FP represents a false positive example, and FN represents a false negative example; The recall rate calculation formula is: Recall rate = TP / (TP+FN), where TP represents true positive examples, TN represents true negative examples, FP represents false positive examples, and FN represents false negative examples.
7. The AI-based power data evaluation method according to claim 1, characterized in that: In step S6, whether the model meets the requirements is determined based on the evaluation results; if not, return to steps S4 and S5 to reselect the model or adjust the parameters.
8. The AI-based power data evaluation method according to claim 1, characterized in that: In step S6, the above performance index is calculated based on the model prediction results and the true label of the test set; the calculation formula is as follows: Accuracy: number of accurately predicted samples / total number of samples; Precision: TP / (TP+FP); Recall rate: TP / (TP+FN); F1 score: 2*(precision*recall) / (precision+recall); Mean square error: Σ(y_true-y_pred)2 / n; Root mean square error: sqrt(Σ(y_true-y_pred)2 / n); Coefficient of determination: 1-(SS_res / SS_tot), where SS_res is the residual sum of squares and SS_tot is the total sum of squares; Among them, TP represents true positive examples, FP represents false positive examples, FN represents false negative examples, and n is the number of samples in the test set.
9. The AI-based power data evaluation method according to claim 1, characterized in that: In step S7, the process steps of deploying the model are: Model export: Save the trained model to a file, usually a .pkl or .joblib file, so that it can be loaded and used in different environments; Environment preparation: Determine the target environment for model deployment, including hardware (such as servers, cloud platforms, edge devices) and software (such as operating systems, dependent libraries, API services); Integration development: Develop an interface or service to receive input data, call the model to make predictions, and return the prediction results; this may involve web service development, API writing, and database integration; Model deployment: deploy model files and interfaces to the target environment; If it is an online service, you may need to configure load balancing and automatic expansion functions to ensure the stability and performance of the service.
10. The perception system of the power data evaluation method based on AI according to claim 1, characterized in that: The sensing system comprises: Data acquisition module: responsible for collecting power data from various sensors, smart meters, and monitoring equipment sources; these data may include voltage, current, power, frequency, temperature, and humidity; Data transmission module: transmits the collected data to the data processing center through wired or wireless networks; this module involves communication protocols, network security, and data compression technology; Sensor management module: responsible for managing various sensors deployed in the power system, including calibration, maintenance, and fault detection to ensure the accuracy and reliability of data.
Citation Information
Patent Citations
Method and system for identifying power consumption categories based on decision tree algorithm
CN111222556A
Intelligent refrigerator reliability analysis method based on neural training network
CN116757534A
