Log storage and analysis method and system in energy storage system

CN122507785APending Publication Date: 2026-08-04SHANGHAI ROBESTEC ENERGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610554260.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-24
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

1.海量日志查询响应慢:运维人员定位问题时,从数GB的CSV日志中筛选特定信息耗时过长,影响故障排查效率

Benefits of technology

[0020] The log storage and analysis scheme for energy storage systems provided in this application has the following beneficial effects: 1) It increases the conditional query speed of BMS logs by tens of times, greatly shortening the fault location time. 2) Through the transaction characteristics of the database, it ensures the integrity and reliability of log data, avoiding the problem of invalid logs due to power outages. 3) Through the database and query software, it avoids the problem of original data being tampered with due to human error when viewing data. 4) Utilizing the powerful query capabilities of relational databases, it realizes in-depth and correlational analysis of BMS operating status, providing a data foundation for battery health assessment and algorithm optimization. 5) By using binary storage and compression, the log file size of the same amount of data is reduced by 30%-70% compared to CSV format, reducing the cost of long-term data storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122507785A_ABST
    Figure CN122507785A_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a kind of energy storage system log storage and analysis method and system, its method includes: BMS will real-time acquisition time series data in running process is stored in time series data table in embedded database, while the event log collected is stored in event log table in embedded database;Log file export unit exports time series data table and event log table in the embedded database of the BMS to host computer;The host computer obtains the configurable data analysis model selected by user, and according to the data source defined in the configurable data analysis model and the query parameter input by user, automatically generates optimized SQL query statement, and according to the SQL query statement, extract the required data from the embedded database;The host computer uses the configurable data analysis model to analyze the required data, obtains analysis result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of energy storage system technology, and in particular to a method and system for log storage and analysis in an energy storage system. Background Technology

[0002] The Battery Management System (BMS) is the core control unit of an energy storage system, responsible for real-time monitoring of battery status and ensuring the safe operation of the energy storage system. During operation, the BMS generates massive amounts of time-series data (such as voltage, current, and temperature) and event logs (such as faults and state transitions). These logs are crucial for system state backtracking, fault diagnosis, performance analysis, and optimization.

[0003] In current energy storage systems, log analysis of the Battery Management System (BMS) is cumbersome and cannot quickly pinpoint problems, hindering overall data analysis and system optimization. Therefore, the existing technology suffers from the following main problems: 1. Slow response time for querying massive logs: When operations and maintenance personnel are locating problems, it takes too long to filter specific information from CSV logs of several gigabytes, which affects the efficiency of troubleshooting.

[0004] 2. Weak data analysis capabilities: Existing solutions struggle to support flexible and complex multi-condition combination queries and data correlation analysis, limiting the ability to extract valuable information from log data.

[0005] 3. Data security and integrity risks: Flat files are easily modified by mistake and lack protection mechanisms in the event of abnormal power outages, posing a risk of data loss or tampering.

[0006] 4. Fragmented log storage and analysis processes: Inconsistent storage formats and analysis tools lead to low data flow efficiency and make it difficult to form an integrated diagnostic loop.

[0007] 5. High long-term storage costs: Unstructured text logs occupy a large amount of storage space, making long-term preservation economically unfeasible. Summary of the Invention

[0008] In view of this, embodiments of this application provide a log storage and analysis method for an energy storage system. One or more embodiments of this application also relate to a log storage and analysis system for an energy storage system, a computing device, a computer-readable storage medium, and a computer program, to address the technical deficiencies existing in the prior art.

[0009] According to a first aspect of the embodiments of this application, a method for log storage and analysis in an energy storage system is provided, including: The BMS stores the real-time time-series data collected during operation into the time-series data table in the embedded database, and also stores the collected event logs into the event log table in the embedded database. The log file export unit exports the time-series data table and event log table from the embedded database of the BMS to the host computer; The host computer acquires the configurable data analysis model selected by the user, and automatically generates an optimized SQL query statement based on the data source defined in the configurable data analysis model and the query parameters input by the user, and extracts the required data from the embedded database based on the SQL query statement. The host computer uses the configurable data analysis model to analyze the required data and obtain the analysis results.

[0010] Preferably, the time-series data table uses timestamps as the primary key and index, and includes timestamps, voltage values ​​of each individual battery cell, temperature values ​​of each temperature measurement point, total battery pack voltage, total battery pack current, battery pack state of charge, battery pack health status, and battery cluster identifiers. The event log table uses the event code as the primary key and includes the event code, event level, event occurrence time, event description, battery cluster identifier, and association start and end times for associating with the time-series data table.

[0011] Preferably, the configuration content of the configurable data analysis model includes: defined basic model information, defined data source, defined input parameters, defined data processing pipeline, defined judgment rules, defined actions, defined output, and defined drill-down configuration.

