Power network fault early warning method based on large model

By cleaning and encoding time-series features in power network fault early warning methods, and combining them with large language models for fault early warning, the problems of high-frequency transient feature loss and noise interference are solved, achieving high-sensitivity and high-efficiency fault early warning.

CN122020392APending Publication Date: 2026-05-12STATE GRID HENAN INFORMATION & TELECOMM CO
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
STATE GRID HENAN INFORMATION & TELECOMM CO
Filing Date
2026-02-09
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing technologies for power network fault early warning using large models face problems such as loss of high-frequency transient features, depletion of context window resources, and noise interference, resulting in low early warning sensitivity and efficiency, making it difficult to meet the high sensitivity and high real-time requirements of power systems.

Method used

By standardizing and cleaning the raw sensor data stream and encoding its temporal features, a temporal soft cue embedding vector is constructed. This vector is then combined with a pre-trained text embedding model to generate a knowledge base vector index. Nearest neighbor search and multimodal feature fusion are then performed, and a large language model is used for fault classification.

Benefits of technology

It effectively solves the problems of high-frequency transient feature loss and context window resource exhaustion caused by traditional numerical textualization methods, realizes deep semantic alignment between heterogeneous power data and textual knowledge, and improves early warning sensitivity and inference efficiency in complex fault scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122020392A_ABST
    Figure CN122020392A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of power system automation, and particularly discloses a power network fault early warning method based on a large model, and the method comprises the steps: directly mapping the data of a high-frequency power sensor into a time sequence soft prompt vector which can be understood by the large model through a lightweight encoder and a linear projection technology; deep alignment of continuous signals and discrete semantics is realized, and information loss and efficiency bottleneck caused by numerical textualization are avoided. And then, directionally retrieving an operation and maintenance knowledge base by using the soft prompt vector, introducing a cross-modal affinity matrix to construct a semantic gating mechanism, dynamically screening and enhancing retrieved key knowledge fragments according to real-time waveform characteristics, and automatically inhibiting redundant text noise irrelevant to the current working condition. And finally, deep attention interaction and reasoning are performed on a composite sequence formed by an instruction, enhanced knowledge and soft prompt through a large model, a control signal containing fault classification and disposal suggestions is output, and real-time accurate early warning considering high-frequency signal sensitivity and expert knowledge logicality is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of power system automation technology, and more specifically, to a power network fault early warning method based on a large model. Background Technology

[0002] With the rapid development of new power systems, the power grid topology is becoming increasingly complex. The randomness and volatility brought about by the integration of new energy sources have led to diverse and concealed fault patterns. To ensure the safe and stable operation of the power grid, utilizing artificial intelligence technology to achieve accurate early warning of faults has become an industry consensus. In recent years, large language models, with their powerful knowledge storage, logical reasoning, and generalization capabilities, have provided a new technical approach for handling complex fault diagnosis and decision support problems in the power sector, especially demonstrating great potential in integrating unstructured operation and maintenance knowledge with structured monitoring data.

[0003] However, directly applying large models, which are primarily adept at handling discrete symbolic text, to continuous, high-frequency power time-series data analysis faces the fundamental challenge of the non-homogeneity of heterogeneous data encoding spaces in practical applications. Existing technologies typically employ numerical textification to address this problem, mechanically converting massive amounts of sensor-sampled values ​​into string sequences (e.g., converting voltage values ​​into text characters) and inputting them into the model. This approach has drawbacks: firstly, it severs the continuous mathematical characteristics between values, leading to significant loss of high-frequency transient information (such as microsecond-level voltage distortion or harmonic oscillations) during the conversion process; secondly, converting high-frequency data into text tokens one by one quickly exhausts the context window constraints of large models, resulting in high inference costs and extremely low efficiency. Furthermore, when using retrieval-enhanced generation techniques to introduce external knowledge bases, existing solutions often simply perform linear concatenation of retrieved historical fault text with real-time data. Due to the lack of an active attention guidance mechanism based on real-time signal characteristics, redundant text noise in the retrieval results that does not match the current operating conditions cannot be effectively suppressed. This simple modal stacking fails to achieve deep semantic interaction, easily misleading the model's attention and causing it to make illusory misjudgments that contradict physical facts, making it difficult to meet the stringent requirements of power systems for high sensitivity, high real-time performance, and high reliability in fault early warning.

[0004] Therefore, an optimized power network fault early warning scheme based on a large model is desired. Summary of the Invention

[0005] To address the aforementioned technical problems, this application is proposed. Embodiments of this application provide a power network fault early warning method based on a large model, comprising: S1: Standardize and clean the collected raw sensor data stream to obtain a normalized time series tensor, and use a pre-trained text embedding model to vectorize the operation and maintenance log text to obtain a knowledge base vector index. S2: Perform temporal feature encoding and soft cue mapping on the normalized temporal tensor to obtain the temporal soft cue embedding vector; S3: Pool the time-series soft cue embedding vector to obtain the query vector, and perform a nearest neighbor search in the knowledge base vector index based on the query vector to retrieve the matching and associated search text set; S4: Convert the retrieved text set into a text embedding vector, and then perform a time-series logical concatenation of the text embedding vector with the timing soft cue embedding vector and the preset task instruction embedding vector to obtain a composite input embedding sequence; S5: Embed composite inputs into a pre-trained large language model of sequence inputs and perform large model inference to obtain the fault classification probability distribution; S6: In response to the maximum probability value in the fault classification probability distribution exceeding a preset threshold, a final early warning control signal containing the fault type and handling suggestions is generated.

[0006] Compared with existing technologies, this application proposes a power network fault early warning method based on a large model. It constructs a temporal feature encoder to directly map and project the high-frequency, continuous raw sensor data stream into a temporal soft cue embedding vector that the large language model can understand. This vector is then used to retrieve associated operation and maintenance knowledge text in a high-dimensional semantic space. Subsequently, natural language instructions, retrieved domain knowledge, and soft cue vectors representing real-time status are concatenated using temporal logic and fused with multimodal features to construct a composite input sequence containing full contextual information. This sequence drives the large model to perform attention-based interactive reasoning to output the fault probability. This approach effectively solves the problems of high-frequency transient feature loss and context window resource exhaustion caused by traditional numerical textualization methods, achieving deep semantic alignment between heterogeneous power data and textual knowledge, and improving the early warning sensitivity and reasoning efficiency in complex fault scenarios. Attached Figure Description

[0007] The above and other objects, features, and advantages of this application will become more apparent from the more detailed description of the embodiments of this application in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of this application and form part of the specification. They are used together with the embodiments of this application to explain this application and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same components or steps.

[0008] Figure 1 This is a flowchart of a power network fault early warning method based on a large model according to an embodiment of this application; Figure 2This is a schematic diagram of data flow for a power network fault early warning method based on a large model according to an embodiment of this application; Figure 3 This is a flowchart illustrating the process of performing time-series feature encoding and soft-cue mapping on a normalized time-series tensor to obtain a time-series soft-cue embedding vector in a power network fault early warning method based on a large model according to an embodiment of this application. Figure 4 The flowchart illustrates the process of converting a retrieved text set into a text embedding vector and then performing a time-series logical concatenation of the text embedding vector with a time-series soft cue embedding vector and a preset task instruction embedding vector to obtain a composite input embedding sequence, according to the power network fault early warning method based on a large model according to the embodiments of this application. Figure 5 The flowchart illustrates the process of concatenating instruction embedding vectors, knowledge embedding vectors, and time-series soft hint embedding vectors along the sequence length dimension to obtain an unmasked mixed sequence in the power network fault early warning method based on a large model according to an embodiment of this application. Figure 6 This is a flowchart illustrating how a large language model, pre-trained with composite input and sequential input, performs large-model inference to obtain a fault classification probability distribution in a power network fault early warning method based on a large model, according to an embodiment of this application. Detailed Implementation

[0009] Hereinafter, exemplary embodiments according to this application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments of this application. It should be understood that this application is not limited to the exemplary embodiments described herein.

[0010] As indicated in this application and claims, unless the context clearly indicates otherwise, the words "a," "an," "an," and / or "the" are not specifically singular and may include plural forms. Generally speaking, the terms "comprising" and "including" only indicate the inclusion of explicitly identified steps and elements, which do not constitute an exclusive list, and the method or apparatus may also include other steps or elements.

