A method for network outage buffering and backfilling of flow battery energy storage gateway

By employing a dual-queue mechanism and adaptive backfill rate adjustment, the data processing problem of the flow battery energy storage system when the network is disconnected is solved, ensuring the priority of real-time control tasks and achieving reliable data storage and low-disturbance backfilling.

CN123123437APending Publication Date: 2026-11-17DALIAN BINGSHAN GUARDIAN AUTOMATIC CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611602113.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-16
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

When the network is disconnected, the historical data retransmission process of existing flow battery energy storage systems can easily affect real-time data upload, control commands, and alarm processing, leading to a decrease in system stability.

Method used

A dual-queue mechanism is adopted, with the real-time upload queue and the historical backfill queue separated. Real-time data has higher priority than historical data. Data is stored in a local WAL cache, and the historical backfill rate is dynamically adjusted according to the gateway's operating status. Combined with timestamp conflict resolution and confirmation deletion mechanisms, real-time control tasks are given priority.

Benefits of technology

After the network was restored, efficient separation and uploading of real-time and historical data was achieved, reducing the impact on real-time control and improving system stability and data storage reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123123437A_ABST
    Figure CN123123437A_ABST
Patent Text Reader

Abstract

This invention provides a method for network outage caching and backfilling in a flow battery energy storage gateway, relating to the technical field of flow battery energy storage. The method includes the following steps: collecting operational data from the flow battery energy storage system and encapsulating it into time-series data points with device number, measurement point number, timestamp, sampling sequence number, numerical value, quality code, and checksum; detecting the network availability status of a remote server or remote time-series database; calculating the historical backfilling rate based on the gateway's operational status and uploading data in the historical backfilling queue according to the historical backfilling rate; reducing or suspending historical backfilling when real-time control-related tasks exceed protection thresholds; and marking the corresponding WAL record as confirmed after successful historical data upload and remote confirmation. This invention saves data during network outages in a structured WAL format, reducing the risk of data loss due to power outages or subsequent network outages.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of flow battery energy storage, and more particularly to a method for network outage buffering and backfilling of flow battery energy storage gateways. Background Technology

[0002] A flow battery energy storage station typically includes equipment such as a BMS, PCS, fuel cell stack, pumps and valves, chiller, temperature and humidity sensors, and external I / O modules. The energy storage gateway needs to continuously collect the operating data, alarm status, and communication status of the above equipment and upload the data to a remote time-series database or energy storage monitoring platform.

[0003] In actual field operations, energy storage stations may experience network outages or weak networks due to public network link anomalies, dedicated line jitter, unavailability of remote databases, or maintenance of upstream networks. During network outages, the gateway still needs to continuously execute local Modbus data acquisition, pump and valve control, alarm reporting, and protection interlocking logic, and save historical data from the outage period as much as possible.

[0004] Existing breakpoint resume solutions typically only focus on saving data when the network is disconnected and re-transmitting data after the network is restored. However, the historical data re-transmission process may consume CPU, disk I / O, network bandwidth, and database write capacity, leading to increased latency in real-time data uploads, larger Modbus acquisition cycle jitter, and even affecting on-site control commands and alarm processing. For flow battery energy storage systems, real-time control and safety protection tasks take priority over historical data backfilling. Therefore, a method is needed that can perform network outage caching and adaptive backfilling while prioritizing real-time control. Summary of the Invention

[0005] To address the technical problem mentioned in the background section of the above-mentioned existing breakpoint resume transmission schemes, which can easily affect real-time acquisition, control commands, alarm reporting, and gateway CPU stability due to the centralized retransmission of historical data after network recovery, this invention provides a method for network outage caching and backfilling in a flow battery energy storage gateway. This invention encapsulates the acquired data into time-series data points with device number, measurement point number, timestamp, sampling sequence number, quality code, and checksum. When the network is normal, the time-series data points are written to the real-time upload queue and uploaded to a remote time-series database. When the network is abnormal, the time-series data points are sequentially appended to the local WAL cache. After network recovery, both the real-time upload queue and the historical backfill queue are maintained, with the real-time upload queue having higher priority. The backfilling rate of the historical backfill queue is dynamically calculated based on CPU utilization, network RTT, real-time upload queue length, database write failure rate, and Modbus acquisition cycle jitter. When real-time control-related tasks exceed protection thresholds, historical backfilling automatically slows down or pauses. Only after successful historical data upload and remote confirmation is the WAL record marked as confirmed and the completed segment deleted.

