Battery time sequence anomaly detection method and device, equipment and storage medium
The battery time series anomaly detection method uses multivariate time series segmentation and nonlinear sequence prediction to accurately assess battery health, improving electric vehicle performance and safety by predicting remaining energy and chargeable capacity.
Patent Information
- Application Number
- CN202411101825.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-12-10
AI Technical Summary
Existing battery management systems fail to accurately reflect the health status and aging characteristics of batteries, limiting their performance and safety in electric vehicles.
A battery time series anomaly detection method that utilizes multivariate time series segmentation and nonlinear sequence prediction algorithms, including Gaussian distribution modeling and support vector regression, to divide battery data into segments and predict battery status accurately.
This method provides a more reliable monitoring system for battery health, enabling precise predictions of remaining energy and chargeable capacity, enhancing vehicle performance and safety.
Smart Images

Figure CN119104899A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of battery management technology, and in particular to a battery time series anomaly detection method, device, equipment and storage medium. Background Art
[0002] In the context of the rapid development of electric vehicle technology today, battery management has become one of the key research areas. Battery management of electric vehicles is crucial to the performance and range of the vehicle. With the continuous advancement of battery technology, intelligent management of battery systems has become increasingly important to improve energy efficiency, extend battery life, and ensure vehicle performance and safety.
[0003] In the related art, a commonly used method for estimating the battery state is to measure the charge and discharge current of the battery over a period of time, integrate the measured current over time, and calculate the total charge of the current over time.
[0004] However, it cannot directly reflect the health status and aging characteristics of the battery. Summary of the invention
[0005] In order to solve the above technical problems, the present application provides a battery time series anomaly detection method, device, equipment and storage medium to achieve accurate prediction of battery status and provide a more reliable monitoring method for the battery management system.
[0006] In a first aspect, the present application provides a battery time series anomaly detection method, the method comprising: obtaining time series status data of a battery to be detected; dividing the time series status data into multiple sub-sequence status data according to a multivariate time series segmentation algorithm, wherein the sub-sequence status data corresponds to a time interval; for each time interval, obtaining multiple discrete state data within the time interval; determining a corresponding multi-core function combination based on the sub-sequence status data and the multiple discrete state data; and using the selected multi-core function combination to predict the status data of the battery to be detected.
[0007] In the second aspect, the present application provides a battery time series anomaly detection device, which includes: a first data acquisition module, used to acquire time series status data of a battery to be detected; a first data segmentation module, used to segment the time series status data into multiple sub-sequence status data according to a multivariate time series segmentation algorithm, wherein the sub-sequence status data corresponds to a time interval; a second data acquisition module, used to acquire multiple discrete state data within each time interval; a multi-core function determination module, used to determine a corresponding multi-core function combination based on the sub-sequence status data and multiple discrete state data; a state data prediction module, used to predict the state data of the battery to be detected using the selected multi-core function combination.
[0008] In a third aspect, the present application provides a battery time series anomaly detection device, which includes: one or more processors; a storage device for storing one or more programs; when the one or more programs are executed by one or more processors, the one or more processors implement the battery time series anomaly detection method as described in the first aspect above.
[0009] In a fourth aspect, the present application provides a storage medium, which may be a computer-readable storage medium having a computer program stored thereon, and when the program is executed by a processor, the battery time series anomaly detection method as described in the first aspect above is implemented.
[0010] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the battery time series anomaly detection method as described in the first aspect above is implemented.
[0011] Compared with the prior art, the technical solution provided by the embodiments of the present application has the following advantages:
[0012] The embodiments of the present application provide a battery time series anomaly detection method, apparatus, device and storage medium, the method comprising: obtaining time series state data of a battery to be detected; dividing the time series state data into a plurality of sub-sequence state data according to a multivariate time series segmentation algorithm, wherein the sub-sequence state data corresponds to a time interval; for each time interval, obtaining a plurality of discrete state data within the time interval; determining a corresponding multi-core function combination based on the sub-sequence state data and the plurality of discrete state data; and predicting the state data of the battery to be detected using the selected multi-core function combination.
[0013] In the embodiments of the present application, on the one hand, the multivariate time series partitioning algorithm utilizes the characteristics of time series data to divide the time series state data of the battery into multiple segments, and uses the Gaussian distribution model to model and detect anomalies for each segment. It can more accurately capture the changing trends and abnormal behaviors of the battery state, providing a more reliable monitoring method for the battery management system. On the other hand, the nonlinear sequence prediction algorithm predicts the state of the battery by performing nonlinear transformation and modeling on the subsequence state data, and using support vector regression and other techniques. It can more accurately predict the remaining energy, chargeable capacity and health status of the battery, providing more accurate data support for the battery management system. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0015] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0016] Figure 1 A flowchart of a battery time series anomaly detection method provided in an embodiment of the present application;
[0017] Figure 2 A schematic diagram of the division of time series state data provided in an embodiment of the present application;
[0018] Figure 3 A schematic diagram of a flow chart of a method for determining a multi-core function combination provided in an embodiment of the present application;
[0019] Figure 4 A schematic diagram of a flow chart of a multivariate time division algorithm provided in an embodiment of the present application;
[0020] Figure 5 A schematic diagram of the structure of a battery time series anomaly detection device provided in an embodiment of the present application;
[0021] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the scheme of the present application will be further described below. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0023] In the following description, many specific details are set forth to facilitate a full understanding of the present application, but the present application may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only part of the embodiments of the present application, rather than all of the embodiments.
[0024] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0025] It should be noted that the concepts such as "first" and "second" mentioned in this application are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0026] It should be noted that the modifications of "one" and "plurality" mentioned in the present application are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0027] The battery time series anomaly detection method provided by the present application is described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0028] Figure 1 This is a flow chart of a battery time series anomaly detection method in an embodiment of the present application. This embodiment can be used to accurately predict the state of a battery. The method can be executed by a battery time series anomaly detection device. The battery time series anomaly detection device can be implemented in software and / or hardware. The battery time series anomaly detection device can be configured in an electronic device.
[0029] like Figure 1 As shown, the battery time series anomaly detection method provided in the embodiment of the present application mainly includes steps S101-S105.
[0030] S101, obtaining time series status data of a battery to be tested.
[0031] Among them, the battery to be tested can be understood as the battery whose status data needs to be predicted. A time series is a set of data points arranged in chronological order, which is usually used to analyze and predict the future state of the battery. Status data usually refers to a series of data related to battery performance and health. For example, status data can include: voltage, current, power, capacity, charge change rate, etc.
[0032] The time series status data may include a set of parameters related to battery performance and health arranged in chronological order. In other words, the time series status data may include a set of parameters related to voltage, current, power, capacity, charge change rate, etc. arranged in chronological order.
[0033] Read the respective data from each sensor of the battery to be tested in time series to form time series status data. For example: read the current data from the current sensor of the battery to be tested in time series, read the voltage data from the voltage sensor of the battery to be tested in time series, read the power data from the power sensor of the battery to be tested in time series, read the capacity data from the capacity sensor of the battery to be tested in time series, read the charge change rate data from the charge change rate sensor of the battery to be tested in time series, aggregate the above data read from the sensors to obtain time series status data.
[0034] S102 . Divide the time series state data into a plurality of subsequence state data according to a multivariate time series segmentation algorithm, wherein each subsequence state data corresponds to a time interval.
[0035] The time series state data can be understood as the state data arranged in time order within a time period, and the subsequence state data can be understood as a part of the time series state data.
[0036] For example, the time series state data is the state data arranged in chronological order within one month. If 6 days is a time interval, the above time series can be divided into 5 sub-sequence state data. Each sub-sequence state data corresponds to a time interval. It should be noted that this is just an example, and the time series state data is not necessarily divided evenly.
[0037] like Figure 2 As shown, when the time series state data is represented in matrix form, each row represents a parameter category, each column represents a time point, there are a total of m parameter categories and n time points, and a11 represents the specific value of the first parameter category at the first time point.
[0038] Dividing the time series state data into multiple subsequence state data can be understood as finding multiple split points in the time period corresponding to the entire time series, and the split points divide the time series state data into multiple subsequence state data. Further, multiple split points are found through a multivariate time series splitting algorithm.
[0039] Furthermore, the subsequence state data corresponds to the time interval one by one. For example, the time interval corresponding to the subsequence state data A1 is t1, the time interval corresponding to the subsequence state data A2 is t2, the time interval corresponding to the subsequence state data A3 is t3, etc. The lengths of the time intervals can be the same or different, and the lengths of the time intervals can be specifically determined by the segmentation points.
[0040] S103: For each time interval, obtain a plurality of discrete state data within the time interval.
[0041] The discrete state data is usually binary or classified, indicating a specific state or event of the battery. For example, the various flags in the battery manager. Table 2 is a battery flag description table. Commonly used discrete state data mainly include the discrete state data in Table 2. Table 2 provides 19 discrete state data, that is, discrete state data composed of 19 battery flags. The specific value of the discrete state data can be read from the corresponding flag in the battery manager.
[0042] Table 2
[0043] Bit Definition 1 Definition 0 Processing instructions 0 Temperature difference alarm normal The flag remains until the alarm condition is removed. 1 Battery high temperature alarm normal The flag remains until the alarm condition is removed. 2 On-board energy storage device type overvoltage alarm normal The flag remains until the alarm condition is removed. 3 On-board energy storage device type undervoltage alarm normal The flag remains until the alarm condition is removed. 4 SOC low alarm normal The flag remains until the alarm condition is removed. 5 Single battery overvoltage alarm normal The flag remains until the alarm condition is removed. 6 Single battery undervoltage alarm normal The flag remains until the alarm condition is removed. 7 SOC too high alarm normal The flag remains until the alarm condition is removed. 8 SOC jump alarm normal The flag remains until the alarm condition is removed. 9 Rechargeable energy storage system mismatch alarm normal The flag remains until the alarm condition is removed. 10 Poor battery consistency alarm normal The flag remains until the alarm condition is removed. 11 Insulation alarm normal The flag remains until the alarm condition is removed. 12 DC-DC temperature alarm normal The flag remains until the alarm condition is removed. 13 Braking system alarm normal The flag remains until the alarm condition is removed. 14 DC-DC status alarm normal The flag remains until the alarm condition is removed. 15 Drive motor controller temperature alarm normal The flag remains until the alarm condition is removed. 16 High voltage interlock status alarm normal The flag remains until the alarm condition is removed. 17 Drive motor temperature alarm normal The flag remains until the alarm condition is removed. 18 On-board energy storage device type overcharge normal The flag remains until the alarm condition is removed.
[0044] It is written in S102 that each subsequence state data has a corresponding time interval. Obtain each discrete state data in each time interval. For example: obtain each discrete state data corresponding to time interval t1, obtain each discrete state data corresponding to time interval t2, and obtain each discrete state data corresponding to time interval t3. Multiple discrete state data refer to multiple flag bits. In other words, obtaining each discrete state data is to obtain the specific value of each flag bit.
[0045] It should be noted that the subsequence state data and each discrete state data corresponding to the same time interval are processed as a group of state data.
[0046] For the discrete state data read from Table 2, the state of each flag bit can be encoded as a binary value, 1 for alarm, and 0 for normal. Encoding according to the binary value constitutes a character sequence of the battery flag bit, for example: "temperature difference alarm" can be encoded as "1", and "normal" can be encoded as "0". In this way, the flag bit can be represented as a vector composed of 0 and 1. It should be noted that the state encoding of each flag bit corresponding to the flag bit at different time points constitutes a character sequence, that is, a discrete state data.
[0047] Multiple discrete state data refers to a character sequence formed by multiple identification bits in a corresponding time interval. For example, there are 19 discrete state data in Table 2, that is, a character sequence formed by 19 identification bits in a corresponding time interval.
[0048] S104: Determine a corresponding multi-core function combination based on the subsequence state data and the plurality of discrete state data.
[0049] Since the subsequence state data is continuous data, its corresponding kernel function can be constructed in Euclidean space. Furthermore, since the time series state data of the battery generally conforms to the Gaussian distribution, the subsequence state data also conforms to the Gaussian distribution, so the Gaussian kernel function is selected for the subsequence state data.
[0050] The rules of multiple discrete state data are inconsistent, so a corresponding kernel function needs to be constructed for each discrete state data. And discrete state data is different from sequence state data. Discrete state data is a data point one by one. Therefore, in the embodiment of the present application, the kernel function of the discrete state data selects the string kernel function on the set of discrete data.
[0051] In other words, the subsequence state data has its corresponding Gaussian kernel function. Each discrete state data also has its corresponding string kernel function. In the embodiment of the present application, the Gaussian kernel function of the subsequence state data and the string kernel function of each discrete state data are combined to construct a multi-kernel function combination.
[0052] The multi-core kernel function combination includes a Gaussian kernel function and multiple string kernel functions, and each kernel function has a corresponding weight value. Specifically, the multi-core function combination is represented by formula (1).
[0053]
[0054] Among them, j represents the kernel function number, m represents the total number of kernel functions, and s j represents the weight value of the jth kernel function, K j (·,·) represents the kernel value between the sample and the state data calculated by the jth kernel function. K * (·,·) represents the kernel value between the sample and the state data calculated by the multi-kernel function combination. The state data includes subsequence state data or discrete state data.
[0055] It is worth noting that the multi-kernel function combination still satisfies Mercer's theorem and can be used as the inner product kernel for the support vector regression problem.
[0056] In an embodiment of the present application, a method for determining a kernel function corresponding to discrete state data is provided. Specifically, a string kernel function is defined to process a character sequence of discrete state data for subsequent pattern recognition and anomaly detection.
[0057] The role of the string kernel function is to map the character sequence of discrete state data to a high-dimensional feature space, so that it can be better classified and analyzed. Further, two character sequences are mapped to a new space and their inner product is calculated. The two strings are the sample string and the character sequence corresponding to the discrete state data.
[0058] A commonly used kernel function is a string kernel function, which can measure the similarity between two strings. In the embodiment of the present application, a string kernel function based on a string is defined to calculate the similarity between character sequences of discrete state data.
[0059] Specifically, a dictionary needs to be defined to map each discrete state data to a unique index. Then, the character sequence can be converted into a sparse vector, where each dimension corresponds to the index of a discrete state data, and the value 1 or 0 indicates whether the alarm exists. Finally, the string kernel function is used to calculate the similarity between two sparse vectors to obtain their inner product.
[0060] The string kernel function corresponding to discrete state data is explained below.
[0061] Kernel functions can be defined not only on Euclidean space, but also on a set of discrete data. For example, the string kernel function is a kernel function defined on a set of strings. The string kernel function has applications in text classification, information retrieval, bioinformatics, and more.
[0062] Assume a finite character table ∑, string s is a sequence of finite characters selected from ∑, including null characters, the length of string s is represented by |s|, and its elements are denoted by s(1)s(2)^s(|s|). The concatenation of two strings s and t is denoted by st, and the set of all strings of length n is denoted by Σ n , the set of all strings is denoted by
[0063] Assume that the substring u of the string s is defined as an index sequence i = (i1, i2, ..., i |u| ), where 1≤i1 <i2<…<i |u| ≤|s|, the substring u of s is defined as u=s(i)=s(1)s(2)…s(i |u| ), the length of substring u is recorded as l(i)=i |u| -i1+1. If i is continuous, then l(i)=|u|; otherwise l(i)>|u|.
[0064] Assume that S is a set of strings whose length is greater than or equal to n, and s is an element of S. Now build the string set S into the feature space The mapping φ n (s), It means that the definition is in Σ n The real number space on which each dimension corresponds to a string u∈Σ n , mapping φ n (s) maps strings to spaces A vector whose value in the u dimension is shown in formula (2).
[0065]
[0066] Where λ represents a decay parameter, 0<λ≤1, l(i) represents the length of the string, and the summation is performed on all substrings in s that are identical to u.
[0067] Assume that ∑ is an English character set, n is 3, and S is a set of strings whose length is greater than or equal to 3. Consider mapping the string set S to the feature space H3, where one dimension of H3 corresponds to the string asd. In this case, the values of the strings "Nasdaq" and "lass das" on this dimension are [φ3(Nasdaq)]asd =λ 3 and [φ3(lass□das)] asd =2λ 5 In the first string, asd is a continuous substring, and in the second string, asd is a discontinuous substring of length 5, which appears 2 times in total.
[0068] The string kernel function on two strings s and t is based on the mapping φ n The inner product in the feature space of the purchase is shown in formula (3).
[0069]
[0070] String kernel function k n (s, t) gives the cosine similarity of the feature vectors composed of all substrings of length n in strings s and t. Intuitively, the more substrings two strings have in common, the more similar they are, and the larger the value of the string kernel function, which can be quickly calculated by dynamic programming.
[0071] This can help effectively calculate the similarity between character sequences of discrete state data in the feature space, which can then be used for subsequent pattern recognition and anomaly detection tasks. By performing kernel function processing on discrete state data of batteries, we can better understand the abnormal behavior of the battery system, discover and handle potential problems in a timely manner, and thus improve the stability and safety of the battery system.
[0072] S105 , predicting the status data of the battery to be tested by using the selected multi-core function combination.
[0073] In the above S104, a multi-kernel function combination is determined. The multi-kernel function combination satisfies Mercer's theorem and can be used for the inner product kernel of the support vector regression problem.
[0074] Specifically, the state data of the battery to be detected is predicted using the selected multi-core function combination, including: determining the state data of the battery to be detected using the selected multi-core function combination and a prediction function, wherein the prediction function is as shown in formula (4).
[0075]
[0076] in,
[0077] Where n represents the number of input samples, i represents the serial number of the input sample, xi represents the i-th input sample, m represents the total number of kernel functions, j represents the serial number of the kernel function, s j represents the weight value of the j-th kernel function, x represents input data, and the input data includes subsequence state data or each of the scattered state data, represents the predicted state data corresponding to the jth kernel function, Φ j (x) represents the feature vector mapped from the input data x to the high-dimensional space, K j (x i ,x) represents the jth kernel function calculation input sample x i and the kernel value between the input data x. represents the optimal solution of the dual parameter corresponding to the i-th sample, λ represents the regularization parameter, represents the matrix of optimized intercept estimates.
[0078] The input data x includes subsequence state data or discrete state data corresponding to the kernel function.
[0079] By inputting the subsequence state data and the discrete state data into the above prediction function for calculation, the state data of the battery to be tested within a period of time in the future can be obtained.
[0080] An embodiment of the present application provides a battery time series anomaly detection method, the method comprising: obtaining time series state data of a battery to be detected; dividing the time series state data into multiple sub-sequence state data according to a multivariate time series segmentation algorithm, wherein the sub-sequence state data corresponds to a time interval; for each time interval, obtaining multiple discrete state data within the time interval; determining a corresponding multi-core function combination based on the sub-sequence state data and the multiple discrete state data; and using the selected multi-core function combination to predict the state data of the battery to be detected.
[0081] Since the multivariate time series partitioning algorithm uses the characteristics of time series data to divide the sequence into multiple segments, and uses the Gaussian distribution model to model and detect anomalies in each segment, it can more accurately capture the changing trends and abnormal behaviors of the battery status, providing a more reliable monitoring method for the battery management system. On the other hand, the nonlinear sequence prediction algorithm predicts the battery status by performing nonlinear transformation and modeling on the time series data, and using technologies such as support vector regression. It can more accurately predict the remaining energy, chargeable capacity and health status of the battery, providing more accurate data support for the battery management system.
[0082] The partitioning algorithm based on multivariate time series and the nonlinear sequence prediction algorithm provide effective solutions for electric vehicle battery management. These algorithms can help achieve accurate prediction and anomaly detection of battery status, improve vehicle performance, mileage and user experience, and promote the further development of electric vehicle technology.
[0083] On the basis of the above-mentioned embodiment, the embodiment of the present application further optimizes the step of "determining the corresponding multi-kernel function combination based on the subsequence state data and the multiple discrete state data", such as Figure 3As shown, the method for determining a multi-core function combination provided in an embodiment of the present application includes the following steps S201-S205.
[0084] In the implementation of the present application, the prediction method for the state data of the battery to be detected adopts a nonlinear sequence prediction algorithm, that is, a multi-core support vector machine is used for prediction. Therefore, the support vector machine is first introduced in the embodiment of the present application.
[0085] Assume that the input sample data of the kernel function is {x1,x2,…,x n},in, And the output sample data of the kernel function is {y1,y2,…,y n},in, Let Φ: As a function mapping, it maps the variables of the p-dimensional vector space x to the Hilbert space The solution to the support vector regression problem is shown in formula (5).
[0086]
[0087] Where i represents the sequence number of the input sample data, n represents the number of input sample data, β represents the vector of intercept estimates, and ξ represents the slack variable, which allows some data points to exceed the ε-insensitive region. λ represents the regularization parameter, which is used to control the trade-off between model error and complexity. l(·) represents the loss function, which is a measure of the tolerable fitting error, that is, i Commonly used transformations include Laplace loss function, ∈-insensitive loss function, Quadratic loss function, Huber loss function, etc. This type of loss is characterized by symmetry loss.
[0088] The Laplace loss function is selected to train the support vector regression machine. The solution to the problem of support vector regression including the Laplace loss function is shown in formula (6).
[0089]
[0090] The constraints are shown in formula (7).
[0091]
[0092] in, and represents the lower limit and upper limit of the slack variable, yi represents the i-th output sample data, β0 represents the intercept estimate of the nonlinear model, the meanings of other parameters are as described above, and st represents the output data calculated by formula (6).
[0093] After Lagrangian transformation of the above formulas (6) and (7), the Lagrangian form of the solution to the problem of log support vector regression can be obtained as shown in formula (8).
[0094]
[0095] in, is a non-negative Lagrange multiplier, and the meanings of other parameters are as described above. The dual form of formula (8) is derived as shown in formula (9).
[0096]
[0097] The constraints of formula (9) are shown in formula (10).
[0098]
[0099] in, is a symmetric positive definite matrix, where the element corresponding to each position (i, j) is K i,j =Φ(x i ) T Φ(x j )=K(x i ,x j ). Optimal solution The form of the corresponding original variables is shown in formula (11).
[0100]
[0101] in, represents the optimal solution matrix corresponding to the intercept estimate, Represents the optimal solution for the intercept estimate corresponding to the i-th sample.
[0102] In this way, the prediction function is obtained, as shown in formula (12).
[0103]
[0104] in, Represents the output data of the prediction function, represents the optimized intercept estimate, and x represents the input battery state data, which may include subsequence state data and discrete state data.
[0105] S201, selecting subsequence state data and a kernel function corresponding to each discrete state data.
[0106] The Gaussian kernel function is selected for the subsequence state data, and the method for determining the kernel function corresponding to the discrete state data can be found in the description in the above embodiment, which will not be repeated in the embodiments of the present application.
[0107] S202: construct an initial multi-kernel function combination based on each kernel function.
[0108] Support vector machine SVR does not need to explicitly define the mapping function Φ, only the kernel function is needed as the inner product function. Support vector machine needs to select a suitable kernel function. If there is a set of kernel functions K1(·,·), K2(·,·),…,K m (·,·), that is, there is a set of feature mapping functions Φ1(·),Φ2(·),…,Φ m (·). If all mapping features are used, it is equivalent to using the cumulative kernel function
[0109] S203: Determine the target problem of the multi-core function combination.
[0110] When the kernel function in the support vector machine is a combination of multiple kernel functions, the objective function of the support vector machine is transformed into the one shown in formula (13).
[0111]
[0112] The constraint conditions corresponding to the objective function (Formula 13) are shown in Formula (14).
[0113]
[0114] Among them, β j Represents the intercept estimate corresponding to the j-th kernel function.
[0115] Furthermore, the dual form of the objective function of the support vector machine (Formula 13) is shown in Formula (15). For the convenience of subsequent expression, the dual form of the objective function is called objective function 1.
[0116]
[0117] The constraints corresponding to the dual form of the objective function (Formula 15) are shown in Formula (16).
[0118]
[0119] The optimization methods for solving objective function 1 include QP method and SMO method.
[0120] Solving the above equation, we can finally get the optimal value of the dual parameter α express As shown in formula (17).
[0121]
[0122] Introduce L1 norm regularization coefficient to do scale transformation s1,…,s m ≥0 and And define each parameter Then the objective function 2 is shown in formula (18).
[0123]
[0124] The constraint condition is expressed by formula (19):
[0125]
[0126] Where n represents the number of input samples, i represents the sequence number of the input sample, and x i represents the i-th input sample, m represents the total number of kernel functions, j represents the sequence number of the kernel function, s j represents the weight value of the jth kernel function, Φ j (x i ) represents the feature vector of the i-th input sample mapped to the high-dimensional space, and represents two slack variables; C is the regularization parameter, β0 represents the intercept estimate of the nonlinear model, β j Represents the intercept estimate corresponding to the j-th kernel function.
[0127] S204: Solve the target problem to obtain the target weights corresponding to each kernel function.
[0128] Solving the above formulas (17) and (18), we can get the optimal parameters as well as
[0129] The Lagrangian form of the above objective function 2 is as shown in formula (19).
[0130]
[0131] In formula (19), there are Lagrange multipliers The Lagrange multipliers are assumed as in formula (20).
[0132]
[0133] Then the Karush-Kuhn-Tucker (KKT) conditions are as follows:
[0134]
[0135] Depend on The slack variable conditions can be written as formulas (25)-(30)
[0136]
[0137] ∈ j s j =0 (30)
[0138] Solve the minimum and maximum Lagrangian objective function as shown in formula (31):
[0139]
[0140] If y i -f(x i )>0, it can be seen from formula (26) that the maximization objective function must have It can also be seen from formula (25) that the minimized objective function must have Otherwise, the objective function will tend to infinity. According to formula (24), we can get Then, from formula (29), we can get According to formula (28), we can get Then, from formula (23), we can get Therefore, i -f(x i )>0, then γ i =1,ξ i >0; This analytical method gives the relationship as shown in formula (32).
[0141] y i -f(x i )>0:γ i =1,ξ i >0y i -f(x i )>0:γ i =1,ξ i >0
[0142] y i -f(x i )>0:γ i =1,ξ i >0(32)
[0143] Based on these three conditions, four event sets are constructed, as shown in formula (33).
[0144] Right
[0145] Elbow
[0146] Left
[0147] Dynamic Core Collection (33)
[0148] The following primal system holds, as shown in formulas (34) and (35).
[0149]
[0150] If the sample point or Then γ i Determine, from formula (21) we can get formula (36).
[0151]
[0152] Because s j ≠0 if Then from (12) we can get ∈ j =0, and then from (22) we can get formula (37).
[0153]
[0154] We call formula (36) and formula (37) the dual system. For any given solution set that satisfies the KKT condition under C, it must satisfy (34)-(37), that is, the original system and the dual system hold, and vice versa. For a linear equation system, the original system has The variables need to be determined, that is, To satisfy |ε|+1 equations, and the dual system has |ε|+1 variables to be determined, that is, {η,γ i ∈ε} to satisfy In order to satisfy both systems, we need to satisfy Therefore, we consider how to initialize the collection and traverse the collection path state.
[0155] Set initialization when C = 0,
[0156] When C = 0, there is a unique solution. According to (22), there must be s i =0, i=1,…,m. Then we get the initial state of the set. At this time, for the input sequence {y1,y2,…,y n} Sort in descending order to get y ord(1) ≤y ord(2) ≤…≤y ord(n) , then we have formula (38).
[0157]
[0158] in is the upward rounding function, and ord represents the subscript in the original sequence. According to formula (33), v, The definition of can get the corresponding set partition, and the cardinality of the set is |ε|=1, like Then γ i =1; if Then γ i = -1; ε = {i *}, From (21) if n is an even number, then otherwise
[0159] Initializing the collection also requires Add an element j * , we consider In fact, due to the continuity of the system, for ΔC in the right neighborhood of 0, * The value will not change the collection ε, Therefore, γ i (i=1…n) does not change, adding any j * , (15)-(18) are all valid. Therefore, the optimization objective function is as shown in formula (39).
[0160]
[0161] By rearranging formula (39), we can obtain formula (40).
[0162]
[0163] That is formula (41).
[0164]
[0165] Then there is and
[0166] The critical value of ΔC>0 is given by becomes
[0167] By the continuity of the linear system ε l , Confirm that there is η l , we analyze the continuous changes at C, that is, we have formula (42) and formula (43).
[0168]
[0169] because and is a constant and can be uniquely determined by the system linear system (non-singular). Therefore, consider C l The linear increment at can obtain the linear function of the parameter with respect to C as shown in formula (44).
[0170]
[0171] It can be determined that for a smaller increment ΔC = CC l >0, (44) still satisfies ε, The set partitioning condition remains unchanged, so the system parameters can be updated according to formula (44). However, there is a critical value that causes the original set partitioning to change under formula (44). We divide this change into two events:
[0172] Event 1: A point leaves or And add ε; that is, there is a residual y at one point i -f(x i ) changes from non-zero to 0;
[0173] Event2: an activation coefficient s j ≠0 becomes inactive, that is, s j From j >0 changes to s j =0;
[0174] The linear equation of (44) ensures that the points that have been put into ε will not come out of the set, but as ΔC increases linearly, Event1 or Event2 will definitely occur.
[0175] Therefore, enumerate all the critical points of the event, for all points The point of Event1 is calculated as shown in formula (45).
[0176] For all The point of Event2 is calculated as shown in formula (46).
[0177] The event of linear growth of ΔC will occur at the following values as early as formula (47).
[0178]
[0179] Based on ΔC, we can update the variable C l+1Given the parameters and collective state of step l, the relationship of the linear system is established. When ΔC increases, |ε| increases by 1 when Event 1 occurs, and increases by 1 when Event 2 occurs. Subtract 1 and use the new set state as the l+1 step parameter.
[0180] The critical value of Δη<0 is given by becomes
[0181] Consider the dual system γ i (i∈ε) is a linear function of η as shown in formula (49).
[0182]
[0183] The other |ε| variables can be represented by the above linear system The equation is uniquely determined because it satisfies To satisfy Condition, we need to perform "point deletion of the ε set and The point join point of the collection is used to change the state of the collection. It is divided into two events:
[0184] Event 3: A point is removed from the ε set, that is, i is placed into or In the collection;
[0185] Event4: A point is added to middle;
[0186] We let Therefore, (17) and (18) always hold when the state of the set does not change. As shown in formula (50).
[0187]
[0188] If Event4 occurs, equation (18) must be satisfied Then we have formula (51).
[0189]
[0190] The dual system provides The maximum critical value of the variation is formula (52).
[0191]
[0192] Then update η l+1 =η l +Δη and dual parameters and get ε l+1 , If Event3 occurs, |ε l+1 | Minus 1, if Event 4 occurs Add 1.
[0193] S205: construct a multi-kernel function combination based on each kernel function and the target weight corresponding to each kernel function.
[0194] By solving objective function 2, we can get the weight values corresponding to each kernel function as well as Therefore, the weight values corresponding to the above kernel functions are Substituting into formula (1), we can obtain the completed combination of multiple functions.
[0195] In addition, the objective function 1 is solved to finally obtain the optimal value of the dual parameter α express As shown in formula (17).
[0196] The optimal value of the dual parameter α as well as Substituting into formula (4), we get the complete prediction function. The prediction function is used to predict the battery status data.
[0197] The nonlinear sequence prediction algorithm predicts the battery status by performing nonlinear transformation and modeling on the time series data, and using technologies such as support vector regression. This algorithm can more accurately predict the remaining energy, chargeable capacity and health status of the battery, providing more accurate data support for the battery management system.
[0198] On the basis of the above-mentioned embodiment, the embodiment of the present application optimizes the process of "segmenting the time series state data into a plurality of subsequence state data according to the multivariate time series segmentation algorithm", such as Figure 4 As shown, the multivariate time series segmentation algorithm provided in the embodiment of the present application mainly includes the following steps S301-S305.
[0199] The multivariate time series partitioning algorithm is a method specifically for effectively partitioning time series data containing multiple variables. In the embodiment of the present application, a greedy Gaussian regularization partitioning algorithm is used to partition the time series state data into multiple subsequence state data.
[0200] S301: Divide the time series state data into a plurality of first time series segments.
[0201] The input samples are x1,…,x L , and x i ∈R d , and assuming Then the Log likelihood value of the input sample can be expressed by formula (53).
[0202]
[0203] For the problem of d>>L, that is, the number of dimensions of the input samples is much larger than the number of input samples, the PCA dimensionality reduction projection method performs SVD decomposition on the empirical covariance matrix and removes the smaller eigenvalue components to obtain Σ -1 A stable estimator is used to perform projection. In high-dimensional statistics, a classic approach is to directly -1 To make regularization restrictions, select a metric, such as the trace modulus as shown in formula (54).
[0204]
[0205] By rearranging the above formulas (53) and (54), we can obtain formula (55).
[0206]
[0207] Among them, λ≥0, other methods, such as sparse inverse constraint and sparse PCA, are common methods in high-dimensional statistics.
[0208] For a time series state data x1,…,x T ∈R d , and assume The mean μ of the Gaussian distribution is t and covariance Σ t Only at the breakpoints b1,…,b K When K<<T occurs, K split points split the time series state data into K+1 segments, that is, K+1 first time series segments are obtained. K determines the split points b1,…,b K In each first time series segment, x t is generated by the same multivariate Gaussian distribution as shown in formula (56).
[0209] μ (1) ,…,μ (K+1) ,∑ (1) ,…,∑ (K+1) (56)
[0210] Among them, the split point satisfies 1=b0 <b1<…<b K K+1 =T+1, we have formula (57).
[0211] (μ t ,∑y )=(μ (i) ,∑ (i) ),b i-1 ≤t i ,i=1,…,K(57)
[0212] The subscript t represents the serial number t in the time series, the superscript (i) represents the i-th segment, and the serial number b of the corresponding segment starting position i-1 and b i We call this model the Gaussian Segmentation Model (GSM).
[0213] The Log maximum likelihood of the regularized piecewise Gaussian problem above is as shown in formula (58).
[0214]
[0215] In GSM, i ,μ (i) ,Σ (i)} i=1,…,K+1 b=(b1,b2…b K ),μ=(μ1,μ2…μ K ),Σ=(Σ1,…,Σ K ), is ψ(b i-1 ,b i ,μ (i) ,Σ (i) ), and is abbreviated as ψ i (b,μ,Σ) or ψ i (b) As shown in formula (59).
[0216]
[0217] Optimization Objective and Model Parameters Given the hyperparameters K and λ, the optimization objective function is shown in formula (60).
[0218]
[0219] And only consider the case of λ>0, that is, Σ must be a set of positive covariances to ensure log|Σ (i) | and Tr((Σ (i) ) -1 ) is a positive number.
[0220] The effect of hyperparameters on regularized likelihood is as follows: a larger K increases the number of parameters in the model, divides the time series into more and smaller segments, and increases the model complexity. At the same time, the number of samples in each segment becomes smaller, and a larger λ is needed to shrink the inverse covariance, control the likelihood of the Gaussian distribution, and improve the estimation stability. How to use cross validation or out-of-sample Bayesian information rate to determine the values of K and λ will be introduced in the evaluation indicators below. If the same evaluation indicators can be achieved, we tend to use a smaller K (a model that is easier to explain the data) and a larger λ (a more stable parameter model).
[0221] When the values of K and λ are determined, b has We transform it into a maximization problem, as shown in formula (61).
[0222]
[0223] Optimize under given b Then we have formula (62).
[0224]
[0225] in is the empirical mean and also the estimated covariance matrix, as shown in formula (63), S (i) is the empirical covariance matrix, as shown in formula (64), To estimate the covariance matrix, as shown in formula (65).
[0226]
[0227] Note the above Due to b i -b i-1 is less than the dimension d, so it is singular, but it must be positive semidefinite, so is necessarily positive definite, satisfying λ>0. In fact, The form of the estimate is similar to the commonly used Stein-type shrinkage estimate of covariance (Ledoit & Wolf).
[0228] Given the hyperparameters K and λ, the regularized maximum likelihood GSM model maximization is transformed into a search problem for partition points, as shown in formula (66).
[0229]
[0230] Calculate the likelihood within a segment, Required 3For order operations, Cholesky decomposition can be used to reduce the computational cost of floating point calculations and determinant solutions. The following decomposition is performed, as shown in formula (67).
[0231]
[0232] S302 : For each first time series segment, use a greedy algorithm to find a first segmentation point corresponding to the first time series segment.
[0233] For each first time series segment, calculate the empirical mean μ according to the method provided above (i) and the estimated covariance matrix ∑ (i) Then, for each first time series segment, based on the empirical mean μ corresponding to the first time series segment (i) And the estimated covariance matrix ∑ corresponding to the first time series segment (i) , find the first split point corresponding to the first time series segment.
[0234] Specifically, the first time series segment is Its corresponding empirical mean μ (i) And its corresponding estimated covariance matrix Σ (i) Take the first time series segment as an example. The corresponding initial first split point is b i-1 .
[0235] First, initialize the variables, the initial split point b i-1 The empirical mean μ on the left (left) =0, initial split point b i-1 The estimated covariance matrix Σ on the left (left) =λI, initial split point b i-1 The empirical mean μ on the right (right) =μ (i) , initial split point b i-1 The estimated covariance matrix ∑ on the right side (right) =∑ (i) +λI. Maximum likelihood value v max =0, and the initial split point t max =b i-1 .
[0236] The first time series segment is For each time point t in the traversed time point t, calculate the empirical mean μ on the left side of the time point t (left) , the estimated covariance matrix ∑ on the left (left) , right side empirical mean μ (right) And the estimated covariance matrix ∑ on the right (right)Then, the likelihood difference v corresponding to time point t is calculated according to formula (68): temp .
[0237] v temp =ψ(b i-1 ,t,μ (left) ,Σ (left) )+ψ(t+1,b i ,μ (right) ,Σ (right) )(68)
[0238] Then, determine the likelihood difference v corresponding to time point t temp Is it greater than the maximum likelihood value v max , if the likelihood difference v corresponding to time point t temp Greater than the maximum likelihood value v max , then update the maximum likelihood value, that is, use v temp The value of v max . That is v max =v temp At the same time, the split point t will be updated max In other words, use time point t as the first segmentation point after the update, that is, t max =t.
[0239] For the first time series segment is At each time point t in the above process, the above process is executed. After all time points t are executed, the returned t max That is the optimal split point, and the returned likelihood difference is v max -ψ(b i-1 ,b i ,μ (i) ,Σ (i) ).
[0240] The i-th time series segment The segment likelihood is ψ(b i-1 ,b i ,μ (i) ,Σ (i) ). The subpath partitioning algorithm finds i-1 <t<b i The first division point t of the i-th time series segment is divided into two parts and The likelihood sum ψ(b i-1 ,t,μ (left) ,Σ (left) )+ψ(t+1,b i ,μ (right) ,Σ (right) )maximum.
[0241] The above steps are performed for each first time series segment to obtain multiple first segmentation points included in each first time series segment. The multiple first segmentation points included in all first time series segments are aggregated to obtain a first segmentation point set.
[0242] S303: Optimize each second segmentation point in the second segmentation point set based on the time series state data to obtain a target segmentation point set.
[0243] In a possible implementation, for each first split point in the first split point set, based on the left time series segment and the right time series segment corresponding to the current first split point, the estimated mean and the estimated covariance corresponding to the current first split point are calculated; based on the estimated mean and the estimated covariance, a second split point is found between the previous first split point and the next first split point; if the second split point is different from the current first split point, the current first split point is replaced by the second split point; if the second split point is the same as the current first split point, the current first split point is retained; until all the first split points in the first split point set are traversed, the updated first split point set is used as the second split point set.
[0244] The time for the algorithm to adjust the first split point is Td 3 The algorithm is recorded as AdjustBreakpoints(x1,…,x T ,b,μ,∑). The algorithm adjusts the partition sequence based on the current time series segment b, improves the likelihood target or keeps it unchanged, and loops until 1-OPT is satisfied.
[0245] Among them, the 1-OPT property partition is defined as the sequence partition of the objective function cannot be improved by changing (moving and adding) any partition point.
[0246] Specifically, the input data of the above algorithm includes time series state data x1,…,x T , the first split point set b, the estimated mean set μ corresponding to the time series segment after the first split point split, and the estimated covariance set ∑ corresponding to the time series segment after the first split point split.
[0247] For each first split point bi in the first split point set b (a total of K optimal split points), perform the following steps:
[0248] Get the first split point bi-1 on the left side and the first split point bi+1 on the right side of the current first split point bi. Read the time series segment between the first split point bi-1 on the left side and the first split point bi+1 on the right side, and calculate the estimated mean of the time series segment and the estimated covariance
[0249] Call the split function Split, input the time series segment between the first split point bi-1 on the left and the first split point bi+1 on the right, and the estimated mean and the estimated covariance The splitting function Split attempts to find a second split point ti and the corresponding maximum likelihood value vi in this time series segment based on the above input data.
[0250] If the second split point ti returned by the Split function is different from the current first split point bi, the second split point ti is determined to be the optimal split point, that is, in the first split point set, the first split point bi is deleted and the second split point ti is added. If the second split point ti returned by the Split function is the same as the current first split point bi, the current first split point bi is determined to be the optimal split point, that is, in the first split point set, the first split point bi is retained.
[0251] After performing the above adjustment on each first segmentation point in the first segmentation point set, a second segmentation point set b is output.
[0252] S304: Optimize each second segmentation point in the second segmentation point set based on the time series state data to obtain a target segmentation point set.
[0253] In the embodiment of the present application, a greedy Gaussian partitioning algorithm is used to optimize each second split point. Each cycle of the greedy Gaussian partitioning algorithm is divided into two parts: AddNewBreakpoint (Add step) and AdjustBreakpoints (Adjust step). Among them, the Add step can be calculated in parallel. The Add step sequentially traverses all time series segments on the basis of the original divided time series segment b, finds a new split point that improves the objective function, splits the time series segment into two and re-marks the sequence number of b. The Adjust step sequentially traverses all adjacent time series segments on the basis of the divided time series segment b, finds the optimal split point for two adjacent time series segments and replaces the original split point. The Adjust step will be cycled multiple times until it stabilizes. Therefore, the partition b that meets the exit condition of the Add step must satisfy the 1-OPT property, and neither a new split point can be added nor a split point can be moved to improve the objective function.
[0254] In a possible implementation, each second split point in the second split point set is optimized based on the time series state data to obtain a target split point set, including: traversing the second split points in the second split point set, and finding a third split point in the left time series segment corresponding to the current second split point; calculating the likelihood difference corresponding to the third split point; if the likelihood difference corresponding to the third split point is greater than a set value, adding the third split point to the second split point set, and updating the sequence number of each split point in the second split point set; until the second split points in the second split point set are traversed, the sequence number of each split point in the second split point set is updated. The second split point set after the current third split point is used as the third split point set; the third split points in the third split point set are traversed, and a fourth split point is found in the left time series segment and the right time series segment of the current third split point; the likelihood difference corresponding to the fourth split point is calculated; if the likelihood difference corresponding to the fourth split point is greater than the set value, the fourth split point replaces the current third split point; if the likelihood difference corresponding to the fourth split point is less than or equal to the set value, the current third split point is retained; until the third split points in the third split point set are traversed, the updated third split point set is used as the target split point set.
[0255] In the embodiment of the present application, the hyperparameter K is specified max , that is, the maximum number of split points. The GGS algorithm gives the value that satisfies K=1,…,K max The solution is stopped until the solution satisfies the 1-OPT property. Obviously, b0≤b1≤…≤b K ≤ b K+1 The solution must satisfy the 1-OPT property, but the solution that satisfies the 1-OPT property is not necessarily the optimal solution.
[0256] Specifically, the input data of the above greedy Gaussian partitioning algorithm includes time series state data x1,…,x T , hyperparameter K max And the greedy Gaussian partitioning algorithm is initialized, and the second segmentation points b0=1 and b1=T+1 are set, indicating that the entire time series is a single segment, and the target segmentation point set b is initialized to empty.
[0257] For each second dividing point bi in the second dividing point set, the following steps are performed: obtain the second dividing point bi-1 on the left side of the current second dividing point bi, obtain the time series segment between the second dividing point bi-1 on the left side and the current second dividing point bi, and calculate the estimated mean μ(i) and estimated covariance Σ(i) corresponding to the time series segment. Call the splitting function Split, input the time series segment between the second dividing point bi-1 on the left side and the current second dividing point bi, as well as the corresponding estimated mean μ(i) and estimated covariance Σ(i). The splitting function Split attempts to find an optimal dividing point ti and the corresponding maximum likelihood value vi in the time series segment between the second dividing point bi-1 on the left side and the current second dividing point bi.
[0258] If all calculated maximum likelihood values vi are negative and K>0, the second segmentation point set is used as the third segmentation point set.
[0259] If all calculated maximum likelihood values vi are positive, all segmentation points ti whose maximum likelihood values vi are positive are taken as second segmentation points and added to the second segmentation point set, and the processed second segmentation point set is taken as the third segmentation point set.
[0260] For each third segmentation point bi in the third segmentation point set b, perform the following steps:
[0261] Get the third dividing point bi-1 on the left and the third dividing point bi+1 on the right of the current third dividing point bi. Read the time series segment between the third dividing point bi-1 on the left and the third dividing point bi+1 on the right, and calculate the estimated mean of the time series segment. and the estimated covariance
[0262] Call the split function Split, input the time series segment between the third split point bi-1 on the left and the third split point bi+1 on the right, and the estimated mean and the estimated covariance The splitting function Split attempts to find a fourth split point ti and the corresponding maximum likelihood value vi in this time series segment based on the above input data.
[0263] If the fourth split point ti returned by the Split function is different from the current third split point bi, the fourth split point ti is determined to be the optimal split point, that is, in the third split point set, the third split point bi is deleted and the fourth split point ti is added. If the fourth split point ti returned by the Split function is the same as the current third split point bi, the current third split point bi is determined to be the optimal split point, that is, in the third split point set, the third split point bi is retained.
[0264] After performing the above adjustment on each third segmentation point in the third segmentation point set, a target segmentation point set b is output.
[0265] S405: Divide the time series state data into a plurality of sub-sequence state data using a target segmentation point set.
[0266] After determining the target segmentation point set according to the above steps, call the splitting function Split, input the target segmentation point set and the time series state data, and segment the time series state data into multiple sub-sequence state data.
[0267] The multivariate time series partitioning algorithm uses the characteristics of time series data to divide the sequence into multiple segments, and uses the Gaussian distribution model to model and detect anomalies in each segment. This algorithm can more accurately capture the changing trends and abnormal behaviors of the battery status, providing a more reliable monitoring method for the battery management system.
[0268] Figure 5 Schematic diagram of the structure of a battery time series anomaly detection device in an embodiment of the present application. Figure 5 As shown, the battery time series anomaly detection device 50 provided in the embodiment of the present application mainly includes: a first data acquisition module 51, a first data segmentation module 52, a second data acquisition module 53, a multi-core function determination module 54 and a state data prediction module 55.
[0269] Among them, the first data acquisition module 51 is used to obtain the time series state data of the battery to be detected; the first data segmentation module 52 is used to segment the time series state data into multiple sub-sequence state data according to the multivariate time series segmentation algorithm, wherein the sub-sequence state data corresponds to a time interval; the second data acquisition module 53 is used to obtain multiple discrete state data within the time interval for each time interval; the multi-core function determination module 54 is used to determine the corresponding multi-core function combination based on the sub-sequence state data and the multiple discrete state data; the state data prediction module 55 is used to predict the state data of the battery to be detected using the selected multi-core function combination.
[0270] In one possible implementation, the multi-kernel function determination module 54 is used to select the kernel functions corresponding to the subsequence state data and each of the discrete state data; construct an initial multi-kernel function combination based on each of the kernel functions; determine the target problem of the multi-kernel function combination; solve the target problem to obtain the target weights corresponding to each of the kernel functions; and construct a multi-kernel function combination based on each of the kernel functions and the target weights corresponding to each of the kernel functions.
[0271] In a possible implementation, the target problem includes a target optimization function and constraints: wherein the target optimization function is expressed by the following formula:
[0272]
[0273] The constraint condition is expressed by the following formula:
[0274]
[0275] s j ≥0,j=1,…,m;
[0276]
[0277] Where n represents the number of input samples, i represents the sequence number of the input sample, and x i represents the i-th input sample, m represents the total number of kernel functions, j represents the sequence number of the kernel function, s j represents the weight value of the jth kernel function, Φ j (x i ) represents the feature vector of the i-th input sample mapped to the high-dimensional space, and represents two slack variables; C is the regularization parameter, β0 represents the intercept estimate of the nonlinear model, β j Represents the intercept estimate of the j-th kernel function.
[0278] In a possible implementation, the state data prediction module 55 is specifically used to determine the state data of the battery to be detected by using the selected multi-core function combination and the prediction function, wherein the prediction function is represented by the following formula:
[0279]
[0280] in,
[0281] Where n represents the number of input samples, i represents the serial number of the input sample, xi represents the i-th input sample, m represents the total number of kernel functions, j represents the serial number of the kernel function, s j represents the weight value of the j-th kernel function, x represents input data, and the input data includes subsequence state data or each discrete state data, represents the predicted state data corresponding to the jth kernel function, Φ j (x) represents the feature vector mapped from the input data x to the high-dimensional space, K j (x i ,x) represents the jth kernel function calculation input sample x i and the kernel value between the input data x represents the optimal solution of the dual parameter corresponding to the i-th sample, λ represents the regularization parameter, represents the matrix of optimized intercept estimates.
[0282] In a possible implementation, the first data segmentation module 52 is used to segment the time series state data into multiple first time series segments; for each first time series segment, a greedy algorithm is used to find the first segmentation point corresponding to the first time series segment; based on the time series state data and the first segmentation point set, each first segmentation point is adjusted to obtain a second segmentation point set, wherein the first segmentation point set includes multiple first segmentation points; based on the time series state data, each second segmentation point in the second segmentation point set is optimized to obtain a target segmentation point set; and the time series state data is segmented into multiple subsequence state data using the target segmentation point set.
[0283] In a possible implementation, the first data segmentation module 52 is specifically used to calculate, for each first segmentation point in the first segmentation point set, an estimated mean and an estimated covariance corresponding to the current first segmentation point based on the left time series segment and the right time series segment corresponding to the current first segmentation point; based on the estimated mean and the estimated covariance, find a second segmentation point between the previous first segmentation point and the next first segmentation point; if the second segmentation point is different from the current first segmentation point, use the second segmentation point to replace the current first segmentation point; if the second segmentation point is the same as the current first segmentation point, retain the current first segmentation point; until all the first segmentation points in the first segmentation point set are traversed, the updated first segmentation point set is used as the second segmentation point set.
[0284] In a possible implementation, the first data segmentation module 52 is specifically configured to traverse the second segmentation points in the second segmentation point set, search for a third segmentation point in the left time series segment corresponding to the current second segmentation point, calculate the likelihood difference corresponding to the third segmentation point, and if the likelihood difference corresponding to the third segmentation point is greater than a set value, add the third segmentation point to the second segmentation point set, and update the sequence number of each segmentation point in the second segmentation point set; until the second segmentation points in the second segmentation point set are traversed, the updated second segmentation point set is used as the third segmentation point. a target segmentation point set; traversing the third segmentation points in the third segmentation point set, and searching for a fourth segmentation point in the left time series segment and the right time series segment of the current third segmentation point; calculating the likelihood difference corresponding to the fourth segmentation point; if the likelihood difference corresponding to the fourth segmentation point is greater than a set value, replacing the current third segmentation point with the fourth segmentation point; if the likelihood difference corresponding to the fourth segmentation point is less than or equal to the set value, retaining the current third segmentation point; until the third segmentation points in the third segmentation point set are traversed, the updated third segmentation point set is used as the target segmentation point set.
[0285] The battery time series anomaly detection device provided in the embodiment of the present application can execute the battery time series anomaly detection method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0286] Figure 6 Schematic diagram of the structure of a battery time series anomaly detection device provided in this embodiment. Figure 6 As shown, the battery time series abnormality detection device 600 includes a processor 610, a memory 620, an input device 630 and an output device 640; the number of processors 610 in the electronic device can be one or more. Figure 6 A processor 610 is taken as an example; the processor 610, the memory 620, the input device 630 and the output device 640 in the electronic device can be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.
[0287] The memory 620 is a computer-readable storage medium that can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the battery time series anomaly detection method in the embodiment of the present invention. The processor 610 executes various functional applications and data processing of the electronic device by running the software programs, instructions and modules stored in the memory 620, that is, the battery time series anomaly detection method provided in the embodiment of the present invention is implemented.
[0288] The memory 620 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 620 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 620 may further include a memory remotely arranged relative to the processor 610, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0289] The input device 630 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the electronic device, and may include a keyboard, a mouse, etc. The output device 640 may include a display device such as a display screen.
[0290] This embodiment also provides a storage medium containing computer executable instructions, which, when executed by a computer processor, are used to implement the battery time series anomaly detection method provided in the embodiment of the present invention.
[0291] Of course, the computer executable instructions of a storage medium including computer executable instructions provided in an embodiment of the present invention are not limited to the operations of the method described above, and can also execute related operations in the battery time series anomaly detection method provided in any embodiment of the present invention.
[0292] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0293] It is worth noting that in the embodiment of the above-mentioned battery time series anomaly detection device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0294] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0295] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A battery time series anomaly detection method, characterized in that: The method comprises: Obtain time series status data of the battery to be tested; Divide the time series state data into a plurality of subsequence state data according to a multivariate time series segmentation algorithm, wherein the subsequence state data corresponds to a time interval; For each of the time intervals, obtaining a plurality of discrete state data within the time interval; Determine a corresponding multi-kernel function combination based on the subsequence state data and the plurality of discrete state data; The multi-core function combination is used to predict the state data of the battery to be detected.
2. The method according to claim 1, characterized in that Determining a corresponding multi-kernel function combination based on the subsequence state data and the plurality of discrete state data includes: Selecting the subsequence state data and the kernel function corresponding to each of the discrete state data; Constructing an initial multi-kernel function combination based on each of the kernel functions; Determining a target problem of the multi-core function combination; Solving the target problem to obtain target weights corresponding to each kernel function; A multi-kernel function combination is constructed based on each of the kernel functions and the target weights corresponding to each of the kernel functions.
3. The method according to claim 2, characterized in that The target problem includes the target optimization function and constraints: The objective optimization function is expressed by the following formula: The constraint condition is expressed by the following formula: s j ≥0,j=1,…,m; Where n represents the number of input samples, i represents the sequence number of the input sample, and x i represents the i-th input sample, m represents the total number of kernel functions, j represents the sequence number of the kernel function, s j represents the weight value of the jth kernel function, Φ j (x i ) represents the feature vector of the i-th input sample mapped to the high-dimensional space, and represents two slack variables; C is the regularization parameter, β0 represents the intercept estimate of the nonlinear model, β j Represents the intercept estimate of the j-th kernel function.
4. The method according to claim 3, characterized in that The state data of the battery to be detected is predicted by using the selected multi-core function combination, including: The state data of the battery to be detected is determined by using the selected multi-core function combination and the prediction function, wherein the prediction function is represented by the following formula: in, Where n represents the number of input samples, i represents the serial number of the input sample, xi represents the i-th input sample, m represents the total number of kernel functions, j represents the serial number of the kernel function, s j represents the weight value of the j-th kernel function, x represents input data, and the input data includes subsequence state data or each discrete state data, represents the predicted state data corresponding to the jth kernel function, Φ j (x) represents the feature vector mapped from the input data x to the high-dimensional space, K j (x i ,x) represents the jth kernel function calculation input sample x i and the kernel value between the input data x represents the optimal solution of the dual parameter corresponding to the i-th sample, λ represents the regularization parameter, represents the matrix of optimized intercept estimates.
5. The method according to claim 1, characterized in that: The time series state data is divided into a plurality of subsequence state data according to a multivariate time series segmentation algorithm, including: dividing the time series state data into a plurality of first time series segments; For each first time series segment, a greedy algorithm is used to find a first split point corresponding to the first time series segment; Adjust each first segmentation point based on the time series state data and the first segmentation point set to obtain a second segmentation point set, wherein the first segmentation point set includes a plurality of first segmentation points; Optimizing each second segmentation point in the second segmentation point set based on the time series state data to obtain a target segmentation point set; The time series state data is divided into a plurality of sub-sequence state data using the target segmentation point set.
6. The method according to claim 5, characterized in that Each first segmentation point is adjusted based on the time series state data and the first segmentation point set to obtain a second segmentation point set, including: For each first segmentation point in the first segmentation point set, based on the left time series segment and the right time series segment corresponding to the current first segmentation point, calculate the estimated mean and the estimated covariance corresponding to the current first segmentation point; Finding a second split point between a previous first split point and a subsequent first split point based on the estimated mean and the estimated covariance; If the second segmentation point is different from the current first segmentation point, replacing the current first segmentation point with the second segmentation point; If the second segmentation point is the same as the current first segmentation point, retaining the current first segmentation point; After all the first segmentation points in the first segmentation point set are traversed, the updated first segmentation point set is used as the second segmentation point set.
7. The method according to claim 5, characterized in that Optimizing each second segmentation point in the second segmentation point set based on the time series state data to obtain a target segmentation point set includes: Traversing the second split points in the second split point set, and searching for a third split point in the left time series segment corresponding to the current second split point; Calculating the likelihood difference corresponding to the third segmentation point; If the likelihood difference corresponding to the third segmentation point is greater than a set value, the third segmentation point is added to the second segmentation point set, and the sequence numbers of the segmentation points in the second segmentation point set are updated; After the second split point set in the second split point set is traversed completely, the updated second split point set is used as the third split point set; Traversing the third segmentation points in the third segmentation point set, and searching for a fourth segmentation point in the left time series segment and the right time series segment of the current third segmentation point; Calculating the likelihood difference corresponding to the fourth segmentation point; If the likelihood difference corresponding to the fourth segmentation point is greater than a set value, the fourth segmentation point replaces the current third segmentation point; If the likelihood difference corresponding to the fourth segmentation point is less than or equal to the set value, retaining the current third segmentation point; After the third segmentation points in the third segmentation point set are traversed completely, the updated third segmentation point set is used as the target segmentation point set.
8. A battery time series anomaly detection device, characterized in that: The device comprises: A first data acquisition module, used to acquire time series status data of the battery to be detected; A first data segmentation module, used for segmenting the time series state data into a plurality of subsequence state data according to a multivariate time series segmentation algorithm, wherein the subsequence state data corresponds to a time interval; A second data acquisition module, used for acquiring, for each of the time intervals, a plurality of discrete state data within the time interval; A multi-core function determination module, used to determine a corresponding multi-core function combination based on the subsequence state data and the plurality of discrete state data; The state data prediction module is used to predict the state data of the battery to be detected by using the selected multi-core function combination.
9. A battery time series anomaly detection device, characterized in that: The device comprises: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the battery time series anomaly detection method as described in any one of claims 1 to 7.
10. A storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the battery time series anomaly detection method as described in any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Method, device and equipment for determining state of charge of battery and readable storage medium
CN120370183A
