Self-supervised learning model training method based on measurement data

By dynamically generating mask time-series prediction and feature comparison tasks, combining the noise level and statistical distribution characteristics of measurement data, dynamically adjusting the weight of the loss function, and optimizing the self-supervised learning model through an adaptive fine-tuning module, the problems of insufficient feature robustness and cross-task generalization ability in power grid measurement data are solved, and the model achieves efficient adaptation and excellent performance in power grid analysis tasks.

CN121835799APending Publication Date: 2026-04-10STATE GRID SICHUAN ELECTRIC POWER CO MARKETING SERVICE CENT
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610009243.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-06
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing general-purpose self-supervised learning methods suffer from poor feature robustness, weak physical interpretability, and insufficient cross-task generalization ability when applied to power grid measurement data.

Method used

By dynamically generating mask time-series prediction and feature comparison tasks, and combining the noise level and real-time statistical distribution characteristics of the measurement data, the weights of the loss function are dynamically adjusted, and the fitness is evaluated through an adaptive fine-tuning module to optimize the self-supervised learning model.

Benefits of technology

This improves the model's adaptability and robustness in power grid analysis tasks, enhances its physical interpretability and cross-task generalization ability, and ensures that the model performs well under different data quality and operating conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121835799A_ABST
    Figure CN121835799A_ABST
Patent Text Reader

Abstract

The invention discloses a self-supervised learning model training method based on measurement data, and relates to the technical field of power system monitoring, and the method comprises the steps: inputting the measurement data into a time sequence feature encoder for processing, and outputting a high-dimensional feature vector; dynamically generating a mask time sequence prediction task and a feature comparison task based on the noise level and the real-time statistical distribution features of the measurement data; dynamically determining loss weights of different tasks based on the noise level of the measurement data, and constructing a loss function; utilizing the high-dimensional feature vector to obtain a pre-training model by optimizing loss function training; and according to the adaptation degree between the high-dimensional feature vector and the downstream task, performing parameter fine adjustment on the pre-training model to obtain a self-supervised learning model adaptive to the downstream task. According to the method, the self-supervision task and the loss weight are adaptively generated based on the actual situation of the measurement data, parameter fine adjustment is performed based on the matching degree, and the adaptability of the model to the measurement data and the cross-task generalization ability of the model are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power system monitoring technology, and specifically to a method for training a self-supervised learning model based on measurement data. Background Technology

[0002] Measurement data is the core carrier for characterizing the operating status of the power grid, the health level of equipment, and power quality. With the continuous development of smart grid informatization, the scale of power measurement data collection is growing exponentially. How to efficiently extract discriminative features from massive, unlabeled measurement data to achieve accurate state identification, anomaly detection, or trend prediction has become a key requirement for the industry's intelligent upgrading. Existing general-purpose self-supervised learning methods have the following limitations when applied to power grid measurement data:

[0003] Firstly, existing methods mostly employ fixed data augmentation and task generation strategies, which cannot adapt to the reality of dynamic and drastic changes in the noise level of power grid measurement data. This leads to a mismatch between task difficulty and data quality, resulting in poor robustness of the features learned by the model.

[0004] Secondly, the self-supervised tasks designed by existing methods are mostly general time-series tasks. The positive and negative sample pairs they construct lack guidance from the physical laws of the power grid, causing the model to learn feature associations that violate basic physical constraints. This results in poor generalization ability and low physical interpretability of the model in real power grid analysis tasks.

[0005] Third, existing methods use a fixed-weight loss function combination during the pre-training stage, making it difficult for the features extracted by the pre-trained model to be optimally adapted to diverse downstream tasks such as state estimation, fault diagnosis, and load forecasting. When the model migrates across different regional power grids, different operating conditions, or different analysis tasks, its performance is easily degraded, making it difficult to meet the actual needs of intelligent analysis across all power grid scenarios.

[0006] Therefore, existing technologies, due to their static, general, and fixed task and training paradigms, cannot adapt to the dynamic noise characteristics, complex physical constraints, and diverse downstream task requirements of power grid data. This results in poor robustness of the features learned by the models, weak physical interpretability, and insufficient cross-task generalization ability, making it difficult to meet the actual application needs of smart grids. Summary of the Invention

[0007] The technical problem this invention aims to solve is that existing general-purpose self-supervised learning methods suffer from poor feature robustness, weak physical interpretability, and insufficient cross-task generalization ability when applied to power grid measurement data. The objective is to provide a self-supervised learning model training method based on measurement data that addresses these problems.

[0008] This invention is achieved through the following technical solution:

[0009] In a first aspect, the present invention provides a method for training a self-supervised learning model based on measurement data, comprising:

[0010] The measurement data is input into a time-series feature encoder for processing, and a high-dimensional feature vector is output.

[0011] Based on the noise level and real-time statistical distribution characteristics of the measurement data, a mask time series prediction task is dynamically generated by a dynamic task generator.

[0012] Based on the real-time statistical distribution characteristics of the measurement data, a dynamic task generator dynamically generates feature comparison tasks.

[0013] The dynamic task generator dynamically determines the weights of the first loss term for the masking time series prediction task and the second loss term for the feature comparison task based on the noise level of the measurement data, and constructs a loss function based on the weighted sum of the first and second loss terms.

[0014] Using the high-dimensional feature vector, the self-supervised learning model containing the temporal feature encoder and the dynamic task generator is pre-trained by optimizing the loss function to obtain a pre-trained model;

[0015] The adaptive fine-tuning module evaluates the fit between the high-dimensional feature vector and the downstream task, and the parameters of the pre-trained model are fine-tuned based on the fit to obtain a self-supervised learning model adapted to the downstream task.

[0016] Optionally, the temporal feature encoder includes a sliding window convolutional layer, a cross-modal coupled feature processing unit, and an improved Transformer network; the step of inputting measurement data into the temporal feature encoder for processing and outputting a high-dimensional feature vector includes:

[0017] The sliding window convolutional layer extracts multi-scale local features of the measurement data in parallel, and fuses the local features at each scale to output multi-scale fused features.

[0018] Based on the feature contribution of the downstream task, the cross-modal coupling feature processing unit dynamically allocates modal attention weights to data from different sources in the measurement data. Based on the modal attention weights, the data from different sources are weighted and fused to obtain fused cross-modal features. The fused cross-modal features are then channel-superimposed with the multi-scale fused features to form a joint feature vector.

[0019] The joint feature vector is processed using a time attention mechanism that integrates power grid physical constraints to obtain enhanced features;

[0020] The enhanced features are further refined using the improved Transformer network, resulting in a high-dimensional feature vector.

[0021] Optionally, the sliding window convolutional layer includes a first convolutional kernel, a second convolutional kernel, and a third convolutional kernel; the step of extracting multi-scale local features of the measurement data in parallel through the sliding window convolutional layer, and fusing the local features at each scale to output multi-scale fused features includes:

[0022] The instantaneous perturbation features in the measurement data are captured by the first convolutional kernel;

[0023] The second convolutional kernel captures short-term fluctuation features in the measurement data; the scale of the second convolutional kernel is larger than that of the first convolutional kernel.

[0024] The third convolutional kernel captures long-term trend features in the measurement data; the scale of the third convolutional kernel is larger than that of the second convolutional kernel.

[0025] After aligning the instantaneous disturbance features, short-term fluctuation features, and long-term trend features spatially, they are superimposed and fused along the channel dimension to form a multi-scale fused feature.

