A data acquisition method and device of a portable energy storage power station detection equipment

By using mirrored port acquisition and multi-layer protocol parsing, combined with three-level caching and backup channel switching, the problem of data loss during network interruption of portable energy storage power station testing equipment has been solved, realizing continuous data acquisition and improving equipment reliability.

CN122496729APending Publication Date: 2026-07-31HUANENG CLEAN ENERGY RES INST +2
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HUANENG CLEAN ENERGY RES INST
Filing Date
2026-03-13
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing portable energy storage power station testing equipment is prone to data interruption when the network is down, lacks an effective buffering mechanism, resulting in data loss, and has a slow network fault response speed, affecting operation and maintenance efficiency and the continuity of data collection.

Method used

Real-time data streams are collected through mirror ports, and multi-layer protocol parsing and validity verification are performed. A three-level caching mechanism and multi-mode backup channel switching are established to ensure the continuity and reliability of data during network interruptions.

Benefits of technology

It enables uninterrupted data acquisition in complex network environments, improves the reliability and plug-and-play nature of the equipment, and ensures the integrity and continuity of the data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122496729A_ABST
    Figure CN122496729A_ABST
Patent Text Reader

Abstract

This invention proposes a data acquisition method and device for portable energy storage power station testing equipment. The invention includes: S1 acquiring real-time data streams through a mirror port, parsing multi-layer protocols of the messages, and extracting data values, data references, quality attributes, and timestamps; S2 performing validity verification and time synchronization correction on the parsed data, converting it to a unified unit system and standard time format, storing it in a real-time memory database, and asynchronously writing it to persistent storage; S3 monitoring data packets and link status, triggering a three-level caching mechanism and recording breakpoint information when communication is interrupted; S4 verifying the cached data and retransmitting it in sequence after communication is restored, automatically switching to a backup channel for reduced-dimensional acquisition and marking path identifiers when the main channel fails. This invention improves the integrity, real-time performance, and reliability of data acquisition, realizes data caching and recovery during communication interruptions, ensures continuous acquisition links, and adapts to the complex operating conditions of energy storage power station testing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of energy storage technology, and in particular to a data acquisition method and device for a portable energy storage power station testing equipment. Background Technology

[0002] As a key component of the new energy system, energy storage power stations have seen rapid growth in installed capacity in recent years. With increasingly stringent requirements for the reliability and safety of energy storage equipment in power systems, portable condition monitoring devices have become crucial technologies for preventative maintenance, fault diagnosis, and performance evaluation in energy storage power stations. Specifically, the core function of these devices relies on the real-time acquisition of operating data from the Battery Management System (BMS), Power Conversion System (PCS), and transformers. In related technologies, industrial sites commonly employ a communication architecture based on the IEC 61850 standard. Through the collaborative operation of the MMS protocol and the Reporting Control Block (RCB), a complete data acquisition system covering data model acquisition, real-time stream subscription, and parsing is constructed.

[0003] However, existing methods have significant limitations. Traditional methods rely entirely on mirrored ports of switches for data acquisition. If switch configurations change, ports fail, or network congestion occurs, the data flow is immediately interrupted, rendering the devices "blind." Furthermore, most devices lack effective local data buffering mechanisms, meaning network jitter or momentary interruptions can lead to permanent data loss. In addition, network failures require on-site intervention from maintenance personnel for line switching or reconfiguration, resulting in slow response times. Each deployment also necessitates complex switch configuration by network administrators, impacting the operational efficiency of energy storage power stations and the continuity of data acquisition. Summary of the Invention

[0004] The present invention aims to at least partially solve one of the technical problems in the related art.

[0005] Therefore, the first objective of this invention is to provide a data acquisition method for a portable energy storage power station testing device.

[0006] Another objective of this invention is to provide a data acquisition device for a portable energy storage power station testing equipment.

[0007] The third objective of this invention is to provide a computer device.

[0008] A fourth objective of this invention is to provide a non-transitory computer-readable storage medium.

[0009] To achieve the above objectives, a first aspect of the present invention provides a data acquisition method for a portable energy storage power station testing device, comprising:

[0010] S1 collects real-time data streams from the target device through the mirror port, performs multi-layer protocol parsing on the captured packets, extracts data values ​​and associates data references, and extracts quality attributes and timestamps. S2 performs validity checks and time synchronization corrections on the parsed data, converts the data into a unified unit system and standard time format, stores it in a real-time memory database, and asynchronously writes it to persistent storage according to a preset strategy. S3 continuously monitors the arrival interval and link status of data packets. When a communication interruption is detected, a three-level caching mechanism is triggered to transfer real-time data into a pre-allocated circular buffer. Once the buffer reaches a threshold, it is automatically written to the solid-state drive cache area and the breakpoint information at which the interruption began is recorded. S4. After communication is restored, the integrity of the cached data is verified based on the recorded breakpoints, and the retransmitted data is re-injected into the processing pipeline according to the original time sequence. When the main channel cannot be restored, it automatically switches to the backup communication channel for dimensionality reduction data acquisition and marks the acquisition path identifier when the data is entered into the database.

[0011] In one embodiment of the present invention, the step of acquiring the real-time data stream of the target device through the mirror port includes: By analyzing the network environment, obtain the network topology of the energy storage power station, identify the model of the EMS core switch, the IP address of the BMS / PCS / transformer, the VLAN and physical port number, determine the mirror source port and mirror destination port, and use fiber optic or network cable to connect the network interface of the portable testing device to the designated mirror destination port of the switch. Execute configuration commands on the EMS switch to create a local observation port and configure port mirroring; The device starts its packet capture engine to passively monitor network traffic, while actively sending ICMPping or IEC61850 specific discovery messages to identify target devices, parse MMS protocol messages to observe or participate in the application association establishment process between the IEC61850 client and server, and obtain negotiation parameters.

[0012] In one embodiment of the present invention, parsing the MMS protocol message includes: Obtain the device's dataset structure through the MMSGetNameList and GetVariableAccessAttributes services or by parsing the Report Control Block (RCB) to identify the data object references and their data types that need to be collected. Portable devices can parse or actively configure RCB as clients. Key parameters include RptID report identifier, OptFlds selection including fields such as data, quality, and timestamp, TrgOps trigger conditions, and IntgPd integration period. Configure a BPF filter on the packet capture engine to focus on the target device's MMS traffic.

[0013] In one embodiment of the present invention, the step of performing multi-layer protocol parsing on the captured message includes: Low-level protocol parsing: stripping Ethernet frames, IP packets, and TCP segment headers, and reassembling MMS protocol data units (PDUs); MMS layer parsing: Parses the ConfirmedEventNotification service, extracting the event time, reason, and included dataset references; Data value parsing: Based on the pre-acquired dataset structure, the data in MMSPDU is type-decoded and associated with data references; Quality and Timestamp Extraction: Parse the quality attributes attached to each data value and extract time tags such as DataTime and EntryTime.

[0014] In one embodiment of the present invention, the step of performing validity verification and time synchronization correction on the parsed data, converting the data into a unified unit system and standard time format, storing it in a real-time memory database, and asynchronously writing it to persistent storage according to a preset strategy includes: Validity verification: Check the data quality identifier, filter out invalid or substitute data, and perform a reasonableness verification; Time synchronization correction: Check the continuity of data timestamps. If the device supports IEEE1588PTP synchronization, correct based on the synchronization signal; otherwise, record the offset between the device clock and the standard time.

[0015] In one embodiment of the present invention, the continuous monitoring of the arrival interval and link status of data packets, and the triggering of a three-level caching mechanism when a communication interruption is detected, includes: The system continuously monitors the data packet arrival interval and link status. If more than 3 consecutive heartbeat cycles are lost, it is determined to be an interruption and triggers the protection process. The three-level caching mechanism includes: L1 memory cache, where real-time data being processed is immediately transferred to a pre-allocated circular buffer in memory to ensure that data is not lost during interruptions; L2SSD high-speed cache: When the memory buffer reaches a threshold, the background thread automatically and asynchronously writes the data to the high-speed cache area of ​​the solid-state drive. The cached index records accurately record the timestamp and sequence number of the last valid data entry before the interruption began in the database's metadata table.

[0016] In one embodiment of the present invention, after communication is restored, the integrity of the cached data is verified based on the recorded breakpoints, including: The system first verifies the integrity of the cached data using CRC checksum. Then, based on the recorded breakpoints, the cached data is replayed according to the original timing and report structure and injected into the real-time processing pipeline; The retransmitted data has a special source marker.

