Battery state prediction method, system and storage medium with encryption effect

CN122764682APending Publication Date: 2026-09-15FUJIAN XINGYUN SOFTWARE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611100821.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-23
Publication Date
2026-09-15

Smart Images

  • Figure CN122764682A_ABST
    Figure CN122764682A_ABST
Patent Text Reader

Abstract

This invention provides a battery state prediction method, system, and storage medium with encryption effect. The method includes: acquiring battery operating data, wherein the battery operating data is in time series format; performing lightweight perceptual layer encryption on the battery operating data to obtain compressed encrypted data; inputting the compressed encrypted data into a preset dual-encoder network model for feature extraction to obtain local and global features of the compressed encrypted data; fusing the local and global features according to preset weights to obtain fused features; and performing time series-based battery state prediction based on the fused features to obtain a battery state prediction result. This invention ensures data security by compressing and encrypting battery operating data, and improves prediction accuracy by using a dual-encoder network model for feature extraction. It has high prediction efficiency and versatility in time series data processing and prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of battery management system technology, and particularly to a battery state prediction method, system, and storage medium with encryption effect. Background Technology

[0002] A Battery Management System (BMS) is an electronic system used to monitor, control, and manage battery packs. It is widely used in electric vehicles, energy storage systems, and portable electronic devices to ensure the safe and efficient operation of batteries and extend their lifespan. One of the most important functions of a BMS is battery state prediction. This is achieved by analyzing battery operating data to evaluate key performance indicators, including State of Health (SOH), State of Charge (SOC), and Remaining Useful Life (RUL). Existing battery state prediction methods are generally based on compressed sensing data compression methods, single-network prediction models, or hybrid models.

[0003] With the rapid development of battery technology, battery management systems (BMS) are increasingly demanding data-driven state prediction, but face two major challenges: First, data privacy and security are crucial. Battery operating data contains sensitive information (such as battery formulation and user charging / discharging habits). Existing methods directly upload raw data to the cloud, posing a risk of reverse engineering and data leakage. Second, existing time-series feature extraction models are not adapted to the specific characteristics of battery data. Battery aging processes exhibit multi-scale features, including local features such as instantaneous voltage drops and abnormal temperature fluctuations, as well as global features such as capacity decay and internal resistance growth trends. As mentioned above, compressed sensing technology is mostly used for image processing, and the matrix information it uses is rarely used for battery data encryption and state prediction, resulting in significant feature loss. Furthermore, single-network prediction models struggle to simultaneously capture the coupling relationship between local anomalies and global degradation patterns. In particular, existing Transformers and their variants (including SwingTransformer) are designed for image data, and their self-attention mechanism is calculated in the spatial dimension, failing to directly adapt to the temporal dependencies of battery time-series data, leading to insufficient accuracy in extracting global degradation trends. Hybrid models also have relatively high deployment costs, making multi-terminal applications difficult.

[0004] In existing technologies, compressed sensing is only used for signal and image compression processing, without being combined with battery state prediction to achieve encryption of the perception layer; the CNN+Transformer dual encoder architecture is only used for feature extraction of images and text, without improvement for battery time-series data; Swin Transformer and its variants are only adapted to image data, without mechanisms designed for battery time-series data; BiLSTM is only used for time-series prediction, without being combined with multi-scale feature fusion of dual encoders. These technologies are used individually and cannot solve the dual challenges of data security protection and multi-scale feature extraction in battery state prediction, nor can they achieve the technical effect of encryption not affecting prediction and feature extraction adapted to battery time-series features. Simply combining these technologies leads to problems such as high model complexity, low prediction accuracy, and encryption failure.

[0005] Therefore, it is necessary to propose a new solution to the above problems. Summary of the Invention

[0006] This invention provides a battery state prediction method, system, and storage medium with encryption effect, aiming to solve the technical problems of insufficient feature extraction and limited prediction accuracy in existing methods for predicting battery state.

[0007] To address the aforementioned technical problems, in a first aspect, the present invention provides a battery state prediction method with encryption effect, comprising the following steps:

[0008] S101. Obtain battery operating data, wherein the battery operating data is in time series format; S102. Lightweight sensing layer encryption is applied to the battery operation data to obtain compressed encrypted data; S103. Input the compressed and encrypted data into a preset dual encoder network model for feature extraction to obtain the local and global features of the compressed and encrypted data; S104. The local features and the global features are fused according to preset weights to obtain fused features; S105. Determine whether the preset dual encoder network model meets the preset training objective. If not, update the model parameters and return to step S103; if yes, execute step S106. S106. Based on the fusion features, perform time-series-based battery state prediction to obtain battery state prediction results.