[0026] Optionally, the step of processing the joint feature vector using a time attention mechanism that integrates power grid physical constraints to obtain enhanced features includes:

[0027] Based on the rated power frequency cycle of the power grid, the timing position coding factor for each time step is generated;

[0028] The temporal position encoding factor is fused with the features of the corresponding time step in the joint feature vector to obtain intermediate features;

[0029] Based on the phase difference of voltage and current and the measured values ​​of active power at different time steps, an electrical quantity correlation weight matrix is ​​constructed; the electrical quantity correlation weight matrix is ​​used to quantify the correlation importance between data at different time steps;

[0030] Based on the electrical quantity correlation weight matrix, attention-weighted aggregation and transformation are performed on the intermediate features to obtain enhanced features.

[0031] Optionally, the improved Transformer network includes a batch normalization unit and an electrical quantity normalization unit connected in sequence; the step of deepening the enhanced features through the improved Transformer network to output a high-dimensional feature vector includes:

[0032] The batch normalization unit is used to standardize the distribution of the enhancement features between batches to obtain standardized features.

[0033] The electrical quantity normalization unit performs truncation and normalization processing on the standardized features based on the rated electrical parameters range of the power grid to obtain a high-dimensional feature vector.

[0034] Optionally, the noise level is characterized by the signal-to-noise ratio; the step of dynamically generating a mask time-series prediction task based on the noise level and real-time statistical distribution characteristics of the measurement data by a dynamic task generator includes:

[0035] When the signal-to-noise ratio is greater than or equal to the first threshold, the mask ratio of the mask timing prediction task is set to the first ratio.

[0036] When the signal-to-noise ratio is less than the first threshold and greater than or equal to the second threshold, the mask ratio is set to the second ratio; the first threshold is greater than the second threshold.

[0037] When the signal-to-noise ratio is less than the second threshold, the mask ratio is set to a third ratio; the first ratio is less than the second ratio, and the second ratio is less than the third ratio.

[0038] Optionally, the step of dynamically generating a mask time series prediction task based on the noise level and real-time statistical distribution characteristics of the measurement data using a dynamic task generator includes:

[0039] Based on the real-time statistical distribution characteristics of the measurement data, time-series segments in the measurement data that characterize the dynamic changes of electrical quantities are identified as mask candidate regions; the time-series segments that characterize the dynamic changes of electrical quantities refer to the portions of the measurement data whose rate of change or magnitude of change exceeds a preset dynamic threshold.

[0040] From the mask candidate region, data integrity key nodes are excluded to determine the mask position of the mask timing prediction task; the data integrity key nodes include: the start and end positions of the data continuum segment, and the time point that represents the important operation state switch.

[0041] Optionally, the step of dynamically generating a feature comparison task based on the real-time statistical distribution characteristics of the measurement data using a dynamic task generator includes:

[0042] Positive sample pairs for feature comparison tasks are selected and constructed from measurement data collected from the same power grid monitoring point in adjacent time periods; wherein, the two data sets of the positive sample pairs satisfy the following: voltage deviation, current deviation, and power deviation do not exceed the first preset deviation, and power conservation deviation does not exceed the second preset deviation.

[0043] From measurement data collected from different power grid monitoring points, or from the same monitoring point under different operating conditions, negative sample pairs for feature comparison tasks are screened and constructed; wherein, the two data sets of the negative sample pairs satisfy the following: the voltage and current phase difference exceeds the third preset deviation, and the power balance relationship deviation exceeds the fourth preset deviation.

[0044] Optionally, the noise level is characterized by the signal-to-noise ratio; the step of dynamically determining the weights of the first loss term for the mask temporal prediction task and the second loss term for the feature comparison task based on the noise level of the measurement data by a dynamic task generator includes:

[0045] When the signal-to-noise ratio is greater than or equal to the first threshold, the weight of the first loss term is set to be less than the weight of the second loss term;

[0046] When the signal-to-noise ratio is less than the first threshold and greater than or equal to the second threshold, the weight of the first loss term is set to be equal to the weight of the second loss term; the first threshold is greater than the second threshold.

[0047] When the signal-to-noise ratio is less than the second threshold, the weight of the first loss term is set to be greater than the weight of the second loss term.

[0048] Optionally, the step of fine-tuning the parameters of the pre-trained model based on the fitness level to obtain a self-supervised learning model adapted to the downstream task includes:

[0049] If the fit is less than the preset fit threshold, then the core parameters of the temporal feature encoder remain unchanged.

[0050] Update the mapping layer parameters of the dynamic task generator according to the preset learning rate;

[0051] The intermediate layer parameters of the dynamic task generator are updated according to the dynamic learning rate; the dynamic learning rate is dynamically determined based on the degree of deviation between the fitness and the preset fitness threshold, and the dynamic learning rate does not exceed a predetermined multiple of the preset learning rate.

[0052] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0053] This application provides a self-supervised learning model training method based on measurement data. This method dynamically generates masked time-series prediction tasks based on the noise level and real-time statistical distribution characteristics of the measurement data, ensuring that the model can efficiently learn high-quality feature representations under various data quality environments, greatly improving the model's adaptability and robustness to power grid measurement data. Based on the real-time statistical distribution characteristics of the measurement data, a feature comparison task is dynamically generated, guiding the model to learn discriminative features that conform to the physical laws of the power grid, thereby improving the model's generalization ability and physical interpretability in real power grid analysis tasks. By dynamically allocating the weights of the masked prediction task and the feature comparison task in the total loss function based on the same noise level, the model can adaptively adjust its optimization direction according to real-time data conditions, thus providing downstream tasks with a pre-trained model that performs well under various operating conditions. Furthermore, by evaluating the fit between the pre-trained features and downstream tasks and making precise parameter adjustments, efficient and smooth transfer from general pre-training to specific tasks is achieved, thereby improving the model's cross-task generalization ability. Attached Figure Description

[0054] To more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of the present invention and should not be considered as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort. In the drawings:

[0055] Figure 1 A flowchart illustrating the training method for a self-supervised learning model based on measurement data provided in this application embodiment;

[0056] Figure 2 This is a schematic diagram of the structure of the self-supervised learning model provided in the embodiments of this application. Detailed Implementation

[0057] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the embodiments and accompanying drawings. The illustrative embodiments and descriptions of the present invention are only used to explain the present invention and are not intended to limit the present invention.

[0058] To address the shortcomings of existing general-purpose self-supervised learning methods when applied to power grid measurement data, such as poor feature robustness, weak physical interpretability, and insufficient cross-task generalization ability, this application provides a method for training a self-supervised learning model based on measurement data. Please refer to... Figure 1 This is a flowchart illustrating the training method for a self-supervised learning model based on measurement data provided in this application embodiment. The following is a description of... Figure 1The training method for a self-supervised learning model based on measurement data is introduced.

[0059] S1. Input the measurement data into the time-series feature encoder for processing and output a high-dimensional feature vector.

[0060] In the specific implementation process, firstly, raw measurement data is acquired. This raw measurement data includes multi-source data such as voltage, current, and temperature collected during power grid operation, and the data format is time series. Secondly, the raw measurement data is preprocessed to improve data quality, laying the foundation for subsequent feature extraction and model training. The preprocessing process is described below.