[0006] The technical means employed in this invention are as follows: A method for network outage buffering and refilling of a flow battery energy storage gateway includes the following steps: Step 1: Collect the operating data of the flow battery energy storage system and encapsulate it into time series data points with device number, measurement point number, timestamp, sampling sequence number, value, quality code and check value; Step 2: Detect the network availability status of the remote server or remote time series database; when the network is available, write the time series data points into the real-time upload queue and upload them; when the network is unavailable, write the time series data points into the local WAL cache; when the network is detected to have recovered, while continuing to upload the current real-time data in the real-time upload queue, scan the local WAL cache to generate a historical backfill queue. Step 3: Calculate the historical backfill rate based on the gateway's operating status, and upload the data in the historical backfill queue according to the historical backfill rate; wherein, the gateway's operating status includes at least CPU utilization, network RTT, real-time upload queue length, and Modbus acquisition cycle jitter; Step 4: When the real-time control related tasks exceed the protection threshold, reduce or suspend historical backfilling; Step 5: After the historical data is successfully uploaded and remote confirmation is received, mark the corresponding WAL record as confirmed.

[0007] Furthermore, the operating data of the flow battery energy storage system includes at least one of the following: BMS data, PCS data, stack data, chiller data, temperature and humidity data, external IO module data, alarm status, and communication status.

[0008] Furthermore, the network availability status is determined based on at least two of the following: HTTP connection status, TCP connection status, remote time-series database write results, recent N upload failure rate, network RTT, and upload queue length.

[0009] Furthermore, the local WAL cache adopts a pre-allocated segmented file, sequential append writing and index delayed update method, and each segmented file has a segment check value; The WAL record includes the Magic recognition header, file version, device number, measurement point number, sampling timestamp, sampling sequence number, data value, quality code, CRC check value, and upload status field.

[0010] Furthermore, the upload status field includes at least three statuses: not uploaded, uploading, confirmed, corrupted, and skipped.

[0011] Furthermore, in step 3, the historical backfill rate is:

[0012] in, Indicates the maximum permissible backfill rate. Indicates the network quality coefficient. Indicates the CPU idle coefficient. Indicates the real-time task protection coefficient. This represents the database write success rate coefficient.

[0013] Furthermore, when historical data and real-time data have the same device number, measurement point number, and timestamp, timestamp conflict resolution is performed. The timestamp conflict resolution includes at least one of the following rules: prioritizing data with correct CRC, prioritizing data with larger sampling sequence number, prioritizing data with normal quality code, and prohibiting duplicate writing to confirmed data.

[0014] Furthermore, after the historical data is successfully uploaded, the WAL record is not deleted immediately. Instead, after receiving confirmation of successful write to the remote time-series database, the WAL record is marked as confirmed, and the WAL segment is deleted after all records in the corresponding WAL segment have been confirmed.

[0015] Furthermore, if a network anomaly is detected again during the historical backfilling process, historical backfilling is stopped and unconfirmed WAL records are maintained. Backfilling will continue from the unconfirmed location once the network is detected to have recovered again.

[0016] Furthermore, the real-time control related tasks include at least one of the following: current Modbus acquisition task, pump and valve control command task, alarm reporting task, and flow battery protection interlock task; The flow battery energy storage gateway is any one of the following: an ARM gateway running a Go program, an industrial computer, an embedded Linux gateway, or a local data acquisition gateway for the energy storage station.