[0017] To achieve the above objectives, a second aspect of the present invention provides a data acquisition device for a portable energy storage power station testing equipment, comprising: The acquisition and parsing module is used to acquire real-time data streams from the target device through the mirror port, perform multi-layer protocol parsing on the captured packets, extract data values ​​and associate data references, and extract quality attributes and timestamps. The verification, conversion, and storage module is used to verify the validity of the parsed data and correct the time synchronization. After converting the data into a unified unit system and standard time format, it is stored in a real-time memory database and asynchronously written to persistent storage according to a preset strategy. The monitoring cache module is used to continuously monitor the arrival interval of data packets and the link status. When a communication interruption is detected, a three-level caching mechanism is triggered to transfer real-time data into a pre-allocated circular buffer. Once the buffer reaches a threshold, it is automatically written to the solid-state drive cache area and the breakpoint information at which the interruption began is recorded. The recovery and switching module is used to perform integrity verification on cached data based on the recorded breakpoints after communication is restored, and to re-inject the retransmitted data into the processing pipeline according to the original time sequence; when the main channel cannot be restored, it automatically switches to the backup communication channel for dimensionality reduction data acquisition, and marks the acquisition path identifier when the data is entered into the database.

[0018] The present invention discloses a data acquisition method and apparatus for a portable energy storage power station testing device. Through a three-level caching system and a multi-mode backup channel switching mechanism, it effectively solves the problem of data loss under network interruption, realizes uninterrupted continuous data acquisition, and significantly improves the reliability and plug-and-play capability of the portable energy storage power station testing device in complex network environments.

[0019] To achieve the above objectives, a third aspect of this application provides a computer device, including a processor and a memory; wherein the processor runs a program corresponding to the executable program code by reading executable program code stored in the memory, for implementing the method described in the first aspect embodiment.

[0020] To achieve the above objectives, a fourth aspect of this application provides a non-transitory computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the method described in the first aspect.

[0021] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0022] Figure 1 This is a flowchart of a data acquisition method for a portable energy storage power station testing device according to an embodiment of the present invention; Figure 2 This is a structural diagram of a data acquisition device for a portable energy storage power station testing equipment according to an embodiment of the present invention; Figure 3 It is a computer device according to an embodiment of the present invention. Detailed Implementation

[0023] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0024] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0025] The following description, with reference to the accompanying drawings, illustrates a data acquisition method and apparatus for a portable energy storage power station testing device according to an embodiment of the present invention.

[0026] Figure 1 This is a flowchart of a data acquisition method for a portable energy storage power station testing device according to an embodiment of the present invention, such as... Figure 1 As shown, it includes: S1 collects real-time data streams from the target device through the mirror port, performs multi-layer protocol parsing on the captured packets, extracts data values ​​and associates data references, and extracts quality attributes and timestamps. Furthermore, acquiring real-time data streams from target devices via mirrored ports is the initial step in the data acquisition process of this invention. Its core lies in utilizing the port mirroring function of a switch to achieve non-intrusive capture of communication traffic from target devices such as BMS, PCS, and transformers. During the network environment analysis and access planning phase, a site survey is first conducted to obtain the network topology of the energy storage power station, clarifying the IP address, VLAN, and physical port number of the target devices. Then, the mirroring source port and mirroring destination port are determined, and a portable detection device is connected to the designated mirroring destination port of the switch using fiber optic or network cables. An observation port is created on the switch, and port mirroring is configured so that the communication traffic of the target devices is copied to the access port of the detection device. After the device starts its packet capture engine, it first passively listens to network traffic, while simultaneously actively sending ICMPping or IEC61850 specific discovery messages to quickly identify target devices; it parses MMS protocol messages to observe or participate in the application association establishment process between the IEC61850 client and server, obtaining negotiation parameters; and it obtains the device's dataset structure through the MMSGetNameList and GetVariableAccessAttributes services or by parsing the report control block, clarifying the references to the data objects to be collected and their data types. As one implementation method, the portable device acts as a client to parse or actively configure the Report Control Block (RCB). Its key parameters include RptID, OptFlds, TrgOps, and IntgPd. A BPF filter is set on the packet capture engine to focus on the target device's MMS traffic. Ethernet frames, IP packets, and TCP segment headers are stripped to reassemble the MMS protocol data unit. The ConfirmedEventNotification service is parsed to extract the event time, cause, and dataset reference. The data in the MMSPDU is type-decoded according to the pre-acquired dataset structure and associated with the data reference. At the same time, the Quality attribute attached to each data value is parsed to extract time tags such as DateTime and EntryTime.

[0027] Further, network environment analysis and access planning, and on-site survey: Obtain the network topology diagram of the energy storage power station, and clarify the EMS core switch model, BMS / PCS / transformer IP addresses, VLANs, and physical port numbers. Strategy formulation: Determine the mirroring source port (the port connecting the BMS / PCS) and mirroring destination port (the port for portable devices to access). Typically, an unused optical or electrical port on the core switch is selected as the destination port. Physical connection: Using fiber optic or network cables that meet the on-site distance requirements, connect the network interface of the portable testing device to the designated mirroring destination port on the switch. Switch mirroring configuration: Execute configuration commands on the EMS switch to create a local observation port and configure port mirroring.