[0009] Furthermore, step S101 also includes: processing the battery operation data into multiple non-overlapping sequence blocks based on time series according to a preset block size using time-domain block compression sensing technology.

[0010] Furthermore, step S102 specifically includes: Using a convolutional layer as a measurement matrix, the battery operation data is compressed and encrypted according to a preset compression ratio based on the order of the non-overlapping sequence blocks to obtain the compressed and encrypted data.

[0011] Furthermore, the preset dual-encoder network model includes a CNN convolutional neural network sub-model and a Transformer sub-model, wherein: The CNN convolutional neural network sub-model is used to extract the local features from the compressed and encrypted data through a convolutional residual structure composed of depthwise separable convolutions and residual connections; The Transformer sub-model is used to extract the global features from the compressed and encrypted data using a SwinTransformer block architecture with a T-MSA time attention mechanism.

[0012] Furthermore, the Swin Transformer block architecture with T-MSA temporal attention mechanism includes, in order of input-output logic, a first normalization layer, a temporal attention mechanism layer, a second normalization layer, a first multilayer perceptron, a third normalization layer, a self-attention mechanism layer with temporal offset, a fourth normalization layer, and a second multilayer perceptron, wherein: The output of the time attention mechanism layer is residually connected to the input of the first normalization layer. The output of the first multilayer perceptron is residually connected to the input of the second normalization layer. The output of the self-attention mechanism layer with time-domain offset is residually connected to the input of the third normalization layer; The output of the second multilayer perceptron is residually connected to the input of the fourth normalization layer.

[0013] Furthermore, in step S106, a prediction model based on an improved BiLSTM bidirectional long and short attention mechanism is used to predict the battery state of the fused features based on time series.

[0014] Secondly, the present invention also provides a battery state prediction system with encryption effect, comprising: A data loading module is used to acquire battery operating data, which is in a time series format; The data compression module is used to compress and encrypt the battery operating data to obtain compressed and encrypted data; The feature extraction module is used to input the compressed and encrypted data into a preset dual encoder network model for feature extraction, thereby obtaining the local and global features of the compressed and encrypted data. The feature fusion module is used to fuse the local features and the global features according to a preset weight to obtain fused features; The loop training module is used to determine whether the preset dual encoder network model meets the preset training objective. If not, the model parameters are updated and the process is returned to the feature extraction module; if yes, the prediction module is executed. The prediction module is used to perform time-series-based battery state prediction based on the fused features to obtain the battery state prediction result.

[0015] Furthermore, the preset dual-encoder network model includes a CNN convolutional neural network sub-model and a Transformer sub-model, wherein: The CNN convolutional neural network sub-model is used to extract the local features from the compressed and encrypted data through a convolutional residual structure composed of depthwise separable convolutions and residual connections; The Transformer sub-model is used to extract the global features from the compressed and encrypted data using a SwinTransformer block architecture with a T-MSA time attention mechanism.

[0016] Thirdly, the present invention also provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps in the battery state prediction method with encryption effect as described in any of the above embodiments.

[0017] Fourthly, the present invention also provides a storage medium storing a computer program, which, when executed by a processor, implements the steps of the battery state prediction method with encryption effect as described in any of the above embodiments.

[0018] The beneficial effects achieved by this invention are that it proposes an encrypted battery state prediction method. This method ensures the security of the data during the prediction process by compressing and encrypting the battery operation data. At the same time, it uses a dual-encoder network model to extract features from the data, which can improve the accuracy of battery state prediction. This also makes the method proposed in this invention highly efficient and versatile in time series data processing and prediction. Attached Figure Description

[0019] Figure 1 This is a flowchart of the steps of the battery state prediction method with encryption effect provided in the embodiments of the present invention; Figure 2 This is a schematic diagram of the architecture of the preset dual encoder network model provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the Swin Transformer block architecture with T-MSA temporal attention mechanism provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of a battery state prediction system with encryption effect provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0021] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating the steps of a battery state prediction method with encryption effect provided in an embodiment of the present invention. The battery state prediction method with encryption effect includes the following steps: S101. Obtain battery operating data, wherein the battery operating data is in time series format.

[0022] In this embodiment of the invention, the battery operating data includes time-series data of parameters such as voltage, current, temperature, and impedance changing over time. The characteristic of time-series data is its time sequence, which makes the data have a sequential dependency relationship. Subsequent data points are often related to previous data points. In fact, the purpose of battery state prediction is to predict this time sequence, thereby analyzing the possible values ​​of subsequent battery operating data.

[0023] Specifically, in this embodiment of the invention, for the battery sequence data in the time series format, step S101 further includes: processing the battery operation data into multiple non-overlapping sequence blocks based on the time series according to a preset block size using time-domain block compression sensing technology.

