An energy storage cabinet with temperature detection and alarm function
By using the moving average algorithm of adaptive window and adaptive weights in the temperature detection and alarm system of the energy storage cabinet, the problems of noise increase and information lag caused by the increase in data volume in the prior art are solved, and a more accurate temperature abnormality warning is achieved.
Patent Information
- Application Number
- CN202411897109.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-12-23
AI Technical Summary
In the multi-point temperature detection and warning function of existing energy storage cabinets, the increase in data volume leads to an increase in noise data. Fixed-sized windows cannot respond to rapid changes in data in a timely manner, resulting in information lag or trend information loss. The fixed weight fails to consider the importance of data, and is easily disturbed by noise data, resulting in inaccurate temperature abnormality warning.
Adaptive window and moving average algorithm of adaptive weights are used to build a sliding window of preset size and dynamically adjust the window length according to the change speed and degree of dispersion of temperature data to obtain the adaptive window. At the same time, the data sequence to be fitted is filtered according to the data change trend and Spearman correlation coefficient, and fitted to obtain the adaptive weight, and then the temperature data is weighted and averaged.
It improves the accuracy of temperature abnormality warning of energy storage cabinets, can handle the increase in data volume more effectively, avoid information lag and trend loss, and optimizes fixed weights through adaptive weights to reduce interference from noise data.
Smart Images