[0017] Compared with the prior art, the present invention has the following advantages: This invention saves data during network outages in a structured WAL format, reducing the risk of data loss due to power outages or renewed network outages; after network recovery, real-time data and historical data are separated into dual queues to avoid historical backfilling crowding out real-time uploads; adaptive rate limiting dynamically adjusts the backfilling speed according to the gateway's operating status, protecting the Modbus acquisition cycle and on-site control tasks; timestamp conflict resolution and confirmation deletion mechanisms can reduce the risk of duplicate writing and erroneous deletion. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a diagram illustrating the overall structure of the offline caching and backfilling method of the present invention. Figure 2 This is a diagram of the local WAL cache record structure of the present invention; Figure 3 This is the network state-driven cache backfill state machine diagram of the present invention; Figure 4 This is a diagram of the adaptive backfill current limiting calculation structure of the present invention; Figure 5 This is a structural diagram of the dual-queue priority scheduling, conflict resolution, and confirmation deletion of the present invention. Detailed Implementation

[0020] 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.

[0021] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0022] like Figures 1-5 As shown, the present invention provides a method for network outage buffering and backfilling of a flow battery energy storage gateway, comprising the following steps: Step 1: Collect the operating data of the flow battery energy storage system and encapsulate it into time-series data points with device number, measurement point number, timestamp, sampling sequence number, value, quality code and check value; the operating data of the flow battery energy storage system includes at least one of the following: BMS (Battery Management System) data, PCS (Power Conversion System) data, stack data, chiller data, temperature and humidity data, external IO (input / output interface) module data, alarm status and communication status. The operational data includes periodic sampling data generated by the BMS, PCS, fuel cell stack, chiller, temperature and humidity sensors, and external I / O modules, as well as event data generated by changes in alarm status or communication status. For the periodic sampling data, the energy storage gateway identifies the data source by device number and measurement point number, and determines the temporal position of the data by sampling timestamp and sampling sequence number. For the event data, the energy storage gateway records the time of status change and the status value after the change. Both the periodic sampling data and the event data carry a quality code and a CRC (Cyclic Redundancy Check) check value to write to the local WAL (Write-Ahead Log) cache in chronological order during network outages, and to restore the data order of each measurement point, verify the integrity of records, and identify duplicate or conflicting records after network recovery.

[0023] Step 2: Detect the network availability status of the remote server or remote time-series database; when the network is available, write the time-series data points into the real-time upload queue and upload them; when the network status detection result meets the preset unavailability judgment condition, append the time-series data points to the pre-allocated WAL (Write-Ahead Log) segment file according to the sampling sequence number, and write the CRC check value and the non-upload status flag in the corresponding WAL record; when the write result of the remote time-series database, the recent N upload failure rate and the network RTT (Round-Trip Time) meet the preset network recovery condition, locate the first unconfirmed record according to the WAL segment index and confirmation flag, read and verify the WAL record according to the sampling sequence number, and write the verified WAL record into the historical backfill queue; the priority scheduler prioritizes the real-time upload queue, and when the real-time upload queue length and the real-time control task status have not reached the protection threshold, schedule the historical backfill queue according to the adaptive backfill rate. When the network is unavailable, the time-series data points are written to the local WAL cache; when the network is detected to have recovered, while the real-time upload queue continues to upload the current real-time data, the local WAL cache is scanned to generate a historical backfill queue; the network availability status is determined based on at least two of the following: HTTP (Hypertext Transfer Protocol) connection status, TCP (Transmission Control Protocol) connection status, remote time-series database write results, the most recent N upload failure rates, network RTT, and upload queue length. The determination of network availability includes: periodically acquiring network connectivity metrics, service writability metrics, transmission quality metrics, and queue backlog metrics; wherein, the network connectivity metrics are generated based on TCP connection results or HTTP health check results, the service writability metrics are generated based on the write results of the remote time-series database, the transmission quality metrics are generated based on the recent N upload failure rates and smoothed network RTT, and the queue backlog metrics are generated based on the real-time upload queue length and its duration; when the remote time-series database write is abnormal, and at least one of the network connectivity metrics, transmission quality metrics, and queue backlog metrics is abnormal, and the above states continuously meet a first preset number of detection cycles, the network is determined to be unavailable; when the network connection is restored, the remote time-series database is continuously successfully written, and the upload failure rate and smoothed network RTT are lower than the corresponding recovery threshold, and the above states continuously meet a second preset number of detection cycles, the network is determined to be restored.

