Detailed Description
The embodiment of the invention provides a method for measuring current and power of a ternary polymer lithium battery sharing charging equipment. The terms "first," "second," "third," "fourth" and the like in the description and in the claims and in the above drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments described herein may be implemented in other sequences than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or apparatus.
For ease of understanding, a specific flow of an embodiment of the present invention is described below, referring to fig. 1, and an embodiment of a method for measuring current and power of a ternary polymer lithium battery sharing a charging device in an embodiment of the present invention includes:
Step S1, carrying out multipoint sampling and preprocessing on current, voltage, temperature and use frequency of the charging equipment of the ternary polymer lithium batteries in a plurality of shared charging equipment to obtain a preprocessed data set;
It is understood that the execution body of the present invention may be a ternary polymer lithium battery current and power measurement device sharing a charging device, and may also be a terminal or a server, which is not limited herein. The embodiment of the invention is described by taking a server as an execution main body as an example.
Specifically, high-frequency sampling is carried out on the ternary polymer lithium batteries in the plurality of shared charging devices, and current, voltage and temperature data are collected to obtain original sampling data. The original data is time stamped and associated with the device identification to form an original data set with temporal and spatial information. The device usage characteristic data is generated by calculating the frequency of use and the number of charge-discharge cycles of each charging device. And carrying out multi-scale analysis of wavelet transformation on the original data set with the space-time information, carrying out denoising treatment on the original data, effectively separating useful signals and noise by the wavelet transformation in a multi-scale analysis mode, and retaining the core characteristics of the data to obtain denoised signal data. And carrying out amplitude normalization and time scale standardization on the denoised signal data. Amplitude normalization can eliminate amplitude differences in different devices and sampling processes, so that data has comparability among different devices, and time scale normalization ensures that time characteristics of the data are unified, so that the data in different time periods can be compared and analyzed under the same time scale, and a standardized data set is obtained. Based on the standardized data set, the charging period is identified and segmented using a dynamic time warping algorithm. The identification of the charge cycle is one of the key steps in the overall process, as the performance and life of the battery is largely dependent on the regularity of the charge-discharge cycle. The dynamic time warping algorithm can accurately identify the starting point and the stopping point of the charging period by dynamically matching the data in different time periods, reasonably divide the original data to obtain period segmentation data, and reflect the working states of the battery in different charging periods. The periodic segment data and the device use feature data for time series alignment and feature fusion. Time sequence alignment ensures time consistency among different data sources, and feature fusion is to integrate various feature information (such as current, voltage, temperature, equipment use frequency and the like) into a unified feature vector to obtain a multi-dimensional feature data set. And carrying out sliding window segmentation and overlapping sampling on the multi-dimensional characteristic data set. The method comprises the steps of dividing a sliding window into a plurality of sections, dividing the section of data by a fixed step length on a time axis, wherein each section of data can reflect the working condition of a battery within a certain time range, and overlapping sampling is used for increasing the redundancy of the data and ensuring the continuity and the integrity of information between the data by overlapping adjacent windows in a certain proportion. The preprocessing dataset for current and power measurement model construction is generated by sliding window segmentation and overlap sampling.
S2, constructing comprehensive feature vectors based on the preprocessing data set and performing feature selection to obtain a plurality of target feature subsets;
Specifically, time domain and frequency domain analysis is performed on the preprocessed data set, and an initial feature set is obtained. In time domain analysis, the time sequence changes of parameters such as current, voltage, temperature and the like can reveal the trend and rule of the battery performance, while in frequency domain analysis, the periodic components and hidden modes in the data are captured by transforming to a frequency space. Based on the initial feature set, calculating the change rate of key parameters in the charge and discharge process, extracting dynamic change features, and capturing the fluctuation condition of key performance parameters of the battery under different working conditions, wherein for example, abrupt changes of current and voltage possibly indicate abnormal working conditions or battery aging. By combining the initial feature set and the dynamically changing features, a comprehensive feature vector is constructed. And calculating the influence degree of each feature on the battery performance based on the comprehensive feature vector, and obtaining the importance ranking of the features. The correlation of each feature with the battery performance was evaluated, and features with greater influence were given a higher importance level. The ranking process not only helps identify features that are important to battery health and performance, but also eliminates and screens irrelevant or redundant features to improve the efficiency of subsequent modeling. And setting a plurality of importance thresholds according to the feature importance ranking, and dividing the features into a plurality of layers to obtain a layered feature set. Each level corresponds to a different importance threshold, arranged in order from high to low. And carrying out correlation analysis on the characteristics in the layered characteristic set, and reducing the multiple collinearity problem. And simplifying the feature set through correlation analysis, and reserving the most representative features to obtain the simplified feature set. Based on the simplified feature set, a dynamic weight adjustment model is constructed, and feature weights are initialized to form an initial weight distribution scheme. And dynamically adjusting the characteristic weight according to the use mode of the shared charging equipment. In actual use, the load condition, the health state of the battery, the use frequency and the like of the shared charging equipment are changed, and the dynamic adjustment of the feature weight is beneficial to the model to adaptively cope with various working conditions, so that a plurality of target feature subsets are finally formed.
S3, carrying out multidimensional analysis and hierarchical clustering on battery working conditions and the use modes of the shared charging equipment according to the target feature subsets to obtain a plurality of working conditions and use mode category results;
Specifically, the normalization processing is carried out on the multiple target feature subsets, so that the difference of different features in dimension and scale is eliminated, and the comparability of the different features in cluster analysis is ensured. Through normalization processing, a standardized feature matrix is obtained, the matrix unifies the numerical range of each feature, and the overlarge influence of certain features with larger numerical values on the clustering result is avoided. Based on the standardized feature matrix, euclidean distance between the features is calculated, and similarity between the features is measured. Euclidean distance is a commonly used distance measurement method, and a distance matrix between features is constructed by calculating the distance between different features. Based on the distance matrix, the initial clustering is performed by adopting a minimum distance method. The minimum distance method is a basic method of hierarchical clustering, and features or data points closest to the features or data points are continuously combined to gradually form a clustering structure, so that an initial clustering result is obtained. And carrying out hierarchical combination on the initial clustering results to construct a clustering tree structure. The clustering tree is a multi-level structure, and can show the whole process from individual data points to large-class aggregation, and through the structure, the clustering condition of the data on different levels can be clearly observed. And calculating the inter-class and intra-class distance ratio based on the multi-level clustering model to determine the optimal clustering number. Inter-class distances represent differences between different classes, while intra-class distances represent similarities within the same class. And finding an optimal clustering number through calculation of the inter-class and intra-class distance ratio, so that the difference between different classes is the largest, the difference between the same classes is the smallest, and an optimized clustering result is obtained. And carrying out feature analysis on each category in the optimized clustering result, extracting feature vectors of the categories, and forming a working condition feature set. The feature vector of each category can reflect the specific working state and characteristics of the battery under the category, such as charge and discharge speed, temperature change rule and the like. Meanwhile, according to the working condition characteristic set, the time and space use data of the shared charging equipment are combined to construct a use mode descriptor. The usage pattern of the shared charging device depends not only on the physical characteristics of the battery, but also on factors such as the frequency of use of the device, geographical location, etc. By analyzing the temporal and spatial data, a set of usage pattern features is obtained. And carrying out combined analysis on the working condition characteristic set and the use mode characteristic set to generate the combined distribution of the working condition and the use mode. Through joint analysis, the association between the working condition of the battery and the use mode of the equipment is captured, the results of a plurality of working conditions and use mode categories are obtained, the performance of the battery under different working conditions is revealed, and the operation characteristics of the shared charging equipment under different use scenes can be provided.
S4, constructing a plurality of current and power measurement models based on a plurality of working conditions, a using mode class result and a plurality of target feature subsets;
Specifically, independent heat vector coding is carried out on a plurality of working conditions and using mode class results, class information is converted into feature vectors, and sequential deviation among classes is avoided. After the class feature vector is coded, class information of different working conditions and using modes can be accurately expressed. And splicing the category feature vectors with a plurality of target feature subsets, and performing feature interaction by utilizing a multi-head self-attention mechanism. The multi-head self-attention mechanism realizes the depth interaction among the features by capturing the long-distance dependency relationship among the features, and generates an enhanced feature vector. And constructing a sharing factor encoder which comprises three parallel sub-networks and respectively processes sharing factors such as charging frequency, using time and ambient temperature. each sub-network consists of three full-connection layers, and GELU activation functions are used, and the activation functions can promote nonlinear expression capacity of the model, so that an encoder can extract finer sharing factor characteristics, and the sharing factor characteristics after training and encoding are obtained. And inputting the enhanced feature vector and the encoded sharing factor features into a feature fusion layer. The feature fusion layer adopts a Gating Linear Unit (GLU) structure, and the structure automatically adjusts the fusion mode of information according to different input features to realize self-adaptive fusion of the features and obtain training fusion features. And constructing a dynamic graph convolution layer based on the training fusion characteristics. The dynamic graph convolution layer dynamically constructs a graph structure by learning a similarity matrix between samples, and extracts high-order features by applying graph convolution operation. The graph convolution can effectively capture the local relation between data and the dependence of higher-order features, improve the quality of feature representation and obtain the training graph convolution feature. The graph convolution feature is input into a multi-scale time sequential convolution network. The network comprises three parallel one-dimensional convolution branches, the sizes of convolution kernels are respectively set to be 3, 5 and 7, each branch is connected with a maximum pooling layer, and the change characteristics of battery current and power data on different time scales are extracted through convolution operations of different scales. A two-way long short-term memory network layer (Bi-LSTM) with enhanced attention is constructed. By taking the multi-scale timing features as inputs and applying a self-attention mechanism on the outputs of the LSTM cells, training context-aware features can be obtained while capturing the long-term dependencies of the sequence data while highlighting the most important parts of the data. Training context-aware features are input to the self-calibrating residual network. The network consists of 5 residual blocks, and each residual block adopts layer normalization and ELU activation functions to ensure the stability of gradient and the nonlinear expression capability of the network in the training process. And a self-calibration gating mechanism is added in the residual connection, so that the network can adaptively adjust the information transmission process according to different input characteristics, thereby improving the performance of the model and obtaining self-calibration characteristics. Based on the self-calibration feature, an uncertainty estimation layer is constructed. The layer adopts a multi-task learning framework, and simultaneously predicts the mean value and variance of current and power to generate a measurement result with probability property. In the whole training process, a negative log-likelihood loss function is used for optimization, L1 regularization is combined to prevent the model from being over-fitted, and a learning rate attenuation strategy is adopted to ensure the convergence effect of the model. End-to-end training is performed through an Adam optimizer, and a plurality of current and power measurement models adapting to different sharing scenes are generated. The models can accurately measure and predict the current and the power of the battery under different working conditions and using modes.
S5, performing temperature compensation and shared use frequency compensation based on a measurement circuit topological structure to obtain a temperature and use frequency compensation matrix;
Specifically, the topology structure of the measurement circuit of the shared charging equipment is analyzed, and an initial equivalent circuit model is constructed. The equivalent circuit model can reflect the connection relation and the electrical characteristics of each element in the circuit. Based on the initial equivalent circuit, a node voltage method and a mesh current method are applied to establish a mathematical model of the circuit. The node voltage method can reflect the potential difference between different nodes by solving the voltage of each node in the circuit, and the mesh current rule is used for analyzing the current distribution condition in each mesh, so that the running state of the circuit is comprehensively described. And performing symbol matrix transformation and algebraic reduction on the circuit mathematical model to obtain a decoupled sub-circuit equation set. By decoupling the complex circuit, the overall circuit is broken down into multiple independent sub-circuits. And constructing a nonlinear characteristic model of the temperature sensitive element based on the decoupled subcircuit equation set to form a temperature correlation coefficient matrix. The temperature sensitive element has different electrical characteristics at different temperatures, and the influence of the temperature on the circuit performance is quantified through a nonlinear characteristic model. And carrying out thermodynamic analysis on the temperature correlation coefficient matrix, and establishing a heat conduction equation. The heat conduction equation describes the transfer and diffusion process of temperature in the circuit, helping to understand the temperature change at different locations in the circuit. To solve the heat conduction equation, a finite difference method is used as a numerical solving means. The finite difference method can accurately determine a spatial distribution function of temperature by discretizing a continuous temperature field into a finite number of calculation points. And based on the temperature distribution function, performing temperature compensation on the decoupled sub-circuit, and correcting deviation of parameters such as resistance, inductance and the like caused by temperature change in the circuit to obtain circuit parameters after temperature compensation. And frequency domain analysis is carried out on circuit parameters after temperature compensation, and response characteristics of the circuit under different frequencies are researched, particularly in shared charging equipment, fluctuation of charging frequency and equipment use frequency can have a larger influence on the circuit. And constructing an influence model of the shared use frequency through frequency domain analysis, calculating a corresponding frequency response function, and quantifying the specific influence of the use frequency of the equipment on the circuit performance. The circuit parameters are shared using frequency compensation based on the frequency response function. The frequency compensation is to compensate the performance loss caused by the frequency change by adjusting the frequency related parameters in the circuit. In this process, the temperature compensation result is combined with the frequency compensation result to form a temperature and frequency compensation matrix.
And S6, performing model fusion and self-adaptive calibration on a plurality of current and power measurement models based on a plurality of working conditions, a use mode classification result, a temperature and a use frequency compensation matrix to obtain a current and power measurement model set.
Specifically, feature coding is performed on classification results of a plurality of working conditions and using modes, so that feature vectors of the working conditions and the modes are obtained, and the running states of the battery under different working conditions are effectively represented. Based on the feature vector, screening the existing multiple current and power measurement models, selecting a model which can perform optimally under a specific working condition and a using mode, and forming a candidate model subset. Applying a temperature and frequency compensation matrix to each model in the subset of candidate models, the temperature compensation and frequency compensation can effectively correct errors in current and power measurement models due to ambient temperature variations and frequency fluctuations in use by the sharing device. By applying the compensated model parameters to each model, it is ensured that these models can maintain a high accuracy under different temperature and frequency conditions. And on the basis of the compensated model parameters, according to the contribution degree of different models to the measurement result, a dynamic weight coefficient is given to each model to form a weighted model set. The weight coefficient is dynamically adjusted according to the performances of the model under different working conditions and using modes, so that the weighted model set is ensured to integrate the advantages of various models, and the overall performance is improved. And performing ensemble learning on the weighted model set. Through the ensemble learning method, the output results of the weighting models are fused to generate an initial ensemble model. A self-calibration layer comprising a plurality of residual units and an attention mechanism is constructed on the basis of the initial integration model. The residual unit can effectively capture the error between the model output and the true value, while the attention mechanism is used for highlighting the most important features under different working conditions and use modes. Through self-adaptive adjustment, the calibrated integrated model can more accurately reflect the actual current and power measurement results of the battery. And calculating posterior distribution of model prediction for the calibrated integrated model, providing uncertainty estimation for a prediction result, and improving the robustness of the model under different working conditions. On this basis, an adaptive threshold selector is constructed. The self-adaptive threshold selector dynamically adjusts the predicted threshold according to different working conditions and using modes, so that the model can automatically select the optimal threshold to predict the current and the power under different conditions, the accuracy and the adaptability of a measuring result are ensured, and a current and power measuring model set is obtained.
And acquiring real-time data of the ternary polymer lithium battery in the shared charging equipment, and acquiring key physical parameters such as current, voltage, temperature and the like. Preprocessing the acquired data, removing noise and smoothing the data, and carrying out normalization processing to ensure that different features are analyzed under the same dimension, so as to obtain a standardized real-time feature vector. Based on the normalized real-time feature vector, a current operating condition category, such as whether the battery is in a high load, low load or normal load state, is determined by a pre-trained operating condition classification model. The condition classification model assigns a condition identifier to each operating condition. After the working condition is determined, an activation model corresponding to the current working condition is called from the current and power measurement model set. The model is designed and optimized according to specific working conditions, and can ensure that high-precision measurement results are provided under different working conditions. The normalized real-time feature vector is input to a shared factor encoder in the activation model. The shared factor encoder encodes the input features and extracts important factors related to the use of the device, such as the use frequency, the use duration, the ambient temperature, and the like. Encoders are typically composed of multiple layers of neural networks that generate more abstract shared factor features through nonlinear activation functions (e.g., GELU). In this way, key usage characteristics of the device are fully extracted and encoded, forming sharing factor characteristics after real-time encoding. And inputting the real-time coded sharing factor features into a feature fusion layer, and carrying out fusion operation with the standardized real-time feature vectors. The feature fusion layer performs weighted combination on data from different sources, so that the fused features can reflect the physical state and the service environment of the battery at the same time. And generating real-time fusion characteristics through fusion operation. And inputting the real-time fusion features into a dynamic graph convolution layer to extract high-order features. The dynamic graph convolution layer can extract complex relations among features by dynamically constructing a correlation graph among the features, and capture high-order dependence of battery states. A real-time graph convolution feature is generated by a convolution operation. The real-time graph convolution feature is input into a multi-scale time sequential convolution network and a attention-enhanced Bi-directional long-short-time memory network (Bi-LSTM). The multi-scale time sequence convolution network captures the change of the feature in different time spans through convolution kernels of a plurality of different scales, and the Bi-LSTM can model the time sequence dependency of the feature and identify time sequence information which is most critical to the current state through an attention mechanism. Bi-LSTM outputs real-time context-aware features that reflect the time-dependent characteristics and important context information of the battery under current operating conditions. Self-calibration residual error network processing is carried out on the real-time context sensing characteristics so as to reduce deviation in model prediction, and an initial original measurement result is generated by combining uncertainty estimation. The self-calibration residual error network can enhance the correction capability of the model to the measurement error by introducing residual error connection and a self-calibration mechanism. And correcting the original measurement result by combining the temperature and using a frequency compensation matrix to obtain a measurement result of real-time current and power. The compensation matrix adjusts the output of the battery measurement model according to the temperature of the current environment and the use frequency of the equipment, and ensures the accuracy and reliability of current and power measurement under complex conditions.
Further, the standardized real-time feature vector is decomposed, and the charging frequency feature, the using time length feature and the environment temperature feature are extracted. The charging frequency characteristics are input to a first fully-connected layer of the charging frequency encoder, which maps the input characteristics to a new characteristic space through linear transformation, and an intermediate characteristic representation is obtained. The intermediate feature is processed through GELU activation functions. GELU is a nonlinear activation function, which can improve the nonlinear representation capability of the model by introducing the smoothness of Gaussian distribution, so that the model can better capture the complex mode in the charging frequency characteristic. Through this activation process, the activation output of the first layer is obtained. And inputting the activation output to a second full-connection layer of the charging frequency encoder, performing dimension reduction and information compression on the characteristics, and reserving key information in the charging frequency characteristics through dimension reduction operation, and simultaneously reducing the influence of redundant characteristics. And the feature after the dimension reduction is subjected to GELU activation function processing again, so that the activation output of the second layer is obtained. And inputting the activation output of the second layer into a third full-connection layer, and performing feature mapping and semantic extraction. And extracting higher-level semantic information related to the charging frequency through deep feature transformation to form a coding result of the charging frequency. Similar to the processing of the charging frequency characteristics, the in-use time length characteristics and the ambient temperature characteristics are processed through the respective full connection layers, respectively. Each feature is processed by three full-connection layers to sequentially complete linear transformation, dimension reduction and semantic extraction, and a long-time-to-use coding result and an environment temperature coding result are generated. And carrying out feature fusion on the charging frequency coding result, the using time length coding result and the environment temperature coding result. Through the feature fusion operation, features from different dimensions can be effectively integrated to form a comprehensive real-time coded sharing factor feature, and the real-time state of the sharing charging equipment is comprehensively reflected.
In the embodiment of the invention, the key characteristics of the battery can be effectively extracted by combining the multipoint sampling and preprocessing technology with the dynamic weight adjustment algorithm to perform characteristic selection, and the accuracy of current and power measurement is obviously improved. The battery working conditions and the use modes are classified by using a hierarchical clustering method, and a plurality of current and power measurement models are constructed, so that the method can adapt to different sharing scenes and use conditions. Through equivalent decoupling of the measuring circuit, introduction of temperature and use of a frequency compensation matrix, measuring parameters can be adjusted in real time, and influences of environmental factors and use frequency on a measuring result are effectively eliminated. By adopting the model fusion and self-adaptive calibration technology and combining with a Bayesian model averaging method, the measurement system can be automatically adjusted along with the change of the battery performance, and the long-term measurement stability is maintained. By constructing an efficient neural network model and an optimized data processing flow, real-time measurement of current and power can be realized, and the quick response requirement of the shared charging equipment is met. Through the uncertainty estimation layer and the probabilistic measurement result, the measurement reliability can be estimated, and a reliable basis is provided for equipment management and fault early warning. Based on the mechanism of working condition recognition and model selection, the most suitable model can be called according to different conditions, the use of computing resources is optimized, and the overall efficiency of the system is improved.
In a specific embodiment, the process of executing step S1 may specifically include the following steps:
high-frequency sampling is carried out on the ternary polymer lithium batteries in the plurality of shared charging devices, and current, voltage and temperature data are acquired to obtain original sampling data;
Performing time stamp marking and equipment identification association on the original sampling data to obtain an original data set with space-time information, and calculating the use frequency and the charge-discharge cycle times of each charging equipment based on the original data set with the space-time information to obtain equipment use characteristic data;
Performing multi-scale analysis of wavelet transformation on the original data set with the space-time information to obtain denoised signal data, and performing amplitude normalization and time scale normalization on the denoised signal data to obtain a standardized data set;
Based on the standardized data set, the charging period is identified and segmented by utilizing a dynamic time warping algorithm, and periodic segmented data are obtained;
And carrying out time sequence alignment and feature fusion on the periodic segmented data and the device by using the feature data to obtain a multi-dimensional feature data set, and carrying out sliding window segmentation and overlapping sampling on the multi-dimensional feature data set to generate a preprocessing data set.
Specifically, the high-precision sensor is used for collecting current, voltage and temperature data at a high frequency. Assuming a sampling frequency of 1000 Hz, 1000 current, voltage, temperature data points are obtained per second, forming a high-precision raw data set. To tag the data, each data point is time stamped, representing a time series of acquisitions. At the same time, the device identification is associatedSuch that each data pointInformation of time and equipment is provided. The labeled raw dataset may be represented as:
;
Wherein,Is the total number of sampling points and,Is a time stamp of the time,Is the device identity. Based on the original data set with the time-space information, the use frequency and the charge-discharge cycle number of each charging device are calculated. Frequency of useThe calculation can be made by the following formula:
;
Wherein,Is that the device is in a time intervalThe number of uses in the water tank. The charge-discharge cycle times can be controlled by monitoring the voltageCalculating the complete period of the voltage from low to high (charging) to high to low (discharging) over timeExpressed by the formula:
;
Wherein,Indicating the change in the voltage level of the capacitor,Is a time interval. After obtaining the device usage characterization data, the original dataset with spatio-temporal information is then multi-scale analyzed using wavelet transformation. The wavelet transformation can separate noise from useful signals in the signals to obtain denoised signal data. For a signalWavelet transform thereofThe calculation can be made by the following formula:
;
Wherein,Is a scale parameter of the sample,Is a parameter of the translation and,Is a function of the wavelet,Is the complex conjugate thereof. After denoising, amplitude normalization and time scale normalization are performed on the signal data. The amplitude normalization normalizes all data to a range of 0 to 1, and the time scale normalization ensures that the data on different time scales have consistency by normalizing the time intervals. Based on the standardized data set, the charging period is identified and segmented by using a dynamic time warping algorithm. Dynamic time warping is an algorithm for comparing time sequences of different lengths, which can match two time sequences on a nonlinear time scale, and identify periodic behavior. For two time sequencesAndThe dynamic time warping distance can be expressed as:
;
Dynamic time warping allows the algorithm to identify similar charging cycles even though the charging rates of different devices are different by finding the best matching path between the two time series. And cycle segmentation data is obtained through dynamic time warping, so that accurate segmentation of charging behaviors is ensured. The periodic segment data is time-series aligned and feature fused with the device usage feature data. The time sequence alignment is to synchronize different characteristic data according to time sequence so as to ensure the matching relation between the multi-dimensional data. For example, the characteristic data such as the usage frequency of the device, the number of charge-discharge cycles, etc. need to be compared with the corresponding periodic segment data on the same time axis. By this operation, a multi-dimensional feature data set is generated, including dynamic information of current, voltage, temperature data, and statistical features such as device usage frequency and charge-discharge cycles. In order to improve the usability of the data, sliding window segmentation and overlap sampling are performed on the multi-dimensional feature data set. The sliding window technique divides data on a time axis by setting a window of a fixed length (e.g., 5 seconds or 10 seconds), and overlapping sampling is to set a partial overlapping region between adjacent windows to ensure data continuity and feature integrity. For example, if the window length is 10 seconds and the overlap time is 2 seconds, then the first window data is 0-10 seconds and the second window data is 8-18 seconds. Through a sliding window segmentation and overlapping sampling technology, continuity of data in different time periods is guaranteed, and a richer preprocessed data set is generated.
In a specific embodiment, the process of executing step S2 may specifically include the following steps:
Performing time domain and frequency domain analysis on the preprocessed data set to obtain an initial feature set, and calculating the key parameter change rate in the charge and discharge process based on the initial feature set to obtain dynamic change features;
combining the initial feature set and the dynamic change feature to construct a comprehensive feature vector, and calculating the influence degree of each feature on the battery performance based on the comprehensive feature vector to obtain feature importance ranking;
According to the feature importance ranking, a plurality of importance thresholds are set, the features are divided into a plurality of layers, a layered feature set is obtained, and correlation analysis is carried out on the features in the layered feature set, so that a simplified feature set is obtained;
Based on the simplified feature set, a dynamic weight adjustment model is constructed, feature weights are initialized to obtain an initial weight distribution scheme, and the feature weights are dynamically adjusted according to the initial weight distribution scheme and the use mode of the shared charging equipment to obtain a plurality of target feature subsets.
Specifically, a time series of signals of current, voltage, temperature, etc. are extracted from the raw dataset. Time domain analysis mainly examines the change characteristics of signals along with time, such as whether the battery voltage has obvious rising or falling trend in the charging and discharging process, whether the current has peak value, and the like. In time domain analysis, common statistics include mean, variance, peak, skewness, and kurtosis. And preliminarily knowing the change rule of the voltage in the battery charging and discharging process through time domain statistics. The frequency domain analysis converts the time domain signal into a frequency domain signal by performing fourier transform on the signal, and analyzes the frequency component of the signal. By fast Fourier transformation, the voltage or current signalConversion to a frequency domain representationThe formula is:
;
In the frequency domain, the amplitude and phase information of the specific frequency components can reveal the response characteristics of the battery in different frequency ranges, and particularly whether noise or abnormal vibration exists in different frequency bands in the charging and discharging processes. Combining the time domain and frequency domain analysis results to obtain an initial feature set. And calculating the change rate of key parameters in the charge and discharge process based on the initial feature set so as to extract dynamic change features. The dynamic change characteristic is a change rate reflecting the battery state with time. For example, rate of change of voltageThe rate of change of voltage when the battery is charged or discharged can be described:
;
Wherein,AndRespectively time ofAndVoltage value at that time. The dynamically changing features help predict the state of health of the battery. Similarly, the rate of change of current and temperature can also be calculated in the same way to obtain a complete feature set reflecting the dynamic changes of different parameters during the battery charging and discharging process. Based on the initial feature set and the dynamic change features, these features are combined to construct a comprehensive feature vector. The comprehensive feature vector can comprehensively represent the states of the battery under different working conditions, and comprises time domain features, frequency domain features and dynamic change features. Assuming that there isThe integrated feature vector may be expressed as:
;
Wherein,Represent the firstAnd features. Based on the comprehensive feature vector, feature importance is calculated through the degree of influence of the features on the battery performance. Feature importance ranking may typically be achieved by regression analysis or decision tree models. The importance score for each feature is obtained by calculating the degree of contribution of each feature to a target variable (e.g., battery state of health or performance). For a feature ofIts characteristic importanceMay be calculated by correlation between the feature and the target variable or contribution rate in the model. According to different feature importance scores, a plurality of importance thresholds are set, and the features are divided into a plurality of levels. For example, features are divided into three levels of high importance, medium importance, and low importance. The layered feature set can be better focused on features that have the greatest impact on battery performance, while weakly correlated features can be filtered out appropriately. And carrying out correlation analysis on the characteristics in the layered characteristic set to remove redundant information. Correlation analysis is accomplished by calculating a correlation coefficient between two features, the formula:
;
Wherein,Is characterized byAndCorrelation coefficient between covIs the covariance of them and,AndIs their standard deviation. If it isApproaching 1, it means that the two features are highly correlated, and one of them can be selected to be retained, resulting in a reduced feature set. Based on the reduced feature set, a dynamic weight adjustment model is constructed, a dynamically adjusted weight is assigned to each feature, and an initial weight allocation scheme is determined based on the feature importance ranking. Assuming each featureIs of the initial weight ofThe weight initialization scheme may be expressed as:
;
Wherein,Is characterized byIs used to determine the importance score of the (c) for the (c),Is the weight initially assigned. The weights of these features are dynamically adjusted according to the usage pattern of the shared charging device. For example, the weight of the current signature may need to be increased when the battery is in a high load operating state, while the weight of the temperature signature should be increased appropriately in a low temperature environment. By dynamically adjusting the feature weights, the most critical features of the model can be captured under different working conditions and using modes. Through the steps, a plurality of target feature subsets can be finally obtained, and each subset reflects feature performance under different working conditions.
In a specific embodiment, the process of executing step S3 may specifically include the following steps:
Normalizing the plurality of target feature subsets to obtain a standardized feature matrix, calculating Euclidean distances among features based on the standardized feature matrix, and constructing a distance matrix;
According to the distance matrix, adopting a minimum distance method to perform initial clustering on the features to obtain an initial clustering result, performing hierarchical combination on the initial clustering result, and constructing a clustering tree structure to obtain a multi-level clustering model;
Calculating the inter-class and intra-class distance ratio based on a multi-level clustering model, determining the optimal clustering number to obtain an optimal clustering result, carrying out feature analysis on each class in the optimal clustering result, and extracting class feature vectors to obtain a working condition feature set;
according to the working condition characteristic set, combining time and space use data of the shared charging equipment to construct a use mode descriptor, so as to obtain a use mode characteristic set;
and carrying out combined analysis on the working condition characteristic set and the use mode characteristic set to generate joint distribution of the working condition and the use mode, and obtaining a plurality of working condition and use mode category results.
Specifically, each feature is normalized so that each feature can be compared at the same scale during subsequent clustering. The purpose of normalization is to eliminate dimensional differences of different features, e.g. currents and temperatures may have different ranges of values, whereas normalization may map them to the same range (typically between 0 and 1) so that the effects of different features are relatively balanced, resulting in a normalized feature matrix, one feature for each row and a different sample point for each column. Based on the normalized feature matrix, euclidean distances between features are calculated, quantifying the similarity of different features in multidimensional space, features with smaller distances meaning that they are closer in data distribution. The calculation formula of the Euclidean distance is as follows:
;
Wherein,AndFeatures respectivelyAnd featuresIs used for the vector of (a),Is the number of samples that are to be taken,AndIs the firstCharacteristic values corresponding to the respective samples. By the formula, a distance matrix between the features is obtainedWherein each elementRepresenting characteristicsAnd featuresEuclidean distance between them. And according to the distance matrix, adopting a minimum distance method to perform initial clustering on the features. The minimum distance method is a basic method of hierarchical clustering, and a plurality of clusters are gradually formed by continuously combining two features closest to each other into one cluster. In the initial clustering stage, each feature acts as an independent cluster and then gradually merges according to the minimum value in the distance matrix. The initial clustering results reflect the similarity between different features, and the process gradually establishes the connection between the features. And carrying out hierarchical combination on the initial clustering results to construct a clustering tree structure. Hierarchical cluster trees (also known as dendrograms) can demonstrate the aggregation process from individual to whole among features. A multi-level clustering model is generated by continuously combining the nearest feature clusters. In this model, low-level clusters represent strong correlations between features, while high-level clusters reflect feature similarities over a larger range. Based on the multi-level clustering model, the inter-class and intra-class distance ratio is calculated to determine the optimal clustering number. The intra-class distance represents the similarity between features in the same class, while the inter-class distance reflects the variability between different classes. And finding out a clustering number capable of maximizing the difference between classes and minimizing the difference in the classes through calculating the distance ratio between the classes and the distance ratio in the classes. Interclass spacingAnd intra-class distanceThe ratio of (2) can be expressed by the following formula:
;
By maximising the ratioAnd determining the optimal cluster number. When the ratio reaches the maximum value, the clustering effect is optimal. And carrying out feature analysis on each category according to the optimal clustering number, extracting feature vectors of each category, and comprehensively reflecting main modes of various features to form a working condition feature set. Based on the working condition characteristic set, a usage pattern descriptor is constructed in combination with the time and space usage data of the shared charging equipment. The usage pattern of the shared charging device is not only dependent on the physical state of the battery (such as current and voltage), but is also affected by the frequency of use, time period and geographic location of the device. The temporal and spatial data may help identify the usage scenario of the device. For example, some devices may be used frequently during peak hours, while other devices may be used less frequently in low temperature environments. By analyzing these data, a usage pattern descriptor is constructed for each device, forming a usage pattern feature set. And carrying out combined analysis on the working condition characteristic set and the use mode characteristic set to generate combined distribution of the working condition and the use mode, and revealing the working states of the battery under different use scenes. The operating mode feature set describes the physical state of the battery, while the usage mode feature set provides context information related to device usage. By combining the two, the conditions exhibited by the battery in a particular mode of use are identified. For example, some devices may exhibit a significant voltage drop in a long-term high-load mode of use, while being stable in a light-load mode of use. And generating joint distribution of the working conditions and the use modes through combination analysis, and reflecting the relevance of different working conditions and the use modes. And obtaining class results of a plurality of working conditions and using modes according to the joint distribution, and helping to predict the performance of the battery in different using environments.
In a specific embodiment, the process of performing step S4 may specifically include the following steps:
Carrying out independent heat vector coding on the class results of the multiple working conditions and the using modes to obtain class feature vectors;
splicing the category feature vectors with a plurality of target feature subsets, and carrying out feature interaction through a multi-head self-attention mechanism to obtain enhanced feature vectors;
Constructing a sharing factor encoder, which comprises three parallel sub-networks, namely a charging frequency encoder, a using time-length encoder and an environment temperature encoder, wherein each sub-network consists of three full-connection layers, and a GELU activating function is used to obtain sharing factor characteristics after training encoding;
inputting the enhanced feature vector and the encoded sharing factor feature into a feature fusion layer, wherein the feature fusion layer adopts a gating linear unit structure to realize self-adaptive fusion of the feature, and obtaining training fusion features;
Constructing a dynamic graph convolution layer based on training fusion characteristics, dynamically constructing a graph structure by the dynamic graph convolution layer through a similarity matrix among learning samples, and extracting high-order characteristics by applying graph convolution operation to obtain training graph convolution characteristics;
Inputting the graph convolution characteristics into a multi-scale time sequence convolution network, wherein the multi-scale time sequence convolution network comprises three parallel one-dimensional convolution branches, the convolution kernel sizes are 3, 5 and 7 respectively, and each branch is connected with a maximum pooling layer to obtain the multi-scale time sequence characteristics;
Constructing a attention-enhanced bidirectional long-short-time memory network layer, wherein the attention-enhanced bidirectional long-short-time memory network layer uses multi-scale time sequence characteristics as input, and applies a self-attention mechanism on the output of an LSTM unit to obtain training context sensing characteristics;
inputting training context sensing characteristics into a self-calibration residual error network, wherein the self-calibration residual error network comprises 5 residual error blocks, a layer normalization and ELU activation function is used in each residual error block, and a self-calibration gating mechanism is added in residual error connection to obtain self-calibration characteristics;
Constructing an uncertainty estimation layer based on self-calibration characteristics, wherein the uncertainty estimation layer adopts a multi-task learning framework, and simultaneously predicts the mean value and variance of current and power to obtain a probabilistic measurement result;
And (3) performing end-to-end training by using a negative log-likelihood loss function and combining an L1 regularization and learning rate attenuation strategy, and obtaining a plurality of current and power measurement models adapting to different sharing scenes.
Specifically, the single-hot vector coding is performed on the multiple working conditions and the using mode class results. The single-hot coding is a common classification characteristic coding mode, and converts category information into binary vectors. For example, assume that there are three usage pattern categories (A, B, C), the one-hot vector encodes category A as [1, 0], category B as [0,1,0], and category C as [0, 1]. By encoding, a class feature vector is obtained, and the states of each device in different use modes can be effectively represented. And performing a splicing operation on the category feature vector and the target feature subsets. The target feature subset may include physical features of the battery such as current, voltage, temperature, etc., as well as frequency, time, and spatial features of use of the device. By stitching the class features with these target features, a more comprehensive feature vector is formed that can reflect both the physical state and the usage pattern of the battery. In order to mine complex relationships between features, a multi-head self-attention mechanism is adopted for feature interaction. The multi-headed self-attention mechanism captures interdependencies between features through multiple attention heads, enabling the generation of enhanced feature vectors in different contexts. The core formula of the self-attention mechanism is as follows:
;
Wherein,Is a matrix of queries that is a function of the query,Is a matrix of keys that are arranged in a matrix,Is a matrix of values that are to be found,Is the feature dimension. By the formula, the similarity between feature vectors is quantified, so that the relation between features is better learned. The shared factor encoder is constructed to capture the shared characteristics of the equipment under different working conditions and consists of three parallel sub-networks, namely a charging frequency encoder, a using time-length encoder and an environment temperature encoder. Each subnetwork consists of three fully connected layers and employs GELU activation functions to enhance nonlinear expression capabilities. GELU the activation function is advantageous over the ReLU function because it combines randomness and nonlinearity to handle small-valued inputs more smoothly. The formula is as follows:
;
And generating coding characteristics of the sharing factors by the encoder, and reflecting the influence of the use frequency, the use duration and the environment temperature of the equipment under different scenes. And inputting the enhanced feature vector and the sharing factor feature into a feature fusion layer for fusion. The feature fusion layer adopts a Gating Linear Unit (GLU) structure to realize self-adaptive fusion of features. The GLU structure can effectively filter out irrelevant information by carrying out gating operation on different input characteristics, and only retains the characteristics which are useful for the current working condition and the use mode. The fused features can better reflect the overall state of the equipment and generate training fusion features. And constructing a dynamic graph convolution layer based on the training fusion characteristics. The dynamic graph convolution layer can dynamically construct a graph structure according to the similarity between samples, and captures high-order dependence between features. Dynamic graph convolution not only considers the direct relationship between local features, but also extracts deeper feature representations through graph convolution operations. The core formula is as follows:
;
Wherein,Is an adjacency matrix of the graph,Is a matrix of degrees that is a function of the degree,Is the firstThe feature matrix of the layer is used,Is a matrix of weights that are to be used,Is an activation function. Higher order training graph convolution features are extracted through dynamic graph convolution operations. The graph convolution feature is input into a multi-scale time sequential convolution network. The network consists of three parallel one-dimensional convolution kernels of sizes 3,5, 7, respectively, to capture characteristic variations on different time scales. Each convolution branch is followed by a maximum pooling layer to extract key timing characteristics. By means of multi-scale convolution operation, complex time sequence data of changes of battery charging duration, use frequency and the like can be effectively applied. The attention-enhanced bidirectional long-short-term memory network layer is constructed to capture forward and backward dependencies of the time series data, and the self-attention mechanism further strengthens the attention to the important time series segments. By taking the multi-scale timing characteristics as input, the bidirectional long-short-time memory network can generate training context-aware characteristics, reflecting timing and context information in the data. Training context-aware features are input to the self-calibrating residual network. The self-calibrating residual network consists of 5 residual blocks, each with a layer normalization and ELU activation function inside to ensure stability of the gradient and non-linear expressive power of the model in the deep network. The self-calibration gating mechanism is added in the residual connection, so that a residual path can be dynamically adjusted according to the change of the input characteristics, and the flexibility and the accuracy of the model are improved. And finally generating self-calibration characteristics through a residual block. Based on the self-calibration feature, an uncertainty estimation layer is constructed. The layer adopts a multi-task learning framework, and simultaneously predicts the mean and variance of current and power to generate a probabilistic measurement result. The uncertainty estimation can provide a confidence interval for the result of model prediction, thereby improving the robustness of the model. For electric currentSum powerThe mean and variance predictions of (2) may be represented by the following loss function:
;
Wherein,AndThe predicted values of current and power respectively,AndStandard deviation estimated for uncertainty. To optimize the training process of the model, a negative log-likelihood loss function is used in conjunction with L1 regularization to prevent overfitting. Meanwhile, a learning rate decay strategy is adopted to ensure that the model can gradually converge in the training process. The end-to-end training of the whole model is carried out through an Adam optimizer, and model parameters are adjusted gradually, so that the model parameters can be suitable for current and power measurement under different sharing scenes.
In a specific embodiment, the process of performing step S5 may specifically include the following steps:
Analyzing the topological structure of the measurement circuit of the shared charging equipment to obtain an initial equivalent circuit, and establishing a circuit mathematical model based on the initial equivalent circuit by applying a node voltage method and a mesh current method;
performing symbol matrix transformation and algebraic reduction on the circuit mathematical model to obtain a decoupled sub-circuit equation set, and constructing a nonlinear characteristic model of the temperature sensitive element based on the decoupled sub-circuit equation set to obtain a temperature correlation coefficient matrix;
Performing thermodynamic analysis on the temperature correlation coefficient matrix, establishing a heat conduction equation, solving by using a finite difference method to obtain a temperature distribution function, and performing temperature compensation on the decoupled sub-circuit based on the temperature distribution function to obtain circuit parameters after temperature compensation;
Carrying out frequency domain analysis on the circuit parameters after temperature compensation, and constructing an influence model of shared use frequency to obtain a frequency response function;
and based on the frequency response function, sharing the circuit parameters for frequency compensation, and combining the temperature compensation result to obtain a temperature and frequency compensation matrix.
Specifically, the topology structure of the measurement circuit of the shared charging equipment is analyzed to obtain an initial equivalent circuit. The measuring circuit is usually composed of basic elements such as resistors, inductors, capacitors, etc. and some temperature sensitive elements. The equivalent circuit model converts the complex circuit topology into a mathematically processable form by simplifying the actual structure of the circuit. In this process, the voltage and current of each circuit node are precisely described. After the initial equivalent circuit is obtained, a node voltage method and a mesh current method are applied to establish a mathematical model of the circuit. The node voltage method is to establish an equation by analyzing voltages of respective nodes in a circuit, and the mesh current method is to establish an equation by analyzing a flow of current in each loop. The basic principle of the node voltage method is kirchhoff's current law, i.e. the principle of applying "inflow current equals outflow current" to each node. For one hasThe voltage equation of the circuit of each node can be expressed as a matrix:
;
Wherein,Is an admittance matrix, and contains information of all elements such as resistance, capacitance and the like in a circuit; Is a node voltage vector representing the voltage of each node; Is a current vector representing the injection current of each node. By solving this system of equations, the voltage distribution of each node is obtained. Meanwhile, the mesh current method is based on kirchhoff's voltage law, and the core is that for each loop, the voltage drop in the loop is equal to the supply voltage in the loop. For the followingA mesh whose current equation can be expressed as:
;
Wherein,Is a resistive matrix, representing the impedance in each loop,Is the vector of the current in the cell,Is the supply voltage vector. By solving this equation, the current distribution in each cell is obtained. And performing symbol matrix transformation and algebraic reduction on the circuit mathematical model. The symbol matrix transformation is used for carrying out standardization processing on complex circuit equations, and eliminating certain redundant variables in the algebraic simplification process to obtain a decoupled sub-circuit equation set. The decoupled equations enable each sub-circuit to be analyzed and calculated independently of the other circuits. And constructing a nonlinear characteristic model of the temperature sensitive element based on the decoupled subcircuit equation set. The resistance of a temperature sensitive element (such as a thermistor) at different temperatures can change, and the nonlinear characteristics of the temperature sensitive element can be described by an empirical formula or experimental data. For example for a temperature-sensitive resistorThe relationship between the resistance and the temperature can be expressed as:
;
Wherein,Is the reference temperatureThe resistance value of the lower layer is equal to the resistance value,Is a temperature coefficient and indicates the influence of temperature change on the resistance. In this way, a temperature-dependent coefficient matrix is obtainedEach element of which reflects the characteristics of the circuit element at different temperatures. And carrying out thermodynamic analysis on the temperature correlation coefficient matrix, and establishing a heat conduction equation to describe the conduction and diffusion of the temperature in the circuit. The basic form of the heat conduction equation is:
;
Wherein,Is a function of the temperature distribution,Is the coefficient of thermal conductivity of the material,Is the laplace operator, representing the spatial variation of temperature. To solve this equation, a finite difference method is used. The finite difference method obtains the distribution of temperature at each time and spatial point by discretizing the continuous temperature change into a finite number of calculation points. Obtaining a temperature distribution function by solving a heat conduction equationWhich describes the temperature change with time and space. Based on the temperature distribution function, the decoupled sub-circuits are subjected to temperature compensation, and circuit parameters are adjusted so that the circuits can keep stable working states at different temperatures. By performing temperature compensation on parameters such as resistance and capacitance of the circuit, circuit performance fluctuation caused by temperature change can be avoided, and circuit parameters after temperature compensation can be obtained. And carrying out frequency domain analysis on the circuit parameters after temperature compensation. Frequency domain analysis is to understand the behavior of a circuit at different frequencies by converting its time response into a frequency response. And converting a time domain equation of the circuit into a frequency domain equation through Fourier transformation, and constructing an influence model of the shared use frequency. For voltages in circuitsIts frequency domain representationIs that
;
Obtaining frequency response functions of the circuit under different frequencies through frequency domain analysisWhich describes the response characteristics of the circuit to signals of different frequencies. Based on frequency response functionsFrequency compensation is shared for circuit parameters. The frequency of use of the shared charging device can affect the operating state of the circuit, especially at high frequencies, where parasitic inductances and capacitances in the circuit can lead to instability. The circuit parameters are adjusted through frequency compensation, so that the circuit parameters can keep stable operation under different using frequencies. Combining the temperature compensation result with the frequency compensation result to obtain a temperature and frequency compensation matrixEach element of which represents a correction value of the circuit parameter at a specific temperature and frequency of use.
In a specific embodiment, the process of executing step S6 may specifically include the following steps:
feature coding is carried out on the classification results of the working conditions and the using modes to obtain working condition mode feature vectors, model selection is carried out on the current and power measurement models based on the working condition mode feature vectors to obtain candidate model subsets;
applying a temperature and frequency compensation matrix to each model in the candidate model subset to obtain compensated model parameters, and assigning a dynamic weight coefficient to each model based on the compensated model parameters to obtain a weighted model set;
Performing integrated learning on the weighted model set to obtain an initial integrated model, constructing a self-calibration layer containing a plurality of residual units and an attention mechanism based on the initial integrated model, and performing self-adaptive adjustment on model output to obtain a calibrated integrated model;
And calculating posterior distribution predicted by the model for the calibrated integrated model, constructing a self-adaptive threshold selector, and dynamically adjusting a prediction threshold according to different working conditions and using modes to obtain a current and power measurement model set.
Specifically, feature coding is performed on different working conditions and using modes, and classification results are converted into numerical vector representations which can be directly input into a model. Each class is mapped to a unique binary vector using one-hot encoding. For example, if there are three different conditions (e.g., "high load", "medium load" and "low load"), the corresponding codes are [1, 0], [0,1,0] and [0, 1], respectively. In this way, different working conditions and use modes are converted into numerical characteristics, and a complete working condition mode characteristic vector is constructed. Based on the operating mode feature vector, a plurality of current and power measurement models are selected. And screening out a proper current and power measurement model according to the current working condition mode characteristics. Each model may be optimized for different operating conditions and usage scenarios, and model selection may be based on operating characteristics of the current device, matching to the most applicable model set. This can be done by calculating the fitness of the operating mode feature vector to each model. For example, if a model is designed specifically for "high load" conditions, the priority of the model may be higher in high load mode. The screened models form a subset of candidate models. For each model in the candidate model subset, a temperature and frequency compensation matrix is applied to correct the deviation of the model due to temperature variation and frequency fluctuation in actual operation. Temperature and frequency compensation matrixBy adjusting circuit parameters (such as resistance and capacitance), the model can be kept stable under different environmental conditions. The compensated model parameters can be expressed as:
;
Wherein,Representing the parameters of the original model and,Is a parameter after the compensation and is used for the compensation,Is a compensation matrix. By applying the compensation matrix, the model can be automatically adapted to different temperatures and use frequencies, and the accuracy of the prediction result is ensured. Based on the compensated model parameters, a dynamic weight coefficient is assigned to each model to generate a weighted model set. The dynamic weight dynamically adjusts the contribution degree of the model in the weighted model set according to the performance and compensation effect of the model under the current working condition. Weight coefficientThe distribution can be performed according to performance indexes (such as errors or precision) of the model, and the formula is as follows:
;
Wherein,Is a modelIs a function of the error of (a). The smaller the error, the greater the weight of the model and vice versa. A weighted model set is obtained by weighting such that the output of each model is combined according to its importance. And performing integrated learning on the weighted model set to obtain an initial integrated model. The goal of the ensemble learning is to fuse the prediction results of multiple models to obtain a comprehensive model that performs better than a single model. And obtaining an initial integrated model by carrying out weighted average on the prediction result of the weighted model set or by voting. To improve accuracy and adaptivity of the integrated model, a self-calibration layer is built based on the initial integrated model, which contains a plurality of residual units and an attention mechanism. The residual unit can help the model capture deep features, while the attention mechanism enables the model to focus on the most critical information. The basic form of the residual unit is:
;
Wherein,Is an input feature that is used to determine the input,Is a function of the nonlinear transformation of the features (such as a convolution layer),Is a weight parameter. By connecting the input and output with residual errors, the model can avoid the problem of gradient disappearance and effectively capture deep relationships in the data. The attention mechanism focuses on the features that have the most impact on the output by giving different weights to different parts of the input features. The calculation formula of the attention is:
;
Wherein,Is a matrix of queries that is a function of the query,Is a matrix of keys that are arranged in a matrix,Is a matrix of values that are to be found,Is the feature dimension. Through the mechanism, the self-calibration layer can adaptively adjust the model output, and the accuracy of the model is improved. On the calibrated integrated model, the posterior distribution of model predictions is calculated to better evaluate the uncertainty of the predicted results. The posterior distribution can provide a confidence interval for each predicted value, helping to understand the reliability of the prediction. For current and power predictions, the posterior distribution can be calculated using a Bayesian formula, and the uncertainty of the predictions can be expressed by the variance of the model. An adaptive threshold selector is constructed. The goal of the adaptive threshold selector is to dynamically adjust the prediction threshold according to different operating conditions and usage patterns. The prediction accuracy of current and power may be different in different modes of use, and therefore different thresholds need to be set according to operating characteristics. For example, in a high load mode, a higher threshold may be required to cope with power fluctuations, while in a low load mode, the threshold may be relatively low. The self-adaptive threshold value can be set by analyzing error distribution in historical data, and the accuracy of the model in different scenes can be ensured by dynamically adjusting the threshold value.
In a specific embodiment, the method for measuring current and power of the terpolymer lithium battery of the shared charging device further includes the following steps:
Performing real-time data acquisition and pretreatment on the ternary polymer lithium battery in the shared charging equipment to obtain a standardized real-time feature vector;
Determining the current working condition category based on the standardized real-time feature vector to obtain a working condition identifier, and calling a corresponding activation model from the current and power measurement model set according to the working condition identifier;
inputting the standardized real-time feature vector into a sharing factor encoder of an activation model to obtain sharing factor features after real-time encoding;
inputting the real-time coded sharing factor characteristics into a characteristic fusion layer, and fusing the sharing factor characteristics with standardized real-time characteristic vectors to obtain real-time fusion characteristics;
inputting the real-time fusion features into a dynamic graph convolution layer to perform high-order feature extraction to obtain real-time graph convolution features;
Inputting the real-time graph convolution characteristic into a multi-scale time sequence convolution network and a attention-enhanced bidirectional long-short-time memory network layer to obtain a real-time context sensing characteristic;
self-calibration residual error and uncertainty estimation are carried out on the real-time context sensing characteristics, an original measurement result is obtained, and a real-time current and power measurement result is obtained by combining temperature and using a frequency compensation matrix.
Specifically, important physical parameters such as current, voltage, temperature and the like are collected from the equipment through a high-precision sensor. Preprocessing the collected original data, including denoising, data smoothing, normalization and the like, so as to eliminate measurement noise, abnormal values and scale differences among different features and obtain a standardized real-time feature vector. Based on the normalized real-time feature vector, a current battery operating condition class is determined. The condition category may be predicted by a pre-trained classification model. The classification model can classify the current state into different working condition categories, such as high load, normal operation or low load, according to the characteristics of current, voltage, temperature and the like of the battery. Assuming that a K nearest neighbor classifier is used, the model determines the nearest working condition category by calculating the distance between the real-time feature vector and various working conditions in the training set. The operating condition identifier is an identifier of the category and determines what operating state the current battery is in. Based on the determined operating condition identifier, a corresponding activation model is invoked from the pre-trained set of current and power measurement models. Each model is optimized for a different operating condition, for example, assuming the current operating condition of the battery is "high load", the system activates a model from the set of models specifically designed for the high load operating condition. The normalized real-time feature vector is input to a shared factor encoder in the activation model. The shared factor encoder is used for extracting key features according to specific use factors (such as use frequency, use duration and temperature) of the equipment and improving the expression capacity of the model. The encoder may comprise a multi-layer fully-connected neural network that is processed by a nonlinear activation function (e.g., reLU or GELU) to generate the real-time encoded shared factor characteristic. And inputting the sharing factor characteristics after the real-time encoding into a characteristic fusion layer. And fusing the shared factor characteristic with the original standardized real-time characteristic vector. A common fusion method is to gate the linear units, and by controlling the weights of different features, important features are weighted more heavily, while the influence of irrelevant or redundant features is weakened. The formula for feature fusion can be expressed as:
;
Wherein,AndIs a matrix of weights that can be trained,Is the function of the activation and,Is a fused feature. The obtained real-time fusion characteristics can comprehensively reflect the current state of the battery and the influence of sharing factors. And inputting the real-time fusion features into a dynamic graph convolution layer to perform high-order feature extraction. The dynamic graph convolution layer dynamically constructs a graph structure by learning the similarity among the features, and applies convolution operation to the graph to extract the high-order features of the battery state. The formula of the dynamic graph convolution is:
;
Wherein,Is the firstThe feature matrix of the layer is used,Is an adjacency matrix of the graph, representing the connection relationship between features,Is a matrix of degrees that is a function of the degree,Is a matrix of weights that can be trained,Is an activation function. The high-order associated features in the battery state can be extracted through dynamic graph convolution to generate real-time graph convolution features. The extracted real-time graph convolution features are input into a multi-scale time sequence convolution network and a attention-enhanced bidirectional long-short-time memory network layer. The multi-scale time sequence convolution network comprises convolution kernels with different sizes, wherein the convolution kernels are used for capturing characteristic changes with different time scales in data, and the formula is as follows:
;
Wherein,、、Is a convolution operation of different kernel sizes, concat represents stitching together convolution results of different scales. The bidirectional long short-time memory network is used for capturing time sequence dependency in data, can process the bidirectional time sequence relation of input characteristics, and simultaneously focuses on time sequence information which has important influence on the current battery state through a self-attention mechanism to generate real-time context sensing characteristics. And performing self-calibration residual error network and uncertainty estimation processing on the real-time context awareness features. The self-calibration residual error network can correct errors in deep features, and the formula of a residual error unit is as follows:
;
Wherein,Is a non-linear transformation of the data,Is an input feature that is used to determine the input,Is an output feature. The self-calibration network combines the current input and the calibration result of the model, so that the model can still keep high accuracy under the complex working condition. Uncertainty estimation estimates uncertainty of the measurement result by predicting mean and variance, the formula is:
;
Wherein,Is the average value of the predictions and,Is the standard deviation of the two-dimensional image,Is a random variable used to capture the uncertainty of the predictions. And combining uncertainty estimation to obtain an original measurement result. And correcting the original measurement result by combining the temperature and using a frequency compensation matrix to obtain a final real-time current and power measurement result. Compensation matrixThe measurement deviation caused by temperature and frequency changes is corrected, and the formula is as follows:
;
Wherein,Is the result of the original measurement and,Is the result after compensation. By means of real-time measurement and compensation, the system can accurately measure current and power under complex working conditions.
In a specific embodiment, the step of inputting the normalized real-time feature vector into the shared factor encoder of the activation model, and the process of obtaining the real-time encoded shared factor feature may specifically include the following steps:
performing feature decomposition on the standardized real-time feature vector to obtain a charging frequency feature, a service life feature and an environmental temperature feature;
Inputting the charging frequency characteristic into a first full-connection layer of the charging frequency encoder, performing linear transformation on the input characteristic to obtain an intermediate characteristic representation, applying GELU activation functions to the intermediate characteristic representation, and introducing nonlinear transformation to obtain a first layer activation output;
Inputting the first layer activation output into a second full-connection layer of the charging frequency encoder, performing feature dimension reduction and information compression to obtain dimension reduction features, and applying GELU activation functions to the dimension reduction features to obtain a second layer activation output;
activating the second layer to output and input a third full-connection layer of the charging frequency encoder, and performing feature mapping and semantic extraction to obtain a charging frequency encoding result;
According to the using time length characteristic and the environment temperature characteristic, a using time length coding result and an environment temperature coding result are obtained respectively;
And carrying out feature fusion on the charging frequency coding result, the using time-length coding result and the environment temperature coding result to obtain the sharing factor feature after the real-time coding.
Specifically, the standardized real-time feature vector is disassembled, and is decomposed into three key sub-features, namely a charging frequency feature, a using time length feature and an environment temperature feature. Standardized real-time feature vectors typically contain multidimensional data such as voltage, current, temperature, time of use, etc. of the battery. The feature subset directly related to the charging frequency, the duration of use and the ambient temperature is extracted by an index or feature selection algorithm. For example, assume normalized feature vectorsWhereinRepresenting the frequency of the charge-up,Representing the duration of the use and,Three independent feature subsets are obtained by feature decomposition, representing the ambient temperature, namely charging frequency featuresLong-term use characteristicsAnd ambient temperature characteristics. Will charge the frequency characteristicA first fully connected layer input to the charging frequency encoder. The fully connected layer is a linear transformation operation that functions to linearly combine the input charging frequency characteristics to generate an intermediate characteristic representation. This process can be expressed by the following formula:
;
Wherein,Is the output of the first fully connected layer,Is the weight matrix of the first layer,Is a characteristic of the charging frequency of the input,Is a bias term. An intermediate representation of the feature is obtained by linear transformation. To introduce non-linear characteristics, the model is prevented from being too simple, and GELU activation functions are applied to the intermediate feature representation. GELU is a nonlinear activation function that can introduce randomness and smoothness through gaussian distribution, the formula is as follows:
;
The activation output of the first layer is obtained through GELU activation functions. Activating the first layer to outputAs input, the second fully connected layer of the charging frequency encoder is input. The main function of the second fully-connected layer is to perform the reduction and information compression on the input characteristics. Through the dimension reduction operation, the most representative information is reserved, and the feature dimension is reduced to prevent the over fitting problem. The linear transformation of the second layer can be expressed as:
;
Wherein,Is the output of the second layer and,Is the weight matrix of the second layer,Is a bias term. The feature after the dimension reduction is processed by GELU activation functions to obtain the activation output of the second layer. Activating the second layer to outputAnd a third full connection layer input to the charging frequency encoder. In the third layer, feature mapping and semantic extraction are mainly performed, so that features have higher-level semantic information, and a model is convenient to understand the influence of charging frequency on overall current and power measurement. The linear transformation formula of the third layer is:
;
Obtaining the coding result of the charging frequency through the characteristic mapping process. The encoding results are used for subsequent feature fusion and model prediction. Similar to the charging frequency characteristics, the time-of-use length characteristicsAnd ambient temperature characteristicsAnd are respectively input to the corresponding encoders. Each encoder comprises three fully connected layers, again non-linearly transformed using GELU activation functions. Obtaining the encoding result of the using time length through feature dimension reduction and semantic extractionAnd ambient temperature encoding results. And fusing the encoding results of the charging frequency, the using time and the ambient temperature to obtain the sharing factor characteristics after the real-time encoding. Splicing the three feature coding results together by adopting a splicing method to generate a comprehensive shared feature vector
;
Wherein Concat is a splicing operation,Is the final sharing factor feature. The shared feature vector contains information of charging frequency, using duration and ambient temperature, and can reflect the state of the equipment more comprehensively.
The method for measuring the current and the power of the ternary polymer lithium battery of the shared charging device in the embodiment of the invention is described above, and referring to fig. 2, an embodiment of the device for measuring the current and the power of the ternary polymer lithium battery of the shared charging device in the embodiment of the invention includes:
the sampling module is used for carrying out multipoint sampling and preprocessing on the current, the voltage and the temperature of the ternary polymer lithium battery in the plurality of shared charging devices and the use frequency of the charging devices to obtain a preprocessed data set;
the selection module is used for constructing comprehensive feature vectors based on the preprocessing data set and carrying out feature selection to obtain a plurality of target feature subsets;
The analysis module is used for carrying out multidimensional analysis and hierarchical clustering on the battery working conditions and the use modes of the shared charging equipment according to the target feature subsets to obtain a plurality of working conditions and use mode category results;
the construction module is used for constructing a plurality of current and power measurement models based on a plurality of working conditions, a plurality of using mode class results and a plurality of target feature subsets;
The compensation module is used for carrying out temperature compensation and shared use frequency compensation based on the topology structure of the measurement circuit to obtain a temperature and use frequency compensation matrix;
And the fusion module is used for carrying out model fusion and self-adaptive calibration on the plurality of current and power measurement models based on the classification results of the working conditions and the use modes, the temperature and the use frequency compensation matrix, and obtaining a current and power measurement model set.
Through the cooperation of the components, the characteristic selection is carried out by combining a multipoint sampling and preprocessing technology and a dynamic weight adjustment algorithm, so that the key characteristics of the battery can be effectively extracted, and the accuracy of current and power measurement is remarkably improved. The battery working conditions and the use modes are classified by using a hierarchical clustering method, and a plurality of current and power measurement models are constructed, so that the method can adapt to different sharing scenes and use conditions. Through equivalent decoupling of the measuring circuit, introduction of temperature and use of a frequency compensation matrix, measuring parameters can be adjusted in real time, and influences of environmental factors and use frequency on a measuring result are effectively eliminated. By adopting the model fusion and self-adaptive calibration technology and combining with a Bayesian model averaging method, the measurement system can be automatically adjusted along with the change of the battery performance, and the long-term measurement stability is maintained. By constructing an efficient neural network model and an optimized data processing flow, real-time measurement of current and power can be realized, and the quick response requirement of the shared charging equipment is met. Through the uncertainty estimation layer and the probabilistic measurement result, the measurement reliability can be estimated, and a reliable basis is provided for equipment management and fault early warning. Based on the mechanism of working condition recognition and model selection, the most suitable model can be called according to different conditions, the use of computing resources is optimized, and the overall efficiency of the system is improved.
The present invention also provides a computer device, including a memory and a processor, where the memory stores computer readable instructions that, when executed by the processor, cause the processor to execute the steps of the method for measuring current and power of a lithium ternary polymer battery of the shared charging device in the foregoing embodiments.
The present invention also provides a computer readable storage medium, which may be a non-volatile computer readable storage medium, and may also be a volatile computer readable storage medium, where instructions are stored in the computer readable storage medium, when the instructions are executed on a computer, cause the computer to perform the steps of the method for measuring current and power of a lithium terpolymer battery of the shared charging device.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, systems and units may refer to the corresponding processes in the foregoing method embodiments, which are not repeated herein.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. The storage medium includes a U disk, a removable hard disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, an optical disk, or other various media capable of storing program codes.
While the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those skilled in the art that the foregoing embodiments may be modified or equivalents may be substituted for some of the features thereof, and that the modifications or substitutions do not depart from the spirit and scope of the embodiments of the invention.