[0061] For missing values ​​in the original measurement data, an adaptive filling strategy based on time-series correlation and power grid physical rules is adopted. Specifically, linear interpolation fitting is performed using electrical quantity data from adjacent time steps, ensuring that the fitting result satisfies the power conservation law of the power grid. For example, when current data for a certain time step is missing, linear interpolation estimation is performed based on the current values ​​of a preset number (e.g., 5) time steps before and after it. The rationality of the interpolation result is verified and adjusted by checking the active power conservation relationship of the line, until the interpolation result simultaneously satisfies time-series smoothness and physical constraints.

[0062] Noise in the raw measurement data is first identified using the 3σ criterion (i.e., data values ​​exceeding the mean ± 3 standard deviations). For the identified noisy data, a sliding window filter is used for smoothing. The size of the filter window is dynamically determined based on the power grid frequency period corresponding to the measurement data. For example, when the power grid frequency period is 20 milliseconds, the window size can be set to 20 time steps. This dynamically adaptable window setting ensures that random noise is effectively smoothed while preserving the original temporal characteristics and physical meaning of the data to the greatest extent possible.

[0063] The high-quality, well-organized measurement data obtained from the preprocessing is then input into the temporal feature encoder. The temporal feature encoder extracts and encodes features from the input data and finally outputs a high-dimensional feature vector that represents the deep temporal dependencies of the measurement data.

[0064] S2. Based on the noise level and real-time statistical distribution characteristics of the measurement data, a dynamic task generator dynamically generates mask time series prediction tasks.

[0065] In the specific implementation process, the dynamic task generator quantifies and evaluates the noise level of the measurement data. The noise level can be characterized by noise statistics such as signal-to-noise ratio (SNR) and total harmonic distortion (THD). In this embodiment, signal-to-noise ratio (SNR) is preferably used as the quantification indicator.

[0066] Masked temporal prediction is a self-supervised training task. Its purpose is to train a model to predict the content of the masked portions of input time-series data by randomly masking (covering) certain segments of the data, based on contextual information. This task forces the model to learn the temporal dependencies, evolutionary patterns, and robust feature representation capabilities within the data. Two dynamic decisions in masked temporal prediction include determining the masking ratio and masking location. The masking ratio refers to the percentage of data points or time periods randomly masked in a complete time-series data sample. The masking location refers to the specific time points or time segments selected for masking within the time-series data.

[0067] In one possible embodiment, the mask ratio is determined based on the noise level of the measurement data, and the specific steps include:

[0068] When the signal-to-noise ratio is greater than or equal to the first threshold, the mask ratio is set to the first ratio; when the signal-to-noise ratio is less than the first threshold but greater than or equal to the second threshold, the mask ratio is set to the second ratio; when the signal-to-noise ratio is less than the second threshold, the mask ratio is set to the third ratio; wherein, the first threshold is greater than the second threshold; the first ratio is less than the second ratio, and the second ratio is less than the third ratio.

[0069] For example, the first threshold is 30dB and the second threshold is 15dB.

[0070] When SNR≥30dB, it is judged as a low noise level. At this time, the data quality is high and the information is clear. The mask ratio is set to a relatively low first ratio (such as 10%-20%) so that the model can learn from high-quality data in a refined and low-interference manner.

[0071] When 15dB≤SNR<30dB, it is judged as a medium noise level, and the mask ratio is set to a medium second ratio (such as 25%-35%) to provide a moderate challenge while maintaining the stability of learning.

[0072] When SNR < 15dB, it is considered a high noise level. At this point, the data signal-to-noise ratio is low and interference is severe. The mask ratio is then set to a relatively high third ratio (e.g., 40%-50%). A high mask ratio forces the model to rely on more robust contextual information for inference even with severely missing information, thereby significantly enhancing the model's feature extraction and noise resistance capabilities in harsh data environments.

[0073] In one possible embodiment, the mask location is determined based on the real-time statistical distribution characteristics of the measurement data, and the specific steps include:

[0074] Based on the real-time statistical distribution characteristics of the measurement data, time-series segments in the measurement data that represent the dynamic changes of electrical quantities are identified as candidate mask regions; from the candidate mask regions, key nodes for data integrity are excluded to determine the final mask position.

[0075] Among them, the time-series segments characterizing the dynamic changes of electrical quantities refer to the portions of the measured data where the rate of change or amplitude of change exceeds a preset dynamic threshold. Specifically, these include: the moments and adjacent regions where voltage or current undergoes abrupt changes (such as instantaneous changes caused by switching operations or faults), and the intervals where power fluctuates drastically. Data integrity critical nodes refer to the time points or locations where, if masked, they would severely disrupt the basic logical structure of the data sequence or prevent the model from learning effectively. Specifically, these include: the start and end positions of continuous data segments, and the moments characterizing important operational state transitions (such as circuit breaker changes, protection actions, or state transition moments inferred from data abrupt changes).

[0076] In the specific implementation process, the absolute value of the first-order difference of voltage or current within a preset short time window (e.g., 10 milliseconds) is calculated. If this value exceeds a preset first percentage (e.g., 5%) of its rated value, this moment is determined to be a sudden change moment, and the adjacent area within a certain range before and after it is designated as a mask candidate region. The absolute value change of active power within a preset longer time window (e.g., 1 second) is calculated. If this change exceeds a preset second percentage (e.g., 20%) of its recent average value, this interval is determined to be a "violent fluctuation interval," and the entire interval is designated as a mask candidate region.

[0077] In this embodiment, by preferentially masking key areas of dynamic changes in electrical quantities (such as abrupt changes and fluctuations), the model is forced to learn core event characteristics of the power grid in a targeted manner, which significantly improves training efficiency and the relevance of feature learning. By actively excluding key nodes of data integrity (such as start and end points, state transition times), the basic logical structure of the training data is ensured to be intact, preventing the model from learning incorrect associations and guaranteeing the stability of the training process and the physical rationality of the learned features.

[0078] S3. Based on the real-time statistical distribution characteristics of the measurement data, a dynamic task generator dynamically generates feature comparison tasks.

[0079] The feature comparison task is a self-supervised training task. Its purpose is to enable the model to learn to distinguish between physically similar data pairs (positive sample pairs) and physically dissimilar data pairs (negative sample pairs), thereby bringing similar states closer together and distancing dissimilar states apart in the feature space. Ultimately, this allows the model to autonomously capture and quantify the essential physical differences between different operating states of the power grid, laying the foundation for downstream tasks such as anomaly detection and state classification.

[0080] In one possible embodiment, the specific steps of S3 include:

[0081] From measurement data collected at the same power grid monitoring point in adjacent time periods, positive sample pairs for feature comparison tasks are selected and constructed. Among them, the two data sets of the positive sample pairs meet the following conditions: voltage deviation, current deviation, and power deviation do not exceed the first preset deviation (e.g., 5%), and the power conservation deviation does not exceed the second preset deviation (e.g., 3%). From measurement data collected at different power grid monitoring points, or at the same monitoring point under different operating conditions, negative sample pairs for feature comparison tasks are selected and constructed. Among them, the two data sets of the negative sample pairs meet the following conditions: voltage and current phase difference exceeds the third preset deviation (e.g., 30%), and the power balance relationship deviation exceeds the fourth preset deviation (e.g., 10%).

[0082] For example, for measurement data from the same substation between 10:00 and 10:05 every day, positive sample pairs must meet the following requirements: voltage deviation ≤ 5%, current deviation ≤ 5%, power deviation ≤ 5%, and power conservation deviation ≤ 3%, to ensure that positive sample pairs represent similar data under normal grid operation conditions.

