Adaptive prediction correction method and system based on quality assessment and retrieval enhancement

By constructing a historical sequence knowledge base and adaptive weight adjustment, the reliability of existing prediction methods under complex dynamic disturbances is solved, and the stability and accuracy of power load and wind and solar power prediction are improved.

CN122175064APending Publication Date: 2026-06-09SHANDONG ELECTRIC POWER ENG CONSULTING INST CORP

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANDONG ELECTRIC POWER ENG CONSULTING INST CORP
Filing Date
2026-02-25
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing forecasting methods lack reliability and stability when faced with complex dynamic disturbances, especially in power load and wind and solar power forecasting. Existing methods struggle to effectively handle rare or anomalous patterns and lack real-time correction mechanisms.

Method used

An adaptive prediction correction method based on quality assessment and retrieval enhancement is adopted. By constructing a historical sequence knowledge base, a pre-trained basic model is used for preliminary prediction. Adaptive weights are generated based on similarity calculation and quality assessment to dynamically adjust the correction strategy of the prediction results.

Benefits of technology

It improves the stability and accuracy of the prediction system under complex perturbations, and can enhance the robustness and accuracy of predictions without modifying the original model, especially significantly improving prediction performance when dealing with rare or anomalous patterns.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122175064A_ABST
    Figure CN122175064A_ABST
Patent Text Reader

Abstract

This invention belongs to the field of power forecasting technology and provides an adaptive prediction correction method and system based on quality assessment and retrieval enhancement. It extracts sample pairs from selected data sources, integrates and stores all extracted sample pairs to form a historical sequence knowledge base. In response to the current input time series data, a preliminary prediction result is obtained using a pre-trained basic model. Then, based on similarity calculation, a retrieval is performed from the historical sequence knowledge base, and the retrieval results are weighted and averaged to obtain a retrieval-enhanced prediction result. The reliability of the prediction result is evaluated, and adaptive weights are generated. Based on the adaptive weights, the preliminary prediction result from the pre-trained basic model, and the retrieval-enhanced prediction result, prediction correction is performed. This invention significantly improves the overall stability, robustness, and prediction accuracy of the prediction system when facing complex real-world disturbances.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of power prediction technology, specifically relating to an adaptive prediction correction method and system based on quality assessment and retrieval enhancement. Background Technology

