Electric power artificial intelligence model automatic updating method and related device
By automatically acquiring the drift and error rate increase of the input data of the power artificial intelligence model, the model can be updated autonomously, which solves the problem of lagging model updates in existing technologies and improves the agility and stability of power grid operation.
Patent Information
- Application Number
- CN202511703849.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-19
- Publication Date
- 2026-03-03
AI Technical Summary
The existing power AI model update mechanism relies on manual triggering, which leads to a serious lag in the identification and processing of model performance degradation. This makes it difficult to adapt to the dynamic changes in meteorological conditions and load characteristics in the power system, affecting prediction accuracy and operational effectiveness.
By acquiring the current input data drift and error rate increase rate of the power artificial intelligence model, the model update indication is automatically determined. The model is then updated autonomously using a sliding window monitoring and automated scheduling method, including steps such as training environment preparation, data processing, model training, evaluation, and deployment.
It significantly shortens the response time from model anomalies to repairs, from days/weeks to minutes/hours, improving the agile response capability of the power grid's operating status and ensuring the safe and stable operation of the power system.
Smart Images

Figure CN121597245A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of power and relates to a method and related apparatus for automatically updating an artificial intelligence model for power systems. Background Technology
[0002] Power AI models are core intelligent algorithms specifically applied to all aspects of the power system. By learning and analyzing massive amounts of power data (such as load, weather, equipment status, and market transactions), they achieve accurate perception of the power grid status, intelligent prediction of operating trends, and optimized support for complex decisions. They are widely used in scenarios such as load forecasting, fault diagnosis, new energy power forecasting, and intelligent inspection, and are a key technological driving force for building new power systems and ensuring the safe, economical, and efficient operation of the power grid.
[0003] Currently, the update mechanism of power AI models largely relies on manual triggering, typically requiring human intervention to determine whether to initiate the model retraining process. This passive response approach leads to a significant lag in the identification and handling of model performance degradation, making it difficult to adapt in a timely manner to dynamic changes in factors such as meteorological conditions and load characteristics within the power system, thus affecting prediction accuracy and operational effectiveness. Furthermore, it can easily cause business systems to remain in a suboptimal state for extended periods, even triggering a chain reaction of service degradation and impacting the safe and stable operation of the power system. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method and related apparatus for automatically updating an artificial intelligence model for power systems.
[0005] To achieve the above objectives, the present invention employs the following technical solution: In a first aspect, the present invention provides a method for automatically updating a power artificial intelligence model, comprising: acquiring the current input data drift degree and the current error rate increase rate of the power artificial intelligence model; determining an update indication for the power artificial intelligence model based on the current input data drift degree and the current error rate increase rate of the power artificial intelligence model; and updating the power artificial intelligence model when the update indication of the power artificial intelligence model is to perform an update.
[0006] Optionally, obtaining the current input data drift and current error rate increase rate of the power artificial intelligence model includes: obtaining the data drift of each classification feature data in the input data of the power artificial intelligence model using the following formula:
[0007] in, For the data drift of categorical feature data, The number of types of categorical feature data. For the training data, the first The proportion of class classification feature data The first in the current online service data The proportion of class classification feature data.
[0008] The data drift of each continuous feature data in the input data of the power artificial intelligence model is obtained by the following formula:
[0009] in, For continuous feature data, the data drift degree For continuous feature data in the training data in the th... The probability of a discrete interval. For continuous feature data in the current online service data, in the first... The probability of a discrete interval denoted as the number of discrete intervals.
[0010] The data drift of each category feature data and each continuous feature data in the input data of the power artificial intelligence model are weighted and superimposed based on the importance of the feature data to obtain the current input data drift of the power artificial intelligence model.
[0011] A sliding window monitoring method is used to obtain the current error rate of the power artificial intelligence model; the increase in the current error rate of the power artificial intelligence model compared with the benchmark error rate is taken as the error rate increase rate of the power artificial intelligence model.
[0012] Optionally, determining the update instruction for the power artificial intelligence model based on the current input data drift and the current error rate change rate of the power artificial intelligence model includes: when the current input data drift of the power artificial intelligence model is not greater than a preset input data drift threshold, and the current error rate change rate of the power artificial intelligence model is not greater than a preset error rate change rate threshold, the update instruction for the power artificial intelligence model is not to update; otherwise, the update instruction for the power artificial intelligence model is to update.
[0013] Optionally, it also includes updating the power artificial intelligence model in response to periodic update instructions.
[0014] Optionally, updating the power AI model includes: acquiring current resource availability information and the update resource requirements of the power AI model, and obtaining update control instructions based on the current resource availability information and the update resource requirements of the power AI model; wherein, the update control instructions include starting update and postponing update; and updating the power AI model according to the update control instructions.
[0015] Optionally, the updated power AI model includes: splitting the updated power AI model into several ordered task nodes, and executing the several ordered task nodes sequentially based on an automated scheduling method.
[0016] Optionally, the ordered task nodes include: training environment and resource preparation (first sequence), training data acquisition and versioning (second sequence), training data preprocessing (second sequence), model training (fourth sequence), model evaluation (fifth sequence), and model deployment (second sequence); wherein, training environment and resource preparation includes: obtaining a Docker image of the entire training environment of the power artificial intelligence model from a preset Docker image repository as the training environment; model evaluation includes: processing real-time input data by using a shadow model to process the currently trained power artificial intelligence model, obtaining various model evaluation indicators during the processing, and evaluating the model by deployment when all model evaluation indicators are not less than preset thresholds; model deployment includes: after deploying the currently trained power artificial intelligence model, retaining the original power artificial intelligence model for a preset time, and saving the currently trained power artificial intelligence model to the model version repository.
[0017] Optionally, it also includes: real-time acquisition of monitoring indicators of the power artificial intelligence model; wherein the monitoring indicators include service latency, service error rate, resource utilization rate and error rate; obtaining abnormal situations of the power artificial intelligence model based on the monitoring indicators of the power artificial intelligence model, and when the abnormal situation of the power artificial intelligence model is abnormal, performing version rollback of the power artificial intelligence model, and generating and sending a version rollback report.
[0018] Optionally, the abnormal situation of the power artificial intelligence model obtained from the monitoring indicators of the power artificial intelligence model includes: when the monitoring indicators of the power artificial intelligence model meet at least one of conditions 1 to 4, the abnormal situation of the power artificial intelligence model is abnormal; otherwise, the abnormal situation of the power artificial intelligence model is normal; wherein, condition 1: the 99th percentile of the service delay time sorted from smallest to largest exceeds the preset delay time threshold and continues for a first time; condition 2: the resource utilization rate exceeds the preset utilization rate threshold and continues for a second time; condition 3: the service error rate exceeds the preset error rate threshold and continues for a third time; condition 4: the increase value of the model error rate compared with the baseline error rate exceeds the preset increase value threshold and continues for a fourth time.
[0019] In a second aspect, the present invention provides an automatic update system for a power artificial intelligence model, comprising: a data acquisition module for acquiring the current input data drift degree and the current error rate increase rate of the power artificial intelligence model; an update indication module for determining an update indication for the power artificial intelligence model based on the current input data drift degree and the current error rate increase rate of the power artificial intelligence model; and an update control module for updating the power artificial intelligence model when the update indication of the power artificial intelligence model is to perform an update.
[0020] Optionally, the data acquisition module is specifically used to: obtain the data drift of each category feature data in the input data of the power artificial intelligence model using the following formula:
[0021] in, For the data drift of categorical feature data, The number of types of categorical feature data. For the training data, the first The proportion of class classification feature data The first in the current online service data The proportion of class classification feature data.
[0022] The data drift of each continuous feature data in the input data of the power artificial intelligence model is obtained by the following formula:
[0023] in, For continuous feature data, the data drift degree For continuous feature data in the training data in the th... The probability of a discrete interval. For continuous feature data in the current online service data, in the first... The probability of a discrete interval denoted as the number of discrete intervals.
[0024] The data drift of each category feature data and each continuous feature data in the input data of the power artificial intelligence model are weighted and superimposed based on the importance of the feature data to obtain the current input data drift of the power artificial intelligence model.
[0025] A sliding window monitoring method is used to obtain the current error rate of the power artificial intelligence model; the increase in the current error rate of the power artificial intelligence model compared with the benchmark error rate is taken as the error rate increase rate of the power artificial intelligence model.
[0026] Optionally, the update indication module is specifically used to: when the current input data drift of the power artificial intelligence model is not greater than a preset input data drift threshold, and the current error rate change rate of the power artificial intelligence model is not greater than a preset error rate change rate threshold, the update indication of the power artificial intelligence model is not to update; otherwise, the update indication of the power artificial intelligence model is to update.
[0027] Optionally, the update control module is further configured to: update the power artificial intelligence model in response to a periodic update command.
[0028] Optionally, the update control module is specifically used to: obtain current resource idle information and the update resource requirements of the power artificial intelligence model, and obtain update control instructions based on the current resource idle information and the update resource requirements of the power artificial intelligence model; wherein, the update control instructions include start update and postpone update; and update the power artificial intelligence model according to the update control instructions.
[0029] Optionally, the update control module is specifically used to: divide the updated power artificial intelligence model into several ordered task nodes, and execute several ordered task nodes sequentially based on an automated scheduling method.
[0030] Optionally, the ordered task nodes include: training environment and resource preparation (first sequence), training data acquisition and versioning (second sequence), training data preprocessing (second sequence), model training (fourth sequence), model evaluation (fifth sequence), and model deployment (second sequence); wherein, training environment and resource preparation includes: obtaining a Docker image of the entire training environment of the power artificial intelligence model from a preset Docker image repository as the training environment; model evaluation includes: processing real-time input data by using a shadow model to process the currently trained power artificial intelligence model, obtaining various model evaluation indicators during the processing, and evaluating the model by deployment when all model evaluation indicators are not less than preset thresholds; model deployment includes: after deploying the currently trained power artificial intelligence model, retaining the original power artificial intelligence model for a preset time, and saving the currently trained power artificial intelligence model to the model version repository.
[0031] Optionally, it also includes: an indicator acquisition module, used to acquire monitoring indicators of the power artificial intelligence model in real time; wherein, the monitoring indicators include service latency, service error rate, resource utilization rate and error rate; and a version rollback module, used to obtain abnormal conditions of the power artificial intelligence model based on the monitoring indicators of the power artificial intelligence model, and when the abnormal condition of the power artificial intelligence model is abnormal, to perform version rollback of the power artificial intelligence model, and to generate and send a version rollback report.
[0032] Optionally, the version rollback module is specifically used to: when the monitoring indicators of the power artificial intelligence model meet at least one of conditions 1 to 4, the abnormal situation of the power artificial intelligence model is abnormal; otherwise, the abnormal situation of the power artificial intelligence model is normal; wherein, condition 1: the 99th percentile of the service latency time sorted from smallest to largest exceeds the preset latency time threshold and continues for a first time; condition 2: the resource utilization rate exceeds the preset utilization rate threshold and continues for a second time; condition 3: the service error rate exceeds the preset error rate threshold and continues for a third time; condition 4: the increase in the model error rate compared to the baseline error rate exceeds the preset increase value threshold and continues for a fourth time.
[0033] In a third aspect, the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described automatic update method for an electric power artificial intelligence model.
[0034] In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described automatic update method for the power artificial intelligence model.
[0035] Compared with the prior art, the present invention has the following beneficial effects: This invention presents an automatic update method for power AI models. It uses the drift degree of the current input data and the current error rate increase rate of the power AI model as indicator data for model updates. By analyzing these indicators, it determines the update indication for the power AI model and then updates the model accordingly. This method enables autonomous updates to be initiated at an early stage of model performance degradation, reducing the response time from the occurrence of anomalies to the initiation of repair from days / weeks to minutes / hours. This significantly improves the agile response capability to changes in the power grid's operating status and effectively ensures the safe and stable operation of the power system. Compared to the traditional method that relies on manual judgment and typically only identifies performance degradation of the power AI model after business operations have been affected, this method achieves a significant reduction in response time and a fundamental improvement in operational efficiency. Attached Figure Description
[0036] Figure 1 This is a flowchart of the automatic update method for the power artificial intelligence model according to an embodiment of the present invention.
[0037] Figure 2 This is a block diagram of the automatic update system for the power artificial intelligence model according to an embodiment of the present invention. Detailed Implementation
[0038] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0039] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0040] The present invention will now be described in further detail with reference to the accompanying drawings: See Figure 1 In one embodiment of the present invention, an automatic update method for power artificial intelligence models is provided, which is applicable to power artificial intelligence models such as power meteorological forecasting artificial intelligence models, source-load forecasting artificial intelligence models, and power flow calculation artificial intelligence models in power systems, and can effectively reduce manual operation and maintenance costs.
[0041] Specifically, the automatic update method for the power artificial intelligence model of the present invention includes the following steps: S1: Obtain the current input data drift and the current error rate increase rate of the power artificial intelligence model.
[0042] S2: Determine the update indication for the power artificial intelligence model based on the current input data drift and the current error rate increase rate of the power artificial intelligence model.
[0043] S3: Update the power AI model when the update indicator for the power AI model is set to update.
[0044] This invention presents an automatic update method for power AI models. It uses the drift degree of the current input data and the current error rate increase rate of the power AI model as indicator data for model updates. By analyzing these indicators, it determines the update indication for the power AI model and then updates the model accordingly. This method enables autonomous updates to be initiated at an early stage of model performance degradation, reducing the response time from the occurrence of anomalies to the initiation of repair from days / weeks to minutes / hours. This significantly improves the agile response capability to changes in the power grid's operating status and effectively ensures the safe and stable operation of the power system. Compared to the traditional method that relies on manual judgment and typically only identifies performance degradation of the power AI model after business operations have been affected, this method achieves a significant reduction in response time and a fundamental improvement in operational efficiency.
[0045] In one possible implementation, obtaining the current input data drift of the power AI model includes: obtaining the data drift of each category feature data in the input data of the power AI model using the following formula:
[0046] in, For the data drift of categorical feature data, The number of types of categorical feature data. For the training data, the first The proportion of class classification feature data The first in the current online service data The proportion of class classification feature data.
[0047] The data drift of each continuous feature data in the input data of the power artificial intelligence model is obtained by the following formula:
[0048] in, For continuous feature data, the data drift degree For continuous feature data in the training data in the th... The probability of a discrete interval. For continuous feature data in the current online service data, in the first... The probability of a discrete interval denoted as the number of discrete intervals.
[0049] The data drift of each category feature data and each continuous feature data in the input data of the power artificial intelligence model are weighted and superimposed based on the importance of the feature data to obtain the current input data drift of the power artificial intelligence model.
[0050] Interpretive, when weighting based on the importance of feature data, the feature data here includes categorical feature data and continuous feature data, and the weights of the feature data can be set through model training or historical experience.
[0051] Interpretive data drift detection targets the input data of the power artificial intelligence model. For the categorical feature data in the input data, the PSI (Population Stability Index) is used to quantitatively calculate the data drift degree of the categorical feature data.
[0052] For interpreting continuous feature data in the input data, the KL divergence (Kullback-Leibler Divergence) is used to quantitatively calculate the data drift of continuous feature data.
[0053] For example, let's take an artificial intelligence model for power weather forecasting. An artificial intelligence model for power weather forecasting refers to a specialized model that uses artificial intelligence technology to accurately predict meteorological elements closely related to the operation of the power system, and then applies the prediction results to power system dispatching, operation and maintenance, and trading. Its input data generally includes temperature, wind speed, humidity, and weather type.
[0054] For categorical feature data, taking weather type as an example, if the proportions of sunny days, rainy days, and snowy days in the training data are 60%, 30%, and 10%, respectively, while the proportions of the three in the current online service data become 50%, 40%, and 10%, then the data drift of this weather type can be calculated using the above formula to be approximately 0.047.
[0055] For continuous feature data, taking temperature as an example, the temperature data is first converted into a discrete distribution by equal-frequency binning (e.g., dividing it into 10 intervals), and then the KL divergence between the training data and the current online service data is calculated.
[0056] In one possible implementation, obtaining the current error rate increase rate of the power artificial intelligence model includes: using a sliding window monitoring method to obtain the current error rate of the power artificial intelligence model; and taking the increase value of the current error rate of the power artificial intelligence model compared with the benchmark error rate as the error rate increase rate of the power artificial intelligence model.
[0057] Explanatoryly, the current error rate is the average error rate of the most recent few (e.g., 1000) service data points of the power AI model. By calculating the increase in the current error rate of the power AI model compared to the baseline error rate, the performance changes of the power AI model can be effectively perceived. The baseline error rate is the error rate when the power AI model was first launched.
[0058] In one possible implementation, determining the update instruction for the power AI model based on the current input data drift and the current error rate change rate of the power AI model includes: when the current input data drift of the power AI model is not greater than a preset input data drift threshold and the current error rate change rate of the power AI model is not greater than a preset error rate change rate threshold, the update instruction for the power AI model is not to update; otherwise, the update instruction for the power AI model is to update.
[0059] Interpretive, by monitoring changes in two dimensions in parallel—data drift (input data distribution) and error rate change (model output accuracy)—an update is determined to be required when either indicator exceeds a safety threshold, ensuring that the update mechanism is triggered in the early stages of substantial model degradation.
[0060] In one possible implementation, the automatic update method for the power artificial intelligence model further includes: updating the power artificial intelligence model in response to a periodic update instruction.
[0061] For example, a scheduled task scheduler can be used to pre-set monthly updates for the power AI model. This periodic, mandatory update mechanism effectively prevents the risk of slow performance degradation of the power AI model due to monitoring system underreporting or data drift that fails to reach thresholds for an extended period. By establishing a guaranteed baseline of regular updates, it ensures that the power AI model remains synchronized with the latest grid operating environment, thereby maintaining prediction accuracy and system stability in long-term operation.
[0062] In one possible implementation, updating the power AI model includes: acquiring current resource availability information and the update resource requirements of the power AI model, and obtaining update control instructions based on the current resource availability information and the update resource requirements of the power AI model; wherein the update control instructions include starting the update and postponing the update; and updating the power AI model according to the update control instructions.
[0063] The system interprets current resource availability information, such as the amount of free CPU and GPU resources, and combines this information with an analysis of the update resource requirements of the power AI model. If the current resource availability meets the update resource requirements of the power AI model, an update control command is generated to immediately initiate the update. Conversely, if the current resource availability does not meet the update resource requirements of the power AI model, an update control command is generated to postpone the update until the early morning.
[0064] In one possible implementation, the updated power AI model includes: splitting the updated power AI model into several ordered task nodes, and executing the several ordered task nodes sequentially based on an automated scheduling method.
[0065] For example, Apache Airflow (an open-source platform for programming, scheduling, and monitoring workflows) can be used as the workflow engine to break down the updating of the power AI model into several ordered task nodes and define dependencies through a directed acyclic graph to achieve automatic updates. This can reduce the human cost of model updates by more than 70% and make the process of each model update reproducible and the results traceable.
[0066] In one possible implementation, the ordered task nodes include: training environment and resource preparation (first sequence), training data acquisition and versioning (second sequence), training data preprocessing (second sequence), model training (fourth sequence), model evaluation (fifth sequence), and model deployment (second sequence).
[0067] The training environment and resource preparation includes: obtaining a Docker image containing the entire training environment of the power artificial intelligence model from a pre-set Docker image repository as the training environment.
[0068] Model evaluation includes: processing real-time input data by using a shadow model to process the currently trained power AI model, obtaining the evaluation metrics of each model during the processing, and conducting a deployment evaluation when all model evaluation metrics are not less than the preset threshold of each model evaluation metric.
[0069] Model deployment includes: after deploying the currently trained power AI model, retaining the original power AI model for a preset time, and saving the currently trained power AI model to the model version repository.
[0070] For interpretive purposes, the training environment and resource preparation are handled by encapsulating the entire training environment using Docker images. This typically includes a Python interpreter, system dependency libraries, deep learning frameworks, and custom code libraries. A centralized Docker image repository is maintained to store all Docker images. During resource preparation, computing resources can be dynamically requested and released on the Kubernetes cluster based on task priority and resource requirements.
[0071] Interpretive methods for training data acquisition and versioning can be used to pull data from pre-specified data sources and employ data versioning tools to create a unique version hash for the current dataset as a code version before training begins, associating it with the model version. Furthermore, the source of the data, the transformation process, and the final dataset version used for training can be recorded, forming a complete data genealogy.
[0072] In this implementation, the Docker image version is bound to the code version and data version to generate an independent model version of the power artificial intelligence model.
[0073] Interpretive preprocessing for training data, considering the temporal and multi-source characteristics of power data, can perform key steps such as data quality verification, outlier and missing value handling, and temporal feature construction. After feature selection and dimensionality reduction, standardization and encoding are performed. The entire process code can be encapsulated as a serializable preprocessor, which is then persistently saved after fitting to the training set. During online inference, the same version of the preprocessor is loaded to ensure complete consistency between the online and offline feature spaces, eliminating training and service bias.
[0074] For interpretable model training, the process typically involves loading a specified version of the baseline model and code from a model repository, launching the training task on allocated GPU / CPU resources, and recording all hyperparameters, environment information, and training metrics. The training code can be encapsulated as a standalone script that accepts command-line arguments, with all hyperparameters read from configuration files rather than hard-coded into the script. Furthermore, strategies such as Bayesian optimization and random search can be employed to find the optimal combination of hyperparameters within a given resource budget. Simultaneously, integration with MLflow (a machine learning lifecycle management platform) can automatically record hyperparameters, real-time training metric curves, generated model file paths, code versions, data versions, and training environment information for each trial to support subsequent analysis.
[0075] For interpretability, a multi-dimensional, hierarchical automated evaluation system can be employed for model evaluation to ensure the model's generalization ability and business value. In the offline phase, the model needs to be comprehensively evaluated on independent test sets, time-validation sets, and test sets constructed for special scenarios (such as extreme weather and holidays). Evaluation metrics include basic metrics such as accuracy, F1-Score (harmonic mean of precision and recall), AUC (Area Under the Curve, used to measure classification model performance), and MAE (Mean Absolute Error), as well as customized metrics linked to business performance. Furthermore, interpretability tools such as SHAP (SHapley Additive exPlanations) and LIME (Local Interpretable Model-agnostic Explanations) can be integrated for feature importance analysis to verify whether the model's decisions align with knowledge in the power industry.
[0076] For example, deployment evaluation can be added to the model evaluation process. This involves using a shadow model to process real-time input data on the currently trained power AI model. Specifically, the currently trained power AI model is deployed in a validation environment, receiving the exact same real-time input traffic as the current application model and making predictions. However, the prediction results are not returned to the user; they are only recorded. The performance of the currently trained power AI model is evaluated under realistic data distribution and traffic pressure. By comparing the prediction results with those of the current application model, reliable evidence of performance advantages is obtained. Ultimately, when all evaluation metrics of the currently trained power AI model are not lower than the preset thresholds for each metric, it can be used for production environment service deployment.
[0077] For interpretative purposes, models that pass evaluation can be converted to ONNX format to improve cross-framework compatibility. The model service on inference nodes can be updated on a rolling basis via Kubernetes, with older models retained for 10 minutes to ensure uninterrupted switching. Simultaneously, evaluated models can be saved to a model repository, recording training parameters, data snapshots, and evaluation reports; the retention period is typically set to one year.
[0078] Explanatoryly, through the above methods, the entire process of power AI model from data preparation, training, evaluation to deployment is automated, reducing the human cost of power AI model iteration by more than 70%, and the process of each iteration of power AI model is reproducible and the results are traceable.
[0079] In one possible implementation, the automatic update method for the power AI model further includes: acquiring monitoring indicators of the power AI model in real time; wherein the monitoring indicators include service latency, service error rate, resource utilization rate, and error rate; identifying abnormal situations of the power AI model based on the monitoring indicators, and when the abnormal situation of the power AI model is abnormal, performing a version rollback of the power AI model, and generating and sending a version rollback report.
[0080] For example, a Prometheus+Grafana architecture (a classic monitoring solution combining data capture, storage, and data visualization alerts) can be used to obtain real-time monitoring metrics of the power AI model in the following ways: 1. Embed a custom Python script probe to collect information such as service latency, service requests per second, and resource utilization every 30 seconds; 2. Pull real values from the actual observation system every hour, compare them with the predicted values, and calculate the real-time error rate; 3. Metric storage: Store the most recent 7 days of data locally through Prometheus (an open-source system monitoring and alerting toolkit that collects and stores time-series data periodically via pull), and archive long-term data to InfluxDB (an open-source time-series database designed to handle high write and query loads, often used to store large-scale metric data).
[0081] For example, the rollback of a power AI model includes the following steps: Step 1: The monitoring node sends a rollback command with details of the abnormal indicators; Step 2: The model version library is queried to obtain the model version with the highest evaluation score and no abnormal records in the past 3 months, i.e., the historical best model; Step 3: The Kubernetes API (Kubernetes Application Programming Interface) is called to gradually switch the traffic of the inference node to the historical best model through the Nginx load balancer; Step 4: After the switch is completed, the abnormal model is marked as pending analysis, and its inference log is saved for subsequent root cause localization; Step 5: An alarm email is sent to the operations and maintenance personnel, including the abnormal time, indicator change curve, and rollback results.
[0082] Based on this, when an online model malfunctions, it can automatically switch to the best historical version within 30 seconds, reducing potential business interruption time, ensuring service continuity, and improving business availability to 99.99%.
[0083] In one possible implementation, the step of determining the abnormal situation of the power artificial intelligence model based on the monitoring indicators of the power artificial intelligence model includes: when the monitoring indicators of the power artificial intelligence model meet at least one of conditions 1 to 4, the abnormal situation of the power artificial intelligence model is abnormal; otherwise, the abnormal situation of the power artificial intelligence model is normal; wherein, condition 1: the 99th percentile of the service delay time sorted from smallest to largest exceeds a preset delay time threshold and continues for a first time; condition 2: the resource utilization rate exceeds a preset utilization rate threshold and continues for a second time; condition 3: the service error rate exceeds a preset error rate threshold and continues for a third time; condition 4: the increase in the model error rate compared to the baseline error rate exceeds a preset increase value threshold and continues for a fourth time.
[0084] For example, condition 1 is: the 99th percentile of service latency sorted from smallest to largest exceeds 800ms and lasts for 5 minutes; condition 2 is: CPU / GPU utilization exceeds 95% and lasts for 10 minutes; condition 3 is: service error rate exceeds 5% and lasts for 1 minute; condition 4 is: the increase in model error rate compared to baseline error rate exceeds 0.03 and lasts for 24 hours.
[0085] Explanatory: if condition 1 is met, it indicates that the current power AI model is experiencing performance degradation; if condition 2 is met, it indicates that the current power AI model is experiencing resource overload; if condition 3 is met, it indicates that the current power AI model is experiencing service unavailability; if condition 4 is met, it indicates that the current power AI model is experiencing an error rate increase, requiring timely intervention and correction.
[0086] In another embodiment of the present invention, the specific process of the automatic update method of the power artificial intelligence model of the present invention is illustrated by taking the short-term load forecasting model of the power grid as an example.
[0087] Scenario: Historical load data simulation of a provincial power company, used for self-evolution of a deep learning model for 96-point load forecasting the following day. Result: A sudden and sustained high temperature caused a surge in air conditioning load, with its electricity consumption pattern significantly differing from the historical summer patterns in the training data. Real-time calculated indicators continuously exceeded limits, triggering the model update mechanism, generating a high-priority training task, and initiating model retraining. The new model was evaluated on multiple test sets, assessing its performance under real data distribution and flow pressure. The new model's average accuracy on this flow was significantly higher than the old model, and the flow was automatically switched to the new model. Two weeks after the full release of the new model, temperature data declined. Monitoring detected an increase in the new model's prediction error during this period, triggering an automatic rollback mechanism, successfully avoiding prediction failures due to abnormal weather.
[0088] The following are embodiments of the apparatus of the present invention, which can be used to execute embodiments of the method of the present invention. For details not disclosed in the apparatus embodiments, please refer to the embodiments of the method of the present invention.
[0089] See Figure 2 In another embodiment of the present invention, an automatic update system for a power artificial intelligence model is provided, which can be used to implement the above-mentioned automatic update method for a power artificial intelligence model. Specifically, the automatic update system for a power artificial intelligence model includes a data acquisition module, an update instruction module, and an update control module.
[0090] The data acquisition module is used to acquire the current input data drift and the current error rate increase rate of the power artificial intelligence model; the update indication module is used to determine the update indication of the power artificial intelligence model based on the current input data drift and the current error rate increase rate; and the update control module is used to update the power artificial intelligence model when the update indication of the power artificial intelligence model is to perform an update.
[0091] In one possible implementation, the data acquisition module is specifically used for: The data drift of each category feature data in the input data of the power artificial intelligence model is obtained by the following formula:
[0092] in, For the data drift of categorical feature data, The number of types of categorical feature data. For the training data, the first The proportion of class classification feature data The first in the current online service data The proportion of class classification feature data.
[0093] The data drift of each continuous feature data in the input data of the power artificial intelligence model is obtained by the following formula:
[0094] in, For continuous feature data, the data drift degree For continuous feature data in the training data in the th... The probability of a discrete interval. For continuous feature data in the current online service data, in the first... The probability of a discrete interval denoted as the number of discrete intervals.
[0095] The data drift of each category feature data and each continuous feature data in the input data of the power artificial intelligence model are weighted and superimposed based on the importance of the feature data to obtain the current input data drift of the power artificial intelligence model.
[0096] A sliding window monitoring method is used to obtain the current error rate of the power artificial intelligence model; the increase in the current error rate of the power artificial intelligence model compared with the benchmark error rate is taken as the error rate increase rate of the power artificial intelligence model.
[0097] In one possible implementation, the update indication module is specifically used to: when the current input data drift of the power artificial intelligence model is not greater than a preset input data drift threshold, and the current error rate change rate of the power artificial intelligence model is not greater than a preset error rate change rate threshold, the update indication of the power artificial intelligence model is not to update; otherwise, the update indication of the power artificial intelligence model is to update.
[0098] In one possible implementation, the update control module is further configured to: update the power artificial intelligence model in response to a periodic update command.
[0099] In one possible implementation, the update control module is specifically used to: obtain current resource idle information and the update resource requirements of the power artificial intelligence model, and obtain update control instructions based on the current resource idle information and the update resource requirements of the power artificial intelligence model; wherein, the update control instructions include start update and postpone update; and update the power artificial intelligence model according to the update control instructions.
[0100] In one possible implementation, the update control module is specifically used to: divide the updated power artificial intelligence model into several ordered task nodes, and execute several ordered task nodes sequentially based on an automated scheduling method.
[0101] In one possible implementation, the ordered task nodes include: a first-order training environment and resource preparation, a second-order training data acquisition and versioning, a second-order training data preprocessing, a fourth-order model training, a fifth-order model evaluation, and a second-order model deployment; wherein, the training environment and resource preparation includes: obtaining a Docker image of the entire training environment of the power artificial intelligence model from a preset Docker image repository as the training environment; the model evaluation includes: processing real-time input data by using a shadow model approach with the currently trained power artificial intelligence model, obtaining various model evaluation metrics during the processing, and evaluating the model by deployment when all model evaluation metrics are not less than preset thresholds; the model deployment includes: after deploying the currently trained power artificial intelligence model, retaining the original power artificial intelligence model for a preset time, and saving the currently trained power artificial intelligence model to a model version repository.
[0102] In one possible implementation, the system further includes: an indicator acquisition module for acquiring monitoring indicators of the power AI model in real time; wherein the monitoring indicators include service latency, service error rate, resource utilization rate, and error rate; and a version rollback module for obtaining abnormal conditions of the power AI model based on the monitoring indicators of the power AI model, and when the abnormal condition of the power AI model is abnormal, performing version rollback of the power AI model, and generating and sending a version rollback report.
[0103] In one possible implementation, the version rollback module is specifically used to: when the monitoring indicators of the power artificial intelligence model meet at least one of conditions 1 to 4, the abnormal situation of the power artificial intelligence model is abnormal; otherwise, the abnormal situation of the power artificial intelligence model is normal; wherein, condition 1: the 99th percentile of the service latency time sorted from smallest to largest exceeds the preset latency time threshold and continues for a first time; condition 2: the resource utilization rate exceeds the preset utilization rate threshold and continues for a second time; condition 3: the service error rate exceeds the preset error rate threshold and continues for a third time; condition 4: the increase in the model error rate compared to the baseline error rate exceeds the preset increase value threshold and continues for a fourth time.
[0104] All relevant content of each step involved in the aforementioned embodiments of the automatic update method for the power artificial intelligence model can be referenced to the functional description of the corresponding functional module of the automatic update system for the power artificial intelligence model in the embodiments of the present invention, and will not be repeated here.
[0105] The module division in this embodiment of the invention is illustrative and represents only one logical functional division. In actual implementation, other division methods may be used. Furthermore, the functional modules in the various embodiments of the invention can be integrated into a single processor, exist as separate physical entities, or be integrated into a single module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0106] In another embodiment of the present invention, a computer device is provided, comprising a processor and a memory. The memory stores a computer program, which includes program instructions. The processor executes the program instructions stored in the computer storage medium. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions in the computer storage medium to achieve a corresponding method flow or corresponding function. The processor described in this embodiment of the present invention can be used for the operation of an automatic update method for a power artificial intelligence model.
[0107] In another embodiment of the present invention, a storage medium is provided, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device used to store programs and data. It is understood that the computer-readable storage medium here can include both the built-in storage medium in the computer device and extended storage media supported by the computer device. The computer-readable storage medium provides storage space that stores the terminal's operating system. Furthermore, the storage space also stores one or more instructions suitable for loading and execution by a processor. These instructions can be one or more computer programs (including program code). It should be noted that the computer-readable storage medium here can be high-speed RAM or non-volatile memory, such as at least one disk storage device. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the automatic update method for the power artificial intelligence model in the above embodiments.
[0108] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0109] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0110] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0111] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0112] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for automatically updating a power artificial intelligence model, characterized in that, include: Obtain the current input data drift and current error rate increase rate of the power artificial intelligence model; Based on the current input data drift and the current error rate increase rate of the power artificial intelligence model, determine the update indication for the power artificial intelligence model; Update the power AI model when the update indicator is set to update.
2. The automatic update method for the power artificial intelligence model according to claim 1, characterized in that, The current input data drift and current error rate increase rate of the power artificial intelligence model include: The data drift of each category feature data in the input data of the power artificial intelligence model is obtained by the following formula: in, For the data drift of categorical feature data, The number of types of categorical feature data. For the training data, the first The proportion of class classification feature data The first in the current online service data The proportion of category-specific feature data; The data drift of each continuous feature data in the input data of the power artificial intelligence model is obtained by the following formula: in, For continuous feature data, the data drift degree For continuous feature data in the training data in the th... The probability of a discrete interval. For continuous feature data in the current online service data, in the first... The probability of a discrete interval The number of discrete intervals; The data drift of each category feature data and the data drift of each continuous feature data in the input data of the power artificial intelligence model are weighted and superimposed based on the importance of the feature data to obtain the current input data drift of the power artificial intelligence model. The current error rate of the power artificial intelligence model is obtained by using a sliding window monitoring method. The increase in the current error rate of the power AI model compared to the baseline error rate is taken as the error rate increase rate of the power AI model.
3. The automatic update method for the power artificial intelligence model according to claim 1, characterized in that, The step of determining the update indication for the power artificial intelligence model based on the current input data drift and the current error rate change rate includes: When the current input data drift of the power AI model is not greater than the preset input data drift threshold, and the current error rate change rate of the power AI model is not greater than the preset error rate change rate threshold, the update indication of the power AI model is not to update. Otherwise, the update instruction for the power AI model is to perform an update.
4. The automatic update method for the power artificial intelligence model according to claim 1, characterized in that, Also includes: The power AI model is updated in response to periodic update commands.
5. The automatic update method for the power artificial intelligence model according to claim 1, characterized in that, The updated power AI model includes: The system obtains current resource availability information and the update resource requirements of the power AI model, and generates update control instructions based on these information. The update control instructions include starting the update and postponing the update. The power AI model is updated based on the update control instructions.
6. The automatic update method for the power artificial intelligence model according to claim 1, characterized in that, The updated power AI model includes: The updated power AI model is broken down into several ordered task nodes, and these ordered task nodes are executed sequentially based on an automated scheduling method.
7. The automatic update method for the power artificial intelligence model according to claim 6, characterized in that, The ordered task nodes include: the first sequence of training environment and resource preparation, the second sequence of training data acquisition and versioning, the second sequence of training data preprocessing, the fourth sequence of model training, the fifth sequence of model evaluation, and the second sequence of model deployment. The training environment and resource preparation includes: obtaining a Docker image of the entire training environment that encapsulates the power artificial intelligence model from a pre-set Docker image repository as the training environment; Model evaluation includes: processing real-time input data by using a shadow model to process the currently trained power AI model, obtaining the evaluation metrics of each model during the processing, and conducting a deployment evaluation when all model evaluation metrics are not less than the preset threshold of each model evaluation metric. Model deployment includes: after deploying the currently trained power AI model, retaining the original power AI model for a preset time, and saving the currently trained power AI model to the model version repository.
8. The automatic update method for the power artificial intelligence model according to claim 1, characterized in that, Also includes: Real-time acquisition of monitoring indicators from the power AI model; these indicators include service latency, service error rate, resource utilization, and error rate. Based on the monitoring indicators of the power AI model, abnormal situations of the power AI model are identified. When an abnormal situation of the power AI model is deemed abnormal, the version of the power AI model is rolled back, and a version rollback report is generated and sent.
9. The automatic update method for the power artificial intelligence model according to claim 8, characterized in that, The abnormal situations of the power artificial intelligence model obtained from the monitoring indicators of the power artificial intelligence model include: When the monitoring indicators of the power artificial intelligence model meet at least one of conditions 1 to 4, the abnormal situation of the power artificial intelligence model is abnormal; otherwise, the abnormal situation of the power artificial intelligence model is normal. Among them, condition 1: the 99th percentile of the service latency time sorted from smallest to largest exceeds the preset latency time threshold and continues for the first time; condition 2: the resource utilization rate exceeds the preset utilization rate threshold and continues for the second time; condition 3: the service error rate exceeds the preset error rate threshold and continues for the third time; condition 4: the increase in the model error rate compared to the baseline error rate exceeds the preset increase value threshold and continues for the fourth time.
10. An automatic update system for an artificial intelligence model of electricity, characterized in that, include: The data acquisition module is used to acquire the current input data drift and the current error rate increase rate of the power artificial intelligence model; The update instruction module is used to determine the update instruction of the power artificial intelligence model based on the current input data drift degree and the current error rate increase rate of the power artificial intelligence model. The update control module is used to update the power artificial intelligence model when the update indication of the power artificial intelligence model is to be updated.
11. The automatic update system for the power artificial intelligence model according to claim 10, characterized in that, The data acquisition module is specifically used for: The data drift of each category feature data in the input data of the power artificial intelligence model is obtained by the following formula: in, For the data drift of categorical feature data, The number of types of categorical feature data. For the training data, the first The proportion of class classification feature data The first in the current online service data The proportion of category-specific feature data; The data drift of each continuous feature data in the input data of the power artificial intelligence model is obtained by the following formula: in, For continuous feature data, the data drift degree For continuous feature data in the training data in the th... The probability of a discrete interval. For continuous feature data in the current online service data, in the first... The probability of a discrete interval The number of discrete intervals; The data drift of each category feature data and the data drift of each continuous feature data in the input data of the power artificial intelligence model are weighted and superimposed based on the importance of the feature data to obtain the current input data drift of the power artificial intelligence model. The current error rate of the power artificial intelligence model is obtained by using a sliding window monitoring method. The increase in the current error rate of the power AI model compared to the baseline error rate is taken as the error rate increase rate of the power AI model.
12. The automatic update system for the power artificial intelligence model according to claim 10, characterized in that, The update indication module is specifically used for: When the current input data drift of the power AI model is not greater than the preset input data drift threshold, and the current error rate change rate of the power AI model is not greater than the preset error rate change rate threshold, the update indication of the power AI model is not to update. Otherwise, the update instruction for the power AI model is to perform an update.
13. The automatic update system for the power artificial intelligence model according to claim 10, characterized in that, The update control module is also used for: The power AI model is updated in response to periodic update commands.
14. The automatic update system for the power artificial intelligence model according to claim 10, characterized in that, The update control module is specifically used for: The system obtains current resource availability information and the update resource requirements of the power AI model, and generates update control instructions based on these information. The update control instructions include starting the update and postponing the update. The power AI model is updated based on the update control instructions.
15. The automatic update system for the power artificial intelligence model according to claim 10, characterized in that, The update control module is specifically used for: The updated power AI model is broken down into several ordered task nodes, and these ordered task nodes are executed sequentially based on an automated scheduling method.
16. The automatic update system for the power artificial intelligence model according to claim 15, characterized in that, The ordered task nodes include: the first sequence of training environment and resource preparation, the second sequence of training data acquisition and versioning, the second sequence of training data preprocessing, the fourth sequence of model training, the fifth sequence of model evaluation, and the second sequence of model deployment. The training environment and resource preparation includes: obtaining a Docker image of the entire training environment that encapsulates the power artificial intelligence model from a pre-set Docker image repository as the training environment; Model evaluation includes: processing real-time input data by using a shadow model to process the currently trained power AI model, obtaining the evaluation metrics of each model during the processing, and conducting a deployment evaluation when all model evaluation metrics are not less than the preset threshold of each model evaluation metric. Model deployment includes: after deploying the currently trained power AI model, retaining the original power AI model for a preset time, and saving the currently trained power AI model to the model version repository.
17. The automatic update system for the power artificial intelligence model according to claim 10, characterized in that, Also includes: The indicator acquisition module is used to acquire monitoring indicators of the power artificial intelligence model in real time; among them, the monitoring indicators include service latency, service error rate, resource utilization, and error rate. The version rollback module is used to identify abnormal situations in the power AI model based on the monitoring indicators of the power AI model, and when the abnormal situation of the power AI model is abnormal, to roll back the version of the power AI model, and generate and send a version rollback report.
18. The automatic update system for the power artificial intelligence model according to claim 17, characterized in that, The version rollback module is specifically used for: When the monitoring indicators of the power artificial intelligence model meet at least one of conditions 1 to 4, the abnormal situation of the power artificial intelligence model is abnormal; otherwise, the abnormal situation of the power artificial intelligence model is normal. Among them, condition 1: the 99th percentile of the service latency time sorted from smallest to largest exceeds the preset latency time threshold and continues for the first time; condition 2: the resource utilization rate exceeds the preset utilization rate threshold and continues for the second time; condition 3: the service error rate exceeds the preset error rate threshold and continues for the third time; condition 4: the increase in the model error rate compared to the baseline error rate exceeds the preset increase value threshold and continues for the fourth time.
19. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the automatic update method for the power artificial intelligence model as described in any one of claims 1 to 9.
20. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the automatic update method for the power artificial intelligence model as described in any one of claims 1 to 9.