[0083] For example, the negative sample pairs of synchronous measurement data from substation A and substation B, or measurement data from the same substation during normal operation and fault operation, must meet the following requirements: voltage and current phase difference > 30° and power balance relationship deviation > 10%, to ensure that the negative sample pairs represent the differences in data under different operating conditions of the power grid.

[0084] In practical implementation, the quantization deviations of voltage, current, and power, as well as the power conservation / balance relationship, serve as hard constraints for constructing positive and negative sample pairs. This clearly defines the objective criteria for "physical state similarity" (small deviation, good conservation) and "physical state dissimilarity" (large phase difference, poor balance relationship). The features learned by the model under this signal-driven approach have similarity metrics that are directly related to the physical essence of power grid operation (such as phase consistency and power balance), greatly improving the model's interpretability and engineering credibility.

[0085] S4. Based on the noise level of the measurement data, the dynamic task generator dynamically generates the weights of the first loss term for the masked time series prediction task and the weights of the second loss term for the feature comparison task. Based on the weighted sum of the first and second loss terms, a loss function is constructed.

[0086] In one possible embodiment, the specific steps of S4 include:

[0087] When the signal-to-noise ratio is greater than or equal to the first threshold, the weight of the first loss term is set to be less than the weight of the second loss term; when the signal-to-noise ratio is less than the first threshold but greater than or equal to the second threshold, the weight of the first loss term is set to be equal to the weight of the second loss term; the first threshold is greater than the second threshold; when the signal-to-noise ratio is less than the second threshold, the weight of the first loss term is set to be greater than the weight of the second loss term.

[0088] For example, the first threshold is 30dB and the second threshold is 15dB.

[0089] When SNR ≥ 30dB, it is considered a low noise level. At this point, the data is clear, and the feature reliability is high. The focus should be on training the discriminative power of the features. Therefore, the weight λ1 of the first loss term (i.e., mask prediction loss) is set to be smaller than the weight λ2 of the second loss term (i.e., feature contrast loss), for example, λ1 = 0.4, λ2 = 0.6. This encourages the model to make full use of high-quality data and learn more refined feature discrimination boundaries.

[0090] When 15dB≤SNR<30dB, it is judged as medium noise level. In order to balance feature learning and robustness, the weights of the first loss term and the second loss term are set to be equal, for example, λ1=λ2=0.5.

[0091] When SNR < 15dB, it is considered a high noise level. At this point, the data signal-to-noise ratio is low, and features are easily contaminated. Therefore, the focus should be on training the model's robustness and feature reconstruction capabilities. Thus, the weight of the first loss term is set greater than the weight of the second loss term, for example, λ1 = 0.6 and λ2 = 0.4. This allows the model to focus on learning the intrinsic structure of the data and its denoising and completion capabilities under high interference conditions, thereby enhancing its robustness.

[0092] In this embodiment, the mask prediction loss weight (λ1) is positively correlated with the noise level (increasing as SNR decreases), while the feature contrast loss weight (λ2) is negatively correlated with the noise level (decreasing as SNR decreases). This dynamic weight allocation mechanism addresses the "one-size-fits-all" optimization flaw of fixed loss functions on complex industrial data, enabling the pre-trained model to learn the most suitable and efficient feature representations from data sources of varying quality. This provides a more generalizable model foundation for downstream tasks.

[0093] S5. Using high-dimensional feature vectors, the self-supervised learning model containing a temporal feature encoder and a dynamic task generator is pre-trained by optimizing the loss function to obtain a pre-trained model.

[0094] In the specific implementation process, the high-dimensional temporal feature vector is input into the dynamic task generator to complete the training calculation of mask prediction and feature comparison tasks. The parameter weights of the temporal feature encoder and the dynamic task generator are iteratively updated through the backpropagation algorithm to minimize the loss function until the model converges (for example, when the change of the loss function value of 10 consecutive training batches is less than 1e-4, it is determined that the model has converged). The pre-trained model can autonomously learn the effective features of the measurement data.

[0095] S6. The adaptive fine-tuning module is used to evaluate the fit between the high-dimensional feature vector and the downstream task. Based on the fit, the parameters of the pre-trained model are fine-tuned to obtain a self-supervised learning model that is adapted to the downstream task.

[0096] In the specific implementation process, when the pre-trained model is applied to a specific downstream task (such as state estimation, fault diagnosis, load prediction, transient stability assessment, etc.), the adaptive fine-tuning module evaluates the fit between the high-dimensional feature vector and the downstream task, which is used to quantify the degree of matching between the high-dimensional feature vector output by the pre-trained model and the requirements of the downstream task.

[0097] First, the cosine similarity between the high-dimensional feature vector and the standard feature vector constructed for the downstream task is calculated to obtain the feature matching degree.

[0098] Secondly, the high-dimensional feature vector is verified to ensure it conforms to the relevant physical rules of the power grid, thus obtaining the physical constraint satisfaction level. Specifically, the high-dimensional feature vector is decoded into the corresponding electrical quantity time series; the electrical quantity time series is input into a preset physical rule verifier, which includes power conservation rules, voltage and current phase constraint rules, and active and reactive power coupling relationship rules; the proportion of electrical quantity time series that satisfy all verification rules is counted out of the total number of verifications, and the proportion is converted into a percentage score as the physical constraint satisfaction level.

[0099] Finally, the feature matching degree and the physical constraint satisfaction degree are weighted and summed to obtain the final fit. The feature matching degree accounts for 60% of the weight, and the physical constraint satisfaction degree accounts for 40%.

[0100] After obtaining the fit between the high-dimensional feature vector and the downstream task, the fit is compared with the preset fit threshold. The preset fit threshold is set based on the historical fit data statistics of the downstream task, and is usually set to 80 points (out of 100).

[0101] In one possible embodiment, if the fit is greater than or equal to a preset fit threshold, all parameters of the pre-trained model are kept unchanged.

[0102] In the specific implementation process, when the fit is greater than or equal to the preset fit threshold, it means that the feature extraction capability of the pre-trained model is highly adapted to the downstream task and no adjustment is needed. Freeze all parameters of the pre-trained model (including the temporal feature encoder and the dynamic task generator) and apply it directly to the downstream task.

[0103] In one possible embodiment, if the fit is less than a preset fit threshold, the core parameters of the temporal feature encoder are kept unchanged; the mapping layer parameters of the dynamic task generator are updated according to a preset learning rate; the intermediate layer parameters of the dynamic task generator are updated according to a dynamic learning rate; the dynamic learning rate is dynamically determined based on the degree of deviation between the fit and the preset fit threshold, and the dynamic learning rate does not exceed a predetermined multiple of the preset learning rate.

[0104] In practice, when the fit is lower than the preset threshold, it indicates that the feature extraction capability of the pre-trained model is not well-suited to the downstream task, and the pre-trained model needs to be fine-tuned for the downstream task.

[0105] First, the core parameters of the temporal feature encoder are frozen, including the encoder layer weights of the improved Transformer network and the basic weights of the temporal attention mechanism, and their learning rate is kept at zero. This protects the deep feature representations and domain knowledge of the power grid measurement data that are universally applicable, learned during the pre-training stage, and prevents catastrophic forgetting or feature degradation caused by fine-tuning in downstream tasks, thus avoiding damage to the core feature extraction capability.