[0011] While this application makes various references to certain modules of the systems according to embodiments of this application, any number of different modules can be used and run on user terminals and / or servers. The modules described are merely illustrative, and different aspects of the systems and methods may use different modules.

[0012] Flowcharts are used in this application to illustrate the operations performed by the system according to embodiments of this application. It should be understood that the preceding or following operations are not necessarily performed in exact order. Instead, various steps can be processed in reverse order or simultaneously as needed. Furthermore, other operations can be added to these processes, or one or more steps can be removed from them.

[0013] Existing power network fault early warning technologies often struggle with the challenge of effectively homomorphically aligning heterogeneous data encoding spaces when dealing with continuous high-frequency time-series data and discrete, unstructured maintenance text. Furthermore, traditional methods of converting numerical data into text not only result in significant loss of high-frequency transient features but also introduce substantial noise due to the lack of real-time signal-based attention guidance in simple retrieval and splicing, potentially leading to illusory misjudgments that contradict physical realities. Therefore, this application proposes a power network fault early warning method based on a large model. This method aims to establish a deep semantic interaction bridge between physical signals and domain knowledge, achieving high-precision fault reasoning through lightweight encoding and cross-modal gating mechanisms. Specifically, it first utilizes a temporal feature encoder incorporating convolutional neural networks and Transformer architectures to directly linearly project standardized sensor waveform data into temporal soft cue embedding vectors that can be understood by a large language model, thereby reducing token consumption while preserving microscopic waveform details. Next, a signal-driven semantic gating mechanism is introduced in the multimodal fusion stage, dynamically calculating the cross-modal affinity between real-time waveform features and retrieved historical knowledge text, thereby generating gating vectors to automatically suppress irrelevant text noise and highlight key fault descriptions. Finally, by constructing a composite embedding sequence input model from task instructions, gating-enhanced knowledge vectors, and temporal soft cue vectors, a deep attention mechanism is used to fully capture the correlation between signals and knowledge, outputting fault warning signals with both high confidence and physical interpretability.

[0014] Figure 1 This is a flowchart of a power network fault early warning method based on a large model according to an embodiment of this application. Figure 2 This is a schematic diagram of data flow in a power network fault early warning method based on a large model according to an embodiment of this application. Figure 1 and Figure 2As shown, the power network fault early warning method based on a large model according to an embodiment of this application includes: S1, standardizing and cleaning the collected raw sensor data stream to obtain a normalized time-series tensor, and using a pre-trained text embedding model to vectorize the operation and maintenance log text to obtain a knowledge base vector index; S2, performing time-series feature encoding and soft-hint mapping on the normalized time-series tensor to obtain a time-series soft-hint embedding vector; S3, pooling the time-series soft-hint embedding vector to obtain a query vector, and performing a nearest neighbor search in the knowledge base vector index based on the query vector to retrieve a matching and associated set of search texts; S4, converting the set of search texts into text embedding vectors, and performing time-series logical concatenation of the text embedding vectors with the time-series soft-hint embedding vectors and a preset task instruction embedding vector to obtain a composite input embedding sequence; S5, inputting the composite input embedding sequence into a pre-trained large language model for large model inference to obtain a fault classification probability distribution; S6, in response to the maximum probability value in the fault classification probability distribution exceeding a preset threshold, generating a final early warning control signal containing the fault type and handling suggestions.

[0015] Specifically, in step S1, the collected raw sensor data stream is standardized and cleaned to obtain a normalized time-series tensor, and a pre-trained text embedding model is used to vectorize the operation and maintenance log text to obtain a knowledge base vector index. It should be noted that because sensor data in power systems often originate from heterogeneous equipment from different manufacturers, their sampling frequencies, transmission delays, and physical dimensions differ. Furthermore, text data such as operation and maintenance logs contain a large amount of non-standardized noisy characters and format redundancy, causing the directly input raw data to fail to meet the stringent requirements of deep learning models for consistent input feature distribution and temporal alignment. Based on this, the technical solution of this application further parses the original sensor data stream to identify the sampling timestamps of sensor nodes, and resamples the original sensor data stream to obtain a sensor data matrix; it then performs Z-Score normalization on the sensor data matrix to obtain a normalized time-series tensor; it cleans and segments the collected operation and maintenance log text into unstructured text to obtain a text fragment sequence; and it uses a pre-trained text embedding model to perform feature mapping encoding on the text fragment sequence to obtain a knowledge base vector index. This eliminates the temporal misalignment and dimensional differences of multi-source data, and transforms unstructured domain knowledge into a machine-readable high-dimensional dense vector representation. Through the above processing, standard input data with strict time alignment and normal numerical distribution can be effectively constructed, avoiding model training non-convergence or feature weight deviation caused by data quality issues, thus establishing a data foundation for high-precision inference of the fault warning model.

[0016] More specifically, in a specific example of this application, step S1 includes: parsing the original sensor data stream to identify the sampling timestamps of the sensor nodes, and resampling the original sensor data stream to obtain a sensor data matrix; performing Z-Score normalization on the sensor data matrix to obtain a normalized time series tensor; cleaning and segmenting the collected operation and maintenance log text into unstructured text to obtain a text fragment sequence; and using a pre-trained text embedding model to perform feature mapping encoding on the text fragment sequence to obtain a knowledge base vector index.

[0017] Accordingly, the original sensor data stream is parsed to identify the sampling timestamps of the sensor nodes, and the original sensor data stream is resampled to obtain the sensor data matrix. The sensor data matrix is ​​then Z-score normalized to obtain a normalized time series tensor. It should be noted that, because voltage transformers, current transformers, and circuit breaker condition monitoring devices in power systems are often provided by different manufacturers, their sampling frequencies, clock synchronization accuracy, and data transmission delays vary objectively. This results in the original data exhibiting uneven, unstructured characteristics on the time axis. Furthermore, there is a huge dimensional and order-of-magnitude difference between the kilovolt-level values ​​of bus voltage and the ampere-level values ​​of line current. Directly inputting this data into a deep neural network would lead to unstable gradient updates and severe biases in feature weights. Based on this, the technical solution of this application first parses the original sensor data stream to identify the sampling timestamps of the sensor nodes, then resamples the original sensor data stream to obtain a sensor data matrix, and performs Z-score normalization on the sensor data matrix to obtain a normalized time-series tensor. This completely eliminates the temporal misalignment and physical dimension differences of multi-source heterogeneous data, constructing high-quality standard input data that is strictly aligned in the time dimension and has a consistent numerical distribution. Through the above processing, the causal logic confusion of fault evolution caused by data asynchrony can be effectively avoided, and the dominant bias of large-scale features on model optimization can be completely eliminated, ensuring that the subsequent time-series encoder can focus on waveform morphological changes rather than numerical magnitude, thereby improving the convergence speed and robustness of the fault warning model.

[0018] More specifically, in a concrete example of this application, the data preprocessing workflow is constructed as a cascaded automated pipeline operation, covering the entire process from time alignment to numerical standardization. First, timestamp parsing and alignment are performed, reading the raw sensor data streams from the SCADA system or field monitoring and control devices, parsing the metadata in the data packet header to extract the absolute timestamp information uploaded by each sensor node, and establishing a unified global reference time axis. Next, resampling processing is performed. Addressing the data asynchrony caused by differences in sampling frequencies or network transmission jitter among different sensors, a linear interpolation algorithm is used to calculate simulated values ​​at the reference time point, filling in data gaps and correcting time drift, transforming the non-uniformly sampled discrete sequence into a dense sensor data matrix with a fixed frequency and fixed step size. Finally, Z-Score standardization is performed. For feature channels with different physical dimensions in the matrix, the statistical mean and standard deviation within the current sliding time window are calculated independently. This statistic is used to map the original physical observations to standard normal distribution values ​​with a mean of 0 and a variance of 1, thus completing the construction of the normalized time series tensor.

