Control method of energy storage device, energy storage system and storage medium

By storing cloud control strategies in the local data storage module and switching to local autonomous mode in case of communication failure, the control problem of energy storage equipment in the distribution area during communication interruption is solved, and reliable operation and safe switching of energy storage equipment are realized.

CN122495708APending Publication Date: 2026-07-31SHENZHEN CLOU ELECTRONICS
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN CLOU ELECTRONICS
Filing Date
2026-04-24
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing energy storage devices in distribution areas may lose control commands during communication interruptions, potentially leading to shutdowns or undesirable operating conditions and threatening the safety of power supply in the distribution area.

Method used

The local data storage module pre-stores the control strategies issued by the cloud, including remote control periods and corresponding power values ​​or setting flags. By querying the mapping value that matches the current time, reliable remote control of the energy storage device can be achieved. In case of communication failure, it automatically switches to the local autonomous strategy and performs charging and discharging control based on local measurement data.

Benefits of technology

It achieves globally optimized time-based power control under normal communication conditions, and ensures seamless switching to safe and autonomous operation when communication is abnormal, thus guaranteeing the reliability and stability of control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122495708A_ABST
    Figure CN122495708A_ABST
Patent Text Reader

Abstract

This application discloses a control method, energy storage system, and storage medium for an energy storage device, relating to the field of energy storage system technology. The disclosed control method for the energy storage device includes: querying a mapping value corresponding to the current time from a local data storage module as a query result; if the query result includes a power value, sending a control command including the power value to the energy storage device, so that the energy storage device performs charge and discharge control based on the power value in the control command; if the query result includes a setting flag, sending a command to the local controller of the energy storage device to switch to a local autonomous strategy, so that the local controller of the energy storage device performs charge and discharge control on the energy storage device based on the power value determined by local measurement data. This enables the energy storage device in the distribution area to reliably execute time-based power control commands issued from the cloud based on global optimization, and to seamlessly switch to a safe local autonomous operation strategy when communication is abnormal or there is no cloud remote control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of energy storage system technology, and in particular to control methods for energy storage devices, energy storage systems and storage media. Background Technology

[0002] With the high proportion of new loads such as distributed photovoltaic power and electric vehicle charging piles being connected to distribution network areas, the distribution network is facing multiple challenges, including voltage exceeding limits, bidirectional power flow, three-phase imbalance, and seasonal heavy overload. Distribution network energy storage, as a flexible and economical "investment alternative," can effectively perform peak shaving and valley filling, reactive power compensation, and improve power supply quality and renewable energy absorption capacity, and has become a key infrastructure supporting the development of new power systems.

[0003] Currently, the main operation and control strategies for energy storage in distribution substations include centralized remote control, where a cloud platform directly and continuously issues real-time power commands to the energy storage devices. Theoretically, this strategy can achieve globally optimal scheduling. However, it heavily relies on communication; the control loop must be established on a stable, low-latency communication link. If communication is interrupted, the energy storage devices will lose control commands and may enter a shutdown or undesirable operating state, threatening the power supply security of the distribution substation. Summary of the Invention

[0004] The main purpose of this application is to provide a control method, energy storage system and storage medium for energy storage devices, which aims to enable the energy storage devices in the distribution area to reliably execute time-based power control commands issued from the cloud based on global optimization, and to seamlessly switch to a safe local autonomous operation strategy when communication is abnormal or there is no cloud remote control.

[0005] To achieve the above objectives, this application proposes a control method for an energy storage device, comprising: The local data storage module retrieves the mapping value corresponding to the current time as the query result. The local data storage module stores the control strategy sent from the cloud. The control strategy includes the start time, end time and mapping value corresponding to each time of at least one remote control period. The mapping value includes power value or setting flag. If the query result includes a power value, a control command including the power value is sent to the energy storage device so that the energy storage device can perform charging and discharging control based on the power value in the control command. If the query result includes a setting flag, a command to switch to a local autonomous strategy is sent to the local controller of the energy storage device, so that the local controller of the energy storage device can control the charging and discharging of the energy storage device based on the power value determined by local measurement data.

[0006] In one embodiment, retrieving the mapping value corresponding to the current time from the local data storage module as the query result includes: Get the current time and use it as the query base. Traverse the data structure in the local data storage module arranged in chronological order to find the target node that meets the conditions. The conditions that the target node meets include: the current time is greater than or equal to the set time of a certain node and less than the set time of the next node of that certain node. If a target node that meets the conditions is found, it is determined that the current time is within the remote control period, and the power value corresponding to the target node is used as the query result. If no target node that meets the conditions is found after the traversal is completed, it is determined that the current time is not within any remote control period, and a flag is set as the query result.

[0007] In one embodiment, before retrieving the mapping value corresponding to the current time from the local data storage module as the query result, the method further includes: Create a data structure in the local data storage module; Receive control strategies sent from the cloud, wherein the control strategies include at least one remote control period and the corresponding mapping value of the remote control period; The control strategy is loaded into the data structure.

[0008] In one embodiment, the data structure is a linked list; creating the data structure in the local data storage module includes: Create an initial structure, whose contents include time, mapping value, and link pointer, with the link pointer being null; Create the head node of the linked list based on the initial structure; The contents of the initial structure of the header node are initialized to obtain the data structure.

[0009] In one embodiment, the data structure is a linked list; loading the control strategy into the data structure includes: For a single remote control period, find the node positions corresponding to the start and end times of the remote control period in the linked list, and insert the corresponding structure at the node position. The structure includes the time, the mapping value, and the link pointer, which is used to link the current node to the next node.

[0010] In one embodiment, finding the node positions corresponding to the start and end times of the remote control period in the linked list, and inserting the corresponding structure at the node positions includes: Traverse the linked list arranged in chronological order and find the first node in the list whose time is greater than the start time of the remote control period; The node position preceding the first node is determined as the node position corresponding to the start time, and a first structure is inserted at the node position corresponding to the start time. The first structure includes the start time, power value, and first link pointer. Continue traversing the linked list in chronological order to find the second node in the list whose time is greater than the time of the remote control period; The node position preceding the second node is determined as the node position corresponding to the end time, and a second structure is inserted at the node position corresponding to the end time. The second structure includes the end time, a setting flag, and a second link pointer.

[0011] In one embodiment, finding the node positions corresponding to the start and end times of the remote control period in the linked list, and inserting the corresponding structure at the node positions includes: Traverse the linked list arranged in chronological order and search for the first node in the list whose time is greater than the start time of the remote control period; If it does not exist, the end position of the linked list is determined as the node position corresponding to the start time, and the first structure is inserted at the node position corresponding to the start time. The first structure includes the start time, power value and first link pointer. Continue traversing the linked list arranged in chronological order, and search for whether there exists a second node in the linked list whose first time is greater than the end time of the remote control period; If it does not exist, the end position of the linked list is determined as the node position corresponding to the end time, and a second structure is inserted at the end position of the linked list. The second structure includes the end time, a setting flag, and a second link pointer.

[0012] In one embodiment, after receiving the control strategy sent from the cloud, the method further includes: Iterate through each remote control period and check whether each remote control period is valid; If ineffective, skip the invalid remote control period; If valid, the valid remote control period will be loaded into the data structure.

[0013] In addition, to achieve the above objectives, this application also proposes an energy storage system, including: a cloud, an energy management system, a local controller for the energy storage device, the energy storage device, and a local data storage module; The energy management system includes: a memory, a processor, and a control program for an energy storage device stored in the memory and executable on the processor. The control program for the energy storage device is configured to implement the steps of the control method for the energy storage device described above.

[0014] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, storing a control program for an energy storage device. When the control program for the energy storage device is executed by a processor, it implements the steps of the control method for the energy storage device as described above.

[0015] One or more technical solutions proposed in this application have at least the following technical effects: By pre-storing the control strategy issued by the cloud, which includes remote control time periods and corresponding power values ​​or set flags, in the local data storage module, under normal communication and cloud control conditions, the power value matching the current time can be directly queried and control commands can be issued, enabling the energy storage equipment in the distribution area to reliably execute time-based remote power control based on global optimization; when communication is abnormal or there is no cloud remote control, the current time will not be able to match a valid power value, the query result will correspond to the set flag, and the system will automatically issue a switching command to the energy storage equipment, enabling it to seamlessly switch to a safe autonomous operation mode that autonomously determines the power based on local measurement data and executes charging and discharging control, thereby ensuring the reliable execution of the cloud global optimization strategy and realizing uninterrupted local safe operation in abnormal scenarios. Attached Figure Description

[0016] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A flowchart illustrating an embodiment of the control method for the energy storage device of this application; Figure 2 A schematic diagram of the overall flow of the control method for the energy storage device of this application is shown; Figure 3 The flowchart illustrating the linked list initialization based on the control strategy of this application is shown; Figure 4 This document illustrates a flowchart of the loading and control strategy provided in this application into a linked list; Figure 5 A flowchart for obtaining the power value at the current time, as provided in this application, is shown; Figure 6 A flowchart illustrating how this application determines the corresponding strategy based on the power value is shown.

