A method, system, device and medium for processing multi-frequency sampling data of an energy storage system
By performing data slicing and frequency encoding on multi-frequency sampling data from energy storage systems, and using a self-supervised trained converter encoder for cross-modal alignment, the problem of balancing alignment accuracy and efficiency in existing technologies is solved, achieving high-precision, low-overhead multi-source data fusion and state assessment.
Patent Information
- Application Number
- CN202611543930.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-08
- Publication Date
- 2026-11-03
AI Technical Summary
Existing methods for aligning multi-frequency sampling data in energy storage systems rely on hardware clock synchronization or manually preset rules, which makes it difficult to balance alignment accuracy and computational efficiency. They also ignore cross-modal physical correlations, cannot adapt to complex and changing operating conditions, and affect the reliability of multi-source data fusion and state assessment.
By dividing multimodal and multi-frequency sampled data into data slices and adding frequency position encoding, an input embedding sequence is generated. Self-supervised training is performed using a transformer encoder to construct positive and negative sample pairs, determine the optimal alignment path, and perform temporal resampling to achieve cross-modal data alignment.
It achieves high-precision transient information capture without relying on high-precision clock synchronization and manual annotation, reducing data preparation and system deployment costs. It utilizes cross-modal physical coupling to ensure the consistency of alignment results and achieves high-precision transient information capture with low computational overhead.
Smart Images