[0019] Accordingly, the collected operation and maintenance log text is cleaned and segmented into unstructured text to obtain a text segment sequence. Then, a pre-trained text embedding model is used to perform feature mapping encoding on the text segment sequence to obtain a knowledge base vector index. It should be noted that unstructured data such as power operation and maintenance logs and operating procedures are generally lengthy, poorly formatted, and contain a large amount of noise information unrelated to fault diagnosis. Directly using them as input would lead to a waste of computational resources and make it difficult to measure their correlation with real-time signals using mathematical distance. Based on this, the technical solution of this application further cleans and segments the collected operation and maintenance log text into unstructured text to obtain a text segment sequence. Then, a pre-trained text embedding model is used to perform feature mapping encoding on the text segment sequence to obtain a knowledge base vector index. This transforms qualitative historical experience knowledge into a quantitatively computable vector space representation, and achieves efficient compression and structured storage of massive amounts of text knowledge. The above processing effectively overcomes the bottleneck of long documents being limited by the model context window, and provides a precise search space for subsequent semantic retrieval based on signal features, ensuring that the model can quickly anchor the historical fault cases and handling basis that best match the current working conditions.

[0020] More specifically, in a concrete example of this application, the unstructured text processing flow first performs a text cleaning operation, using a set of regular expression rules to scan and filter the original operation and maintenance logs, removing HTML tags, special garbled symbols, and meaningless formatting characters, and standardizing and normalizing device abbreviations and technical terms in the records. Next, a sliding window segmentation operation is performed, setting fixed token length thresholds and overlap rate parameters to continuously cut the cleaned long text into multiple fixed-length text fragment sequences with overlapping contextual semantics, ensuring the semantic integrity of the segmentation edges. Then, a feature mapping and encoding operation is performed, loading a pre-trained deep language model as an encoder to perform forward inference calculations on each text fragment, transforming discrete natural language symbols into high-dimensional dense feature vector representations. Finally, an index building operation is performed, batch importing all generated feature vectors into a vector database and constructing an approximate nearest neighbor index structure based on graph algorithms or quantization, thereby generating a knowledge base vector index.

[0021] Specifically, in step S2, the normalized time-series tensor is subjected to temporal feature encoding and soft cue mapping to obtain a temporal soft cue embedding vector. It should be noted that, given the complexity of multi-source heterogeneous data generated in power backbone communication networks and production operations, the continuous high-frequency analog signals collected by sensors such as voltage and current are in inconsistent feature encoding spaces with the discrete text symbols that large language models can understand. If traditional numerical-to-text methods are used, not only will millisecond-level transient distortion and harmonic features be lost during the discretization process, but the generation of lengthy numerical sequences will also exhaust the model's context window resources, resulting in low inference efficiency and difficulty in capturing deep temporal dependencies. Based on this, the technical solution of this application further performs temporal feature encoding and soft cue mapping on the normalized time-series tensor to obtain a temporal soft cue embedding vector. An encoder containing convolutional and projection layers linearly projects and aligns the continuous waveform features of the physical domain to the semantic embedding space of the large model, constructing a machine-readable implicit cue vector. Through the above processing, the modal barriers between heterogeneous data can be effectively broken down, the integrity of the original signal micromorphology can be preserved without explicit text conversion, the computational overhead can be reduced, and high-density feature inputs can be provided for subsequent large-scale model joint analysis of multi-source data and generation of accurate alarms.

[0022] Figure 3 This is a flowchart illustrating the process of encoding time-series features and mapping soft hints to a normalized time-series tensor to obtain a time-series soft hint embedding vector, according to an embodiment of the power network fault early warning method based on a large model, as described in this application. Figure 3As shown, step S2 further includes: S21, performing local temporal pattern extraction based on 1D-CNN on the normalized temporal tensor to obtain local feature maps; S22, injecting position encoding into the local feature maps and using the multi-head self-attention mechanism of the Transformer encoder layer to model global dependencies to obtain global temporal hidden states; S23, performing cross-modal feature linear projection on the global temporal hidden states to obtain temporal soft cue embedding vectors.

[0023] In step S21, local temporal pattern extraction based on 1D-CNN is performed on the normalized time-series tensor to obtain local feature maps. It should be noted that early fault features in power networks typically exist as transient distortions at the microsecond or millisecond level, such as voltage drops, current spikes, or harmonic oscillations at specific frequencies. These high-frequency and local waveform details are easily overlooked in extremely long original sampling sequences, and directly processing the full-length sequence would lead to a quadratic increase in computational complexity. Therefore, the technical solution of this application further performs local temporal pattern extraction based on 1D-CNN on the normalized time-series tensor to obtain local feature maps. This utilizes the local perception characteristics of convolutional neural networks to automatically capture and aggregate these microscopic waveform morphological features within a sliding time window. Through the above processing, the original low-order physical signal can be effectively transformed into a high-order feature representation containing rich local semantics, while simultaneously achieving dimensionality reduction and compression of the time dimension, improving the computational efficiency and feature focusing capability of subsequent global modeling.

[0024] More specifically, in a concrete example of this application, the extraction process is implemented as a cascaded convolutional neural network operation. First, a convolutional scanning operation is performed to construct a network structure containing multiple one-dimensional convolutional layers. Convolutional kernels of a specific size are configured to slide step-by-step along the time axis of a normalized temporal tensor. The inner product of the convolutional kernel parameters and the sensor data within the local time window is calculated, thereby extracting basic morphological features such as peaks, troughs, and slope changes. Then, a nonlinear activation process is performed, mapping the linear output of the convolutional layers through an activation function, introducing nonlinear transformation characteristics to adapt to the complex dynamic changes of power signals. Finally, a downsampling aggregation operation is performed, using a max-pooling layer to reduce the dimensionality of the activated feature sequence, filtering and retaining the feature values ​​with the highest response intensity in the local neighborhood, filtering out non-critical background fluctuation noise, and ultimately generating a local feature map with compressed dimensionality but increased information density.

[0025] In step S22, position encoding is injected into the local feature map, and global dependency modeling is performed using the multi-head self-attention mechanism of the Transformer encoder layer to obtain the global temporal hidden state. It should be noted that since power system faults are often dynamic processes with long temporal evolution characteristics, simple local feature extraction is insufficient to capture the causal relationships between distant time steps, and the inherent translation invariance of convolution operations leads to the loss of crucial temporal position information, failing to accurately reflect the sequential logic of fault development. Based on this, the technical solution of this application further injects position encoding into the local feature map and uses the multi-head self-attention mechanism of the Transformer encoder layer to perform global dependency modeling to obtain the global temporal hidden state. This explicitly marks the absolute position of the time-series data on the time axis, and utilizes the fully connected characteristics of the self-attention mechanism to calculate the correlation strength between any two time points in the sequence. Through the above processing, the limitations of the local receptive field can be effectively overcome, integrating discrete local waveform features into a temporal state expression with global contextual semantics, ensuring that the model accurately understands the entire life cycle evolution of the fault from latency to outbreak.

[0026] More specifically, in a concrete example of this application, the global modeling process is implemented as a deep feature reconstruction task based on an attention mechanism. First, a positional encoding injection operation is performed. Based on the time step dimension of the local feature map, fixed positional vectors with different frequencies are generated using sine and cosine functions, or learnable positional embedding vectors are trained. These vectors are then added element-wise to the local feature map, thereby endowing the feature sequence with explicit temporal localization information. Next, a multi-head self-attention computation operation is performed. The feature sequence after the positional information is superimposed is linearly projected into a query matrix, a key matrix, and a value matrix, respectively. These matrices are then divided into multiple independent attention heads, and the dot product similarity and attention weights between features at different time steps are calculated in parallel. Based on this, the value matrix is ​​weighted and aggregated to capture the multidimensional coupling relationships between different physical quantities at the same time and between the same physical quantity at different times. Finally, a feedforward and normalization processing operation is performed. The output of the multi-head attention is processed through residual connections and layer normalization, and then fed into a feedforward neural network for nonlinear transformation, ultimately outputting a global temporal hidden state that incorporates long-range contextual information.

[0027] In step S23, a cross-modal feature linear projection is performed on the global temporal hidden state to obtain a temporal soft cue embedding vector. It should be noted that although the global temporal hidden state after temporal encoding aggregates the contextual dependency information of the power waveform, the dimension of its feature vector usually depends on the encoder's model structure, resulting in an objective numerical mismatch with the inherent word embedding vector dimension of the pre-trained large language model. Furthermore, the two reside in different semantic manifold spaces, and direct input will lead to dimensionality mismatch errors and semantic understanding obstacles. Based on this, the technical solution of this application further performs a cross-modal feature linear projection on the global temporal hidden state to obtain a temporal soft cue embedding vector, thereby constructing a linear mapping bridge connecting the physical signal feature space and the natural language semantic space, forcing the temporal features to align to the input interface standard of the large language model. Through the above processing, lossless adaptation of heterogeneous modal data can be effectively achieved, enabling continuous power waveform features to be disguised as a soft token sequence recognizable by the large model. This empowers the large model to directly read and understand the microscopic changes in analog signals without the need for discretization word segmentation.