[0028] This step achieves interference-free acquisition of communication data from the target device through passive acquisition via mirrored ports. The multi-layer protocol parsing mechanism ensures a complete conversion chain from raw network packets to structured data. The synchronous extraction of quality attributes and time tags lays the foundation for subsequent data validity verification and time synchronization correction, ensuring both the integrity of data acquisition and the stability of the industrial field network environment.

[0029] S2 performs validity checks and time synchronization corrections on the parsed data, converts the data into a unified unit system and standard time format, stores it in a real-time memory database, and asynchronously writes it to persistent storage according to a preset strategy. Furthermore, the parsed data undergoes validity verification and time synchronization correction. After being converted to a unified unit system and standard time format, the data is stored in a real-time in-memory database and asynchronously written to persistent storage according to a preset strategy. This step aims to ensure the accuracy, timeliness, and traceability of the collected data, while establishing a multi-layered data storage architecture to meet the differentiated needs of real-time monitoring and historical analysis. In the data validity verification stage, invalid data or substitute values ​​are identified and filtered by parsing the quality identifiers carried in the data. At the same time, the values ​​are thresholded according to a preset reasonable range, and data exceeding the range is marked with an alarm. In the time synchronization correction stage, the continuity of data timestamps is checked. If the data source supports precise time synchronization protocols such as IEEE 1588PTP, the timestamps are corrected based on the synchronization signal. Otherwise, the offset between the device's local clock and the standard time is recorded for subsequent processing. In the data standardization stage, all types of data are uniformly converted to the International System of Units (SI), such as voltage in volts (V), current in amperes (A), power in kilowatts (kW), and temperature in degrees Celsius (°C). The time format is uniformly set to UTC timestamps, and enumerated type values ​​are converted to readable strings. Data storage adopts a hierarchical architecture. The verified and standardized data is first written to a real-time in-memory database, supporting high-speed queries and real-time display at the millisecond level. The full data of the most recent period is usually cached for fast access. At the same time, according to a preset strategy, the data is asynchronously written to a persistent storage system, such as a time-series database or a relational database, to achieve long-term data archiving and historical analysis. As one implementation method, data can be stored in an in-memory database such as Redis or a self-developed circular buffer. Persistent storage can use time-series databases such as InfluxDB and TDengine, and data can be sharded according to device, data type, and time to optimize query efficiency.

[0030] Furthermore, device discovery and protocol handshake, passive listening and active probing: The device starts a packet capture engine (such as libpcap) to passively listen to network traffic. Simultaneously, it can actively send ICMPping or IEC61850-specific discovery messages to quickly identify target devices. IEC61850 service establishment: Parsing MMS (Manufacturing Message Specification) protocol messages, observing or participating in the application association establishment process between the IEC61850 client and server (BMS / PCS), and obtaining negotiation parameters such as maximum service support and protocol version. Data model acquisition: Through the MMSGetNameList and GetVariableAccessAttributes services, or by parsing existing Report Control Blocks (RCBs), obtaining the device's DataSet structure, and clarifying the references to the data objects to be collected and their data types.

[0031] This step significantly improves data quality and availability through multi-dimensional data verification and standardization, ensuring the reliability of subsequent analysis and decision-making. At the same time, the tiered storage architecture takes into account the differentiated needs of real-time and persistence, ensuring both the rapid response of the monitoring interface and the effective accumulation of historical data.

[0032] S3 continuously monitors the arrival interval and link status of data packets. When a communication interruption is detected, a three-level caching mechanism is triggered to transfer real-time data into a pre-allocated circular buffer. Once the buffer reaches a threshold, it is automatically written to the solid-state drive cache area and the breakpoint information at which the interruption began is recorded. Furthermore, continuously monitoring the arrival interval of data packets and the link status is a crucial step in ensuring data continuity. The system establishes a dynamic assessment mechanism for communication health by tracking the time interval of data packets and the working status of the physical link in real time. When continuous data packet loss exceeds a preset heartbeat cycle threshold, communication is considered interrupted, and a three-level caching mechanism is triggered to achieve seamless data protection. This mechanism first transfers the real-time data being processed into a pre-allocated circular buffer, utilizing the high-speed read / write characteristics of memory to ensure no data loss during the interruption. When the circular buffer reaches its capacity threshold, a background thread automatically writes the data asynchronously and continuously to the solid-state drive cache, forming a second level of data protection. Simultaneously, the timestamp and sequence number of the last valid data at the start of the interruption are precisely recorded in the database's metadata table as the basis for subsequent breakpoint resumption. As a specific implementation, the system can be configured to determine an interruption if continuous data loss exceeds three heartbeat cycles (e.g., three seconds), and the buffer threshold can be set to 80%.