[0024] In a preferred embodiment, the local WAL cache adopts a pre-allocated segmented file, sequential append writing and index delayed update method, and each segmented file has a segment check value; The WAL record includes the Magic recognition header (file recognition header), file version, device number, measurement point number, sampling timestamp, sampling sequence number, data value, quality code, CRC check value, and upload status field.

[0025] The local WAL cache consists of segmented data files and a status index file. The system pre-creates segmented files of a set capacity as the current write segment. After the collected data is encapsulated into WAL records, it is written to the end of the current segment file according to the sampling sequence number; after the record is written to disk, the valid write position is updated in the status index file. When the current segment is full, the system closes the segment, calculates and saves the segment checksum, and then switches to a new pre-allocated segment file to continue writing.

[0026] When the gateway restarts, it checks the end of the active segment based on the valid write position recorded in the status index, and identifies the complete record and rebuilds the index by using the Magic identification header, file version, and CRC check value. When the network recovers, it locates the first unconfirmed record based on the status index and reads subsequent records in the sampling order; records that pass verification but are not confirmed are added to the historical backfill queue, and records that fail verification are marked as corrupt and do not participate in backfilling.

[0027] Step 3: Calculate the historical backfill rate based on the gateway's operating status, and upload the data in the historical backfill queue according to the historical backfill rate; wherein, the gateway operating status includes at least CPU utilization, network RTT, real-time upload queue length, and Modbus acquisition cycle jitter; in Step 3, the historical backfill rate is:

[0028] in, Indicates the maximum permissible backfill rate. Indicates the network quality coefficient. Indicates the CPU idle coefficient. Indicates the real-time task protection coefficient. This represents the database write success rate coefficient.

[0029] Step 4: When the real-time control related tasks exceed the protection threshold, reduce or suspend historical backfilling; Step 5: After the historical data is successfully uploaded and remote confirmation is received, mark the corresponding WAL record as confirmed.

[0030] In a preferred embodiment, the upload status field in this application includes at least three statuses: not uploaded, uploading, confirmed, corrupted, and skipped. The status index file records the upload status of each WAL record, including not uploaded, uploading, confirmed, corrupted, and skipped. After a WAL record is persisted, its upload status is set to not uploaded; when a WAL record is added to an upload batch, its upload status is updated to uploading; after receiving a write success confirmation from a remote time-series database, the upload status is updated to confirmed; if the upload fails or no write success confirmation is received within a preset time, the upload status reverts to not uploaded; if a WAL record fails integrity verification, its upload status is updated to corrupted; if a WAL record matches duplicate data, timestamp conflicts, or invalid data processing rules, its upload status is updated to skipped.

[0031] After the gateway restarts or the network recovers, WAL records with an upload status of "not uploaded" will be added to the historical backfill queue. For WAL records that are in the upload state but have not received a successful write confirmation, their upload status will be restored to "not uploaded". WAL records with upload statuses of "confirmed", "damaged", or "skipped" will no longer be added to the historical backfill queue.

[0032] Preferably, when historical data and real-time data have the same device number, measurement point number, and timestamp, timestamp conflict resolution is performed. This timestamp conflict resolution includes at least one rule among: prioritizing data with correct CRC, prioritizing data with larger sampling sequence numbers, prioritizing data with normal quality codes, and prohibiting duplicate writing to confirmed data. The energy storage gateway generates data identifiers based on the device number, measurement point number, and sampling timestamp. During historical backfilling, when multiple WAL records with the same data identifier exist, records with failed CRC checks are first removed, and then records with normal quality codes are selected from the records that passed CRC checks. When multiple records with normal quality codes exist, the record with the larger sampling sequence number is added to the historical backfilling queue. When a confirmed record with the same data identifier already exists in the status index, the remaining records with the same data identifier are marked as skipped and not uploaded again.