[0012] Preferably, before the host computer obtains the configurable data analysis model selected by the user, it further includes: When the analysis software running on the host computer starts, it scans all configurable data analysis model configuration files in the specified directory, calls the configuration parser to convert each configurable data analysis model configuration file into a model object in memory, and registers the parsed model object into the model manager so that it can be displayed to the user in the model list on the software interface, so that the user can select a configurable data analysis model from the model list.

[0013] Preferably, the host computer uses the configurable data analysis model to analyze the required data, and the analysis results include: The host computer processes the required data sequentially according to the data processing pipeline defined in the configurable data analysis model to obtain the data processing results. The host computer performs rule judgment on the data processing results according to the judgment rules defined in the configurable data analysis model, and obtains the rule judgment result. The host computer executes and outputs actions based on the actions and outputs defined in the configurable data analysis model, according to the rule judgment results.

[0014] Preferably, it further includes: The host computer obtains the user-selected combination of configurable data analysis models, and automatically generates optimized SQL join query statements based on multiple data sources defined in the combination of configurable data analysis models and multiple query parameters input by the user. Based on the SQL join query statements, it extracts the required data from multiple embedded databases. The host computer uses the combined configurable data analysis model to analyze the data extracted from multiple embedded databases and obtain the analysis results.

[0015] Preferably, the BMS stores the real-time time-series data collected during operation into the time-series data table in the embedded database according to the set time period using an automatic table partitioning strategy. At the same time, it maintains a UNION view, which merges all partitioned tables into a single logical table. The upper-layer application does not need to be aware of the specific partitioned table structure when querying. The BMS stores the collected event logs in the event log table of the embedded database. At the same time, it determines the range of time-series data to be associated based on the event type and stores the start and end timestamps as foreign keys in the event log table to establish an event-data association.

[0016] According to a second aspect of the embodiments of this application, a log storage and analysis system for an energy storage system is provided, comprising: The BMS is configured to store real-time time-series data collected during operation into a time-series data table in an embedded database, and simultaneously store the collected event logs into an event log table in the embedded database. The log file export unit is configured to export the time-series data table and event log table in the embedded database of the BMS to the host computer. The host computer is configured to acquire the configurable data analysis model selected by the user, and automatically generate an optimized SQL query statement based on the data source defined in the configurable data analysis model and the query parameters input by the user. Based on the SQL query statement, the host computer extracts the required data from the embedded database and analyzes the required data using the configurable data analysis model to obtain the analysis results.

[0017] According to a third aspect of the embodiments of this application, a computing device is provided, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement any of the steps of the log storage and analysis method in the energy storage system.

[0018] According to a fourth aspect of the embodiments of this application, a computer-readable storage medium is provided that stores computer-executable instructions, which, when executed by a processor, implement the steps of the log storage and analysis method in any of the energy storage systems described above.

[0019] According to a fifth aspect of the present application, a computer program is provided, wherein when the computer program is executed in a computer, it causes the computer to perform the steps of the log storage and analysis method in the above-described energy storage system.

[0020] The log storage and analysis scheme for energy storage systems provided in this application has the following beneficial effects: 1) It increases the conditional query speed of BMS logs by tens of times, greatly shortening the fault location time. 2) Through the transaction characteristics of the database, it ensures the integrity and reliability of log data, avoiding the problem of invalid logs due to power outages. 3) Through the database and query software, it avoids the problem of original data being tampered with due to human error when viewing data. 4) Utilizing the powerful query capabilities of relational databases, it realizes in-depth and correlational analysis of BMS operating status, providing a data foundation for battery health assessment and algorithm optimization. 5) By using binary storage and compression, the log file size of the same amount of data is reduced by 30%-70% compared to CSV format, reducing the cost of long-term data storage. Attached Figure Description

[0021] Figure 1 This is a flowchart of a log storage and analysis method in an energy storage system according to an embodiment of this application; Figure 2 This is a schematic diagram of the overall system architecture provided in one embodiment of this application; Figure 3 This is a diagram of the embedded database table structure provided in one embodiment of this application. Figure 4 This is a flowchart of log data writing and transaction processing provided in one embodiment of this application; Figure 5 This is a schematic diagram of a log storage and analysis system in an energy storage system according to an embodiment of this application; Figure 6 This is a structural block diagram of a computing device provided in one embodiment of this application. Detailed Implementation

[0022] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. In the following description, suffixes such as "module," "part," or "unit" used to denote elements are used only for the purpose of illustrative purposes and have no inherent meaning. Therefore, "module," "part," or "unit" may be used interchangeably.

[0023] This application provides a log storage and analysis method for an energy storage system. This application also relates to a log storage and analysis system for an energy storage system, a computing device, a computer-readable storage medium, and a computer program, which will be described in detail in the following embodiments.