[0106] Secondly, the mapping layer parameters of the dynamic task generator (usually the fully connected layer or linear projection head at the end) are updated according to a preset learning rate of 1e-5 to 1e-3 to improve the adaptability of task generation to downstream task requirements.

[0107] Finally, for the intermediate layer parameters of the dynamic task generator, including the fusion weights of the cross-modal coupled feature processing units and the convolutional kernel weights of the sliding window convolutional layer, a dynamic learning rate is used for updating. The dynamic learning rate is dynamically determined based on the deviation between the fitness score and the preset fitness score threshold. The greater the deviation, the larger the dynamic learning rate and the more aggressive the adjustment. The dynamic learning rate does not exceed twice the preset learning rate, effectively preventing a surge in the learning rate due to excessive fitness deviation, avoiding gradient explosion, oscillation, or non-convergence problems during training, and ensuring the robustness and controllability of the fine-tuning process.

[0108] Using the labeled dataset of the downstream task, and taking the supervised loss function of the downstream task itself as the optimization objective, the core parameters of the temporal feature encoder, the mapping layer parameters and intermediate layer parameters of the dynamic task generator are updated and trained. During the training process, the model's fitness on the validation set is continuously monitored. When the fitness is greater than or equal to the preset fitness threshold for multiple consecutive evaluation cycles, the fine-tuning process is terminated, and a self-supervised learning model adapted to the downstream task is obtained.

[0109] In this embodiment, a layered fine-tuning strategy is adopted for the functional positioning of different parts of the model: a stable preset learning rate is used for the mapping layer directly related to the task output to ensure a smooth transition in the output space; a dynamic learning rate linked to the fit deviation is used for the intermediate layer responsible for feature interaction and reorganization, achieving intelligent adjustment of "faster adjustment for larger deviations and more precise adjustment for smaller deviations". This differentiated update mechanism enables the model to adapt to downstream tasks with optimal convergence speed and stability.

[0110] Please refer to Figure 2 This is a schematic diagram of the structure of the self-supervised learning model provided in this embodiment. The self-supervised learning model includes three core components: a temporal feature encoder, a dynamic task generator, and an adaptive fine-tuning module.

[0111] The temporal feature encoder employs an improved Transformer network, integrating a time attention mechanism that fuses the physical constraints of the power grid, a sliding window convolutional layer, and a cross-modal coupling feature processing unit to capture short-term mutation dependencies, long-term periodic evolution trends, and cross-modal coupling features of measurement data.

[0112] The dynamic task generator interacts with the output of the temporal feature encoder to dynamically generate masked temporal prediction tasks and feature comparison tasks based on the real-time statistical distribution characteristics and noise levels of the measurement data. The weighted sum of the masked prediction loss and the feature comparison loss is used as the loss function, and self-supervised training is completed using high-dimensional temporal feature vectors.

[0113] The adaptive fine-tuning module enables bidirectional linkage with the dynamic task generator and downstream task interfaces. It has a built-in task feature adaptation evaluation unit, which is used to dynamically adjust the parameter weights of the temporal feature encoder and the dynamic task generator according to the requirements of downstream tasks.

[0114] In one possible embodiment, the temporal feature encoder includes a sliding window convolutional layer, a cross-modal coupled feature processing unit, and an improved Transformer network. The specific steps of S1 include:

[0115] S11. Multi-scale local features of measurement data are extracted in parallel through sliding window convolutional layers, and the local features at each scale are fused to output multi-scale fused features.

[0116] S12. Based on the feature contribution of downstream tasks, the cross-modal coupling feature processing unit dynamically allocates modal attention weights to data from different sources in the measurement data. Based on the modal attention weights, the data from different sources are weighted and fused to obtain the fused cross-modal features. The fused cross-modal features are then channel-superimposed with the multi-scale fused features to form a joint feature vector.

[0117] Specifically, the cross-modal coupled feature processing unit achieves multi-source data fusion through a modal attention weight matrix. The element values ​​of the modal attention weight matrix are dynamically allocated based on the feature contribution of the multi-source measurement data in the downstream task. For example, in the fault diagnosis task, the feature contribution of current data is higher, so the corresponding weight value will be increased accordingly, while the weight value of temperature data will be appropriately reduced; in the equipment thermal stability assessment task, the weight value of temperature data will be increased.

[0118] S13. The joint feature vector is processed by a time attention mechanism that integrates power grid physical constraints to obtain enhanced features.

[0119] S14. Enhance the features by using an improved Transformer network to output a high-dimensional feature vector.

[0120] In this embodiment, the cross-modal coupling feature processing unit effectively integrates heterogeneous data from multiple sources, including electrical quantities (voltage, current) and non-electrical quantities (temperature). Through a modal attention mechanism, it breaks down traditional data silos at the feature level, achieving deep fusion and complementary enhancement of multi-dimensional power grid monitoring information. Furthermore, the cross-modal coupling feature processing unit introduces a task-oriented modal attention mechanism, dynamically evaluating the importance of data from different sources based on downstream tasks and assigning fusion weights. This makes feature fusion no longer a simple concatenation, but rather an optimal information integration that is task-adaptive, significantly improving the relevance and specificity of features for particular downstream tasks. By superimposing the fused cross-modal features and multi-scale local features along the channel dimension, a joint feature vector with richer dimensions and more complete information is formed, providing a high-quality, high-information-density input foundation for subsequent deep feature extraction.

[0121] In one possible embodiment, the sliding window convolutional layer includes a first convolutional kernel, a second convolutional kernel, and a third convolutional kernel; the specific steps of S11 include:

[0122] The instantaneous disturbance features in the measurement data are captured by the first convolutional kernel; the short-term fluctuation features in the measurement data are captured by the second convolutional kernel; the scale of the second convolutional kernel is larger than that of the first convolutional kernel; the long-term trend features in the measurement data are captured by the third convolutional kernel; the scale of the third convolutional kernel is larger than that of the second convolutional kernel; after spatial dimension alignment of the instantaneous disturbance features, short-term fluctuation features and long-term trend features, they are superimposed and fused along the channel dimension to form multi-scale fused features.

[0123] In practice, the size of the sliding window is dynamically adjusted based on the sampling frequency and data type of the measurement data. When the sampling frequency of the measurement data is greater than or equal to a preset high sampling frequency threshold (e.g., 50Hz), the sliding window size is set to the first time step (e.g., 10 time steps). When the data type of the measurement data is a type of data with gradual changes (e.g., temperature), the sliding window size is set to the second time step (e.g., 20 time steps). This adaptability ensures that the temporal resolution of feature extraction is optimally matched with the physical change characteristics and information density of the data, significantly improving the efficiency and relevance of feature extraction.

[0124] The sliding window convolutional layer uses three sets of convolutional kernels of different sizes. The first convolutional kernel, which is fine-grained, is set to 3×3 and is specifically used to capture transient disturbance features (such as lightning strikes or current surges caused by switching operations). The second convolutional kernel, which is medium-grained, is set to 5×5 and is specifically used to capture short-term fluctuation features (such as voltage fluctuations within a few minutes). The third convolutional kernel, which is coarse-grained, is set to 7×7 and is specifically used to capture trend features (such as load change trends and temperature change trends within a day).