[0033] Further, real-time data stream subscription and parsing, and report control block management: the portable device acts as a client, parsing or actively configuring the RCB. Key parameters include RptID (report identifier), OptFlds (selecting fields such as data, quality, and timestamp), TrgOps (triggering conditions, such as data changes and periodic reporting), and IntgPd (integration period). Packet capture and filtering: setting a BPF filter on the packet capture engine to focus on the target device's MMS traffic, significantly reducing the load of invalid data processing. Multi-layer protocol parsing, low-level parsing: stripping Ethernet frames, IP packets, and TCP segment headers, and reconstructing MMS protocol data units (PDUs). MMS layer parsing: parsing the ConfirmedEventNotification service, extracting the event time, cause, and included dataset references. Data value parsing: decoding the data type (integer, floating-point, bit string, time, etc.) in the MMSPDU according to the pre-acquired dataset structure, and associating it with data references. Quality and timestamp extraction: parsing the quality attribute attached to each data value, extracting time stamps such as DataTime and EntryTime.

[0034] Furthermore, data validation and standardization, including validity verification: checking data quality identifiers and filtering out "invalid" or "alternative" data. During rationality verification, for core parameters such as individual cell voltage and battery temperature, threshold judgment formulas are used for quantitative verification. Taking individual cell voltage as an example, the judgment formula is:

[0035] in, The voltage value is collected for a single cell. This is the lower limit threshold of the single-unit voltage (e.g., 2.5V). This is the upper limit threshold for the voltage of a single cell (e.g., 3.8V); exceeding this range will trigger an alarm. For the total current of the battery pack, a rate mutation verification formula is used:

[0036] in, This is the current current value being collected. The current value collected at the previous moment. The time interval for data collection. This is the threshold for the maximum rate of change of current; exceeding this threshold indicates abnormal data and is marked as such.

[0037] Time synchronization correction: Check the continuity of data timestamps. If the device supports IEEE 1588PTP synchronization, then correct based on the synchronization signal; otherwise, record the offset between the device clock and the standard time. The clock offset calculation formula is:

[0038] in, This is the device clock offset. For the device's local clock timestamp, If it is a UTC standard timestamp, (e.g., 500ms) then the timestamps of subsequent data collection are offset and compensated. .

[0039] Unit and format standardization: Convert all data to a unified International System of Units (e.g., V, A, kW, ℃) and a standard time format (UTC timestamp), and convert enumerated values ​​into readable strings.

[0040] This invention establishes a hierarchical caching system from memory to solid-state drives, combined with precise recording of breakpoint information, to achieve complete data preservation and reliable recovery in the event of network interruption, effectively solving the technical problem of permanent data loss caused by network jitter or momentary interruption in the prior art.

[0041] S4. After communication is restored, the integrity of the cached data is verified based on the recorded breakpoints, and the retransmitted data is re-injected into the processing pipeline according to the original time sequence. When the main channel cannot be restored, it automatically switches to the backup communication channel for dimensionality reduction data acquisition and marks the acquisition path identifier when the data is entered into the database.

[0042] Furthermore, after communication is restored, the system initiates a data continuity assurance process. First, it performs integrity verification on the cached data, using a preset verification mechanism to verify that the data was not damaged or lost during storage and interruption, ensuring the reliability of the retransmitted data. After verification, the system, based on the breakpoint information recorded at the start of the interruption, including the timestamp and sequence number of the last valid data, re-injects the cached data into the real-time processing pipeline according to the original time sequence and report structure, achieving seamless data connection. The retransmitted data is marked with a special source to distinguish it from the real-time data. When it is detected that the primary mirror channel cannot be restored within a preset time, the system automatically evaluates and switches to the backup communication channel, selects the optimal backup path according to a preset strategy, dynamically loads the corresponding communication protocol stack and reconfigures the communication parameters, focuses on core security and status parameters for dimensionality reduction data collection, and stores the collected data along with the data source identifier and collection path identifier when it is entered into the database. After the primary channel is restored, it performs timeline alignment and data fusion. As one implementation method, the system can use the CRC check algorithm to verify the integrity of the cached data, use a static IP to directly connect to the device maintenance network through the device's backup network port, and adjust the acquisition strategy according to the bandwidth and protocol capabilities of the backup channel to focus on key parameters such as individual unit voltage, temperature, total current, SOC, and charge / discharge status.