Figure CN123030966A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of energy storage system data processing technology, and in particular to a method, system, device and medium for processing multi-frequency sampling data of energy storage systems. Background Technology
[0002] As a key regulation resource in new power systems, energy storage systems rely heavily on the fusion and analysis of multi-source sensing data, including voltage, current, temperature, and state of charge (SOC), for operational status assessment. With the high-density deployment of monitoring sensors in energy storage power plants, different types of sensors collect data at varying sampling frequencies: electrical signals such as voltage and current require millisecond-level high-frequency sampling (e.g., 1kHz) to capture transient changes such as short-circuit impacts and switching actions, while thermodynamic and state variables such as temperature and SOC are limited by sensor response speed and physical inertia, typically using second-level low-frequency sampling (e.g., 1Hz). This multi-frequency sampling characteristic naturally leads to data misalignment in the time dimension, preventing direct fusion of multi-source data and severely limiting the accuracy of energy storage system state estimation, fault diagnosis, and health assessment.
[0003] Current techniques for aligning time-series data still have significant limitations when processing multi-frequency sampling data from energy storage systems, specifically in the following aspects: First, fixed clock synchronization relies on hardware precision. Existing technologies mostly use Network Time Protocol (NTP) or Precision Time Protocol (PTP) to achieve sensor clock synchronization. This method is highly dependent on hardware and has high deployment and maintenance costs. In practical engineering environments, it is difficult to guarantee millisecond-level synchronization accuracy in the long term due to transmission delay, network jitter, and crystal oscillator drift. Once the clock source fails or the network fluctuates, the data alignment accuracy will drop sharply, making it difficult to deploy universally in large-scale energy storage power stations.
[0004] Secondly, interpolation resampling methods are prone to transient distortion. Linear interpolation or spline interpolation upsamples low-frequency data to a high-frequency time point by assuming that the data changes smoothly and gradually within the sampling interval. However, during the switching between charging and discharging in energy storage systems, voltage and current signals are often accompanied by millisecond-level spikes or step changes. Interpolation methods cannot accurately reproduce such abrupt changes, resulting in the loss of key transient information. This directly leads to distortion of the input to the subsequent state estimation model and affects the timeliness of fault warning.
[0005] Third, the Dynamic Time Warping (DTW) algorithm is computationally inefficient and ignores cross-modal correlations. DTW uses dynamic programming to find the optimal nonlinear alignment path between two sequences, which can tolerate a certain degree of time distortion, but its computational complexity is O(n²). Faced with the massive amounts of data accumulated over long periods of energy storage system operation, this method incurs enormous computational overhead, making it difficult to meet the requirements of online real-time processing. Furthermore, DTW is essentially a univariate matching algorithm; when processing multimodal data such as voltage, current, and temperature, it must be executed separately, failing to utilize the inherent electromechanical-thermal coupling relationships between various physical quantities as alignment constraints. This can lead to potentially inconsistent alignment results in a physical sense, limiting the accuracy of subsequent multi-source data fusion analysis.
[0006] Fourth, rule-based event alignment methods have poor generalization capabilities. This method relies excessively on expert knowledge by manually defining characteristic events such as charge / discharge switching and current surges as alignment anchors. When battery type, operating conditions, or aging status changes, the preset rules struggle to cover the new data patterns, exhibit poor cross-power station migration capabilities, and have high rule maintenance costs.
[0007] Fifth, supervised learning methods rely heavily on manual annotation. In recent years, some studies have attempted to use deep learning models for end-to-end temporal alignment, but such supervised learning paradigms require massive amounts of accurately aligned labels as training data. Under the complex and ever-changing actual operating conditions of energy storage systems, obtaining high-quality labeled data covering various scenarios is extremely costly, or even infeasible, severely restricting the engineering application of such methods. Summary of the Invention
[0008] This invention provides a method, system, device, and medium for processing multi-frequency sampling data of energy storage systems. It solves the technical problems of existing multi-frequency sampling data alignment methods for energy storage systems, which rely on hardware clock synchronization or manually preset rules and labels, making it difficult to balance alignment accuracy and computational efficiency, ignoring cross-modal physical correlations, and failing to adapt to complex and changing operating conditions, thus affecting the reliability of multi-source data fusion and state assessment.
[0009] The first aspect of this invention provides a method for processing multi-frequency sampling data of an energy storage system, comprising: Acquire multimodal and multi-frequency sampling data from the energy storage system, divide each mode of data in the multimodal and multi-frequency sampling data into data slices and add frequency position codes to generate the input embedding sequence corresponding to each mode; Based on the acquisition timestamps of each modal data, embedding vectors corresponding to data slices under different modalities are extracted from each input embedding sequence to construct positive and negative sample pairs. The input embedding sequence input transformer encoder is subjected to feature extraction, and the parameters of the transformer encoder are adjusted with the goal of maximizing the feature similarity of the positive sample pairs and minimizing the feature similarity of the negative sample pairs to complete self-supervised training and obtain a trained transformer encoder. After the multimodal data to be aligned corresponding to the energy storage system is divided into the same data slices and encoded by the frequency position, it is input into the trained converter encoder to obtain the alignment-aware feature vector corresponding to each data slice position in each mode. Based on the similarity between the alignment-aware feature vectors, the optimal alignment path between the modalities is determined. The original sampling points corresponding to each modality are resampled in time according to the optimal alignment path, and the resampled data of each modality is mapped to a preset time axis to output the aligned multimodal data.
[0010] Optionally, the step of dividing each modal data in the multimodal multi-frequency sampling data into data slices and adding frequency position encoding to generate the input embedding sequence corresponding to each modality includes: The multimodal multi-frequency sampling data is divided into data slices according to a uniform time granularity, and an initial data slice feature sequence corresponding to each mode is generated. An aggregation operation is used to compress multiple sampling points within the same data slice corresponding to the high-frequency modal data in the initial data slice feature sequence into the feature vector of the data slice, thereby generating the intermediate data slice feature sequence. The sampling points within the same data slice corresponding to the low-frequency modal data in the intermediate data slice feature sequence are expanded into the feature vector of the data slice by the padding operation to obtain the target data slice feature sequence. Based on the original sampling frequency index of each mode, the corresponding frequency embedding vector is obtained from the learnable frequency embedding matrix; Linear projection is performed on each feature vector in the feature sequence of the target data slice to obtain the projection vector of each data slice; The projection vector is added to the sequence position code and the frequency embedding vector to generate the target input embedding data for each data slice; All target input embedding data corresponding to each modality are arranged in chronological order to obtain the input embedding sequence corresponding to each modality.
[0011] Optionally, the step of extracting embedding vectors corresponding to data slices under different modalities from each of the input embedding sequences based on the acquisition timestamps of each modality data, and constructing positive sample pairs and negative sample pairs, includes: Based on the acquisition timestamps of the data of each modality, the acquisition time corresponding to each data slice in each modality is determined; From each of the input embedding sequences, extract the embedding vectors corresponding to data slices from different modalities with the same acquisition time, and construct positive sample pairs; From each of the input embedding sequences, embedding vectors corresponding to data slices under different modalities at different acquisition times are extracted to construct negative sample pairs; The negative sample pairs also include hard negative sample pairs, which are the embedding vectors corresponding to data slices under different modalities where the difference at the acquisition time is less than a preset threshold.
[0012] Optionally, the transformer encoder includes a multi-head self-attention layer, a first normalization layer, a feedforward network layer, and a second normalization layer connected in sequence; the step of extracting features from each of the input embedding sequences into the transformer encoder, and adjusting the parameters of the transformer encoder with the goal of maximizing the feature similarity of the positive sample pairs and minimizing the feature similarity of the negative sample pairs to complete self-supervised training and obtain a trained transformer encoder includes: The input embedding sequences corresponding to each modality are concatenated according to the modality, and then superimposed with the modality type codes corresponding to each data slice to generate the encoder input sequence. The encoder input sequence is input into the converter encoder, and after passing through the multi-head self-attention layer and the first normalization layer in sequence, it is connected with the encoder input sequence for the first residual connection to obtain the intermediate output sequence. After the intermediate output sequence is passed through the feedforward network layer and the second normalization layer in sequence, it is connected with the intermediate output sequence for the second residual connection to output the alignment-aware feature vector corresponding to each data slice; Calculate the cosine similarity between the alignment-aware feature vectors of different modal data slices in the positive sample pair, and use it as the first cosine similarity; Calculate the cosine similarity between the alignment-aware feature vectors of different modal data slices in the negative sample pair, and use it as the second cosine similarity; Based on the first cosine similarity and the second cosine similarity, a contrast loss term is constructed, and the contrast loss value is calculated. With the goal of minimizing the contrastive loss value, the parameters of the converter encoder are iteratively adjusted until the contrastive loss value converges, thus completing the self-supervised training and obtaining the trained converter encoder.
[0013] Optionally, the step of constructing a contrast loss term based on the first cosine similarity and the second cosine similarity, and calculating the contrast loss value, includes: Using the exponential term of each of the first cosine similarities as the numerator and the sum of the cosine similarity exponential terms of each of the positive sample midpoint anchor data slices and all candidate data slices in the same batch as the denominator, a loss term is constructed, and the unidirectional contrast loss value is calculated. The first direction contrast loss value is calculated using the first modality data slice in the positive sample pair as the anchor point, and the second direction contrast loss value is calculated using the second modality data slice in the positive sample pair as the anchor point. The average of the first-direction contrast loss value and the second-direction contrast loss value is used as the bidirectional contrast loss value corresponding to the positive sample pair. When the number of modes is equal to two, the bidirectional contrast loss value is used as the contrast loss value; When the number of modes is greater than two, calculate the corresponding bidirectional contrast loss value for each mode pair composed of two different modes. The sum of the bidirectional contrast loss values of all the aforementioned mode pairs is taken as the contrast loss value.
[0014] Optionally, the step of inputting the multimodal data to be aligned corresponding to the energy storage system into the trained converter encoder after being divided into the same data slices and encoded by the same frequency position, to obtain the alignment-aware feature vector corresponding to each data slice position in each mode, includes: Obtain the multimodal data to be aligned corresponding to the energy storage system; The multimodal data to be aligned is divided into data slice sequences corresponding to each modality according to the same data slice division method as in the training phase, and the same frequency position code is added to each data slice sequence to generate an embedding sequence to be encoded for each modality. Each of the embedded sequences to be encoded is input into the trained transformer encoder for feature extraction, and the alignment-aware feature vector corresponding to each data slice position in each modality is output.
[0015] Optionally, the step of determining the optimal alignment path between each modality based on the similarity between each alignment-aware feature vector includes: Calculate the cosine similarity of alignment-aware feature vectors between different data slices in each modality, and construct a cross-modal similarity matrix; Based on the cross-modal similarity matrix, a path search method is used to determine the optimal alignment path between the modalities.
[0016] A second aspect of the present invention provides a processing system for multi-frequency sampling data of an energy storage system, comprising: The slicing and encoding module is used to acquire multi-modal and multi-frequency sampling data of the energy storage system, divide the data of each mode into data slices and add frequency position encoding to generate the input embedding sequence corresponding to each mode; The sample construction module is used to extract the embedding vectors corresponding to data slices under different modalities from each input embedding sequence based on the acquisition timestamp of each modal data, and to construct positive sample pairs and negative sample pairs. The self-supervised training module is used to extract features from each of the input embedding sequence input transformer encoders, and adjust the parameters of the transformer encoders with the goal of maximizing the feature similarity of the positive sample pairs and minimizing the feature similarity of the negative sample pairs, to complete the self-supervised training and obtain the trained transformer encoder. The feature extraction module is used to input the multimodal data to be aligned corresponding to the energy storage system into the trained converter encoder after the same data slice division and frequency position encoding, so as to obtain the alignment-aware feature vector corresponding to each data slice position in each mode; The path solving module is used to determine the optimal alignment path between the modalities based on the similarity between the alignment-aware feature vectors. The alignment output module is used to perform temporal resampling on the original sampling points corresponding to each modality according to the optimal alignment path, map the resampled data of each modality to a preset time axis, and output the aligned multimodal data.
[0017] A third aspect of the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the energy storage system multi-frequency sampling data processing method described above.
[0018] The fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed, it implements the method for processing multi-frequency sampling data of an energy storage system as described above.
[0019] As can be seen from the above technical solutions, the present invention has the following advantages: This invention divides the acquired multimodal, multi-frequency sampling data from an energy storage system into data slices and adds frequency position encoding to generate input embedding sequences corresponding to each mode. This achieves a unified time-granularity mapping of data at different sampling rates, laying a standardized data foundation for subsequent cross-modal time-series alignment. By extracting embedding vectors corresponding to data slices under different modes from each input embedding sequence based on the acquisition timestamps of each modality's data, positive and negative sample pairs are constructed. This enables the automatic acquisition of the supervision signals required for comparative learning training without relying on high-precision clock synchronization and manual annotation, effectively reducing data preparation and system deployment costs. By embedding each input into the sequence input transformer encoder for feature extraction, and adjusting the transformer encoder parameters with the goal of maximizing the feature similarity of positive sample pairs and minimizing the feature similarity of negative sample pairs to complete self-supervised training, the encoder is forced to map cross-modal data slices corresponding to the same physical moment to similar positions in the feature space. This encodes alignment-aware information into the output feature vector, enabling the alignment process to fully utilize the inherent physical coupling relationship between voltage, current, temperature, and state of charge as constraints. This overcomes the deficiency of univariate matching methods in not being able to utilize cross-modal correlations and ensures the physical consistency of the alignment results.
[0020] By dividing the multimodal data to be aligned into identical data slices and encoding their frequency positions, and then inputting the data slices into a pre-trained transformer encoder, alignment-aware feature vectors corresponding to each data slice position in each modality are obtained. This allows the alignment-aware features to be extracted with only one forward propagation during the inference phase, avoiding the high time overhead caused by repeated iterative computations. The optimal alignment path between each modality is determined based on the similarity between the alignment-aware feature vectors. The original sampling points corresponding to each modality are then temporally resampled according to the optimal alignment path and mapped to a unified time axis to output aligned multimodal data. This allows the inference phase to complete temporal matching with only linear complexity path search while maintaining high alignment accuracy. Simultaneously, it accurately captures spikes and step changes during charge-discharge switching, avoiding the loss of critical transient information caused by methods such as linear interpolation, thus balancing high alignment accuracy with low computational overhead. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 A flowchart illustrating the steps of a method for processing multi-frequency sampling data in an energy storage system, as provided in an embodiment of the present invention; Figure 2 A flowchart illustrating a method for processing multi-frequency sampling data of an energy storage system, provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of multi-frequency data slicing provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the construction of cross-modal comparison samples provided in an embodiment of the present invention; Figure 5 This is a structural diagram of the Transformer encoder provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of the cross-modal similarity matrix provided in an embodiment of the present invention; Figure 7 This is a schematic diagram of the inference stage timing alignment process provided in an embodiment of the present invention; Figure 8 This is a schematic diagram comparing the timing alignment performance provided in an embodiment of the present invention; Figure 9 A structural block diagram of a multi-frequency sampling data processing system for an energy storage system provided in an embodiment of the present invention; Figure 10 This is a structural block diagram of a computer device provided in an embodiment of the present invention. Detailed Implementation
[0023] This invention provides a method, system, device, and medium for processing multi-frequency sampling data of an energy storage system. It addresses the technical problems of existing multi-frequency sampling data alignment methods for energy storage systems, which rely on hardware clock synchronization or manually preset rules and labels, making it difficult to balance alignment accuracy and computational efficiency, ignoring cross-modal physical correlations, and failing to adapt to complex and changing operating conditions, thus affecting the reliability of multi-source data fusion and state assessment.
[0024] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0025] Please see Figure 1 and Figure 2 , Figure 1 A flowchart illustrating the steps of a method for processing multi-frequency sampling data in an energy storage system, as provided in an embodiment of the present invention; Figure 2 This is a flowchart illustrating a method for processing multi-frequency sampling data of an energy storage system, as provided in an embodiment of the present invention. Figure 1 and Figure 2 The end-to-end processing chain of this method is fully demonstrated, which includes six core steps: data slicing and encoding, comparison sample construction, self-supervised training, feature extraction, path solving and alignment output. Each step is connected through data flow, supporting differentiable optimization of the entire process.
[0026] This invention provides a method for processing multi-frequency sampling data from an energy storage system, comprising: Step 101: Obtain multi-mode multi-frequency sampling data of the energy storage system, divide the data of each mode in the multi-mode multi-frequency sampling data into data slices and add frequency position codes to generate the input embedding sequence corresponding to each mode.
[0027] Multimodal, multi-frequency sampling data refers to the collection of multi-source physical quantity data acquired by various sensors deployed at different monitoring nodes at differentiated sampling frequencies during the operation of an energy storage power station. Specifically, it includes electrical signals such as voltage and current (typically sampled at millisecond-level high frequencies, such as 1000Hz) and thermodynamic and state signals such as temperature and state of charge (typically sampled at second-level low frequencies, such as 1Hz). The inherent differences in sampling frequencies between different modal data lead to misalignment issues in the time dimension, preventing direct fusion. Therefore, it is necessary to map each modal data to the same time granularity through unified slicing processing and preserve the original sampling rate information of each mode through frequency position encoding.
[0028] This step corresponds to Figure 3 A schematic diagram of multi-frequency data slicing is shown, which includes four sub-diagrams: (a) the original waveform and data slice division of the high-frequency voltage signal; (b) the data slice feature vector obtained after downsampling and aggregation of the high-frequency data; (c) the original sampling points and data slice division of the low-frequency temperature signal; and (d) the data slice feature vector obtained after upsampling and filling of the low-frequency data.
[0029] In this embodiment of the invention, firstly, the data for each modality is divided into data slices according to a uniform time granularity, generating initial data slice feature sequences corresponding to each modality. Next, an aggregation operation is used to compress multiple sampling points within the same data slice corresponding to the high-frequency modality data into feature vectors for that data slice, generating intermediate data slice feature sequences. Then, a padding operation is used to expand the sampling points within the same data slice corresponding to the low-frequency modality data into feature vectors for that data slice, obtaining target data slice feature sequences. Then, based on the original sampling frequency index of each modality, the corresponding frequency embedding vector is obtained from the learnable frequency embedding matrix. Simultaneously, each feature vector is linearly projected and added to the sequence position encoding and frequency embedding vector to generate target input embedding data for each data slice. Finally, all target input embedding data corresponding to each modality are arranged in chronological order to obtain the input embedding sequence corresponding to each modality. This process converts the original multimodal multi-frequency sampling data into a structured input embedding sequence that retains frequency information, providing standardized data input for subsequent cross-modal temporal alignment.
[0030] Further, step 101 includes the following sub-steps: S11. Divide the data of each modality in the multimodal multi-frequency sampling data into data slices according to a uniform time granularity, and generate the initial data slice feature sequence corresponding to each modality.
[0031] Uniform time granularity refers to a pre-defined fixed time length. (For example, 100ms) serves as the basic time unit for all modal data slices. This granularity allows modal data with different sampling frequencies to be uniformly divided in the time dimension, ensuring that the number of slices for each modality remains consistent over time.
[0032] In this embodiment of the invention, the multimodal multi-frequency sampling data from step 101 is first acquired, and each modal data is treated as an independent processing object. Then, the data is processed according to a uniform time granularity. The original time series of each modality is segmented to generate initial data slice feature sequences corresponding to each modality. Through this segmentation, modal data with different sampling frequencies achieve a uniform slice granularity in the time dimension, providing a uniformly formatted processing unit for subsequent aggregation or filling operations.
[0033] S12. Using aggregation operations, multiple sampling points within the same data slice corresponding to the high-frequency modal data in the initial data slice feature sequence are compressed into feature vectors of that data slice, generating intermediate data slice feature sequences.
[0034] High-frequency modal data refers to modal data with a sampling frequency higher than the frequency corresponding to a uniform time granularity. Taking voltage data as an example... Figure 3As shown in (a), the original high-frequency voltage signal (sampling rate) =1000Hz) is divided into multiple patch intervals, and the time granularity of each patch (data slice) is 1000Hz. =100ms, each patch contains Each sampling point. For example... Figure 3 As shown in (b) in the figure, the sampling points within each patch are compressed into a feature vector through an aggregation operation.
[0035] Aggregation operations refer to the operation of mapping multiple sampling points within the same data slice to a single feature vector using a certain aggregation function. Let the voltage data sampling rate be... =1000Hz, target Patch time granularity is =100ms, then each patch contains There are 10 sampling points. The aggregation method is represented as follows: ; in, For the first k Feature vectors of each voltage patch; It is an aggregate function; This is the original high-frequency voltage sampling sequence; k Patch number; The number of sampling points contained in each voltage patch; Indicates the first k The original sampling point range corresponding to each Patch.
[0036] The aggregation function can be selected in the following ways: (1) Mean aggregation: (2) Statistical aggregation: (3) Learnable aggregation: The mapping method is learned through a one-dimensional convolutional layer.
[0037] In this embodiment of the invention, data slices belonging to high-frequency modal data are first identified in the initial data slice feature sequence. Then, for each data slice corresponding to each high-frequency modal data, an aggregation operation is performed to compress multiple sampling points within the slice into a single feature vector. Finally, the processed high-frequency modal data slice features are combined with the unprocessed low-frequency modal data slice features to form an intermediate data slice feature sequence. Through the aggregation operation, the high-frequency modal data is transformed from each slice containing multiple sampling points to each slice corresponding to a single feature vector, reducing data dimensionality and subsequent computational overhead.
[0038] S13. Using a padding operation, the sampling points within the same data slice corresponding to the low-frequency modal data in the intermediate data slice feature sequence are expanded into the feature vector of that data slice to obtain the target data slice feature sequence.
[0039] Low-frequency modal data refers to modal data whose sampling frequency is lower than the frequency corresponding to a uniform time granularity. Taking temperature data as an example... Figure 3 As shown in (c), the original low-frequency temperature signal (sampling rate) =1Hz) has only 1 sampling point per second, but the target patch time granularity is =100ms, 10 patches need to be filled per second. For example Figure 3 As shown in (d) in the figure, it is expanded into 10 patch feature vectors by zero-order preservation or linear interpolation.
[0040] The padding operation refers to the operation of expanding sparse sampling points in low-frequency modal data into feature vectors with the same format as slices of high-frequency modal data. Let the temperature data sampling rate be... =1Hz, target patch time granularity is =100ms, then 10 patches need to be filled per second, and the filling method is expressed by the formula: ; in, For the first k Feature vectors of a temperature patch; This is a fill function; T This is the original low-frequency temperature sampling sequence; k Patch number; The target patch time granularity; This represents the sampling frequency of the temperature data.
[0041] The filling strategy can be implemented in the following ways: (1) Zero-order hold: copy the most recent sampled value to fill the entire patch; (2) Linear interpolation: linear interpolate based on adjacent sampled points; (3) Learnable filling: learn the filling pattern through a multilayer perceptron (MLP).
[0042] In this embodiment of the invention, data slices belonging to low-frequency modal data are identified in the intermediate data slice feature sequence. Then, for each data slice corresponding to each low-frequency modal data, a padding operation is performed to expand the sampling points within the slice into a feature vector for that data slice. Finally, the target data slice feature sequence is obtained, with all modal data uniformly formatted so that each slice corresponds to a feature vector.
[0043] S14. Based on the original sampling frequency index of each mode, obtain the corresponding frequency embedding vector from the learnable frequency embedding matrix.
[0044] The original sampling frequency index is a number used to uniquely identify the original sampling frequency of each modality's data. For example, 1000Hz corresponds to index 0, 100Hz corresponds to index 1, and 1Hz corresponds to index 2.
[0045] A learnable frequency embedding matrix is a parameter matrix that is continuously updated through backpropagation during model training. Each row of the matrix corresponds to a sampling frequency identifier. This matrix stores the embedding vector corresponding to that frequency. It is used in training along with other parameters of the model, enabling the model to automatically learn the optimal representation for different sampling frequencies.
[0046] The frequency embedding vector, used to identify the original sampling rate to which the data slice belongs, is calculated as follows: ; in, This is the identifier for the original sampling rate; It is a frequency embedding vector, i.e., a frequency position encoding, with a dimension of . d ; This is a lookup operation for the embedded layer.
[0047] In this embodiment of the invention, the original sampling frequency index of each modality data is obtained. Then, using this index as the lookup key, the corresponding frequency embedding vector is extracted from the learnable frequency embedding matrix. This vector will be added to the projection vector and sequence position encoding in S16 to form the target input embedding data of the data slice. Through the frequency embedding vector, the model can perceive the differences in the original sampling rate of each modality, thereby better learning the temporal correspondence across modalities.
[0048] S15. Perform linear projection on each feature vector in the feature sequence of the target data slice to obtain the projection vector of each data slice.
[0049] Linear projection refers to the operation of mapping feature vectors from the original feature space to the model's hidden space through a linear transformation (matrix multiplication). Specifically, it maps the feature vectors of each data slice... Multiplying by a learnable weight matrix yields a projection vector with uniform dimensions. .
[0050] In this embodiment of the invention, the feature vectors of each data slice in the target data slice feature sequence generated in S13 are first obtained. Next, for each feature vector in the sequence, a linear projection is performed by multiplying it with the learnable weight matrix, mapping each feature vector to a unified hidden space dimension. d Finally, output the projection vectors corresponding to each data slice. Through linear projection, feature vectors of different modalities and dimensions are unified into the same feature space, making subsequent encoding overlay and attention computation possible.
[0051] S16. Add the projection vector to the sequence position encoding and frequency embedding vector to generate the target input embedding data for each data slice.
[0052] Sequence position encoding This is encoded information added to the position of a data slice in the time series, allowing the model to perceive the temporal order of each data slice. This encoding can use sine / cosine positional encoding or learnable positional embedding.
[0053] The target input embedding data refers to the complete vector representation of each data slice that is ultimately input into the Transformer encoder. It is obtained by element-wise addition of the projection vector, sequence position encoding, and frequency embedding vector, as shown in the following formula: ; in, For the first k The final embedding vector of each patch (i.e., the target input embedding data). The projection vector generated for S15; For the first k Sequence position encoding of each patch; This is the frequency embedding vector obtained for S14. This embedding simultaneously contains the numerical features, temporal location information, and original sampling frequency information of the slice.
[0054] In this embodiment of the invention, the projection vectors of each data slice generated in S15 are first obtained. Next, the corresponding sequence position encoding is superimposed on each projection vector. (Identifying the position of the slice within its modal time series) and the frequency embedding vector obtained in S14. (The original sampling rate of the slice is identified), and the three factors are added element-wise. Finally, the target input embedded data corresponding to each data slice is output. By superimposing the projection vector, position encoding, and frequency embedding vector, the target input embedding data of each data slice learns temporal order information and sampling rate source information, providing a complete input representation for the Transformer encoder's cross-modal temporal alignment learning.
[0055] S17. Arrange all target input embedding data corresponding to each mode in chronological order to obtain the input embedding sequence corresponding to each mode.
[0056] In this embodiment of the invention, all target input embedding data generated in S16 are first processed according to modal type. Classify them according to whether they belong to the same mode (such as voltage mode). V All target input embedding data are aggregated together to form the embedding set corresponding to that modality. Next, all target input embedding data for each mode are sorted according to their chronological order in the original time series. Finally, the input embedding sequences corresponding to each mode are output, completing the transformation from the original multimodal multi-frequency sampling data to a unified format input embedding sequence that retains frequency information.
[0057] It should be noted that during subsequent Transformer encoder processing (see...) Figure 5 (Left input section) The input embedding sequences of each modality will be concatenated modally. Add modal type encoding To distinguish different modal sources and form a complete encoder input, i.e. .in, The input sequence for the Transformer encoder; These are the embedding vectors for the t-th patch, representing voltage, current, temperature, and SOC mode, respectively. T The number of patches for each modality; Modality type encoding is used to distinguish different modality sources. This splicing and encoding process is completed in the Transformer encoder input construction in step 102. This step only generates the independent input embedding sequence for each modality.
[0058] Step 102: Based on the acquisition timestamps of each modality data, extract the embedding vectors corresponding to the data slices under different modalities from each input embedding sequence, and construct positive sample pairs and negative sample pairs.
[0059] This step corresponds to Figure 4 A schematic diagram of cross-modal comparison sample construction. The upper part of the diagram shows the data slice sequence of the voltage mode, and the lower part shows the data slice sequence of the temperature mode. Solid green lines connect positive sample pairs, i.e., cross-modal data slices at the same time. Dashed gray lines connect negative sample pairs, i.e., cross-modal data slices at different times. Negative sample pairs at adjacent times are connected by dashed yellow lines and marked as hard negative samples.
[0060] This step constructs the training samples required for contrastive learning based on the coarse-grained timestamps recorded by the data acquisition system. In the actual operation of an energy storage power station, each sensor collects data independently, and the system records a coarse-grained timestamp for each sampling point with second-level accuracy.
[0061] In this embodiment of the invention, the acquisition time corresponding to each data slice is first determined based on the acquisition timestamp of each modality's data. Then, embedding vectors corresponding to data slices from different modalities with the same acquisition time are extracted from each input embedding sequence to construct positive sample pairs. Next, embedding vectors corresponding to data slices from different modalities with different acquisition times are extracted from each input embedding sequence to construct negative sample pairs. The negative sample pairs also include hard negative sample pairs, which are embedding vectors corresponding to data slices from different modalities whose acquisition time difference is less than a preset threshold. By constructing positive and negative sample pairs, supervision signals are provided for subsequent comparative learning training.
[0062] Further, step 102 includes the following sub-steps: S21. Based on the acquisition timestamps of each modal data, determine the acquisition time corresponding to each data slice in each modality.
[0063] In this embodiment of the invention, the data acquisition system records a coarse-grained timestamp for each sampling point, with a precision at the second level. In step S11, after dividing the modal data into multiple data slices according to a uniform time granularity, the acquisition time corresponding to each data slice is determined based on the acquisition timestamp of each sampling point. For high-frequency modal data, multiple sampling points within the same data slice have the same or similar acquisition times; the average time or start time of the sampling points within the slice is taken as the acquisition time of that data slice. For low-frequency modal data, each data slice contains only one sampling point; the acquisition time of that sampling point is directly taken as the acquisition time of that data slice. This method establishes the correspondence between each modality's data slice and its acquisition time, providing a basis for time alignment for the subsequent construction of positive and negative sample pairs.
[0064] S22. Extract the embedding vectors corresponding to the data slices of different modalities with the same acquisition time from each input embedding sequence, and construct positive sample pairs.
[0065] In this embodiment of the invention, based on the acquisition time corresponding to each data slice determined in S21, different modal data slices with the same acquisition time are selected from the input embedding sequence corresponding to each modality, and the embedding vectors corresponding to these data slices are extracted to construct positive sample pairs. Specifically, this is expressed as follows: ; in, For voltage mode number 1 k Embedding vectors corresponding to each data slice; For the temperature mode number k Embedding vectors corresponding to each data slice; This is a function for extracting coarse-grained timestamps from data slices; positive sample pairs are defined as embedding vector pairs corresponding to cross-modal data slices with the same acquisition time.
[0066] S23. Extract the embedding vectors corresponding to the data slices under different modalities at different acquisition times from each input embedding sequence, and construct negative sample pairs.
[0067] In this embodiment of the invention, based on the acquisition time corresponding to each data slice determined in S21, different modal data slices with different acquisition times are selected from the input embedding sequences corresponding to each modality, and the embedding vectors corresponding to these data slices are extracted to construct negative sample pairs. Specifically, this is expressed as follows: ; in, For voltage mode number 1 k Embedding vectors corresponding to each data slice; For the temperature mode number j Embedding vectors corresponding to each data slice; This represents a pair of cross-modal data slices acquired at different times.
[0068] It is worth mentioning that negative sample pairs also include hard negative sample pairs. Hard negative sample pairs are the embedding vectors corresponding to data slices of different modalities whose difference at the acquisition time is less than a preset threshold, specifically represented as follows: ; in, The offset is within the threshold range of the time proximity; For example, to preset the nearest neighbor threshold. =2, corresponding to a 200ms time difference. Time proximity threshold. The value of will affect the training effect of hard negative samples: if the value is too small, the hard negative samples and positive samples will be too similar, which may make it difficult for the model to distinguish them; if the value is too large, the hard negative samples and positive samples will be too different, and the training value of hard negative samples will be lost.
[0069] Step 103: Extract features from each input embedded sequence into the transformer encoder, and adjust the parameters of the transformer encoder with the goal of maximizing the feature similarity of positive sample pairs and minimizing the feature similarity of negative sample pairs to complete self-supervised training and obtain the trained transformer encoder.
[0070] It should be noted that, Figure 5 The transformer encoder network structure with shared parameters is shown: the input layer receives the embedded sequences of each modality slice, and after modality type encoding, features are extracted through a multi-layer transformer module (including a multi-head self-attention mechanism and a feedforward network) to output the alignment-aware feature vector of each slice position; Figure 6 To compare the core data structure for loss calculation, the matrix elements represent the cosine similarity between two modality slices, with diagonal elements corresponding to positive sample pairs and off-diagonal elements corresponding to negative sample pairs.
[0071] It should be noted that this step utilizes the positive and negative sample pairs constructed in step 102 for comparative learning training. This training is based on second-level coarse-grained timestamps recorded by the data acquisition system as weak supervision signals. Multiple data slices within the same second constitute a positive sample candidate pool. Although it is impossible to precisely determine which k-th voltage data slice corresponds strictly to which temperature data slice, comparative learning training allows the converter encoder to learn that cross-modal data slices with similar physical state change patterns should correspond to the same time. For example, during charging, the voltage data slice shows an upward trend, while the corresponding temperature data slice shows a slight upward trend. Comparative learning training allows the model to associate these two patterns. This pattern-matching-based alignment method helps achieve finer temporal alignment when the accuracy of the original timestamps is limited.
[0072] In this embodiment of the invention, the transformer encoder is configured with the following parameters: the temporal granularity of the data slice is 100ms, serving as a uniform temporal resolution; the number of layers in the transformer encoder is 2 to 4; the hidden dimension is 128 to 256; the number of attention heads in the multi-head self-attention is 4 to 8; the temperature coefficient in the contrastive learning loss function is 0.07 to 0.1; and the batch size during training is 256 to 512. These parameters can be adaptively adjusted according to the actual application scenario and data scale.
[0073] Transformer encoder training can be flexibly executed in three stages: The pre-training stage employs a large-scale self-supervised contrastive learning strategy to complete encoder pre-training on massive energy storage operation data, enabling the encoder to learn general temporal alignment features. During the fine-tuning phase, a joint training strategy for downstream tasks is adopted, which involves fine-tuning the encoder together with tasks such as SOC estimation and fault diagnosis to achieve global optimization. During the online adaptation phase, an incremental learning strategy is adopted to continuously update encoder parameters using data generated by new equipment and new operating conditions, ensuring the long-term adaptability of the encoder.
[0074] Furthermore, the converter encoder comprises a multi-head self-attention layer, a first normalization layer, a feedforward network layer, and a second normalization layer connected in sequence. In this embodiment, the input embedding sequences corresponding to each modality are first concatenated modally and then superimposed with the modality type encoding corresponding to each data slice to generate the encoder input sequence. Next, the encoder input sequence is input to the converter encoder, passing through the multi-head self-attention layer and the first normalization layer sequentially, and then undergoing a first residual connection with the encoder input sequence to obtain an intermediate output sequence. Then, the intermediate output sequence passes through the feedforward network layer and the second normalization layer sequentially, and then undergoes a second residual connection with the intermediate output sequence to output the alignment-aware feature vectors corresponding to each data slice. Afterward, the cosine similarity between the alignment-aware feature vectors of different modal data slices in a positive sample pair is calculated as the first cosine similarity, and the cosine similarity between the alignment-aware feature vectors of different modal data slices in a negative sample pair is calculated as the second cosine similarity. Then, a contrastive loss term is constructed based on the first and second cosine similarities, and the contrastive loss value is calculated. Finally, with the goal of minimizing the contrastive loss value, the parameters of the transformer encoder are iteratively adjusted until the contrastive loss value converges, completing the self-supervised training and obtaining the trained transformer encoder.
[0075] Furthermore, step 103 includes the following sub-steps: S31. After concatenating the input embedding sequences corresponding to each mode according to the mode, the sequence is superimposed with the mode type encoding corresponding to each data slice to generate the encoder input sequence.
[0076] In embodiments of the present invention, such as Figure 5 As shown in the input section on the left, the input embedding sequences corresponding to each mode are concatenated according to mode to form a unified encoder input sequence. Specifically, the target input embedding data of all data slices for the voltage mode, current mode, temperature mode, and SOC mode are arranged sequentially according to mode type: ; in, The input sequence for the Transformer encoder; These are the embedding vectors for the t-th patch, representing voltage, current, temperature, and SOC mode, respectively. T The number of patches for each modality, i.e., the number of data slices.
[0077] After the data slices are assembled, add modality type encoding to each slice. Used to distinguish different modal sources: ; By splicing by modality and overlaying modality type encoding, the encoder is able to distinguish the boundaries of each modality and perceive the modality type to which each data slice belongs.
[0078] S32. Input the encoder input sequence into the encoder converter, and after passing through the multi-head self-attention layer and the first normalization layer in sequence, perform the first residual connection with the encoder input sequence to obtain the intermediate output sequence.
[0079] In this embodiment of the invention, the encoder input sequence generated in S31 is input to the first sub-layer of the encoder in the transformer. This sub-layer includes a multi-head self-attention mechanism and a first-layer normalization operation. Figure 4 As shown in the middle main section, the encoder input sequence is first used simultaneously as query Q, key K, and value V to input into the multi-head self-attention layer, and the attention weights between the positions of each data slice are calculated: ; Where Q, K, and V are the query, key, and value matrices, respectively; The dimension of the key vector, and the scaling factor. This is used to prevent the gradient from entering the saturation region due to an excessively large dot product; This is a normalized exponential function used to convert attention weights into a probability distribution.
[0080] The output of the multi-head self-attention layer, after being normalized by the first layer, is then connected to the encoder input sequence via a first residual connection: ; in, This is an intermediate output sequence; This is a layer normalization operation used to stabilize the training process; This is a multi-head self-attention function that concatenates and linearly transforms the results of multiple attention heads. Residual connections preserve the original information of the encoder's input sequence, helping to alleviate the vanishing gradient problem in deep networks.
[0081] S33. After passing the intermediate output sequence through the feedforward network layer and the second normalization layer, perform a second residual connection with the intermediate output sequence to output the alignment-aware feature vectors corresponding to each data slice.
[0082] In this embodiment of the invention, the intermediate output sequence obtained in S32 is input into the second sub-layer of the converter encoder. This sub-layer includes a feedforward network layer and a second normalization layer. Figure 5 As shown in the middle main body, the intermediate output sequence First, it passes through the feedforward network layer. The sequence undergoes a nonlinear transformation, followed by a second normalization layer, and is then compared with the intermediate output sequence. Perform a second residual join: ; in, For the encoder output of the converter; It is a feedforward network, which typically contains two linear transformations and one nonlinear activation function.
[0083] The transducer encoder can contain multiple blocks as described above, each block having the same structure and sharing parameters across all modes. The output of the last block... In this process, the output of each data slice position is taken as the alignment-aware feature vector (e.g., Figure 5 (As shown in the output section on the right) ; in, For modality m No. k Alignment-aware feature vectors corresponding to each data slice ; Indicates the mode in encoder output m No. k The vector corresponding to each data slice position; d For feature dimensions; for d A real vector space.
[0084] S34. Calculate the cosine similarity between the alignment-aware feature vectors of different modal data slices in the positive sample pair, and use it as the first cosine similarity.
[0085] In this embodiment of the invention, the alignment-aware feature vectors corresponding to each data slice output by S33 are used. For the positive sample pairs constructed in step 102 Calculate the cosine similarity. That is, for voltage data slices acquired at the same time in step 102... With temperature data slices Extract the corresponding alignment-aware feature vectors output by S33 respectively. and The cosine similarity between the two features is calculated. Cosine similarity measures the directional consistency of two feature vectors in a high-dimensional space to reflect their temporal correspondence; its value ranges from -1 to 1, with a larger value indicating greater similarity. For example... Figure 6 As shown, the similarity matrix The diagonal elements in the array correspond to positive sample pairs. The calculation formula is: ; in, The cosine similarity function; For voltage mode number 1 kAlignment-aware feature vectors of data slices; For the temperature mode number k Alignment-aware feature vectors for each data slice; the numerator is the dot product of the two feature vectors, and the denominator is the product of the magnitudes of the two feature vectors. The cosine similarity of the positive sample pairs is denoted as the first cosine similarity.
[0086] It is important to emphasize that feature similarity here does not require that the physical quantities of different modes have similar values (the numerical ranges and units of voltage and temperature are different). Instead, by comparing the loss function, the transformer encoder is forced to map the cross-modal slices corresponding to the same physical moment to similar positions in the feature space, and finally learns an abstract representation of the temporal correspondence, capturing the physical coupling relationship between cross-modal data.
[0087] S35. Calculate the cosine similarity between the alignment-aware feature vectors of different modal data slices in the negative sample pair, and use it as the second cosine similarity.
[0088] In this embodiment of the invention, the alignment-aware feature vectors corresponding to each data slice output by S33 are used. For the negative sample pairs constructed in step 102 Calculate the cosine similarity. That is, for voltage data slices acquired at different times in step 102. With temperature data slices Extract the corresponding alignment-aware feature vectors output by S33 respectively. and And calculate the cosine similarity between the two. Figure 6 As shown, the similarity matrix The off-diagonal elements in the matrix correspond to negative sample pairs. The calculation formula is: ; in, This represents cross-modal data slices collected at different times. The cosine similarity of the negative sample pairs is denoted as the second cosine similarity.
[0089] S36. Based on the first cosine similarity and the second cosine similarity, construct the contrast loss term and calculate the contrast loss value.
[0090] In this embodiment of the invention, a contrastive learning loss term is constructed based on the first cosine similarity and the second cosine similarity calculated in steps S34 and S35. The goal of this loss term is to increase the first cosine similarity of positive sample pairs while decreasing the second cosine similarity of negative sample pairs, thereby forcing the transformer encoder to learn to encode alignment-aware information into the feature vector. This ensures that cross-modal data slices at the same time are close to each other in the feature space, while cross-modal data slices at different times are far apart in the feature space.
[0091] Further, step S36 includes the following sub-steps: S361. Using the exponential term of each first cosine similarity as the numerator and the sum of the cosine similarity exponential terms of each positive sample midpoint data slice and all candidate data slices in the same batch as the denominator, construct a loss term and calculate the unidirectional contrast loss value.
[0092] In this embodiment of the invention, a unidirectional contrastive loss term is constructed using a loss function based on noise contrast estimation. For example... Figure 6 As shown, for unidirectional contrastive learning with voltage mode as anchor point and temperature mode as candidate, the first... k The formula for calculating the one-way contrast loss value of a positive sample pair is: ; in, For voltage mode first k Each data slice serves as an anchor point, and the temperature mode is used as a candidate unidirectional contrast loss value. Anchor point data slice (voltage mode 1) k Alignment-aware feature vectors of (a number of data slices); The alignment-sensing feature vector of temperature modal data slices in positive sample pairing; Within the same batch j Aligned sensing feature vectors of candidate data slices (temperature modes); molecule The term represents the exponential term of the similarity between the anchor point and the positive sample pair; the denominator is the exponential term of the similarity between the anchor point and the positive sample pair. The sum of similarity index terms between the anchor point and all candidate temperature modal data slices within the same batch; This is a temperature coefficient used to adjust the smoothness of the similarity distribution; N The number of data slices within the batch; For the natural constant e An exponential function with base 0; It is the natural logarithm function.
[0093] The mechanism of this loss function is as follows: the numerator maximizes the feature similarity of positive sample pairs, and the denominator takes into account the similarity of all candidate data slices (including positive and negative samples) at the same time, so that positive sample pairs are relatively closer in the feature space.
[0094] It should be noted that the feature similarity calculated in this step does not require the physical quantities of different modalities to be similar in value (voltage and temperature have different numerical ranges and units). Instead, it learns the numerator and denominator of the loss function through comparison, enabling the encoder to map cross-modal data slices corresponding to the same physical moment to similar positions in the feature space. After training, the encoder learns an abstract representation of temporal correspondences, capturing the physical coupling relationships between cross-modal data.
[0095] S362. Calculate the first direction contrast loss value using the first modality data slice in the positive sample pair as the anchor point, and calculate the second direction contrast loss value using the second modality data slice in the positive sample pair as the anchor point.
[0096] In this embodiment of the invention, to fully utilize the bidirectional correspondence of cross-modal data, the unidirectional contrast loss values in both directions are calculated separately. The first direction contrast loss value... Using voltage mode data slices as anchor points and temperature mode data slices as candidates, the contrast loss of all positive sample pairs in the direction anchored by the voltage mode is calculated in the same manner as in S361, and the batch average is taken as the first direction contrast loss value. The second direction contrast loss value is then calculated. Using temperature mode data slices as anchor points and voltage mode data slices as candidates, the contrast loss of all positive sample pairs in the direction of temperature mode as anchor point is calculated in the same way as S361, and the batch average is taken as the contrast loss value of the second direction.
[0097] S363. The average of the first-direction contrast loss value and the second-direction contrast loss value is used as the bidirectional contrast loss value corresponding to the positive sample pair.
[0098] In this embodiment of the invention, the first direction contrast loss value calculated in S362 is used. Comparison of loss values in the second direction Taking the average, we obtain the two-way contrast loss value: ; in, This represents the bidirectional contrastive loss value. Through bidirectional optimization, the model can simultaneously learn the temporal correspondence between cross-modal data in both directions, making the mapping of the alignment-aware feature vector between the two modalities more symmetrical and stable.
[0099] S364. When the number of modes is equal to two, the bidirectional contrast loss value is used as the contrast loss value.
[0100] In this embodiment of the invention, when the number of modes participating in alignment is equal to two, that is, only the first mode and the second mode participate in contrastive learning, there is no need for multimodal expansion, and the bidirectional contrastive loss value calculated in S363 is directly applied. This serves as the final comparative loss value.
[0101] S365. When the number of modes is greater than two, calculate the corresponding bidirectional contrast loss value for each mode pair composed of two different modes.
[0102] In this embodiment of the invention, when the number of modes involved in alignment is greater than two, for example, when it is necessary to align four modes simultaneously: voltage, current, temperature, and SOC, it is necessary to calculate the bidirectional contrast loss value for each different pair of mode combinations. Specifically, for any two different modes... The resulting mode pairs are used to calculate the corresponding bidirectional contrast loss values according to steps S361 to S363. .
[0103] S366. The sum of the bidirectional contrast loss values of all mode pairs is taken as the contrast loss value.
[0104] In this embodiment of the invention, the bidirectional contrast loss values of all mode pairs in S365 are summed to obtain the multimodal joint contrast loss value: ; in, This represents the multimodal joint contrastive loss value, with the summation range covering all mode pairs to be aligned. Through this multimodal joint contrastive loss, the model can simultaneously learn the temporal correspondences between multiple modes, fully utilizing the abundant multi-source sensing data in the energy storage system.
[0105] S37. With the goal of minimizing the contrastive loss value, iteratively adjust the parameters of the converter encoder until the contrastive loss value converges, thus completing the self-supervised training and obtaining the trained converter encoder.
[0106] In this embodiment of the invention, the contrast loss value calculated in S36 is used as the optimization target. Specifically, when the number of modes is equal to two, the contrast loss value is the final contrast loss value in S364; when the number of modes is greater than two, the contrast loss value is the value in S366. The gradient is calculated using the backpropagation algorithm, and the optimizer iteratively updates all trainable parameters of the transformer encoder. In each iteration, a batch of samples is input into the encoder, the contrastive loss is calculated, and the parameters are updated via backpropagation. This process is repeated until the contrastive loss no longer decreases significantly on the validation set, indicating convergence. At this point, the parameter state of the transformer encoder is saved, resulting in the trained transformer encoder. Through self-supervised contrastive learning training, the encoder has encoded cross-modal temporal alignment information into the output feature vector, which can then be directly used for temporal alignment tasks during the inference phase.
[0107] Step 104: After dividing the multimodal data to be aligned corresponding to the energy storage system into the same data slices and encoding the frequency and position, input the data into the trained converter encoder to obtain the alignment-aware feature vector corresponding to each data slice position in each mode.
[0108] It should be noted that this step and subsequent steps share the same transformer encoder as step 103. Self-supervised contrastive learning training has been completed in step 103, and the encoder has encoded cross-modal temporal alignment information into the output feature vector. During the inference phase, the encoder parameters remain fixed. The multimodal data to be aligned is directly input into the trained encoder to obtain the alignment-aware feature vectors corresponding to each data slice. These feature vectors are directly used for subsequent similarity calculations and path searching, without the need for retraining or adjusting the encoder parameters.
[0109] Furthermore, step 104 includes the following sub-steps: S41. Obtain the multimodal data to be aligned corresponding to the energy storage system.
[0110] In this embodiment of the invention, multimodal data to be aligned is acquired during the operation of the energy storage system. This data has the same modal type and sampling frequency characteristics as the multimodal multi-frequency sampling data in step 101, that is, it includes high-frequency electrical quantity signals such as voltage and current, and low-frequency state quantity signals such as temperature and SOC. However, the different modal data differ in sampling frequency and are not aligned in the time dimension, requiring alignment processing in subsequent steps. This step corresponds to... Figure 6 Input the original multimodal data to be aligned.
[0111] S42. Divide the multimodal data to be aligned into data slice sequences corresponding to each modality according to the same data slicing method as in the training phase, and add the same frequency position coding to each data slice sequence to generate the embedding sequence to be encoded for each modality.
[0112] In this embodiment of the invention, the multimodal data to be aligned acquired in S41 is preprocessed in the same manner as in the training phase. First, the data for each modality is divided into data slices according to the same uniform time granularity as in step 101, generating a data slice sequence corresponding to each modality. Then, frequency position encoding is added in the same manner as in step 101, that is, the corresponding frequency embedding vector is obtained from the learnable frequency embedding matrix according to the original sampling frequency index of each modality, and superimposed on the feature vector of each data slice. After this preprocessing, an embedding sequence to be encoded corresponding to each modality is generated. The format of this sequence is consistent with the input embedding sequence output in step 101, ensuring the compatibility of the data format in the inference phase with the data format in the training phase.
[0113] S43. Input each embedded sequence to be encoded into the trained transformer encoder for feature extraction, and output the alignment-aware feature vector corresponding to each data slice position in each modality.
[0114] In this embodiment of the invention, the modal embedding sequences to be encoded generated in S42 are input into the transformer encoder trained in step 103. The encoder parameters remain fixed during the inference phase, and the embedding sequences to be encoded for each modality are directly propagated forward. The encoder first concatenates the embedding sequences to be encoded for each modality according to the modality and adds modality type encoding to form a complete encoder input sequence; then, it sequentially passes through a multi-head self-attention layer, a first normalization layer, a feedforward network layer, and a second normalization layer, with two residual connections for feature extraction. The structure of each block is exactly the same as in the training phase. The vector of each data slice position in the output of the last block of the encoder is taken as the alignment-aware feature vector corresponding to that data slice. Specifically, for modal... m The k Each data slice has an alignment-aware feature vector. For the corresponding position in the encoder output A vector with dimension d This feature vector has already been encoded with cross-modal temporal alignment information during the training phase and can be directly used for subsequent cross-modal similarity calculations. This step corresponds to... Figure 7 The trained Transformer encoder extracts the feature vectors of each patch.
[0115] Step 105: Determine the optimal alignment path between each modality based on the similarity between each alignment-aware feature vector.
[0116] In this embodiment of the invention, based on the alignment-aware feature vectors corresponding to the positions of each data slice in each modality extracted in step 104, the similarity between cross-modal data slices is calculated, and the optimal alignment path is determined through path search. This path reflects the correspondence between different modalities of data in the time dimension. This step corresponds to... Figure 7 The cross-modal similarity matrix is calculated and the optimal alignment path is searched based on greedy matching or dynamic programming.
[0117] In the scenario of multi-frequency alignment in energy storage, since the physical timing is irreversible, dynamic programming mode with monotonicity constraints is preferred. When the sampling of each mode is approximately synchronized and there is only a small time shift, greedy matching with window constraints can be used to reduce computational overhead.
[0118] Furthermore, step 105 includes the following sub-steps: S51. Calculate the cosine similarity of alignment-aware feature vectors between different data slices in each modality, and construct a cross-modal similarity matrix.
[0119] In this embodiment of the invention, based on the alignment-aware feature vectors corresponding to each data slice output in step 104, the cosine similarity between data slices of different modes is calculated. Taking voltage mode and temperature mode as examples, for the voltage mode...i The first data slice and temperature mode j Each data slice has an alignment-aware feature vector of 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ... and The formula for calculating cosine similarity is: ; in, The first element in the similarity matrix i Line number j The elements of the column represent the voltage mode. i The first data slice and temperature mode j Similarity between data slices; The cosine similarity function is used; the numerator is the dot product of the two eigenvectors, and the denominator is the product of the magnitudes of the two eigenvectors. Cosine similarity is calculated for all cross-modal data slice pairs, constructing a complete cross-modal similarity matrix S. The rows of this matrix correspond to data slices of the first modality, and the columns correspond to data slices of the second modality. A larger value for each element in the matrix indicates greater similarity between the data slice pairs in the feature space, and a higher probability of temporal alignment. This step corresponds to... Figure 7 Calculate the cross-modal similarity matrix.
[0120] S52. Based on the cross-modal similarity matrix, a path search method is used to determine the optimal alignment path between each modality.
[0121] In this embodiment of the invention, a cross-modal similarity matrix is constructed based on S51. S The optimal alignment path between each mode is determined by path search.
[0122] To ensure the physical validity of the alignment results, the alignment constraints and path search rules during the inference phase are as follows: Path search method 1 (greedy matching): indexing each voltage data slice i Each temperature data slice with the highest feature similarity is independently selected as the matching object: ; This method allows one-to-many matching, meaning multiple voltage data slices can be matched to the same temperature data slice. It does not enforce path monotonicity and is suitable for scenarios where there are no strict temporal monotonic constraints between modes or where local time shifts exist. To suppress mismatches, a neighborhood window constraint can be added, meaning that only... Search for the optimal match within the range, where The maximum allowed twist window width typically ranges from 2 to 5 data slices.
[0123] Path Search Method Two (Dynamic Programming): When the alignment path is required to satisfy the monotonically increasing constraint of irreversible time, dynamic programming is used to search for the globally optimal path. The local cost function is defined as follows: ; The higher the similarity, the lower the local cost. The cumulative cost recursive relationship is as follows: ; The three transfer directions correspond to the lag, synchronization, and lead of the temperature mode data slice relative to the voltage mode data slice, respectively. The boundary conditions are... The path starts and ends at anchor points respectively. and To limit excessive twisting, a Sakoe-Chiba band constraint is introduced, allowing only those conditions to be met. The units participate in the recursion, among which w This mode distorts the window width. It forces the path to monotonically increase and performs a one-to-one match by default.
[0124] By using any of the path search methods described above, the optimal alignment path between different modalities can be determined. This path describes the temporal mapping relationship between data slices of different modalities, providing an alignment basis for subsequent data resampling. This step corresponds to... Figure 7 The optimal alignment path is searched based on greedy matching or dynamic programming.
[0125] Step 106: Perform time-series resampling on the original sampling points corresponding to each mode according to the optimal alignment path, map the resampled data of each mode to the preset time axis, and output the aligned multimodal data.
[0126] In this embodiment of the invention, the alignment performance of this method can be achieved through... Figure 8 A time-series alignment performance comparison chart provides intuitive verification. This chart includes two sets of quantitative comparisons: (a) alignment error comparison; (b) computational efficiency comparison. Based on the optimal alignment path determined in step 105, the original sampling points corresponding to each mode are time-series resampled. Specifically, based on the time-series mapping relationship in the optimal alignment path, the alignment position of each mode's data on a unified time axis is determined, and the original sampling points of each mode are resampled and mapped to the same time axis according to this mapping relationship. After resampling, the data of each mode achieves synchronous alignment in the time dimension, forming time-series aligned multimodal data. Through this resampling operation, modal data with different sampling frequencies achieve fine alignment on a unified time axis, which can be directly used for downstream tasks such as state estimation, fault diagnosis, and health assessment of energy storage systems.
[0127] The following three examples further illustrate the actual effects and applicable scenarios of this method.
[0128] Example 1: Voltage-temperature data alignment; Application scenario: Aligning voltage signals (1kHz) and temperature signals (1Hz) in an energy storage power station. Data configuration: (1) Voltage data: sampling rate 1000Hz, duration 1 hour; (2) Temperature data: sampling rate 1Hz, duration 1 hour; (3) Patch granularity: 100ms.
[0129] Training configuration: (1) Number of Transformer layers: 2; (2) Hidden dimension: 128; (3) Temperature coefficient: 0.07; (4) Number of training epochs: 100.
[0130] The alignment results are shown in Table 1:
[0131] In this embodiment, the alignment error is measured based on the following Ground Truth acquisition methods: (1) High-precision clock annotation: In a laboratory environment, a high-precision GPS clock (accuracy less than 1ms) is used to provide a unified time reference for each sensor to obtain a precisely annotated test dataset; (2) Expert event annotation: Domain experts annotate the precise times of feature events (charging start-up, load switching, overcurrent protection triggering, etc.) in each modal signal as reference alignment points; (3) Simulation data verification: Using simulation data with known correspondences, a time offset is artificially added, and the model's ability to recover the original correspondences is evaluated. The alignment error is defined as the absolute time difference between the alignment time predicted by the model and the Ground Truth. The data in the table is the average alignment error of all samples in the test set.
[0132] In this embodiment, the temporal proximity threshold for hard-to-bear samples The value is set to 2 (corresponding to a 200ms time difference). This value was chosen based on the following considerations: If the value is too small, it will be difficult to handle insufficient sample size, thus limiting the training effect; If the value is too large, the difference between the hard-to-bear samples and the positive samples becomes too large, thus losing the challenge of the hard-to-bear samples. Experiments show that... =2 can effectively improve the temporal resolution of the model, and the alignment accuracy is optimal under this setting.
[0133] For a comparison of the alignment performance of the method of this invention with existing DTW and linear interpolation methods in this embodiment, please refer to [link to relevant documentation]. Figure 8 The alignment error of the method of this invention is 8.3ms, which is 45% and 82% lower than that of Dynamic Time Warping (DTW) (15.2ms) and linear interpolation (45.6ms), respectively. The computation time of the inference stage is only 0.3s, which is significantly better than that of DTW (12.5s), while maintaining the best alignment accuracy.
[0134] Example 2: Synchronization and Alignment of Four-Modal Data; Application scenario: Simultaneously aligning four modal data of energy storage power stations: voltage, current, temperature, and state of charge; Data configuration: (1) Voltage data: sampling rate 1000Hz; (2) Current data: sampling rate 1000Hz; (3) Temperature data: sampling rate 1Hz; (4) State of charge data: sampling rate 1Hz.
[0135] The alignment effect is as follows: The alignment error for voltage and current mode pairs is 2.1 ms, for voltage and temperature mode pairs it is 9.5 ms, for voltage and state of charge mode pairs it is 11.2 ms, for current and temperature mode pairs it is 8.7 ms, and the overall average alignment error for all mode pairs is 7.9 ms.
[0136] Example 3: Generalization test under different working conditions; Application scenario: Test the alignment effect of this method under different operating conditions such as peak shaving, frequency modulation, and standby; Test setup: Select peak-shaving, frequency-shaving, and standby conditions included in the training set, as well as AGC response conditions not included in the training set, to test the alignment error of this method.
[0137] The generalization effect is as follows: The alignment error is 7.8ms under peak load conditions, 9.2ms under frequency modulation conditions, and 5.1ms under standby conditions; the alignment error is 12.3ms under AGC response conditions not covered by the training set.
[0138] Conclusion: This method still has good generalization ability for unseen operating conditions and can be adapted to various operating scenarios of energy storage power stations.
[0139] Please see Figure 9 , Figure 9 This is a structural block diagram of a multi-frequency sampling data processing system for an energy storage system, provided as an embodiment of the present invention.
[0140] This invention provides a system for processing multi-frequency sampling data from an energy storage system, comprising: The slice encoding module 901 is used to acquire multi-mode multi-frequency sampling data of the energy storage system, divide the data of each mode into data slices and add frequency position encoding to generate the input embedding sequence corresponding to each mode. The sample construction module 902 is used to extract the embedding vectors corresponding to data slices under different modalities from each input embedding sequence based on the acquisition timestamp of each modal data, and to construct positive sample pairs and negative sample pairs. The self-supervised training module 903 is used to extract features from each input into the sequence input transformer encoder, and adjust the parameters of the transformer encoder with the goal of maximizing the feature similarity of positive sample pairs and minimizing the feature similarity of negative sample pairs, to complete the self-supervised training and obtain the trained transformer encoder. The feature extraction module 904 is used to input the multimodal data to be aligned into the trained transformer encoder after dividing it into the same data slices and encoding the frequency position, so as to obtain the alignment-aware feature vector corresponding to each data slice position in each modality. The path solving module 905 is used to determine the optimal alignment path between each modality based on the similarity between each alignment-aware feature vector; The alignment output module 906 is used to perform time-series resampling of the original sampling points corresponding to each mode according to the optimal alignment path, map the resampled data of each mode to a preset time axis, and output the aligned multimodal data.
[0141] Since the above is a system corresponding to a method for processing multi-frequency sampling data of an energy storage system, its implementation principle is the same as that of a method for processing multi-frequency sampling data of an energy storage system. For the sake of convenience and brevity, those skilled in the art can clearly understand that the specific working process of the system and modules described above can be referred to the corresponding process in the aforementioned method embodiments, and will not be repeated here.
[0142] Please see Figure 10 , Figure 10 This is a structural block diagram of an electronic device provided in an embodiment of the present invention.
[0143] An electronic device according to an embodiment of the present invention includes: a memory 1001 and a processor 1002. The memory 1001 stores a computer program. When the computer program is executed by the processor 1002, the processor 1002 performs a processing method for multi-frequency sampling data of an energy storage system as described in any of the above embodiments.
[0144] Memory 1001 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Memory 1001 has storage space 1003 for program code 1013 for performing any of the method steps described above. For example, storage space 1003 for program code may include individual program codes 1013 for implementing the various steps in the methods described above. This program code can be read from or written to one or more computer program products. These computer program products include program code carriers such as hard disks, CDs, memory cards, or floppy disks. The program code may be compressed, for example, in a suitable form. When run by a computing processing device, this code causes the computing processing device to perform the various steps in the methods described above. This program code can be read from or written to one or more computer program products. These computer program products include program code carriers such as hard disks, CDs, memory cards, or floppy disks. The program code may be compressed, for example, in a suitable form. When this code is run by a computing processing device, it causes the device to perform the various steps in the multi-frequency sampling data processing method for the energy storage system described above.
[0145] This invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a method for processing multi-frequency sampling data of an energy storage system as described in any of the above embodiments.
[0146] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0147] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.
[0148] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0149] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0150] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0151] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for processing multi-frequency sampling data of an energy storage system, characterized in that, include: Acquire multimodal and multi-frequency sampling data from the energy storage system, divide each mode of data in the multimodal and multi-frequency sampling data into data slices and add frequency position codes to generate the input embedding sequence corresponding to each mode; Based on the acquisition timestamps of each modal data, embedding vectors corresponding to data slices under different modalities are extracted from each input embedding sequence to construct positive and negative sample pairs. The input embedding sequence input transformer encoder is subjected to feature extraction, and the parameters of the transformer encoder are adjusted with the goal of maximizing the feature similarity of the positive sample pairs and minimizing the feature similarity of the negative sample pairs to complete self-supervised training and obtain a trained transformer encoder. After the multimodal data to be aligned corresponding to the energy storage system is divided into the same data slices and encoded by the frequency position, it is input into the trained converter encoder to obtain the alignment-aware feature vector corresponding to each data slice position in each mode. Based on the similarity between the alignment-aware feature vectors, the optimal alignment path between the modalities is determined. The original sampling points corresponding to each modality are resampled in time according to the optimal alignment path, and the resampled data of each modality is mapped to a preset time axis to output the aligned multimodal data.
2. The method for processing multi-frequency sampling data of an energy storage system according to claim 1, characterized in that, The step of dividing each modal data in the multimodal multi-frequency sampling data into data slices and adding frequency position encoding to generate the input embedding sequence corresponding to each modality includes: The multimodal multi-frequency sampling data is divided into data slices according to a uniform time granularity, and an initial data slice feature sequence corresponding to each mode is generated. An aggregation operation is used to compress multiple sampling points within the same data slice corresponding to the high-frequency modal data in the initial data slice feature sequence into the feature vector of the data slice, thereby generating the intermediate data slice feature sequence. The sampling points within the same data slice corresponding to the low-frequency modal data in the intermediate data slice feature sequence are expanded into the feature vector of the data slice by the padding operation to obtain the target data slice feature sequence. Based on the original sampling frequency index of each mode, the corresponding frequency embedding vector is obtained from the learnable frequency embedding matrix; Linear projection is performed on each feature vector in the feature sequence of the target data slice to obtain the projection vector of each data slice; The projection vector is added to the sequence position code and the frequency embedding vector to generate the target input embedding data for each data slice; All target input embedding data corresponding to each modality are arranged in chronological order to obtain the input embedding sequence corresponding to each modality.
3. The method for processing multi-frequency sampling data of an energy storage system according to claim 1, characterized in that, The step of extracting embedding vectors corresponding to data slices under different modalities from each input embedding sequence based on the acquisition timestamps of each modality data, and constructing positive sample pairs and negative sample pairs, includes: Based on the acquisition timestamps of the data of each modality, the acquisition time corresponding to each data slice in each modality is determined; From each of the input embedding sequences, extract the embedding vectors corresponding to data slices from different modalities with the same acquisition time, and construct positive sample pairs; From each of the input embedding sequences, embedding vectors corresponding to data slices under different modalities at different acquisition times are extracted to construct negative sample pairs; The negative sample pairs also include hard negative sample pairs, which are the embedding vectors corresponding to data slices under different modalities where the difference in acquisition time is less than a preset threshold.
4. The method for processing multi-frequency sampling data of an energy storage system according to claim 1, characterized in that, The transformer encoder comprises a multi-head self-attention layer, a first normalization layer, a feedforward network layer, and a second normalization layer connected in sequence; the step of extracting features from each of the input embedding sequences into the transformer encoder, and adjusting the parameters of the transformer encoder with the goal of maximizing the feature similarity of the positive sample pairs and minimizing the feature similarity of the negative sample pairs, to complete self-supervised training and obtain a trained transformer encoder includes: The input embedding sequences corresponding to each modality are concatenated according to the modality, and then superimposed with the modality type codes corresponding to each data slice to generate the encoder input sequence. The encoder input sequence is input into the converter encoder, and after passing through the multi-head self-attention layer and the first normalization layer in sequence, it is connected with the encoder input sequence for the first residual connection to obtain the intermediate output sequence. After the intermediate output sequence is passed through the feedforward network layer and the second normalization layer in sequence, it is connected with the intermediate output sequence for the second residual connection to output the alignment-aware feature vector corresponding to each data slice; Calculate the cosine similarity between the alignment-aware feature vectors of different modal data slices in the positive sample pair, and use it as the first cosine similarity; Calculate the cosine similarity between the alignment-aware feature vectors of different modal data slices in the negative sample pair, and use it as the second cosine similarity; Based on the first cosine similarity and the second cosine similarity, a contrast loss term is constructed, and the contrast loss value is calculated. With the goal of minimizing the contrastive loss value, the parameters of the converter encoder are iteratively adjusted until the contrastive loss value converges, thus completing the self-supervised training and obtaining the trained converter encoder.
5. The method for processing multi-frequency sampling data of an energy storage system according to claim 4, characterized in that, The step of constructing a contrast loss term based on the first cosine similarity and the second cosine similarity, and calculating the contrast loss value, includes: Using the exponential term of each of the first cosine similarities as the numerator and the sum of the cosine similarity exponential terms of each of the positive sample midpoint data slices and all candidate data slices in the same batch as the denominator, a loss term is constructed, and the unidirectional contrast loss value is calculated. The first direction contrast loss value is calculated using the first modality data slice in the positive sample pair as the anchor point, and the second direction contrast loss value is calculated using the second modality data slice in the positive sample pair as the anchor point. The average of the first-direction contrast loss value and the second-direction contrast loss value is used as the bidirectional contrast loss value corresponding to the positive sample pair. When the number of modes is equal to two, the bidirectional contrast loss value is used as the contrast loss value; When the number of modes is greater than two, calculate the corresponding bidirectional contrast loss value for each mode pair composed of two different modes. The sum of the bidirectional contrast loss values of all the aforementioned mode pairs is taken as the contrast loss value.
6. The method for processing multi-frequency sampling data of an energy storage system according to claim 1, characterized in that, The step of inputting the multimodal data to be aligned corresponding to the energy storage system into the trained converter encoder after being divided into the same data slices and encoded by the frequency position, to obtain the alignment-aware feature vector corresponding to each data slice position in each mode, includes: Obtain the multimodal data to be aligned corresponding to the energy storage system; The multimodal data to be aligned is divided into data slice sequences corresponding to each modality according to the same data slice division method as in the training phase, and the same frequency position code is added to each data slice sequence to generate an embedding sequence to be encoded for each modality. Each of the embedded sequences to be encoded is input into the trained transformer encoder for feature extraction, and the alignment-aware feature vector corresponding to each data slice position in each modality is output.
7. The method for processing multi-frequency sampling data of an energy storage system according to claim 1, characterized in that, The step of determining the optimal alignment path between each modality based on the similarity between each alignment-aware feature vector includes: Calculate the cosine similarity of alignment-aware feature vectors between different data slices in each modality, and construct a cross-modal similarity matrix; Based on the cross-modal similarity matrix, a path search method is used to determine the optimal alignment path between the modalities.
8. A system for processing multi-frequency sampling data of an energy storage system, characterized in that, include: The slicing and encoding module is used to acquire multi-modal and multi-frequency sampling data of the energy storage system, divide the data of each mode into data slices and add frequency position encoding to generate the input embedding sequence corresponding to each mode; The sample construction module is used to extract the embedding vectors corresponding to data slices under different modalities from each input embedding sequence based on the acquisition timestamp of each modal data, and to construct positive sample pairs and negative sample pairs. The self-supervised training module is used to extract features from each of the input embedding sequence input transformer encoders, and adjust the parameters of the transformer encoders with the goal of maximizing the feature similarity of the positive sample pairs and minimizing the feature similarity of the negative sample pairs, thereby completing the self-supervised training and obtaining the trained transformer encoder. The feature extraction module is used to input the multimodal data to be aligned corresponding to the energy storage system into the trained converter encoder after the same data slice division and frequency position encoding, so as to obtain the alignment-aware feature vector corresponding to each data slice position in each mode; The path solving module is used to determine the optimal alignment path between the modalities based on the similarity between the alignment-aware feature vectors. The alignment output module is used to perform temporal resampling on the original sampling points corresponding to each modality according to the optimal alignment path, map the resampled data of each modality to a preset time axis, and output the aligned multimodal data.
9. An electronic device, characterized in that, The system includes a memory and a processor. The memory stores a computer program, which, when executed by the processor, causes the processor to perform the steps of the method for processing multi-frequency sampling data of an energy storage system as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed, it implements the method for processing multi-frequency sampling data of the energy storage system as described in any one of claims 1-7.