[0125] In this embodiment, a parallel sliding window convolutional layer is used to simultaneously capture three key features in power grid measurement data: instantaneous disturbances, short-term fluctuations, and long-term trends. This multi-scale parallel extraction avoids the information limitations of single-scale convolution and, through channel overlay and fusion, enables the model to comprehensively and meticulously characterize the complete evolution of the power grid's operating state in the time domain.

[0126] In one possible embodiment, the specific steps of S12 include:

[0127] Based on the rated power frequency cycle of the power grid, a time-series position coding factor is generated for each time step; the time-series position coding factor is fused with the features of the corresponding time step in the joint feature vector to obtain intermediate features; based on the voltage and current phase difference and the measured active power values ​​of different time steps, an electrical quantity correlation weight matrix is ​​constructed; the electrical quantity correlation weight matrix is ​​used to quantify the correlation importance between data of different time steps; based on the electrical quantity correlation weight matrix, attention-weighted aggregation and transformation are performed on the intermediate features to obtain enhanced features.

[0128] In practical implementation, the time attention mechanism that integrates power grid physical constraints is a key component of the time-series feature encoder. Its core function is to ensure that the model follows the physical operating laws of the power grid when focusing on time-series data. This mechanism introduces a time-series location coding factor based on the power grid's rated parameters and an electrical quantity association weight matrix. The time-series location coding factor is used to assign physical meaning to the time dimension of the data, and its calculation formula is as follows:

[0129]

[0130] in, Let be the temporal position encoding factor at time step t; This is the current time step; The rated power frequency period of the power grid is usually taken as 20 milliseconds corresponding to 50Hz; sin() represents the sine function; cos() represents the sine function; the superscript T represents the transpose matrix.

[0131] The dimensionality of the time-series location encoding factor should be consistent with the feature dimension of the measurement data to ensure direct superposition and fusion with the data features. Specifically, after feature extraction, the measurement data (voltage, current, etc.) is transformed into a 64-dimensional feature vector (the dimension can be adjusted between 32 and 128 dimensions depending on the data complexity). The time-series location encoding factor is aligned with the feature vector dimension through dimensional expansion, and then the fusion of time information and data features is achieved through element-wise addition. This design not only meets the input dimension compatibility requirements of the Transformer model, but also, through the embedding of physical constraints, makes the time-series correlations learned by the model more closely match the actual operating rules of the power grid.

[0132] The electrical quantity correlation weight matrix is ​​used to dynamically adjust the correlation importance of measurement data at different time steps. Its element values ​​are dynamically updated using the following formula:

[0133]

[0134] in, The correlation weights between the data at time step i and time step j in the electrical quantity correlation weight matrix are: and These are preset weighting coefficients; in practical applications, they can be set to α=0.7 and β=0.3. Let be the voltage-current phase difference at time steps i and j; The measured value of active power at time step i; Let be the measured value of active power at time step j; min() indicates taking the minimum value.

[0135] The element values ​​of the electrical quantity correlation weight matrix strictly follow the voltage and current phase correlation constraints and the power conservation law during the update process, avoiding correlation weight allocation that does not conform to the common sense of power grid physics, thereby strengthening the characteristic response at key time nodes (such as voltage sudden changes and power fluctuations) and improving the sensitivity to abnormal states.

[0136] In one possible embodiment, the improved Transformer network includes a batch normalization unit and an electrical quantity normalization unit connected in sequence; the specific steps of S14 include:

[0137] The enhanced features are standardized by batch normalization unit to standardize the distribution of batches; the standardized features are truncated and normalized by electrical quantity normalization unit based on the rated electrical parameters of the power grid to obtain high-dimensional feature vectors.

[0138] In the specific implementation process, the input enhancement features are first standardized by calculating the mean and variance of each batch using a batch normalization unit. Then, an electrical quantity normalization unit sets a normalization threshold based on the grid's rated voltage and rated current ranges. For voltage features, the normalization threshold is the rated voltage. ±10% (i.e. For current characteristics, the normalized threshold is the rated current. ±15% (i.e. ).

[0139] For example, for a power grid with a rated voltage of 220kV, the normalization threshold is set to 198kV to 242kV, and for a line with a rated current of 1000A, the normalization threshold is set to 850A to 1150A.

[0140] For the standardized features of the input ,like Then normalization is performed according to the following formula:

[0141]

[0142] in, This corresponds to the lower bound of the normalized threshold. This corresponds to the upper limit of the normalization threshold. This is the normalized value.

[0143] For abnormal data exceeding the threshold, threshold truncation is applied, i.e.: if Then let ;like Then let .

[0144] In this embodiment, the standardization process of the batch normalization unit can eliminate the distribution differences between different batches of data, ensuring the numerical stability and efficient convergence of the model training. The truncation process of the electrical quantity normalization unit can automatically identify and constrain abnormal data exceeding the rated range, preventing outliers such as measurement noise and communication errors from interfering with model training. This fundamentally ensures that the model's learning pattern conforms to the actual power grid, avoids physically infeasible solutions, and improves the physical interpretability of the model features.

[0145] In summary, the self-supervised learning model training method based on measurement data provided in this application has the following beneficial effects:

[0146] 1. By deeply embedding the unique physical constraints of the power grid (such as power conservation, voltage and current phase correlation, and rated parameter range) into the core components of the model, integrating the time-series position encoding factor into the rated power frequency cycle of the power grid, dynamically following physical rules in the electrical quantity correlation weight matrix, and ensuring that the features conform to the actual operating boundary through a dual normalization structure, the model feature learning no longer relies on pure data-driven approaches, but rather takes into account both "data patterns and physical common sense". This makes the output features more reasonable for power grid operation and significantly improves the generalization ability under different power grid scenarios (such as substations of different voltage levels and different operating conditions), reducing the performance degradation of the model caused by differences in data distribution.

[0147] 2. To address the challenges of high noise, multi-source heterogeneity, and multi-scale characteristics in power grid measurement data, a dynamically adaptable data processing and training mechanism was designed. A sliding window convolutional layer extracts instantaneous disturbances, short-term fluctuations, and long-term trend features in parallel using three sets of convolutional kernels at different scales. Cross-modal coupling units dynamically allocate multi-source data weights according to downstream task requirements. An adaptive mask ratio is precisely adjusted based on noise levels. A physical constraint-guided comparison task constructs sample pairs based on data statistical characteristics and physical boundaries. This enables the model to specifically process measurement data of different qualities and types, effectively filtering noise interference, integrating multi-source information, and capturing key features. Compared to traditional models with fixed structures, it has a higher tolerance for missing values ​​and noise, and extracts more complete and discriminative high-dimensional temporal features.

[0148] 3. The adaptive fine-tuning module quantifies the matching degree and employs a differentiated update strategy of "freezing core parameters + dynamically adjusting local parameters." This allows for downstream task adaptation without retraining the entire model, ensuring the stability of the model's core feature extraction capabilities while rapidly responding to the varying needs of different downstream tasks. Simultaneously, the dynamic task generator autonomously generates training tasks based on real-time data characteristics, reducing the cost and trial-and-error cycle of manual task design and enabling the model to quickly adapt to different data qualities and application scenarios.

[0149] The following section introduces the practical application scenarios of the self-supervised learning model training method based on measurement data provided in this application.

[0150] Taking the scenario of "24-hour daily load forecast of 110kV regional substation" as an example, the substation serves a county town and three surrounding small industrial zones. The core requirement is to accurately predict the electricity load (unit: MW) every 15 minutes, so as to support the power grid dispatching department to optimize the power supply plan and avoid overload or insufficient power supply.