[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.

[0003] Time series forecasting is a crucial research area in data science and artificial intelligence, with wide applications in key fields such as power system load forecasting, renewable energy wind and solar power forecasting, and electricity price forecasting. With advancements in deep learning technology, neural network-based forecasting models have achieved significant improvements in accuracy. However, the reliability and stability of forecast results still face serious challenges in these practical applications. Specifically, while most time series instances exhibit similar numerical patterns, some instances display rare or anomalous behaviors (such as sudden load changes or intermittent, drastic fluctuations in wind and solar power). Mainstream forecasting methods often struggle to effectively model these special instances, leading to inaccurate or even unreliable forecast results.

[0004] The reason for this predicament is that existing mainstream prediction methods mainly rely on learning general statistical patterns from large-scale data, and have limited ability to generalize to "long-tail" or "abnormal" instances outside the training data distribution.

[0005] In practical scenarios where high reliability is required, such as power load forecasting and wind and solar power generation forecasting, current technical solutions have the following two main limitations: (1) Insufficient utilization of prediction quality assessment results. The assessment results (such as confidence intervals) generated by existing methods are usually only used for ex-post risk warnings and fail to be transformed into decision signals that guide prediction correction in real time and directly. This results in the system being unable to proactively trigger effective enhancement or correction mechanisms when prediction reliability is low; (2) Rigid use of historical data and retrieval enhancement strategies. To compensate for the model’s inadequacy in modeling rare patterns, retrieval enhancement techniques have been introduced, which aim to assist prediction by finding historically similar sequences.

[0006] However, existing methods often employ fixed or simple similarity-based weights to statically fuse retrieval results with the original predictions. This strategy fails to consider the real-time prediction quality of the current instance: when the model's own predictions are highly reliable, over-reliance on external retrieval may introduce noise; conversely, when the model's prediction uncertainty is high, it may not be able to fully leverage historical similarity patterns. This disconnect between the fusion strategy and real-time quality status severely limits the practical effectiveness of retrieval enhancement, making it poorly suited for handling complex dynamics such as sudden load changes and intermittent fluctuations in wind and solar power. Summary of the Invention

[0007] To address the aforementioned problems, this invention proposes an adaptive prediction correction method and system based on quality assessment and retrieval enhancement. This invention significantly improves the overall stability, robustness, and prediction accuracy of the prediction system when facing complex real-world disturbances.

[0008] According to some embodiments, the present invention adopts the following technical solution: An adaptive prediction and correction method based on quality assessment and retrieval enhancement includes the following steps: Extract sample pairs consisting of historical observation sequences and their corresponding subsequent real sequences from the selected data sources, integrate and store all extracted sample pairs to form a historical sequence knowledge base; In response to the current input time series data, the pre-trained base model is used to process it to obtain preliminary prediction results; In response to the current input time series data, based on similarity calculation, the K most similar historical sequence segments and their corresponding subsequent real sequences are retrieved from the historical sequence knowledge base. The retrieval results are then weighted and averaged to obtain the retrieval-enhanced prediction results. Assess the reliability of the prediction results and generate adaptive weights based on the reliability; Based on the adaptive weights, as well as the preliminary prediction results from the pre-trained base model and the retrieval-enhanced prediction results, prediction correction is performed.

[0009] As an alternative implementation, the length of the historical observation sequence is a predefined observation window length T, which includes all or part of the features of the time series at T consecutive time points; the length of the subsequent real sequence is a predefined prediction window length L, which includes the real values ​​of the target variable to be predicted at L future time points.

[0010] As an alternative implementation, during the process of integrating and storing all extracted sample pairs, the historical observation sequence is used as a searchable key, and the corresponding subsequent real sequence is stored as a reference value to support subsequent fast retrieval operations based on sequence similarity.

[0011] As an optional implementation, the process of obtaining the pre-trained base model includes: acquiring time series data, preprocessing it, and then dividing it into a training set and a test set; A time series prediction model is selected as the base model, and the base model is trained using the training set and tested using the test set until the testing requirements are met, thus obtaining the pre-trained base model.

[0012] As an alternative implementation, the time series data includes, but is not limited to, at least one of power load data, power data, or electricity price data.

[0013] As an alternative implementation, in response to the current input time series data, based on similarity calculation, the process of retrieving the K most similar historical sequence segments and their corresponding subsequent real sequences from the historical sequence knowledge base, and then performing a weighted average of the retrieval results to obtain the retrieval-enhanced prediction result is implemented by a retrieval enhancement module. The retrieval enhancement module includes a similarity retrieval unit and a weighted fusion unit. The similarity retrieval unit is used to retrieve the K most similar historical sequence segments and their corresponding subsequent real sequences from the historical sequence knowledge base based on the similarity calculation between the current input sequence and the historical sequences. The weighted fusion unit is used to normalize the similarity into weight coefficients and calculate the retrieval-enhanced prediction result through a weighted average.

[0014] As an alternative implementation, the process of evaluating the reliability of the prediction results and generating adaptive weights based on the reliability is implemented by a quality assessment module, which includes: The joint feature encoding unit receives the current sequence, the preliminary prediction sequence generated by the pre-trained model, and a learnable channel indicator. It maps the three to the same feature space through a linear projection layer and concatenates them to obtain the primary fusion feature. Then, it performs nonlinear transformation and fusion on the primary fusion feature through at least one fully connected layer and a nonlinear activation function to finally output the joint feature. An error estimation signal generation unit is used to receive the primary fusion features, learn and output a quantized error estimation signal by modeling the dependencies within the sequence and across feature dimensions, so as to characterize the estimation of the potential error of the current preliminary prediction result. An adaptive weight calculation unit is used to dynamically calculate two sets of fusion weights based on the error estimation signal, joint features, and retrieval similarity information through a gated weight generation network. The weight α is used to adjust the degree of dependence on the preliminary prediction result, and the weight β is used to adjust the degree of dependence on the retrieval-enhanced prediction result.

[0015] As a further defined implementation, the adaptive weight calculation unit is configured to concatenate the joint features and the error estimation signal into a gated network, which consists of a fully connected layer, a GELU activation function, a linear layer, and a Sigmoid function layer connected in series to generate an initial gate value; Using the generated initial gating values, the joint features are differentially modulated. The first gating signal is multiplied by the joint features to obtain the modulation features used to predict the weight α. The second gating signal is multiplied by the joint features and then added to the retrieval similarity to obtain the modulation features used to predict the weight β. The modulated features are input into two parallel weight prediction subnetworks, each consisting of a linear layer and a sigmoid function layer, to generate the original weights. A trainable coordination parameter is then introduced to scale the original weights. The scaled weights are then normalized to ensure that their sum is 1, forming the final probabilistic weights α and β used for fusion.

[0016] As an alternative implementation, the prediction correction process based on the adaptive weights, the preliminary prediction results from the pre-trained base model, and the retrieval enhancement prediction results includes: performing prediction correction based on the adaptive fusion weights α and β from the quality assessment module, the preliminary prediction results from the pre-trained base model, and the retrieval enhancement prediction results from the retrieval enhancement module, using the following formula: ; In the formula, To finally correct the prediction results, These are the preliminary prediction results from the pre-trained model. To enhance the prediction results for retrieval.

[0017] As an alternative implementation, the method further includes the following steps: constructing a composite loss function and training the parameters of the quality assessment module, the retrieval enhancement module, and the pre-trained base model to minimize the prediction error; the composite loss function consists of prediction loss and quality assessment loss. The current input time series data is processed using the trained quality assessment module, retrieval enhancement module, and pre-trained base model to obtain the final prediction result.

[0018] An adaptive prediction and correction system based on quality assessment and retrieval enhancement includes: The historical sequence knowledge base construction module is configured to extract sample pairs consisting of historical observation sequences and their corresponding subsequent real sequences from selected data sources, integrate and store all extracted sample pairs to form a historical sequence knowledge base; The base model prediction module is configured to respond to the current input time series data by processing it with a pre-trained base model to obtain preliminary prediction results. The retrieval enhancement module is configured to, in response to the current input time series data, retrieve the K most similar historical sequence segments and their corresponding subsequent real sequences from the historical sequence knowledge base based on similarity calculation, and perform a weighted average of the retrieval results to obtain the retrieval enhancement prediction result; The quality assessment module is configured to evaluate the reliability of the prediction results and generate adaptive weights based on the reliability. The prediction correction module is configured to perform prediction correction based on the adaptive weights, as well as the preliminary prediction results from the pre-trained base model and the retrieval-enhanced prediction results.

[0019] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention can be seamlessly integrated into existing forecasting systems such as power load forecasting and wind and solar power forecasting in a non-intrusive manner, with low implementation cost and strong versatility.

[0020] This invention innovatively uses real-time quality assessment signals as the core decision-making basis for fusion strategies, enabling the system to dynamically adjust its reliance on its own prediction results and external retrieval information based on the current reliability of the prediction.

[0021] This invention improves prediction accuracy and robustness without modifying the original prediction model by introducing an adaptive fusion mechanism guided by quality assessment.

[0022] When dealing with rare, anomalous, or out-of-distribution instances in training data, such as sudden spikes in load or precipitous drops in wind and solar power caused by extreme weather, this invention can automatically trigger a more proactive retrieval enhancement and correction mechanism through quality assessment. This effectively compensates for the insufficient generalization ability of mainstream models in such scenarios and significantly improves the overall stability, robustness, and prediction accuracy of the prediction system when facing complex real-world disturbances.

[0023] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0024] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.

