Operation data storage method and system, electronic equipment and storage medium
By dynamically adjusting the data sampling rate and prediction cycle in the battery management system, the problems of difficult battery pack failure analysis and excessive data storage are solved, and data acquisition and storage are optimized, ensuring safe operation and efficient management of the battery.
Patent Information
- Application Number
- CN202411649997.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-11-19
Smart Images

Figure CN119597214A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of battery management technology, and in particular to a method and system for storing running data, an electronic device and a storage medium. Background Art
[0002] The battery management system is used to monitor the operating data of the battery. Generally, after the battery pack leaves the factory, if a fault occurs, the data is only saved at the moment when the battery pack fails and is detected by the battery management system. The amount of saved data is difficult to use to analyze the use and evolution of the battery pack, making it difficult for technicians to determine whether the fault is caused by battery usage problems or quality problems with the battery itself.
[0003] In the prior art, in order to optimize the accuracy of data analysis after a battery pack failure, data is usually recorded from the moment the battery pack is powered on, thereby ensuring data integrity. However, due to the long operation time of the battery pack, the memory stores too much battery pack data, which in turn increases the computational and storage burden of the battery management system during data analysis. Summary of the invention
[0004] The problem solved by the present invention is how to reduce the calculation burden and storage burden of the battery management system while ensuring the accuracy of key data analysis of the battery pack.
[0005] In order to solve the above problems, the present invention provides a method and system for storing running data, an electronic device and a storage medium.
[0006] In a first aspect, the present invention provides an operation data storage method, which is applied to a battery management system. The operation data storage method comprises: When the battery pack is in a powered-on state, determining whether the battery pack is powered-on for the first time, and setting a data sampling rate and a data prediction period according to the determination result; Continuously monitoring the data of the battery pack according to the data sampling rate, obtaining a battery data group of the battery pack and storing it in a regular file; Executing a judgment step, the judgment step comprising, when the duration of monitoring the battery pack according to the current data sampling rate reaches a data prediction period, predicting the change of the battery data group in a preset future time period according to the change of the battery data group in the data prediction period, to obtain the future change of the battery data group; Determining the operating state of the battery pack according to the future change of the battery data group within the preset future time period; When the operating state of the battery pack is normal, the data sampling rate is adjusted to a preset sampling rate, the data of the battery pack is continuously monitored according to the preset sampling rate, the battery data group obtained by monitoring is stored in the regular file, and the determination step is returned to be executed, and the data prediction period is adjusted to the first time period; When the operating state of the battery pack is a warning state, the data sampling rate is adjusted to a first sampling rate, data monitoring of the battery pack is continued at the first sampling rate, the battery data group obtained by monitoring is stored in a regular file, and the determination step is executed again, and the data prediction period is adjusted to a second time period; When the operating state of the battery pack is an emergency state, the data sampling rate is adjusted to a second sampling rate, the data of the battery pack is continuously monitored according to the second sampling rate, the battery data group obtained by monitoring is stored as snapshot data in a snapshot file, and the judgment step is executed again, and the data prediction period is adjusted to a third time period; Among them, the change amplitude and / or change frequency of the battery data groups corresponding to the normal state, the warning state and the emergency state increase successively, the preset sampling rate is less than the first sampling rate, the first sampling rate is less than the second sampling rate, the first time period is greater than the second time period, and the second time period is greater than the third time period.
[0007] Optionally, the determining whether the battery pack is powered on for the first time and setting the data sampling rate and the data prediction period according to the determination result includes: When the battery pack is powered on, the operating time of the hardware of the battery management system is obtained; Determining whether the battery pack is powered on for the first time based on the hardware time; If yes, initializing the data sampling rate to the preset sampling rate, and initializing the data prediction period to the first time period; If not, the historical sampling rate and historical prediction period recorded for the last time are used as the data sampling rate and the data prediction period respectively.
[0008] Optionally, the determining whether the battery pack is powered on for the first time and setting the data sampling rate according to the determination result includes: When the battery pack is powered on, obtain the hardware running time of the battery management system; Determining whether the battery pack is powered on for the first time based on the hardware running time; If so, initializing the data sampling rate to a preset sampling rate; If not, the last recorded historical sampling rate is used as the data sampling rate.
[0009] Optionally, the continuously monitoring the data of the battery pack according to the data sampling rate to obtain a battery data group of the battery pack and store it in a regular file includes: Acquire parameter data of the battery pack according to the data sampling rate to obtain the battery data group of the battery pack; Detecting whether the file name corresponding to the battery data group contains an identifier indicating the latest state; If yes, open the regular file and write the battery data set to the end of the regular file; If not, the file name of the regular file is updated according to the battery data set, and then the battery data set is written to the end of the regular file.
[0010] Optionally, the continuously monitoring the data of the battery pack according to the data sampling rate to obtain a battery data group of the battery pack and storing it in a regular file further includes: Continuously monitoring and collecting data of the battery pack according to the data sampling rate, and continuously detecting whether the remaining storage space of the storage device where the conventional file is located is less than the storage space required by the battery data group to be written; If the detection result is that the remaining storage space of the storage device where the regular file is located is less than the storage space required by the battery data group to be written, then retrieving the timestamp associated with each battery data group in the regular file; According to the timestamps, the battery data groups are sorted and formed into a time series; Starting from the earliest battery data set in the time series, the battery data sets are deleted one by one until the remaining storage space of the regular file is greater than or equal to the storage space required by the battery data set to be written.
[0011] Optionally, judging the operating state of the battery pack according to the future change of the battery data group within the preset future time period includes: Acquire a plurality of the battery data groups within the preset future time period, each of the battery data groups including values of a plurality of parameters of the battery pack at a sampling time; When the value of each parameter of the battery pack in the preset future time period is within the normal threshold range corresponding to the parameter, determining that the operating state is a normal state; When a value of any one of the parameters of the battery pack in the preset future time period is within a warning threshold range corresponding to the parameter, determining that the operating state is a warning state; When a value of any one of the parameters of the battery pack in the preset future time period is within an emergency threshold range corresponding to the parameter, determining that the operating state is an emergency state; Among them, for each of the parameters, the maximum value of the normal threshold range corresponding to the parameter is less than or equal to the minimum value of the warning threshold range corresponding to the parameter, and the maximum value of the warning threshold range corresponding to the parameter is less than or equal to the minimum value of the emergency threshold range corresponding to the parameter.
[0012] Optionally, when the operating state of the battery pack is an emergency state, adjusting the data sampling rate to a second sampling rate, continuing to monitor the data of the battery pack according to the second sampling rate, and storing the battery data group obtained by monitoring as snapshot data in a snapshot file, includes: When the operating state of the battery pack is an emergency state, updating the file name of the battery data group of the battery pack according to the battery data group monitored according to the second sampling rate; The battery data group monitored according to the second sampling rate is written to the end of the snapshot file in the form of the updated file name.
[0013] Optionally, the operation data storage method further includes: When the battery pack is shut down or in standby mode in the normal operating state, the hardware operating time of the battery management system is reset.
[0014] In a second aspect, the present invention provides an operation data storage system, comprising: A sampling rate setting unit, used for determining whether the battery pack is powered on for the first time when the battery pack is in a powered-on state, and setting a data sampling rate and a data prediction period according to the determination result; A storage adjustment unit, used for continuously monitoring the data of the battery pack according to the data sampling rate, obtaining a battery data group of the battery pack and storing it in a regular file; A judgment unit: used to execute a judgment step, wherein when the duration of monitoring the battery pack at the current data sampling rate reaches a data prediction period, based on the changes of the battery data group within the data prediction period, a prediction is made on the changes of the battery data group within a preset future time period to obtain the future changes of the battery data group; Determining the operating state of the battery pack according to the future change of the battery data group within the preset future time period; When the operating state of the battery pack is normal, the data sampling rate is adjusted to a preset sampling rate, the data of the battery pack is continuously monitored according to the preset sampling rate, the battery data group obtained by monitoring is stored in the regular file, and the determination step is returned to be executed, and the data prediction period is adjusted to the first time period; When the operating state of the battery pack is a warning state, the data sampling rate is adjusted to a first sampling rate, data monitoring of the battery pack is continued at the first sampling rate, the battery data group obtained by monitoring is stored in a regular file, and the determination step is executed again, and the data prediction period is adjusted to a second time period; When the operating state of the battery pack is an emergency state, the data sampling rate is adjusted to a second sampling rate, the data of the battery pack is continuously monitored according to the second sampling rate, the battery data group obtained by monitoring is stored as snapshot data in a snapshot file, and the judgment step is executed again, and the data prediction period is adjusted to a third time period; Among them, the change amplitude and / or change frequency of the battery data groups corresponding to the normal state, the warning state and the emergency state increase successively, the preset sampling rate is less than the first sampling rate, the first sampling rate is less than the second sampling rate, the first time period is greater than the second time period, and the second time period is greater than the third time period.
[0015] In a third aspect, the present invention provides an electronic device, comprising a memory and a processor; the memory is used to store a computer program; the processor is used to implement the above-mentioned running data storage method when executing the computer program.
[0016] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the above-mentioned method for storing running data is implemented.
[0017] The operation data storage method, system, electronic device and storage medium of the present invention initialize the data sampling rate and data prediction period by intelligently judging whether it is the first power-on when the battery pack is powered on, and predicting according to the battery data group within the data prediction period, and then continuously monitoring the battery data according to the predicted future changes of the battery data group, and dynamically adjusting the sampling frequency according to the trend of data changes in a preset future time period, so as to optimize data acquisition, and at the same time adjust the data prediction period of the battery data according to the data changes, and then adjust the prediction frequency of the battery data group, so as to reduce the calculation pressure of the system under normal circumstances and optimize the use of storage resources; in the warning state and the emergency state, the prediction period is reduced in turn, and the prediction frequency of the battery data group is increased, so as to more flexibly respond to different operation states and improve the response flexibility of the system; by dynamically adjusting the sampling rate according to the operation state of the battery pack, the data storage amount during normal operation of the battery can be reduced to reduce unnecessary data storage and improve the efficiency of data management, and at the same time, when the battery state changes greatly, the data sampling is increased to capture key state changes, so as to ensure the analysis accuracy of key data. Specifically: when the battery pack is in normal operation, a preset lower sampling rate is used for data monitoring, which reduces the amount of data in the memory, thereby optimizing the use of storage resources; thus helping to reduce the storage burden, so that the memory can be used more effectively to store critical data. When the battery pack is in warning or emergency operation, increasing the sampling rate can more accurately capture changes in the battery state, which is crucial for subsequent data analysis and fault diagnosis; in this way, technicians can more accurately define the cause of the fault, whether it is due to battery usage problems or battery quality problems; and, in an emergency, the monitored data is stored as snapshot data in the snapshot file, and the file name is updated according to the fault information; the real-time update and snapshot storage mechanism ensures that the battery status data can be quickly accessed and analyzed at critical moments, further ensuring the safe operation and health management of the battery. At the same time, since the change amplitude and frequency of the battery data groups corresponding to the normal state, warning state and emergency state increase successively, the corresponding sampling frequency is set for this purpose, so as to adapt to the data monitoring needs of the battery pack under different operating conditions, and ensure the continuity and integrity of the data. The integrated intelligent data analysis tool of the present invention analyzes battery performance and health status in real time, predicts potential problems, reduces data processing requirements during low-change periods, thereby reducing storage requirements, avoids oversampling when the battery status is stable, and increases the sampling rate when the battery status changes significantly. It can capture key data points more accurately, thereby improving the relevance and accuracy of data analysis, optimizing the use of storage resources, enhancing data analysis accuracy, and ensuring that battery status data can be quickly accessed and analyzed at critical moments; and through continuous monitoring and adaptive adjustment, the battery management system can better cope with various situations during the operation of the battery pack and improve the robustness and reliability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 A flow chart of a method for storing running data according to an embodiment of the present invention; Figure 2 A schematic diagram of a system for storing data in accordance with another embodiment of the present invention; Figure 3 The figure is a schematic diagram of the structure of an electronic device according to another embodiment of the present invention. DETAILED DESCRIPTION
[0019] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. Although certain embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be interpreted as being limited to the embodiments described herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are only for exemplary purposes and are not intended to limit the scope of protection of the present invention.
[0020] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0021] The term "including" and its variations used in this document are open inclusions, that is, "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 other embodiment"; the term "some embodiments" means "at least some embodiments"; the term "optionally" means "optional embodiments". The relevant definitions of other terms will be given in the following description. It should be noted that the concepts of "first", "second", etc. mentioned in the present invention 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.
[0022] It should be noted that the modifications of "one" and "plurality" mentioned in the present invention 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".
[0023] The names of the messages or information exchanged between multiple devices in the embodiments of the present invention are only used for illustrative purposes, and are not used to limit the scope of these messages or information.
[0024] In the related technology, although the whole process record can provide complete data, a large amount of data may contain a lot of redundant or less important information, which makes it more difficult to extract useful information from the data and conduct in-depth analysis. As the running time of the battery pack increases, the amount of data accumulated in the memory continues to increase, which may lead to the exhaustion of storage space and the inability to continue recording data. At the same time, continuous data collection and processing will increase the energy consumption of BMS and affect the overall efficiency of the battery pack. The accumulation of a large amount of data causes the BMS to face a higher computing burden during data processing and analysis, which may affect the response speed and performance of the system.
[0025] In view of the problems existing in the above-mentioned related technologies, this embodiment provides a method, system and storage medium for storing running data.
[0026] Combination Figure 1 As shown, an operation data storage method provided by an embodiment of the present invention is applied to a battery management system (Battery Management System-BMS), and the operation data storage method includes: When the battery pack is in a powered-on state, it is determined whether the battery pack is powered-on for the first time, and a data sampling rate and a data prediction period are set according to the determination result.
[0027] Specifically, when the battery pack is powered on, the BMS first checks the startup log or identification parameters of the battery pack to determine whether this is the first time the battery pack is powered on. In a preferred embodiment of the present invention, if it is the first time to power on, the BMS will set a starting data sampling rate and data prediction period according to the preset initial parameters. If it is not the first time to power on, the BMS will continue data collection based on the sampling rate before the last power failure, or re-evaluate and set an appropriate sampling rate and data prediction period based on the historical data and current status of the battery.
[0028] The data of the battery pack is continuously monitored according to the data sampling rate to obtain a battery data group of the battery pack and store it in a regular file.
[0029] Specifically, the BMS continuously monitors the key parameters of the battery pack at the set sampling rate. In the preferred embodiment of the present invention, the battery pack can be monitored including voltage, current, temperature, SOC (State of Charge, the remaining power of the battery), etc. During the data collection process, the BMS will record the values of these parameters in real time, and perform preliminary processing and analysis as needed. The collected battery data group will be stored in the regular storage file of the BMS. Within the preset time period, the BMS will evaluate whether the sampling rate needs to be adjusted based on the changing trend and pattern of the battery data.
[0030] Executing a judgment step, the judgment step comprising, when the duration of monitoring the battery pack according to the current data sampling rate reaches a data prediction period, predicting the change of the battery data group in a preset future time period according to the change of the battery data group in the data prediction period, to obtain the future change of the battery data group; Determining the operating state of the battery pack according to the future change of the battery data group within the preset future time period; When the operating state of the battery pack is normal, the data sampling rate is adjusted to a preset sampling rate, the data of the battery pack is continuously monitored according to the preset sampling rate, the battery data group obtained by monitoring is stored in the regular file, and the determination step is returned to be executed, and the data prediction period is adjusted to the first time period; When the operating state of the battery pack is a warning state, the data sampling rate is adjusted to a first sampling rate, data monitoring of the battery pack is continued at the first sampling rate, the battery data group obtained by monitoring is stored in a regular file, and the determination step is executed again, and the data prediction period is adjusted to a second time period; When the operating state of the battery pack is an emergency state, the data sampling rate is adjusted to a second sampling rate, the data of the battery pack is continuously monitored according to the second sampling rate, the battery data group obtained by monitoring is stored as snapshot data in a snapshot file, and the judgment step is executed again, and the data prediction period is adjusted to a third time period; Among them, the change amplitude and / or change frequency of the battery data groups corresponding to the normal state, the warning state and the emergency state increase successively, the preset sampling rate is less than the first sampling rate, the first sampling rate is less than the second sampling rate, the first time period is greater than the second time period, and the second time period is greater than the third time period.
[0031] Specifically, the BMS first predicts the changes in the battery data group within a preset future time period based on the changes in the battery data group within the data prediction period. Generally, the prediction can be made through a deep learning network, and then the data prediction period is adjusted according to the predicted future changes in the battery data group within the preset future time period. The system can predict the future battery state based on the current battery data changes. Among them, under normal conditions, the prediction period can be extended because the battery state is relatively stable at this time and does not require too frequent predictions. In warning or emergency conditions, shortening the prediction period can respond to changes in battery state more quickly, so that timely measures can be taken. Analyze the battery data group predicted in the future time period and evaluate the operating state of the battery pack, which includes normal state, warning state and emergency state. When the battery pack is in a normal state, the BMS will adjust the data sampling rate to the preset sampling rate. The preset sampling rate is a balanced sampling frequency that is sufficient to continuously monitor the state of the battery pack without excessive consumption of storage resources or energy. If the operating state is a warning state, it indicates that the battery pack may have some non-serious problems, such as a slight voltage deviation or temperature increase. At this time, the BMS will increase the data sampling rate to the first sampling rate to monitor the battery status more frequently, so that possible faults can be responded to quickly. In an emergency state, such as overheating, overcharging or voltage abnormality, the BMS will further increase the data sampling rate to the second sampling rate, which is the highest sampling frequency, to ensure that detailed data can be captured for fault analysis in critical situations. In a preferred embodiment of the present invention, when the voltage exceeds a preset threshold, the BMS adjusts the operating state from a normal state to a warning state and increases the sampling rate accordingly. As the voltage continues to rise, the system may further upgrade the state to an emergency state and record data at the highest sampling rate. By adjusting the sampling rate under different operating states, the BMS can ensure that more detailed data is captured when the battery state changes, thereby improving the accuracy and usefulness of data analysis. At the same time, lowering the sampling rate when the battery state is stable can reduce unnecessary data storage and processing, thereby saving storage space and energy consumption.
[0032] Among them, regular files are used to store battery data groups monitored at a preset sampling rate or a first sampling rate. These data are used for daily battery status monitoring and analysis, and reflect the operation of the battery pack in a normal or warning state. Snapshot files are used to store battery data groups monitored at a second sampling rate when the battery pack is in an emergency state. Snapshot files are equivalent to data backups in an emergency state, which can be quickly accessed and used for rapid response and fault diagnosis in emergency situations. The purpose of snapshot files is to quickly obtain detailed data when an emergency occurs in the battery pack, so as to facilitate timely processing. In the battery management system, snapshot files can provide detailed data in an emergency state, which helps to analyze the cause of the fault and take appropriate measures.
[0033] For example, assume that a battery pack is used in an electric vehicle. The battery management system (BMS) is responsible for monitoring the performance and status of the battery pack. When the battery pack is powered on, the BMS will check whether this is the first time the battery pack is powered on; if so, the BMS will set an initial data sampling rate and data prediction cycle, such as sampling the battery voltage, current and temperature every 10 seconds; at the same time, the battery pack is continuously monitored at the initial sampling rate, and the collected data (voltage, current, temperature, etc.) is stored in a regular file; these data constitute a battery data group. And the stored battery data group is predicted regularly (for example, every minute or every hour), for example, the battery data group within 1 minute predicts the future changes of the battery data group in the future time period.
[0034] If the BMS finds through analysis that the changes in battery parameters are very small (for example, the battery is operating in a steady state), the BMS may reduce the sampling rate and extend the prediction period for the battery data set, thereby reducing the prediction frequency to reduce the need for data storage. This may mean that the BMS adjusts the sampling rate to once every 30 seconds.
[0035] If the BMS detects a rapid change in battery parameters (for example, a sharp rise in battery temperature or a sudden increase in current), the BMS may increase the sampling rate and shorten the prediction period for the battery data set, thereby increasing the prediction frequency to more closely monitor the battery status. This may mean that the BMS adjusts the sampling rate to once every 5 seconds.
[0036] If the BMS detects that any parameter reaches an emergency threshold (for example, the battery temperature exceeds the set safety limit or the voltage suddenly drops to a dangerous level), the BMS will store the current battery data set as snapshot data to the snapshot file and may trigger an alarm or take emergency measures, such as cutting off the power supply or starting the cooling system.
[0037] In this way, the BMS can intelligently adjust the data sampling rate according to the actual operating status of the battery, ensuring adequate monitoring of the battery status and optimizing the efficiency of data storage and processing. This adaptive sampling strategy helps to extend battery life, improve battery performance, and ensure the safety of battery use.
[0038] The operation data storage method of the present invention initializes the data sampling rate and the data prediction period by intelligently judging whether it is the first power-on when the battery pack is powered on, and predicts according to the battery data group within the data prediction period, and then continuously monitors the battery data according to the predicted future changes of the battery data group and dynamically adjusts the sampling frequency according to the trend of data changes in a preset future time period to achieve data acquisition optimization, and at the same time adjusts the data prediction period of the battery data according to the data changes, and then adjusts the prediction frequency of the battery data group, thereby reducing the calculation pressure of the system under normal circumstances and optimizing the use of storage resources; in the warning state and the emergency state, the prediction period is reduced and the prediction frequency of the battery data group is increased, so as to more flexibly respond to different operation states and improve the response flexibility of the system; by dynamically adjusting the sampling rate according to the operation state of the battery pack, the data storage amount during normal operation of the battery can be reduced, and at the same time, when the battery state changes greatly, data sampling is increased to capture key state changes, which not only reduces unnecessary data storage but also improves the efficiency of data management. Specifically: when the battery pack is in normal operation, a preset lower sampling rate is used for data monitoring, which reduces the amount of data in the memory, thereby optimizing the use of storage resources; thus helping to reduce the storage burden, so that the memory can be used more effectively to store critical data. When the battery pack is in warning or emergency operation, increasing the sampling rate can more accurately capture changes in the battery state, which is crucial for subsequent data analysis and fault diagnosis; in this way, technicians can more accurately define the cause of the fault, whether it is due to battery usage problems or battery quality problems; and, in an emergency, the monitored data is stored as snapshot data in the snapshot file, and the file name is updated according to the fault information; the real-time update and snapshot storage mechanism ensures that the battery status data can be quickly accessed and analyzed at critical moments, further ensuring the safe operation and health management of the battery. At the same time, since the change amplitude and frequency of the battery data groups corresponding to the normal state, warning state and emergency state increase successively, the corresponding sampling frequency is set for this purpose, so as to adapt to the data monitoring needs of the battery pack under different operating conditions, and ensure the continuity and integrity of the data. The integrated intelligent data analysis tool of the present invention analyzes battery performance and health status in real time, predicts potential problems, reduces data processing requirements during low-change periods, thereby reducing storage requirements, avoids oversampling when the battery status is stable, and increases the sampling rate when the battery status changes significantly. It can capture key data points more accurately, thereby improving the relevance and accuracy of data analysis, optimizing the use of storage resources, enhancing data analysis accuracy, and ensuring that battery status data can be quickly accessed and analyzed at critical moments; and through continuous monitoring and adaptive adjustment, the battery management system can better cope with various situations during the operation of the battery pack and improve the robustness and reliability of the system.
[0039] Optionally, the determining whether the battery pack is powered on for the first time and setting the data sampling rate and the data prediction period according to the determination result includes: When the battery pack is powered on, obtain the hardware running time of the battery management system; Determining whether the battery pack is powered on for the first time based on the hardware running time; If yes, initializing the data sampling rate to the preset sampling rate, and initializing the data prediction period to the first time period; If not, the historical sampling rate and historical prediction period recorded for the last time are used as the data sampling rate and the data prediction period respectively.
[0040] Specifically, when the battery pack is powered on, the BMS records the current timestamp by reading the hardware time. This timestamp is not only used to synchronize the internal clock of the BMS, but also serves as a basis for determining whether the battery pack is powered on for the first time. If the BMS detects that this is the first time the battery pack is powered on, it initializes the data sampling rate and data prediction cycle according to the preset parameters, where the preset sampling rate is determined based on the battery chemical characteristics and historical data experience, and can ensure that comprehensive data is collected in the early stage of battery use for subsequent analysis. The data prediction cycle is a time period set based on the current battery data sampling rate. During this time period, the system will continue to monitor the battery data and use the collected data to predict the future battery status at the end of the cycle. If the BMS determines that this is not the first power-on, it will retrieve the last historical sampling rate and historical prediction cycle saved in the memory and use it as the current sampling rate and prediction cycle to maintain the continuity of data sampling and avoid missing important battery status change information due to sudden changes in the sampling rate. In a preferred embodiment of the present invention, if the battery pack has been powered on before, the BMS will continue to monitor according to the last sampling rate and update the data to the same file, or store the snapshot data to the snapshot file in an emergency.
[0041] In the embodiments of the present invention, the relevance and accuracy of the data are improved, especially when the battery pack is powered on for the first time, the key initial state of the battery can be captured by initializing the sampling rate and the data prediction period, providing important information for subsequent performance evaluation and fault diagnosis. Secondly, this method optimizes the use of storage space, because when it is not powered on for the first time, the BMS can select an appropriate sampling rate based on the historical state of the battery, avoiding the waste of storage space caused by oversampling, while reducing the data sampling rate and extending the prediction period to reduce the system's computational burden and storage requirements.
[0042] Optionally, the continuously monitoring the data of the battery pack according to the data sampling rate to obtain a battery data group of the battery pack and store it in a regular file includes: Acquire parameter data of the battery pack according to the data sampling rate to obtain the battery data group of the battery pack; Detecting whether the file name corresponding to the battery data group contains an identifier indicating the latest state; If yes, open the regular file and write the battery data set to the end of the regular file; If not, the file name of the regular file is updated according to the battery data set, and then the battery data set is written to the end of the regular file.
[0043] Specifically, the BMS obtains key parameter data of the battery pack, such as voltage, current, temperature, etc., through integrated sensors based on a pre-set or dynamically adjusted data sampling rate, and these data are summarized into battery data groups. The effective collection of these parameter data is the basis for intelligent management of BMS. Next, the BMS will detect whether the regular file name storing this data already contains an identifier representing the latest status of the battery, such as a timestamp or serial number. If the file name already contains such an identifier, indicating that the file is a data file used to record the current status, the BMS will directly append the new battery data group to the end of this file. If there is no such identifier, the BMS will update the file name based on the current battery data group, create a new file, and write the battery data group to the end of the new file to ensure that the update of the file name can reflect the latest status of the battery, which is convenient for data management and fault diagnosis.
[0044] In the embodiments of the present invention, by continuously monitoring and appending data to existing files or creating new files, the continuity and integrity of the data are ensured, providing rich information for battery performance analysis. By detecting whether the file name contains the identifier of the latest state, the BMS can efficiently manage data files, avoid data overwriting and loss, and simplify the data retrieval process.
[0045] Optionally, the continuously monitoring the data of the battery pack according to the data sampling rate to obtain a battery data group of the battery pack and storing it in a regular file further includes: Continuously monitoring and collecting data of the battery pack according to the data sampling rate, and continuously detecting whether the remaining storage space of the storage device where the conventional file is located is less than the storage space required by the battery data group to be written; If the detection result is that the remaining storage space of the storage device where the regular file is located is less than the storage space required by the battery data group to be written, then retrieving the timestamp associated with each battery data group in the regular file; According to the timestamps, the battery data groups are sorted and formed into a time series; Starting from the earliest battery data set in the time series, the battery data sets are deleted one by one until the remaining storage space of the regular file is greater than or equal to the storage space required by the battery data set to be written.
[0046] Specifically, in order to effectively manage the storage of battery data, the system will continuously monitor and collect battery pack data according to the set data sampling rate, and store this data in regular files. In this process, BMS not only pays attention to data collection, but also must manage storage space to ensure that the system does not fail due to insufficient storage space. To this end, BMS will continuously detect the remaining storage space of the storage device related to the regular file to determine whether there is enough space to store new battery data groups. If insufficient remaining space is detected, the system will retrieve the timestamp associated with each battery data group in the file, which is marked when the data is written to the file, ensuring the traceability of the data. Then, BMS sorts the battery data groups according to these timestamps to form a time series. According to the time series, BMS will start with the earliest data and delete the battery data groups one by one until the remaining storage space of the regular file can meet the storage requirements of the new data group, ensuring the retention of important data (i.e., the most recent data) while eliminating older data.
[0047] In an embodiment of the present invention, by dynamically managing storage space, the BMS ensures that key data of the battery pack can be continuously recorded, and the latest data will not be lost even when storage space is tight, ensuring that the storage space is effectively utilized while retaining the data most representative of the current battery status.
[0048] Optionally, judging the operating state of the battery pack according to the future change of the battery data group within the preset future time period includes: Acquire a plurality of the battery data groups within the preset future time period, each of the battery data groups including values of a plurality of parameters of the battery pack at a sampling time; When the value of each parameter of the battery pack in the preset future time period is within the normal threshold range corresponding to the parameter, determining that the operating state is a normal state; When a value of any one of the parameters of the battery pack in the preset future time period is within a warning threshold range corresponding to the parameter, determining that the operating state is a warning state; When a value of any one of the parameters of the battery pack in the preset future time period is within an emergency threshold range corresponding to the parameter, determining that the operating state is an emergency state; Among them, for each of the parameters, the maximum value of the normal threshold range corresponding to the parameter is less than or equal to the minimum value of the warning threshold range corresponding to the parameter, and the maximum value of the warning threshold range corresponding to the parameter is less than or equal to the minimum value of the emergency threshold range corresponding to the parameter.
[0049] Specifically, the BMS first analyzes the battery data set collected within a preset future time period to evaluate the operating state of the battery pack, which may include a normal state, a warning state, and an emergency state. When the battery pack is in a normal state, the BMS adjusts the data sampling rate to a preset sampling rate, which is a balanced sampling frequency sufficient to continuously monitor the state of the battery pack without excessive consumption of storage resources or energy. If the operating state is a warning state, it indicates that the battery pack may have some non-serious problems, such as a slight voltage deviation or temperature increase. At this time, the BMS will increase the data sampling rate to the first sampling rate to monitor the battery state more frequently, so that possible faults can be responded to quickly. In an emergency state, such as overheating, overcharging, or voltage abnormality, the BMS will further increase the data sampling rate to a second sampling rate, which is the highest sampling frequency, to ensure that detailed data can be captured for fault analysis in critical situations. In a preferred embodiment of the present invention, when the voltage exceeds a preset threshold, the BMS adjusts the operating state from a normal state to a warning state and increases the sampling rate accordingly. As the voltage continues to rise, the system may further upgrade the state to an emergency state and record data at the highest sampling rate.
[0050] Specifically: For each parameter of the battery pack, three threshold ranges are set: Normal threshold range: This is the normal working range of the parameter. If the values of all parameters are within this range, the battery pack is considered to be operating in a normal state. Warning threshold range: When the parameter value exceeds the normal range but has not yet reached the emergency state, the system will determine the operating state of the battery pack to be a warning state. This range is used to indicate that there may be an abnormality. Emergency threshold range: When the parameter value exceeds the warning range and reaches or exceeds the emergency threshold, the system will determine the operating state of the battery pack to be an emergency state, which means that the battery pack may face serious safety risks or is about to fail. The state judgment logic includes three states: Normal state: If the values of all parameters are within their respective normal threshold ranges within the preset future time period, the operating state of the battery pack is determined to be a normal state. Warning state: If the value of any parameter exceeds the normal threshold range but is still within the warning threshold range within the preset future time period, the operating state of the battery pack is determined to be a warning state. Emergency state: If the value of any parameter exceeds the warning threshold range and reaches the emergency threshold range within the preset future time period, the operating state of the battery pack is determined to be an emergency state. Moreover, in this preferred embodiment, the setting of the threshold range is continuous, that is, the maximum value of the normal threshold range of each parameter does not exceed the minimum value of the warning threshold range, and the maximum value of the warning threshold range does not exceed the minimum value of the emergency threshold range; such a setting ensures the continuity and logic of the state judgment and avoids the ambiguity of the state judgment. In this embodiment, the battery management system can monitor the state of the battery pack in real time, and adjust the sampling rate and take corresponding measures in time according to the changes in parameters. This threshold-based judgment method is simple and clear, easy to implement, and can effectively guide the operation and maintenance of the battery pack.
[0051] In the embodiment of the present invention, by adjusting the sampling rate under different operating conditions, the BMS can ensure that more detailed data is captured when the battery state changes, thereby improving the accuracy and usefulness of data analysis. At the same time, reducing the sampling rate when the battery state is stable can reduce unnecessary data storage and processing, thereby saving storage space and energy consumption.
[0052] Optionally, when the operating state of the battery pack is an emergency state, adjusting the data sampling rate to a second sampling rate, continuing to monitor the data of the battery pack according to the second sampling rate, and storing the battery data group obtained by monitoring as snapshot data in a snapshot file, includes: When the operating state of the battery pack is an emergency state, updating the file name of the battery data group of the battery pack according to the battery data group monitored according to the second sampling rate; The battery data group monitored according to the second sampling rate is written to the end of the snapshot file in the form of the updated file name.
[0053] Specifically, in an emergency, the battery data group contains critical fault information that is essential for subsequent analysis and diagnosis; in order to quickly identify and retrieve data sets related to specific faults, the system updates the file name based on the current battery data group. The file name update may include information such as timestamp, fault code, battery pack identifier, etc. to ensure the uniqueness and descriptiveness of the file name. For example, the file name may be "BatteryPack12_20240324_185500_OverTemperature.dat", which contains the battery pack number, the current date and time, and possible fault types (such as "OverTemperature" means overtemperature).
[0054] Among them, the snapshot file is a special data file used to store data collected at a specific moment or under specific conditions; in the battery management system, the snapshot file is used to record the detailed data of the battery pack in an emergency state for detailed analysis and fault diagnosis. The system will append the updated battery data group to the end of the snapshot file with a new file name; this append operation will not overwrite the existing data in the snapshot file, but will add a new data group to the end of the file to ensure the continuity and integrity of the data. The data written to the snapshot file includes the values of parameters such as voltage, current, temperature, SOC, SOH, and possible fault codes or status marks; these data are usually stored in a structured format, such as CSV, JSON or binary format, to facilitate subsequent reading and analysis. The data in the snapshot file can be accessed quickly because they are stored continuously and each data group has a clear identifier (i.e., file name).
[0055] In an embodiment of the present invention, by updating the file name in an emergency state and appending the data to the snapshot file, the system can ensure that the data collected at the critical moment will not be lost and can be distinguished from the previous data analysis; the updated file name provides additional information about the data content, which helps technicians quickly locate the problem when performing fault analysis. When the operating status of the battery pack is an emergency state, the system will update the file name according to the battery data group and append the data to the end of the snapshot file with a new file name to ensure the security, integrity and accessibility of key data, and also help improve the reliability and fault response capabilities of the battery management system.
[0056] Optionally, the operation data storage method further includes: When the battery pack is shut down or in standby mode in the normal operating state, the hardware operating time of the battery management system is reset.
[0057] Specifically, when the battery pack is shut down or in standby mode under normal operating conditions, the system will execute the steps of resetting the hardware time. This measure ensures that when the battery pack is powered on again, the BMS can accurately record and synchronize the battery usage time, providing an accurate time reference for subsequent data sampling and analysis. Resetting the hardware time helps to avoid time accumulation errors and ensures the coherence and consistency of timestamps in battery data records. In a preferred embodiment of the present invention, when the battery pack enters standby mode after completing charging, the BMS resets the hardware time to zero, providing a data recording starting point for starting the time from zero when the battery pack is powered on next time.
[0058] In the embodiment of the present invention, the hardware time is reset to ensure that the internal clock of the BMS is synchronized with the actual usage time of the battery pack, thereby providing an accurate time reference for data recording.
[0059] As shown above, in a preferred embodiment of the present invention, in a battery management system (BMS), there is a flowchart to guide the storage and processing of data. When the battery pack is powered on (wakes up), the BMS first obtains the time of the real-time clock, which will be used to record and manage battery data. If it is the first time that the battery pack is powered on, the BMS will initialize the data sampling rate to a preset sampling rate to ensure that detailed data of the initial state is collected. As the battery pack starts to operate, the BMS continues to collect data at a preset sampling rate and writes it to a data storage called a regular file. This file does not initially contain any identifier indicating the latest state. As data continues to be written, the BMS will periodically check the remaining storage space of the regular file to ensure that there is enough space to store new data. If at the end of a preset future time period, the BMS detects that the parameters of the battery pack are all within the normal range, the system will determine that the battery pack is in a normal state. In this case, the data sampling rate remains at the preset sampling rate. If the parameters are out of the normal range but not in an emergency state, the BMS determines the state of the battery pack as a warning state and increases the data sampling rate to the first sampling rate to more closely monitor the battery state. During the operation of the battery pack, if the BMS detects a fault, such as a single cell voltage undervoltage or CAN power failure, the system will enter an emergency state. At this time, the BMS will increase the data sampling rate to the second sampling rate and store the current battery data group as snapshot data in the snapshot file. The file name of the snapshot file will be updated according to the fault information, such as adding a timestamp and fault code, and then the data will be written to the end of the file. When the battery pack is shut down or on standby in a normal state, the BMS will reset the hardware time so that the new operating cycle can be accurately recorded when the battery pack is powered on again. Throughout the process, the BMS is also responsible for processing small microcontroller-related tasks, setting the analog front-end sleep mark, and writing to the internal FLASH in FLASH power-off mode to ensure persistent storage of data. Through this embodiment, the BMS can dynamically adjust the data sampling rate according to the actual operating status of the battery pack, optimize the use of storage space, improve the usefulness of the data, and provide detailed data support at critical moments, thereby ensuring the safe and efficient operation of the battery pack.
[0060] Combination Figure 2 As shown, the present invention also provides an operation data storage system, comprising: A sampling rate setting unit, used for determining whether the battery pack is powered on for the first time when the battery pack is in a powered-on state, and setting a data sampling rate according to the determination result; A storage adjustment unit, used for continuously monitoring the data of the battery pack according to the data sampling rate, obtaining a battery data group of the battery pack and storing it in a regular file; A judgment unit: used to execute a judgment step, wherein when the duration of monitoring the battery pack at the current data sampling rate reaches a data prediction period, based on the changes of the battery data group within the data prediction period, a prediction is made on the changes of the battery data group within a preset future time period to obtain the future changes of the battery data group; Determining the operating state of the battery pack according to the future change of the battery data group within the preset future time period; When the operating state of the battery pack is normal, the data sampling rate is adjusted to a preset sampling rate, data monitoring of the battery pack is continued according to the preset sampling rate, the battery data group obtained by monitoring is stored in the regular file, and the determination step is returned to be executed; When the operating state of the battery pack is a warning state, adjusting the data sampling rate to a first sampling rate, continuing to monitor the data of the battery pack according to the first sampling rate, storing the battery data group obtained by monitoring into a regular file, and returning to execute the determination step; When the operating state of the battery pack is an emergency state, adjusting the data sampling rate to a second sampling rate, continuing to monitor the data of the battery pack according to the second sampling rate, storing the battery data group obtained by monitoring as snapshot data in a snapshot file, and returning to execute the determination step; Among them, the change amplitude and / or change frequency of the battery data groups corresponding to the normal state, the warning state and the emergency state increase successively, the preset sampling rate is less than the first sampling rate, and the first sampling rate is less than the second sampling rate.
[0061] The operation data storage system of the present invention initializes the data sampling rate and data prediction period by intelligently judging whether it is the first power-on when the battery pack is powered on, and predicts according to the battery data group within the data prediction period, and then continuously monitors the battery data according to the predicted future changes of the battery data group and dynamically adjusts the sampling frequency according to the trend of data changes in a preset future time period to achieve data acquisition optimization, and at the same time adjusts the data prediction period of the battery data according to the data changes, and then adjusts the prediction frequency of the battery data group, thereby reducing the computing pressure of the system under normal circumstances and optimizing the use of storage resources; in the warning state and the emergency state, the prediction period is reduced and the prediction frequency of the battery data group is increased, so as to more flexibly respond to different operation states and improve the response flexibility of the system; by dynamically adjusting the sampling rate according to the operation state of the battery pack, the data storage amount during normal operation of the battery can be reduced, and at the same time, when the battery state changes greatly, data sampling is increased to capture key state changes, which not only reduces unnecessary data storage but also improves the efficiency of data management. Specifically: when the battery pack is in normal operation, a preset lower sampling rate is used for data monitoring, which reduces the amount of data in the memory, thereby optimizing the use of storage resources; thus helping to reduce the storage burden, so that the memory can be used more effectively to store critical data. When the battery pack is in warning or emergency operation, increasing the sampling rate can more accurately capture changes in the battery state, which is crucial for subsequent data analysis and fault diagnosis; in this way, technicians can more accurately define the cause of the fault, whether it is due to battery usage problems or battery quality problems; and, in an emergency, the monitored data is stored as snapshot data in the snapshot file, and the file name is updated according to the fault information; the real-time update and snapshot storage mechanism ensures that the battery status data can be quickly accessed and analyzed at critical moments, further ensuring the safe operation and health management of the battery. At the same time, since the change amplitude and frequency of the battery data groups corresponding to the normal state, warning state and emergency state increase successively, the corresponding sampling frequency is set for this purpose, so as to adapt to the data monitoring needs of the battery pack under different operating conditions, and ensure the continuity and integrity of the data. The integrated intelligent data analysis tool of the present invention analyzes battery performance and health status in real time, predicts potential problems, reduces data processing requirements during low-change periods, thereby reducing storage requirements, avoids oversampling when the battery status is stable, and increases the sampling rate when the battery status changes significantly. It can capture key data points more accurately, thereby improving the relevance and accuracy of data analysis, optimizing the use of storage resources, enhancing data analysis accuracy, and ensuring that battery status data can be quickly accessed and analyzed at critical moments; and through continuous monitoring and adaptive adjustment, the battery management system can better cope with various situations during the operation of the battery pack and improve the robustness and reliability of the system.
[0062] Combination Figure 3 As shown, an electronic device 300 provided by an embodiment of the present invention includes a memory 310 and a processor 320; the memory 310 is used to store a computer program; the processor 320 is used to implement the above-mentioned running data storage method when executing the computer program.
[0063] In other words, an electronic device 300 includes a memory 310 and a processor 320 coupled to the memory 310; the memory 310 is configured to store a computer program; and the processor 320 is configured to perform the following operations when executing the computer program: When the battery pack is in a powered-on state, determining whether the battery pack is powered-on for the first time, and setting a data sampling rate according to the determination result; Continuously monitoring the data of the battery pack according to the data sampling rate, obtaining a battery data group of the battery pack and storing it in a regular file; Executing a determination step, the determination step comprising determining the operating state of the battery pack according to changes in the battery data group within the data prediction period when the duration of monitoring the battery pack at the current data sampling rate reaches a data prediction period; When the operating state of the battery pack is normal, the data sampling rate is adjusted to a preset sampling rate, data monitoring of the battery pack is continued according to the preset sampling rate, the battery data group obtained by monitoring is stored in the regular file, and the determination step is returned to be executed; When the operating state of the battery pack is a warning state, adjusting the data sampling rate to a first sampling rate, continuing to monitor the data of the battery pack according to the first sampling rate, storing the battery data group obtained by monitoring into a regular file, and returning to execute the determination step; When the operating state of the battery pack is an emergency state, adjusting the data sampling rate to a second sampling rate, continuing to monitor the data of the battery pack according to the second sampling rate, storing the battery data group obtained by monitoring as snapshot data in a snapshot file, and returning to execute the determination step; Among them, the change amplitude and / or change frequency of the battery data groups corresponding to the normal state, the warning state and the emergency state increase successively, the preset sampling rate is less than the first sampling rate, and the first sampling rate is less than the second sampling rate.
[0064] An electronic device 300 that can be used as a server or client of the present invention will now be described, which is an example of a hardware device that can be applied to various aspects of the present invention. The electronic device 300 is intended to represent various forms of digital electronic computer equipment, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device 300 can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples, and are not intended to limit the implementation of the present invention described and / or required herein.
[0065] The electronic device 300 includes a computing unit, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) or a computer program loaded from a storage unit into a random access memory (RAM). In the RAM, various programs and data required for the operation of the device can also be stored. The computing unit, ROM, and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.
[0066] The electronic device of the present invention initializes the data sampling rate and the data prediction period by intelligently judging whether it is the first time to power on the battery pack when the battery pack is powered on, and predicts according to the battery data group within the data prediction period, and then continuously monitors the battery data according to the predicted future changes of the battery data group and dynamically adjusts the sampling frequency according to the trend of data changes in a preset future time period to optimize data acquisition, and at the same time adjusts the data prediction period of the battery data according to the data changes, and then adjusts the prediction frequency of the battery data group, thereby reducing the computing pressure of the system under normal circumstances and optimizing the use of storage resources; in the warning state and the emergency state, the prediction period is reduced and the prediction frequency of the battery data group is increased, so as to more flexibly respond to different operating states and improve the response flexibility of the system; by dynamically adjusting the sampling rate according to the operating state of the battery pack, the amount of data storage during normal battery operation can be reduced, and at the same time, when the battery state changes greatly, data sampling is increased to capture key state changes, which not only reduces unnecessary data storage but also improves the efficiency of data management. Specifically: when the battery pack is in normal operation, a preset lower sampling rate is used for data monitoring, which reduces the amount of data in the memory, thereby optimizing the use of storage resources; thus helping to reduce the storage burden, so that the memory can be used more effectively to store critical data. When the battery pack is in warning or emergency operation, increasing the sampling rate can more accurately capture changes in the battery state, which is crucial for subsequent data analysis and fault diagnosis; in this way, technicians can more accurately define the cause of the fault, whether it is due to battery usage problems or battery quality problems; and, in an emergency, the monitored data is stored as snapshot data in the snapshot file, and the file name is updated according to the fault information; the real-time update and snapshot storage mechanism ensures that the battery status data can be quickly accessed and analyzed at critical moments, further ensuring the safe operation and health management of the battery. At the same time, since the change amplitude and frequency of the battery data groups corresponding to the normal state, warning state and emergency state increase successively, the corresponding sampling frequency is set for this purpose, so as to adapt to the data monitoring needs of the battery pack under different operating conditions, and ensure the continuity and integrity of the data. The integrated intelligent data analysis tool of the present invention analyzes battery performance and health status in real time, predicts potential problems, reduces data processing requirements during low-change periods, thereby reducing storage requirements, avoids oversampling when the battery status is stable, and increases the sampling rate when the battery status changes significantly. It can capture key data points more accurately, thereby improving the relevance and accuracy of data analysis, optimizing the use of storage resources, enhancing data analysis accuracy, and ensuring that battery status data can be quickly accessed and analyzed at critical moments; and through continuous monitoring and adaptive adjustment, the battery management system can better cope with various situations during the operation of the battery pack and improve the robustness and reliability of the system.
[0067] An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the operating data storage method as described above is implemented.
[0068] In other words, a non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor performs the following operations: When the battery pack is in a powered-on state, determining whether the battery pack is powered-on for the first time, and setting a data sampling rate according to the determination result; Continuously monitoring the data of the battery pack according to the data sampling rate, obtaining a battery data group of the battery pack and storing it in a regular file; Executing a determination step, the determination step comprising determining the operating state of the battery pack according to changes in the battery data group within the data prediction period when the duration of monitoring the battery pack at the current data sampling rate reaches a data prediction period; When the operating state of the battery pack is normal, the data sampling rate is adjusted to a preset sampling rate, data monitoring of the battery pack is continued according to the preset sampling rate, the battery data group obtained by monitoring is stored in the regular file, and the determination step is returned to be executed; When the operating state of the battery pack is a warning state, adjusting the data sampling rate to a first sampling rate, continuing to monitor the data of the battery pack according to the first sampling rate, storing the battery data group obtained by monitoring into a regular file, and returning to execute the determination step; When the operating state of the battery pack is an emergency state, adjusting the data sampling rate to a second sampling rate, continuing to monitor the data of the battery pack according to the second sampling rate, storing the battery data group obtained by monitoring as snapshot data in a snapshot file, and returning to execute the determination step; Among them, the change amplitude and / or change frequency of the battery data groups corresponding to the normal state, the warning state and the emergency state increase successively, the preset sampling rate is less than the first sampling rate, and the first sampling rate is less than the second sampling rate.
[0069] The computer-readable storage medium of the present invention initializes the data sampling rate and the data prediction period by intelligently judging whether it is the first power-on when the battery pack is powered on, and predicts according to the battery data group within the data prediction period, and then continuously monitors the battery data according to the predicted future changes of the battery data group and dynamically adjusts the sampling frequency according to the trend of data changes in a preset future time period to optimize data acquisition, and at the same time adjusts the data prediction period of the battery data according to the data changes, and then adjusts the prediction frequency of the battery data group, thereby reducing the computing pressure of the system under normal circumstances and optimizing the use of storage resources; in the warning state and the emergency state, the prediction period is reduced and the prediction frequency of the battery data group is increased, so as to more flexibly respond to different operating states and improve the response flexibility of the system; by dynamically adjusting the sampling rate according to the operating state of the battery pack, the amount of data storage during normal operation of the battery can be reduced, and at the same time, when the battery state changes greatly, data sampling is increased to capture key state changes, which not only reduces unnecessary data storage but also improves the efficiency of data management. Specifically: when the battery pack is in normal operation, a preset lower sampling rate is used for data monitoring, which reduces the amount of data in the memory, thereby optimizing the use of storage resources; thus helping to reduce the storage burden, so that the memory can be used more effectively to store critical data. When the battery pack is in warning or emergency operation, increasing the sampling rate can more accurately capture changes in the battery state, which is crucial for subsequent data analysis and fault diagnosis; in this way, technicians can more accurately define the cause of the fault, whether it is due to battery usage problems or battery quality problems; and, in an emergency, the monitored data is stored as snapshot data in the snapshot file, and the file name is updated according to the fault information; the real-time update and snapshot storage mechanism ensures that the battery status data can be quickly accessed and analyzed at critical moments, further ensuring the safe operation and health management of the battery. At the same time, since the change amplitude and frequency of the battery data groups corresponding to the normal state, warning state and emergency state increase successively, the corresponding sampling frequency is set for this purpose, so as to adapt to the data monitoring needs of the battery pack under different operating conditions, and ensure the continuity and integrity of the data. The integrated intelligent data analysis tool of the present invention analyzes battery performance and health status in real time, predicts potential problems, reduces data processing requirements during low-change periods, thereby reducing storage requirements, avoids oversampling when the battery status is stable, and increases the sampling rate when the battery status changes significantly. It can capture key data points more accurately, thereby improving the relevance and accuracy of data analysis, optimizing the use of storage resources, enhancing data analysis accuracy, and ensuring that battery status data can be quickly accessed and analyzed at critical moments; and through continuous monitoring and adaptive adjustment, the battery management system can better cope with various situations during the operation of the battery pack and improve the robustness and reliability of the system.
[0070] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0071] 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.
[0072] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for storing running data, characterized in that: Applied to a battery management system, the operation data storage method includes: When the battery pack is in a powered-on state, determining whether the battery pack is powered-on for the first time, and setting a data sampling rate and a data prediction period according to the determination result; Continuously monitoring the data of the battery pack according to the data sampling rate, obtaining a battery data group of the battery pack and storing it in a regular file; Executing a judgment step, the judgment step comprising, when the duration of monitoring the battery pack according to the current data sampling rate reaches the data prediction period, predicting the change of the battery data group in a preset future time period according to the change of the battery data group in the data prediction period, to obtain the future change of the battery data group; Determining the operating state of the battery pack according to the future change of the battery data group within the preset future time period; When the operating state of the battery pack is normal, the data sampling rate is adjusted to a preset sampling rate, the data of the battery pack is continuously monitored according to the preset sampling rate, the battery data group obtained by monitoring is stored in the regular file, and the determination step is returned to be executed, and the data prediction period is adjusted to the first time period; When the operating state of the battery pack is a warning state, the data sampling rate is adjusted to a first sampling rate, data monitoring of the battery pack is continued at the first sampling rate, the battery data group obtained by monitoring is stored in a regular file, and the determination step is executed again, and the data prediction period is adjusted to a second time period; When the operating state of the battery pack is an emergency state, the data sampling rate is adjusted to a second sampling rate, the data of the battery pack is continuously monitored according to the second sampling rate, the battery data group obtained by monitoring is stored as snapshot data in a snapshot file, and the judgment step is executed again, and the data prediction period is adjusted to a third time period; Among them, the change amplitude and / or change frequency of the battery data groups corresponding to the normal state, the warning state and the emergency state increase successively, the preset sampling rate is less than the first sampling rate, the first sampling rate is less than the second sampling rate, the first time period is greater than the second time period, and the second time period is greater than the third time period.
2. The operation data storage method according to claim 1, characterized in that: The determining whether the battery pack is powered on for the first time and setting the data sampling rate and the data prediction period according to the determination result includes: When the battery pack is powered on, obtain the hardware running time of the battery management system; Determining whether the battery pack is powered on for the first time based on the hardware running time; If yes, initializing the data sampling rate to the preset sampling rate, and initializing the data prediction period to the first time period; If not, the historical sampling rate and historical prediction period recorded for the last time are used as the data sampling rate and the data prediction period respectively.
3. The operation data storage method according to claim 1, characterized in that: The continuously monitoring the data of the battery pack according to the data sampling rate to obtain the battery data group of the battery pack and store it in a regular file includes: Acquire parameter data of the battery pack according to the data sampling rate to obtain the battery data group of the battery pack; Detecting whether the file name corresponding to the battery data group contains an identifier indicating the latest state; If yes, open the regular file and write the battery data set to the end of the regular file; If not, the file name of the regular file is updated according to the battery data set, and then the battery data set is written to the end of the regular file.
4. The operation data storage method according to claim 3, characterized in that: The method of continuously monitoring the data of the battery pack according to the data sampling rate, obtaining the battery data group of the battery pack and storing the data in a conventional file further includes: Continuously monitoring and collecting data of the battery pack according to the data sampling rate, and continuously detecting whether the remaining storage space of the storage device where the conventional file is located is less than the storage space required by the battery data group to be written; If the detection result is that the remaining storage space of the storage device where the regular file is located is less than the storage space required by the battery data group to be written, then retrieving the timestamp associated with each battery data group in the regular file; According to the timestamps, the battery data groups are sorted and formed into a time series; Starting from the earliest battery data set in the time series, the battery data sets are deleted one by one until the remaining storage space of the regular file is greater than or equal to the storage space required by the battery data set to be written.
5. The operation data storage method according to claim 1, characterized in that: The determining the operating state of the battery pack according to the future change of the battery data group within the preset future time period includes: Acquire a plurality of the battery data groups within the preset future time period, each of the battery data groups including values of a plurality of parameters of the battery pack at a sampling time; When the value of each parameter of the battery pack in the preset future time period is within the normal threshold range corresponding to the parameter, determining that the operating state is a normal state; When a value of any one of the parameters of the battery pack in the preset future time period is within a warning threshold range corresponding to the parameter, determining that the operating state is a warning state; When a value of any one of the parameters of the battery pack in the preset future time period is within an emergency threshold range corresponding to the parameter, determining that the operating state is an emergency state; Among them, for each of the parameters, the maximum value of the normal threshold range corresponding to the parameter is less than or equal to the minimum value of the warning threshold range corresponding to the parameter, and the maximum value of the warning threshold range corresponding to the parameter is less than or equal to the minimum value of the emergency threshold range corresponding to the parameter.
6. The operation data storage method according to claim 5, characterized in that: When the operating state of the battery pack is an emergency state, adjusting the data sampling rate to a second sampling rate, continuing to monitor the data of the battery pack according to the second sampling rate, and storing the battery data group obtained by monitoring as snapshot data in a snapshot file, comprises: When the operating state of the battery pack is an emergency state, updating the file name of the battery data group of the battery pack according to the battery data group monitored according to the second sampling rate; The battery data group monitored according to the second sampling rate is written to the end of the snapshot file in the form of the updated file name.
7. The operation data storage method according to claim 5, characterized in that: Also includes: When the battery pack is shut down or in standby mode in the normal operating state, the hardware operating time of the battery management system is reset.
8. A running data storage system, characterized in that: include: A sampling rate setting unit, used for determining whether the battery pack is powered on for the first time when the battery pack is in a powered-on state, and setting a data sampling rate and a data prediction period according to the determination result; A storage adjustment unit, used for continuously monitoring the data of the battery pack according to the data sampling rate, obtaining a battery data group of the battery pack and storing it in a regular file; A judgment unit: used to execute a judgment step, wherein when the duration of monitoring the battery pack according to the current data sampling rate reaches a data prediction period, based on the change of the battery data group within the data prediction period, a prediction is made on the change of the battery data group within a preset future time period to obtain the future change of the battery data group; Determining the operating state of the battery pack according to the future change of the battery data group within the preset future time period; When the operating state of the battery pack is normal, the data sampling rate is adjusted to a preset sampling rate, the data of the battery pack is continuously monitored according to the preset sampling rate, the battery data group obtained by monitoring is stored in the regular file, and the determination step is returned to be executed, and the data prediction period is adjusted to the first time period; When the operating state of the battery pack is a warning state, the data sampling rate is adjusted to a first sampling rate, data monitoring of the battery pack is continued at the first sampling rate, the battery data group obtained by monitoring is stored in a regular file, and the determination step is executed again, and the data prediction period is adjusted to a second time period; When the operating state of the battery pack is an emergency state, the data sampling rate is adjusted to a second sampling rate, the data of the battery pack is continuously monitored according to the second sampling rate, the battery data group obtained by monitoring is stored as snapshot data in a snapshot file, and the judgment step is executed again, and the data prediction period is adjusted to a third time period; Among them, the change amplitude and / or change frequency of the battery data groups corresponding to the normal state, the warning state and the emergency state increase successively, the preset sampling rate is less than the first sampling rate, the first sampling rate is less than the second sampling rate, the first time period is greater than the second time period, and the second time period is greater than the third time period.
9. An electronic device, characterized in that: including memory and processor; The memory is used to store computer programs; The processor is used to implement the operation data storage method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the operation data storage method according to any one of claims 1 to 7 is implemented.