[0024] Figure 1 The flowchart illustrates a log storage and analysis method in an energy storage system according to an embodiment of this application, which specifically includes the following steps: Step S101: The BMS stores the real-time time-series data collected during operation into the time-series data table in the embedded database, and at the same time stores the collected event logs into the event log table in the embedded database; In one specific embodiment of this application, the time-series data table uses timestamps as the primary key and index, and includes timestamps, voltage values ​​of each individual battery cell, temperature values ​​of each temperature measurement point, total battery pack voltage, total battery pack current, battery pack state of charge, battery pack health status, and battery cluster identifiers; the event log table uses event codes as the primary key, and includes event codes, event levels, event occurrence times, event descriptions, battery cluster identifiers, and association start and end times for associating with the time-series data table.

[0025] In one specific embodiment of this application, the BMS stores the real-time time-series data collected during operation into a time-series data table in the embedded database according to a set time period using an automatic table partitioning strategy. Simultaneously, it maintains a UNION view that merges all partitioned tables into a single logical table, so that upper-layer applications do not need to be aware of the specific table partitioning structure when querying. The BMS also stores the collected event logs into an event log table in the embedded database. Furthermore, it determines the range of time-series data to be associated based on the event type and stores the start and end timestamps as foreign keys in the event log table, establishing an event-data association.

[0026] Step S102: The log file export unit exports the time-series data table and event log table from the embedded database of the BMS to the host computer; Step S103: The host computer obtains the configurable data analysis model selected by the user, and automatically generates an optimized SQL query statement based on the data source defined in the configurable data analysis model and the query parameters input by the user, and extracts the required data from the embedded database based on the SQL query statement; In one specific embodiment of this application, the configuration content of the configurable data analysis model includes: defined basic model information, defined data source, defined input parameters, defined data processing pipeline, defined judgment rules, defined actions, defined output, and defined drill-down configuration.

[0027] In one specific embodiment of this application, before the host computer obtains the configurable data analysis model selected by the user, it further includes: When the analysis software running on the host computer starts, it scans all configurable data analysis model configuration files in the specified directory, calls the configuration parser to convert each configurable data analysis model configuration file into a model object in memory, and registers the parsed model object into the model manager so that it can be displayed to the user in the model list on the software interface, so that the user can select a configurable data analysis model from the model list.

[0028] Step S104: The host computer uses the configurable data analysis model to analyze the required data and obtain the analysis results.

[0029] In one specific embodiment of this application, the host computer uses the configurable data analysis model to analyze the required data, and the analysis results include: The host computer processes the required data sequentially according to the data processing pipeline defined in the configurable data analysis model to obtain the data processing results. The host computer performs rule judgment on the data processing results according to the judgment rules defined in the configurable data analysis model, and obtains the rule judgment result. The host computer executes and outputs actions based on the actions and outputs defined in the configurable data analysis model, according to the rule judgment results.

[0030] In one specific embodiment of this application, it further includes: The host computer obtains the user-selected combination of configurable data analysis models, and automatically generates optimized SQL join query statements based on multiple data sources defined in the combination of configurable data analysis models and multiple query parameters input by the user. Based on the SQL join query statements, it extracts the required data from multiple embedded databases. The host computer uses the combined configurable data analysis model to analyze the data extracted from multiple embedded databases and obtain the analysis results.

[0031] This application enables efficient storage, rapid retrieval, and location of BMS logs, while supporting in-depth intelligent analysis of complete data, significantly improving data reliability, analysis efficiency, and system maintainability, and reducing the space occupied by long-term storage.

[0032] The following is combined Figures 2-4 The present invention will be further described. like Figure 2 As shown, the system architecture of the present invention includes: Embedded storage unit: Integrated into the BMS controller, it uses a lightweight embedded database (such as SQLite) to store log data, providing an efficient and reliable data foundation for upper-level analysis.

[0033] Log file export unit: Supports exporting database files to the host computer.

[0034] Intelligent analysis software: running on a host computer (PC, server), the core of which includes a configurable analysis model engine, a multi-source data fusion module, a deep interactive visualization module, and a report generation module.

[0035] Furthermore, during operation, the embedded storage unit (BMS) writes the collected time-series data into the time-series data table in real time or in batches using INSERT statements or pre-compiled commands in Structured Query Language (SQL).

[0036] When events such as status changes or fault alarms occur, the event information and associated context data (which can reference specific records in the time series data table) are written to the event log table.

[0037] The write process employs a database transaction mechanism. Multiple insert operations within a certain time window or data volume are merged into a single transaction for commit. This reduces I / O operations and improves efficiency, while ensuring that committed data is not lost in the event of an unexpected power outage, and that uncommitted data is automatically rolled back, thus guaranteeing log consistency.