[0019] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0020] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0021] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0022] With the high proportion of new loads such as distributed photovoltaic power and electric vehicle charging piles being connected to distribution network areas, the distribution network is facing multiple challenges, including voltage exceeding limits, bidirectional power flow, three-phase imbalance, and seasonal heavy overload. Distribution network energy storage, as a flexible and economical "investment alternative," can effectively perform peak shaving and valley filling, reactive power compensation, and improve power supply quality and renewable energy absorption capacity, and has become a key infrastructure supporting the development of new power systems.

[0023] Currently, the main operation and control strategies for energy storage in distribution substations include centralized remote control, where a cloud platform directly and continuously issues real-time power commands to the energy storage devices. Theoretically, this strategy can achieve globally optimal scheduling. However, it heavily relies on communication; the control loop must be established on a stable, low-latency communication link. If communication is interrupted, the energy storage devices will lose control commands and may enter a shutdown or undesirable operating state, threatening the power supply security of the distribution substation.

[0024] To address the aforementioned issues, this application proposes a control method for an energy storage device. The main technical solution includes: querying the mapping value corresponding to the current time from a local data storage module as the query result, wherein the local data storage module stores the start time, end time, and mapping value corresponding to each remote control period, and the mapping value includes a power value or a setting flag; if the query result includes a power value, sending a control command including the power value to the energy storage device, so that the energy storage device performs charge and discharge control based on the power value in the control command; if the query result includes a setting flag, sending a command to switch to a local autonomous strategy to the energy storage device, so that the energy storage device determines the power value according to local measurement data and performs charge and discharge control based on the power value.

[0025] By pre-storing control strategies, including remote control time periods and corresponding power values ​​or set flags, issued from the cloud, in the local data storage module, the system can directly query the power value matching the current time and issue control commands under normal communication and cloud control conditions. This enables the energy storage equipment in the distribution area to reliably execute time-based remote power control based on global optimization. However, when communication is abnormal or there is no cloud remote control, the current time will not be able to match a valid power value. The query result will correspond to the set flag, and the system will automatically issue a switching command to the energy storage equipment, enabling it to seamlessly switch to a safe and autonomous operation mode that determines the power based on local measurement data and executes charging and discharging control. This ensures both the reliable execution of the cloud-based global optimization strategy and uninterrupted local safe operation under abnormal scenarios.

[0026] Based on this, this application provides a control method for an energy storage device. This method is applied to an energy storage system, which includes an energy management system. The energy management system is the executing entity of the control method for the energy storage device in this application. Specifically, refer to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the control method for the energy storage device of this application.

[0027] In this embodiment, the control method for the energy storage device includes steps S10 to S40: Step S10: Query the mapping value corresponding to the current time from the local data storage module as the query result. The local data storage module stores the control strategy sent from the cloud. The control strategy includes the start time, end time and mapping value corresponding to each time of at least one remote control period. The mapping value includes power value or setting flag. Energy storage devices are deployed under distribution transformer areas, using electrochemical energy storage units such as lithium-ion batteries as energy storage carriers and energy storage converters (PCS) as the energy conversion core. They are power regulation devices capable of receiving control commands and performing bidirectional energy conversion between DC and AC according to specified power values, enabling charging and discharging operations. Their functions include receiving control commands from the energy management system, executing charging or discharging operations according to specified power values, improving the grid operation status of the distribution area through charging and discharging behavior, and achieving grid support functions such as peak shaving and valley filling, smoothing load fluctuations, compensating for reactive power, stabilizing grid voltage, and improving power supply reliability.

[0028] The local data storage module is integrated within the energy storage system. It possesses data retention capabilities even after power loss or real-time caching, and is a combination of hardware storage units and software data structures used to store control strategy data, time parameters, and mapping value data sent from the cloud. Its function is to permanently or temporarily store control strategies for all time periods sent from the cloud in real-time or in advance. This allows the energy storage device to still access the stored control data for time matching and mode determination even when disconnected from the cloud, eliminating strong dependence on real-time communication links and ensuring control continuity in offline states.

[0029] The query result, after a complete process including obtaining the current time, traversing the data structure, matching target nodes, and conditional judgments, is the final output data used to determine the control mode. It includes two types: power values ​​and set flags. Its function is to determine whether the energy storage device enters remote power control mode or local autonomous control mode; it is the final output of the entire query process and the basis for control decisions.

[0030] The current time is generated by the Real-Time Clock (RTC) module within the energy management system, or obtained by the energy management system through system clock counting. It identifies the current operating moment and can be accurate to the hour, minute, or second level. It serves as a reference parameter for matching remote control periods. Its function is to act as a time retrieval benchmark, comparing the current time with the start and end times of remote control periods stored in the local storage module to determine whether the current moment falls within the remote control period specified in the cloud, providing a time basis for mapping value queries.

[0031] The mapping value refers to the control strategy issued from the cloud, which is bound to each point in time to determine whether the energy storage device enters remote power control mode or local autonomous control mode. This mapping value can be either a power value or a set flag. When the mapping value is a power value, it instructs the energy storage device to execute remote power control from the cloud; when the mapping value is a flag, it instructs the energy storage device to switch to local autonomous control mode after executing remote power control.

[0032] The cloud platform, deployed in the power distribution network dispatch center or cloud server platform, serves as the remote control center for energy storage devices in the distribution area. Its functions include: collecting load data, photovoltaic output data, grid voltage data, and frequency data from the entire distribution network area; calculating and generating power control schemes for different time periods based on global optimization objectives; forming standardized control strategies; and distributing these strategies to the local storage modules of each energy storage device in the distribution area.

[0033] The control strategy is generated in the cloud based on the global optimization target of the power grid in the distribution area. It consists of at least one set of remote control time periods and corresponding mapping values, which guides the energy storage devices to execute a control scheme with a specified power during the specified time period. This enables the energy storage devices to perform charging and discharging according to the global target, avoiding the problems of uncoordinated regulation and poor optimization effect caused by a single device operating only based on its local state.

[0034] The remote control period is clearly defined by the cloud in the control strategy. Energy storage devices prioritize executing the cloud-based remote power control within a continuous time interval, bounded by a clearly defined start and end time point. Purpose: To clearly define the effective time range of cloud-based remote control. Within this period, the device executes remote power control; beyond this period, it automatically exits remote control mode, providing a clear time boundary for mode switching.

[0035] The start time is the activation time of the remote control period set in the cloud. It is the time node when the remote control power value begins to take effect, and it is bound to the corresponding power value and stored in the local data storage module. Its function is to mark the start point of remote control. When the device's current time reaches this moment, the corresponding power value is activated to execute remote control, enabling the energy storage device to enter the control state specified by the cloud on time.

[0036] The end time is the termination point of the remote control period set in the cloud. It is the time node when the remote control power value fails and the mode switching flag takes effect. It is bound to the set flag and stored in the local data storage module. Function: To mark the end point of remote control. When the current time reaches this moment, remote control fails, triggering the energy storage device to automatically switch to local control mode, realizing the safe exit of remote control.

[0037] The power value refers to a parameter derived from cloud-based global optimization calculations for the entire distribution area, used to directly control the charging and discharging intensity of energy storage devices. It includes both charging and discharging power values. Function: As a parameter value for remote control of energy storage devices, the energy management system writes this value into control commands. The energy storage converter (PCS) precisely adjusts its output power according to this power value to complete the charging or discharging action of the specified intensity.

[0038] The set flag refers to a special identifier parameter preset in the cloud-based control strategy. It can be used to indicate that there is currently no valid remote power command or that the remote control period has ended. It is an invalid power value and is only used to trigger mode switching. Function: As a trigger for remote control failure and local control activation, when the query result is this set flag, the energy management system recognizes that there is currently no valid remote command and drives the energy storage device to switch to a local autonomous strategy, ensuring uninterrupted operation. Examples: Standard floating-point non-numerical NAN, custom invalid value flag, specific status word, preset illegal power flag.

[0039] In one optional approach, after startup, the energy management system first performs an initialization operation, constructing a data structure for storing power commands for different time periods. This data structure serves as the data structure for the local data storage module. The cloud sends control strategies containing multiple remote control time periods to the energy management system via wired Ethernet, wireless 4G / 5G, or power line carrier communication. Each remote control time period includes a clear start time, end time, corresponding power value, and a NAN setting flag bound to the end time. The energy management system writes all received remote control time periods sequentially into the nodes of this data structure, with each node storing a time and its corresponding mapping value. During actual operation of the energy storage device, the energy management system continuously acquires the current time through its internal real-time clock (RTC) module. It then traverses the entire data structure of the local data storage module in ascending order, comparing the current time with the times in the nodes of the data structure, searching for nodes that meet the conditions, extracting the mapping value stored in that node, and using it as the query result.