[0024] In the implementation process, this embodiment of the invention places the battery sequence data into a two-dimensional array with rows and columns of H×T, where the number of rows H represents the number of parameter types collected, and the number of columns T represents the time sequence length. Each column of the two-dimensional array represents the value of different parameters at the same time. Furthermore, block-based compressed sensing is a data processing method based on the theoretical framework of compressed sensing, which divides the original signal into several smaller sequence blocks. Compressed sensing utilizes the sparsity of the signal, acquiring signal information with far fewer sampling points than required by the Nyquist sampling theorem, and can accurately reconstruct the original signal. Block-based compressed sensing, based on this, divides the signal into blocks for processing, thus allowing the local sparsity characteristics of each sequence block to be utilized individually, better adapting to the non-stationarity and other characteristics of the signal. In this embodiment of the invention, the sampling points for block-based compressed sensing are designed according to the number of rows and columns of the two-dimensional array, making it into multiple non-overlapping sequence blocks of size B×B. The final number of non-overlapping sequence blocks can be derived. .

[0025] S102. Lightweight sensing layer encryption is applied to the battery operation data to obtain compressed encrypted data.

[0026] Data compression and encryption aim to improve data security. Specifically, step S102 is as follows: Using a convolutional layer as a measurement matrix, the battery operation data is compressed and encrypted according to a preset compression ratio based on the order of the non-overlapping sequence blocks to obtain the compressed and encrypted data.

[0027] A measurement matrix is ​​also a concept in compressed sensing, used to project high-dimensional signals onto a low-dimensional space to obtain a set of compressed measurement values. In this embodiment of the invention, the measurement matrix is ​​implemented using a convolutional layer, and the convolutional layer consists of… m Each step is B of B 2 The filter consists of [a specific filter configuration], and at this point, the preset compression ratio [is used]. satisfy .

[0028] It should be noted that the data encryption effect mentioned in the embodiments of this invention is also achieved based on time-domain block compressed sensing, which requires combining the data processing and prediction stages. The encryption effect to be demonstrated in the embodiments of this invention aims to reduce the risk of data leakage or tampering in other locations after the data acquisition end (such as local sensors) sends the data to the prediction end (such as a cloud server), and block compressed sensing can achieve this effect. On the one hand, the original data and the measurement matrix used to compress and sample the original data in block compressed sensing are only stored on the acquisition end, limiting the data storage range; on the other hand, after compressing the original data, when attempting to restore the original data from the compressed data, a large error will occur, and the restored data can no longer accurately represent the original data. That is, the large data restoration error can play a role in resisting attacks to a certain extent, thus demonstrating the encryption effect of the battery operation data in the embodiments of this invention.

[0029] Specifically, the core encryption effect is achieved through two parts: "dual-key protection" and "irreversible reconstruction." The first key is the arrangement order of non-overlapping sequence blocks of size B in temporal block compressed sensing, and the second key is the convolutional layer parameters used as the measurement matrix. B 2 (Filter weights and step size). Both keys are stored at the acquisition end and do not participate in data transmission. If an attacker attempts to reconstruct the original data from the transmitted compressed and encrypted data, the reconstruction will produce irreversible feature distortion due to the lack of the aforementioned dual keys, and the reconstructed data will not reflect the battery operating data.

[0030] Quantitative analysis of security: The key space of this invention is determined by the block size. B Filter weights of the convolutional layer measurement matrix W Step length S Composition, key space is This key space is larger than the key space requirements of existing lightweight encryption algorithms, meeting the security requirements against brute-force attacks. For example, when B=32 and the filter weights are 32-bit floating-point numbers, the key space reaches an order of magnitude of 2. 512 The above is far greater than AES-128's 2 128 The key space meets the requirements for resisting brute-force attacks.

[0031] Meanwhile, the data processing based on block compression sensing is different from actual encryption and decryption algorithms. Therefore, the obtained compressed and encrypted data does not affect the analysis and prediction of the time series of the data in subsequent steps.

[0032] In this embodiment of the invention, there is a positive synergistic relationship between the compression and encryption step and the subsequent prediction accuracy. The linear projection process based on time-domain block compressed sensing mathematically satisfies the Restricted Isometry Property (RIP). This property ensures that the key temporal topology and pairwise distances of the original high-dimensional time-series data are preserved during dimensionality reduction, meaning that core degradation features such as battery capacity decay trends and internal resistance growth trajectories are not destroyed. Simultaneously, non-sparse redundant information such as high-frequency sensor noise and electromagnetic interference mixed in the original battery operating data is naturally suppressed during the compression and projection process, resulting in a structured noise reduction effect. This gives the compressed and encrypted data a higher signal-to-noise ratio than the original data, providing a cleaner data foundation for the subsequent dual encoder.