[0038] To support upper-level intelligent analysis, the embedded storage subsystem adopts the following optimized design: (1) Database table structure design The embedded database contains two core data tables: The time-series data table stores battery operating parameters sampled at high frequencies by the BMS. This table uses timestamps as the primary key and index to ensure the uniqueness of the time-series data and query efficiency. The table includes the following fields: timestamp, voltage value of each individual cell, temperature value of each measurement point, total battery pack voltage, total current, state of charge (SOC), state of health (SOH), and a battery cluster identifier field to support multi-cluster fusion analysis. All analog data is amplified and stored as integers before storage to reduce storage space usage.

[0039] The event log table stores various events triggered by the BMS. This table uses an auto-incrementing event ID as the primary key and contains the following fields: event code, event level, event occurrence time, event description, and battery cluster identifier. Specifically, this table has two foreign key fields—association start time and association end time—used to point to the range of data records in the time-series data table related to the event. For example, when an overvoltage fault occurs, the system records the time range from 10 seconds before the fault to 5 seconds after the fault as a foreign key, establishing a precise association between the event and the time-series data. Both of these foreign key fields reference the timestamp field in the time-series data table.

[0040] (2) Storage optimization mechanism The system adopts a write-ahead log mode to improve write concurrency performance, allowing other low-priority tasks to read data without being blocked while the BMS is writing to the log.

[0041] To achieve data lifecycle management, the system employs an automatic table partitioning strategy: tables are automatically created daily, with table names including the date information. For example, data from March 6th is written to a partition named "Time Series Data Table_20260306". To simplify upper-level queries, the system creates a unioned view, which merges data from all partitioned tables to present a single logically large table. Upper-level applications only need to access this view for queries, without needing to be aware of the specific partitioned table structure.

[0042] For cold data older than 3 months, the system automatically performs compression and archiving: it identifies old tables older than 3 months and performs space reclamation operations on these tables to reduce storage usage. The compressed cold data can still be accessed transparently through federated views, making it completely transparent to the analysis software, thus achieving a balance between high-performance read / write of hot data and low-cost storage of cold data.

[0043] Furthermore, the intelligent analysis software provides analysis software that runs on a host computer (such as a PC or server), and can directly read and parse the embedded database log files (.db files) generated by the BMS. The software provides a graphical query interface, allowing users to select conditions such as time range, data type, and fault code. The software automatically generates optimized SQL query statements, executes the queries, and quickly returns the results.

[0044] The software provides multi-dimensional visualization analysis capabilities: Configurable Data Analysis Model: This application defines a concise and expressive configuration syntax, employing a structured format that is easy to write and maintain. The core elements of the configuration syntax include:

[0045] The following example illustrates the configuration of a thermal runaway analysis model: The configuration details are as follows: First, define the basic information of the model, including the model name "Thermal Runaway Risk Assessment", version number, author, and functional description.

[0046] In the data source definition section, the main data table is specified as a time series data table, and the query is filtered according to the time range entered by the user and the selected battery cluster.

[0047] In the input parameter definition section, define the following parameters: temperature data of each individual unit (obtained from the database), alarm threshold (default 60℃), warning threshold (default 55℃), temperature rise rate threshold (default 0.5℃ / second), and analysis time window (default 60 seconds).

[0048] The data processing pipeline consists of three steps: The first step is to calculate the highest cell temperature at each time point, which is achieved by taking the maximum value of all cell temperature values.

[0049] The second step is to calculate the rate of temperature rise by using a linear regression method within a sliding window to calculate the derivative of the temperature curve.

[0050] The third step is optional smoothing, which involves applying a moving average filter to the temperature rise rate to remove noise.

[0051] The rules engine defines three judgment rules: "High Temperature Alarm" rule: Triggered when the highest temperature exceeds the alarm threshold, the action is to record the alarm event of severity level and mark the data point in red on the interface.

[0052] "Rapid Temperature Rise Warning" rule: Triggered when the smoothed temperature rise rate exceeds the threshold and the highest temperature exceeds the warning threshold. The action is to record the alarm event at the warning level and mark the data segment in yellow on the interface.

[0053] The "Continuous High Temperature Monitoring" rule is triggered when the highest temperature exceeds the warning threshold and lasts for more than 10 minutes. The action is to record the alarm event at the prompt level and mark the data segment in orange on the interface.

[0054] The output definition section specifies the output content of the model: the curve output includes the highest temperature curve and the temperature rise rate curve, where the highest temperature curve will automatically change color according to the threshold.

[0055] The event output includes all triggered alarm events, including the occurrence time, level, description, and the battery cluster to which they belong.