[0043] Further, data caching and storage include: Real-time in-memory database: Parsed data is first stored in a real-time in-memory database (such as Redis or a self-developed circular buffer), supporting millisecond-level queries and displays, typically caching the full data of the most recent 5-15 minutes. Persistent storage and raw message storage: Optional storage of complete or critical raw network messages (pcap format) for in-depth backtracking analysis. Structured storage: Parsed structured data is written to a time-series database (such as InfluxDB, TDengine) or a relational database. Partitioned tables are designed based on device, data type, and time to optimize query efficiency. Compression and archiving: Compression strategies are implemented for historical data, such as using the Rotating Door (SDT) algorithm for lossy compression of data that has not been accessed for a long time. This algorithm uses a set deviation threshold. While preserving data trend characteristics, redundant data is eliminated. The core judgment formula is:

[0044] in, , For the feature data points that have been retained, These are intermediate data points to be determined. The maximum allowable deviation threshold is used. If the formula is met, the intermediate point is removed; otherwise, it is retained as a new feature point. After compression, the amount of data can be greatly reduced, while ensuring the accuracy of trend restoration.

[0045] Furthermore, regarding status monitoring and data output, the device software interface displays the data acquisition status in real time (such as connection status, data packet rate, and parsing error rate), and presents key parameters in the form of charts and tables. Simultaneously, it pushes real-time data or statistical results outwards through standard interfaces (such as RESTful API and MQTT) for integration by upper-layer applications.

[0046] Furthermore, strategies for ensuring data continuity during communication interruptions: Phase 1: Short Interruption (<5 minutes) – Local Intelligent Cache Resumption, Instant Interruption Detection: The system continuously monitors the data packet arrival interval and link status. A continuous loss of more than 3 heartbeat cycles (configurable, e.g., 3 seconds) is considered an interruption, triggering the protection process. Three-level cache takeover: L1 Memory Cache: Real-time data being processed is immediately transferred to a pre-allocated circular buffer in memory to ensure no data loss during the interruption. L2 SSD High-Speed ​​Cache: Once the memory buffer reaches a threshold (e.g., 80%), a background thread automatically writes data asynchronously and continuously to the SSD's high-speed cache area. Cache Index Records: The timestamp and sequence number of the last valid data entry before the interruption are accurately recorded in the database's metadata table. Network Recovery and Resumption: After link recovery, the system first verifies the integrity of the cached data (CRC check), then, based on the recorded breakpoint, re-"plays" the cached data according to its original timing and report structure and injects it into the real-time processing pipeline. Retransmitted data carries a special source marker.

[0047] Phase Two: Medium- to Long-Term Interruptions or Permanent Failure of the Primary Path – Multi-Mode Backup Channel Switching. When the primary mirror path cannot be restored in the short term, the system activates the backup communication scheme. Channel evaluation and decision-making: The system automatically selects the optimal backup channel based on preset strategies, using a static IP address to directly connect to the device's maintenance network via the device's backup network port. High priority and good data integrity are ensured. Protocol adaptation and data acquisition: Dynamically loading the protocol stack: The system loads the corresponding backup channel's communication protocol stack (e.g., Modbus RTU, CANopen). Parameter reconfiguration: Automatically or prompting the user to configure the backup channel's communication parameters (baud rate, slave address, register mapping table). Dimensional reduction acquisition: Adjusting the acquisition strategy based on the backup channel's bandwidth and protocol capabilities, focusing on the most critical safety and status parameters (individual voltage, temperature, total current, SOC, charging / discharging status). Timestamp processing: If the backup channel lacks precise time synchronization, the portable device's local clock is used, and the difference from the standard time is recorded. Data fusion: Data from the backup channel is stored along with its data source ID and acquisition path identifier upon entry into the database. After the network is restored and the main channel data returns, the system performs timeline alignment and fusion, using the highly reliable main channel data as a benchmark, and supplements the backup channel data from the interruption period.

[0048] Furthermore, in extreme cases (no communication) – local intelligent reconstruction and event capture: when all communication paths fail, the system enters a minimum power consumption guardian mode. Model-based trend prediction: using historical data from the last period before the interruption, lightweight prediction algorithms (such as exponential smoothing and ARIMA) are run to perform short-term extrapolation estimates of key trend parameters such as SOC and average temperature. The estimation results are explicitly labeled as "predicted values".

