A load prediction method based on scene self-adaptation
By constructing multi-scenario dedicated TCN models and combining them with MCU hardware acceleration, the problem of low load prediction accuracy of edge computing devices has been solved, achieving efficient and autonomously optimized load prediction and meeting the real-time requirements of the power system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUANGSHI POWER SUPPLY CO
- Filing Date
- 2026-03-31
- Publication Date
- 2026-05-29
AI Technical Summary
Existing edge computing devices suffer from low prediction accuracy and are unable to run complex deep learning models in real time, failing to meet the high accuracy and real-time requirements of power systems.
We construct multi-scenario dedicated prediction models, combine real-time data acquisition from edge devices, intelligent scene recognition, dynamic model invocation, and autonomous iterative optimization, perform lightweight processing through the TCN model, and utilize the MCU's SIMD instruction set for hardware acceleration to achieve efficient load prediction.
It improves load forecasting accuracy by 6-10 percentage points, meets the real-time requirements of power systems, realizes autonomous model optimization and long-term adaptability, and is suitable for edge computing devices with limited computing and storage resources.
Smart Images

Figure CN122118684A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of power system automation technology, specifically relating to a high-precision load forecasting method suitable for edge computing devices with limited computing and storage resources, capable of automatically selecting a forecasting model based on the power consumption scenario. Background Technology
[0002] Prediction tasks are being moved from cloud-based master stations to edge devices such as transformer terminals (TTUs) and feeder terminals (FTUs). These devices are typically based on microcontrollers (MCUs), whose computing power, storage resources, and power consumption are severely limited.
[0003] Currently, most edge-side load forecasting solutions employ a single, general-purpose model, such as the Autoregressive Integral Moving Average (ARIMA) model or shallow neural networks, to handle all types of user loads (e.g., commercial, residential, industrial, and agricultural). However, the load characteristics of different electricity consumption scenarios differ fundamentally: commercial loads are significantly affected by holidays and promotional activities; residential loads are highly sensitive to weather and resident behavior patterns; industrial loads are strongly correlated with production plans, exhibiting strong regularity but requiring adjustments to shift schedules; and agricultural loads are highly seasonal and weather-dependent. Using a one-size-fits-all general-purpose model fails to accurately capture these diverse patterns, resulting in low forecast accuracy and failing to meet the needs of precise power distribution and demand-side management.
[0004] On the other hand, while complex deep learning models (such as LSTM and GRU) deployed in the cloud have high detection accuracy, their large number of model parameters and high computational complexity make them unsuitable for real-time operation on resource-constrained MCUs. Therefore, there is an urgent need in this field for an adaptive load forecasting method that can maintain high prediction accuracy while running efficiently on edge computing devices.
[0005] CN121562930A discloses a method and system for predicting and optimizing the power load of high-energy-consuming equipment, solving the problems of inaccurate load prediction, limited control methods, and difficulty in dynamic adaptation for high-energy-consuming equipment. The method includes: real-time acquisition of multi-source data from high-energy-consuming equipment; preprocessing to construct a dynamic equipment collaborative causal graph and extracting key constraints; inputting the data and constraints into a dynamic digital sample model to obtain system state simulation results; based on the results, generating and executing a multi-objective optimization control strategy using a meta-learning + reinforcement learning decision framework; collecting actual data to compare deviations; initiating hierarchical federated learning when deviations exceed a threshold; aggregating similar experiences by grouping according to the causal graph topology; and dynamically calibrating model parameters and the decision framework. However, this method cannot solve the aforementioned technical problems. Summary of the Invention
[0006] The purpose of this invention is to overcome the shortcomings of the prior art and provide a scenario-adaptive edge computing device load prediction method. By constructing multi-scenario dedicated prediction models and performing lightweight processing, combined with real-time data acquisition from edge devices, intelligent scene recognition, dynamic model invocation, and autonomous iterative optimization, the optimal balance between edge-side load prediction accuracy and operating efficiency is achieved.
[0007] This invention is achieved through the following technical solution: A scenario-adaptive load forecasting method includes the following steps: Step S1, Data Acquisition and Preprocessing: Collect and preprocess multi-source data, collect historical power load data under the target scenario, with a sampling interval of 15 minutes, including active power, reactive power, current, and voltage. The collection duration is set according to the scenario differences. After the collection is completed, the data is preprocessed. Step S2, Multi-Scenario Model Training and Optimization: Differentiated design of multi-scenario dedicated TCN models is carried out, and four models are trained specifically for commercial, residential, industrial, and agricultural scenarios. Then, model pruning and quantization perception training are performed to prepare for subsequent edge deployment. A hybrid model storage strategy based on usage frequency is implemented, with high-frequency scenario models residing in RAM and low-frequency scenario models loaded from Flash on demand to balance memory resources and response speed. Step S3, Model Deployment: Convert the model obtained in step S2 into a C array (.cc file), add it to the MCU project, call the TFLM interpreter for inference, and combine the inference code with the MCU's data acquisition, communication and other parts; Step S4, Intelligent Load Forecasting: The system acquires current time, day of the week, holiday information, and real-time weather data through the device's built-in clock and external communication module. Then, the system automatically performs online feature engineering, converting the collected raw data into model-recognizable feature vectors. Next, the system rapidly analyzes the feature vectors according to pre-set scene recognition rules, determining the most likely scene category to which the current load belongs through the load recognition module. Then, it calls the dedicated model corresponding to that scene for efficient inference calculations, utilizing the MCU's SIMD instruction set for hardware acceleration of convolution calculations during the inference process. Finally, the system outputs the load forecast result. This step is automatically repeated according to a preset forecast cycle to achieve continuous intelligent load forecasting. Step S5, Model Autonomous Optimization: Edge devices continuously collect real-time load data. The system automatically starts the evaluation process, compares the collected results with the previously generated prediction results, calculates a series of key performance indicators, and performs multi-dimensional evaluation. If the prediction error of the current period exceeds the recent average error or the amount of data in the cache reaches the preset threshold, the model will perform autonomous optimization, add recent data for incremental training, and the edge device will complete the iteration locally. At the same time, the system analyzes the prediction error and attempts to diagnose the root cause of the problem. The aforementioned historical load data needs to cover the minimum cycle requirements of the corresponding scenario, and simultaneously collect time features, weather features, and business features. Time features include hours, days of the week, holidays, shift markers, etc. Weather features include temperature, humidity, precipitation, etc. Business features are adapted according to the scenario, such as promotional activity information in commercial scenarios and production plans in industrial scenarios. The data collection duration is set according to the different scenarios: no less than 1 year for commercial scenarios, no less than 2 years for residential scenarios, no less than 6 months for industrial scenarios, and no less than 3 years for agricultural scenarios, and must cover the entire season or business cycle. The preprocessing described above uses linear interpolation to fill in missing values, identifies and removes outliers using the 3σ criterion, normalizes continuous features to map them to the [0,1] interval, and performs one-hot encoding or label encoding on discrete features. The business scenario model adopts a three-layer causal convolution structure with dilation coefficients set to [1, 24, 168]. The dataset is strictly divided into weekends and weekdays and trained in stages. At the same time, a holiday effect layer is integrated. The load mutation brought about by holidays is explicitly modeled by embedding holiday markers into vectors to refine the pattern differences of different day types. An attention mechanism for business hours is also introduced. In model training, higher prediction error weights are given to the business hours from 9:00 to 21:00 on weekdays to focus on key business hours. The residential scenario model adopts a dual-stream TCN architecture, in which one stream processes historical load time series and the other stream processes weather features such as temperature and humidity in parallel. Finally, deep feature fusion is performed to accurately characterize the nonlinear sensitivity of residential electricity consumption to meteorological conditions. The expansion coefficient is set to [1, 2, 24], and a weighting system for the prediction error during the morning and evening peak periods is adopted to give extra weight to the prediction error of the morning peak (7-9 am) and evening peak (18-21 pm) to ensure the reliability of peak load prediction. The industrial scenario model adds a production planning encoder, which transforms the abstract production schedule into a feature vector that the model can understand. Its expansion coefficient is set to [1, 8, 24] to match a typical 8-hour work shift cycle. The agricultural scenario model adopts a three-stream TCN architecture, which takes time series data, meteorological data (temperature, rainfall, sunshine) and crop information (growth stage, irrigation plan) as inputs, and expands the expansion coefficient to [1, 24, 168, 720]. It also has a built-in seasonal trend decomposition module to decompose the load series into trend, periodic and residual components for learning, so as to improve the accuracy of long-term prediction. In addition, to solve the problems of insufficient data or imbalanced samples, data augmentation techniques such as time shift, adding random noise and weather condition perturbation are used for all scenarios. The pruning described above involves evaluating the importance of weights, removing low-contribution neuron connections, generating a sparse model, and reducing the number of model parameters without significantly sacrificing accuracy. The quantization-aware training described above simulates the process of 8-bit integer calculation during model training, allowing the model weights to adapt to low-precision representation during the training phase, and ultimately generating a high-precision 8-bit integer model. The model deployment further includes fine-grained partition management of MCU storage resources, dividing the Flash memory into a system firmware area, a main program area, a prediction model library area, and a data storage area, and dividing the RAM into a system running area, a data buffer, and a model running area; the prediction model library area is used to store all dedicated TCN models; the model running area is used for real-time calculation of weights and intermediate results during model inference; The method of converting the model into a C array is to convert the PyTorch model obtained in step S2 into ONNX, and then into TensorFlow, or to train directly using TensorFlow, and then use the TensorFlow Lite converter to convert the model into TensorFlow Lite format (.tflite), and then into a C array (.cc file). The load forecast results are output in two forms: real-time reporting and local caching. Real-time reporting is achieved by uploading the forecast results to the power distribution station system immediately through communication modules such as HPLC or 4G for advanced applications. Local caching involves storing the forecast results and corresponding key features in the device's memory to provide data support for subsequent model performance evaluation and autonomous optimization. The multidimensional assessment is a specialized assessment for different scenarios. It calculates core indicators such as mean absolute percentage error (MAPE), root mean square error (RMSE), and accuracy in real time, and conducts specialized assessments for key concerns in different scenarios. For example, for commercial scenarios, it focuses on calculating the prediction MAPE for holidays and the error during business hours; for residential scenarios, it assesses the prediction accuracy during morning and evening peak hours; for industrial scenarios, it focuses on the prediction time deviation at shift change points; and for agricultural scenarios, it analyzes the prediction performance during irrigation periods and different seasons. The system analyzes prediction errors, including error pattern recognition, scene misjudgment, and feature correlation analysis. Error pattern recognition involves analyzing the distribution of errors to determine whether they are systematic biases, random errors, or sudden anomalies. Scene misjudgment occurs when prediction errors are consistently abnormally high over a certain period; the system retrospectively checks the scene recognition module's judgment during that period to determine if misjudgments are present. Feature correlation analysis examines periods with large errors to identify any abnormalities or missing key features, thus determining if the errors are due to issues with the quality of the feature data. The model's autonomous optimization is triggered when the amount of data in the cache reaches a preset threshold or when the system detects that the prediction error exceeds the preset threshold for multiple consecutive periods. The model's self-optimization has an effect verification mechanism. The new version of the model will run in parallel with the old version of the model during a short verification period to compare their prediction accuracy. If the performance of the new version of the model is not as good as that of the old version during the verification period, the system will automatically roll back to the previous stable version to ensure that the prediction performance will not deteriorate due to optimization failure. The scene recognition rules are lightweight rules formulated based on the analysis of the characteristics of the load curves of each scene. They are used to automatically identify scenes by calculating the volatility of the load curve, the peak-to-valley difference, the correlation coefficient with temperature, and setting corresponding thresholds. The method described above runs on an HC32F460 microcontroller with 256KB Flash and 192KB RAM. A single dedicated TCN model is 4-15KB in size after compression, and the calculation time for a single prediction is less than 5 milliseconds. The beneficial effects of this invention are as follows: By designing dedicated TCN models for four major scenarios—commercial, residential, industrial, and agricultural—it deeply explores the inherent patterns of load in each scenario. Compared to traditional general-purpose models, the prediction accuracy is improved by 6-10 percentage points, effectively solving the industry problem of insufficient edge-side load prediction accuracy. Employing structured pruning and 8-bit integer quantization perceptual training techniques, the model size is compressed, with each model occupying only 4-15KB of storage space. Combined with a hybrid model storage strategy based on usage frequency, this allows complex deep learning models to run on MCUs with limited storage resources, overcoming resource bottlenecks. Furthermore, by automatically identifying load types through lightweight scenario recognition rules and dynamically calling the corresponding dedicated models for inference, it achieves full automation from data acquisition to prediction output, requiring no manual intervention. The system can intelligently adapt to changing circumstances. The solution addresses the varying load characteristics across different scenarios. It utilizes the SIMD instruction set of the Cortex-M4 core for hardware acceleration of convolutional computation, achieving a single prediction computation time of less than 5 milliseconds, meeting the real-time requirements of power systems and providing timely and accurate prediction data for grid dispatch and demand response. A complete feedback loop mechanism is established, enabling online autonomous optimization of the model through multi-dimensional performance evaluation, error diagnosis, and incremental learning. This allows the system to adapt to the slow evolution of load patterns over the long term, maintaining stable prediction accuracy. When adding new power consumption scenarios, only the corresponding dedicated model needs to be trained, demonstrating good scalability. The solution forms a complete technology chain from data acquisition and model training to edge deployment. Key technologies such as model compression, storage management, and dynamic scheduling all consider the feasibility and stability of industrial implementation, ensuring controllable technical risks and suitability for large-scale application.
[0008] The present invention has the following main beneficial technical effects: it realizes a complete closed loop from data perception, intelligent decision-making to self-optimization, and ensures long-term high accuracy and scene adaptability of edge load prediction. Attached Figure Description
[0009] Figure 1 This is a schematic diagram of the structural process of the present invention. Detailed Implementation
[0010] A scenario-adaptive load forecasting method includes the following steps: Step S1, Data Acquisition and Preprocessing: Collect and preprocess multi-source data, collect historical power load data under the target scenario, with a sampling interval of 15 minutes, including active power, reactive power, current, and voltage. The collection duration is set according to the scenario differences. After the collection is completed, the data is preprocessed. Step S2, Multi-Scenario Model Training and Optimization: Differentiated design of multi-scenario dedicated TCN models is carried out, and four models are trained specifically for commercial, residential, industrial, and agricultural scenarios. Then, model pruning and quantization perception training are performed to prepare for subsequent edge deployment. A hybrid model storage strategy based on usage frequency is implemented, with high-frequency scenario models residing in RAM and low-frequency scenario models loaded from Flash on demand to balance memory resources and response speed. Step S3, Model Deployment: Convert the model obtained in step S2 into a C array (.cc file), add it to the MCU project, call the TFLM interpreter for inference, and combine the inference code with the MCU's data acquisition, communication and other parts; Step S4, Intelligent Load Forecasting: The system acquires current time, day of the week, holiday information, and real-time weather data through the device's built-in clock and external communication module. Then, the system automatically performs online feature engineering, converting the collected raw data into model-recognizable feature vectors. Next, the system rapidly analyzes the feature vectors according to pre-set scene recognition rules, determining the most likely scene category to which the current load belongs through the load recognition module. Then, it calls the dedicated model corresponding to that scene for efficient inference calculations, utilizing the MCU's SIMD instruction set for hardware acceleration of convolution calculations during the inference process. Finally, the system outputs the load forecast result. This step is automatically repeated according to a preset forecast cycle to achieve continuous intelligent load forecasting. Step S5, Model Autonomous Optimization: Edge devices continuously collect real-time load data. The system automatically starts the evaluation process, compares the collected results with the previously generated prediction results, calculates a series of key performance indicators, and performs multi-dimensional evaluation. If the prediction error of the current period exceeds the recent average error or the amount of data in the cache reaches the preset threshold, the model will perform autonomous optimization, add recent data for incremental training, and the edge device will complete the iteration locally. At the same time, the system analyzes the prediction error and attempts to diagnose the root cause of the problem. The aforementioned historical load data needs to cover the minimum cycle requirements of the corresponding scenario, and simultaneously collect time features, weather features, and business features. Time features include hours, days of the week, holidays, shift markers, etc. Weather features include temperature, humidity, precipitation, etc. Business features are adapted according to the scenario, such as promotional activity information in commercial scenarios and production plans in industrial scenarios. The data collection duration is set according to the different scenarios: no less than 1 year for commercial scenarios, no less than 2 years for residential scenarios, no less than 6 months for industrial scenarios, and no less than 3 years for agricultural scenarios, and must cover the entire season or business cycle. The preprocessing described above uses linear interpolation to fill in missing values, identifies and removes outliers using the 3σ criterion, normalizes continuous features to map them to the [0,1] interval, and performs one-hot encoding or label encoding on discrete features. The business scenario model adopts a three-layer causal convolution structure with dilation coefficients set to [1, 24, 168]. The dataset is strictly divided into weekends and weekdays and trained in stages. At the same time, a holiday effect layer is integrated. The load mutation brought about by holidays is explicitly modeled by embedding holiday markers into vectors to refine the pattern differences of different day types. An attention mechanism for business hours is also introduced. In model training, higher prediction error weights are given to the business hours from 9:00 to 21:00 on weekdays to focus on key business hours. The residential scenario model adopts a dual-stream TCN architecture, in which one stream processes historical load time series and the other stream processes weather features such as temperature and humidity in parallel. Finally, deep feature fusion is performed to accurately characterize the nonlinear sensitivity of residential electricity consumption to meteorological conditions. The expansion coefficient is set to [1, 2, 24], and a weighting system for the prediction error during the morning and evening peak periods is adopted to give extra weight to the prediction error of the morning peak (7-9 am) and evening peak (18-21 pm) to ensure the reliability of peak load prediction. The industrial scenario model adds a production planning encoder, which transforms the abstract production schedule into a feature vector that the model can understand. Its expansion coefficient is set to [1, 8, 24] to match a typical 8-hour work shift cycle. The agricultural scenario model adopts a three-stream TCN architecture, which takes time series data, meteorological data (temperature, rainfall, sunshine) and crop information (growth stage, irrigation plan) as inputs, and expands the expansion coefficient to [1, 24, 168, 720]. It also has a built-in seasonal trend decomposition module to decompose the load series into trend, periodic and residual components for learning, so as to improve the accuracy of long-term prediction. In addition, to solve the problems of insufficient data or imbalanced samples, data augmentation techniques such as time shift, adding random noise and weather condition perturbation are used for all scenarios. The pruning described above involves evaluating the importance of weights, removing low-contribution neuron connections, generating a sparse model, and reducing the number of model parameters without significantly sacrificing accuracy. The quantization-aware training described above simulates the process of 8-bit integer calculation during model training, allowing the model weights to adapt to low-precision representation during the training phase, and ultimately generating a high-precision 8-bit integer model. The model deployment further includes fine-grained partition management of MCU storage resources, dividing the Flash memory into a system firmware area, a main program area, a prediction model library area, and a data storage area, and dividing the RAM into a system running area, a data buffer, and a model running area; the prediction model library area is used to store all dedicated TCN models; the model running area is used for real-time calculation of weights and intermediate results during model inference; The method of converting the model into a C array is to convert the PyTorch model obtained in step S2 into ONNX, and then into TensorFlow, or to train directly using TensorFlow, and then use the TensorFlow Lite converter to convert the model into TensorFlow Lite format (.tflite), and then into a C array (.cc file). The load forecast results are output in two forms: real-time reporting and local caching. Real-time reporting is achieved by uploading the forecast results to the power distribution station system immediately through communication modules such as HPLC or 4G for advanced applications. Local caching involves storing the forecast results and corresponding key features in the device's memory to provide data support for subsequent model performance evaluation and autonomous optimization. The multidimensional assessment is a specialized assessment for different scenarios. It calculates core indicators such as mean absolute percentage error (MAPE), root mean square error (RMSE), and accuracy in real time, and conducts specialized assessments for key concerns in different scenarios. For example, for commercial scenarios, it focuses on calculating the prediction MAPE for holidays and the error during business hours; for residential scenarios, it assesses the prediction accuracy during morning and evening peak hours; for industrial scenarios, it focuses on the prediction time deviation at shift change points; and for agricultural scenarios, it analyzes the prediction performance during irrigation periods and different seasons. The system analyzes prediction errors, including error pattern recognition, scene misjudgment, and feature correlation analysis. Error pattern recognition involves analyzing the distribution of errors to determine whether they are systematic biases, random errors, or sudden anomalies. Scene misjudgment occurs when prediction errors are consistently abnormally high over a certain period; the system retrospectively checks the scene recognition module's judgment during that period to determine if misjudgments are present. Feature correlation analysis examines periods with large errors to identify any abnormalities or missing key features, thus determining if the errors are due to issues with the quality of the feature data. The model's autonomous optimization is triggered when the amount of data in the cache reaches a preset threshold or when the system detects that the prediction error exceeds the preset threshold for multiple consecutive periods. The model's self-optimization has an effect verification mechanism. The new version of the model will run in parallel with the old version of the model during a short verification period to compare their prediction accuracy. If the performance of the new version of the model is not as good as that of the old version during the verification period, the system will automatically roll back to the previous stable version to ensure that the prediction performance will not deteriorate due to optimization failure. The scene recognition rules are lightweight rules formulated based on the analysis of the characteristics of the load curves of each scene. They are used to automatically identify scenes by calculating the volatility of the load curve, the peak-to-valley difference, the correlation coefficient with temperature, and setting corresponding thresholds. The method described above runs on an HC32F460 microcontroller with 256KB Flash and 192KB RAM. A single dedicated TCN model is 4-15KB in size after compression, and the calculation time for a single prediction is less than 5 milliseconds. During operation, the system first initializes and deploys models, collecting historical electricity load data at a 15-minute resolution for the target scenario and preprocessing it. For four scenarios—commercial, residential, industrial, and agricultural—dedicated temporal convolutional network models are trained differently. Each model's architecture is customized to the characteristics of its scenario; for example, the commercial model integrates a holiday effect layer, while the residential model uses a dual-stream network to process weather data. After training, the models undergo pruning and quantization training, compressing them into 8-bit integer format, significantly reducing their size. The optimized models are then converted into C arrays recognizable by the microcontroller and integrated into the device firmware, burned into the edge device's Flash memory. To optimize runtime performance, the system employs a hybrid model storage strategy based on usage frequency, keeping high-frequency models (such as commercial and residential) resident in RAM and low-frequency models stored in Flash for on-demand loading. Subsequently, the system enters an online intelligent prediction closed loop, automatically executing the following according to a preset cycle: the device continuously collects real-time load data and synchronizes... By acquiring multi-source information such as time, calendar, and weather data through a built-in clock and communication module, the system automatically performs online feature engineering. Based on preset lightweight rules, it quickly analyzes real-time feature vectors, automatically determining the scenario category of the current load. According to the scenario judgment, the model scheduler dynamically calls the corresponding dedicated TCN model to the running memory. The inference engine inputs the feature vectors into the model and uses the MCU's SIMD instruction set for hardware acceleration of convolution calculations, completing inference within milliseconds and generating load forecast results for the future period. The system compares the forecast results with actual load data, calculates key performance indicators, and automatically triggers an incremental learning mechanism when the prediction error continuously exceeds a threshold. This mechanism uses recent data to perform lightweight fine-tuning of the model and updates the model parameters after verification, achieving autonomous optimization at the edge and maintaining high prediction accuracy. Through this process, the invention achieves a complete closed loop from data perception and intelligent decision-making to self-optimization, ensuring long-term accuracy and scenario adaptability of edge-side load forecasting.
[0011] For those skilled in the art, any changes, modifications, substitutions, and variations made to the embodiments without departing from the principles and spirit of the present invention, based on the teachings of the present invention, still fall within the protection scope of the present invention.
Claims
1. A scenario-adaptive load forecasting method, characterized in that, Includes the following steps: Step S1, Data Acquisition and Preprocessing: Collect and preprocess multi-source data, collect historical power load data under the target scenario, with a sampling interval of 15 minutes, including active power, reactive power, current, and voltage. The collection duration is set according to the scenario differences. After the collection is completed, the data is preprocessed. Step S2, Multi-Scenario Model Training and Optimization: Differentiated design of multi-scenario dedicated TCN models is carried out, and four models are trained specifically for commercial, residential, industrial, and agricultural scenarios. Then, model pruning and quantization perception training are performed to prepare for subsequent edge deployment. A hybrid model storage strategy based on usage frequency is implemented, with high-frequency scenario models residing in RAM and low-frequency scenario models loaded from Flash on demand to balance memory resources and response speed. Step S3, Model Deployment: Convert the model obtained in step S2 into a C array, which is represented by a .cc file. Add it to the MCU project, call the TFLM interpreter for inference, and combine the inference code with the data acquisition and communication parts of the MCU. Step S4, Intelligent Load Forecasting: The system acquires current time, day of the week, holiday information, and real-time weather data through the device's built-in clock and external communication module. Then, the system automatically performs online feature engineering, converting the collected raw data into model-recognizable feature vectors. Next, the system rapidly analyzes the feature vectors according to pre-set scene recognition rules, determining the most likely scene category to which the current load belongs through the load recognition module. Then, it calls the dedicated model corresponding to that scene for efficient inference calculations, utilizing the MCU's SIMD instruction set for hardware acceleration of convolution calculations during the inference process. Finally, the system outputs the load forecast result. This step is automatically repeated according to a preset forecast cycle to achieve continuous intelligent load forecasting. Step S5, Model Autonomous Optimization: Edge devices continuously collect real-time load data. The system automatically starts the evaluation process, compares the collected results with the previously generated prediction results, calculates a series of key performance indicators, and performs multi-dimensional evaluation. If the prediction error of the current period exceeds the recent average error or the amount of data in the cache reaches the preset threshold, the model will perform autonomous optimization, add recent data for incremental training, and the edge device will complete the iteration locally. At the same time, the system analyzes the prediction error and attempts to diagnose the root cause of the problem.
2. The load forecasting method based on scenario adaptation as described in claim 1, characterized in that: The aforementioned historical load data needs to cover the minimum cycle requirements of the corresponding scenario, and simultaneously collect time features, weather features, and business features. Time features include hours, days of the week, holidays, and shift markers. Weather features include temperature, humidity, and precipitation. Business features are adapted to the scenario, including promotional activity information for commercial scenarios and production plans for industrial scenarios.
3. The load forecasting method based on scenario adaptation as described in claim 1, characterized in that: The data collection duration is set differently for different scenarios: no less than 1 year for commercial scenarios, no less than 2 years for residential scenarios, no less than 6 months for industrial scenarios, and no less than 3 years for agricultural scenarios, and must cover the entire season or business cycle.
4. The load forecasting method based on scenario adaptation as described in claim 1, characterized in that: The preprocessing uses linear interpolation to fill in missing values, identifies and removes outliers using the 3σ criterion, normalizes continuous features to map them to the [0,1] interval, and performs one-hot encoding or label encoding on discrete features.
5. The load forecasting method based on scenario adaptation as described in claim 1, characterized in that: The commercial scenario model employs a three-layer causal convolutional structure with dilation coefficients set to [1, 24, 168]. The dataset is strictly divided into weekends and weekdays for phased training. A holiday effect layer is integrated, explicitly modeling load fluctuations caused by holidays through holiday marker embedding vectors to refine the pattern differences between different day types. A business hour attention mechanism is introduced, assigning higher prediction error weights to the weekday business hours from 9:00 to 21:00 during model training to focus on key business periods. The residential scenario model uses a dual-stream TCN architecture, with one stream processing historical load time series and the other stream processing weather features such as temperature and humidity in parallel. Finally, deep feature fusion is performed to accurately characterize the nonlinear sensitivity of residential electricity consumption to meteorological conditions. Its dilation coefficients are set to [1, 2, 168]. [24], and adopts a weighting system for the prediction error during morning and evening peak hours, giving extra weight to the prediction error of the morning peak and evening peak hours. The morning peak refers to 7-9 am and the evening peak refers to 18-21 pm, to ensure the reliability of peak load prediction; the industrial scenario model adds a production plan encoder, which transforms the abstract production schedule into a feature vector that the model can understand, and its expansion coefficient is set to [1, 8, 24] to match the typical 8-hour work shift cycle; the agricultural scenario model adopts a three-stream TCN architecture, which takes time series, meteorological data and crop information as inputs respectively. The meteorological data includes temperature, rainfall and sunshine, and the crop information includes growth stage and irrigation plan. The expansion coefficient is expanded to [1, 24, 168, 720], and a seasonal trend decomposition module is built in, which decomposes the load sequence into trend, period and residual components for learning to improve the accuracy of long-term prediction. In addition, in order to solve the problem of insufficient data or sample imbalance, data augmentation techniques such as time shift, adding random noise and weather condition perturbation are used for all scenarios.
6. The load forecasting method based on scenario adaptation as described in claim 1, characterized in that: The pruning described above involves evaluating the importance of weights, removing low-contribution neuron connections, generating a sparse model, and reducing the number of model parameters without significantly sacrificing accuracy. The quantization-aware training described above simulates the process of 8-bit integer computation during model training, allowing the model weights to adapt to low-precision representation during the training phase, ultimately generating a high-precision 8-bit integer model.
7. The load forecasting method based on scenario adaptation as described in claim 1, characterized in that: The model deployment further includes fine-grained partition management of MCU storage resources, dividing the Flash memory into a system firmware area, a main program area, a prediction model library area, and a data storage area, and dividing the RAM into a system running area, a data buffer, and a model running area; the prediction model library area is used to store all dedicated TCN models; the model running area is used for real-time calculation of weights and intermediate results during model inference.
8. The load forecasting method based on scenario adaptation as described in claim 1, characterized in that: The system analyzes prediction errors, including error pattern recognition, scene misjudgment, and feature correlation analysis. Error pattern recognition analyzes the distribution of errors to determine whether they are systematic biases, random errors, or sudden abnormal events. Scene misjudgment occurs when prediction errors are consistently abnormally high over a certain period; the system retrospectively checks whether the scene recognition module's judgment during that period is correct to investigate potential scene misjudgments. Feature correlation analysis examines whether certain key features are abnormal or missing during periods of high error, thereby determining whether the error is due to quality issues with the feature data.
9. The load forecasting method based on scenario adaptation as described in claim 1, characterized in that: The model is autonomously optimized, and its triggering mechanism is when the amount of data in the cache reaches a preset threshold or the system detects that the prediction error exceeds the preset threshold for multiple consecutive periods.
10. The load forecasting method based on scenario adaptation as described in claim 1, characterized in that: The model is self-optimized and has an effect verification mechanism. The new version of the model will run in parallel with the old version of the model during a short verification period to compare their prediction accuracy. If the performance of the new version of the model is not as good as the old version during the verification period, the system will automatically roll back to the previous stable version to ensure that the prediction performance will not deteriorate due to optimization failure.