[0040] In another optional approach, a dedicated storage partition is partitioned within the energy management system as a local data storage module, capable of retaining data even in the event of power failure. The cloud-based system standardizes and encapsulates the generated control strategies, clearly specifying the start and end times of each remote control period, as well as the power value or set flag associated with each time point. After encapsulation, the strategy is transmitted via communication link and permanently stored in the designated storage partition. During the actual operation of the energy storage device, the energy management system uses the current time as a query reference. Using the current time as the search keyword, it iterates through the data in the storage partition, matching the current time with the stored start and end times one by one. Once the time period to which the current time belongs is located, the corresponding time point mapping value is read and used as the query result.

[0041] Step S20: If the query result includes a power value, send a control command including the power value to the energy storage device so that the energy storage device can perform charging and discharging control based on the power value in the control command; Control commands are executable instruction messages generated by the energy management system based on effective power values ​​and conforming to the communication specifications of the energy storage converter PCS. These commands can contain mapping values, control command words, and device address information. Their function is to convert the power values ​​sent from the cloud into control signals recognizable by the energy storage device, transmit power regulation requirements, drive the energy storage converter PCS to complete AC-DC conversion and power output, and ultimately control the charging and discharging behavior of the energy storage device.

[0042] In one optional approach, after obtaining the query result, the energy management system first performs a numerical validity check to determine if the query result is a valid floating-point or integer power value, confirming it as a valid power value. The controller encapsulates this power value according to the communication protocol format supported by the energy storage converter PCS, filling in complete information such as device address, function code, register address, mapping value, and checksum in the command message to form an executable control command. The energy management system sends the control command to the energy storage converter PCS. Upon receiving the control command, the energy storage converter PCS parses the message, extracts the power value, and determines whether to perform a charging or discharging action based on the positive or negative sign of the power value. A positive value corresponds to a discharging operation, and a negative value corresponds to a charging operation. Subsequently, it adjusts the turn-on and turn-off timing of the internal IGBT power switches to adjust the energy conversion ratio between the DC and AC sides, stabilizing the output power at the value specified in the command, thus completing precise charging and discharging control.

[0043] In another optional approach, the energy management system performs numerical verification on the query results. After confirming that the power value is indeed from the cloud, it reads the battery total voltage, individual cell voltage, maximum charging current, maximum discharging current, and remaining SOC status parameters uploaded by the local battery management system (BMS). Based on the battery status, it performs safety calibration on the power value from the cloud to avoid exceeding the battery's allowable range. After calibration, the energy management system generates corresponding PWM pulse width modulation control commands according to the control requirements of the energy storage converter (PCS), determining the duty cycle, frequency, and phase parameters of the PWM wave. The energy management system outputs the PWM commands to the drive circuit of the PCS. The drive circuit controls the conduction time and sequence of the power switches according to the commands, achieving precise conversion between DC and AC power. This ensures that the energy storage device stably performs charging or discharging actions according to the calibrated power value, guaranteeing the accuracy and safety of remote power control.

[0044] Step S30: If the query result includes a setting flag, send an instruction to switch to the local autonomous strategy to the local controller of the energy storage device, so that the local controller of the energy storage device can control the charging and discharging of the energy storage device based on the power value determined by the local measurement data.

[0045] Local autonomous strategies refer to strategies pre-embedded in the local controller of energy storage devices. These strategies do not rely on cloud communication or remote commands, but instead autonomously determine power output safety control rules based solely on locally collected grid data. Their function is to provide a stable and reliable basis for autonomous operation of energy storage devices in the absence of effective remote control, ensuring continuous and safe operation of the devices, maintaining basic stability of the power grid in the distribution area, and preventing downtime or loss of control. Examples include: V / f droop control strategies based on local voltage, automatic charging and discharging strategies based on local load size, automatic adjustment strategies based on three-phase imbalance in the distribution area, and timed charging and discharging strategies.

[0046] Local measurement data refers to the real-time operating parameters of the power grid in the distribution area, directly acquired by the local controller of the energy storage device through local voltage transformers, current transformers, and acquisition modules. The data acquisition and processing do not rely on cloud transmission. Function: As the calculation input for local autonomous strategies, the local controller of the energy storage device uses this data to calculate the required charging and discharging power output in real time, achieving autonomous power decision-making without remote commands. Examples: Locally acquired three-phase AC voltage RMS value, grid frequency, real-time load power, photovoltaic grid-connected power, battery pack voltage, and battery charging and discharging current.

[0047] In one optional approach, the energy management system identifies the query results, determines that the query results are a set flag, and generates a switching command for the local autonomous strategy. Upon receiving the switching command, the local controller of the energy storage device activates the local voltage and frequency acquisition modules, using transformers to collect the effective values ​​of the three-phase voltage and grid frequency data of the distribution area's power grid in real time. The local controller of the energy storage device calls a locally pre-stored V / f droop control algorithm, using the collected voltage and frequency data as input parameters, and calculates the target charging and discharging power to be output according to a preset droop curve. After calculation, the local controller of the energy storage device converts the target charging and discharging power into a control signal executable by the energy storage converter PCS, driving the energy storage converter PCS to perform charging and discharging actions according to the calculated target charging and discharging power, achieving stable local autonomous operation without remote commands.

[0048] In another optional approach, when the energy management system detects a custom setting flag preset in the cloud, it determines that there is currently no valid remote control command, generates a local autonomous strategy switching command, and sends it to the local controller of the energy storage device. Upon receiving the local autonomous strategy switching command, the local controller of the energy storage device stops receiving remote power commands and simultaneously calls the local data acquisition unit to obtain real-time measurement data such as the load power of the distribution area, photovoltaic output power, and three-phase imbalance. Based on these local measurement data, the local controller of the energy storage device comprehensively calculates the optimal charging and discharging power, determining the charging or discharging direction and power value. After the calculation is completed, the local controller outputs the decision power to the energy storage converter PCS. The energy storage converter PCS automatically adjusts the energy conversion according to the locally calculated power, completing autonomous charging and discharging control, ensuring the continuous and safe operation of the energy storage device and maintaining the stability of the distribution area's power grid.

[0049] In this embodiment, by pre-storing the control strategy issued from the cloud, which includes remote control time periods and corresponding power values ​​or set flags, in the local data storage module, the system can directly query the power value matching the current time and issue control commands under normal communication and cloud control conditions, enabling the energy storage equipment in the distribution area to reliably execute time-based remote power control based on global optimization. However, when communication is abnormal or there is no cloud remote control, the current time will not be able to match a valid power value, and the query result will correspond to the set flag. Based on this, the system will automatically issue a switching command to the energy storage equipment, enabling it to seamlessly switch to a safe autonomous operation mode that autonomously determines the power based on local measurement data and executes charging and discharging control. This ensures both the reliable execution of the cloud-based global optimization strategy and uninterrupted local safe operation under abnormal scenarios.

[0050] In one feasible implementation, step S10 may include steps S11 to S14: Step S11: Obtain the current time and use the current time as the query reference; In one alternative approach, after power-on, the energy management system continuously drives its internal independent real-time clock (RTC) hardware module. This clock module relies on an external crystal oscillator to provide a stable clock signal, continuously accumulating time and outputting calendar time in year, month, day, hour, minute, and second format. The energy management system then converts this calendar time into the total number of seconds or milliseconds from the start time to the current time using a standardized algorithm, forming a purely numerical digital timestamp. The energy management system uses this timestamp as the current time, serving as a reference standard for subsequent data structure traversal and time comparisons.

[0051] Step S12: Traverse the data structures in the local data storage module arranged in chronological order and find the target node that meets the conditions. The conditions that the target node meets include: the current time is greater than or equal to the set time of a certain node and less than the set time of the next node of that certain node. Traversal is a process by which the energy management system, following a predetermined order, visits each storage node sequentially, starting from the beginning of the data structure. It reads the time and mapping values ​​within each node and performs pre-defined condition checks on each node until all nodes have been visited or a node matching the conditions is found. Its purpose is to ensure that all nodes in the data structure are visited and checked, without skipping or omitting any time period nodes, ensuring comprehensive and reliable identification of remote control time periods, and improving the completeness and accuracy of the query logic.

[0052] Time-order arrangement is a data structure in which all nodes are arranged in order of the time stored in the nodes, from smallest to largest (i.e., from earliest to latest), forming a continuous and conflict-free time series structure. Its functions include: simplifying traversal and search logic, reducing the computational load of the energy management system, ensuring uninterrupted time interval judgment, and improving node search speed and time matching accuracy.

[0053] A data structure is a logical structure used in software programming to organize, store, and manage cloud-based control strategy data. It possesses functions such as node creation, data writing, sequential access, node reading, and dynamic updating, and can organize discrete time and mapping values ​​into an efficiently searchable ordered whole. Its purpose is to standardize and structure the data delivered from the cloud, providing an efficient data access method for fast traversal, time matching, and result querying. Examples of data structures include singly linked lists, dynamic linear lists, ordered arrays, and doubly linked lists.