[0033] S103. Input the compressed and encrypted data into a preset dual encoder network model for feature extraction to obtain the local and global features of the compressed and encrypted data.

[0034] Specifically, the core improvement of this invention lies in the adaptation and modification of the Transformer sub-model to battery time-series data. Please refer to... Figure 2 , Figure 2 This is a schematic diagram of the architecture of the preset dual encoder network model provided in an embodiment of the present invention. Figure 2 The diagram illustrates the flow of compressed and encrypted data as input into the dual encoder, and the output of fused features to the prediction module after feature fusion. The preset dual encoder network model includes a CNN convolutional neural network sub-model and a Transformer sub-model, wherein: The CNN convolutional neural network sub-model is used to extract the local features from the compressed and encrypted data through a convolutional residual structure composed of depthwise separable convolutions and residual connections; The Transformer sub-model is used to extract the global features from the compressed and encrypted data through the SwinTransformer block architecture with T-MSA time attention mechanism. This sub-model is the main contributing module for achieving high-precision prediction in the embodiments of the present invention.

[0035] Generally, most scenarios requiring battery health state prediction are for large-scale battery energy storage systems. Large battery devices have a large amount of battery data and parameters. This invention uses deep neural networks such as CNN and Transformer to achieve deep feature extraction. In step S101, the collected battery data of different dimensions and parameters has been time-aligned and set as two-dimensional data. This allows the image processing-based method to process the multi-dimensional battery data using the pre-defined dual-encoder network model proposed in this invention. Through knowledge transfer, image processing methods extract more features and information than existing time-series processing methods.

[0036] The Swin Transformer block architecture with T-MSA temporal attention mechanism described in this embodiment of the invention is different from existing architectures. For details, please refer to... Figure 3 , Figure 3 This is a schematic diagram of the Swin Transformer block architecture with T-MSA temporal attention mechanism provided in an embodiment of the present invention. According to the input-output logic order, it includes, in sequence, a first normalization layer LN1, a temporal attention mechanism layer T-MSA, a second normalization layer LN2, a first multilayer perceptron MLP1, a third normalization layer LN3, a self-attention mechanism layer ST-MSA with temporal offset, a fourth normalization layer LN4, and a second multilayer perceptron MLP2, wherein: The output of the time attention mechanism layer is residually connected to the input of the first normalization layer. The output of the first multilayer perceptron is residually connected to the input of the second normalization layer. The output of the self-attention mechanism layer with time-domain offset is residually connected to the input of the third normalization layer; The output of the second multilayer perceptron is residually connected to the input of the fourth normalization layer; The key technical contribution of the method proposed in this invention is that when the Swing Transformer is transferred from the image domain to the battery timing prediction domain, it is not simply a matter of replacing the input data, but rather a fundamental transformation of its core attention mechanism.

[0037] Specifically, the self-attention mechanism of the standard Swing Transformer calculates the correlation between pixels in the spatial dimension (height × width) of the image. This design cannot directly capture the dependencies between time points in battery time-series data. To address this fundamental deficiency, this invention proposes T-MSA (Temporal Attention) and ST-MSA (Self-Attention with Temporal Shift), completely replacing the object of attention calculation from the spatial dimension to the temporal dimension, and introducing a temporal window shift operation to adapt to the coupling characteristics of local battery anomalies and global degradation. These modifications constitute the core technical solution of this invention and are the essential features that distinguish it from existing CNN-Transformer fusion schemes.

[0038] Please combine Figure 3 The above connection relationship can be represented by the following relationship: ; ; ; .

[0039] The core of the T-MSA temporal attention mechanism is to perform attention calculations along the temporal dimension while filtering out invalid interference information in the spatial dimension. Its input is a temporal feature tensor derived from compressed and encrypted data after shape reshaping. ,in N For batch size, T For timing length, C This represents the number of feature channels. The output is a long-range dependent feature tensor in the time dimension. .

[0040] T-MSA calculation is based on multi-head self-attention MSA, focusing on the temporal dimension. T conduct q , k , v The linear projection and attention weighting are given by the following formula:

[0041] The calculation of the i-th attention head is as follows:

[0042] In the formula: For linear projection weights, For each dimension of attention head, h The number of heads. q , k, v The dot product calculation only occurs in the time dimension. T Onwards, that is .

[0043] The self-attention mechanism layer ST-MSA with temporal offset adds a temporal offset window to T-MSA. Its core function is to capture local temporal correlations in battery time-series data (such as the timing characteristics before and after voltage drops) by offsetting the window along the time dimension, thus adapting to the coupled characteristics of local anomalies and global degradation in battery aging. Its input and output are similar to T-MSA; the temporal window is divided by the time length... T Divided into multiple non-overlapping time windows Window size is w ,Right now , n This represents the number of windows.