[0033] In this application, the WAL record is not deleted immediately after the historical data is successfully uploaded. Instead, after receiving confirmation of successful writing to the remote time-series database, the WAL record is marked as confirmed, and the WAL segment is deleted after all records in the corresponding WAL segment have been confirmed.

[0034] As a preferred implementation, in this application, when a network anomaly is detected again during the historical backfilling process, historical backfilling is stopped and unconfirmed WAL records are maintained. Backfilling continues from the unconfirmed location after the network is detected to have recovered again.

[0035] In this application, the real-time control related tasks include at least one of the following: current Modbus acquisition task, pump valve control command task, alarm reporting task, and flow battery protection interlock task; The flow battery energy storage gateway is any one of the following: an ARM gateway running a Go program, an industrial computer, an embedded Linux gateway, or a local data acquisition gateway for the energy storage station.

[0036] As one embodiment of this application, the method of the present invention is completed collaboratively by a real-time acquisition module, a time-series data encapsulation module, a network status detection module, a real-time upload queue, a local WAL cache, an adaptive rate limiting module, a historical backfilling queue, a real-time control and protection module, a remote time-series database, a priority scheduler, a timestamp conflict resolution module, and a confirmation deletion module. The real-time acquisition module collects data from the BMS, PCS, fuel cell stack, chiller, temperature and humidity, external I / O, alarms, and communication status. The time-series data encapsulation module encapsulates the data into unified time-series data points. The field composition and function of the unified time-series data points are shown in Table 1. Specifically, DeviceID (device number) and PointID (measurement point number) identify the device and measurement point, respectively; TimestampMs (sampling timestamp) is a millisecond timestamp used for writing to the time-series database and resolving timestamp conflicts; Seq is the sampling sequence number used to determine the age of sampled data at the same timestamp; Value (data value) stores the acquisition result; Quality (quality code) identifies data quality status such as normal, offline, out-of-limit, or estimated value; and CRC is used for cache recovery and conflict judgment.

[0037] Table 1. Examples of Time Series Data Point Fields

[0038] The network status detection module does not rely solely on ping to determine network status. Instead, it comprehensively considers HTTP connections, TCP connections, database write results, the most recent N upload failure rates, network RTT, and upload queue length. When the network is normal, real-time data enters the real-time upload queue and is written to the remote time-series database; when the network is abnormal, real-time data is written to the local WAL cache.

[0039] like Figure 2As shown, the local WAL cache uses pre-allocated segmented files, sequential append writing, and indexing and acknowledgment flags. Each WAL record may include a Magic header, file version, device number, measurement point number, sampling timestamp, sampling sequence number, data value, quality code, CRC checksum, and upload status. The index is only updated after the record is written and the CRC check passes, avoiding half-written records during power outages. The structure of the local WAL record and the function of each field are shown in Table 2. Among them, Magic is used to identify legitimate WAL records; Version identifies the file version to ensure compatibility with different record structures; DeviceID and PointID are used to locate the data source; Timestamp and Seq are used to determine the sampling sequence and support conflict resolution; Value and Quality are used to store the acquisition results and their quality status; CRC is used to identify corrupted or half-written records; State records the upload status such as not uploaded, uploading, acknowledged, corrupted, or skipped.

[0040] Table 2 Examples of WAL Recording Structure

[0041] like Figure 3 As shown, this invention can define online real-time upload state, network outage caching state, recovery backfilling state, backfilling paused state, and confirmation deletion state. When the gateway is in online real-time upload state, it prioritizes uploading the current real-time data; when the network is abnormal, it enters the network outage caching state and writes the data to the WAL; after the network is restored, it enters the recovery backfilling state; if the real-time control protection condition is triggered, it enters the backfilling paused state; after the WAL record receives remote confirmation, it enters the confirmation deletion state.