[0054] The target node is the node that, during the traversal of the data structure, satisfies the condition that the current time is greater than or equal to the set time of this node and less than the set time of the next node. It is a key node that identifies the current time as being within a valid remote control period. Its function is to determine the remote control period to which the current time belongs and directly provide the corresponding power value for that period.

[0055] A node is the smallest independent data unit that constitutes a data structure. Each node encapsulates a single time and its corresponding mapping value, and also contains index information pointing to the next node. It is the basic unit for forming a complete data structure. Its function is to independently carry a set of set time and mapping value data. Multiple nodes are combined to form a complete remote control time period sequence, achieving a one-to-one correspondence between time and mapping value storage.

[0056] The set time is a time value stored in the data structure node, derived from the cloud-based control strategy. It corresponds to the start or end time of the remote control period and is used to delineate the effective time boundary for remote control. Its function is to compare the value with the current time, define the start and end points of the remote control period, form a complete time interval, and provide a time basis for determining whether the system is currently in a remote control state.

[0057] The next node is the next adjacent node in the data structure ordered by time. Its stored setting time is later than the current node's setting time. Its function is to form a closed time interval together with the current node, defining the end boundary of a single remote control period and ensuring accurate and complete time interval determination.

[0058] In one alternative approach, the energy management system initiates the traversal process starting from the head node (the first node) of the data structure. It first reads the set time value from the head node and then reads the set time value from the next node it points to. The energy management system compares the current time (the reference time) with both of these time values ​​to determine if the condition that the current time is greater than or equal to the set time of the current node and less than the set time of the next node is met. If not, it moves to the next node according to the node index order, repeating the operations of reading the time, reading the next node's time, and checking the conditions, until a node that meets the conditions is found or the end of the data structure is reached.

[0059] Step S13: If a target node that meets the conditions is found, it is determined that the current time is within the remote control period, and the power value corresponding to the target node is used as the query result. In one alternative approach, after the energy management system identifies a target node that meets the time conditions during the traversal process, it reads the power value stored internally by the target node, performs data format standardization processing on this power value, and converts it into a floating-point or integer value that meets the requirements for generating subsequent instructions. After processing, the power value is assigned to the query result variable as the output result of this query process.

[0060] In another optional approach, after the energy management system identifies the target node, it first verifies the data validity of the power values ​​stored within the node to determine whether the values ​​are within a reasonable power range and whether they are valid value types. If the verification passes, it officially determines that the current time is within the remote control period, caches the valid power values, and assigns them to the query result output port, thus completing the determination and output of the query results.

[0061] Step S14: If no target node that meets the conditions is found after traversal, it is determined that the current time is not within any remote control period, and the set flag is used as the query result.

[0062] In one alternative approach, after the energy management system has traversed all nodes in the data structure according to the traversal rules, if it still fails to find a target node that meets the time condition, it determines that the current time does not belong to any remote control period. The energy management system then calls a locally pre-stored floating-point special value NAN (not a number), marks this value as a setting flag, and assigns it to the query result variable as the final query result.

[0063] In another optional approach, when the energy management system has traversed all nodes of the data structure and has not found a match for the target interval, it automatically determines that there is no valid remote control command. The energy management system reads the preset setting flag from the cloud from the local parameter storage area, writes the setting flag into the query result register, marks the query result as an invalid power state, and triggers the subsequent process.

[0064] In this embodiment, the current time is obtained and used as the query reference. The data structure in the local data storage module, arranged in chronological order, is traversed to find target nodes that meet certain conditions. The conditions for a target node include: the current time is greater than or equal to a set time of a certain node, and less than the set time of the next node of that node. If a target node that meets the conditions is found, it is determined that the current time is within a remote control period, and the power value corresponding to the target node is used as the query result. If no target node that meets the conditions is found after traversal, it is determined that the current time is not within any remote control period, and a setting flag is used as the query result. If the query result includes a power value, a control command including the power value is sent to the energy storage device so that the energy storage device can perform charge and discharge control based on the power value in the control command. If the query result includes a setting flag, a command to switch to a local autonomous strategy is sent to the local controller of the energy storage device so that the local controller of the energy storage device can perform charge and discharge control on the energy storage device based on the power value determined by local measurement data. Using the current time as the query benchmark, the system systematically traverses structured data and performs strict dual-condition node matching. Finally, based on the search results, it outputs either the effective power value or a set flag, achieving fully automatic, highly reliable, and comprehensive remote control period determination. The entire process relies solely on locally stored data, without real-time communication, enabling rapid and accurate differentiation between remote and local control states. This provides stable decision support for switching between the two control modes, improving the response speed, operational stability, and anti-interference capabilities of the energy storage device's control logic.

[0065] Based on the first embodiment of this application, in the second embodiment of this application, the same or similar content as the above embodiment can be referred to the above description, and will not be repeated hereafter. Furthermore, before step S10, the control method for the energy storage device further includes steps S01~S03: Step S01: Create a data structure in the local data storage module; In one alternative approach, during the power-on initialization phase, the energy management system requests dedicated memory space from the dynamic storage of the local data storage module and defines a data structure containing a set time, a mapping value, and a pointer to the next node according to a preset node format. The energy management system creates a linked list head node, initializes the set time of the head node to the default value, initializes the mapping value to an invalid flag, and sets the pointer to null. Memory allocation, structure definition, node initialization, and pointer binding are completed sequentially, ultimately forming a unidirectional ordered linked list data structure that can be used to store time-segment strategies.

[0066] In another alternative approach, the energy management system divides a contiguous dedicated storage area in the non-volatile flash memory of the local data storage module, sets the start and end addresses of the area, plans the storage location of each data node according to a fixed byte length, and constructs a linear list data structure. The energy management system initializes the time value and mapping value of each storage unit to the default state, sets the node index order and access rules, and completes the creation and initialization of a linear list structure that supports sequential access and data writing.

[0067] Step S02: Receive the control strategy sent from the cloud, wherein the control strategy includes at least one remote control period and the mapping value corresponding to the remote control period; The control strategy is generated by the cloud system based on the global optimization target of the distribution network. It includes at least one set of remote control time periods, the start time and end time of each time period, the power value, and the set flags, forming a complete control scheme. Its function is to provide standardized, time-based remote control basis for energy storage devices, enabling the devices to perform power regulation according to the globally optimal target.

[0068] In one alternative approach, the energy storage device communicates with the cloud via a communication interface, such as Ethernet, 4G / 5G wireless, power line carrier, or RS485, and continuously listens for data transmitted from the cloud according to a preset communication protocol format. When the cloud sends a control strategy data packet, the energy management system receives the data frame and performs cyclic redundancy check. After the check passes, the data packet is parsed to extract the start time, end time, corresponding power value, and setting flag for all remote control periods. The parsed data is then stored in a temporary buffer for later loading.

[0069] In another optional approach, the energy management system enables a communication interruption reception mode to monitor the status of the cloud communication port in real time. When an interruption signal of the control strategy issued by the cloud is detected, the data reception process is initiated, receiving strategy data continuously frame by frame and buffering each frame. After reception, all data undergoes integrity and format verification. If the verification passes, at least one set of remote control time period information and the corresponding mapping value data for each time period are parsed according to the protocol rules, completing the strategy reception and parsing.

[0070] Step S03: Load the control strategy into the data structure.

[0071] Step S10: Query the mapping value corresponding to the current time from the local data storage module as the query result. The local data storage module stores the control strategy sent from the cloud. The control strategy includes the start time, end time and mapping value corresponding to each time period of at least one remote control period. The mapping value includes power value or setting flag. Specifically, query the mapping value corresponding to the current time from the data structure of the local data storage module as the query result.

[0072] Step S20: If the query result includes a power value, send a control command including the power value to the energy storage device so that the energy storage device can perform charging and discharging control based on the power value in the control command; Step S30: If the query result includes a setting flag, send an instruction to switch to the local autonomous strategy to the local controller of the energy storage device, so that the local controller of the energy storage device can control the charging and discharging of the energy storage device based on the power value determined by the local measurement data.

[0073] In one alternative approach, the energy management system reads the parsed control strategy data from a temporary buffer and sorts all remote control periods in ascending order of start time. It then extracts the start time and corresponding power value for each period, creates a new node, writes the data, and inserts it into the data structure in chronological order. Subsequently, it extracts the corresponding end time and set a flag, creates a new node, writes the data, and continues inserting it into the appropriate position within the data structure. The energy management system adjusts the node pointers to ensure the overall arrangement is in ascending chronological order, and marks the data structure as valid and ready after all nodes have been inserted.