[0044] The time-domain offset operation is performed on each time window. Shift left s Step offset operation ( This allows the offset window to partially overlap with adjacent windows, capturing cross-window temporal correlations. T-MSA attention calculation is performed within the offset time window, focusing only on the temporal dimension within the window. q , k, v Dot product.

[0045] The T-MSA temporal attention mechanism layer is primarily used to model and capture long-range dependent features. In this embodiment of the invention, it is used to obtain information that changes over time, such as capacity decay trends and cyclic aging effects. The offset self-attention mechanism layer (ST-MSA) changes the method and scope of attention calculation, thus better adapting to the needs of time-series data processing. During implementation, patch merging is set after the Swin Transformer block with the T-MSA temporal attention mechanism to change the dimensionality, thereby achieving downsampling, and the self-attention result is output as the extracted global feature.

[0046] like Figure 2 As shown, the preset dual encoder network model also has a corresponding decoder network, which performs dimensionality restoration on the encoder output by using convolutional layers and deconvolutional upsampling with the same number of layers as the encoder network, to obtain the local features and global features of the same size as the original compressed and encrypted data. Figure 2 The preset dual encoder network model and decoder network shown in the figure both have 4 layers. During implementation, the number of model layers can be set according to actual needs, depending on the amount of data processed and the accuracy requirements.

[0047] like Figure 2The encoder part extracts relatively abstract battery health status information after processing the battery data. Two-dimensional information is restored from the battery data through skip connections and decoder upsampling. The output data maintains row alignment relative to the input data, still representing different battery parameter types; however, the column parameters change. Some features, based on supervised learning, represent data from subsequent time points based on the input data, while others represent the variation patterns, ranges, and influencing factors of different parameter types.

[0048] S104. The local features and the global features are fused according to preset weights to obtain fused features.

[0049] The preset weights are set according to actual needs. Specifically, multi-scale features are fused using preset weights, which are adaptive dynamic parameters that can be adjusted adaptively. The fused features can be represented as follows: ; in, It is a feature of fusion. It is a preset weight. , These are local features and global features, respectively.

[0050] The feature fusion method in this embodiment of the invention adopts a conventional weighted summation method. Its technical effect mainly depends on the quality of the preceding compressed and encrypted data and the uniqueness of the global features extracted by the T-MSA / ST-MSA improved Transformer.

[0051] S105. Determine whether the preset dual encoder network model meets the preset training objective. If not, return to step S103; if yes, execute step S106.

[0052] Specifically, during implementation, after the aforementioned preset dual encoder network model and feature fusion, data features corresponding to the battery operation data have been collected. Then, deconvolution downsampling and skip connection parts are performed, followed by in-layer concatenation, convolution, and full connection to complete one data processing cycle of the preset dual encoder network model. The preset training objective in this embodiment can be set to various types, such as the number of iterations or the accuracy of the fused features.

[0053] S106. Based on the fusion features, perform time-series-based battery state prediction to obtain battery state prediction results.

[0054] Specifically, in step S106, a prediction model based on an improved BiLSTM bidirectional long and short attention mechanism is used to predict the battery state of the fused features based on a time series. LSTM is a special type of recurrent neural network (RNN) unit that can effectively handle long-term dependencies in sequential data. BiLSTM adds backpropagation information flow to LSTM, enabling the prediction model implemented using it to utilize both past and future information for prediction, thus better capturing the contextual information in the time series.

[0055] Referring to the description in the above embodiments, the improved BiLSTM structure proposed in this embodiment of the invention processes the recovered two-dimensional information after upsampling from the fused features. The bidirectional BiLSTM in step S106 is an improved multi-dimensional bidirectional structure that can input not only data of a certain battery parameter type before and after time changes, but also information from various dimensions such as the correlation influence between different parameters, the degree of data change, the range of change, the rate of change fluctuation, and abrupt change factors. The prediction network can perform comprehensive processing based on different feature perspectives and predict the health status of the battery, outputting information.

[0056] In this embodiment of the invention, the prediction model employs a multi-task loss function to jointly optimize multiple prediction target tasks.

[0057] The adjustable parameters involved in the embodiments of the present invention can be set according to the application scenarios of the battery state prediction method with encryption effect proposed in the embodiments of the present invention.

[0058] For example, for the power battery pack of an electric vehicle, its charge-discharge cycle speed is periodic, and the data volume is small (e.g., 100 battery packs, 500 charge-discharge cycles). In this case, the preset block size is... Compression ratio The compression ratio is set to 10%, the convolutional layer measurement matrix is ​​a 32×32 filter, and the original battery operating data is stored in the electric vehicle system. The data is compressed and encrypted before being transmitted to a cloud server for prediction. Verification by this embodiment shows that at a compression ratio of 10%, the NMSE restoration error without key reconstruction is greater than 75%, demonstrating strong anti-attack capabilities. Furthermore, the temporal feature retention rate of the compressed and encrypted data is greater than 97%, without affecting subsequent feature prediction. Local data storage also reduces the risk of data leakage. For example, for NASA PCoE battery datasets or battery packs in energy storage power stations (50 battery clusters, 1000 charge-discharge cycles), the parallel structure of multiple battery clusters results in higher data dimensionality. In this case, the size B of the non-overlapping sequence block of the block compression sensing is set to 64, and the preset compression ratio is also set. With a setting of 5% and a 64×64 filter for the convolutional layer measurement matrix, the data transmission load is reduced, and the NMSE restoration error of the keyless reconstruction can be greater than 78%. Correspondingly, the number of layers in the encoder and decoder in the preset dual encoder network model can be set to 6 to better capture the coupling effect of battery cluster data when the data volume is large, thereby improving prediction accuracy.

[0059] To verify the effectiveness of the method proposed in this embodiment of the invention, prediction experiments were conducted on the NASA PCoE battery dataset and the CALCE battery dataset using multiple models, including the preset dual encoder network model proposed in this embodiment of the invention, with battery state of health (SOH) and remaining lifetime (RUL) as prediction targets. Specifically: the root mean square error (RMSE) and mean absolute error (MAE) were used to evaluate prediction accuracy, with lower values ​​indicating higher accuracy; the normalized mean square error (NMSE) of keyless reconstruction was used to evaluate security, with higher values ​​indicating stronger resistance to attacks; and the number of model parameters and inference time were used to evaluate computational efficiency, with lower values ​​indicating lower deployment costs.

[0060] Table 1 below shows the accuracy prediction comparison data between the method proposed in this embodiment and other methods such as pure LSTM, pure CNN, pure Transformer, and CNN+LSTM. It can be seen that the method proposed in this embodiment is significantly lower than existing methods and achieves excellent results on different datasets. This demonstrates that the dual encoder composed of CNN and the improved Swing Transformer enhances multi-scale feature extraction capabilities, and the combination with the improved BiLSTM bidirectional long and short attention mechanism can effectively improve the accuracy of battery state prediction.

[0061] Table 1. Experimental results comparing the accuracy of predictions (RMSE / MAE)

[0062] Table 2 below shows the data used by the method proposed in this embodiment of the invention to test keyless reconstruction and resistance to AI blind reconstruction under different compression ratios using the NASA B0005-B0018 dataset, where the block size B=32. It can be seen that as the compression ratio decreases, the NMSE gradually increases, and the resistance to reconstruction attacks is enhanced. This indicates that the method proposed in this embodiment of the invention achieves data security without losing the effective features of battery time-series data, thus meeting prediction requirements.

[0063] Table 2 NMSE security test results

[0064] Table 3 below shows the ablation experiments conducted using the NASA dataset to analyze the SOH prediction RMSE and keyless reconstruction NMSE under different conditions using the method proposed in this embodiment of the invention. It can be seen that the modules of the model in the proposed method are not simply superimposed, but exhibit significant synergistic gain effects. The absence of any module will lead to a significant decrease in prediction accuracy or security. Removing the compression and encryption module results in no encryption security, and due to the loss of the structured noise reduction effect brought by compression and encryption, the RMSE increases from 1.24% to 1.28%. This conversely proves that the compression and encryption stage has a positive synergistic contribution to prediction accuracy, rather than being a simple data preprocessing step. Overall, the data demonstrates that the improved dual-encoder architecture, T-MSA / ST-MSA mechanism, and the collaborative design of the improved BiLSTM prediction model are key to achieving high-precision prediction.

[0065] Table 3. Results of NMSE ablation experiments

[0066] Table 4 below shows the computational efficiency comparison data between the method proposed in this embodiment and other methods such as pure LSTM, pure CNN, pure Transformer, and CNN+LSTM. It can be seen that the method proposed in this embodiment, through dimensionality reduction and structural optimization, achieves high computational efficiency while ensuring high accuracy and security, making it suitable for multi-terminal deployment of battery management systems across edge and cloud.

[0067] Table 4 Comparison of computational efficiency test results

[0068] The beneficial effects achieved by this invention are that it proposes an encrypted battery state prediction method. This method ensures the security of the data during the prediction process by compressing and encrypting the battery operation data. At the same time, it uses a dual-encoder network model to extract features from the data, which can improve the accuracy of battery state prediction. This also makes the method proposed in this invention highly efficient and versatile in time series data processing and prediction.

[0069] This invention also provides a battery state prediction system 200 with encryption effect, please refer to... Figure 4 , Figure 4 This is a schematic diagram of a battery state prediction system with encryption effect provided in an embodiment of the present invention. The battery state prediction system 200 with encryption effect includes: The data loading module 201 is used to acquire battery operating data, which is in a time series format; Data compression module 202 is used to perform lightweight sensing layer encryption on the battery operation data to obtain compressed encrypted data; The feature extraction module 203 is used to input the compressed and encrypted data into a preset dual encoder network model for feature extraction, thereby obtaining the local and global features of the compressed and encrypted data. Feature fusion module 204 is used to fuse the local features and the global features according to a preset weight to obtain fused features; The loop training module 205 is used to determine whether the preset dual encoder network model meets the preset training objective. If not, the model parameters are updated and the process is returned to the feature extraction module 203; if yes, the prediction module 206 is executed. The prediction module 206 is used to perform time-series-based battery state prediction based on the fused features to obtain the battery state prediction result.

[0070] Furthermore, the preset dual-encoder network model includes a CNN convolutional neural network sub-model and a Transformer sub-model, wherein: The CNN convolutional neural network sub-model is used to extract the local features from the compressed and encrypted data through a convolutional residual structure composed of depthwise separable convolutions and residual connections; The Transformer sub-model is used to extract the global features from the compressed and encrypted data using a SwinTransformer block architecture with a T-MSA time attention mechanism.

[0071] The encrypted battery state prediction system 200 can implement the steps of the encrypted battery state prediction method in the above embodiments and achieve the same technical effect, as described in the above embodiments, and will not be repeated here.

[0072] This invention also provides a computer device, please refer to... Figure 5 , Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. The computer device 300 includes: a memory 302, a processor 301, and a computer program stored in the memory 302 and executable on the processor 301.

[0073] The processor 301 calls the computer program stored in the memory 302 to execute the steps in the battery state prediction method with encryption effect provided in this embodiment of the invention. Please refer to... Figure 1 Specifically, it includes the following steps: S101. Obtain battery operating data, wherein the battery operating data is in time series format.

[0074] Step S101 further includes: processing the battery operation data into multiple non-overlapping sequence blocks based on time series according to a preset block size using time-domain block compression sensing technology.

[0075] S102. Lightweight sensing layer encryption is applied to the battery operation data to obtain compressed encrypted data.

[0076] Step S102 is as follows: Using a convolutional layer as a measurement matrix, the battery operation data is compressed and encrypted according to a preset compression ratio based on the order of the non-overlapping sequence blocks to obtain the compressed and encrypted data.

[0077] S103. Input the compressed and encrypted data into a preset dual encoder network model for feature extraction to obtain the local and global features of the compressed and encrypted data.

[0078] The preset dual-encoder network model includes a CNN convolutional neural network sub-model and a Transformer sub-model, wherein: The CNN convolutional neural network sub-model is used to extract the local features from the compressed and encrypted data through a convolutional residual structure composed of depthwise separable convolutions and residual connections; The Transformer sub-model is used to extract the global features from the compressed and encrypted data using a SwinTransformer block architecture with a T-MSA time attention mechanism.

[0079] The Swin Transformer block architecture with T-MSA temporal attention mechanism includes, in order of input-output logic, a first normalization layer, a temporal attention mechanism layer, a second normalization layer, a first multilayer perceptron, a third normalization layer, a self-attention mechanism layer with temporal offset, a fourth normalization layer, and a second multilayer perceptron, wherein: The output of the time attention mechanism layer is residually connected to the input of the first normalization layer. The output of the first multilayer perceptron is residually connected to the input of the second normalization layer. The output of the self-attention mechanism layer with time-domain offset is residually connected to the input of the third normalization layer; The output of the second multilayer perceptron is residually connected to the input of the fourth normalization layer.

[0080] S104. The local features and the global features are fused according to preset weights to obtain fused features.

[0081] S105. Determine whether the preset dual encoder network model meets the preset training objective. If not, update the model parameters and return to step S103; if yes, execute step S106.

[0082] S106. Based on the fusion features, perform time-series-based battery state prediction to obtain battery state prediction results.

[0083] In step S106, a prediction model based on an improved BiLSTM bidirectional long and short attention mechanism is used to predict the battery state of the fused features based on time series.

[0084] The computer device 300 provided in this embodiment of the invention can implement the steps in the battery state prediction method with encryption effect as described in the above embodiments, and can achieve the same technical effect. Refer to the description in the above embodiments, which will not be repeated here.

[0085] This invention also provides a storage medium storing a computer program. When executed by a processor, the computer program implements the various processes and steps of the encrypted battery state prediction method provided in this invention, and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0086] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware (such as a mobile phone, computer, server, air conditioner, or network device, etc.). The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

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