[0056] The statistical summary includes whether an alarm exists, the number of alarms, the highest temperature value and its occurrence time, the cluster number of the highest temperature, the maximum temperature rise rate, and the overall risk level (low / medium / high). The drill-up configuration section defines two levels of drill-up: clicking on cluster-level data allows drilling down to a detailed view of that cluster, passing the cluster number as a parameter; clicking on individual data allows further drilling down to a detailed view of that individual, passing the cluster number and individual index as parameters.

[0057] The model's hot-loading mechanism: The analysis software adopts a plug-in architecture, and the core engine's operation flow is as follows: When the software starts, it scans all model configuration files in the specified directory. For each found configuration file, it calls the configuration parser to parse the syntax, converting the configuration file content into a model object in memory. The parsed model object is registered in the model manager and displayed to the user in the model list on the software interface. The software provides a "reload model" function, allowing users to modify configuration files without restarting the software; clicking this function will immediately apply the new or modified model.

[0058] This mechanism allows for the addition or modification of analysis models without requiring any changes to the software code or recompilation. Field engineers can quickly customize new analysis logic based on actual needs, and the R&D team can rapidly iterate algorithms, greatly improving the system's flexibility and maintainability.

[0059] Model Composition and Nesting: The configuration syntax supports the combined use of models. For example, a "Comprehensive Health Assessment Model" can be defined, which internally references a thermal runaway analysis model, a consistency analysis model, and a life prediction model. During execution, each sub-model is called sequentially, their analysis results are obtained, and a comprehensive score is performed based on these results to output the final health assessment conclusion. This nesting mechanism allows complex analysis tasks to be decomposed into multiple reusable sub-models, improving the modularity and maintainability of the configuration.

[0060] Furthermore, the intelligent analysis software includes: The configurable analysis model engine is responsible for parsing, managing, and executing various analysis models. Its specific functions include: Model loading and management: At startup, the system scans the model configuration files in the specified directory, parses and registers them to the model manager, and supports hot reloading of models; Configuration syntax parsing: Converts custom structured configuration files into in-memory model objects, containing information such as input parameters, data processing pipelines, rule engines, and output definitions; Data query generation: Based on the data source definition in the model configuration and the parameters input by the user, automatically generate optimized SQL query statements to extract the required data from the embedded database; Data processing pipeline execution: Data processing is performed in the order of steps defined in the model configuration, including aggregation calculation, derivative calculation, smoothing filtering, statistical operations, etc. Rule engine execution: Evaluate the rule conditions for each piece of processed data, and trigger the corresponding action (alarm, highlight, record, etc.) when the conditions are met. Formatted output results: The processing results and triggered events are formatted into a standard data structure according to the output definition in the model configuration for presentation by the visualization module.

[0061] The multi-source data fusion module is responsible for acquiring data from multiple data sources and performing unified processing. Its specific functions are as follows: Data source identification: Automatically identify log files of different battery clusters by using file naming rules or cluster identifier fields in the database; Data source management: Maintains multiple data source connection pools and supports opening multiple database files simultaneously; Cross-source query: Automatically generate a joint query statement based on the user-selected list of battery clusters to retrieve data from multiple data sources; Data normalization: unifies the data format of different data sources into a standard data structure, eliminating the problem of inconsistent formats caused by differences in devices; Data caching: Caching frequently queried data reduces repetitive I / O operations and improves query performance; Data validation: Check the integrity and validity of imported data and mark abnormal data.

[0062] The deep interactive visualization module is responsible for presenting analysis results in an intuitive and efficient manner and responding to user interactions. Its specific functions include: Multi-level view rendering: Supports multiple levels of interface rendering, including system-level overview, cluster-level detailed view, individual-level detailed view, and time-segment zoom view; Intelligent color coding: Based on the rules configured in the model, curves and data points are automatically colored: green for normal data, yellow for warnings, and red for alarms; Multi-view linkage: Enables synchronized linkage between line charts, event lists, data tables, and statistical reports; clicking any view will automatically update the other views. Interactive event handling: Respond to user actions such as clicking, selecting, and dragging, and execute corresponding data queries and view updates; Real-time statistical calculation: When the user selects a time period, the statistical characteristics (maximum, minimum, average, standard deviation) of that time period are calculated in real time.

[0063] The report generation module is responsible for solidifying the analysis results into a structured report that can be archived and shared. Its specific functions are: Report template management: Supports predefined report templates, allowing users to customize report styles and content structures; Content collection: Automatically collects key information from the current analysis session, including analysis parameters, curve screenshots, event lists, statistical summaries, diagnostic conclusions, etc. Visual screenshot: Automatically captures a screenshot of the current curve view to ensure that the report includes intuitive graphical information; Report rendering: Format the collected content into PDF, HTML, or Markdown format according to the selected template; Report Export: Saves the generated report to a user-specified location, supporting custom filenames; Report archiving: Automatically archives generated reports to a specified directory for easy historical retrieval.