[0025] Figure 1 This is a flowchart of an adaptive prediction correction method in one embodiment; Figure 2 This is a schematic diagram of the structure of the quality assessment module in one embodiment; Figure 3This is a comparison chart of the prediction results of LSTM-base and QA-LSTM models in one embodiment, where (a) and (b) are comparison charts of the prediction results on different random test samples, respectively. Figure 4 This is a comparison chart of the prediction results of Transformer-base and QA-Transformer models in one embodiment, where (a) and (b) are comparison charts of the prediction results on different random test samples, respectively. Detailed Implementation

[0026] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0027] It should be noted that the following detailed description is illustrative and intended to provide further explanation of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0028] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.

[0029] Where there is no conflict, the embodiments and features described in this application may be combined with each other.

[0030] Example 1 To overcome the limitations of existing prediction methods in generalizing to rare or anomalous time series patterns, and the resulting large fluctuations in prediction reliability, this embodiment proposes an adaptive prediction correction method based on quality assessment and retrieval enhancement, such as... Figure 1 As shown, the specific steps are as follows: Step 1: Data acquisition and preprocessing.

[0031] This embodiment uses electricity load forecasting as an example for illustration. It employs a measured data set of the power system in a certain area from January 1, 2006 to December 31, 2010, with a time resolution of 30 minutes. The original data contains several load-related features, including dry-bulb temperature, wet-bulb temperature, dew point temperature, humidity, electricity price, and the target variable to be predicted—the electricity load value.