[0028] More specifically, in a concrete example of this application, the cross-modal projection process is implemented as a matrix-operation-based dimensionality transformation operation. First, a projection parameter construction operation is performed. Based on the output feature dimension of the temporal encoder and the word embedding dimension of the target large language model, a learnable weight matrix and corresponding bias vector of a fully connected layer are initialized, establishing a linear transformation rule from the source dimension to the target dimension. Then, a forward linear transformation operation is performed, passing the global temporal hidden state sequence as input to the fully connected layer. Matrix multiplication maps the feature vector at each time step to the target high-dimensional space, and bias terms are added to adjust the center shift of the feature distribution. Finally, a soft cue sequence generation operation is performed, outputting a dimensionally aligned continuous vector sequence, which is defined as the temporal soft cue embedding vector. This vector sequence is mathematically consistent with the text word embedding vector and can be directly used as the input key for subsequent attention mechanisms.

[0029] Specifically, in step S3, the time-series soft cue embedding vector is pooled to obtain the query vector, and a nearest neighbor search is performed in the knowledge base vector index based on the query vector to retrieve the matching and associated search text set. It should be noted that since the time-series soft cue embedding vector is essentially a continuous vector sequence that changes dynamically over time, while existing vector retrieval techniques usually require the input query object to be a single static vector representing the overall state, and relying solely on the implicit knowledge within the model parameters is insufficient to cover the massive historical fault cases and targeted operation and maintenance procedures in the power system, the model lacks the necessary prior knowledge guidance when facing complex operating conditions that it has never encountered before. Based on this, the technical solution of this application further performs temporal state aggregation on the temporal soft cue embedding vector to obtain a global state query vector. It then performs vector space similarity calculation and nearest neighbor sorting on the global state query vector and each knowledge entry vector in the knowledge base vector index to obtain a Top-K matching record list. Finally, it extracts the domain knowledge text content mapping from the Top-K matching record list to obtain a retrieval text set. This process compresses dynamic waveform features into a searchable global semantic fingerprint, which is then used to accurately anchor the most similar historical experience in the vector space. Through this processing, the retrieval barrier between time series and static text can be effectively broken down, introducing highly relevant external knowledge enhancement into the subsequent reasoning process and improving the physical interpretability and accuracy of fault diagnosis.

[0030] More specifically, in a specific example of this application, step S3 includes: performing temporal state aggregation on the temporal soft cue embedding vector to obtain a global state query vector; performing vector space similarity calculation and nearest neighbor sorting on the global state query vector and each knowledge entry vector in the knowledge base vector index to obtain a Top-K matching record list; and performing domain knowledge text content mapping extraction on the Top-K matching record list to obtain a retrieval text set.

[0031] In other words, more specifically, the retrieval and matching process is implemented as a semantic anchoring operation based on vector space distance. First, a temporal state aggregation operation is performed, receiving data containing... The timing soft cue embedding vector sequence at each time step is subjected to average pooling along the time dimension, compressing the dynamically changing vector sequence into a static vector that can represent the overall operating state of the system within the current time window, i.e., the global state query vector. Its calculation logic is implemented through the following formula: in, This represents the generated global state query vector. Represents the number of time steps in the sequence. Representing the The vector elements at each time step are then processed. Similarity calculation and sorting are then performed. Using the global state query vector as a probe, a full search is initiated in the pre-built knowledge base vector index. The cosine similarity algorithm is used to calculate the cosine of the angle between the query vector and each knowledge entry vector stored in the database in parallel. The calculation logic is implemented using the following formula: in, Represents the query vector With the records Similarity score between them Represents the dot product operation. This represents the Euclidean norm. All records are sorted in descending order based on the calculated similarity scores, and the records with the highest scores are extracted. Each record is used as a Top-K matching record list. Finally, a content mapping extraction operation is performed, which iterates through the index identifiers in the matching record list, accesses the underlying database to backtrack and extract the corresponding raw natural language text content, filters irrelevant metadata, and then aggregates them to form a retrieval text set.

[0032] Specifically, in step S4, the retrieved text set is converted into text embedding vectors, and the text embedding vectors are concatenated with temporal soft cue embedding vectors and preset task instruction embedding vectors using temporal logic to obtain a composite input embedding sequence. It should be noted that, given that effective reasoning in large language models relies not only on current observation data but also heavily on explicit task definitions and relevant background knowledge, and that the retrieved unstructured operation and maintenance log text, continuous temporal soft cue vectors, and static task instructions are essentially heterogeneous modalities, without unified vectorization and orderly organization, the model will struggle to establish logical connections between elements within the same semantic space, and the lack of clearly defined roles in the input can easily lead to divergent reasoning. Therefore, the technical solution of this application further converts the retrieved text set into text embedding vectors and concatenates them with temporal soft cue embedding vectors and preset task instruction embedding vectors using temporal logic to obtain a composite input embedding sequence, thereby constructing a complete context structure that conforms to the causal reasoning logic of large models: instruction guidance, knowledge reference, and data verification. Through the above processing, the physical barriers between multimodal data can be effectively eliminated, enabling large models to fully capture the deep semantic dependencies between instructions, historical experience and real-time waveforms in a unified high-dimensional embedding space using a self-attention mechanism, thereby improving the logical rigor and physical interpretability of fault diagnosis.

[0033] Figure 4This is a flowchart illustrating the process of converting a retrieved text set into text embedding vectors and then concatenating these text embedding vectors with a temporal soft cue embedding vector and a preset task instruction embedding vector using temporal logic to obtain a composite input embedding sequence, according to an embodiment of this application's power network fault early warning method based on a large model. Figure 4 As shown, step S4 includes: S41, vectorizing the preset system instruction text and retrieval text set to obtain instruction embedding vector and knowledge embedding vector; S42, concatenating the instruction embedding vector, knowledge embedding vector and time-series soft prompt embedding vector along the sequence length dimension to obtain an unmasked mixed sequence; S43, injecting positional encoding into the unmasked mixed sequence to obtain a composite input embedding sequence.

[0034] In step S41, the preset system instruction text and retrieval text set are vectorized and encoded to obtain instruction embedding vectors and knowledge embedding vectors. More specifically, in a specific example of this application, the vectorization encoding process is implemented as a lookup mapping operation based on a pre-trained word embedding matrix. First, an instruction text initialization operation is performed, loading the preset system instruction text into the system memory. This text explicitly defines the expert role, analysis target, and output specifications of the large model in the power fault early warning task, while receiving the retrieval text set generated in the previous stage. Subsequently, a word segmentation operation is performed, using a word segmenter compatible with the target large language model, based on byte pair encoding or the WordPiece algorithm, to segment the above natural language text sequence into a token identifier sequence that conforms to the model's vocabulary specifications. Finally, an embedding mapping operation is performed, using each token identifier obtained from word segmentation as an index to find the corresponding row vector in the model's predefined ultra-large-scale word embedding matrix, converting the discrete integer indexes into high-dimensional dense vectors containing rich semantic information, thereby generating instruction embedding vectors and knowledge embedding vectors respectively.

[0035] It should be noted that, since natural language text is essentially a discrete sequence of symbols readable by humans, while the mathematical operations within deep neural networks only support continuous numerical vectors, and simple strings cannot directly participate in subsequent matrix multiplication-based attention mechanisms and cross-modal feature fusion. Therefore, the technical solution of this application further vectorizes the preset system instruction text and retrieval text sets to obtain instruction embedding vectors and knowledge embedding vectors. This maps abstract language symbols to the high-dimensional semantic feature space of a large language model, completing the mathematical transformation from the symbol domain to the vector domain. Through the above processing, static task instructions and dynamic retrieval knowledge can be effectively given machine-understandable mathematical expressions, ensuring that this textual information can be seamlessly spliced ​​and deeply interacted with temporal soft cue vectors in the same dimensional space, laying a data foundation for the model to accurately understand task intent and background knowledge.