[0064] Data security and optimization mechanisms: Data verification: CRC or hash verification can be performed before and after data is written to the database to ensure the correctness of the stored data.

[0065] Storage optimization: Supports automatic table partitioning (e.g., creating new tables daily) and archiving of old data. SQLite's compression extension can be enabled, or database files can be compressed periodically to save storage space.

[0066] Access control: The analysis software can perform read-only access to the database file to prevent accidental damage to the original logs.

[0067] Example Step 1: Database Construction and Initialization: During the BMS software initialization phase, the system checks if a database file exists on the storage medium. If not, a new SQLite database file is created, and the table creation SQL statements are executed. For example: CREATE TABLE IF NOT EXISTS time_series_data ( timestamp INTEGER PRIMARY KEY, cell_voltage_1 INTEGER, ... pack_temp REAL, soc REAL ); CREATE INDEX idx_time ON time_series_data(timestamp); Step 2, runtime log storage: such as Figure 4 As shown, the BMS packages the data from the acquisition buffer in the main loop or during a timed interrupt. Every N records accumulated (e.g., 50 records) or every T time interval (e.g., 1 second), a database transaction is started, INSERT operations are executed in batches, and then the transaction is committed. When an event occurs, the event information is immediately inserted into the event log table.

[0068] During the BMS software initialization phase, the system first checks if the database file exists on the storage medium. If the file does not exist, a new SQLite database file is created, and table creation statements are executed to create time-series data tables, event log tables, and system metadata tables. After table creation, the system enables Write-Ahead Logging (WAL) mode to improve write concurrency performance and sets the synchronization mode to NORMAL to balance security and write speed. Finally, the system creates a UNION view for subsequent transparent access to the partitioned table data.

[0069] Each time the BMS powers on, the system performs a database integrity check (PRAGMA integrity_check) to ensure that the database files are not corrupted. If an anomaly is detected, the system attempts to recover from the WAL log. If recovery fails, the database is rebuilt from a pre-configured backup file, ensuring uninterrupted log recording.

[0070] In terms of runtime log storage, the BMS collects sensor data in the main loop or during timed interrupts. Every time a certain number of records are accumulated (e.g., 50 records) or at fixed intervals (e.g., 1 second), the system initiates a database transaction, writing time-series data in batches using pre-compiled INSERT statements. After the batch write is complete, the transaction is committed, reducing I / O operations and ensuring data consistency. When events such as status changes or fault alarms occur, the system immediately writes the event information to the event log table. Simultaneously, based on the event type, it determines the range of time-series data to be associated (e.g., 10 seconds before the fault to 5 seconds after the fault), and stores the start and end timestamps as foreign keys in the event log table, establishing a precise event-data relationship. Figure 3 As shown.

[0071] The system also implements an automatic table partitioning mechanism: every morning at midnight, the system checks the current date; if a new day is detected, it automatically creates a new partitioned table (e.g., time_series_data_20260307), and subsequent data is written to the new table. Simultaneously, the system maintains a UNION view, which merges all partitioned tables into a single logical table using the UNION ALL operation, so upper-level applications do not need to be aware of the specific partitioned table structure when querying.

[0072] For cold data older than 3 months, the system automatically implements a compression and archiving strategy: it identifies old tables older than 3 months, performs VACUUM operations on these tables, or enables SQLite's compression extension to reduce storage space usage. The compressed cold data can still be accessed transparently through UNION views, making it completely transparent to the analysis software.

[0073] Step 3: Host Computer Analysis Process: 1. Users use analysis software to open the .db log file exported from the BMS device.

[0074] 2. In the software interface, select the start time and end time, and check the parameters to be analyzed (such as "maximum unit voltage" and "minimum temperature").

[0075] 3. The software converts the conditions into the following SQL statement for execution: SELECT timestamp, cell_voltage_1, ..., pack_temp FROM time_series_data WHERE timestamp BETWEEN ? AND ? ORDER BY timestamp; 4. The software renders the query results as a curve and simultaneously queries the event log table for the corresponding time period, displaying the events as markers on the curve.

[0076] 5. Users can click on the event marker to view event details and zoom in to view more detailed data waveforms before and after the event.

[0077] The intelligent analysis software employs a plug-in architecture, with a configurable model engine at its core. Upon startup, the software scans all model configuration files (e.g., those with the .model or .json extension) in a specified directory, calls a configuration parser to convert the configuration files into in-memory model objects, and registers the parsed models in the model manager, displaying them to the user through the software interface. The software provides a "reload model" function, allowing users to modify configuration files without restarting the software; a single click reload makes the new model effective.