[0032] Of course, in other scenarios, such as when applied to predicting the power of new energy wind and solar power, several historical data such as new energy wind and solar power, meteorological data, sunshine data, temperature, and humidity can be obtained.

[0033] When applied to electricity price forecasting, several of the following can be obtained: historical electricity price data, load data, and environmental data. This invention does not exhaustively list all possibilities.

[0034] First, the data is cleaned to remove potential missing and outlier values. Then, to eliminate the impact of differences in feature units on model training, all features are normalized. The normalization uses a min-max scaling method, with the following formula:

[0035] In the formula, x is the original feature value, and min and max are the minimum and maximum values, respectively. These are the normalized feature values. Subsequently, in this embodiment, the entire dataset is divided into a training set and a test set in an 8:2 ratio. Step 2: Base Model Selection and Pre-training. Theoretically, any time series prediction model (such as LSTM, TCN, etc.) can be selected as the base model, and the base model can be trained using the training set to obtain the pre-trained base model.

[0036] To demonstrate the model independence and plug-and-play nature of the proposed correction framework, this embodiment selects two structurally representative time-series prediction models as the base models for experiments: Long Short-Term Memory (LSTM) networks and Transformer encoders. The input and output lengths of both models are set to 96 and 48, respectively, meaning that historical 48-hour data is used to predict the load value for the next 24 hours.

[0037] For the LSTM model, this embodiment uses a two-layer LSTM network with a hidden layer dimension of 128. A dropout layer is included between the two layers with a dropout rate of 0.1. The hidden state at the last time step is mapped to a 48-dimensional output vector through a fully connected layer. For the Transformer base model, this embodiment uses a standard encoder structure. The input sequence is first passed through a linear projection layer to increase the feature dimension to the model dimension (64 in this embodiment), and then a learnable positional encoding is added. The encoder consists of two layers, each containing a multi-head self-attention mechanism (4 heads) and a feedforward network (128 intermediate dimensions). The encoder output is average-pooled over time and then passed through a linear prediction head to obtain a 48-dimensional output vector. During training, the mean squared error (MSE) loss function is used for both models, the optimizer is Adam, the initial learning rate is set to 0.001, and the maximum training epochs are set to 200. After training, two pre-trained base models are obtained, denoted as LSTM-base and Transformer-base, respectively.

[0038] Step 3: Construction of the Historical Sequence Knowledge Base. In this embodiment, the historical sequence knowledge base is entirely constructed from the training set. Sample pairs consisting of historical observation sequences and their corresponding subsequent real sequences can be extracted from the training set. The length of the historical observation sequence is a predefined observation window length T, containing all features of the time series at T consecutive time points; the length of the subsequent real sequence is a predefined prediction window length L, containing the true values ​​of the target variable to be predicted at L future time points.

[0039] The generation of the sample pairs can be achieved by using a sliding window method to traverse the entire training set time series. The settings of the observation window length T and the prediction window length L are consistent with the input and output length requirements of the selected base model.

[0040] In this embodiment, the observation window length T is set to 96, and the prediction window length L is set to 48. Finally, all extracted sample pairs are stored to form the historical sequence knowledge base. During storage, the historical observation sequence is used as a searchable "key," and the corresponding subsequent real sequence is used as a reference "value" to support subsequent fast retrieval operations based on sequence similarity.

[0041] The above embodiments describe the specific process of constructing a knowledge base based on a training set. It is understood that the data source for constructing the historical sequence knowledge base described in this invention is not limited to this. Depending on the actual application scenario, the knowledge base can also be constructed wholly or partially from other related historical time series datasets, or by fusing multiple datasets, with the sample pair extraction and storage methods being the same as in the above embodiments.