[0074] In another optional approach, the energy management system, following the storage format specified by the data structure, sequentially combines the start time and power value, and the end time and set flag of the remote control period. Each set of data is then written into the created data structure nodes. After each node is written, data verification is performed to compare the written content with the original data in the cloud. Once all data has been written, the data structure status word is updated, marking the policy loading complete and allowing the query process to begin.

[0075] In this embodiment, a data structure is created in the local data storage module; a control strategy sent from the cloud is received, wherein the control strategy includes at least one remote control period and a corresponding mapping value; the control strategy is loaded into the data structure; subsequently, the mapping value corresponding to the current time can be queried from the local data storage module as the query result; if the query result includes a power value, a control command including the power value is sent to the energy storage device, so that the energy storage device performs charge and discharge control based on the power value in the control command; if the query result includes a setting flag, a command to switch to the local autonomous strategy is sent to the local controller of the energy storage device, so that the local controller of the energy storage device performs charge and discharge control on the energy storage device based on the power value determined by local measurement data. By creating a dedicated data structure in the local storage module, receiving the cloud control strategy, and finally loading and solidifying the strategy into the data structure in an orderly manner, the localization and standardization of the cloud remote optimization strategy is realized. This process enables the energy storage device to break free from its dependence on continuous communication and has the ability to execute cloud strategies offline, providing stable and reliable data protection for subsequent real-time queries, time period matching, pattern judgment, and command execution, thereby improving the system's resistance to communication failures and operational reliability.

[0076] In one feasible implementation, the data structure is a linked list. A linked list is a dynamic linear data structure consisting of several independent structure nodes linked together by pointers. Each node contains its own data and a pointer to the next node. It supports dynamically adding, inserting, and deleting nodes, and its length can be infinitely expanded according to actual needs, without being limited by a fixed capacity. Its function is to flexibly adapt to remote control strategies of any number and update frequency issued from the cloud, overcoming the shortcomings of traditional fixed arrays such as limited capacity, difficulty in expansion, and rigid management, thus improving system adaptability and maintainability. Examples include: singly ordered linked lists, singly non-circular linked lists, doubly ordered linked lists, and static linked lists.

[0077] Specifically, step S01 includes steps S011 to S013: Step S011: Create an initial structure, the contents of which include time, mapping value and link pointer, the link pointer being empty; The initial structure refers to the basic data unit used in the early stages of linked list creation to define the node data format. It serves as the template for building the head node and is the smallest encapsulated unit that constitutes a linked list node, uniformly defining all data members contained within the node. Its function is to serve as a standard template for all linked list nodes, ensuring that all subsequently inserted nodes have a unified data format, member type, and storage structure, thus ensuring the consistency and readability of the entire linked list structure.

[0078] The link pointer is a variable stored within the structure to store the memory address of the next node. Multiple independent nodes are sequentially connected through this pointer to form a complete linked list structure. Its function is to maintain the order of nodes in the linked list, enabling sequential traversal, continuous access, and ordered searching of nodes.

[0079] In one alternative approach, the energy management system allocates three variable spaces sequentially according to a predefined data format. The first variable stores the time value, the second variable stores the mapping value, and the third variable stores the link pointer. The energy management system assigns the link pointer variable a null address, not pointing to any storage unit, thus completing the creation of the initial structure.

[0080] In another alternative approach, the energy management system defines a structure data type through an embedded C language program. This structure contains three member variables: time, mapping value, and link pointer. The energy management system declares an object of this structure type as the initial structure, and initializes the link pointer to a null value during creation to ensure that the pointer does not point to any node, thus completing the construction of the initial structure.

[0081] Step S012: Create the head node of the linked list based on the initial structure; The head node is the starting node of the linked list, serving as the access point and management root node for the entire list. Its functions include: providing the program with the entry address for accessing the list, and managing the list's length, node order, and structural state.

[0082] In one alternative approach, the energy management system uses the already created initial structure as a standard template, allocates dedicated memory space at the beginning of the linked list, generates a head node according to the format of the initial structure, and ensures that the head node fully contains three member variables: time, mapping value, and link pointer, thus forming the root node of the linked list.

[0083] In another alternative approach, the energy management system calls the structure creation function provided by the embedded system, uses the initial structure as a prototype, generates the head node of the linked list in memory, and sets the head node as the starting point and entry address of the entire linked list, thus completing the creation of the head node.

[0084] Step S013: Initialize the contents of the initial structure of the table header node to obtain the data structure.

[0085] Initialization refers to assigning preset default initial values ​​to the member variables such as time, mapping value, and link pointer inside the head node, so that the linked list changes from the created state to a ready state that can be used normally.

[0086] In one alternative approach, the energy management system assigns the time variable in the header node to the system's default initial time, assigns the mapping value variable to the default invalid flag, and keeps the link pointer in a null state, thus completing the initialization configuration of all members of the header node and forming a usable linked list data structure.

[0087] In another alternative approach, the energy management system performs initialization configuration on the three member variables of the head node, setting the time to the value corresponding to time zero, setting the mapping value to an invalid flag, and setting the link pointer to an empty address, thus completing all initialization operations and obtaining a stable, standardized, readable and writable linked list data structure.

[0088] In this embodiment, an initial structure is created; a head node of a linked list is created based on the initial structure; the content of the initial structure of the head node is initialized to obtain a data structure; a control strategy sent from the cloud is received, wherein the control strategy includes at least one remote control period and the corresponding mapping value of the remote control period; the control strategy is loaded into the data structure; subsequently, the mapping value corresponding to the current time can be queried from the local data storage module as the query result; if the query result includes a power value, a control command including the power value is sent to the energy storage device so that the energy storage device can perform charge and discharge control based on the power value in the control command; if the query result includes a setting flag, a command to switch to the local autonomous strategy is sent to the local controller of the energy storage device so that the local controller of the energy storage device can perform charge and discharge control on the energy storage device based on the power value determined by the local measurement data. By creating a standardized initial structure, using the initial structure as a template to construct the head node, and finally performing a complete initialization on the head node, a standardized linked list data structure is formed. This structure provides a flexible local storage carrier for cloud control strategies, solves the problem that fixed arrays cannot dynamically adapt to multiple time periods and changing strategies, and improves system adaptability and maintainability. Based on this, the system can use the current time as a query benchmark, systematically traverse structured data, and perform strict two-condition node matching. Finally, it outputs the effective power value or sets a flag based on the search results, achieving fully automatic, highly reliable, and complete determination of remote control periods. The entire process relies solely on locally pre-stored data and does not depend on real-time communication. It can quickly and accurately distinguish between remote control and local control states, providing stable decision support for switching between the two control modes and improving the response speed, operational stability, and anti-interference capability of the energy storage device's control logic.

[0089] In one feasible implementation, step S03 includes step S031: Step S031: For a single remote control period, find the node positions corresponding to the start and end times of the remote control period in the linked list, and insert the corresponding structure at the node position; wherein, the content of the structure includes time, mapping value and link pointer, and the link pointer is used to link the current node to the next node.

[0090] The node position refers to the target location in the linked list where a new structure is inserted. It is usually located before an existing node to ensure ascending time order. Its function is to determine the storage location of the new node and ensure that the overall time of the linked list is strictly increasing.

[0091] In one optional approach, the energy management system, for a single remote control period issued from the cloud, begins traversing the linked list starting from the head node. It reads the time value of each node sequentially in ascending order, compares the node time with the start time, and determines the correct insertion position for the start time. It then traverses the linked list again in the same manner to find the insertion position corresponding to the end time. After positioning, the energy management system creates two new structures, writing the start time and power value, and the end time and setting flag to them respectively, and configures link pointers. The two structures are then inserted into their corresponding positions, completing the loading of a single time period.

[0092] In this embodiment, a data structure is created in the local data storage module; a control strategy sent from the cloud is received, wherein the control strategy includes at least one remote control period and a corresponding mapping value for the remote control period; for a single remote control period, the node positions corresponding to the start and end times of the remote control period are found in the linked list, and the corresponding structure is inserted at the node positions to load the control strategy into the data structure; subsequently, the mapping value corresponding to the current time can be queried from the local data storage module as the query result; if the query result includes a power value, a control command including the power value is sent to the energy storage device so that the energy storage device performs charge and discharge control based on the power value in the control command; if the query result includes a setting flag, a command to switch to the local autonomous strategy is sent to the local controller of the energy storage device so that the local controller of the energy storage device performs charge and discharge control on the energy storage device based on the power value determined by the local measurement data. By limiting the data structure to a linked list, and finding the node positions of the start and end times for each single remote control period and inserting the corresponding structure, dynamic and orderly storage of the cloud control strategy is achieved. Linked lists support insertion of any number of time periods, dynamic updates, and efficient queries, solving the problems of insufficient capacity, inconvenient management, and poor scalability of fixed arrays. This ensures efficient strategy loading, fast querying, and accurate mode switching, improving system reliability, scalability, and resilience against communication failures. Furthermore, by creating a dedicated data structure in the local storage module to receive cloud-based control strategies, and finally loading and storing these strategies in an orderly manner within the data structure, localized and standardized storage of cloud-based remote optimization strategies is achieved. This process frees energy storage devices from dependence on continuous communication, enabling them to execute cloud strategies offline. It provides stable and reliable data support for subsequent real-time queries, time period matching, mode judgment, and command execution, improving the system's resilience against communication failures and operational reliability.