[0088] The embodiments of the present invention have been described above with reference to the accompanying drawings. The disclosed embodiments are merely preferred embodiments of the present invention. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many equivalent changes in form without departing from the spirit and scope of the claims of the present invention, and all such changes are within the protection scope of the present invention.

Claims

1. A battery state prediction method with encryption effect, characterized in that, Includes the following steps: S101. Obtain battery operating data, wherein the battery operating data is in time series format; S102. Lightweight sensing layer encryption is applied to the battery operation data to obtain compressed encrypted data; S103. Input the compressed and encrypted data into a preset dual encoder network model for feature extraction to obtain the local and global features of the compressed and encrypted data; S104. The local features and the global features are fused according to preset weights to obtain fused features; S105. Determine whether the preset dual encoder network model meets the preset training objective. If not, update the model parameters and return to step S103; if yes, execute step S106. S106. Based on the fusion features, perform time-series-based battery state prediction to obtain battery state prediction results.

2. The battery state prediction method with encryption effect according to claim 1, characterized in that, Step S101 further includes: processing the battery operation data into multiple non-overlapping sequence blocks based on time series according to a preset block size using time-domain block compression sensing technology.

3. The battery state prediction method with encryption effect according to claim 2, characterized in that, Step S102 is as follows: Using a convolutional layer as a measurement matrix, the battery operation data is compressed and encrypted according to a preset compression ratio based on the order of the non-overlapping sequence blocks to obtain the compressed and encrypted data.