[0042] like Figure 4 As shown, the adaptive rate limiting module calculates the historical backfill rate based on the gateway's operating status. In one embodiment, Based on changes in RTT and upload failure rate Based on changes in CPU utilization Based on the real-time upload queue length and Modbus acquisition cycle jitter changes. Based on changes in database write success rate, all the above coefficients can be limited to between 0 and 1. The input indicators and adjustment effects of the adaptive rate limiting parameters are shown in Table 3. Adjust the refill rate based on network RTT, packet loss rate, and upload failure rate; reduce the refill rate when network quality deteriorates. Adjust the backfill rate based on CPU utilization and system load; reduce the backfill rate when CPU load increases. Adjust the backfill rate based on the real-time upload queue length and Modbus acquisition cycle jitter, and reduce the backfill rate when the real-time task pressure increases. Adjust the write rate based on the database write failure rate; reduce the backfill rate when write failures increase. The upper limit used to restrict the historical backfill rate.

[0043] Table 3 Examples of Adaptive Current Limiting Parameters

[0044] The real-time control and protection module continuously monitors Modbus acquisition cycle jitter, real-time upload queue length, CPU usage, control command queue backlog, continuous database write failures, and system alarm status. When any indicator exceeds the protection threshold, the priority scheduler immediately reduces the upload quota of the historical backfill queue, and in severe cases, suspends historical backfilling, prioritizing real-time acquisition, control commands, alarm reporting, and flow battery protection interlocking tasks. In one embodiment, the conditions for slowing down and suspending historical backfilling are shown in Table 4. When Modbus acquisition cycle jitter exceeds 30%, historical backfilling is suspended; when the real-time upload queue length exceeds 5000 entries, historical backfilling upload quota allocation is stopped; when CPU usage exceeds 80% for 10 consecutive seconds, the backfilling rate is reduced to the lowest level; when the control command queue is not empty and the waiting timeout occurs, historical backfilling is immediately suspended; when a level 1 alarm or system failure occurs, historical backfilling is suspended.

[0045] Table 4 Examples of Backfill Pause Conditions

[0046] like Figure 5 As shown, the real-time upload queue and the historical backfill queue are scheduled uniformly by the priority scheduler. The real-time upload queue has a higher priority than the historical backfill queue, and the historical backfill queue only receives upload quotas when the real-time task load allows. The timestamp conflict resolution module is used to process records with the same device number, measurement point number, and timestamp in historical and real-time data. The processing rules adopted by the timestamp conflict resolution module are shown in Table 5. For records with the same device number, measurement point number, and timestamp, records that fail CRC check are first excluded, and then records with normal quality codes are selected first from the records that pass the check; if there are multiple records with normal quality codes, the record with the larger sampling sequence number is selected. For data that has already obtained remote write success confirmation, it will not be written again, and other records with the same data identifier are marked as skipped.

[0047] Table 5 Examples of Timestamp Conflict Resolution Rules

[0048] After historical data is written to the remote time-series database, the confirmation deletion module waits for confirmation of successful remote write. Only after receiving confirmation is the corresponding WAL record marked as confirmed. The confirmation deletion module deletes the segment file only after all records within it have been confirmed. If the network is lost again during the backfilling process, unconfirmed records remain in the WAL, and backfilling will continue from the unconfirmed position once the network is restored.

[0049] To illustrate the technical effects of the present invention, Table 6 provides a set of comparative parameters for each embodiment. These parameters are used to illustrate the operational effects of the embodiments of the present invention and are not intended to limit the scope of protection of the present invention.

[0050] Table 6 Comparison of Technical Effects in Examples

[0051] In summary, this invention achieves reliable data storage and low-disturbance backfilling of flow battery energy storage gateways in network outage and recovery scenarios by separating the real-time upload queue from the historical backfill queue, local WAL structured caching, adaptive backfilling rate limiting based on gateway operating status, real-time control protection, timestamp conflict resolution, and confirmation deletion mechanism.

[0052] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. In the above embodiments of the present invention, the descriptions of each embodiment have their own emphasis; parts not described in detail in a certain embodiment can be referred to in the relevant descriptions of other embodiments. It should be understood that the disclosed technical content in the several embodiments provided in this application can be implemented in other ways.