[0093] In one optional approach, finding the node positions corresponding to the start and end times of the remote control period in the linked list, and inserting the corresponding structure at each node position includes: traversing the linked list arranged in chronological order, finding the first node in the linked list whose time is greater than the start time of the remote control period; determining the node position before the first node as the node position corresponding to the start time, and inserting a first structure at the node position corresponding to the start time, wherein the first structure includes the start time, power value, and a first link pointer; continuing to traverse the linked list arranged in chronological order again, finding the first node in the linked list whose time is greater than the end time of the remote control period; determining the node position before the second node as the node position corresponding to the end time, and inserting a second structure at the node position corresponding to the end time, wherein the second structure includes the end time, a setting flag, and a second link pointer.

[0094] Time-order arrangement refers to arranging all nodes in a linked list in ascending order of their time values, forming a continuously increasing time sequence. Its purpose is to simplify search logic, ensuring ordered insertion, efficient querying, and accurate judgment.

[0095] The energy management system starts from the head node of the linked list and reads the time value of each node in ascending order of time. It compares the read time value with the start time of the remote control period, continuing to access nodes until it finds the first node with a time value greater than the start time, and marks this node as the first node. The energy management system determines the adjacent position before the first node as the node position corresponding to the start time. At this position, a first structure is created, the start time and power value are written into the structure, and a first link pointer is configured so that the previous node points to the first structure, and the first structure points to the first node, completing the insertion.

[0096] After insertion, a new linked list is formed. The energy management system starts again from the head node of the new linked list and reads the node times sequentially in ascending order. It compares each node time with the end time, continuing to traverse forward until it finds the first node whose time value is greater than the end time, and marks this node as the second node. The energy management system determines the adjacent position before the second node as the node position corresponding to the end time. At this position, a second structure is created, the end time and a set flag are written into the structure, and a second link pointer is configured, completing the update of the link relationship between the preceding and following nodes.

[0097] In this embodiment, a data structure is created in the local data storage module; a control strategy sent from the cloud is received, wherein the control strategy includes at least one remote control period and a mapping value corresponding to the remote control period; a linked list arranged in chronological order is traversed, and the first node in the linked list whose time is greater than the start time of the remote control period is found; the node positions before the first node are determined as the node positions corresponding to the start time, and a first structure is inserted at the node positions corresponding to the start time, wherein the first structure includes the start time, power value, and a first link pointer; the linked list arranged in chronological order is traversed again, and the second node in the linked list whose time is greater than the end time of the remote control period is found; the node positions before the second node are determined as the node positions corresponding to the start time, and a first structure is inserted at the node positions corresponding to the start time, wherein the first structure includes the start time, power value, and a first link pointer; the linked list ... a second node is found as the second node; the node positions before the second node are determined as the node positions corresponding to the start time, and a first structure is inserted at the node positions corresponding to the start time, wherein the first structure includes the start time, power value, and a first link pointer is inserted at the node positions corresponding to the start time, and a first structure is inserted at the node positions corresponding to the start time, wherein the first The node position corresponding to the end time is determined, and a second structure is inserted at the node position corresponding to the end time. The second structure includes the end time, a setting flag, and a second link pointer to load the control strategy into the data structure. Subsequently, the mapping value corresponding to the current time can be queried from the local data storage module as the query result. If the query result includes a power value, a control command including the power value is sent to the energy storage device so that the energy storage device can perform charge and discharge control based on the power value in the control command. If the query result includes a setting flag, a command to switch to the local autonomous strategy is sent to the local controller of the energy storage device so that the local controller of the energy storage device can perform charge and discharge control based on the power value determined by the local measurement data. Through two ordered traversals, the first node with a larger time is found and a start structure and an end structure are inserted in front of it to ensure that the linked list is always arranged in ascending order of time. This achieves accurate insertion and clear boundary division of remote control time periods, making subsequent time queries reliable and mode switching accurate, thereby improving the system control accuracy and operational stability. Building upon this foundation, a dedicated data structure is created within the local storage module to receive cloud-based control strategies. These strategies are then loaded and permanently stored within the data structure, achieving localized and standardized storage of cloud-based remote optimization strategies. This process frees energy storage devices from dependence on continuous communication, enabling them to execute cloud-based strategies offline. It provides stable and reliable data support for subsequent real-time queries, time-period matching, pattern judgment, and command execution, thereby improving the system's resilience to communication failures and operational reliability.

[0098] In another optional approach, the process involves traversing the linked list to find the node positions corresponding to the start and end times of the remote control period, and inserting the corresponding structures at those node positions. This includes: traversing the linked list in chronological order and searching for a first node whose time is greater than the start time of the remote control period; if not, determining the end position of the linked list as the node position corresponding to the start time, and inserting a first structure at the node position corresponding to the start time, wherein the first structure includes the start time, power value, and a first link pointer; continuing to traverse the linked list in chronological order and searching for a second node whose time is greater than the end time of the remote control period; if not, determining the end position of the linked list as the node position corresponding to the end time, and inserting a second structure at the end position of the linked list, wherein the second structure includes the end time, a setting flag, and a second link pointer.

[0099] The end position refers to the position after the last node in the linked list. Its purpose is to serve as the insertion point for a new node when all other nodes have earlier timestamps.

[0100] The energy management system visits all nodes sequentially from the head of the linked list, reading the time value of each node and comparing it with the start time. After traversing, it checks if there is a node whose time value is greater than the start time. If the first node is not found, the energy management system traverses to the last node of the linked list, creates a first structure after the last node, writes the start time and power value into it, sets the pointer of the original tail node to the first structure, and sets the pointer of the first structure to null, thus completing the insertion at the end.

[0101] After insertion, a new linked list is formed. The energy management system traverses all nodes in the linked list again, comparing each node's time with its end time to determine if a node has a time value greater than its end time. If no second node is found, the energy management system creates a second structure at the end of the linked list, writes the end time and a set flag, points the original tail node to the second structure, and sets the pointer of the second structure to null, completing the insertion at the end. The node ends with the complete insertion period, forming a closed and valid remote control interval, ensuring that mode switching can be triggered normally.

[0102] In this embodiment, a data structure is created in the local data storage module; a control strategy sent from the cloud is received, wherein the control strategy includes at least one remote control period and a mapping value corresponding to the remote control period; a linked list arranged in chronological order is traversed to find whether there is a first node in the linked list whose first time is greater than the start time of the remote control period; if not, the end position of the linked list is determined as the node position corresponding to the start time, and a first structure is inserted at the node position corresponding to the start time, wherein the first structure includes the start time, power value, and a first link pointer; the linked list is traversed again to find whether there is a second node in the linked list whose first time is greater than the end time of the remote control period; if not, the end position of the linked list is determined as the node position corresponding to the end time, and a second structure is inserted at the end position of the linked list, wherein the second structure includes the end time, a setting flag, and a second link pointer. Subsequently, the mapping value corresponding to the current time can be queried from the local data storage module as the query result. If the query result includes a power value, a control command including the power value is sent to the energy storage device, enabling the energy storage device to perform charging and discharging control based on the power value in the control command. If the query result includes a setting flag, a command to switch to the local autonomous strategy is sent to the local controller of the energy storage device, enabling the local controller of the energy storage device to perform charging and discharging control based on the power value determined by local measurement data. For special scenarios where there are no larger time nodes in the linked list, the start and end structures are explicitly inserted at the end of the linked list, covering all possible insertion cases. This ensures that the linked list can be correctly stored at any time, the strategy is not lost, the linked list is not broken, and the time is always ordered, greatly improving system compatibility, robustness, and scenario adaptability. Based on this, by creating a dedicated data structure in the local storage module to receive cloud-based control strategies, and finally loading and solidifying the strategies into the data structure in an orderly manner, the localized and standardized storage of cloud-based remote optimization strategies is achieved. This process enables energy storage devices to break free from their dependence on continuous communication and to execute cloud-based strategies offline. It provides stable and reliable data support for subsequent real-time queries, time-period matching, pattern judgment, and command execution, thereby improving the system's resilience to communication failures and operational reliability.

[0103] In one feasible implementation, before loading the control strategy into the data structure, the method further includes: traversing each remote control period and checking whether each remote control period is valid; if invalid, skipping the invalid remote control period; if valid, loading the valid remote control period into the data structure.

[0104] The energy management system reads all remote control time periods sent from the cloud one by one, and checks in turn whether the start time of each time period is earlier than the end time, whether the time data format meets the system requirements, and whether the power value is within the range allowed to operate by the energy storage equipment, and determines whether the valid conditions are met.