[0036] In step S42, the instruction embedding vector, knowledge embedding vector, and time-series soft cue embedding vector are concatenated along the sequence length dimension to obtain an unmasked mixed sequence. It should be noted that, given that the preset task instructions, retrieved historical knowledge, and real-time time-series soft cue are essentially discrete and heterogeneous information modalities, without a unified physical organization, the large language model will be unable to establish causal dependencies between elements within a single context window, and the model will struggle to distinguish the functional roles and logical boundaries of different information fragments. Based on this, the technical solution of this application further concatenates the instruction embedding vector, knowledge embedding vector, and time-series soft cue embedding vector along the sequence length dimension to obtain an unmasked mixed sequence. A special delimiter embedding vector is used to physically concatenate the above three elements according to an adaptive topological order of task definition-background knowledge-current state, constructing a semantically coherent mixed input stream. Through the above processing, the physical barriers between multimodal data can be effectively broken down, so that large language models do not need to explore the relationship between modalities from scratch. Instead, they can directly capture the deep semantic interaction between instruction guidance, knowledge reference and waveform features in a unified high-dimensional embedding space using the self-attention mechanism. This reduces the alignment burden of the deep network of the model and improves the inference sensitivity to weak fault precursors.

[0037] Figure 5 This document presents a flowchart illustrating the process of concatenating instruction embedding vectors, knowledge embedding vectors, and time-series soft hint embedding vectors along the sequence length dimension to obtain an unmasked mixed sequence in a power network fault early warning method based on a large model, according to embodiments of this application. Figure 5 As shown, step S42 includes: S421, performing cross-modal homomorphic projection and affinity matrix calculation on the knowledge embedding vector and the temporal soft cue embedding vector to obtain the cross-modal affinity matrix; S422, performing signal-driven text semantic gating and feature reweighting on the cross-modal affinity matrix and the knowledge embedding vector to obtain the gated enhanced knowledge vector; S423, performing adaptive topological splicing and hybrid sequence construction on the gated enhanced knowledge vector, instruction embedding vector and temporal soft cue embedding vector to obtain the unmasked hybrid sequence.

[0038] In step S421, cross-modal homomorphic projection and affinity matrix calculation are performed on the knowledge embedding vector and the temporal soft cue embedding vector to obtain the cross-modal affinity matrix. It should be noted that, given that the knowledge embedding vector and the temporal soft cue embedding vector originate from different encoders—the former representing discrete natural language semantics and the latter representing continuous physical waveform features—they reside in heterogeneous feature manifold spaces and must be projected into a unified latent semantic space for meaningful comparison and interaction. Based on this, the technical solution of this application further performs cross-modal homomorphic projection and affinity matrix calculation on the knowledge embedding vector and the temporal soft cue embedding vector to obtain the cross-modal affinity matrix, thereby constructing a mathematical model capable of quantifying the correlation strength between discrete text descriptions and continuous signal morphologies. Through the above processing, a cross-modal affinity matrix can be effectively generated, pre-completing the initial semantic alignment of different modal features, revealing the inherent coupling relationship between historical knowledge and real-time operating conditions, and laying the foundation for subsequent accurate information filtering.

[0039] More specifically, in a concrete example of this application, the computation process is implemented as a matrix operation based on linear transformation and attention mechanisms. First, a homomorphic projection transformation is performed to initialize two independent and learnable linear projection matrices: the query weight matrix and the key weight matrix. These are then applied to the input knowledge embedding vector and the temporal soft cue embedding vector, respectively, mapping the heterogeneous feature vectors to a shared semantic subspace with consistent dimensions. Next, a dot product attention calculation is performed. Drawing on the core idea of ​​attention mechanisms, the dot product attention score between the two transformed vector sequences is calculated. This process measures the similarity between each text token and the signal features at each time step through matrix multiplication. Finally, scaling and matrix generation operations are performed, using a scaling factor to numerically stabilize the dot product result, ultimately generating a cross-modal affinity matrix. This process can be represented as: in, The knowledge embedding vector represents the input, and its dimension is... , It is the number of tokens in the text sequence. It is the embedded dimension. The temporal soft cue embedding vector representing the input has a dimension of . ,in It is the number of time synchronization signals. and These are two learnable query and key weight matrices used for isomorphic projection. It is the dimension of the key vector, used for scaling to stabilize the gradient, and the final result is... This refers to the cross-modal affinity matrix. This step constructs a heatmap that quantifies the correlation strength between textual descriptions and signal morphology; any element in the matrix... The value directly reflects the first The first text token (e.g., fault description word) and the second The correlation between real-time waveform features (e.g., transient waveform changes) at each time step. For example, when the retrieved knowledge text contains the fault description term "voltage sag," if the current real-time sensor data at the [time step]... If each time step precisely exhibits a specific voltage drop pattern, then the corresponding value in the affinity matrix... The element will exhibit a high response value, thereby accurately capturing the strong coupling between the textual concept of voltage sag and the specific physical waveform descent at the mathematical level.

[0040] In step S422, signal-driven text semantic gating and feature reweighting are applied to the cross-modal affinity matrix and knowledge embedding vector to obtain a gated enhanced knowledge vector. It should be noted that, given that the knowledge embedding vector and the temporal soft cue embedding vector originate from different encoders, and that the knowledge text set obtained based on retrieval enhancement generation techniques often contains redundant information that is not directly related to the current working condition or has low relevance, treating all retrieval content equally without utilizing the highly deterministic real-time signal features to dynamically suppress the weights of irrelevant text noise can easily mislead the model's attention, causing it to generate illusions that contradict physical facts during reasoning. Therefore, the technical solution of this application further applies signal-driven text semantic gating and feature reweighting to the cross-modal affinity matrix and knowledge embedding vector to obtain a gated enhanced knowledge vector. This suppresses text noise introduced by RAG retrieval and amplifies the knowledge fragments most relevant to the current real-time working condition, establishing an attention-guided mechanism that actively filters historical text knowledge using real-time waveform features. Through the above processing, a set of dynamically adjustable valves can be effectively generated. Based on real-time signal characteristics, the importance of each word in the historical knowledge text can be automatically and non-linearly adjusted, thereby achieving intelligent cleaning of the retrieved knowledge, suppressing text features unrelated to the current waveform to near 0, while amplifying the feature expression of key clues and improving the signal-to-noise ratio of the input information.

[0041] More specifically, in a concrete example of this application, the gating enhancement process is implemented as a feature reconstruction operation based on max pooling and nonlinear activation. First, a maximum correlation aggregation operation is performed along the signal dimension. Using the cross-modal affinity matrix generated in the previous step, for each text token, the maximum correlation strength between it and all time-series signal steps is aggregated. Mathematically, this operation is represented by extracting the maximum value along the signal time-step dimension of the matrix, because max pooling accurately captures the business logic that if a fault phenomenon described by a text has occurred at any time in the current observation window, then the text description is important. Next, a gating coefficient generation operation is performed, transforming the strength value into a gating coefficient ranging from 0 to 1 using a sigmoid activation function, forming a gating vector. Each element in this vector represents the importance probability of the corresponding text token under the current physical condition. Finally, a feature reweighting and residual connection operation is performed, applying this gating vector element-wise to the original knowledge embedding vector, while introducing a residual connection structure to prevent excessive attenuation of key information, ultimately outputting a gating enhanced knowledge vector. This process can be represented as: in, It is the input cross-modal affinity matrix. This indicates that max pooling is performed along the signal dimension (i.e., the time step dimension) of the affinity matrix. and These are the linear layer weights and biases used for aggregation calculations. Represents the Sigmoid activation function. It is the final generated gate vector. It is the original knowledge embedding vector. This represents the Hadamard product, which is the product of elements. It is a vector consisting entirely of 1s, used to construct residual connections. It is the output gated augmented knowledge vector.