[0078] Once a user selects a model and sets its parameters, the model engine begins execution. First, based on the data source definition in the model configuration and the user-input parameters, the engine automatically generates an optimized SQL query and retrieves the required data from the embedded database. Then, the engine executes each processing step sequentially according to the "data processing pipeline" defined in the model configuration, such as aggregation calculations (maximum, minimum, and average values), sliding window derivative calculations, and smoothing filtering. After processing, the engine inputs the result data into the rule engine, which evaluates each rule condition in the model configuration. When a condition is met, it triggers a corresponding action, such as recording an alarm event or highlighting abnormal data on the interface. Finally, according to the output definition in the model configuration, the engine formats the processing results and triggered events into standard output for presentation by the visualization module.

[0079] Visual Interaction Implementation: The visualization module of the analysis software implements multi-level drill-down and view linkage functions. The system maintains a navigation stack to record the user's exploration path. When the user clicks on a battery cluster in the cluster-level overview interface, the system pushes the current view onto the navigation stack, then creates a cluster-level detailed view, inheriting the time range and context information of the parent view, queries the detailed data of the cluster, and renders it. When the user clicks on an individual cell in the cluster-level view, the system further drills down to the individual cell-level detailed view, queries the complete historical data of that individual cell, automatically calculates statistical characteristics (maximum, minimum, average, standard deviation), and displays them on the interface.

[0080] The software implements a multi-view linkage mechanism: when a user clicks on a data point on the graph, the event list automatically scrolls to the event that occurred at that moment and highlights it, and the data table also automatically scrolls to the corresponding row. When a user selects a time period on the graph, all views automatically and synchronously zoom to that time period, and the statistical reports are updated in real time to show the local statistics within that time period.

[0081] The intelligent color coding module automatically colors curves and data according to the rules configured in the model: normal range data is displayed in green, warning range in yellow, alarm range in red, and watch range in orange. When data approaches the threshold, the color gradually transitions, providing an intuitive warning.

[0082] The report generation module supports exporting the current analysis results to PDF or HTML format. After the user clicks "Generate Report," the system automatically collects the current analysis parameters, key curve screenshots, event list, statistical summary, and diagnostic conclusions, formats them into a structured report according to a preset template, and saves it to the user's specified location.

[0083] Multi-source data fusion implementation: The software supports importing log files from multiple battery clusters simultaneously. After the user selects a directory containing multiple log files, the software automatically identifies the data source based on file naming rules (e.g., cluster01_20260306.db) or the cluster_id field in the database, and creates a data source object for each cluster. During querying, the software automatically generates a union query statement based on the user-selected cluster list, retrieving data from multiple database files. In visualization, the software overlays key indicator curves of each cluster on the same coordinate system, using different colors and line styles to distinguish different clusters. Simultaneously, the software automatically identifies battery clusters exhibiting abnormal performance based on statistical methods (e.g., outlier detection), highlighting them in the cluster list.

[0084] Figure 5 This illustration shows a schematic diagram of the structure of a log storage and analysis system in an energy storage system according to an embodiment of this application. Figure 5 As shown, the system includes: a BMS (Battery Management System), configured to store real-time collected time-series data in a time-series data table in an embedded database, and simultaneously store collected event logs in an event log table in the embedded database; a log file export unit, configured to export the time-series data table and event log table from the BMS's embedded database to a host computer; and a host computer, configured to acquire a configurable data analysis model selected by the user, automatically generate optimized SQL query statements based on the data source defined in the configurable data analysis model and the query parameters input by the user, extract the required data from the embedded database based on the SQL query statements, and analyze the required data using the configurable data analysis model to obtain analysis results.

[0085] The above is an illustrative scheme of a log storage and analysis system in an energy storage system according to this embodiment. It should be noted that the technical solution of the log storage and analysis system in this energy storage system belongs to the same concept as the technical solution of the log storage and analysis method in the energy storage system described above. Details not described in detail in the technical solution of the log storage and analysis system in the energy storage system can be found in the description of the technical solution of the log storage and analysis method in the energy storage system described above.

[0086] Figure 6 A structural block diagram of a computing device 400 according to an embodiment of this application is shown. The components of the computing device 400 include, but are not limited to, a memory 410 and a processor 420. The processor 420 is connected to the memory 410 via a bus 430, and a database 450 is used to store data.

[0087] The computing device 400 also includes an access device 440, which enables the computing device 400 to communicate via one or more networks 460. Examples of these networks include a Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the Internet. The access device 440 may include one or more of any type of wired or wireless network interface (e.g., a Network Interface Card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) interface, a Wi-MAX interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.

[0088] In one embodiment of this application, the aforementioned components of the computing device 400 and Figure 6 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 6 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this application. Those skilled in the art can add or replace other components as needed.

[0089] The computing device 400 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or PCs. The computing device 400 can also be a mobile or stationary server.

[0090] The processor 420 is used to execute the following computer-executable instructions, which, when executed by the processor, implement the steps of the log storage and analysis method in the above-mentioned energy storage system.

