Power grid state prediction method, device and equipment and storage medium
By filtering abnormal segments in power grid runtime sequence data and text, and generating text semantic vectors, the problem of misjudgment in traditional power grid state prediction under complex operating conditions is solved, and power grid state identification with high accuracy and stability is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN POWER SUPPLY BUREAU
- Filing Date
- 2026-03-02
- Publication Date
- 2026-08-04
AI Technical Summary
Traditional methods struggle to achieve stable and reusable power grid state prediction under complex operating conditions, especially in the boundary region between normal and slightly abnormal conditions, where misjudgments and result fluctuations are prone to occur. Existing multimodal methods lack alignment criteria consistent with the power system state mechanism, resulting in cross-modal representations that are "similar in form but different in essence" at the semantic level.
By acquiring the power grid's runtime sequence data and raw text, abnormal fragment sequences are filtered out, the text paragraph with the highest comprehensive semantic response score is determined, feature fusion is performed, a text semantic vector is generated, and it is input into the power grid state prediction model for state prediction.
It improves the accuracy, stability, and interpretability of power grid status identification under complex operating conditions, and has a reproducible and deployable implementation path on the engineering side.
Smart Images

Figure CN121786705B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of power grid condition prediction technology, and in particular to a power grid condition prediction method, apparatus, computer equipment, and computer-readable storage medium. Background Technology
[0002] With the increasing demand for intelligent power grid production inspections, the scale and complexity of on-site operation data and maintenance records have increased dramatically. Traditional methods often process equipment operation sequences and manual inspection texts separately, relying on statistical thresholds or keyword rules to predict the power grid status and obtain alarms and maintenance suggestions. However, traditional methods struggle to form stable and reusable state prediction capabilities under complex operating conditions. On the one hand, the original time series sequences are mainly long-term stable segments, with sparse abnormal behaviors and influenced by factors such as load, environment, and operating condition switching. Simple full-scale modeling can be overwhelmed by redundant backgrounds and amplify noise. On the other hand, inspection texts are mostly freely written, with problems such as ambiguous references, out-of-order descriptions, and inconsistent terminology. Direct semantic encoding makes it difficult to accurately associate them with specific equipment physical behaviors. Existing multimodal methods that fuse time series and text often employ parallel encoding and vector concatenation or contrastive learning strategies, lacking alignment criteria consistent with the power system state mechanism. This results in cross-modal representations that are "similar in form but different in essence" at the semantic level, especially in the boundary region between normal and mildly abnormal conditions, which is prone to misjudgment and result fluctuations. Therefore, improving the accuracy of power grid condition prediction has become an urgent technical problem to be solved. Summary of the Invention
[0003] Therefore, it is necessary to provide a power grid state prediction method, apparatus, computer equipment, and computer-readable storage medium to address the aforementioned technical problems, thereby improving the accuracy of power grid state prediction.
[0004] In a first aspect, this application provides a power grid state prediction method, including:
[0005] Obtain the power grid's runtime sequence data and raw text; the raw text includes multiple raw text paragraphs;
[0006] Filter out abnormal fragment sequences from runtime sequence data;
[0007] For each original text segment, a comprehensive semantic response score is determined based on the original text segment and the sequence of anomalous segments.
[0008] The top K original text paragraphs with the highest comprehensive semantic response scores are selected as the target text paragraphs.
[0009] Feature fusion is performed on all target text paragraphs to obtain the text semantic vector;
[0010] The abnormal fragment sequence and text semantic vector are input into the power grid state prediction model to obtain the state prediction results.
[0011] In one embodiment, the power grid state prediction model includes a time-series coding module, a text coding module, and a state prediction module; the abnormal segment sequence and text semantic vector are input into the power grid state prediction model to obtain the state prediction result, including:
[0012] The abnormal segment sequence is input into the timing coding module to obtain the timing mode representation;
[0013] The text semantic vector is input into the text encoding module to obtain the text modal representation;
[0014] The temporal modality representation and the text modality representation are weighted and fused to obtain a shared representation;
[0015] The shared representation is input into the state prediction module to obtain the state prediction result.
[0016] In one embodiment, filtering out aberrant fragment sequences from runtime sequence data includes:
[0017] The runtime sequence data is segmented to obtain multiple runtime sequence segments; each runtime sequence segment includes a status label, which includes a normal label or an abnormal label.
[0018] The standard deviation is calculated for each runtime segment to obtain the corresponding fluctuation intensity value;
[0019] The abnormal segment sequence is determined based on the runtime segment whose fluctuation intensity value is greater than the preset screening threshold and whose status label is an abnormal label.
[0020] In one embodiment, an abnormal segment sequence is determined based on runtime segments whose fluctuation intensity value is greater than a preset screening threshold and whose status label is an abnormal label, including:
[0021] Obtain the paragraph indexes where the fluctuation intensity value is greater than the preset filtering threshold and the status label is an anomaly label;
[0022] Expand the paragraph index;
[0023] The runtime segment corresponding to the expanded segment index is identified as the abnormal segment sequence.
[0024] In one embodiment, for each original text segment, a comprehensive semantic response score for the original text segment is determined based on the original text segment and the sequence of anomalous fragments, including:
[0025] Differential sequence extraction and encoding of abnormal fragment sequences yield multiple behavioral pattern embeddings;
[0026] Convert each original text paragraph into a text embedding;
[0027] For each original text segment, the cosine similarity between the text embedding corresponding to the original text segment and each behavior pattern embedding is calculated to obtain multiple cosine similarity values corresponding to the original text segment.
[0028] For each prior signal behavior change corresponding to the abnormal segment sequence, calculate the Kullback-Leibler divergence between the preset text language probability distribution and the prior signal behavior change. Multiply the calculated Kullback-Leibler divergence with the preset balance term to obtain the prior matching contribution value.
[0029] For each original text segment, the sum of multiple cosine similarity values and all prior matching contribution values corresponding to the original text segment is divided by the total number of sampling points of the abnormal segment sequence to obtain the comprehensive semantic response score of the original text segment.
[0030] In one embodiment, feature fusion is performed based on all target text paragraphs to obtain a text semantic vector, including:
[0031] Each target text segment is input into the encoder to obtain the corresponding target text vector;
[0032] For each target text paragraph, the attention weight corresponding to the target text paragraph is determined based on the ratio of the comprehensive semantic response score of the target text paragraph to the sum of the comprehensive semantic response scores of all target text paragraphs.
[0033] Based on the attention weight corresponding to each target text paragraph, a weighted sum is performed on all target text paragraphs to obtain the text semantic vector.
[0034] In one embodiment, before acquiring the power grid's runtime sequence data and raw text, the method further includes:
[0035] Acquire historical runtime sequence data and historical raw text of the power grid; the historical raw text includes multiple historical raw text paragraphs.
[0036] Filter out historical abnormal segment sequences from historical runtime sequence data;
[0037] For each historical original text segment, a comprehensive semantic response score is determined based on the historical original text segment and the historical anomalous segment sequence.
[0038] The top K historical original text paragraphs with the highest comprehensive semantic response scores are used as historical target text paragraphs.
[0039] Feature fusion is performed on all historical target text paragraphs to obtain the semantic vector of the historical text;
[0040] The initial state prediction model is trained based on historical anomaly fragment sequences and historical text semantic vectors to obtain the power grid state prediction model.
[0041] Secondly, this application also provides a power grid state prediction device, comprising:
[0042] The acquisition module is used to acquire the power grid's runtime sequence data and raw text; the raw text includes multiple raw text paragraphs.
[0043] The filtering module is used to filter out abnormal fragment sequences from runtime sequence data;
[0044] The determination module is used to determine the comprehensive semantic response score of each original text paragraph based on the original text paragraph and the sequence of anomalous fragments; the top K original text paragraphs with the highest comprehensive semantic response scores are selected as target text paragraphs.
[0045] The fusion module is used to perform feature fusion based on all target text paragraphs to obtain a text semantic vector;
[0046] The prediction module is used to input abnormal fragment sequences and text semantic vectors into the power grid state prediction model to obtain state prediction results.
[0047] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in the first aspect above.
[0048] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first aspect above.
[0049] The aforementioned power grid state prediction method, apparatus, computer equipment, and computer-readable storage medium acquire power grid runtime sequence data and raw text. The raw text includes multiple raw text segments. Anomaly segment sequences are filtered from the runtime sequence data. For each raw text segment, a comprehensive semantic response score is determined based on the raw text segment and the anomaly segment sequence. The top K raw text segments with the highest comprehensive semantic response scores are selected as target text segments. Feature fusion is performed on all target text segments to obtain a text semantic vector. The anomaly segment sequence and the text semantic vector are input into the power grid state prediction model to obtain the state prediction result. Through this method, state-driven anomaly segment extraction compresses runtime sequence data into key anomaly segment sequences strongly correlated with equipment state, effectively filtering out long-term stable background and noise interference, and establishing clear physical behavior anchors for subsequent analysis. Utilizing the temporal response clues contained in the anomaly segment sequences, highly correlated raw text segments are back-filtered and encoded to generate language expressions that are homologous to equipment behavior, i.e., text semantic vectors. By integrating data sampling, anomaly screening, feature alignment, and predictive inference into a logical closed loop, the accuracy, stability, and interpretability of power grid status identification can be improved under complex operating conditions, and it has a reproducible and deployable implementation path on the engineering side. Attached Figure Description
[0050] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0051] Figure 1 This is a flowchart illustrating a power grid state prediction method in one embodiment;
[0052] Figure 2 This is a structural block diagram of a power grid state prediction device in one embodiment;
[0053] Figure 3 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0054] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0055] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0056] In one exemplary embodiment, such as Figure 1 As shown, a power grid state prediction method is provided, and the method is illustrated using a server as an example, including:
[0057] Step 102: Obtain the power grid's runtime sequence data and raw text; the raw text includes multiple raw text paragraphs.
[0058] During equipment inspections at power grid sites, operational sequence data is collected by industrial-grade sensors deployed at key equipment nodes. For example, the methods for collecting operational sequence data include: switchgear, transformers, cable terminals, and other equipment are equipped with low-voltage transformers (for current acquisition), voltage sampling modules (for node voltage acquisition), and thermal imaging cameras (for equipment surface temperature acquisition). Local edge computing terminals collect data through these sensors and upload the data stream in real time, with the format uniformly set to time intervals. The sampling period for the continuous numerical sequence can be set or adjusted according to the device type, for example, 0.1 seconds or 1 second.
[0059] In order to predict the current state of the power grid, it is necessary to obtain the power grid's runtime sequence data. The original text refers to records written in natural language related to equipment inspection and status description, including but not limited to: manual inspection records, maintenance reports, and notes on alarm events. Manual inspection records can be understood as descriptive records filled out by inspection personnel after observing the equipment on-site or via remote video. Maintenance reports can be understood as reports written by technicians or automatically generated by the equipment after operation, maintenance, or troubleshooting. Notes on alarm events can be understood as supplementary explanations added by staff or automatically generated by the equipment after an alarm is generated by power grid equipment.
[0060] For example, the original text is a manual inspection record filled out during the manual inspection process. Includes multiple original text paragraphs Each This represents a piece of natural language text, collected from the text input module of the intelligent patrol terminal. The text varies in length and has undergone basic cleaning processing.
[0061] Optionally, semantic segmentation can be performed on the original text to obtain multiple original text segments.
[0062] Step 104: Filter out the abnormal fragment sequence from the runtime sequence data.
[0063] To achieve accurate alignment training of text semantics, it is necessary to extract anomalous segment sequences with state significance from runtime sequence data. Most of the runtime sequence data consists of stable operating segments of the device, with only a very small proportion of segments exhibiting abrupt changes or pre-failure behaviors.
[0064] For example, combining sensor sampling signals with historical status tags A combined strategy of volatility analysis and label filtering is used to extract structured outlier segments.
[0065] For example, each sampling point is treated as an independent sample, and an unsupervised model is used to directly determine whether it is an outlier. Then, consecutive outliers are aggregated into fragments to obtain an outlier fragment sequence.
[0066] For example, a long time series is cut into subsequences of fixed or variable length. Through a clustering strategy, subsequences far from the center of the cluster are identified as anomalies, resulting in anomaly fragment sequences.
[0067] Step 104 ultimately outputs the abnormal fragment sequence. ,in This sequence will serve as the basis for text semantic matching in the next step. Because this sequence is highly correlated with the state labels, it can provide a clear and reliable temporal input basis for the modality alignment task.
[0068] Step 106: For each original text paragraph, determine the comprehensive semantic response score of the original text paragraph based on the original text paragraph and the sequence of anomalous fragments.
[0069] Among them, the comprehensive semantic response score It is a quantitative evaluation metric used to assess the reliability of a text paragraph's description of an abnormal state. The higher the score of a given original text paragraph, the stronger the correlation between the original text paragraph and the current abnormal state of the device, and the more accurate the description, and therefore the more likely it should be used for subsequent state prediction.
[0070] For example, bimodal embedding encoding is performed on the original text paragraph and the sequence of anomalous fragments, the semantic correlation between the encoded features is calculated, and the comprehensive semantic response score of the original text paragraph is determined based on the semantic correlation.
[0071] For example, a neural network is pre-trained to take as input a fused representation of a text paragraph and a sequence of anomalous fragments, and output a scalar score. The goal of training is to rank this score in accordance with the degree to which the paragraph truly describes the current anomalous state. Optionally, the paragraph embeddings are jointly encoded with the embeddings of all anomalous fragment sequences (either concatenated or fused across attention) as a comprehensive feature; a regression layer is used to output the score. The training data includes weakly supervised labels at the paragraph level, and the loss function employs a pairwise ranking loss (such as Pairwise Hinge Loss) or a list loss (such as ListNet), enabling the neural network model to learn to output scores that conform to the true ranking. By feeding the original text paragraph and the sequence of anomalous fragments into this pre-trained neural network, a comprehensive semantic response score for the original text paragraph can be determined.
[0072] For example, statistical rules are set in advance based on domain knowledge, and the original text paragraphs and abnormal segment sequences are evaluated based on the statistical rules to determine the comprehensive semantic response score of the original text paragraphs.
[0073] Step 108: Select the top K original text paragraphs with the highest comprehensive semantic response scores as target text paragraphs.
[0074] Among them, in order to construct the semantic alignment target, from Selected from The most relevant subset of behavior Based on comprehensive semantic response score Select the K original text paragraphs with the highest comprehensive semantic response scores (e.g., K=3) and define them as target text paragraphs to obtain the target text paragraph set. K can be set or adjusted according to actual needs; this embodiment does not limit the specific value.
[0075] Step 110: Perform feature fusion based on all target text paragraphs to obtain the text semantic vector.
[0076] For example, a weighted average fusion strategy is adopted to perform a weighted average of the vector representation of each target text segment (the target text vector obtained by the encoder) according to its attention weight (obtained by normalization of the comprehensive semantic response score) to obtain the text semantic vector.
[0077] For example, all target text paragraphs are concatenated into a long sequence, which is then fed into an encoder to obtain a text semantic vector.
[0078] The final output text semantic vector It is not just a simple text embedding generation, but actively drives text information filtering through signal behavior, introduces physical behavior supervision in the text modeling stage, and forms a state semantic focus strategy across the entire chain.
[0079] This step focuses on the core objective of multimodal data alignment in power grid production inspection tasks, using abnormal fragment sequences. Based on this, a text semantic alignment extraction method driven by physical response is proposed. Traditional text processing methods often treat all text segments as equal input, ignoring the correspondence between text and actual device operating states. This results in a large amount of information unrelated to the current state being mixed into the semantic space, affecting alignment quality and state recognition accuracy. This step involves extracting the abnormal segment sequence... As physical anchors, they guide the semantic units in the text corresponding to the behavior, thereby forming a text semantic vector with the ability to respond to physical behaviors. This not only improves the accuracy of modality alignment, but also gives semantic space training a clear target convergence direction.
[0080] Step 112: Input the abnormal fragment sequence and text semantic vector into the power grid state prediction model to obtain the state prediction result.
[0081] The power grid state prediction model is the trained model. Optionally, the power grid state prediction model includes the alignment parameter set after the model training is completed. It includes all parameters of the temporal coding module, text coding module, and state prediction module, as well as the state difference standard deviation matrix used to regulate the modality fusion strategy. The abnormal fragment sequence and text semantic vector are used as input to the power grid state prediction model. The trained power grid state prediction model analyzes the features of the abnormal fragment sequence and text semantic vector, classifies them, and obtains the state prediction result.
[0082] In the aforementioned power grid state prediction method, the following steps are taken: First, the power grid's runtime sequence data and raw text are acquired. The raw text includes multiple raw text segments. Second, anomaly segment sequences are extracted from the runtime sequence data. For each raw text segment, a comprehensive semantic response score is determined based on the raw text segment and the anomaly segment sequence. Third, the top K raw text segments with the highest comprehensive semantic response scores are selected as target text segments. Fourth, feature fusion is performed on all target text segments to obtain a text semantic vector. Finally, the anomaly segment sequence and the text semantic vector are input into the power grid state prediction model to obtain the state prediction result. Through this method, state-driven anomaly segment extraction compresses the runtime sequence data into key anomaly segment sequences strongly correlated with equipment state, effectively filtering out long-term stable backgrounds and noise interference, and establishing clear physical behavior anchors for subsequent analysis. Finally, using the temporal response clues contained in the anomaly segment sequences, highly correlated raw text segments are selected and encoded to generate language expressions that are homologous to equipment behavior, i.e., text semantic vectors. By integrating data sampling, anomaly screening, feature alignment, and predictive inference into a logical closed loop, the accuracy, stability, and interpretability of power grid status identification can be improved under complex operating conditions, and it has a reproducible and deployable implementation path on the engineering side.
[0083] In an exemplary embodiment, the power grid state prediction model includes a time-series encoding module, a text encoding module, and a state prediction module; step 112 includes: inputting an abnormal segment sequence into the time-series encoding module to obtain a time-series modal representation; inputting a text semantic vector into the text encoding module to obtain a text modal representation; performing weighted fusion of the time-series modal representation and the text modal representation to obtain a shared representation; and inputting the shared representation into the state prediction module to obtain a state prediction result.
[0084] Specifically, the abnormal fragment sequence is input into the timing coding module to obtain the timing modal representation. The text semantic vector is input into the text encoding module to obtain the text modal representation. ; Based on the distance in the alignment space between the temporal modality representation and the text modality representation Construct single scalar gating coefficients from the dimensional mean Then, a weighted fusion is performed to obtain a shared representation. ;
[0085] ;
[0086] in, For the Sigmoid function; It is a distance scalar of the two-modal alignment space; Indicates to Arithmetic mean over the feature dimension; This is the gating gain hyperparameter, with a default value of 1.5 and a possible value range of [0.5, 3.0]. When the distance noise is large, it can be appropriately increased to improve the timing consistency requirements. This gating improves performance under conditions of strong two-modal consistency and small prior historical differences. The weight is increased when consistency is weak or prior discrepancies are large. The weights are adjusted to suppress misalignment amplification in non-discriminative dimensions. This represents a single scalar gating coefficient, with a value range from 0 to 1.
[0087] Then share the representation The input is fed into the state prediction module, where state prediction is performed on the shared representation. A transition cost vector based on the previous round's prediction category is added to reduce jitter, resulting in the state prediction result. :
[0088] ;
[0089] in, , For alignment parameter set Parameters of the linear discriminant layer frozen in the middle; To predict the category based on the previous time step Column vectors selected from a preset transition cost matrix (e.g., a larger cost for "cross-level jump" and a smaller cost for "adjacent level migration"). The weighting hyperparameter is set to 0.7 by default, with a possible value range of [0.0, 1.5]. It can be increased appropriately to enhance suppression when frequent switching noise exists in the field. This parameter should not be modified. Under the premise of interpretability, the output layer is subjected to posterior correction, reducing high-frequency false alarms caused by edge fluctuations, while also... Rapid transitions are still permitted even when the evidence is significantly enhanced.
[0090] In this embodiment, modal consistency and historical difference priors are combined for adaptive fusion during the inference stage, and class transfer suppression oriented towards operation and maintenance strategies is introduced to reduce edge jitter, thereby improving the accuracy of power grid status identification.
[0091] In an exemplary embodiment, step 104 includes: segmenting the runtime sequence data to obtain multiple runtime sequence segments; each runtime sequence segment includes a status label, which may include a normal label or an abnormal label; calculating the standard deviation of each runtime sequence segment to obtain a corresponding fluctuation intensity value; and determining an abnormal segment sequence based on runtime sequence segments whose fluctuation intensity value is greater than a preset screening threshold and whose status label is an abnormal label.
[0092] Among them, runtime sequence data Based on fixed window length The system is segmented to obtain runtime segments, each containing M sampling points (e.g., 50 sampling points). Each runtime segment includes a status label, which can be either a normal or abnormal label. The local standard deviation is calculated for each runtime segment to obtain the corresponding fluctuation intensity value. :
[0093] ;
[0094] ;
[0095] in, Display window The mean value within the range is used to assess the stability of the benchmark. This represents the fluctuation intensity value for each window segment. It is the length of the sliding window, expressed in units of the number of sampling points. For the first The current runtime segment of each sampling point is obtained directly from the sensor. In actual sampling, the normal segment... Most values fall within the range of 0.2 to 0.4, while abnormal values are usually much higher than this range.
[0096] For example, all the calculated Construct a wave intensity sequence and further calculate its global median. The preset filtering threshold is If the fluctuation intensity value is greater than the preset screening threshold... If the status label is an exception label, then the corresponding runtime segment is an exception fragment sequence.
[0097] For example, all that meet The window segments were initially marked as physical anomaly segments. These physical anomaly segments were then compared with historical tags. The timestamps corresponding to mild or severe anomalies are compared, and only the paragraph indexes that simultaneously satisfy both volatility and label anomaly are retained to form the anomaly window index set. Optionally, the fragments of runtime sequence data pointed to by the exception window index set are identified as exception fragment sequences.
[0098] In an exemplary embodiment, determining an abnormal segment sequence based on runtime segments whose fluctuation intensity value is greater than a preset filtering threshold and whose status label is an abnormal label includes: obtaining the segment index of the segment whose fluctuation intensity value is greater than the preset filtering threshold and whose status label is an abnormal label; expanding the segment index; and determining the runtime segment corresponding to the expanded segment index as the abnormal segment sequence.
[0099] In order to preserve the contextual continuity of the physical response, boundary expansion is performed on each selected window segment, resulting in the final sequence of abnormal fragments. The definition is as follows:
[0100] ;
[0101] in, To extend the window boundary, you can set it to 10, which means retaining 10 sampling points at the front and back. This parameter can be set or adjusted according to actual needs. It is a set of abnormal window indices that meet the aforementioned dual conditions (i.e., the fluctuation intensity value is greater than the preset screening threshold, and the status label is an abnormal label). This abnormal segment extraction method ensures that all These are all segments that exhibit significant fluctuations in physical behavior and are actually marked as abnormal in business data. This segment selection method effectively avoids misidentification problems caused by noise disturbances or long-term trend changes.
[0102] In an exemplary embodiment, step 106 includes: extracting and encoding differential sequences from the abnormal fragment sequence to obtain multiple behavioral pattern embeddings; converting each original text segment into a text embedding; for each original text segment, calculating the cosine similarity between the text embedding corresponding to the original text segment and each behavioral pattern embedding to obtain multiple cosine similarity values corresponding to the original text segment; for each signal behavior change prior corresponding to the abnormal fragment sequence, calculating the Kullback-Leibler divergence between a preset text language probability distribution and the signal behavior change prior, multiplying the calculated Kullback-Leibler divergence with a preset balance term to obtain a prior matching contribution value; for each original text segment, dividing the sum of the multiple cosine similarity values corresponding to the original text segment and all prior matching contribution values by the total number of sampling points in the abnormal fragment sequence to obtain the comprehensive semantic response score of the original text segment.
[0103] In order to accurately establish and Based on the matching relationship between them, the following double-nested semantic guidance structure is proposed:
[0104] Original text paragraphs Convert to text embedding Optionally, the embedding method uses an embedding layer pre-trained on a power industry corpus (such as the first two layers of the power BERT model), with the embedding dimension fixed to the target dimension (e.g., 128 dimensions). For anomalous fragment sequences... Its overall fluctuation trend is extracted by using a sliding window segmentation method to extract the differential sequence. To represent short-term behavioral changes, further encoded into current behavioral patterns embedded. This method extracts local behavioral patterns across time using a single-layer one-dimensional convolutional network. For example, the convolutional network contains 32 filters with a kernel size of 5, a stride of 1, no pooling operation, and an output vector dimension equal to the target dimension (e.g., 128 dimensions), aligned with the current text embedding.
[0105] For each original text segment: cosine similarity is calculated using a dual similarity mapping function based on the text embedding and each behavior pattern embedding, resulting in multiple cosine similarity values; the pre-defined text language probability distribution and the Kullback-Leibler (KL) divergence of each pre-defined prior signal behavior change are calculated and multiplied by a pre-defined balance term to obtain multiple prior matching contribution values; all cosine similarity values and all prior matching contribution values are summed and divided by the total number of sampling points in the anomalous segment sequence to obtain the comprehensive semantic response score. The specific formula is shown below:
[0106] ;
[0107] in, Represents the original text paragraph With abnormal fragment sequences The comprehensive semantic response score, For text embedding, Embedding for behavioral patterns; The cosine similarity function within the embedding space is used to measure the direct semantic relevance of text to behavior. Probability distribution of text language Prior to changes in signal behavior The Kullback-Leibler divergence reflects whether the probabilistic structure of language description is synchronized with physical changes; This is a balancing term used to control the relative contribution of semantic alignment and behavioral structure alignment, and can be set to an empirical value of 0.4. Represents an abnormal fragment sequence Total number of sampling points, summation index Iterate through these sampling points.
[0108] For example, the probability distribution of text language Generated using a language modeler trained on a fault corpus in the power sector, used for modeling. The joint distribution structure of vocabulary in the signal; prior changes in signal behavior It is an empirical distribution formed by the statistical analysis of short-term fluctuation frequencies of anomalous segment sequences, representing a priori changes in signal behavior. It can be understood as an "abnormal fingerprint" or "pattern template". It does not refer to a specific abnormal signal curve, but rather a probability distribution of the short-term dynamic change pattern of such anomalies, which is abstracted and statistically derived from a large number of similar abnormal events. For example, the distribution of the rate of increase before and after a temperature jump.
[0109] In this embodiment, behavioral pattern embedding is introduced. With text language probability distribution The KL alignment term forms a dual alignment mechanism that considers both surface semantic relevance and behavioral structural differences. It can identify the language content that is most descriptive of actual device anomalies in fuzzy semantic text, effectively alleviating the common problem of "semantic similarity but decision conflict" in cross-modal learning, thereby improving the reliability of state prediction.
[0110] In an exemplary embodiment, step 110 includes: inputting each target text segment into the encoder to obtain the corresponding target text vector; for each target text segment, determining the attention weight corresponding to the target text segment based on the ratio of the comprehensive semantic response score of the target text segment to the sum of the comprehensive semantic response scores of all target text segments; and performing a weighted summation of all target text segments according to the attention weight corresponding to each target text segment to obtain the text semantic vector.
[0111] For example, the encoder adopts a bidirectional gated cyclic unit (Bi-GRU) structure with two layers. The hidden state dimension of each layer is the target dimension (e.g., 128 dimensions), and there is no attention mechanism to preserve the original sequentiality.
[0112] Among them, text semantic vector The weighted fusion representation is defined as follows:
[0113] ;
[0114] ;
[0115] in, Indicates the first The target text vector is obtained by encoding a target text segment using a Bi-GRU encoder; The normalized attention weights are used to control the contribution ratio of each paragraph in the final semantic representation.
[0116] In an exemplary embodiment, prior to step 102, the method further includes: acquiring historical operating sequence data and historical raw text of the power grid; the historical raw text includes multiple historical raw text segments; filtering out historical abnormal segment sequences from the historical operating sequence data; for each historical raw text segment, determining a comprehensive semantic response score based on the historical raw text segment and the historical abnormal segment sequence; selecting the top K historical raw text segments with the highest comprehensive semantic response scores as historical target text segments; performing feature fusion based on all historical target text segments to obtain a historical text semantic vector; and training an initial state prediction model based on the historical abnormal segment sequence and the historical text semantic vector to obtain a power grid state prediction model.
[0117] Specifically, using the methods corresponding to steps 102 to 110, historical runtime sequence data and historical raw text are processed to determine historical text semantic vectors. After inputting the historical anomaly fragment sequence and historical text semantic vectors into the initial state prediction model, the historical anomaly fragment sequence is encoded to obtain the temporal modality representation. The semantic vectors of historical texts are encoded to obtain the text modal representation. For temporal modal representation and text modal representation To perform shared semantic alignment, considering the significant "fuzzy boundary" characteristics in power state prediction (such as fluctuations between mild anomalies and normal conditions often due to different equipment loads), this embodiment designs an alignment loss that not only considers spatial distance but also incorporates a fuzzy consistency penalty mechanism for state labels. The alignment loss function is defined as follows:
[0118] ;
[0119] in, This is the temporal modal representation obtained after encoding a sequence of historical anomalous fragments. This refers to the text modal representation obtained after encoding the semantic vectors of historical texts. The time-series and text-encoded aligned space vectors have the same dimension and ; Represents the squared Euclidean distance; The first result obtained by statistical analysis according to state category Dimensional difference Dimensionless values after monotonic standardization (such as zero mean, unit variance, or quantile scaling to [0,1]) are used to weaken the penalty intensity on this dimension. The greater the difference, the less discriminative the dimension is. This is a numerically stable term, with a default value of 10. -6 The possible value range is
[10] . -8 10 -4 ]; The alignment regularization weight defaults to 0.5, with a possible value range of [0.1, 2.0]. The first term shrinks the overall distance between the two modalities, while the second term is a state variation control regularization term, making the alignment softer (i.e., allowing the signal and text to maintain a certain distance) on dimensions with weak discriminability (unable to effectively distinguish states, filled with noise or redundancy), and the alignment harder (i.e., strictly bringing the signal and text closer) on dimensions with strong discriminability (able to effectively distinguish different states). Indicates the first in the historical training samples The difference statistics of dimensions under different state categories are used as static priors in the generation process. For example, in tasks related to temperature fluctuations, if the first... If the dimension is independent of the state, then Larger values correspond to weaker effects of regularization terms; if the first... If the condition is related to an overheating event, then... The smaller the value, the stronger the penalty for misalignment.
[0120] Meanwhile, to ensure that the aligned embedding has practical classification capabilities, a state supervision task is further constructed, using state labels as direct supervision signals, and the following state prediction loss function is designed:
[0121] ;
[0122] in, For state prediction loss, For a set of state categories, This is the classification weight vector matrix. This is a label indicator function, where 1 indicates that the sample label is... Otherwise, it is 0. This is the temporal modal representation obtained after encoding a sequence of historical anomalous fragments. This is the text modal representation obtained after encoding the semantic vectors of historical text. Using... and The average value is used as input to construct a shared perspective state representation in the alignment space, which is both signal sensitive and semantically abstract.
[0123] The overall training loss function is:
[0124] ;
[0125] in, is a hyperparameter, set to 1.0, representing the relative strength of the control state prediction loss and the alignment loss.
[0126] In this way, the modal data, which were independently modeled in the previous steps, are fused in a shared semantic space under the guidance of state labels, thus completing a task-driven fusion. Its special state-discrimination regularization term can achieve "soft alignment" for the fuzzy and abnormal expression characteristics in the power scenario, so that the training process is no longer limited by the assumption of single modality consistency, thereby improving the model's fault tolerance and discrimination ability in boundary scenarios.
[0127] The final output is the alignment parameter set after the model training is completed. It includes all parameters of the temporal coding module, text coding module, and state prediction module, as well as the state difference standard deviation matrix used to regulate the modality fusion strategy. These parameters will be directly used for state prediction inference tasks based on new data, forming the basis of the power grid state prediction model.
[0128] In this embodiment, during the pre-training phase, state labels are used as unified supervision, and a cross-modal alignment mechanism with adaptive weights based on state differences is adopted to achieve synchronous convergence of semantic consistency and decision consistency in the shared space.
[0129] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0130] Based on the same inventive concept, this application also provides a power grid state prediction device for implementing the power grid state prediction method described above. The solution provided by this device is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more power grid state prediction device embodiments provided below can be found in the limitations of the power grid state prediction method described above, and will not be repeated here.
[0131] In one exemplary embodiment, such as Figure 2 As shown, a power grid state prediction device is provided, comprising:
[0132] The acquisition module 202 is used to acquire the power grid's runtime sequence data and raw text; the raw text includes multiple raw text paragraphs.
[0133] Filtering module 204 is used to filter out abnormal fragment sequences from runtime sequence data;
[0134] The determination module 206 is used to determine the comprehensive semantic response score of each original text paragraph based on the original text paragraph and the sequence of abnormal segments; and to select the top K original text paragraphs with the highest comprehensive semantic response scores as target text paragraphs.
[0135] The fusion module 208 is used to perform feature fusion based on all target text paragraphs to obtain a text semantic vector;
[0136] The prediction module 210 is used to input the abnormal fragment sequence and text semantic vector into the power grid state prediction model to obtain the state prediction result.
[0137] In the aforementioned power grid state prediction device, state-driven anomaly segment extraction compresses runtime sequence data into a sequence of key anomaly segments strongly correlated with equipment state, effectively filtering out long-term stable background and noise interference, and establishing clear physical behavior anchors for subsequent analysis. Utilizing the temporal response clues contained in the anomaly segment sequence, highly related original text segments are filtered out and encoded into linguistic expressions consistent with equipment behavior, i.e., text semantic vectors. Integrating data sampling, anomaly filtering, feature alignment, and predictive inference into a logical closed loop improves the accuracy, stability, and interpretability of power grid state identification under complex operating conditions, and provides a reproducible and deployable implementation path on the engineering side.
[0138] In an exemplary embodiment, the power grid state prediction model includes a time-series encoding module, a text encoding module, and a state prediction module; the prediction module 210 is further configured to input an abnormal segment sequence into the time-series encoding module to obtain a time-series modal representation; input a text semantic vector into the text encoding module to obtain a text modal representation; perform weighted fusion of the time-series modal representation and the text modal representation to obtain a shared representation; and input the shared representation into the state prediction module to obtain a state prediction result.
[0139] In an exemplary embodiment, the filtering module 204 is further configured to segment the runtime sequence data to obtain multiple runtime sequence segments; the runtime sequence segments include status labels, which include normal labels or abnormal labels; calculate the standard deviation for each runtime sequence segment to obtain the corresponding fluctuation intensity value; and determine the abnormal segment sequence based on the runtime sequence segments whose fluctuation intensity value is greater than a preset filtering threshold and whose status label is an abnormal label.
[0140] In an exemplary embodiment, the filtering module 204 is further configured to obtain the paragraph index of the fluctuation intensity value being greater than a preset filtering threshold and the status label being an abnormal label; expand the paragraph index; and determine the runtime sequence corresponding to the expanded paragraph index as an abnormal segment sequence.
[0141] In an exemplary embodiment, the determining module 206 is further configured to perform differential sequence extraction and encoding on the abnormal fragment sequence to obtain multiple behavioral pattern embeddings; convert each original text segment into a text embedding; for each original text segment, calculate the cosine similarity between the text embedding corresponding to the original text segment and each behavioral pattern embedding to obtain multiple cosine similarity values corresponding to the original text segment; for each signal behavior change prior corresponding to the abnormal fragment sequence, calculate the Kullback-Leibler divergence between the preset text language probability distribution and the signal behavior change prior, multiply the calculated Kullback-Leibler divergence by a preset balance term to obtain a prior matching contribution value; for each original text segment, divide the sum of the multiple cosine similarity values corresponding to the original text segment and all prior matching contribution values by the total number of sampling points of the abnormal fragment sequence to obtain the comprehensive semantic response score of the original text segment.
[0142] In an exemplary embodiment, the fusion module 208 is further configured to input each target text segment into the encoder to obtain the corresponding target text vector; for each target text segment, determine the attention weight corresponding to the target text segment based on the ratio of the comprehensive semantic response score of the target text segment to the sum of the comprehensive semantic response scores of all target text segments; and perform a weighted summation of all target text segments according to the attention weight corresponding to each target text segment to obtain the text semantic vector.
[0143] In an exemplary embodiment, the power grid state prediction device further includes a training module for acquiring historical operating sequence data and historical raw text of the power grid; the historical raw text includes multiple historical raw text segments; historical abnormal segment sequences are filtered from the historical operating sequence data; for each historical raw text segment, a comprehensive semantic response score is determined based on the historical raw text segment and the historical abnormal segment sequence; the top K historical raw text segments with the highest comprehensive semantic response scores are selected as historical target text segments; feature fusion is performed based on all historical target text segments to obtain a historical text semantic vector; and an initial state prediction model is trained based on the historical abnormal segment sequence and the historical text semantic vector to obtain a power grid state prediction model.
[0144] Each module in the aforementioned power grid condition prediction device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.
[0145] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 3 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a power grid state prediction method.
[0146] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0147] In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps: acquiring runtime sequence data of a power grid and raw text; the raw text includes multiple raw text segments; filtering out abnormal segment sequences from the runtime sequence data; for each raw text segment, determining a comprehensive semantic response score of the raw text segment based on the raw text segment and the abnormal segment sequence; selecting the top K raw text segments with the highest comprehensive semantic response scores as target text segments; performing feature fusion based on all target text segments to obtain a text semantic vector; and inputting the abnormal segment sequence and the text semantic vector into a power grid state prediction model to obtain a state prediction result.
[0148] In one embodiment, when the processor executes the computer program, it further performs the following steps: inputting the abnormal fragment sequence into the timing encoding module to obtain a timing modal representation; inputting the text semantic vector into the text encoding module to obtain a text modal representation; performing weighted fusion of the timing modal representation and the text modal representation to obtain a shared representation; and inputting the shared representation into the state prediction module to obtain a state prediction result.
[0149] In one embodiment, when the processor executes the computer program, it further performs the following steps: segmenting the runtime sequence data to obtain multiple runtime sequence segments; the runtime sequence segments include status labels, and the status labels include normal labels or abnormal labels; calculating the standard deviation of each runtime sequence segment to obtain the corresponding fluctuation intensity value; and determining the abnormal segment sequence based on the runtime sequence segments whose fluctuation intensity value is greater than a preset screening threshold and whose status label is an abnormal label.
[0150] In one embodiment, when the processor executes the computer program, it further performs the following steps: obtaining the paragraph index of the fluctuation intensity value that is greater than a preset filtering threshold and the status label is an abnormal label; expanding the paragraph index; and determining the runtime sequence corresponding to the expanded paragraph index as an abnormal segment sequence.
[0151] In one embodiment, when the processor executes the computer program, it further performs the following steps: performing differential sequence extraction and encoding on the abnormal fragment sequence to obtain multiple behavioral pattern embeddings; converting each original text segment into a text embedding; for each original text segment, calculating the cosine similarity between the text embedding corresponding to the original text segment and each behavioral pattern embedding to obtain multiple cosine similarity values corresponding to the original text segment; for each signal behavior change prior corresponding to the abnormal fragment sequence, calculating the Kullback-Leibler divergence between a preset text language probability distribution and the signal behavior change prior, multiplying the calculated Kullback-Leibler divergence with a preset balance term to obtain a prior matching contribution value; for each original text segment, dividing the sum of the multiple cosine similarity values corresponding to the original text segment and all prior matching contribution values by the total number of sampling points in the abnormal fragment sequence to obtain the comprehensive semantic response score of the original text segment.
[0152] In one embodiment, when the processor executes the computer program, it further performs the following steps: inputting each target text segment into the encoder to obtain the corresponding target text vector; for each target text segment, determining the attention weight corresponding to the target text segment based on the ratio of the comprehensive semantic response score of the target text segment to the sum of the comprehensive semantic response scores of all target text segments; and performing a weighted summation of all target text segments according to the attention weight corresponding to each target text segment to obtain the text semantic vector.
[0153] In one embodiment, when the processor executes the computer program, it further performs the following steps: acquiring historical runtime sequence data and historical raw text of the power grid; the historical raw text includes multiple historical raw text segments; filtering out historical anomalous segment sequences from the historical runtime sequence data; for each historical raw text segment, determining the comprehensive semantic response score of the historical raw text segment based on the historical raw text segment and the historical anomalous segment sequence; selecting the top K historical raw text segments with the highest comprehensive semantic response scores as historical target text segments; performing feature fusion based on all historical target text segments to obtain historical text semantic vectors; and training the initial state prediction model based on the historical anomalous segment sequence and the historical text semantic vectors to obtain the power grid state prediction model.
[0154] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon. When executed by a processor, the computer program performs the following steps: acquiring runtime sequence data and raw text of a power grid; the raw text includes multiple raw text segments; filtering out abnormal segment sequences from the runtime sequence data; for each raw text segment, determining a comprehensive semantic response score based on the raw text segment and the abnormal segment sequence; selecting the top K raw text segments with the highest comprehensive semantic response scores as target text segments; performing feature fusion based on all target text segments to obtain a text semantic vector; and inputting the abnormal segment sequence and the text semantic vector into a power grid state prediction model to obtain a state prediction result.
[0155] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: inputting the sequence of abnormal fragments into the temporal encoding module to obtain a temporal modal representation; inputting the text semantic vector into the text encoding module to obtain a text modal representation; performing weighted fusion of the temporal modal representation and the text modal representation to obtain a shared representation; and inputting the shared representation into the state prediction module to obtain a state prediction result.
[0156] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: segmenting the runtime sequence data to obtain multiple runtime sequence segments; the runtime sequence segments include status labels, which include normal labels or abnormal labels; calculating the standard deviation of each runtime sequence segment to obtain the corresponding fluctuation intensity value; and determining the abnormal segment sequence based on the runtime sequence segments whose fluctuation intensity value is greater than a preset screening threshold and whose status label is an abnormal label.
[0157] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: obtaining the paragraph index of the fluctuation intensity value that is greater than a preset filtering threshold and the status label is an abnormal label; expanding the paragraph index; and determining the runtime sequence corresponding to the expanded paragraph index as an abnormal segment sequence.
[0158] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: performing differential sequence extraction and encoding on the abnormal fragment sequence to obtain multiple behavioral pattern embeddings; converting each original text segment into a text embedding; for each original text segment, calculating the cosine similarity between the text embedding corresponding to the original text segment and each behavioral pattern embedding to obtain multiple cosine similarity values corresponding to the original text segment; for each signal behavior change prior corresponding to the abnormal fragment sequence, calculating the Kullback-Leibler divergence between the preset text language probability distribution and the signal behavior change prior, multiplying the calculated Kullback-Leibler divergence with a preset balance term to obtain a prior matching contribution value; for each original text segment, dividing the sum of the multiple cosine similarity values corresponding to the original text segment and all prior matching contribution values by the total number of sampling points in the abnormal fragment sequence to obtain the comprehensive semantic response score of the original text segment.
[0159] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: inputting each target text segment into the encoder to obtain the corresponding target text vector; for each target text segment, determining the attention weight corresponding to the target text segment based on the ratio of the comprehensive semantic response score of the target text segment to the sum of the comprehensive semantic response scores of all target text segments; and performing a weighted summation of all target text segments according to the attention weight corresponding to each target text segment to obtain the text semantic vector.
[0160] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: acquiring historical runtime sequence data and historical raw text of the power grid; the historical raw text includes multiple historical raw text segments; filtering out historical anomalous segment sequences from the historical runtime sequence data; for each historical raw text segment, determining the comprehensive semantic response score of the historical raw text segment based on the historical raw text segment and the historical anomalous segment sequence; selecting the top K historical raw text segments with the highest comprehensive semantic response scores as historical target text segments; performing feature fusion based on all historical target text segments to obtain historical text semantic vectors; and training the initial state prediction model based on the historical anomalous segment sequence and the historical text semantic vectors to obtain the power grid state prediction model.
[0161] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0162] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0163] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0164] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for predicting power grid conditions, characterized in that, The method includes: Obtain the power grid's runtime sequence data and raw text; the raw text includes multiple raw text paragraphs; Filter out abnormal fragment sequences from the runtime sequence data; For each original text segment, a comprehensive semantic response score is determined based on the original text segment and the sequence of anomalous fragments. The top K original text paragraphs with the highest comprehensive semantic response scores are selected as the target text paragraphs. Feature fusion is performed on all the target text paragraphs to obtain the text semantic vector; The abnormal fragment sequence and the text semantic vector are input into the power grid state prediction model to obtain the state prediction result; Specifically, determining the comprehensive semantic response score of each original text segment based on the original text segment and the sequence of anomalous fragments includes: Differential sequence extraction and encoding are performed on the abnormal fragment sequence to obtain multiple behavioral pattern embeddings; Convert each original text paragraph into a text embedding; For each original text segment, the cosine similarity between the text embedding corresponding to the original text segment and each behavior pattern embedding is calculated to obtain multiple cosine similarity values corresponding to the original text segment; For each prior signal behavior change corresponding to the abnormal segment sequence, calculate the Kullback-Leibler divergence between the preset text language probability distribution and the prior signal behavior change. Multiply the calculated Kullback-Leibler divergence with a preset balance term to obtain the prior matching contribution value. For each original text segment, the sum of multiple cosine similarity values corresponding to the original text segment and all the prior matching contribution values is divided by the total number of sampling points of the abnormal segment sequence to obtain the comprehensive semantic response score of the original text segment.
2. The method according to claim 1, characterized in that, The power grid state prediction model includes a time-series coding module, a text coding module, and a state prediction module; the step of inputting the abnormal segment sequence and the text semantic vector into the power grid state prediction model to obtain the state prediction result includes: The abnormal segment sequence is input into the timing coding module to obtain a timing modal representation; The text semantic vector is input into the text encoding module to obtain the text modal representation; The temporal modality representation and the text modality representation are weighted and fused to obtain a shared representation; The shared representation is input into the state prediction module to obtain the state prediction result.
3. The method according to claim 1, characterized in that, The step of filtering out abnormal fragment sequences from the runtime sequence data includes: The runtime sequence data is segmented to obtain multiple runtime sequence segments; each runtime sequence segment includes a status label, which includes a normal label or an abnormal label. The standard deviation is calculated for each runtime segment to obtain the corresponding fluctuation intensity value; The abnormal segment sequence is determined based on the runtime segment whose fluctuation intensity value is greater than the preset screening threshold and whose status label is an abnormal label.
4. The method according to claim 3, characterized in that, The step of determining the abnormal segment sequence based on runtime segments whose fluctuation intensity value is greater than a preset screening threshold and whose status label is an abnormal label includes: Obtain the paragraph indexes where the fluctuation intensity value is greater than the preset filtering threshold and the status label is an anomaly label; Expand the paragraph index; The runtime segment corresponding to the expanded segment index is identified as the abnormal segment sequence.
5. The method according to claim 1, characterized in that, The feature fusion based on all the target text paragraphs yields a text semantic vector, including: Each target text segment is input into the encoder to obtain the corresponding target text vector; For each target text paragraph, the attention weight corresponding to the target text paragraph is determined based on the ratio of the comprehensive semantic response score of the target text paragraph to the sum of the comprehensive semantic response scores of all target text paragraphs. Based on the attention weight corresponding to each target text paragraph, a weighted sum is performed on all the target text paragraphs to obtain the text semantic vector.
6. The method according to any one of claims 1 to 5, characterized in that, Before acquiring the power grid's runtime sequence data and raw text, the method further includes: Acquire historical runtime sequence data and historical raw text of the power grid; the historical raw text includes multiple historical raw text paragraphs. Filter out historical abnormal segment sequences from the historical runtime sequence data; For each historical original text segment, a comprehensive semantic response score is determined based on the historical original text segment and the historical abnormal segment sequence. The top K historical original text paragraphs with the highest comprehensive semantic response scores are used as historical target text paragraphs. Feature fusion is performed on all the aforementioned historical target text segments to obtain the historical text semantic vector; The initial state prediction model is trained based on the historical anomaly fragment sequence and the historical text semantic vector to obtain the power grid state prediction model.
7. A power grid condition prediction device, characterized in that, The device includes: The acquisition module is used to acquire the power grid's runtime sequence data and raw text; the raw text includes multiple raw text paragraphs. The filtering module is used to filter out abnormal fragment sequences from the runtime sequence data; The determination module is used to determine the comprehensive semantic response score of each original text paragraph based on the original text paragraph and the sequence of abnormal segments; and to select the top K original text paragraphs with the highest comprehensive semantic response scores as target text paragraphs. The fusion module is used to perform feature fusion based on all the target text paragraphs to obtain a text semantic vector; The prediction module is used to input the abnormal fragment sequence and the text semantic vector into the power grid state prediction model to obtain the state prediction result; The determining module is further configured to: extract and encode differential sequences from the abnormal fragment sequence to obtain multiple behavioral pattern embeddings; convert each original text segment into a text embedding; for each original text segment, calculate the cosine similarity between the text embedding corresponding to the original text segment and each behavioral pattern embedding to obtain multiple cosine similarity values corresponding to the original text segment; for each signal behavior change prior corresponding to the abnormal fragment sequence, calculate the Kullback-Leibler divergence between a preset text language probability distribution and the signal behavior change prior, multiply the calculated Kullback-Leibler divergence by a preset balance term to obtain a prior matching contribution value; for each original text segment, divide the sum of the multiple cosine similarity values corresponding to the original text segment and all the prior matching contribution values by the total number of sampling points of the abnormal fragment sequence to obtain the comprehensive semantic response score of the original text segment.
8. The apparatus according to claim 7, characterized in that, The power grid state prediction model includes a time-series encoding module, a text encoding module, and a state prediction module. The prediction module is further configured to input the abnormal segment sequence into the time-series encoding module to obtain a time-series modal representation; input the text semantic vector into the text encoding module to obtain a text modal representation; perform weighted fusion of the time-series modal representation and the text modal representation to obtain a shared representation; and input the shared representation into the state prediction module to obtain the state prediction result.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.