[0049] Furthermore, prevention and recovery support includes network health pre-diagnosis: Continuously monitor the network quality of the main channel (latency, jitter, packet loss rate) and provide early warnings of potential risks. Configuration backup and rapid recovery: The device stores the switch's mirrored configuration scripts. If the configuration is lost after a switch restart, it can assist maintenance personnel in quickly redeploying the configuration.

[0050] This step ensures the continuity and integrity of data during network interruptions through a breakpoint resume mechanism, preventing permanent data loss. At the same time, the automatic switching of backup channels ensures that critical operational information can still be obtained in extreme cases, significantly improving the reliability and availability of the testing equipment.

[0051] This invention proposes a data acquisition method for portable energy storage testing devices, forming a complete technical closed loop from normal acquisition to emergency switching. Through refined mirror port acquisition steps, the accuracy and non-intrusiveness of data acquisition are ensured; and through an innovative multi-level continuity assurance strategy, it effectively addresses interruptions of varying durations and natures, ensuring data continuity and reliability.

[0052] To achieve the above embodiments, such as Figure 2 As shown, this embodiment also provides a data acquisition device 10 for portable energy storage power station testing equipment, including: The acquisition and parsing module 100 is used to acquire real-time data streams from the target device through the mirror port, perform multi-layer protocol parsing on the captured packets, extract data values ​​and associate data references, and extract quality attributes and timestamps. The verification conversion storage module 200 is used to perform validity verification and time synchronization correction on the parsed data, convert the data into a unified unit system and standard time format and store it in the real-time memory database, and asynchronously write it to persistent storage according to a preset strategy. The monitoring cache module 300 is used to continuously monitor the arrival interval of data packets and the link status. When a communication interruption is detected, a three-level caching mechanism is triggered to transfer real-time data into a pre-allocated circular buffer. After the buffer reaches the threshold, it is automatically written to the solid-state hard disk cache area and the breakpoint information at the start of the interruption is recorded. The recovery switching module 400 is used to perform integrity verification on cached data based on the recorded breakpoints after communication is restored, and to re-inject the retransmitted data into the processing pipeline according to the original time sequence; when the main channel cannot be restored, it automatically switches to the backup communication channel for dimensionality reduction data acquisition, and marks the acquisition path identifier when the data is entered into the database.

[0053] The data acquisition device for a portable energy storage power station testing equipment according to an embodiment of the present invention effectively solves the problem of data loss under network interruption through a three-level caching system and a multi-mode backup channel switching mechanism, realizing uninterrupted continuous data acquisition and significantly improving the reliability and plug-and-play capability of the portable energy storage power station testing equipment in complex network environments.

[0054] To implement the methods of the above embodiments, the present invention also provides a computer device, such as... Figure 3 As shown, the computer device 600 includes a memory 601 and a processor 602; wherein, the processor 602 reads the executable program code stored in the memory 601 to run a program corresponding to the executable program code, so as to implement the various steps of the data acquisition method of the portable energy storage power station testing device described above.

[0055] To implement the above embodiments, this application also proposes a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a data acquisition method for a portable energy storage power station testing device as described in the foregoing embodiments.

[0056] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0057] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

Claims

1. A data acquisition method for a portable energy storage power plant detection device, characterized in that, include: S1 collects real-time data streams from the target device through the mirror port, performs multi-layer protocol parsing on the captured packets, extracts data values ​​and associates data references, and extracts quality attributes and timestamps. S2 performs validity checks and time synchronization corrections on the parsed data, converts the data into a unified unit system and standard time format, stores it in a real-time memory database, and asynchronously writes it to persistent storage according to a preset strategy. S3 continuously monitors the arrival interval and link status of data packets. When a communication interruption is detected, a three-level caching mechanism is triggered to transfer real-time data into a pre-allocated circular buffer. Once the buffer reaches a threshold, it is automatically written to the solid-state drive cache area and the breakpoint information at which the interruption began is recorded. S4. After communication is restored, the integrity of the cached data is verified based on the recorded breakpoints, and the retransmitted data is re-injected into the processing pipeline according to the original time sequence. When the main channel cannot be restored, it automatically switches to the backup communication channel for dimensionality reduction data acquisition and marks the acquisition path identifier when the data is entered into the database.

2. The method of claim 1, wherein, The process of acquiring real-time data streams from the target device via the mirror port includes: By analyzing the network environment, obtain the network topology of the energy storage power station, identify the model of the EMS core switch, the IP address of the BMS / PCS / transformer, the VLAN and physical port number, determine the mirror source port and mirror destination port, and use fiber optic or network cable to connect the network interface of the portable testing device to the designated mirror destination port of the switch. Execute configuration commands on the EMS switch to create a local observation port and configure port mirroring; The device starts its packet capture engine to passively monitor network traffic, while actively sending ICMPping or IEC61850 specific discovery messages to identify target devices, parse MMS protocol messages to observe or participate in the application association establishment process between the IEC61850 client and server, and obtain negotiation parameters.