4. The battery state prediction method with encryption effect according to claim 1, characterized in that, The preset dual-encoder network model includes a CNN convolutional neural network sub-model and a Transformer sub-model, wherein: The CNN convolutional neural network sub-model is used to extract the local features from the compressed and encrypted data through a convolutional residual structure composed of depthwise separable convolutions and residual connections; The Transformer sub-model is used to extract the global features from the compressed and encrypted data using a Swing Transformer block architecture with a T-MSA time attention mechanism.

5. The battery state prediction method with encryption effect according to claim 4, characterized in that, The Swin Transformer block architecture with T-MSA temporal attention mechanism includes, in order of input-output logic, a first normalization layer, a temporal attention mechanism layer, a second normalization layer, a first multilayer perceptron, a third normalization layer, a self-attention mechanism layer with temporal offset, a fourth normalization layer, and a second multilayer perceptron, wherein: The output of the time attention mechanism layer is residually connected to the input of the first normalization layer. The output of the first multilayer perceptron is residually connected to the input of the second normalization layer. The output of the self-attention mechanism layer with time-domain offset is residually connected to the input of the third normalization layer; The output of the second multilayer perceptron is residually connected to the input of the fourth normalization layer.

6. The battery state prediction method with encryption effect according to claim 1, characterized in that, In step S106, a prediction model based on an improved BiLSTM bidirectional long and short attention mechanism is used to predict the battery state of the fused features based on time series.