[0053] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for network outage buffering and refilling of a flow battery energy storage gateway, characterized in that, Includes the following steps: Step 1: Collect the operating data of the flow battery energy storage system and encapsulate it into time series data points with device number, measurement point number, timestamp, sampling sequence number, value, quality code and check value; Step 2: Check the network availability status of the remote server or remote time-series database; When the network is available, the time-series data points are written into the real-time upload queue and uploaded; When the network is unavailable, the time-series data points are written to the local WAL cache; when the network is detected to be restored, while the real-time data continues to be uploaded in the real-time upload queue, the local WAL cache is scanned to generate a historical backfill queue. Step 3: Calculate the historical backfill rate based on the gateway's operating status, and upload the data in the historical backfill queue according to the historical backfill rate; wherein, the gateway's operating status includes at least CPU utilization, network RTT, real-time upload queue length, and Modbus acquisition cycle jitter; Step 4: When the real-time control related tasks exceed the protection threshold, reduce or suspend historical backfilling; Step 5: After the historical data is successfully uploaded and remote confirmation is received, mark the corresponding WAL record as confirmed.

2. The method for network outage buffering and refilling of a flow battery energy storage gateway according to claim 1, characterized in that, The operating data of the flow battery energy storage system includes at least one of the following: BMS data, PCS data, stack data, chiller data, temperature and humidity data, external I / O module data, alarm status, and communication status.

3. The method for network outage buffering and refilling of a flow battery energy storage gateway according to claim 1, characterized in that, The network availability status is determined based on at least two of the following: HTTP connection status, TCP connection status, remote time-series database write results, recent N upload failure rate, network RTT, and upload queue length.

4. The method for network outage buffering and refilling of a flow battery energy storage gateway according to claim 1, characterized in that, The local WAL cache adopts a pre-allocated segmented file, sequential append writing and index delayed update method, and each segmented file has a segment check value; The WAL record includes the Magic recognition header, file version, device number, measurement point number, sampling timestamp, sampling sequence number, data value, quality code, CRC check value, and upload status field.

5. The method for network outage buffering and refilling of a flow battery energy storage gateway according to claim 4, characterized in that, The upload status field includes at least three statuses: not uploaded, uploading, confirmed, corrupted, and skipped.

6. The method for network outage buffering and refilling of a flow battery energy storage gateway according to claim 1, characterized in that, In step 3, the historical backfill rate is: in, Indicates the maximum permissible backfill rate. Indicates the network quality coefficient. Indicates the CPU idle coefficient. Indicates the real-time task protection coefficient. This represents the database write success rate coefficient.

7. The method for network outage buffering and refilling of a flow battery energy storage gateway according to claim 1, characterized in that, When historical data and real-time data have the same device number, measurement point number, and timestamp, timestamp conflict resolution is performed. The timestamp conflict resolution includes at least one of the following rules: prioritizing data with correct CRC, prioritizing data with larger sampling sequence number, prioritizing data with normal quality code, and prohibiting duplicate writing to confirmed data.

8. The method for network outage buffering and refilling of a flow battery energy storage gateway according to claim 1, characterized in that, After the historical data is successfully uploaded, the WAL record is not deleted immediately. Instead, after receiving confirmation of successful write to the remote time-series database, the WAL record is marked as confirmed, and the WAL segment is deleted after all records in the corresponding WAL segment have been confirmed.

9. The method for network outage buffering and refilling of a flow battery energy storage gateway according to claim 1, characterized in that, If a network anomaly is detected again during the historical backfilling process, the historical backfilling is stopped and the unconfirmed WAL records are kept. Backfilling will continue from the unconfirmed location once the network is detected to have recovered again.

10. The method for network outage buffering and refilling of a flow battery energy storage gateway according to claim 1, characterized in that, The real-time control related tasks include at least one of the following: current Modbus acquisition task, pump and valve control command task, alarm reporting task, and flow battery protection interlock task. The flow battery energy storage gateway is any one of the following: an ARM gateway running a Go program, an industrial computer, an embedded Linux gateway, or a local data acquisition gateway for the energy storage station.