3. The method of claim 2, wherein, The parsing of MMS protocol messages includes: Obtain the device's dataset structure through the MMSGetNameList and GetVariableAccessAttributes services or by parsing the Report Control Block (RCB) to identify the data object references and their data types that need to be collected. Portable devices can parse or actively configure RCB as clients. Key parameters include RptID report identifier, OptFlds selection including fields such as data, quality, and timestamp, TrgOps trigger conditions, and IntgPd integration period. Configure a BPF filter on the packet capture engine to focus on the target device's MMS traffic.

4. The method of claim 1, wherein, The process of performing multi-layer protocol parsing on the captured messages includes: Low-level protocol parsing: stripping Ethernet frames, IP packets, and TCP segment headers, and reassembling MMS protocol data units (PDUs); MMS layer parsing: Parses the ConfirmedEventNotification service, extracting the event time, reason, and included dataset references; Data value parsing: Based on the pre-acquired dataset structure, the data in MMSPDU is type-decoded and associated with data references; Quality and Timestamp Extraction: Parse the quality attributes attached to each data value and extract time tags such as DataTime and EntryTime.

5. The method of claim 1, wherein, The process of validating and time-synchronized the parsed data, converting it to a unified unit system and standard time format, storing it in a real-time in-memory database, and asynchronously writing it to persistent storage according to a preset strategy includes: Validity verification: Check the data quality identifier, filter out invalid or substitute data, and perform a reasonableness verification; Time synchronization correction: Check the continuity of data timestamps. If the device supports IEEE1588PTP synchronization, correct based on the synchronization signal; otherwise, record the offset between the device clock and the standard time.

6. The method of claim 1, wherein, The continuous monitoring of data packet arrival intervals and link status triggers a three-level caching mechanism when a communication interruption is detected, including: The system continuously monitors the data packet arrival interval and link status. If more than 3 consecutive heartbeat cycles are lost, it is determined to be an interruption and triggers the protection process. The three-level caching mechanism includes: L1 memory cache, where real-time data being processed is immediately transferred to a pre-allocated circular buffer in memory to ensure that data is not lost during interruptions; L2SSD high-speed cache: When the memory buffer reaches a threshold, the background thread automatically and asynchronously writes the data to the high-speed cache area of ​​the solid-state drive. The cached index records accurately record the timestamp and sequence number of the last valid data entry before the interruption began in the database's metadata table.

7. The method of claim 1, wherein, After communication is restored, the integrity of the cached data is verified based on the recorded breakpoints, including: The system first verifies the integrity of the cached data using CRC checksum. Then, based on the recorded breakpoints, the cached data is replayed according to the original timing and report structure and injected into the real-time processing pipeline; The retransmitted data has a special source marker.

8. A data acquisition device for a portable energy storage plant detection apparatus, characterized in that, include: The acquisition and parsing module is used to acquire real-time data streams from the target device through the mirror port, perform multi-layer protocol parsing on the captured packets, extract data values ​​and associate data references, and extract quality attributes and timestamps. The verification, conversion, and storage module is used to verify the validity of the parsed data and correct the time synchronization. After converting the data into a unified unit system and standard time format, it is stored in a real-time memory database and asynchronously written to persistent storage according to a preset strategy. The monitoring cache module is used to continuously monitor the arrival interval of data packets and the link status. When a communication interruption is detected, a three-level caching mechanism is triggered to transfer real-time data into a pre-allocated circular buffer. Once the buffer reaches a threshold, it is automatically written to the solid-state drive cache area and the breakpoint information at which the interruption began is recorded. The recovery and switching module is used to perform integrity verification on cached data based on the recorded breakpoints after communication is restored, and to re-inject the retransmitted data into the processing pipeline according to the original time sequence; when the main channel cannot be restored, it automatically switches to the backup communication channel for dimensionality reduction data acquisition, and marks the acquisition path identifier when the data is entered into the database.

9. A computer device, characterized in that, Including processor and memory; The processor reads executable program code stored in the memory to run a program corresponding to the executable program code, so as to implement the data acquisition method of a portable energy storage power station testing device as described in any one of claims 1-7.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements a data acquisition method for a portable energy storage power station testing device as described in any one of claims 1-7.