7. A battery state prediction system with encryption effect, characterized in that, include: A data loading module is used to acquire battery operating data, which is in a time series format; The data compression module is used to perform lightweight sensing layer encryption on the battery operation data to obtain compressed and encrypted data; The feature extraction module is used to input the compressed and encrypted data into a preset dual encoder network model for feature extraction, thereby obtaining the local and global features of the compressed and encrypted data. The feature fusion module is used to fuse the local features and the global features according to a preset weight to obtain fused features; The loop training module is used to determine whether the preset dual encoder network model meets the preset training objective. If not, it updates the model parameters and returns to the feature extraction module. If so, execute the prediction module; The prediction module is used to perform time-series-based battery state prediction based on the fused features to obtain the battery state prediction result.

8. The battery state prediction system with encryption effect according to claim 7, characterized in that, The preset dual-encoder network model includes a CNN convolutional neural network sub-model and a Transformer sub-model, wherein: The CNN convolutional neural network sub-model is used to extract the local features from the compressed and encrypted data through a convolutional residual structure composed of depthwise separable convolutions and residual connections; The Transformer sub-model is used to extract the global features from the compressed and encrypted data using a Swing Transformer block architecture with a T-MSA time attention mechanism.

9. A computer device, characterized in that, include: The memory, the processor, and the computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of the battery state prediction method with encryption effect as described in any one of claims 1-6.

10. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the steps of the battery state prediction method with encryption effect as described in any one of claims 1-6.