[0091] An embodiment of this application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the log storage and analysis method in the above-described energy storage system.

[0092] An embodiment of this application also provides a computer program, wherein when the computer program is executed in a computer, it causes the computer to perform the steps of the log storage and analysis method in the above-described energy storage system.

[0093] The above are illustrative schemes of a computing device, a computer-readable storage medium, and a computer program according to this embodiment. It should be noted that each technical solution belongs to the same concept as the log storage and analysis method in the energy storage system described above. Details not described in detail for each technical solution can be found in the description of the log storage and analysis method in the energy storage system described above.

[0094] The preferred embodiments of the present invention have been described above with reference to the accompanying drawings, but this does not limit the scope of the invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and spirit of the present invention should be within the scope of the present invention.

Claims

1. A method for log storage and analysis in an energy storage system, characterized by, include: BMS stores the real-time collected time-series data during operation into the time-series data table in the embedded database, and also stores the collected event logs into the event log table in the embedded database. The log file export unit exports the time-series data table and event log table from the embedded database of the BMS to the host computer; The host computer acquires the configurable data analysis model selected by the user, and automatically generates an optimized SQL query statement based on the data source defined in the configurable data analysis model and the query parameters input by the user, and extracts the required data from the embedded database based on the SQL query statement. The host computer uses the configurable data analysis model to analyze the required data and obtain the analysis results.

2. The method of claim 1, wherein, The time-series data table uses timestamps as the primary key and index. The time-series data table includes timestamps, voltage values ​​of each individual cell, temperature values ​​of each temperature measurement point, total battery pack voltage, total battery pack current, battery pack state of charge, battery pack health status, and battery cluster identifiers. The event log table uses the event code as the primary key and includes the event code, event level, event occurrence time, event description, battery cluster identifier, and association start and end times for associating with the time-series data table.

3. The method of claim 1, wherein, The configuration content of the configurable data analysis model includes: defined basic model information, defined data source, defined input parameters, defined data processing pipeline, defined judgment rules, defined actions, defined output, and defined drill-down configuration.

4. The method of claim 3, wherein, Before the host computer obtains the configurable data analysis model selected by the user, it also includes: When the analysis software running on the host computer starts, it scans all configurable data analysis model configuration files in the specified directory, calls the configuration parser to convert each configurable data analysis model configuration file into a model object in memory, and registers the parsed model object into the model manager so that it can be displayed to the user in the model list on the software interface, so that the user can select a configurable data analysis model from the model list.

5. The method of claim 4, wherein, The host computer uses the configurable data analysis model to analyze the required data, and the analysis results include: The host computer processes the required data sequentially according to the data processing pipeline defined in the configurable data analysis model to obtain the data processing results. The host computer performs rule judgment on the data processing results according to the judgment rules defined in the configurable data analysis model, and obtains the rule judgment result. The host computer executes and outputs actions based on the actions and outputs defined in the configurable data analysis model, according to the rule judgment results.

6. The method of claim 1, wherein, Also includes: The host computer obtains the user-selected combination of configurable data analysis models, and automatically generates optimized SQL join query statements based on multiple data sources defined in the combination of configurable data analysis models and multiple query parameters input by the user. Based on the SQL join query statements, it extracts the required data from multiple embedded databases. The host computer uses the combined configurable data analysis model to analyze the data extracted from multiple embedded databases and obtain the analysis results.

7. The method of claim 2, wherein, The BMS collects time-series data in real time during operation and stores it in the time-series data table of the embedded database according to the set time period using an automatic table partitioning strategy. At the same time, it maintains a UNION view, which merges all partitioned tables into a single logical table. Upper-layer applications do not need to be aware of the specific partitioned table structure when querying. The BMS stores the collected event logs in the event log table of the embedded database. At the same time, it determines the range of time-series data to be associated based on the event type and stores the start and end timestamps as foreign keys in the event log table to establish an event-data association.

8. A log storage and analysis system in an energy storage system, characterized by, include: The BMS is configured to store real-time time-series data collected during operation into a time-series data table in an embedded database, and simultaneously store the collected event logs into an event log table in the embedded database. The log file export unit is configured to export the time-series data table and event log table in the embedded database of the BMS to the host computer. The host computer is configured to acquire the configurable data analysis model selected by the user, and automatically generate an optimized SQL query statement based on the data source defined in the configurable data analysis model and the query parameters input by the user. Based on the SQL query statement, the host computer extracts the required data from the embedded database and analyzes the required data using the configurable data analysis model to obtain the analysis results.

9. A computing device, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, they implement the steps of the log storage and analysis method in the energy storage system according to any one of claims 1 to 7.

10. A computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the log storage and analysis method in the energy storage system according to any one of claims 1 to 7.