[0042] In a specific scenario, suppose a phase B voltage sag fault occurs in the current power system, and the retrieved historical knowledge text contains multiple descriptions, including main transformer overload and voltage sag caused by line short circuit. In affinity calculation, the text token for voltage sag will have a highly correlated response with the time step of voltage drop in the real-time waveform. After max pooling and sigmoid activation, the gating coefficient corresponding to this token... It will approach 1; however, the overload token, due to its mismatch with the current waveform, has a lower gating coefficient. It will approach 0. In the final residual calculation... In this model, the eigenvector of voltage sag is amplified by nearly 2 times, while the eigenvector of overload retains only its original intensity or is relatively suppressed. In subsequent processing, the large model will naturally focus its attention on the highlighted voltage sag feature, thereby accurately eliminating the overload interference term and making a correct warning that conforms to physical facts.

[0043] In step S423, the gated enhanced knowledge vector, instruction embedding vector, and temporal soft cue embedding vector are adaptively topologically concatenated and mixed into a sequence to obtain an unmasked mixed sequence. It should be noted that after completing the deep interaction and filtering of cross-modal features, all processed, high-quality information needs to be integrated into a unified sequence for the large model to perform final inference. Based on this, the technical solution of this application further performs adaptive topological concatenation and mixed into a sequence to obtain an unmasked mixed sequence, thereby physically concatenating the preset instruction embedding vector, the gated enhanced knowledge vector, and the original temporal soft cue embedding vector using a special delimiter embedding vector. Through the above processing, a pre-aligned mixed sequence can be effectively constructed. Although it is still a concatenation in form, its core content, namely the gated enhanced knowledge vector, already contains the interaction information with the temporal soft cue embedding vector. This allows the large language model to focus directly on the highlighted, highly correlated feature pairs instead of exploring the relationships between modalities from scratch in subsequent attention calculations, thereby improving the model's sensitivity to capturing weak, early fault signs in power systems and its inference efficiency.

[0044] More specifically, in a concrete example of this application, the construction process is implemented as a vector-based serialization and reassembly operation. First, a vector preparation operation is performed to obtain an instruction embedding vector with a clearly defined task context, a gated augmented knowledge vector carrying signal attention after processing in previous steps, and a temporal soft cue embedding vector representing the real-time physical waveform. Simultaneously, a special delimiter embedding vector is generated to isolate different semantic blocks. Then, a sequence concatenation operation is performed, assembling the above vectors into a single continuous tensor according to a topological order consistent with cognitive logic. This process can be represented as: in, It is the input instruction embedding vector. It is the gated augmented knowledge vector generated in the previous step. It is the input temporal soft cue embedding vector. It is a special delimiter embedding vector used to separate different information blocks. This represents a concatenation operation along the length dimension of the sequence. This results in the final unmasked hybrid sequence. For example, consider a complex high-resistance grounding fault. In the generated unmasked hybrid sequence, the first part is an instruction vector requesting fault diagnosis based on data; this is followed by a gated enhanced knowledge vector, where descriptive features about zero-sequence voltage rise and intermittent arcing have been significantly amplified by the gating mechanism of the preceding steps, while irrelevant short-circuit features are suppressed; the last part is a soft-hint vector of the real-time acquired voltage waveform. When the large model receives this entire sequence, because the knowledge vector part has already highlighted descriptions highly matching the waveform features, when calculating self-attention, the model, as if holding a reference answer, quickly establishes strong connections between the minute fluctuations in the waveform and the textual description of the high-resistance grounding, thus outputting accurate warning conclusions within milliseconds, avoiding getting lost in a sea of ​​irrelevant knowledge.

[0045] In step S43, positional encoding injection is performed on the unmasked mixed sequence to obtain a composite input embedding sequence. It should be noted that, given that the underlying Transformer architecture of the large language model is essentially based on a parallel computing self-attention mechanism, its processing of the input sequence without positional encoding exhibits permutational equivariance. That is, the model itself cannot automatically perceive the logical relationship between data based solely on the input order. The mixed sequence constructed in this solution strictly follows the logical topology of task instructions guiding background knowledge reference to real-time waveform verification. Without positional marking, causal logic would be disordered. Therefore, the technical solution of this application further performs positional encoding injection on the unmasked mixed sequence to obtain a composite input embedding sequence, thereby explicitly marking the absolute coordinates of heterogeneous data in the input stream and forcibly establishing the relative order between different modal information blocks. Through the above processing, the positional perception defect of the self-attention mechanism can be effectively overcome, ensuring that the large model can accurately identify the initial guiding role of task instructions and the interpretation logic of historical knowledge for subsequent real-time waveform data. This maintains a tight temporal causal chain during inference and avoids misjudgments of business logic due to information disorder.

[0046] More specifically, in a concrete example of this application, the positional encoding injection process is implemented as a mathematical superposition operation based on sequence indexes. First, a sequence length calculation operation is performed, counting the total length of the unmasked mixed sequence, which is composed of instruction embedding vectors, gated augmentation knowledge vectors, and temporal soft cue embedding vectors. This length corresponds to the total number of tokens in the model's input layer. Next, a position matrix generation operation is performed. Based on the total length and the feature dimensions of the model's hidden layers, fixed positional encoding matrices with different frequency periods are generated using sine and cosine functions, or a set of learnable positional embedding vectors that can be updated during training is initialized, ensuring that each positional index in the sequence has a unique feature vector that represents its absolute position and relative distance. Finally, a feature superposition operation is performed, adding the generated matrix containing positional information element-wise to the feature matrix of the unmasked mixed sequence, thereby injecting physical positional information into the high-dimensional semantic space without changing the data dimension.

[0047] Specifically, in step S5, the pre-trained large language model with composite input embedding sequences is subjected to large-scale model inference to obtain the fault classification probability distribution. It should be noted that although the composite input embedding sequence physically achieves the splicing of multimodal information, truly understanding the complex internal causal logic between instruction intent, historical knowledge, and real-time waveforms, and transforming it into a definite diagnostic conclusion, still requires the semantic recombination and discrimination of high-dimensional features by a deep neural network with powerful inference capabilities. Furthermore, traditional shallow models struggle to handle such heterogeneous data in the absence of deep semantic interaction. Based on this, the technical solution of this application further performs large-scale model inference on the pre-trained large language model with composite input embedding sequences to obtain the fault classification probability distribution. This activates the deep multi-head self-attention mechanism within the large model, enabling it to dynamically weigh the matching degree between historical experience and real-time signals in the global context. Through the nonlinear transformation of the feedforward neural network, this cross-modal understanding is transformed into mathematical prediction probabilities for each fault category. Through the above processing, the advantages of large language models in knowledge generalization and logical reasoning in the power vertical field can be effectively utilized to transform abstract heterogeneous features into fault confidence with clear physical orientation, laying a solid quantitative foundation for the subsequent generation of accurate handling strategies.

[0048] Figure 6 This is a flowchart illustrating the process of embedding composite inputs into a pre-trained large language model of sequential inputs to perform large-model inference to obtain the fault classification probability distribution, according to an embodiment of the large-model-based power network fault early warning method of this application. Figure 6As shown, step S5 includes: S51, performing feature interaction based on self-attention mechanism on the composite input embedding sequence to obtain deep context feature representation; S52, performing linear transformation and nonlinear activation processing on the deep context feature representation input position-aware feedforward neural network to obtain the terminal hidden state vector of the convergent sequence reasoning conclusion; S53, using the trained linear classification head to perform dimension mapping and probability normalization on the terminal hidden state vector to obtain the fault classification probability distribution.

[0049] In step S51, the composite input embedding sequence undergoes feature interaction based on a self-attention mechanism to obtain a deep contextual feature representation. It should be noted that although the composite input embedding sequence physically integrates instructions, knowledge, and time-series signals, a deep dependency based on business logic has not yet been established between the modal features. Furthermore, a simple linear arrangement cannot reflect the weight differences of different information elements during the evolution of power faults; for example, minor distortions in real-time waveforms may correspond to critical fault patterns in historical records. Therefore, the technical solution of this application further performs feature interaction based on a self-attention mechanism on the composite input embedding sequence to obtain a deep contextual feature representation. This utilizes the Transformer architecture within the pre-trained large language model to compute the correlation strength between signal features at each time step and each text token in parallel across the entire sequence, and dynamically aggregates contextual information accordingly. Through the above processing, the semantic barriers of multimodal data can be effectively broken down, enabling the model to accurately capture the causal mapping between waveform changes guided by task instructions and historical fault knowledge, thereby generating a deep feature representation containing rich physical meaning and logical judgment capabilities.