[0042] Step 4: Construct the retrieval enhancement module. This module consists of a similarity retrieval unit and a weighted fusion unit. The similarity retrieval unit calculates the similarity between the current input sequence and historical sequences, retrieving the K most similar historical sequence segments and their corresponding subsequent real sequences from the historical sequence knowledge base. The value of K can be set according to the actual task requirements and the size of the knowledge base; in this embodiment, K is 5. Furthermore, this embodiment uses cosine similarity for similarity calculation, and its calculation formula is as follows:

[0043] In the formula Given the current input sequence, For historical observation sequences in the knowledge base, This represents the similarity between the current sequence and historical observed sequences. After calculation, the K most similar historical sequences and their corresponding subsequent true values ​​are retrieved. and the corresponding similarity .

[0044] In the weighted fusion unit, the similarity is first normalized into weight coefficients using the softmax function. :

[0045] Then, the retrieval-enhanced prediction results are calculated using a weighted average formula. :

[0046] The similarity metric described in this invention can also be implemented using other algorithms capable of measuring the shape or distance between sequences, such as Dynamic Time Warping (DTW) distance, Euclidean distance, etc. The corresponding distance values ​​need to be converted to similarity values ​​before similar normalization and weighted fusion can be performed. The core of the retrieval enhancement module lies in obtaining historical references using similarity retrieval and generating retrieval enhancement prediction results through weighted fusion. The specific similarity metric and weighted fusion strategy can be selected according to the actual application scenario.

[0047] Step 5: Construct the quality assessment module. This module is a learnable neural network whose function is to evaluate the reliability of the initial prediction results and dynamically generate adaptive weights for correcting the fusion. Figure 2 This is a structural diagram of the quality assessment model. This module consists of a joint feature encoding unit, an error estimation signal generation unit, and an adaptive weight calculation unit.

[0048] For the joint feature encoding unit, the current sequence, the preliminary prediction sequence generated by the pre-trained base model, and a learnable channel indicator are first projected onto the same feature space through a linear layer and then concatenated to obtain the primary fusion features. Subsequently, the initial fusion features are nonlinearly transformed and fused using a feature encoding network to finally output the joint features. The feature encoding network described in this embodiment is composed of a first linear layer, a first GELU layer, a second linear layer, and a second GELU layer connected in series.

[0049] For the error estimation signal generation unit, the primary fusion features are... The input error estimation signal generation unit learns and outputs a quantized error estimation signal Q through a sequence dependency modeling network. This signal represents the estimation of the potential error of the current preliminary prediction result. The error estimation signal generation unit is composed of a multi-head self-attention layer, a normalization layer, a linear layer, and a GELU layer connected in sequence.

[0050] For the adaptive weight calculation unit, this unit is based on the error estimation signal Q and joint features. The system retrieves similarity information (sims) and dynamically calculates two sets of fusion weights (denoted as α and β) through a gated weight generation network. Weight α controls the dependence on the initial prediction results, while weight β controls the dependence on the retrieval-enhanced prediction results.

[0051] The weights are calculated as follows: First, the joint features are... The error estimation signal Q is concatenated with the input to a gated network. This network consists of a fully connected layer, a GELU activation function, a linear layer with an output dimension of 2, and a sigmoid function layer, generating the initial gate value. and ):

[0052] In the formula, W1, b1, W2, and b2 are learnable parameters. This indicates a splicing operation.

[0053] Secondly, using the generated initial gating values, the joint features are respectively... Differential modulation is performed: the first gated signal is multiplied by the joint feature to obtain the modulation feature specifically used for predicting the weight α. The second-gated signal is multiplied by the joint feature and then added to the retrieval similarity to obtain the modulation feature specifically used for predicting the weight β. The calculation formula is as follows:

[0054]

[0055] In the formula For joint features, sims represents the retrieved similarity information; Subsequently, the modulated features are input into two parallel weight prediction subnetworks, each consisting of a linear layer with an output dimension of 1 and a sigmoid function layer, to generate the original weights. and ;

[0056] In the formula W α and W β Let b be the weight matrix of the linear layer. α and b β This is the corresponding bias.

[0057] Then, a trainable coordination parameter w is introduced to scale the original weights, ensuring that the system can learn the overall balance tendency between the weights. The calculation formula is as follows:

[0058]

[0059] in and These are the scaled weight coefficients; finally, the scaled weights are normalized to ensure their sum is 1, forming the final probabilistic weights α and β used for fusion:

[0060]

[0061] The quality assessment module enables real-time quality assessment of the prediction results and generates adaptive fusion weights accordingly, which constitute the core intelligent unit for implementing correction decisions in this invention. Step 6: Based on the adaptive fusion weights α and β from the quality assessment module, the preliminary prediction results from the pre-trained base model, and the retrieval enhancement prediction results from the retrieval enhancement module, perform prediction correction. The formula is as follows:

[0062] In the formula To finally correct the prediction results, These are preliminary prediction results from the pre-trained base model. To enhance the prediction results for retrieval; Step 7: Construct a composite loss function and train the parameters of the quality assessment module, retrieval enhancement module, and pre-trained base model. The composite loss function consists of prediction loss. and quality assessment loss The overall goal of this system is to minimize the final prediction error and ensure the accuracy of the quality assessment signal.

[0063] Where the prediction loss is the final corrected prediction result. Compared with the true value The error between these values ​​is used to optimize the output accuracy of the entire model. The calculation formula is as follows:

[0064] In the formula, n is the number of samples. To predict losses.

[0065] The quality assessment loss is the actual error between the error estimate signal Q output by the quality assessment module and the preliminary prediction result. The error between the two values ​​is used to guide and constrain the learning of the quality assessment module, ensuring that its output quantized signal approximates the true prediction error, thereby guaranteeing the reliability and interpretability of the generated adaptive fusion weights. The calculation formula is as follows:

[0066] Among them, actual error Based on preliminary forecast results Compared with the true value The calculation shows that:

[0067] The expression for the composite loss function is:

[0068] In the formula To balance the weighting coefficients of the two losses, the backpropagation algorithm is used to minimize them. This enables end-to-end collaborative optimization of all trainable parameters. In this embodiment... The maximum training epoch for corrected prediction is set to 1, the learning rate is set to 0.001, the maximum training epoch for corrected prediction is set to 200, and the learning rate is set to 0.001. In this embodiment, the LSTM and Transformer models that combine the quality assessment and retrieval enhancement modules are denoted as QA-LSTM and QA-Transformer.

[0069] Figure 3 The graph compares the prediction results of LSTM-base and QA-LSTM on two random test samples. It shows that both models can capture the basic trend of load changes, but the prediction curve of the QA-LSTM model fits the actual value more closely, especially in the fluctuation range and at the peak, initially confirming the effectiveness of the correction mechanism of this invention. To further objectively and comprehensively evaluate the performance, we calculated the mean absolute error (MAPE) and coefficient of determination (R²) of the two models on the entire test set. 2 The calculation formula is as follows:

[0070]

[0071] In the formula, is The true value For predicted values, denoted as MAPE, where n is the sample size. A smaller MAPE indicates higher prediction accuracy. 2 The closer the value is to 1, the better the model's fit. The results are shown in Table 1. The MAPE of the QA-LSTM model on the test set is lower than that of the LSTM-base model, while the R-value of the QA-LSTM model is lower. 2 It is closer to 1 than LSTM-base. These results demonstrate that the quality assessment and adaptive retrieval enhancement strategy proposed in this invention can effectively improve the accuracy and stability of the prediction model.

[0072] To verify that the quality assessment and adaptive correction framework proposed in this invention has universality independent of the base prediction model, the framework was further combined with the Transformer architecture to construct the QA-Transformer model, which was then compared with the Transformer-base model. Figure 4 The chart compares the prediction results of QA-Transformer and Transformer-base on two random test samples. Although the Transformer-base model has already achieved better prediction results than LSTM-base due to its powerful global dependency modeling ability, the prediction curve of the QA-Transformer model integrating the correction framework of this invention shows better tracking ability and smaller deviation from the true value. Quantitative evaluation on the test set further confirms the above results. As shown in Table 1, QA-Transformer performs better than LSTM-base in terms of MAPE and R... 2 In terms of metrics, it outperforms the Transformer-based model. Overall Figure 3 , Figure 4 As shown in Table 1, the proposed method achieves stable and significant performance improvements on two distinctly different underlying model architectures (LSTM and Transformer). This fully demonstrates that the quality assessment and adaptive retrieval enhancement correction mechanism constructed in this invention is a general enhancement framework independent of the underlying model architecture, which can be flexibly integrated onto various existing prediction models and effectively improve model prediction accuracy and robustness.