[0151] (a) Data Acquisition and Preprocessing Stage

[0152] Three types of core data were acquired from the substation's power consumption data acquisition system, with a sampling frequency of 15 minutes per sampling, a time span of 3 months, and a total of approximately 11,500 data points. The core power consumption data includes total active power, voltage (110kV side line voltage), and current (low-voltage side current of the main transformer). The auxiliary data covers the daily maximum and minimum temperatures at the substation location, as well as the date type (weekday / weekend / holiday). Among these, the temperature data is mainly used to correct for the impact of air conditioning and heating loads.

[0153] For missing data, if the total active power data for a certain period is missing and the missing rate is ≤3%, a linear interpolation method with power balance verification is used to process it. The interpolation result must satisfy: total active power = sum of power of each outgoing line, to ensure compliance with the power conservation constraint of the power grid.

[0154] For noisy data, since the load data has low noise (SNR≥35dB), only a small amount of acquisition error data is identified using the 3σ criterion, and then smoothed by a sliding window filter with 5 time steps. The window size is adapted to the 15-minute sampling frequency to avoid destroying the trend characteristics of the load itself.

[0155] (II) Feature Extraction and Deepening Stage

[0156] The preprocessed data is input into a time-series feature encoder, which focuses on extracting load time-series trends and correlation features. The sliding window convolutional layer captures features in parallel using three sets of convolutional kernels of different scales. The 3×3 convolutional kernel is specifically used to capture short-term load fluctuations caused by factory start-ups and shutdowns, such as a sudden load increase of 5-8MW when a production line in an industrial area starts at 10:00. The 5×5 convolutional kernel is used to capture the concentrated load growth features of residents during the morning peak (7:00-9:00) and evening peak (18:00-21:00). The 7×7 convolutional kernel focuses on long-term trend features, such as weekday load being 15%-20% higher than weekend load and summer cooling load being 25% higher than spring load.

[0157] The cross-modal coupling unit performs differentiated weight allocation in the load forecasting task, assigning 60% core weight to total active power and historical load data, 25% auxiliary verification weight to voltage and current data, and 15% trend correction weight to temperature and date type data, and finally fusing multi-source data into a 64-dimensional joint feature vector.

[0158] The time attention mechanism enhances the characteristic response at key time points such as morning and evening peak hours and factory start-up and shutdown, while ensuring that the characteristics meet the substation's rated constraints, such as the total active power not exceeding the main transformer's rated capacity of 100MW.

[0159] The improved Transformer's dual normalization process first unifies the data distribution through batch normalization, and then constrains the total active power to 0-120MW (1.2 times the rated capacity of 100MW, with a safety margin) and the voltage to 99-121kV (110kV±10%), to prevent the characteristics from exceeding the physical operating boundaries.

[0160] (III) Self-monitored training phase

[0161] The dynamic task generator leverages the low noise and high integrity of load forecast data to generate adaptive training tasks.

[0162] In the adaptive masking time series prediction task, due to the low data noise (SNR≥35dB), the masking ratio is set to 10%-15%, and the focus is on masking the load stable period such as 1:00-4:00 am, so that the model can focus on practicing the ability to complete the stable load based on the trend, and avoid the masking of data during the key peak period affecting the training effect.

[0163] In the physical constraint-guided dynamic feature comparison task, positive sample pairs select similar load data from the same time period on adjacent dates, such as load data at 7:30 on Monday and Tuesday, requiring load deviation ≤3% and voltage deviation ≤5% to ensure that positive sample pairs represent load patterns under the same electricity consumption scenario. Negative sample pairs select load data from different date types or different seasons, such as weekday 10:00 and weekend 10:00, summer 14:00 and winter 14:00, requiring load deviation >20% to clarify load differences under different electricity consumption scenarios. The training process adopts a weighted loss function of "mask prediction loss (30%) + feature comparison loss (70%)", highlighting the emphasis of load prediction on trend comparison. The model converges when the loss change is <1e-4 for 10 consecutive batches. At this time, the model has autonomously learned core features such as weekday / weekend load differences, morning and evening peak patterns, and the impact of temperature on load.

[0164] (iv) Model adaptation stage

[0165] In the fit evaluation stage, since the core requirement for load forecasting is the accuracy of time-series trend fitting, the fit weight was adjusted to "feature matching degree 70% + physical constraint satisfaction degree 30%". The feature matching degree evaluates the similarity between the model output and historical load trends, while the physical constraint satisfaction degree verifies that the predicted load does not exceed the rated capacity of the main transformer. The initial fit score was 75 (not meeting the standard). Therefore, the core parameters of the time-series feature encoder were frozen, and only the mapping layer parameters of the dynamic task generator (learning rate 1e-4) were updated to strengthen the association between date type, temperature, and load in task generation. Simultaneously, the weight of temperature data in the cross-modal coupling unit was increased from 15% to 20% to accommodate the significant impact of summer cooling loads. After adjustment, the fit score reached 88 (meeting the standard), and fine-tuning was stopped.

[0166] (v) Load forecasting stage

[0167] After fine-tuning, a self-supervised learning model adapted to the load forecasting task is obtained. By inputting the load, voltage, and temperature data of the previous 24 hours into the model, the load forecast value for the next 24 hours can be output every 15 minutes.

[0168] The electricity load of this 110kV substation is mainly affected by residential electricity consumption and small-scale industrial production. Residential electricity consumption exhibits peak characteristics in the morning and evening, while industrial electricity consumption shows a pattern of stability on weekdays and a decrease on weekends. Historical load data includes both short-term fluctuations caused by factory start-ups and shutdowns and long-term trends due to seasonal variations. The model obtained using the self-supervised learning model training method based on measurement data provided in this application significantly improves prediction accuracy. The cycle from pre-training to task-adapted deployment is short, eliminating the need for manual annotation of complex information such as load peak types and influencing factors. Furthermore, when load patterns change due to weekends or holidays, there is no need to retrain the entire model; only periodic adaptive fine-tuning is required for rapid adaptation. Because the model is built into physical constraint verification, the predicted load has never exceeded the rated capacity of the main transformer, effectively avoiding potential risks in the scheduling scheme.

[0169] Based on the same inventive concept, this application also provides a computer device, which includes a processor, a memory, and a computer program stored in the memory. The computer program is executed by the processor to implement the aforementioned self-supervised learning model training method based on measurement data.

[0170] Based on the same inventive concept, this application also provides a computer storage medium storing a computer program, which is executed by a processor to implement the aforementioned self-supervised learning model training method based on measurement data.

[0171] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a device including one or any combination of the above-mentioned memories. The computer may be a variety of computing devices, including smart terminals and servers.

[0172] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0173] As an example, executable instructions may, but do not necessarily, correspond to files in the file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., a file that stores one or more modules, subroutines, or code sections).

[0174] As an example, executable instructions can be deployed to execute on a single computing device, or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.