[0050] More specifically, in a concrete example of this application, the feature interaction process is implemented as a deep matrix operation based on a multi-head attention mechanism. First, linear projection and multi-head segmentation operations are performed, linearly mapping the composite input embedding sequence into a query matrix, key matrix, and value matrix using three independent learnable weight matrices. These matrices are then segmented along the feature dimension into multiple independent attention heads to capture semantic associations in different subspaces in parallel. For example, one attention head focuses on the correspondence between waveform trends and fault descriptions, while another focuses on the matching of instruction requirements with the current state. Subsequently, attention scoring and weighted aggregation operations are performed. Within each attention head, the dot product of the query matrix and the transposed key matrix is ​​calculated, and numerical stabilization is performed using a scaling factor. Then, a normalized attention weight matrix is ​​generated using the Softmax function. This matrix quantifies the dependency between any two elements in the sequence. Based on this weight matrix, the value matrix is ​​weighted and summed, thereby incorporating global contextual information into the local features of each position. Finally, residual connection and layer normalization operations are performed. The weighted aggregated output features are added element-wise to the original input features, and the result is normalized to standardize the feature distribution and prevent gradient vanishing or exploding. The final output is a deep context feature representation that integrates multimodal global dependencies, which serves as the input basis for subsequent feedforward neural networks to perform nonlinear inference.

[0051] In step S52, the deep context feature representation is input into a position-aware feedforward neural network and subjected to linear transformation and nonlinear activation processing to obtain the terminal hidden state vector of the convergent sequence reasoning conclusion. It should be noted that although the deep context feature representation obtained through the self-attention mechanism successfully captures the global dependencies between instructions, knowledge, and waveforms, it is essentially still a linearly weighted feature aggregation form, lacking sufficient nonlinear transformation capability to complete the deep logical deduction and feature reorganization of complex power fault modes. Furthermore, the model needs to perform independent high-dimensional spatial mapping on the features at each time step to distinguish subtle fault symptoms from background noise. Based on this, the technical solution of this application further performs linear transformation and nonlinear activation processing on the deep context feature representation input into a position-aware feedforward neural network to obtain the terminal hidden state vector of the convergent sequence reasoning conclusion. This allows the features to be projected into a higher-dimensional semantic space through a fully connected layer, introduces complex logical judgment capabilities using nonlinear activation functions, and gradually extracts high-order semantic information that can characterize the overall operating state of the system through hierarchical transmission. Through the above processing, the model's ability to analyze nonlinear and non-stationary power signals can be effectively enhanced, ensuring that the final output end hidden state vector highly condenses all the reasoning evidence for fault type determination, and providing robust feature support for subsequent classification decisions.

[0052] More specifically, in a concrete example of this application, the feedforward neural network processing is implemented as a position-independent layer-by-layer feature dimensionality expansion and compression operation. First, dimensionality expansion and non-linear activation operations are performed. For each position vector in the deep context feature representation sequence, the weight matrix of the first fully connected network is linearly projected onto it, expanding its feature dimension to several times its original dimension. Then, a non-linear activation function such as GeLU or SwiGLU is used to gate and filter the expanded vector, removing redundant information and retaining key fault feature responses. Next, dimensionality restoration and residual fusion operations are performed. The activated high-dimensional vector is input into the second fully connected network for dimensionality reduction projection, restoring it to the standard hidden layer dimension of the model. This output is then combined with the original input vector before entering the feedforward network through element-wise residual connections and layer normalization to stabilize the gradient propagation of the deep network and preserve the original semantic information. Finally, the terminal state extraction operation is performed. After repeating the above calculation through multiple stacked Transformer modules, the output vector corresponding to the last time step or specific end symbol position in the sequence is locked and defined as the terminal hidden state vector that gathers the conclusions of the whole sequence reasoning. This vector serves as the direct mathematical basis for subsequent fault classification tasks.

[0053] In step S53, the trained linear classifier head is used to perform dimensional mapping and probability normalization on the terminal hidden state vector to obtain the fault classification probability distribution. It should be noted that since the terminal hidden state vector output by the large model is essentially a dense feature representation in a high-dimensional semantic space, although it aggregates global contextual information of instructions, knowledge, and waveforms, it does not directly correspond to the specific discrete power fault categories defined in actual business scenarios. Furthermore, its value is an unbounded raw score, lacking direct probabilistic interpretability and cannot be directly used for industrial-grade threshold determination. Based on this, the technical solution of this application further utilizes the trained linear classifier head to perform dimensional mapping and probability normalization on the terminal hidden state vector to obtain the fault classification probability distribution. This mathematically projects the abstract high-order semantic features onto a predefined fault type solution space, such as single-phase grounding, phase-to-phase short circuit, or normal operating state, and transforms the raw output into a normalized confidence value. Through the above processing, a mathematical leap from feature representation to decision conclusion can be effectively achieved, quantifying the model's certainty that the current power system operating state belongs to various fault types, providing a standardized probabilistic basis for subsequent early warning triggering.

[0054] More specifically, in a concrete example of this application, the classification process is implemented as a dimensionality reduction and numerical normalization operation based on matrix operations. First, a dimensionality mapping operation is performed, inputting the terminal hidden state vector as a linear classifier constructed using a fully connected layer. Matrix multiplication is then performed using a weight matrix whose dimension matches the model's hidden layer size and the preset total number of fault categories, linearly compressing the high-dimensional feature vector into a logistic value vector of length equal to the number of fault categories. Each element in this vector represents the model's original scoring tendency for a specific fault type. Subsequently, a probability normalization operation is performed, inputting the aforementioned logistic value vector into a Softmax function for exponential and normalization operations. The proportion of each logistic value in the overall numerical sum is calculated, ensuring that all output elements are non-negative and sum to one, thereby generating the final fault classification probability distribution.

[0055] Specifically, in an optional embodiment, the temporal feature encoder and linear classification head are trained through supervised learning. The training data consists of historical fault records and sensor waveforms within corresponding time windows, labeled with preset fault categories. During training, the 1D-CNN, Transformer encoder, cross-modal projection layer, gating network, and linear classification head are used as trainable modules, optimized using cross-entropy loss. The optimizer can be AdamW, the learning rate can be 1e-4 to 5e-4, the batch size can be 16 to 128, and the number of training epochs can be 10 to 100. In inference deployment, the pre-trained large language model can be kept frozen, training only the aforementioned trainable modules, or LoRA / Prefix-Tuning can be used to perform lightweight adaptation of the large language model to reduce computational overhead and improve real-time performance.

[0056] Specifically, in step S6, in response to the maximum probability value in the fault classification probability distribution exceeding a preset threshold, a final early warning control signal containing the fault type and handling suggestions is generated. It should be noted that, given that the fault classification probability distribution output by the large model inference is essentially a high-dimensional mathematical feature expression, its simple numerical form is difficult for power dispatchers or automated control systems to directly understand and execute. Furthermore, prediction results lacking strict confidence filtering are highly susceptible to false alarms due to environmental noise interference, thereby reducing the trust of maintenance personnel in the system. Based on this, the technical solution of this application further performs maximum likelihood estimation and risk threshold determination on the fault classification probability distribution to obtain a risk triggering state tuple. In response to the risk triggering state tuple indicating the existence of risk, semantic mapping and explanatory text generation processing are performed using a fault metadata dictionary and handling suggestion template to obtain the original message structure data. Then, based on the power industry communication standard protocol, the original message structure data is serialized, encapsulated, and verified to obtain the final early warning control signal. This transforms abstract probability values ​​into executable instructions with clear business semantics, containing specific handling strategies, and conforming to industrial communication standards. Through the above processing, a closed loop from algorithm reasoning to business decision-making can be effectively realized, ensuring that the final warning signal has both high confidence in physical interpretability and can be seamlessly integrated into the existing power monitoring and dispatching system, thereby improving the accuracy and automation level of fault emergency response.

[0057] More specifically, in a specific example of this application, step S6 includes: performing maximum likelihood estimation and risk threshold determination on the fault classification probability distribution to obtain a risk triggering state tuple; in response to the risk triggering state tuple indicating the existence of risk, performing semantic mapping and explanatory text generation processing using a fault metadata dictionary and a handling suggestion template to obtain the original message structure data; and performing serialization encapsulation and verification processing on the original message structure data based on the power industry communication standard protocol to obtain the final early warning control signal.