[0105] When the energy management system determines that a certain remote control period is invalid, it directly clears the data for that period from the cache without performing any operations such as structure creation, node insertion, or linked list loading, and immediately jumps to the next period to continue the detection. This filters erroneous data, prevents illegal policies from polluting the linked list, and avoids system malfunctions.

[0106] After the energy management system confirms the validity of the remote control period, it locates the node positions corresponding to the start and end times according to the linked list's insertion rules, creates the corresponding structures, writes data, updates the link pointers, and fully loads the valid period into the linked list data structure. Legitimate, secure, and executable strategies are stored in the local linked list, providing a reliable data foundation for subsequent queries, judgments, and executions.

[0107] In this embodiment, a data structure is created in the local data storage module; a control strategy sent from the cloud is received, wherein the control strategy includes at least one remote control period and a corresponding mapping value for the remote control period; each remote control period is traversed, and the validity of each remote control period is checked; if invalid, the invalid remote control period is skipped; if valid, the valid remote control period is loaded into the data structure. Subsequently, the mapping value corresponding to the current time can be queried from the local data storage module as the query result; if the query result includes a power value, a control command including the power value is sent to the energy storage device, so that the energy storage device performs charging and discharging control based on the power value in the control command; if the query result includes a setting flag, a command to switch to the local autonomous strategy is sent to the local controller of the energy storage device, so that the local controller of the energy storage device performs charging and discharging control on the energy storage device based on the power value determined by the local measurement data. By adding a validity detection process before strategy loading, and through the logic of traversal judgment, invalid skipping, and valid loading, erroneous, illegal, and unexecutable period data are filtered from the source, avoiding problems such as query failure, abnormal mode switching, and power over-limit operation caused by strategy errors, thereby improving system stability, security, reliability, and anti-interference capability. Building upon this foundation, a dedicated data structure is created in the local storage module to receive cloud-based control strategies. These strategies are then loaded and permanently stored within the data structure, achieving localized and standardized storage of cloud-based remote optimization strategies. This process frees energy storage devices from dependence on continuous communication, enabling them to execute cloud-based strategies offline. It provides stable and reliable data support for subsequent real-time queries, time-period matching, pattern judgment, and command execution, thereby improving the system's resilience to communication failures and operational reliability.

[0108] For example, in order to help understand the implementation flow of the control method for the energy storage device obtained by combining the above embodiments, the overall flow of the control method for the energy storage device of this application will be described in detail below: Reference Figure 2This paper illustrates an overall flowchart of a control method for an energy storage device provided in this application, which may specifically include the following steps: Step 101: First, initialize a linked list to store the upper-level control strategy. The upper-level control strategy must contain the start time, end time, and mapping value for multiple time periods, including power values ​​or setting flags.

[0109] Reference Figure 3 This diagram illustrates a flowchart of the initialization process of the upper-level control parameter linked list provided in an embodiment of this application; corresponding to the specific process of creating a data structure in the local data storage module. The flowchart describes the complete process of initializing the head node of a linked list used to store time-period power instructions. First, an initial structure is created, defining three key data members: time, power value, and a pointer to the next node. Then, based on this initial structure, the head node of the linked list is created, and the link pointer of this node is initialized to null. The time is initialized to 0000 to represent 0:00, and the initial power value is NAN to represent invalidity. The linked list is then created in the above manner.

[0110] Step 102: If there is a superior control strategy, the control strategy needs to be loaded into the linked list for easy access in real time control later. Reference Figure 4 First, it checks if the content of the superior control strategy exists. If not, the process ends directly. If it does, the superior control strategy is loaded, and then each remote control period is traversed one by one. The start time, end time, and power value of each remote control period are checked for validity. If invalid, the current period is skipped, and the parameters of the next period are processed directly. If valid, the linked list is traversed, and the parameters are inserted into the linked list. The linked list is traversed sequentially, and the first node whose time is greater than the start time is found. A structure is inserted in front of it. If no such node is found, a structure is inserted at the end of the linked list. The time in the structure is the start time of the period, and the power is the mapped value of the period. Then, the linked list is traversed again, and the first node whose time is greater than the end time is found. A structure is inserted in front of it. If no such node is found, a structure is inserted at the end of the linked list. The time in the structure is the end time of the period, and the power is the invalid value NAN. Step 103: Pass in the current time and traverse the linked list to find the power value at the corresponding time point.

[0111] Reference Figure 5This document illustrates a flowchart illustrating the process of obtaining the power value at the current time, as provided in an embodiment of this application. The flowchart describes the key logic of how an energy storage device in a distribution area determines the power value to be executed by querying a pre-stored power instruction chain based on the current time during operation. First, the system's current time is obtained as the query reference. Then, the program traverses the linked list arranged in chronological order, with the core objective of finding a node that meets specific conditions: the current time is greater than or equal to the set time of a certain node, but less than the set time of the next node. If such a node is successfully found, it means that the current time is within the remote control period defined by that node, and the process returns the preset power value recorded by that node, allowing the device to perform remote power control. Conversely, if no node meeting the conditions is found after traversing the linked list (e.g., the current time is earlier than the start time of the first node or later than the end time of the last node), the process returns a special "NAN" value. This "NAN" value serves as a clear setting flag, indicating that the current time is not within any remote control period, thereby triggering the device to switch to a local autonomous control strategy.

[0112] Step 104: Make a judgment and decision based on the query results returned in step 103, and decide whether to use the remote control strategy or the local governance strategy.

[0113] Reference Figure 6 This document illustrates a flowchart illustrating the process of determining the corresponding strategy based on power values, as provided in an embodiment of this application. The flowchart describes the core decision-making and execution process of power regulation for energy storage devices in a distribution area. After obtaining the query result in step 103, the process proceeds to a crucial judgment stage: checking the validity of the currently required mapping value. If the value is deemed valid, "regulation based on power value" is executed, dynamically allocating the three-phase power to achieve the target total power. If the value is deemed invalid, "regulation based on local governance strategy" is executed, calling the local strategy to calculate the power that should be output. These two paths ultimately converge at the "regulation of the energy storage converter PCS" stage, i.e., actual power control of the energy storage converter PCS, ultimately leading to the "end" of the process. The entire process is concise and efficient, reflecting the "query-judgment-execution" logic of this application: by judging the validity of the power command in real time, it autonomously selects to execute either remote optimization scheduling or a local autonomous strategy, thereby ensuring the reliability and continuity of control.

[0114] This application, through the aforementioned scheme, achieves a safe and seamless switching between "remote time-based power control" and "local autonomous strategy" for energy storage equipment in the distribution area. Key points include: (1) Dynamic Management of Power Control Instructions Based on Linked List Data Structure: A linked list data structure is used to store the power control instructions issued by the upper-level cloud. Each node contains a time point and a mapping value. The mapping value of the start time is the corresponding power value issued by the upper-level cloud, and the power value of the end time is a standard NaN (such as 0x7FC00000), which represents an invalid value. The linked list has the characteristics of dynamic addition and deletion, which can flexibly adapt to the variable number of time-period instructions issued by the upper level that may be updated at any time, overcoming the shortcomings of fixed arrays in terms of limited capacity and rigid management. By sorting the linked list nodes in ascending order of time, the orderliness and efficiency of instruction retrieval are ensured, laying the data foundation for real-time judgment of the current operating mode.

[0115] (2) Command boundary and mode switching mechanism with "standard NAN" as the setting flag. In the linked list node, the power value corresponding to the "end time" of each control period is set as a special "NAN" (non-numerical) flag, which is a core design. This design clearly defines the boundary of the remote control period (from start time to end time) at the data structure level. Within the boundary, a valid power value can be obtained; outside the boundary (i.e., after the "end time"), the "NAN" flag is obtained. The "NAN" flag acts as a trigger for mode switching. The control program obtains the current target power by querying the linked list in real time: if a specific value is obtained, remote power control is executed; if "NAN" is obtained, the switch to the local preset control strategy is immediately triggered, such as V / f control, timed charging and discharging, etc.

[0116] (3) Robust control process of "query-judgment-execution": The entire control method follows a simple and robust process: real-time query of the linked list - judgment of the return value - execution of the corresponding strategy. This process transforms the complex collaborative control problem into a judgment of the query results of the linked list data. Regardless of whether the communication is normal, as long as the linked list data exists (which can be pre-delivered or cached), the device can make the correct decision autonomously. This fundamentally solves the problem of dependence on continuous communication in fully centralized scheduling. Even if the communication is interrupted, the device can still automatically and errorlessly switch to local autonomous mode after the remote control period ends, based on the latest time period instructions and "NAN" flag in the linked list, ensuring the continuity and security of power supply in the distribution area.

[0117] In summary, by combining three key technologies—linked list management of time period instructions, "NAN" flag defining boundaries, and mode switching logic based on query results—this application enables the energy storage equipment in the distribution area to reliably integrate superior optimized scheduling with local autonomous control. This achieves both the economy of global collaboration and ensures operational reliability under communication anomalies, effectively overcoming the shortcomings of the background technology.