[0175] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0176] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0177] The above specific embodiments further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for training a self-supervised learning model based on measurement data, characterized in that, include: The measurement data is input into a time-series feature encoder for processing, and a high-dimensional feature vector is output. Based on the noise level and real-time statistical distribution characteristics of the measurement data, a mask time series prediction task is dynamically generated by a dynamic task generator. Based on the real-time statistical distribution characteristics of the measurement data, a dynamic task generator dynamically generates feature comparison tasks. The dynamic task generator dynamically determines the weights of the first loss term for the masking time series prediction task and the second loss term for the feature comparison task based on the noise level of the measurement data, and constructs a loss function based on the weighted sum of the first and second loss terms. Using the high-dimensional feature vector, the self-supervised learning model containing the temporal feature encoder and the dynamic task generator is pre-trained by optimizing the loss function to obtain a pre-trained model; The adaptive fine-tuning module evaluates the fit between the high-dimensional feature vector and the downstream task, and the parameters of the pre-trained model are fine-tuned based on the fit to obtain a self-supervised learning model adapted to the downstream task.

2. The method for training a self-supervised learning model based on measurement data according to claim 1, characterized in that, The temporal feature encoder includes a sliding window convolutional layer, a cross-modal coupled feature processing unit, and an improved Transformer network; The step of inputting measurement data into a time-series feature encoder for processing and outputting a high-dimensional feature vector includes: The sliding window convolutional layer extracts multi-scale local features of the measurement data in parallel, and fuses the local features at each scale to output multi-scale fused features. Based on the feature contribution of the downstream task, the cross-modal coupling feature processing unit dynamically allocates modal attention weights to data from different sources in the measurement data. Based on the modal attention weights, the data from different sources are weighted and fused to obtain fused cross-modal features. The fused cross-modal features are then channel-superimposed with the multi-scale fused features to form a joint feature vector. The joint feature vector is processed using a time attention mechanism that integrates power grid physical constraints to obtain enhanced features; The enhanced features are further refined using the improved Transformer network, resulting in a high-dimensional feature vector.

3. The method for training a self-supervised learning model based on measurement data according to claim 2, characterized in that, The sliding window convolutional layer includes a first convolutional kernel, a second convolutional kernel, and a third convolutional kernel; the multi-scale local features of the measurement data are extracted in parallel through the sliding window convolutional layer, and the local features at each scale are fused to output multi-scale fused features, including: The instantaneous perturbation features in the measurement data are captured by the first convolutional kernel; The second convolutional kernel captures short-term fluctuation features in the measurement data; the scale of the second convolutional kernel is larger than that of the first convolutional kernel. The third convolutional kernel captures long-term trend features in the measurement data; the scale of the third convolutional kernel is larger than that of the second convolutional kernel. After aligning the instantaneous disturbance features, short-term fluctuation features, and long-term trend features spatially, they are superimposed and fused along the channel dimension to form a multi-scale fused feature.

4. The method for training a self-supervised learning model based on measurement data according to claim 2, characterized in that, The process of using a time attention mechanism that integrates power grid physical constraints to process the joint feature vector to obtain enhanced features includes: Based on the rated power frequency cycle of the power grid, the timing position coding factor for each time step is generated; The temporal position encoding factor is fused with the features of the corresponding time step in the joint feature vector to obtain intermediate features; Based on the phase difference of voltage and current and the measured values ​​of active power at different time steps, an electrical quantity correlation weight matrix is ​​constructed; the electrical quantity correlation weight matrix is ​​used to quantify the correlation importance between data at different time steps; Based on the electrical quantity correlation weight matrix, attention-weighted aggregation and transformation are performed on the intermediate features to obtain enhanced features.

5. The method for training a self-supervised learning model based on measurement data according to claim 2, characterized in that, The improved Transformer network includes batch normalization units and electrical quantity normalization units connected in sequence; the step of deepening the enhanced features through the improved Transformer network to output a high-dimensional feature vector includes: The batch normalization unit is used to standardize the distribution of the enhancement features between batches to obtain standardized features. The electrical quantity normalization unit performs truncation and normalization processing on the standardized features based on the rated electrical parameters range of the power grid to obtain a high-dimensional feature vector.

6. The method for training a self-supervised learning model based on measurement data according to claim 1, characterized in that, The noise level is characterized by the signal-to-noise ratio; the dynamic generation of a mask time series prediction task based on the noise level and real-time statistical distribution characteristics of the measurement data by the dynamic task generator includes: When the signal-to-noise ratio is greater than or equal to the first threshold, the mask ratio of the mask timing prediction task is set to the first ratio. When the signal-to-noise ratio is less than the first threshold and greater than or equal to the second threshold, the mask ratio is set to the second ratio; the first threshold is greater than the second threshold. When the signal-to-noise ratio is less than the second threshold, the mask ratio is set to a third ratio; the first ratio is less than the second ratio, and the second ratio is less than the third ratio.

7. The method for training a self-supervised learning model based on measurement data according to claim 1, characterized in that, The step of dynamically generating a mask time series prediction task based on the noise level and real-time statistical distribution characteristics of the measurement data using a dynamic task generator includes: Based on the real-time statistical distribution characteristics of the measurement data, time-series segments in the measurement data that characterize the dynamic changes of electrical quantities are identified as mask candidate regions; the time-series segments that characterize the dynamic changes of electrical quantities refer to the portions of the measurement data whose rate of change or magnitude of change exceeds a preset dynamic threshold. From the mask candidate region, data integrity key nodes are excluded to determine the mask position of the mask timing prediction task; the data integrity key nodes include: the start and end positions of the data continuum segment, and the time point that represents the important operation state switch.

8. The method for training a self-supervised learning model based on measurement data according to claim 1, characterized in that, The step of dynamically generating feature comparison tasks based on the real-time statistical distribution characteristics of the measurement data using a dynamic task generator includes: From the measurement data collected at the same power grid monitoring point in adjacent time periods, positive sample pairs for generating feature comparison tasks are screened and constructed; wherein, the two data sets of the positive sample pair satisfy the following: voltage deviation, current deviation, and power deviation do not exceed the first preset deviation, and power conservation deviation does not exceed the second preset deviation; From measurement data collected from different power grid monitoring points, or from the same monitoring point under different operating conditions, negative sample pairs for feature comparison tasks are screened and constructed; wherein, the two data sets of the negative sample pairs satisfy the following: the voltage and current phase difference exceeds the third preset deviation, and the power balance relationship deviation exceeds the fourth preset deviation.

9. The method for training a self-supervised learning model based on measurement data according to claim 1, characterized in that, The noise level is characterized by the signal-to-noise ratio; the dynamic determination of the weights of the first loss term of the mask temporal prediction task and the second loss term of the feature comparison task based on the noise level of the measurement data by the dynamic task generator includes: When the signal-to-noise ratio is greater than or equal to the first threshold, the weight of the first loss term is set to be less than the weight of the second loss term; When the signal-to-noise ratio is less than the first threshold and greater than or equal to the second threshold, the weight of the first loss term is set to be equal to the weight of the second loss term; the first threshold is greater than the second threshold. When the signal-to-noise ratio is less than the second threshold, the weight of the first loss term is set to be greater than the weight of the second loss term.

10. The method for training a self-supervised learning model based on measurement data according to claim 1, characterized in that, The step of fine-tuning the parameters of the pre-trained model based on the fitness level to obtain a self-supervised learning model adapted to the downstream task includes: If the fit is less than the preset fit threshold, then the core parameters of the temporal feature encoder remain unchanged. Update the mapping layer parameters of the dynamic task generator according to the preset learning rate; The intermediate layer parameters of the dynamic task generator are updated according to the dynamic learning rate; the dynamic learning rate is dynamically determined based on the degree of deviation between the fitness and the preset fitness threshold, and the dynamic learning rate does not exceed a predetermined multiple of the preset learning rate.