[0058] Furthermore, the warning generation and signal transmission process is implemented as a cascaded transformation operation from the mathematical domain to the business domain and then to the communication domain. First, a risk determination operation is performed. The fault classification probability distribution vector is received, and using the maximum likelihood estimation principle, the index position with the highest probability value is retrieved through the Argmax function to determine the predicted fault category. This maximum probability value is then used as the confidence level and compared numerically with a preset safety threshold (e.g., 0.85). Only when the predicted category is an abnormal state and the confidence level is strictly greater than the threshold will the generated risk trigger state tuple be set to a valid alarm state. This determination logic is implemented through the following formula: in, For indicator functions, To predict the category index, For normal category index, To achieve the highest confidence level, The threshold is set as the safety threshold. Then, a semantic generation operation is performed. Once the risk triggers the status tuple indicating an alarm, a pre-built fault metadata dictionary is immediately invoked. Based on the category index, standard fault names and codes are extracted, and a matching handling suggestion template (e.g., "Suggest checking the secondary circuit of XX equipment") is retrieved from the knowledge base. The fault time, confidence level, and equipment ID are dynamically filled into the template to generate human-readable raw message structure data. Finally, a protocol encapsulation operation is performed. According to power industry communication standards (such as IEC61850 or MQTT protocol), the above structured data is serialized into binary or JSON format data packets, and a cyclic redundancy check code is calculated and appended to the message tail to ensure transmission integrity. Finally, the encapsulated data packet is sent to the operation and maintenance monitoring center as the final early warning control signal through the message middleware interface.

[0059] In summary, the power network fault early warning method based on a large model according to the embodiments of this application is elucidated. It constructs a lightweight temporal encoder that directly maps normalized sensor waveform data into temporal soft cue vectors aligned with the semantic space of the large language model, significantly reducing token consumption while preserving micro-transient features. Furthermore, to address the model illusion problem caused by redundant text noise in retrieval enhancement generation, this scheme introduces a signal-driven cross-modal semantic gating mechanism. This mechanism dynamically calculates the affinity between real-time waveform features and the retrieved knowledge text, automatically suppressing the weight of irrelevant historical records and highlighting key fault descriptions. By constructing a composite embedding sequence containing instructions, gating enhancement knowledge, and soft cues, the large model can deeply interact with multimodal information, ultimately outputting a high-confidence fault early warning signal, achieving efficient, accurate, and physically interpretable power fault monitoring.

[0060] As described above, the power network fault early warning method based on a large model according to the embodiments of this application can be implemented in various power information and communication infrastructures and intelligent operation and maintenance management platforms, such as power communication network management center servers, digital twin simulation platforms, or new-generation intelligent operation and maintenance integrated machines. In one possible implementation, this method can be integrated into a unified network management system or panoramic command center as a fault early warning engine or intelligent auxiliary decision-making component. For example, the method can be an independent fault diagnosis application running on an operation and maintenance workstation, or it can be an advanced alarm analysis plugin and handling suggestion generation module of an existing network management system, or a middleware service deployed on the server and distributing handling strategies through an interface; of course, the time-series soft hint mapping, signal-driven cross-modal semantic gating, and large model multimodal inference modules in this method can also run on AI servers equipped with high-performance GPU computing power, edge computing nodes, or dedicated AI accelerator cards, serving as the underlying inference foundation of the power communication intelligent management and control system.

[0061] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A power network fault early warning method based on a large model, characterized in that, include: S1: Standardize and clean the collected raw sensor data stream to obtain a normalized time series tensor, and use a pre-trained text embedding model to vectorize the operation and maintenance log text to obtain a knowledge base vector index. S2: Perform temporal feature encoding and soft cue mapping on the normalized temporal tensor to obtain the temporal soft cue embedding vector; S3: Pool the temporal soft cue embedding vector to obtain the query vector, and perform a nearest neighbor search in the knowledge base vector index based on the query vector to retrieve the matching and associated search text set; S4: Convert the retrieved text set into a text embedding vector, and then perform a time-series logical concatenation of the text embedding vector with the timing soft cue embedding vector and the preset task instruction embedding vector to obtain a composite input embedding sequence; S5: Embed composite inputs into a pre-trained large language model of sequence inputs and perform large model inference to obtain the fault classification probability distribution; S6: In response to the maximum probability value in the fault classification probability distribution exceeding a preset threshold, a final early warning control signal containing the fault type and handling suggestions is generated.

2. The power network fault early warning method based on a large model according to claim 1, characterized in that, The raw sensor data stream includes bus voltage, line current, active / reactive power, frequency, and circuit breaker open / close position signals.

3. The power network fault early warning method based on a large model according to claim 1, characterized in that, Step S1 includes: The original sensor data stream is parsed to identify the sampling timestamps of the sensor nodes, and the original sensor data stream is resampled to obtain the sensor data matrix. The sensor data matrix is ​​Z-score normalized to obtain a normalized time series tensor; The collected operation and maintenance log text is cleaned and segmented into unstructured text to obtain a sequence of text fragments; A pre-trained text embedding model is used to perform feature mapping encoding on text fragment sequences to obtain a knowledge base vector index.

4. The power network fault early warning method based on a large model according to claim 1, characterized in that, Step S2 includes: Local temporal pattern extraction based on 1D-CNN is performed on the normalized temporal tensor to obtain local feature maps; Position encoding is injected into local feature maps, and the multi-head self-attention mechanism of the Transformer encoder layer is used to model global dependencies to obtain the global temporal hidden state; Cross-modal feature linear projection is performed on the global temporal hidden state to obtain the temporal soft cue embedding vector.

5. The power network fault early warning method based on a large model according to claim 1, characterized in that, Step S3 includes: Perform time-series state aggregation on the time-series soft cue embedding vector to obtain the global state query vector; The vector space similarity calculation and nearest neighbor sorting are performed on the global state query vector and the vector of each knowledge entry in the knowledge base vector index to obtain the Top-K matching record list; The domain knowledge text content is extracted from the Top-K matching record list to obtain the retrieval text set.

6. The power network fault early warning method based on a large model according to claim 1, characterized in that, Step S4 includes: The preset system instruction text and retrieval text set are vectorized to obtain instruction embedding vectors and knowledge embedding vectors; The instruction embedding vector, knowledge embedding vector, and timing soft cue embedding vector are concatenated along the sequence length dimension to obtain an unmasked mixed sequence; Position-encoded injection is performed on the unmasked mixed sequence to obtain a composite input embedding sequence.

7. The power network fault early warning method based on a large model according to claim 1, characterized in that, Step S5 includes: To obtain deep contextual feature representations, feature interactions based on a self-attention mechanism are performed on composite input embedding sequences. The deep context feature representation is input to a location-aware feedforward neural network and subjected to linear transformation and nonlinear activation processing to obtain the terminal hidden state vector of the convergent sequence reasoning conclusion; The trained linear classifier head is used to perform dimension mapping and probability normalization on the terminal hidden state vector to obtain the fault classification probability distribution.

8. The power network fault early warning method based on a large model according to claim 1, characterized in that, Step S6 includes: The probability distribution of fault classification is estimated by maximum likelihood estimation and risk threshold determination to obtain the risk triggering state tuple. In response to the risk-triggered state tuple indicating the presence of risk, semantic mapping and interpretation text generation are performed using the fault metadata dictionary and handling suggestion template to obtain the original message structure data. The original message structure data is serialized, encapsulated, and verified based on the power industry communication standard protocol to obtain the final early warning control signal.

9. The power network fault early warning method based on a large model according to claim 6, characterized in that, The instruction embedding vector, knowledge embedding vector, and time-series soft cue embedding vector are concatenated along the sequence length dimension to obtain an unmasked mixed sequence, including: Cross-modal homomorphic projection and affinity matrix calculation are performed on knowledge embedding vectors and temporal soft cue embedding vectors to obtain the cross-modal affinity matrix; Signal-driven text semantic gating and feature reweighting are applied to the cross-modal affinity matrix and knowledge embedding vector to obtain gated enhanced knowledge vectors; An unmasked hybrid sequence is obtained by adaptive topological splicing and hybrid sequence construction of gated enhanced knowledge vectors, instruction embedding vectors, and temporal soft cue embedding vectors.