[0118] The technical effects to be achieved by this application can be summarized as follows: This application achieves a safe and seamless integration of centralized optimization and distributed autonomy: It enables the energy storage equipment in the distribution area to have two capabilities simultaneously. When communication is normal, the equipment can accurately execute the time-based power commands issued by the superior based on global optimization, so as to realize the coordinated and economical operation of the distribution area and even the power grid (such as participating in demand response). Once communication is interrupted or the current time is not within the remote control period, the equipment can automatically and instantly switch to the preset local autonomous strategy based on the "NAN" flag, so as to ensure the continuity of power supply.

[0119] The robustness and reliability of system operation are improved: the control logic of this application does not rely on a continuous communication link. Upper-level instructions can be issued in advance and cached in a local linked list on the device, forming an "offline contingency plan." Experimental verification shows that even in the event of a long-term communication interruption, the energy storage device can still execute optimized instructions according to this contingency plan within the preset remote control period, and automatically return to the local strategy after the period ends, without any manual intervention. This greatly reduces the risk of system runaway due to communication failures and meets the stringent reliability requirements of power systems.

[0120] The flexibility and manageability of the control strategy are improved: the use of a linked list data structure to manage time-period instructions makes the addition, deletion, modification, and query of strategies highly flexible and easily adaptable to the frequently updated power grid dispatching needs. At the same time, the unified "query-judgment-execution" process simplifies the control logic, reduces software complexity, and improves maintainability.

[0121] In summary, the method described in this application not only successfully resolves the core contradiction between "global optimization" and "local reliability," but also brings significant comprehensive improvements in system robustness and management flexibility, providing key technical support for building a highly resilient and intelligent new power distribution network.

[0122] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the control method of the energy storage device of this application. Any simple modifications based on this technical concept are within the protection scope of this application.

[0123] Based on the same inventive concept, this application also provides an energy storage system, including: a cloud platform, an energy management system, a local controller for the energy storage device, the energy storage device, and a local data storage module; wherein, the cloud platform is used to issue control strategies. The local controller for the energy storage device is used to control the energy storage device. The cloud platform is connected to the energy management system, the energy management system is connected to the local controller and local data storage module of the energy storage device, and the local controller of the energy storage device is connected to the energy storage device.

[0124] The energy management system described above includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform the control method of the energy storage device in the above embodiments.

[0125] The energy storage system provided in this application, employing the control method for the energy storage device in the above embodiments, enables the energy storage device in the distribution area to reliably execute time-based power control commands issued from the cloud based on global optimization, and to seamlessly switch to a secure local autonomous operation strategy when communication is abnormal or there is no remote control from the cloud. Compared with the prior art, the beneficial effects of the energy storage system provided in this application are the same as those of the control method for the energy storage device provided in the above embodiments, and other technical features of this energy storage system are the same as those disclosed in the method of the previous embodiment, and will not be repeated here.

[0126] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0127] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0128] Based on the same inventive concept, this application provides a computer-readable storage medium having computer-readable program instructions (i.e., computer programs) stored thereon, which are used to execute the control method of the energy storage device in the above embodiments.

[0129] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory (EPROM), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, radio frequency (RF), etc., or any suitable combination thereof.

[0130] The aforementioned computer-readable storage medium may be included in the energy management system; or it may exist independently and not be incorporated into the energy management system.

[0131] The aforementioned computer-readable storage medium carries one or more programs that, when executed by the energy management system, cause the energy management system to perform the steps of the aforementioned control method for the energy storage device.

[0132] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0133] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0134] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0135] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., computer programs) for executing the control method of the aforementioned energy storage device. This enables the energy storage device in the distribution area to reliably execute time-based power control instructions issued from the cloud based on global optimization, and to seamlessly switch to a secure local autonomous operation strategy in the event of communication failures or the absence of cloud-based remote control. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the control method of the energy storage device provided in the above embodiments, and will not be repeated here.

[0136] The above are only some embodiments of this application and do not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.

Claims

1. A control method for an energy storage device, characterized in that, The method includes: The local data storage module retrieves the mapping value corresponding to the current time as the query result. The local data storage module stores the control strategy sent from the cloud. The control strategy includes the start time, end time and mapping value corresponding to each time of at least one remote control period. The mapping value includes a power value or a setting flag. If the query result includes a power value, a control command including the power value is sent to the energy storage device so that the energy storage device performs charging and discharging control based on the power value in the control command. If the query result includes a setting flag, an instruction to switch to a local autonomous strategy is sent to the local controller of the energy storage device, so that the local controller of the energy storage device can perform charge and discharge control on the energy storage device based on the power value determined by local measurement data.

2. The control method for the energy storage device as described in claim 1, characterized in that, The step of retrieving the mapping value corresponding to the current time from the local data storage module as the query result includes: Obtain the current time and use the current time as the query reference; Traverse the data structure in the local data storage module arranged in chronological order to find the target node that meets the conditions. The conditions that the target node meets include: the current time is greater than or equal to the set time of a certain node and less than the set time of the next node of that certain node. If a target node that meets the conditions is found, it is determined that the current time is within the remote control period, and the power value corresponding to the target node is used as the query result. If no target node that meets the conditions is found after the traversal is completed, it is determined that the current time is not within any remote control period, and the set flag is used as the query result.

3. The control method for the energy storage device as described in claim 1, characterized in that, Before retrieving the mapping value corresponding to the current time from the local data storage module as the query result, the process also includes: Create a data structure in the local data storage module; The system receives a control strategy sent from the cloud, wherein the control strategy includes at least one remote control period and a mapping value corresponding to the remote control period. The control strategy is loaded into the data structure.

4. The control method for the energy storage device as described in claim 3, characterized in that, The data structure is a linked list; the creation of the data structure in the local data storage module includes: Create an initial structure, wherein the contents of the initial structure include time, mapping value, and link pointer, and the link pointer is null; The head node of the linked list is created based on the initial structure; The contents of the initial structure of the header node are initialized to obtain the data structure.

5. The control method for the energy storage device as described in claim 3, characterized in that, The data structure is a linked list; loading the control strategy into the data structure includes: For a single remote control period, the node positions corresponding to the start and end times of the remote control period are found in the linked list, and the corresponding structure is inserted at the node position; wherein, the content of the structure includes time, mapping value and link pointer, and the link pointer is used to link the current node to the next node.

6. The control method for the energy storage device as described in claim 5, characterized in that, The step of finding the node positions corresponding to the start and end times of the remote control period in the linked list, and inserting the corresponding structure at the node positions, includes: Traverse the linked list arranged in chronological order and find the first node in the linked list whose time is greater than the start time of the remote control period; The node position preceding the first node is determined as the node position corresponding to the start time, and a first structure is inserted at the node position corresponding to the start time. The first structure includes the start time, power value, and first link pointer. Continue traversing the linked list arranged in chronological order to find the second node in the linked list whose time is greater than the end time of the remote control period; The node position preceding the second node is determined as the node position corresponding to the end time, and a second structure is inserted at the node position corresponding to the end time. The second structure includes an end time, a setting flag, and a second link pointer.

7. The control method for the energy storage device as described in claim 5, characterized in that, The step of finding the node positions corresponding to the start and end times of the remote control period in the linked list, and inserting the corresponding structure at the node positions, includes: Traverse the linked list arranged in chronological order and search for the existence of a first node in the linked list whose time is greater than the start time of the remote control period; If it does not exist, the end position of the linked list is determined as the node position corresponding to the start time, and a first structure is inserted at the node position corresponding to the start time, wherein the first structure includes the start time, power value and a first link pointer; Continue traversing the linked list arranged in chronological order to find whether there exists a second node in the linked list whose first time is greater than the end time of the remote control period; If it does not exist, the end position of the linked list is determined as the node position corresponding to the end time, and a second structure is inserted at the end position of the linked list, wherein the second structure includes the end time, a setting flag, and a second link pointer.

8. The control method for the energy storage device as described in claim 3, characterized in that, After receiving the control strategy sent from the cloud, the system further includes: Iterate through each of the remote control periods and check whether each of the remote control periods is valid; If ineffective, skip the invalid remote control period; If valid, the valid remote control period will be loaded into the data structure.

9. An energy storage system, characterized in that, The energy storage system includes: a cloud platform, an energy management system, a local controller for the energy storage device, the energy storage device, and a local data storage module; The energy management system includes: a memory, a processor, and a control program for an energy storage device stored in the memory and executable on the processor, wherein the control program for the energy storage device is configured to implement the steps of the control method for the energy storage device as described in any one of claims 1 to 8.

10. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and the storage medium stores a control program for an energy storage device. When the control program for the energy storage device is executed by a processor, it implements the steps of the control method for the energy storage device as described in any one of claims 1 to 8.