[0073] Table 1: Performance comparison of different models on the test set

[0074] Example 2 An adaptive prediction and correction system based on quality assessment and retrieval enhancement includes: The historical sequence knowledge base construction module is configured to extract sample pairs consisting of historical observation sequences and their corresponding subsequent real sequences from selected data sources, integrate and store all extracted sample pairs to form a historical sequence knowledge base; The base model prediction module is configured to respond to the current input time series data by processing it with a pre-trained base model to obtain preliminary prediction results. The retrieval enhancement module is configured to, in response to the current input time series data, retrieve the K most similar historical sequence segments and their corresponding subsequent real sequences from the historical sequence knowledge base based on similarity calculation, and perform a weighted average of the retrieval results to obtain the retrieval enhancement prediction result; The quality assessment module is configured to evaluate the reliability of the prediction results and generate adaptive weights based on the reliability. The prediction correction module is configured to perform prediction correction based on the adaptive weights, as well as the preliminary prediction results from the pre-trained base model and the retrieval-enhanced prediction results.

[0075] The specific execution process of each module in this embodiment can be referred to the method in Embodiment 1, and will not be repeated here.

[0076] 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 one or more computer-usable storage media (including, but not limited to, disk storage, etc.) containing computer-usable program code. CD - ROM It takes the form of a computer program product implemented on (such as optical memory, etc.).

[0077] 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.

[0078] 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.

[0079] 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 1The steps of the function specified in one or more boxes.

[0080] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made by those skilled in the art without creative effort within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. An adaptive prediction and correction method based on quality assessment and retrieval enhancement, characterized in that, Includes the following steps: Extract sample pairs consisting of historical observation sequences and their corresponding subsequent real sequences from the selected data sources, integrate and store all extracted sample pairs to form a historical sequence knowledge base; In response to the current input time series data, the pre-trained base model is used to process it to obtain preliminary prediction results; In response to the current input time series data, based on similarity calculation, the K most similar historical sequence segments and their corresponding subsequent real sequences are retrieved from the historical sequence knowledge base. The retrieval results are then weighted and averaged to obtain the retrieval-enhanced prediction results. Assess the reliability of the prediction results and generate adaptive weights based on the reliability; Based on the adaptive weights, as well as the preliminary prediction results from the pre-trained base model and the retrieval-enhanced prediction results, prediction correction is performed.

2. The adaptive prediction and correction method based on quality assessment and retrieval enhancement as described in claim 1, characterized in that, The length of the historical observation sequence is a predefined observation window length T, which includes all or part of the features of the time series at T consecutive time points; the length of the subsequent real sequence is a predefined prediction window length L, which includes the real values ​​of the target variable to be predicted at L future time points.

3. The adaptive prediction and correction method based on quality assessment and retrieval enhancement as described in claim 1, characterized in that, During the process of integrating and storing all extracted sample pairs, the historical observation sequence is used as a searchable key, and the corresponding subsequent real sequence is stored as a reference value to support subsequent fast retrieval operations based on sequence similarity.

4. The adaptive prediction and correction method based on quality assessment and retrieval enhancement as described in claim 1, characterized in that, The process of obtaining the pre-trained base model includes: acquiring time series data, preprocessing it, and then dividing it into training and test sets; A time series prediction model is selected as the base model, and the base model is trained using the training set and tested using the test set until the test requirements are met, thus obtaining the pre-trained base model. The time series data includes at least one of power load data, power data, or electricity price data.

5. The adaptive prediction and correction method based on quality assessment and retrieval enhancement as described in claim 1, characterized in that, In response to the current input time series data, based on similarity calculation, the K most similar historical sequence segments and their corresponding subsequent real sequences are retrieved from the historical sequence knowledge base. The process of obtaining the retrieval-enhanced prediction result by weighted averaging of the retrieval results is implemented by the retrieval enhancement module. The retrieval enhancement module includes a similarity retrieval unit and a weighted fusion unit. The similarity retrieval unit is used to retrieve the K most similar historical sequence segments and their corresponding subsequent real sequences from the historical sequence knowledge base based on the similarity calculation between the current input sequence and the historical sequences. The weighted fusion unit is used to normalize the similarity into weight coefficients and calculate the retrieval-enhanced prediction result by weighted averaging.