Figure CN119360586B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to an energy storage cabinet with a temperature detection and alarm function. Background Art
[0002] The power quality and reliability of power supply in the distribution area have a direct impact on the normal production and life of residents. In order to respond to national policies and solve pain points such as poor power supply quality and the increase of new loads, an outdoor energy storage cabinet for energy storage in the distribution area is proposed. Since the temperature management of the energy storage cabinet is crucial to ensure the safety, efficiency and life of the battery system, an energy storage cabinet with temperature detection and alarm function is proposed. Since the battery generates heat during the charging and discharging process, if the heat is not effectively dissipated, the battery temperature may be too high, causing safety problems such as capacity attenuation, shortened life, and even thermal runaway. Therefore, it is necessary to detect the temperature of the energy storage cabinet in real time and give early warning to prevent risks such as thermal runaway.
[0003] The traditional method uses a fixed-size window and a fixed-weight moving average algorithm to smooth the temperature data, obtain the prediction results based on the processed data, and then issue an abnormal warning for the temperature of the energy storage cabinet. The algorithm has a simple calculation method, fast calculation speed, and can remove the random noise of the data, making the temperature trend clearer and quickly obtaining the prediction results. However, in order to solve the pain point problem of energy storage in the substation, the existing energy storage cabinet combines the Internet of Things technology to realize the multi-point temperature detection and warning function, resulting in an increase in data points, and the increase in data volume may lead to an increase in noise data. The fixed-size window may not be able to respond to the rapid changes in data in a timely manner, resulting in information lag or loss of trend information; at the same time, the fixed weight does not take into account the importance of the data, and may be interfered by the noise data, causing the data to deviate from the real data development trend, and thus unable to obtain accurate abnormal warnings for the temperature of the energy storage cabinet.
[0004] Therefore, how to optimize the moving average algorithm to improve the accuracy of abnormal warning of the temperature of the energy storage cabinet has become an urgent problem to be solved. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides an energy storage cabinet with a temperature detection and alarm function to solve the problem of how to optimize the moving average algorithm to improve the accuracy of abnormal warning of the temperature of the energy storage cabinet.
[0006] An embodiment of the present invention provides an energy storage cabinet with a temperature detection alarm function, including a cabinet body, wherein a temperature detection alarm system is provided inside the cabinet body, and the temperature detection alarm system includes:
[0007] A data acquisition module, used to collect temperature data of a sensor at any position in the energy storage cabinet to obtain a temperature data sequence, and in the process of smoothing the temperature data sequence using a moving average algorithm, construct a sliding window of a preset size, and obtain at least one adaptive window in the temperature data sequence according to the change speed and discreteness of the temperature data in the sliding window;
[0008] A data fitting module, for obtaining, for any adaptive window, a data sequence to be fitted corresponding to the adaptive window according to the position of the adaptive window in the temperature data sequence and the data change trend in the adaptive window;
[0009] A weight acquisition module is used to fit the data sequence to be fitted to obtain fitting data corresponding to each temperature data in the adaptive window, and obtain an adaptive weight of each temperature data in the adaptive window according to the difference between each temperature data in the adaptive window and the corresponding fitting data;
[0010] The data prediction module is used to obtain the weighted average of the last temperature data in the adaptive window according to the adaptive weight of each temperature data in the adaptive window, form a smoothed data sequence with the weighted average of the last temperature data in each of the adaptive windows, and issue an abnormal warning for the temperature of the energy storage cabinet according to the smoothed data sequence.
[0011] Furthermore, the data acquisition module obtains at least one adaptive window in the temperature data sequence according to the change speed and discreteness of the temperature data in the sliding window, including:
[0012] The sliding window contains the first temperature data in the temperature data sequence, performs a first-order difference operation on each temperature data in the sliding window to obtain a difference sequence of the sliding window, linearly normalizes the absolute value of each difference value in the difference sequence of the sliding window to obtain a corresponding normalized difference value, calculates the mean of all normalized difference values, and obtains the data change speed of the sliding window;
[0013] According to a preset hysteresis number range and each temperature data in the sliding window, the data discreteness of the sliding window is obtained;
[0014] Calculate the mean of the data change speed and the data discreteness, subtract the mean from a constant 1 to obtain a data stability index of the sliding window, and adjust the length of the sliding window according to the data stability index to obtain an adaptive window;
[0015] The sliding window is moved according to a preset sliding step length until the adaptive window contains the last temperature data in the temperature data sequence, thereby obtaining at least one adaptive window in the temperature data sequence.
[0016] Furthermore, the data acquisition module obtains the data discreteness of the sliding window according to the preset hysteresis number range and each temperature data in the sliding window, including:
[0017] For any hysteresis number in the preset hysteresis number range, subtract the hysteresis number from the number of all temperature data in the sliding window to obtain a target number, and construct a first hysteresis sliding window in the sliding window, wherein the number of all temperature data included in the first hysteresis sliding window is the target number, and the first hysteresis sliding window includes the first temperature data in the sliding window;
[0018] The temperature data contained in the first hysteresis sliding window is formed into a first subsequence, the hysteresis number is used as a sliding step, the first hysteresis sliding window is moved to obtain a second hysteresis sliding window, and the temperature data contained in the second hysteresis sliding window is formed into a second subsequence;
[0019] The interquartile ranges of the first subsequence and the second subsequence are calculated respectively to obtain an average value of the interquartile ranges, the average value of the interquartile ranges is linearly normalized to obtain a target interquartile range corresponding to the lag number, the average value of the target interquartile ranges corresponding to all lag numbers in the preset lag number range is calculated to obtain the data discreteness of the sliding window.
[0020] Furthermore, the data acquisition module adjusts the length of the sliding window according to the data stability index to obtain an adaptive window, including:
[0021] If the data stability index is less than the minimum value in the preset data stability index threshold range, subtract the data stability index from the minimum value to obtain a first difference index, round down the product of the first difference index and the preset length adjustment threshold to obtain a first target value, increase the length of the sliding window by the first target value to obtain an adaptive window;
[0022] If the data stability index is greater than the maximum value in the preset data stability index threshold range, subtract the maximum value from the data stability index to obtain a second difference index, round down the product of the second difference index and the preset length adjustment threshold to obtain a second target value, and reduce the length of the sliding window by the second target value to obtain an adaptive window;
[0023] If the data stability index is within the preset data stability index threshold range, the sliding window is used as an adaptive window.
[0024] Furthermore, the data fitting module obtains the to-be-fitted data sequence corresponding to the adaptive window according to the position of the adaptive window in the temperature data sequence and the data change trend in the adaptive window, including:
[0025] If the adaptive window is the first adaptive window in the temperature data sequence, all temperature data in the adaptive window are combined into a data sequence to be fitted;
[0026] If the adaptive window is not the first adaptive window in the temperature data sequence, then obtaining the previous adaptive window of the adaptive window, and obtaining a change trend similarity index according to the Spearman correlation coefficient between the differential sequence of the adaptive window and the differential sequence of the previous adaptive window;
[0027] If the variation trend similarity index is greater than or equal to a preset similarity threshold, all temperature data contained in the adaptive window are combined into a data sequence to be fitted;
[0028] If the variation trend similarity index is less than the preset similarity threshold, all temperature data contained in the adaptive window and the previous adaptive window are combined into a data sequence to be fitted.
[0029] Furthermore, the weight acquisition module fits the data sequence to be fitted to obtain fitting data corresponding to each temperature data in the adaptive window, including:
[0030] Obtaining a difference sequence of the data sequence to be fitted to obtain a target difference sequence, calculating the average of all difference values in the target difference sequence to obtain a difference sequence mean, and for any difference value in the target difference sequence, calculating the absolute value of the difference between the difference value and the difference sequence mean to obtain an abnormal coefficient of the difference value;
[0031] Calculate the ratio between the abnormal coefficient and the mean of the difference sequence to obtain the degree of abnormality of the difference value, and obtain the abnormal data in the data sequence to be fitted according to the degree of abnormality of each difference value in the target difference sequence;
[0032] The average value between the left adjacent data and the right adjacent data of each abnormal data is assigned to the corresponding abnormal data to obtain a new data sequence to be fitted, and a straight line fitting is performed on the temperature data in the new data sequence to be fitted to obtain the fitting data corresponding to each temperature data in the adaptive window.
[0033] Furthermore, the weight acquisition module obtains abnormal data in the to-be-fitted data sequence according to the abnormality degree of each differential value in the target differential sequence, including:
[0034] For any difference value in the target difference sequence, if the abnormality of the difference value is greater than or equal to a preset abnormality threshold, the previous difference value of the difference value is obtained; if the abnormality of the previous difference value is less than the preset abnormality threshold, the latter of the two data to be fitted corresponding to the difference value is abnormal data;
[0035] If the abnormality degree of the previous difference value is greater than or equal to the preset abnormality degree threshold, the previous data to be fitted of the two data to be fitted corresponding to the difference value is abnormal data.
[0036] Furthermore, the weight acquisition module obtains the adaptive weight of each temperature data in the adaptive window according to the difference between each temperature data in the adaptive window and the corresponding fitting data, including:
[0037] Calculate the absolute value of the difference between each temperature data in the adaptive window and the corresponding fitting data to obtain a fitting difference index, and obtain a fitting difference index cumulative value of all fitting difference indexes;
[0038] For any temperature data in the adaptive window, the temperature data is taken as the target temperature data, and the ratio between the accumulated value of the fitting difference index and the fitting difference index corresponding to the target temperature data is linearly normalized to obtain the adaptive weight of the target temperature data.
[0039] Furthermore, the data prediction module performs abnormal warning on the temperature of the energy storage cabinet according to the smoothed data sequence, including:
[0040] Obtain a first-order difference sequence of the smoothed data sequence, use the average of the lengths of all adaptive windows as the period number for predicting the first-order difference sequence using the average moving average algorithm, and obtain a moving average value sequence corresponding to the first-order difference sequence;
[0041] The last data in the moving average sequence is added to the weighted average corresponding to the last temperature data in the temperature data sequence to obtain a predicted temperature. If the predicted temperature is greater than or equal to a preset alarm temperature, an abnormal temperature warning is issued for the energy storage cabinet.
[0042] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0043] The present invention provides an energy storage cabinet with a temperature detection and alarm function, comprising a cabinet body, wherein a temperature detection and alarm system is arranged inside the cabinet body, and the temperature detection and alarm system comprises: a data acquisition module, which is used to acquire temperature data of a sensor at any position in the energy storage cabinet to obtain a temperature data sequence, and in the process of smoothing the temperature data sequence by using a moving average algorithm, a sliding window of a preset size is constructed, and at least one adaptive window in the temperature data sequence is obtained according to the change speed and discrete degree of the temperature data in the sliding window; a data fitting module, which is used to obtain, for any adaptive window, a temperature data sequence according to the position of the adaptive window in the temperature data sequence and the data change trend in the adaptive window to the data sequence to be fitted corresponding to the adaptive window; a weight acquisition module, used to fit the data sequence to be fitted, obtain the fitting data corresponding to each temperature data in the adaptive window, and obtain the adaptive weight of each temperature data in the adaptive window according to the difference between each temperature data in the adaptive window and the corresponding fitting data; a data prediction module, used to obtain the weighted average value of the last temperature data in the adaptive window according to the adaptive weight of each temperature data in the adaptive window, form a smoothed data sequence with the weighted average value of the last temperature data in each of the adaptive windows, and issue an abnormal warning for the temperature of the energy storage cabinet according to the smoothed data sequence. Among them, a sliding window of a preset size is constructed in the temperature data sequence, and the length of the sliding window is adjusted according to the change speed and discreteness of the temperature data in the sliding window to obtain an adaptive window, and the fixed window in the average moving algorithm is optimized. Further, the data sequence to be fitted is obtained according to the data change trend in the adaptive window, and the data (abnormal data) that does not meet the change trend in the data sequence to be fitted is adjusted, and the adjusted data sequence to be fitted is fitted to achieve a better fitting effect. According to the fitting result, an adaptive weight is given to the temperature data, and the fixed weight in the average moving algorithm is optimized. Then, the temperature data sequence is smoothed according to the optimized average moving algorithm, and an abnormal warning is given to the temperature of the energy storage cabinet according to the smoothed data, so as to improve the accuracy of the abnormal warning of the temperature of the energy storage cabinet. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0045] Figure 1It is a structural block diagram of a temperature detection alarm system for an energy storage cabinet provided in Embodiment 1 of the present invention. DETAILED DESCRIPTION
[0046] Embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, but should not be understood as limiting the present disclosure.
[0047] It should be noted that the terms "first", "second", etc. in the specification of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure.
[0048] In order to illustrate the technical solution of the present invention, specific embodiments are provided below for illustration.
[0049] In the embodiment of the present invention, it is considered that the temperature management of the energy storage cabinet is crucial to ensure the safety, efficiency and life of the battery system. Therefore, an energy storage cabinet with a temperature detection alarm function is proposed. The energy storage cabinet includes a cabinet body with an opening on one side, and at least one cabinet door is movably connected to the cabinet body opening side. A temperature detection alarm system is arranged inside the cabinet body, and is used to send an alarm signal to the alarm device when an abnormal temperature warning occurs in the energy storage cabinet. An alarm device connected to the temperature detection alarm system is arranged on the cabinet door, and is used to receive the alarm signal sent by the temperature detection alarm system and send an alarm sound. For the temperature detection alarm system, see Figure 1 , is a structural block diagram of a temperature detection alarm system for an energy storage cabinet provided in Embodiment 1 of the present invention, such as Figure 1 As shown, the system includes:
[0050] The data acquisition module 11 is used to collect temperature data of a sensor at any position in the energy storage cabinet to obtain a temperature data sequence. In the process of smoothing the temperature data sequence using a moving average algorithm, a sliding window of a preset size is constructed, and at least one adaptive window in the temperature data sequence is obtained according to the change speed and discreteness of the temperature data in the sliding window.
[0051] For sensors at different positions in the energy storage cabinet, such as battery cells, gaps between battery modules, cooling pipes, battery management systems, energy storage cabins, mobile cooling components, etc., collect temperature data from sensors at any position to obtain a temperature data sequence, and set the length of the sliding window to 10. There is no restriction here, and the implementer can set it according to the implementation scenario. Construct a sliding window of length 10 in the temperature data sequence. In the process of smoothing the temperature data sequence using the moving average algorithm, a sliding window that is too large will cause the loss of trend information, and a sliding window that is too small will be too sensitive to random noise, causing the data to be disturbed by noise and deviate from the real data change trend. Therefore, it is necessary to optimize the fixed window in the moving average algorithm, dynamically adjust the size of the sliding window, and obtain all adaptive windows in the temperature data sequence. The adaptive window is obtained as follows:
[0052] (1) Obtain the data change rate in the sliding window.
[0053] Specifically, the sliding window contains the first temperature data in the temperature data sequence, and a first-order difference operation is performed on each temperature data in the sliding window to obtain the difference sequence of the sliding window. The absolute value of each difference value in the difference sequence of the sliding window is linearly normalized to obtain the corresponding normalized difference value, and the mean of all normalized difference values is calculated to obtain the data change speed of the sliding window.
[0054] In one embodiment, the calculation formula for the data change speed of the sliding window is:
[0055]
[0056] Where D represents the data change speed of the sliding window, n represents the number of all temperature data contained in the sliding window, represents the i-th temperature data in the sliding window, represents the i-1th temperature data in the sliding window, represents the linear normalization function, Represents the absolute value symbol.
[0057] It should be noted that That is the normalized difference value. The larger the normalized difference value, the faster the temperature data changes and the more obvious the fluctuation. Therefore, the larger the value of D is, the more unstable the change of temperature data in the sliding window is.
[0058] (2) According to a preset hysteresis number range and each temperature data in the sliding window, the data discreteness of the sliding window is obtained.
[0059] Specifically, for any hysteresis number in the preset hysteresis number range, the number of all temperature data in the sliding window is subtracted from the hysteresis number to obtain a target number, and a first hysteresis sliding window is constructed in the sliding window, wherein the number of all temperature data included in the first hysteresis sliding window is the target number, and the first hysteresis sliding window includes the first temperature data in the sliding window;
[0060] The temperature data contained in the first hysteresis sliding window is formed into a first subsequence, the hysteresis number is used as a sliding step, the first hysteresis sliding window is moved to obtain a second hysteresis sliding window, and the temperature data contained in the second hysteresis sliding window is formed into a second subsequence;
[0061] The interquartile ranges of the first subsequence and the second subsequence are calculated respectively to obtain an average value of the interquartile ranges, the average value of the interquartile ranges is linearly normalized to obtain a target interquartile range corresponding to the lag number, the average value of the target interquartile ranges corresponding to all lag numbers in the preset lag number range is calculated to obtain the data discreteness of the sliding window.
[0062] In one embodiment, the calculation formula for the data discreteness of the sliding window is:
[0063]
[0064] Among them, F represents the data discreteness of the sliding window, n represents the number of all temperature data contained in the sliding window, represents the average of the interquartile range when the lag number is j, represents the linear normalization function.
[0065] It should be noted that That is, the target interquartile range corresponding to the lag number j, The larger the value of is, the more discrete the distribution of the temperature data in the sliding window is, and the more unstable the data is. Therefore, the larger the value of F is, the more unstable the change of the temperature data in the sliding window is.
[0066] Here is an example of obtaining the target quartile data interval: Assume that the temperature data in the sliding window is , calculate half of the number of all temperature data in the sliding window, and the maximum lag number is 5, so the preset lag number range is [1, 5]. When the lag number is 1, the target number is 9, then the first subsequence is , the second subsequence is , the interquartile range of the first subsequence is linearly normalized with the average of the interquartile range of the second subsequence to obtain the target interquartile range when the lag number is 1; when the lag number is 2, the target number is 8, then the first subsequence is , the second subsequence is , the interquartile range of the first subsequence is linearly normalized with the average of the interquartile range of the second subsequence to obtain the target interquartile range when the lag number is 2, and so on, when the lag number is 5, the target number is 5, then the first subsequence is , the second subsequence is , the interquartile range of the first subsequence and the average of the interquartile range of the second subsequence are linearly normalized to obtain the target interquartile range when the lag number is 5, and the mean of the target interquartile ranges of all lag numbers is calculated to obtain the data discreteness of the sliding window, wherein the linear normalization and the acquisition of the interquartile range are prior arts and will not be described in detail here.
[0067] (3) According to the data change rate of the sliding window and the mean of the data discreteness, all adaptive windows in the temperature data sequence are obtained.
[0068] Calculate the mean of the data change speed and the data discreteness, subtract the mean from a constant 1 to obtain a data stability index of the sliding window, and adjust the length of the sliding window according to the data stability index to obtain an adaptive window;
[0069] The sliding window is moved according to a preset sliding step length until the adaptive window contains the last temperature data in the temperature data sequence, thereby obtaining at least one adaptive window in the temperature data sequence.
[0070] In one embodiment, the data stability index of the sliding window is obtained according to the data change speed and data discreteness of the sliding window, and then the length of the sliding window is adjusted according to the data stability index to obtain the first adaptive window in the temperature data sequence. The calculation formula of the data stability index is:
[0071]
[0072] in, It represents the data stability index of the sliding window, D represents the data change speed in the sliding window, F represents the data discreteness of the sliding window, and 1 represents a constant.
[0073] It should be noted that the larger the value of the data change speed, the faster the temperature data changes and the more obvious the fluctuation. The smaller the value, the more unstable the change of temperature data in the sliding window; the larger the value of data discreteness, the more discrete the distribution of temperature data in the sliding window, the more unstable the data, and thus The smaller the value, the more unstable the change of temperature data in the sliding window.
[0074] Furthermore, the length of the sliding window is adjusted according to the data stability index to obtain the first adaptive window of the temperature data sequence. The acquisition of the adaptive window includes:
[0075] If the data stability index is less than the minimum value in the preset data stability index threshold range, subtract the data stability index from the minimum value to obtain a first difference index, round down the product of the first difference index and the preset length adjustment threshold to obtain a first target value, increase the length of the sliding window by the first target value to obtain an adaptive window;
[0076] If the data stability index is greater than the maximum value in the preset data stability index threshold range, subtract the maximum value from the data stability index to obtain a second difference index, round down the product of the second difference index and the preset length adjustment threshold to obtain a second target value, and reduce the length of the sliding window by the second target value to obtain an adaptive window;
[0077] If the data stability index is within the preset data stability index threshold range, the sliding window is used as an adaptive window.
[0078] In one implementation, the stability threshold range is set to [0.6, 0.7], and the preset length adjustment threshold is 10. There is no limitation here, and the implementer can set it according to the implementation scenario.
[0079] If the data stability index is less than 0.6, it means that the temperature data in the sliding window is unstable. It is necessary to expand the length of the sliding window to reduce the volatility of the data and obtain an adaptive window. The length of the adaptive window is:
[0080]
[0081] in, It indicates the length of the adaptive window obtained after the length of the sliding window is expanded. represents the length of the sliding window, represents the data stability index of the sliding window, Indicates the preset length adjustment threshold. Indicates rounding down.
[0082] It should be noted that This is the first difference indicator. This is the first target value.
[0083] If the data stability index is greater than 0.7, it means that the temperature data in the sliding window changes too steadily and the data fluctuation is not obvious. It is necessary to reduce the length of the sliding window to increase the obvious trend of the data and obtain an adaptive window. The length of the adaptive window is:
[0084]
[0085] in, It indicates the length of the adaptive window obtained after reducing the length of the sliding window. represents the length of the sliding window, represents the data stability index of the sliding window, Indicates the preset length adjustment threshold. Indicates rounding down.
[0086] It should be noted that This is the second difference indicator. This is the second target value.
[0087] If the data stability index is within [0.6, 0.7], the length of the sliding window is not adjusted and the sliding window is used as an adaptive window.
[0088] Further, the preset sliding step is set to 1, which is not limited here and can be set by the implementer according to the implementation scenario. After obtaining the first adaptive window in the temperature data sequence, the sliding window is moved backward by 1, and the second adaptive window is obtained according to the method for obtaining the first adaptive window, and then the sliding window is moved backward by 1 again, and the third adaptive window is obtained according to the method for obtaining the first adaptive window, and so on, until the adaptive window contains the last temperature data in the temperature data sequence.
[0089] So far, all adaptive windows in the temperature data sequence have been obtained, and the fixed window in the moving average algorithm has been optimized.
[0090] The data fitting module 12 is used for obtaining, for any adaptive window, a to-be-fitted data sequence corresponding to the adaptive window according to the position of the adaptive window in the temperature data sequence and the data variation trend in the adaptive window.
[0091] In the process of smoothing the temperature data series using the moving average algorithm, since the fixed weight does not take the importance of the data into consideration and may be interfered by noise data, causing the data to deviate from the development trend of the real data, it is necessary to assign adaptive weights to each temperature data according to the fitting data corresponding to each temperature data in the adaptive window, and optimize the fixed weights in the moving average algorithm.
[0092] Considering that the temperature data in the adaptive window may be affected by noise, the credibility of each temperature data may not be the same. Directly fitting the temperature data in the adaptive window will result in large errors. Therefore, for any adaptive window, it is necessary to calculate the similarity between the data change trend of the adaptive window and the previous adaptive window, and judge the credibility of the adaptive window according to the similarity to obtain the data sequence to be fitted corresponding to the adaptive window, and then fit the temperature data in the data sequence to be fitted to obtain the fitting data corresponding to each temperature data in the adaptive window. The method for obtaining the data sequence to be fitted is as follows:
[0093] If the adaptive window is the first adaptive window in the temperature data sequence, all temperature data in the adaptive window are combined into a data sequence to be fitted;
[0094] If the adaptive window is not the first adaptive window in the temperature data sequence, then obtaining the previous adaptive window of the adaptive window, and obtaining a change trend similarity index according to the Spearman correlation coefficient between the differential sequence of the adaptive window and the differential sequence of the previous adaptive window;
[0095] If the variation trend similarity index is greater than or equal to a preset similarity threshold, all temperature data contained in the adaptive window are combined into a data sequence to be fitted;
[0096] If the variation trend similarity index is less than the preset similarity threshold, all temperature data contained in the adaptive window and the previous adaptive window are combined into a data sequence to be fitted.
[0097] In one embodiment, if the adaptive window is the first adaptive window in the temperature data sequence, the adaptive window does not have a previous window and the Spearman correlation coefficient with the previous window cannot be calculated, so all temperature data in the adaptive window are directly used as the data sequence to be fitted.
[0098] If the adaptive window is not the first adaptive window in the temperature data sequence, a first-order difference operation is performed on each temperature data in the adaptive window to obtain a differential sequence of the adaptive window, which is used to characterize the data change trend in the adaptive window, and the Spearman correlation coefficient between the differential sequence of the adaptive window and the differential sequence of the previous adaptive window of the adaptive window is calculated to obtain the similarity of the data change trend between the adaptive window and the previous adaptive window, and the preset similarity threshold is set to 0.6. There is no restriction here. The implementer can set it according to the implementation scenario. If the similarity is greater than or equal to 0.6, it means that there may be less noise in the adaptive window and the credibility is high. All temperature data in the adaptive window can be directly composed of the data sequence to be fitted; if the similarity is less than 0.6, it means that the credibility of the adaptive window is low, and there may be more noise in the adaptive window, which interferes with the temperature data in the adaptive window, causing the data development trend of the temperature data in the adaptive window to deviate, and it is necessary to combine the temperature data in the previous adaptive window to form a data sequence to be fitted. Among them, the Spearman correlation coefficient is a prior art and will not be repeated here.
[0099] The weight acquisition module 13 is used to fit the data sequence to be fitted to obtain the fitting data corresponding to each temperature data in the adaptive window, and obtain the adaptive weight of each temperature data in the adaptive window according to the difference between each temperature data in the adaptive window and its corresponding fitting data.
[0100] Considering that there may be abnormal data affected by noise in the data sequence to be fitted, these data have a great impact on the fitting effect. Therefore, it is necessary to first filter out the abnormal data in the data sequence to be fitted, adjust the abnormal data, and then perform linear fitting on the data sequence to be fitted to obtain the fitting result. Then, according to the fitting result, each temperature data in the data sequence to be fitted is given an adaptive weight. The steps for obtaining abnormal data are:
[0101] (1) Obtain the abnormal coefficient of each difference value based on the difference sequence of the data sequence to be fitted.
[0102] The differential sequence of the data sequence to be fitted is obtained to obtain a target differential sequence, the average value of all differential values in the target differential sequence is calculated to obtain a differential sequence mean, and for any differential value in the target differential sequence, the absolute value of the difference between the differential value and the differential sequence mean is calculated to obtain an abnormal coefficient of the differential value.
[0103] In one embodiment, the first-order difference sequence of the data sequence to be fitted is used as the target difference sequence, and the mean of all difference values in the target difference sequence is calculated to obtain the difference sequence mean. If each temperature data in the data sequence to be fitted conforms to the same development trend and develops stably, the size of each difference value is close and has the same positive and negative attributes, so the difference between each difference value and the difference sequence mean is small; if there is abnormal data in the data sequence to be fitted, the difference between the difference value containing the abnormal data and the difference sequence mean is large. Therefore, for the rth difference value in the target difference sequence, the abnormal coefficient of the rth difference value is obtained according to the difference sequence mean, and the calculation formula of the abnormal coefficient is:
[0104]
[0105] in, represents the abnormal coefficient of the rth difference value in the target difference sequence, represents the rth difference value in the target difference sequence, represents the number of all difference values in the target difference sequence, represents the first The difference value, Represents the absolute value symbol.
[0106] It should be noted that That is, the mean of the difference sequence. When the difference between the rth difference value and the mean of the difference sequence is larger, that is, The larger the value of The larger the value of , the greater the probability that the two data to be fitted corresponding to the rth difference value contain abnormal data.
[0107] (2) Obtain the abnormal data in the data sequence to be fitted based on the abnormal coefficient.
[0108] The ratio of the abnormal coefficient to the mean of the difference sequence is calculated to obtain the degree of abnormality of the difference value, and the abnormal data in the data sequence to be fitted is obtained according to the degree of abnormality of each difference value in the target difference sequence.
[0109] In one embodiment, the calculation formula for the abnormality degree of the rth difference value is:
[0110]
[0111] in, Indicates the abnormality of the rth difference value in the target difference sequence, represents the abnormal coefficient of the rth difference value in the target difference sequence, represents the number of all difference values in the target difference sequence, represents the first A difference value.
[0112] It should be noted that is the difference series mean, The larger the value of , the more obvious the difference between the rth difference value and other difference values in the target difference sequence, and the greater the probability that the two data to be fitted corresponding to the rth difference value contain abnormal data.
[0113] Similarly, the abnormal degree of each difference value in the target difference sequence is obtained, and then the abnormal data in the data sequence to be fitted is obtained according to the abnormal degree of each difference value. The acquisition of abnormal data includes:
[0114] For any difference value in the target difference sequence, if the abnormality of the difference value is greater than or equal to a preset abnormality threshold, the previous difference value of the difference value is obtained; if the abnormality of the previous difference value is less than the preset abnormality threshold, the latter of the two data to be fitted corresponding to the difference value is abnormal data;
[0115] If the abnormality degree of the previous difference value is greater than or equal to the preset abnormality degree threshold, the previous data to be fitted of the two data to be fitted corresponding to the difference value is abnormal data.
[0116] In one embodiment, the preset abnormality threshold is set to 0.6, which is not limited here and can be set by the implementer according to the implementation scenario. Assume that the data sequence to be fitted is , then the target difference sequence (the difference sequence of the data sequence to be fitted) is ,against ,like If the abnormality is less than 0.6, it means There is no abnormal data in the corresponding two data to be fitted; if If the abnormal degree is greater than or equal to 0.6, it means that the abnormal data may be In this case, if The abnormal degree of is less than 0.6, which indicates that the abnormal data is (the next data to be fitted), if If the abnormal degree is greater than or equal to 0.6, it means that the abnormal data is (The previous data to be fitted).
[0117] Similarly, each differential value in the target differential sequence is analyzed to obtain all abnormal data in the data sequence to be fitted. Since these abnormal data have a great influence on the fitting effect, it is necessary to adjust the abnormal data to obtain a new data sequence to be fitted, and then perform linear fitting on the new data sequence to be fitted by the least squares method to obtain the fitting data corresponding to each temperature data in the adaptive window. Among them, linear fitting by the least squares method is an existing technology and will not be repeated here. The specific method of obtaining the fitting data is:
[0118] The average value between the left adjacent data and the right adjacent data of each abnormal data is assigned to the corresponding abnormal data to obtain a new data sequence to be fitted, and a straight line fitting is performed on the temperature data in the new data sequence to be fitted to obtain the fitting data corresponding to each temperature data in the adaptive window.
[0119] After obtaining the fitting data corresponding to each temperature data in the adaptive window, an adaptive weight is assigned to each temperature data according to the difference between each temperature data in the adaptive window and its corresponding fitting data, and the fixed weight in the moving average algorithm is optimized. The specific method of obtaining the adaptive weight is:
[0120] Calculate the absolute value of the difference between each temperature data in the adaptive window and the corresponding fitting data to obtain a fitting difference index, and obtain a fitting difference index cumulative value of all fitting difference indexes;
[0121] For any temperature data in the adaptive window, the temperature data is taken as the target temperature data, and the ratio between the accumulated value of the fitting difference index and the fitting difference index corresponding to the target temperature data is linearly normalized to obtain the adaptive weight of the target temperature data.
[0122] In one embodiment, for the qth temperature data in the adaptive window, the calculation formula for the adaptive weight of the qth temperature data is:
[0123]
[0124] in, represents the adaptive weight of the qth temperature data, T represents the number of all temperature data in the adaptive window, represents the tth temperature data in the adaptive window, represents the fitting data corresponding to the t-th temperature data in the adaptive window, represents the qth temperature data in the adaptive window, represents the fitting data corresponding to the qth temperature data in the adaptive window, represents the linear normalization function, Represents the absolute value symbol.
[0125] It should be noted that That is the cumulative value of the fitting difference index, That is, the fitting difference index of the qth temperature data. The smaller the fitting difference index, the smaller the difference between the qth temperature data and its corresponding fitting data. The larger the value of , the greater the adaptive weight.
[0126] Similarly, the adaptive weight of each temperature data in the adaptive window is obtained.
[0127] At this point, the adaptive weight of each temperature data in the adaptive window is obtained, and the fixed weight in the moving average algorithm is optimized.
[0128] The data prediction module 14 is used to obtain the weighted average of the last temperature data in the adaptive window according to the adaptive weight of each temperature data in the adaptive window, form a smoothed data sequence with the weighted average of the last temperature data in each of the adaptive windows, and issue an abnormal warning for the temperature of the energy storage cabinet according to the smoothed data sequence.
[0129] After obtaining the adaptive weight of each temperature data in the adaptive window, the weighted average value of the last temperature data in the adaptive window is obtained by using the moving average algorithm, which is used to smooth the temperature data in the adaptive window. The moving average algorithm is a prior art and will not be described here. The calculation formula of the weighted average value is:
[0130]
[0131] in, Represents the weighted average of the nth temperature data (the last temperature data) in the adaptive window. Represents the adaptive weight of the first temperature data in the adaptive window, Represents the first temperature data in the adaptive window. Represents the adaptive weight of the second temperature data in the adaptive window, Represents the second temperature data in the adaptive window. represents the adaptive weight of the nth temperature data in the adaptive window, represents the nth temperature data in the adaptive window, and n represents the number of all temperature data in the adaptive window.
[0132] Similarly, the weighted average of the last temperature data in all adaptive windows in the temperature data sequence is obtained, and the weighted average of the last temperature data in each adaptive window is used to replace the corresponding temperature data in the temperature data sequence, thereby completing the smoothing process of the temperature data sequence, and obtaining a corresponding smoothed data sequence. Then, an abnormal warning is performed on the temperature of the energy storage cabinet according to the smoothed data sequence. The abnormal warning step includes:
[0133] Obtain a first-order difference sequence of the smoothed data sequence, use the average of the lengths of all adaptive windows as the period number for predicting the first-order difference sequence using the average moving average algorithm, and obtain a moving average value sequence corresponding to the first-order difference sequence;
[0134] The last data in the moving average sequence is added to the weighted average corresponding to the last temperature data in the temperature data sequence to obtain a predicted temperature. If the predicted temperature is greater than or equal to a preset alarm temperature, an abnormal temperature warning is issued for the energy storage cabinet.
[0135] In one implementation, the preset alarm temperature is set to 40, which is not limited here and can be set by the implementer according to the implementation scenario. Assume that the first-order difference sequence of the smoothed data sequence is , the mean length of all adaptive windows is 3, then the moving average sequence is , add the weighted average value corresponding to the last data in the moving average sequence and the last temperature data in the temperature data sequence to obtain the predicted temperature. If the predicted temperature is greater than or equal to 40, an abnormal temperature warning is issued for the energy storage cabinet so that the staff can take timely response measures.
[0136] Similarly, the predicted temperatures corresponding to sensors at other locations in the energy storage cabinet are obtained, and abnormal warnings are issued.
[0137] It is worth noting that the focus of the present invention is: how to optimize the moving average algorithm to smooth the temperature data sequence, and then obtain the predicted temperature based on the processed data. It is a prior art to issue an abnormal warning for the temperature of the energy storage cabinet based on the predicted temperature, which will not be described in detail here.
[0138] In summary, the present invention provides an energy storage cabinet with a temperature detection and alarm function, comprising a data acquisition module, which is used to acquire temperature data of a sensor at any position in the energy storage cabinet to obtain a temperature data sequence. In the process of smoothing the temperature data sequence using a moving average algorithm, a sliding window of a preset size is constructed, and at least one adaptive window in the temperature data sequence is obtained according to the change speed and discreteness of the temperature data in the sliding window; a data fitting module, which is used to obtain a data sequence to be fitted corresponding to any adaptive window according to the position of the adaptive window in the temperature data sequence and the data change trend in the adaptive window; a weight acquisition module, which is used to fit the data sequence to be fitted to obtain fitting data corresponding to each temperature data in the adaptive window, and obtain the adaptive weight of each temperature data in the adaptive window according to the difference between each temperature data in the adaptive window and the corresponding fitting data; a data prediction module, which is used to obtain the weighted average value of the last temperature data in the adaptive window according to the adaptive weight of each temperature data in the adaptive window, and the weighted average value of the last temperature data in each adaptive window is used to form a smoothed data sequence, and an abnormal warning is issued for the temperature of the energy storage cabinet according to the smoothed data sequence. Among them, a sliding window of a preset size is constructed in the temperature data sequence, and the length of the sliding window is adjusted according to the change speed and discreteness of the temperature data in the sliding window to obtain an adaptive window, and the fixed window in the average moving algorithm is optimized. Further, the data sequence to be fitted is obtained according to the data change trend in the adaptive window, and the data (abnormal data) that does not meet the change trend in the data sequence to be fitted is adjusted, and the adjusted data sequence to be fitted is fitted to achieve a better fitting effect. According to the fitting result, an adaptive weight is given to the temperature data, and the fixed weight in the average moving algorithm is optimized. Then, the temperature data sequence is smoothed according to the optimized average moving algorithm, and an abnormal warning is given to the temperature of the energy storage cabinet according to the smoothed data, so as to improve the accuracy of the abnormal warning of the temperature of the energy storage cabinet.
[0139] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention.
Claims
1. An energy storage cabinet with temperature detection and alarm function, comprising a cabinet body, characterized in that: A temperature detection alarm system is provided inside the cabinet, and the temperature detection alarm system comprises: A data acquisition module, used to collect temperature data of a sensor at any position in the energy storage cabinet to obtain a temperature data sequence, and in the process of smoothing the temperature data sequence using a moving average algorithm, construct a sliding window of a preset size, and obtain at least one adaptive window in the temperature data sequence according to the change speed and discreteness of the temperature data in the sliding window; A data fitting module, for obtaining, for any adaptive window, a data sequence to be fitted corresponding to the adaptive window according to the position of the adaptive window in the temperature data sequence and the data change trend in the adaptive window; A weight acquisition module is used to fit the data sequence to be fitted to obtain fitting data corresponding to each temperature data in the adaptive window, and obtain an adaptive weight of each temperature data in the adaptive window according to the difference between each temperature data in the adaptive window and the corresponding fitting data; A data prediction module, used to obtain a weighted average value of the last temperature data in the adaptive window according to the adaptive weight of each temperature data in the adaptive window, form a smoothed data sequence with the weighted average values of the last temperature data in each of the adaptive windows, and issue an abnormal warning for the temperature of the energy storage cabinet according to the smoothed data sequence; The weight acquisition module fits the data sequence to be fitted to obtain fitting data corresponding to each temperature data in the adaptive window, including: Obtaining a difference sequence of the data sequence to be fitted to obtain a target difference sequence, calculating the average of all difference values in the target difference sequence to obtain a difference sequence mean, and for any difference value in the target difference sequence, calculating the absolute value of the difference between the difference value and the difference sequence mean to obtain an abnormal coefficient of the difference value; Calculate the ratio between the abnormal coefficient and the mean of the difference sequence to obtain the degree of abnormality of the difference value, and obtain the abnormal data in the data sequence to be fitted according to the degree of abnormality of each difference value in the target difference sequence; The average value between the left adjacent data and the right adjacent data of each abnormal data is assigned to the corresponding abnormal data to obtain a new data sequence to be fitted, and a straight line fitting is performed on the temperature data in the new data sequence to be fitted to obtain the fitting data corresponding to each temperature data in the adaptive window.
2. The energy storage cabinet with temperature detection and alarm function according to claim 1 is characterized in that: The data acquisition module obtains at least one adaptive window in the temperature data sequence according to the change speed and discreteness of the temperature data in the sliding window, including: The sliding window contains the first temperature data in the temperature data sequence, performs a first-order difference operation on each temperature data in the sliding window to obtain a difference sequence of the sliding window, linearly normalizes the absolute value of each difference value in the difference sequence of the sliding window to obtain a corresponding normalized difference value, calculates the mean of all normalized difference values, and obtains the data change speed of the sliding window; According to a preset hysteresis number range and each temperature data in the sliding window, the data discreteness of the sliding window is obtained; Calculate the mean of the data change speed and the data discreteness, subtract the mean from a constant 1 to obtain a data stability index of the sliding window, and adjust the length of the sliding window according to the data stability index to obtain an adaptive window; The sliding window is moved according to a preset sliding step length until the adaptive window contains the last temperature data in the temperature data sequence, thereby obtaining at least one adaptive window in the temperature data sequence.
3. The energy storage cabinet with temperature detection and alarm function according to claim 2 is characterized in that: The data acquisition module obtains the data discreteness of the sliding window according to the preset hysteresis number range and each temperature data in the sliding window, including: For any hysteresis number in the preset hysteresis number range, subtract the hysteresis number from the number of all temperature data in the sliding window to obtain a target number, and construct a first hysteresis sliding window in the sliding window, wherein the number of all temperature data included in the first hysteresis sliding window is the target number, and the first hysteresis sliding window includes the first temperature data in the sliding window; The temperature data contained in the first hysteresis sliding window is formed into a first subsequence, the hysteresis number is used as a sliding step, the first hysteresis sliding window is moved to obtain a second hysteresis sliding window, and the temperature data contained in the second hysteresis sliding window is formed into a second subsequence; The interquartile ranges of the first subsequence and the second subsequence are calculated respectively to obtain an average value of the interquartile ranges, the average value of the interquartile ranges is linearly normalized to obtain a target interquartile range corresponding to the lag number, the average value of the target interquartile ranges corresponding to all lag numbers in the preset lag number range is calculated to obtain the data discreteness of the sliding window.
4. The energy storage cabinet with temperature detection and alarm function according to claim 2 is characterized in that: The data acquisition module adjusts the length of the sliding window according to the data stability index to obtain an adaptive window, including: If the data stability index is less than the minimum value in the preset data stability index threshold range, subtract the data stability index from the minimum value to obtain a first difference index, round down the product of the first difference index and the preset length adjustment threshold to obtain a first target value, increase the length of the sliding window by the first target value to obtain an adaptive window; If the data stability index is greater than the maximum value in the preset data stability index threshold range, subtract the maximum value from the data stability index to obtain a second difference index, round down the product of the second difference index and the preset length adjustment threshold to obtain a second target value, and reduce the length of the sliding window by the second target value to obtain an adaptive window; If the data stability index is within the preset data stability index threshold range, the sliding window is used as an adaptive window.
5. The energy storage cabinet with temperature detection and alarm function according to claim 1 is characterized in that: The data fitting module obtains the to-be-fitted data sequence corresponding to the adaptive window according to the position of the adaptive window in the temperature data sequence and the data change trend in the adaptive window, including: If the adaptive window is the first adaptive window in the temperature data sequence, all temperature data in the adaptive window are combined into a data sequence to be fitted; If the adaptive window is not the first adaptive window in the temperature data sequence, then obtaining the previous adaptive window of the adaptive window, and obtaining a change trend similarity index according to the Spearman correlation coefficient between the differential sequence of the adaptive window and the differential sequence of the previous adaptive window; If the variation trend similarity index is greater than or equal to a preset similarity threshold, all temperature data contained in the adaptive window are combined into a data sequence to be fitted; If the variation trend similarity index is less than the preset similarity threshold, all temperature data contained in the adaptive window and the previous adaptive window are combined into a data sequence to be fitted.
6. The energy storage cabinet with temperature detection and alarm function according to claim 1, characterized in that: The weight acquisition module obtains abnormal data in the to-be-fitted data sequence according to the abnormal degree of each differential value in the target differential sequence, including: For any difference value in the target difference sequence, if the abnormality of the difference value is greater than or equal to a preset abnormality threshold, the previous difference value of the difference value is obtained; if the abnormality of the previous difference value is less than the preset abnormality threshold, the latter of the two data to be fitted corresponding to the difference value is abnormal data; If the abnormality degree of the previous difference value is greater than or equal to the preset abnormality degree threshold, the previous data to be fitted of the two data to be fitted corresponding to the difference value is abnormal data.
7. The energy storage cabinet with temperature detection and alarm function according to claim 1 is characterized in that: The weight acquisition module obtains the adaptive weight of each temperature data in the adaptive window according to the difference between each temperature data in the adaptive window and the corresponding fitting data, including: Calculate the absolute value of the difference between each temperature data in the adaptive window and the corresponding fitting data to obtain a fitting difference index, and obtain a fitting difference index cumulative value of all fitting difference indexes; For any temperature data in the adaptive window, the temperature data is taken as the target temperature data, and the ratio between the accumulated value of the fitting difference index and the fitting difference index corresponding to the target temperature data is linearly normalized to obtain the adaptive weight of the target temperature data.
8. The energy storage cabinet with temperature detection and alarm function according to claim 1 is characterized in that: The data prediction module performs abnormal warning on the temperature of the energy storage cabinet according to the smoothed data sequence, including: Obtain a first-order difference sequence of the smoothed data sequence, use the average of the lengths of all adaptive windows as the period number for predicting the first-order difference sequence using the average moving average algorithm, and obtain a moving average value sequence corresponding to the first-order difference sequence; The last data in the moving average sequence is added to the weighted average corresponding to the last temperature data in the temperature data sequence to obtain a predicted temperature. If the predicted temperature is greater than or equal to a preset alarm temperature, an abnormal temperature warning is issued for the energy storage cabinet.
Citation Information
Patent Citations
Smoke sensing intelligent early warning method
CN116778661A
Intelligent environment temperature early warning system of large-diameter internet-of-things water meter
CN117786325A