6. The adaptive prediction and correction method based on quality assessment and retrieval enhancement as described in claim 1, characterized in that, The process of assessing the reliability of the prediction results and generating adaptive weights based on that reliability is implemented by a quality assessment module, which includes: The joint feature encoding unit receives the current sequence, the preliminary prediction sequence generated by the pre-trained model, and a learnable channel indicator. It maps the three to the same feature space through a linear projection layer and concatenates them to obtain the primary fusion feature. Then, it performs nonlinear transformation and fusion on the primary fusion feature through at least one fully connected layer and a nonlinear activation function to finally output the joint feature. An error estimation signal generation unit is used to receive the primary fusion features, learn and output a quantized error estimation signal by modeling the dependencies within the sequence and across feature dimensions, so as to characterize the estimation of the potential error of the current preliminary prediction result. An adaptive weight calculation unit is used to dynamically calculate two sets of fusion weights based on the error estimation signal, joint features, and retrieval similarity information through a gated weight generation network. The weight α is used to adjust the degree of dependence on the preliminary prediction result, and the weight β is used to adjust the degree of dependence on the retrieval-enhanced prediction result.

7. The adaptive prediction and correction method based on quality assessment and retrieval enhancement as described in claim 6, characterized in that, The adaptive weight calculation unit is configured to concatenate the joint features and the error estimation signal into a gated network, which consists of a fully connected layer, a GELU activation function, a linear layer, and a Sigmoid function layer connected in series to generate an initial gate value. Using the generated initial gating values, the joint features are differentially modulated. The first gating signal is multiplied by the joint features to obtain the modulation features used to predict the weight α. The second gating signal is multiplied by the joint features and then added to the retrieval similarity to obtain the modulation features used to predict the weight β. The modulated features are input into two parallel weight prediction subnetworks, each consisting of a linear layer and a sigmoid function layer, to generate the original weights. A trainable coordination parameter is then introduced to scale the original weights. The scaled weights are then normalized to ensure that their sum is 1, forming the final probabilistic weights α and β used for fusion.

8. The adaptive prediction and correction method based on quality assessment and retrieval enhancement as described in claim 1, characterized in that, The prediction correction process, based on the adaptive weights, preliminary prediction results from the pre-trained base model, and retrieval enhancement prediction results, includes: performing prediction correction based on the adaptive fusion weights α and β from the quality assessment module, preliminary prediction results from the pre-trained base model, and retrieval enhancement prediction results from the retrieval enhancement module. The formula is as follows: ; In the formula, To finally correct the prediction results, These are the preliminary prediction results from the pre-trained model. To enhance the prediction results for retrieval.

9. The adaptive prediction and correction method based on quality assessment and retrieval enhancement as described in claim 1, characterized in that, It also includes the following steps: A composite loss function is constructed to train the parameters of the quality assessment module, the retrieval enhancement module, and the pre-trained base model to minimize the prediction error; the composite loss function consists of prediction loss and quality assessment loss. The current input time series data is processed using the trained quality assessment module, retrieval enhancement module, and pre-trained base model to obtain the final prediction result.

10. An adaptive prediction and correction system based on quality assessment and retrieval enhancement, characterized in that, include: The historical sequence knowledge base construction module is configured to extract sample pairs consisting of historical observation sequences and their corresponding subsequent real sequences from selected data sources, integrate and store all extracted sample pairs to form a historical sequence knowledge base; The base model prediction module is configured to respond to the current input time series data by processing it with a pre-trained base model to obtain preliminary prediction results. The retrieval enhancement module is configured to, in response to the current input time series data, retrieve the K most similar historical sequence segments and their corresponding subsequent real sequences from the historical sequence knowledge base based on similarity calculation, and perform a weighted average of the retrieval results to obtain the retrieval enhancement prediction result; The quality assessment module is configured to evaluate the reliability of the prediction results and generate adaptive weights based on the reliability. The prediction correction module is configured to perform prediction correction based on the adaptive weights, as well as the preliminary prediction results from the pre-trained base model and the retrieval-enhanced prediction results.