Method and system for batch firmware update of energy storage plant equipment
By employing random linear network coding and dynamic task priority adjustment, combined with thread pool management, efficient and secure batch firmware updates for energy storage power station equipment were achieved. This solved the problems of low efficiency and high complexity in existing technologies, and improved update efficiency and system stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- DYNESS DIGITAL ENERGY TECHNOLOGY CO LTD
- Filing Date
- 2026-05-09
- Publication Date
- 2026-06-05
Smart Images

Figure CN122152341A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of energy storage power station equipment update technology, and in particular to a method and system for batch firmware update of energy storage power station equipment. Background Technology
[0002] In large-scale power plant-level energy storage projects, there may be hundreds of devices in the system. Various controllers within these devices, such as the Battery Management System (BMS), Energy Management System (EMS), and Power Conversion System (PCS), require firmware updates for functional upgrades or bug fixes. In actual operation, firmware updates are often frequent and cumbersome, consuming significant maintenance time and costs during the operation and maintenance phase.
[0003] Traditional firmware update methods include serial polling and multi-threaded concurrency control. In the serial polling method, firmware updates in energy storage power station equipment are executed sequentially. The implementation process is simple, intuitive, and easy to develop, requiring relatively low skill from developers. However, this sequential updating consumes a significant amount of time, resulting in low efficiency and severely impacting power station operations, leading to substantial waste. Multi-threaded concurrency control can improve efficiency, but its code structure is complex. It requires not only software architecture design but also consideration of resource management, thread management, task management, and exception management. It involves numerous technical methods, is difficult to integrate, and needs to handle concurrency, callbacks, and error handling, making development relatively difficult and demanding on developers. Furthermore, insufficient architectural design can lead to software crashes, posing a significant risk. Summary of the Invention
[0004] Therefore, the technical problem to be solved by the present invention is to overcome the shortcomings of the prior art and provide a method and system for batch firmware update of energy storage power station equipment, which can improve the efficiency of firmware update, and is simple and safe to implement.
[0005] To address the aforementioned technical problems, this invention provides a method for batch firmware updates of energy storage power station equipment, comprising: The firmware update flashing file is fragmented and encoded using random linear network coding technology to obtain the encoded packet corresponding to the firmware update flashing file. The priority of executing firmware update tasks is dynamically adjusted based on the urgency of tasks, system idle time, urgency of firmware updates, and deadline of firmware updates in the current energy storage power station. Based on the priority of the firmware update task, batch firmware updates are performed using encoded packages.
[0006] Furthermore, the dynamic adjustment of the priority for executing firmware update tasks, taking into account the urgency of current tasks in the energy storage power station, system idle time, urgency of firmware updates, and firmware update deadline, includes: The tasks in the energy storage power station are divided into emergency tasks, fixed tasks, customer demand tasks, and firmware update tasks. Emergency tasks have a higher priority than fixed tasks, and fixed tasks have a higher priority than customer demand tasks. The priority of firmware update tasks is dynamically adjusted, and the calculation method for the priority of firmware update tasks is as follows: Wcgroup=Wbase + (Ptotal×Wrange), In the formula, Wcgroup represents the priority of the firmware update task, Wbase represents the base priority, Wrange represents the priority variation range, and Ptotal represents the comprehensive priority value. Ptotal is dynamically adjusted based on system idle time, the urgency of the firmware update, and the deadline of the firmware update.
[0007] Furthermore, the method for calculating the comprehensive priority value is as follows: Ptotal =α×Ssystem +β×Udevice +γ×Tdeadline, In the formula, α, β, and γ represent weighting coefficients, α+β+γ=1, Ssystem represents system idleness, used to measure whether CPU and network I / O are busy, Udevice represents the urgency of firmware update, and Tdeadline represents the deadline for firmware update.
[0008] Furthermore, the method for calculating the system idle time is as follows: Ssystem =ωcpu×Scpu +ωnet×Snet, In the formula, Scpu represents CPU idle time, ωcpu represents CPU weight coefficient, Snet represents network idle time (adjusted according to bandwidth utilization and packet forwarding rate), ωnet represents network weight coefficient, and ωcpu+ωnet=1.
[0009] Furthermore, the method for calculating the CPU idle time is as follows: Scpu = max(0.1,min(1.0,(Umax - Ucurrent) / (Umax-Umin))), In the formula, max() represents taking the maximum value, min() represents taking the minimum value, Umin represents the CPU idle threshold, Ucurrent represents the current CPU utilization, and Umax represents the CPU busy threshold. The method for calculating the network idle time is as follows: Snet=min(Sbandwidth,Spacket), In the formula, Sbandwidth represents bandwidth idle time, and Spacket represents packet forwarding idle time.
[0010] Furthermore, the method for calculating the bandwidth idle time is as follows: Sbandwidth = max(0.1,min(1.0,(Bmax - Bcurrent) / (Bmax-Bmin))), In the formula, Bmax represents the bandwidth busy threshold, Bcurrent represents the current network interface bandwidth utilization, and Bmin represents the bandwidth idle threshold. The method for calculating the packet forwarding idle time is as follows: Spacket = max(0.1,min(1.0,(Pmax - Pcurrent) / (Pmax-Pmin))), In the formula, Pmax represents the busy packet forwarding threshold, Pcurrent represents the current packet forwarding rate, and Pmin represents the idle packet forwarding threshold.
[0011] Furthermore, the method for calculating the urgency of the firmware update is as follows: Udevice = ωs×Slevel / Smax+ ωe×min(1.0, Ecount / Ethreshold), In the formula, Slevel represents the equipment security level, Smax represents the maximum security level, ωs represents the equipment security level weight, ωe represents the error count weight, min() represents taking the minimum value, Ecount represents the number of errors in the equipment in the last 24 hours, and Ethreshold represents the error count threshold.
[0012] Furthermore, the method for calculating the firmware update period is as follows: Tdeadline= max(0.1,min(1.0,Tremaining / (Testimated×Bfactor))), In the formula, max() represents taking the maximum value, min() represents taking the minimum value, Tremaining represents the remaining time until the end of the maintenance window, Testimated represents the estimated time required to complete the device update, and Bfactor represents the buffer factor.
[0013] This invention also provides a batch firmware update system for energy storage power station equipment, including a memory, a processor, and a main control program stored in the memory and executable on the processor. When the processor executes the main control program, it implements the batch firmware update method for energy storage power station equipment and begins the batch firmware update process. The batch firmware update process includes: Upon receiving an instruction to perform a batch firmware update, the thread manager is initialized, and the number of thread pools is set. The thread pool manager allocates a preset number of worker threads to form a local thread pool. The device information that needs firmware update is added to the device list, and the device information includes IP address, port number, and encoded packet. The firmware update task information is added to the task queue, and the firmware update task information includes task name and firmware update task priority. After verifying the validity of the device configuration file, the task queue management is started. The task queue management includes traversing the device configuration, creating a firmware update task for each device, adding the created firmware update task to the queue, managing and monitoring the queue during its use, and deleting the task after it is completed. While managing the task queue, thread pool coordination and monitoring are also performed. The thread pool coordination and monitoring includes monitoring of active thread count, completed task count, failed task count, and thread pool queue length. After thread pool management and firmware update tasks are started, the thread scheduling loop phase begins. During the thread scheduling loop phase, all tasks in the task list are executed in parallel using all threads until all tasks on all devices are completed. To perform a single firmware update task, a TCP connection is established with the specific device to be updated. The flashing file is read into the memory cache, and after a flashing handshake interaction confirmation, the encoding packet corresponding to the specific flashing file is transmitted. After the encoding packet is transmitted, it is verified to be correct, and the flashing process is completed.
[0014] Furthermore, the batch firmware update process also includes: When performing a single firmware update task, exception handling is performed simultaneously. The exception handling includes a communication failure retry mechanism, a fault recovery mechanism, a rollback mechanism after update failure, and a fault isolation mechanism. After all firmware update tasks have been completed, the process enters the termination phase. The task queue stops receiving new tasks, waits for all threads to finish executing, cleans up thread resources, and shuts down the thread pool. Output the firmware update results for all devices, including a list of devices that successfully updated, a list of devices that failed to update, statistical information, an update report, and a firmware update completion flag.
[0015] Compared with the prior art, the above-described technical solution of the present invention has the following advantages: This invention encodes the burning file into an encoding package using random linear network coding technology, and uses the encoding package for unified updates during batch firmware updates, reducing the time complexity of firmware updates and effectively improving update efficiency. By comprehensively considering various situations in the current energy storage power station, the priority of executing firmware update tasks is dynamically adjusted, improving the utilization efficiency of system bandwidth while ensuring urgent tasks, and the update process is simple and safe. Attached Figure Description
[0016] To make the content of this invention easier to understand, the invention will be further described in detail below with reference to specific embodiments and accompanying drawings, wherein: Figure 1 This is a flowchart of a method in a preferred embodiment of the present invention.
[0017] Figure 2 This is a schematic diagram of the communication topology of the power station energy storage system in a preferred embodiment of the present invention.
[0018] Figure 3 This is a schematic diagram of the main control program execution process in a preferred embodiment of the present invention.
[0019] Figure 4 This is a schematic diagram of the multi-threaded, multi-task execution process in a preferred embodiment of the present invention.
[0020] Figure 5 This is a schematic diagram of the multi-threaded, multi-task execution timing diagram in a preferred embodiment of the present invention. Detailed Implementation
[0021] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, so that those skilled in the art can better understand and implement the present invention. However, the embodiments described are not intended to limit the present invention.
[0022] like Figure 1 As shown, this invention discloses a method for batch firmware update of energy storage power station equipment, including the following steps: S1: The firmware update flashing file is fragmented and encoded using Random Linear Network Coding (RLNC) technology to obtain the encoded packet corresponding to the firmware update flashing file.
[0023] S1-1: Divide the firmware update flashing file into n raw data blocks (each block is 1KB), denoted as p1, ..., pi, ..., pn, where pi represents the i-th raw data block and n represents the number of raw data blocks. The value of n is adjusted according to the actual situation.
[0024] S1-2: The encoded packet is: cj=ej1⋅p1+…+eji⋅pi+…+ejn⋅pn, In the formula, cj represents the encoded packet, eji represents the random coefficient of the i-th original data block, and the value of eji is adjusted according to the actual situation; as long as the device receives any n linearly independent encoded packets, it can recover all the original data p1 to pn by solving the linear equation system.
[0025] S2: Dynamically adjust the priority of executing firmware update tasks based on the urgency of tasks in the current energy storage power station, system idle time, urgency of firmware updates, and firmware update deadline.
[0026] S2-1: First, tasks are categorized into emergency tasks, fixed tasks, customer-required tasks, and firmware update tasks in the energy storage power station. Emergency tasks are hard real-time tasks, such as protection logic and fault detection tasks, which must preempt all resources. Fixed tasks are soft real-time tasks, such as data acquisition and status reporting tasks, which need to be completed on time but allow for occasional fluctuations. Customer-required tasks are interactive tasks, where users issue commands to query, requiring rapid response but with low resource consumption.
[0027] S2-2: Set the priority of urgent tasks to be higher than that of fixed tasks, and the priority of fixed tasks to be higher than that of customer-required tasks. The priority of urgent tasks can be set to 10000. The priority of fixed tasks can be set to 4000. The priority of customer-required tasks can be set to 2000. Firmware update tasks have dynamically adjusted priorities, set between 1 and 10000.
[0028] The priority of firmware update tasks is calculated as follows: Wcgroup=Wbase + (Ptotal×Wrange), In the formula, Wcgroup represents the priority of the firmware update task, with a value range of 1 to 10000; Wbase represents the basic priority, with a minimum value of 100, which is adjusted according to actual conditions; Wrange represents the priority variation range, which is adjusted according to actual conditions; and Ptotal represents the comprehensive priority value, with a value range of 0 to 1. Ptotal is dynamically adjusted according to system idle time, the urgency of the firmware update, and the deadline of the firmware update.
[0029] Ptotal determines the relative importance or resource quota of the firmware update task at any given moment. When the system is idle, the priority of the firmware update task is close to 10000, allowing it to compete with ordinary tasks for CPU resources; when the system is busy, the priority is close to 100, and it can only use a very small amount of idle resources. The calculation method for the comprehensive priority value is as follows: Ptotal =α×Ssystem +β×Udevice +γ×Tdeadline, In the formula, α, β, and γ represent weighting coefficients, α+β+γ=1, and in this embodiment, α=0.3, β=0.5, and γ=0.2 are set; Ssystem represents system idleness, used to measure whether the CPU and network I / O are busy; Udevice represents the urgency of firmware updates; and Tdeadline represents the deadline for firmware updates.
[0030] The method for calculating the system idle time is as follows: Ssystem =ωcpu×Scpu +ωnet×Snet, In the formula, Scpu represents CPU idle time, ωcpu represents CPU weight coefficient, Snet represents network idle time (adjusted according to bandwidth utilization and packet forwarding rate), ωnet represents network weight coefficient, and ωcpu+ωnet=1. In this embodiment, ωcpu = 0.3 and ωnet = 0.7 are set.
[0031] The method for calculating CPU idle time is as follows: Scpu = max(0.1,min(1.0,(Umax - Ucurrent) / (Umax-Umin))), In the formula, max() represents the maximum value, min() represents the minimum value, Umin represents the CPU idle threshold (set to 30% in this embodiment), Ucurrent represents the current CPU utilization, and Umax represents the CPU busy threshold (set to 80% in this embodiment).
[0032] The method for calculating the network idle time is as follows: Snet=min(Sbandwidth,Spacket), In the formula, Sbandwidth represents bandwidth idle time, and Spacket represents packet forwarding idle time.
[0033] The method for calculating the bandwidth idle time is as follows: Sbandwidth = max(0.1,min(1.0,(Bmax - Bcurrent) / (Bmax-Bmin))), In the formula, Bmax represents the bandwidth busy threshold, the value of which is adjusted according to the actual situation; Bcurrent represents the current network interface bandwidth utilization rate (in Mbps); and Bmin represents the bandwidth idle threshold, which is set to 20% of the interface bandwidth in this embodiment. The method for calculating the packet forwarding idle time is as follows: Spacket = max(0.1,min(1.0,(Pmax - Pcurrent) / (Pmax-Pmin))), In the formula, Pmax represents the busy packet forwarding threshold, which is set to 60% of the interface bandwidth in this embodiment; Pcurrent represents the current packet forwarding rate (in packets / s); and Pmin represents the idle packet forwarding threshold, which is set to 20% of the interface bandwidth in this embodiment.
[0034] The method for calculating the urgency of the firmware update is as follows: Udevice = ωs×Slevel / Smax+ ωe×min(1.0, Ecount / Ethreshold), In the formula, Slevel represents the equipment security level (the value of Slevel ranges from 1 to 10, with 10 being the highest emergency level, set according to the actual security level of the equipment), Smax represents the maximum security level (set to 10 in this embodiment), ωs represents the equipment security level weight, ωe represents the error count weight, the values of ωs and ωe are set according to actual conditions, min() represents taking the minimum value, Ecount represents the number of errors of the equipment in the last 24 hours, and Ethreshold represents the error count threshold (set to 20 times in this embodiment).
[0035] The method for calculating the firmware update period is as follows: Tdeadline= max(0.1,min(1.0,Tremaining / (Testimated×Bfactor))), In the formula, max() represents the maximum value, min() represents the minimum value, Tremaining represents the remaining time (in minutes) before the end of the maintenance window, Testimated represents the estimated time (in minutes) required to complete the device update, and Bfactor represents the buffer factor (in this embodiment, the value range is 20%~50%).
[0036] S3: Based on the priority of firmware update tasks, batch firmware updates are performed using encoded packets. Hierarchical scheduling is implemented during task execution, utilizing Linux's SCHED_FIFO / RR to handle urgent tasks and SCHED_OTHER to handle other tasks. Through multi-dimensional comprehensive scheduling—including task classification, dynamic adjustment of firmware update task priorities, and hierarchical scheduling—the normal operation of the energy storage power station is ensured.
[0037] This invention also discloses a batch firmware update system for energy storage power station equipment, including a memory, a processor, and a main control program stored in the memory and capable of running on the processor. When the processor executes the main control program, it implements the batch firmware update method for energy storage power station equipment and begins batch firmware update. The batch firmware update process includes initializing system configuration, task queue management, thread pool coordination and monitoring, thread scheduling loop, single device update task, exception handling, termination of processing flow, and result output.
[0038] A batch firmware update system for energy storage power station equipment is installed within the power station's energy storage system. Equipment within the energy storage system undergoes batch firmware updates via this system. For example... Figure 2 As shown, the power station energy storage system comprises a cloud platform layer, a power station network communication layer, and an equipment layer. The power station network communication layer connects to the cloud platform layer via a dedicated Ethernet line or 4G network. The communication protocol typically uses secure HTTPS / MQTT (with TLS encryption) to ensure data security. The internal local area network (LAN) of the power station network communication layer is a ring network composed of several industrial switches. The network adopts a ring network redundancy design to ensure uninterrupted communication within the LAN. The protocol used is Modbus TCP to meet high real-time performance and reliability requirements. Various devices in the equipment layer are connected to the switches via Ethernet to enable the power station management system to control and manage all devices. The devices mainly include energy storage converters (PCS), energy management systems (EMS), or battery management systems (BMS). Each device has an Ethernet port connected to the station's LAN switches and receives unified scheduling from the power station management system.
[0039] Figure 3 As an example of the execution process of the main control program, the progress manager updates the progress through the semaphore of each thread, and the thread pool manager sets the maximum number of concurrency. The thread pool also needs to manage the session of each device. The specific communication is to connect to the target device through TcpClientAsync, sample select() multiplexed non-blocking I / O, and have an automatic retry mechanism. The number of retries can be set. When the device fails, it can be isolated without affecting the firmware update of other devices.
[0040] Figure 4For the complete power-on execution process, after starting a multi-device firmware update, the thread manager is first initialized, and a thread pool is created with a maximum concurrency setting. Then, the device configuration list is loaded, the configuration settings are verified for validity, and the system configuration is initialized. Upon receiving an instruction to perform a batch firmware update, the thread manager is initialized, and the number of thread pools, i.e., the maximum concurrency, is set. The thread pool manager allocates a preset number of worker threads to form a local thread pool (denoted as thread_pool_boot). The device information that needs firmware update is added to the device list (denoted as device_list), which includes the IP address and port number, and the encoding packet corresponding to the flashing file required for the firmware update. The firmware update task information is added to the task queue (denoted as task_queue_boot), which includes the task name, priority of the firmware update task, and function address.
[0041] Task queue management. After initializing the system configuration, the system enters the task queue management phase. After verifying the validity of the device configuration files, the task queue management is initiated. The task queue management includes traversing the device configuration, creating firmware update tasks for each device, adding the created firmware update tasks to the queue, managing and monitoring the queue usage process, and deleting the firmware update tasks after completion. In addition, during operation, the task queue length also needs to be monitored, and resource usage statistics such as completion progress need to be performed.
[0042] Thread pool coordination and monitoring. Thread pool coordination and monitoring are performed concurrently with task queue management. This monitoring includes active thread counts, completed task counts, failed task counts, thread pool queue length monitoring, and resource usage statistics such as thread locks.
[0043] Thread scheduling loop. After thread pool management and firmware update tasks are started, the thread scheduling loop phase begins. In the thread scheduling loop phase, all tasks in the task list are executed in parallel using all threads until all tasks on all devices are completed. The specific process of this phase is as follows: First, the thread scheduler checks the queue. If the queue is empty, it waits for new tasks and notifies the condition variable. Otherwise, it obtains idle threads. If there are idle threads, it assigns tasks to the threads and executes them. If there are no idle threads, it waits for the threads to be released and recycled before executing the tasks.
[0044] Single-device update task steps. A single firmware update task includes: first, connecting to the specific device to be updated via TCP, reading the flashing file into the memory cache, performing a flashing handshake interaction confirmation, and then transmitting the corresponding encoded packet for the specific flashing file; after the encoded packet transmission is complete, the flashing process is completed after the encoded packet integrity is confirmed by CRC32 verification. Throughout the process, a progress report is also required for task statistics.
[0045] Anomaly Handling. To effectively improve program reliability during a single firmware update task, anomaly handling is implemented. This includes a communication failure retry mechanism, a fault recovery mechanism, a rollback mechanism after update failure, and a fault isolation mechanism. This effectively prevents anomalies from occurring, allowing the program to continue executing update tasks for other devices even after a device failure has occurred.
[0046] End processing flow. After all firmware update tasks have been completed, the process ends upon completion triggered by the judgment logic. The task queue stops receiving new tasks and waits for all threads to finish executing before cleaning up thread resources (releasing connections and files) and shutting down the thread pool. This process can effectively prevent memory leaks and program crashes. Figure 5 The runtime sequence consists of three parts: the main program, worker threads, and resource management. The power plant control main process initializes the thread pool and creates threads, then submits n1 tasks. After tasks are enqueued, idle threads are awakened to retrieve them. A thread acquires the task queue lock, retrieves a task, and then releases the lock. Once all threads have acquired tasks and are executing update tasks for devices 1 to n1, the update process requires updating the progress management. After an update task is completed, the thread is marked as idle, waiting to be assigned a new task. After all tasks are completed, all threads in the thread pool are stopped, and the final results and output are collected. The output includes firmware update result information for all devices, including a list of successfully updated devices, a list of failed updates, statistical information, an update report, and a firmware update completion flag.
[0047] This invention provides a rapid and stable batch firmware update method for large-scale power plant-level energy storage projects, significantly improving firmware update efficiency. This effectively saves time and reduces operation and maintenance costs without affecting normal task execution. Compared with existing technologies, specific advantages include: 1. By using random linear network coding technology to encode the burning file into an encoding package, and then using the encoding package for unified updates during batch firmware updates, the time complexity of batch firmware updates is reduced from O(n) (related to the number of devices) to O(1) (independent of the number of devices), effectively improving update efficiency. The network load is extremely low, constant at firmware size × (1 + redundancy).
[0048] 2. By combining random linear network coding with broadcasting, and using a task scheduling strategy that combines task grouping and CPU utilization weights, firmware update tasks can use more bandwidth when the system is idle and less bandwidth when the system is busy, while ensuring that urgent tasks always use bandwidth in real time.
[0049] 3. By comprehensively considering various situations in the current energy storage power station, the priority of firmware update tasks is dynamically adjusted to improve the utilization efficiency of system bandwidth while ensuring urgent tasks. The update process is simple and safe.
[0050] 4. Employing data broadcasting instead of unicasting, packet loss can be eliminated through packet broadcasting technology, requiring only the receiving end to collect a sufficient number of encoded packets. This reduces the load on the host end by continuously broadcasting different encoded packets from the sending end. Each device only needs to receive a sufficient number (not in a specific order) of encoded packets to reconstruct the complete firmware through matrix operations, eliminating the need to report a loss list to the sending end. The transmission time is the same as for a single device, resolving the "one-to-many" transmission bottleneck and avoiding reliance on complex concurrent thread management.
[0051] 5. It uses a high-efficiency embedded Linux platform, and the overall program adopts a single-process multi-threaded basic architecture. It has rich Ethernet open source libraries, network protocol support, open source code, and requires little hardware resources.
[0052] 6. Based on a local area network (LAN) Ethernet communication architecture, this system utilizes advanced thread pools and multi-task management techniques, managing multiple device sessions through a main controller. It employs `std::async` and `std::future` for concurrent execution, with the underlying communication driver using non-blocking I / O asynchronous communication via `select()`. This concurrency control enables rapid firmware updates, further improving efficiency. The use of thread pools for multi-threaded management avoids the system overhead caused by frequent resource allocation and release. Multi-task management saves time through concurrency control, and asynchronous read methods can continuously and concurrently issue multiple requests without waiting for a single response, avoiding blocking.
[0053] 7. By using thread-safe design with mutexes, atomic operation counters and shared state contention, as well as robust error handling mechanisms such as automatic retry, heartbeat detection, timeout protection, and fault isolation, the firmware update speed is guaranteed while maintaining high reliability, which steadily improves the operation and maintenance efficiency and reduces the operation and maintenance costs of large-scale energy storage projects.
[0054] Current firmware updates for power plant-level equipment mostly use sequential updates. The time for batch device updates is the sum of the times for all devices, resulting in low efficiency regardless of whether the operation is automated or manual. For example, with 100 devices, each requiring time t, a single batch firmware update using a polling method would take 100t. In this invention, with a thread pool of 100 threads, the time is approximately equal to the time t for a single device; with a thread pool of 10 threads, the time is approximately 10t, representing an exponential improvement in time efficiency.
[0055] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0056] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0057] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0058] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0059] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.
Claims
1. A method for batch firmware update of energy storage power station equipment, characterized in that, include: The firmware update flashing file is fragmented and encoded using random linear network coding technology to obtain the encoded packet corresponding to the firmware update flashing file. The priority of executing firmware update tasks is dynamically adjusted based on the urgency of tasks, system idle time, urgency of firmware updates, and deadline of firmware updates in the current energy storage power station. Based on the priority of the firmware update task, batch firmware updates are performed using encoded packages.
2. The method for batch firmware update of energy storage power station equipment according to claim 1, characterized in that: The method of dynamically adjusting the priority of firmware update tasks based on the current urgency of tasks in the energy storage power station, system idle time, urgency of firmware updates, and firmware update deadline includes: The tasks in the energy storage power station are divided into emergency tasks, fixed tasks, customer demand tasks, and firmware update tasks. Emergency tasks have a higher priority than fixed tasks, and fixed tasks have a higher priority than customer demand tasks. The priority of firmware update tasks is dynamically adjusted, and the calculation method for the priority of firmware update tasks is as follows: Wcgroup=Wbase + (Ptotal×Wrange), In the formula, Wcgroup represents the priority of the firmware update task, Wbase represents the base priority, Wrange represents the priority variation range, and Ptotal represents the comprehensive priority value. Ptotal is dynamically adjusted based on system idle time, the urgency of the firmware update, and the deadline of the firmware update.
3. The method for batch firmware update of energy storage power station equipment according to claim 2, characterized in that: The method for calculating the comprehensive priority value is as follows: Ptotal =α×Ssystem +β×Udevice +γ×Tdeadline, In the formula, α, β, and γ represent weighting coefficients, α+β+γ=1, Ssystem represents system idleness, used to measure whether CPU and network I / O are busy, Udevice represents the urgency of firmware update, and Tdeadline represents the deadline for firmware update.
4. The method for batch firmware update of energy storage power station equipment according to claim 3, characterized in that: The method for calculating the system idle time is as follows: Ssystem =ωcpu×Scpu +ωnet×Snet, In the formula, Scpu represents CPU idle time, ωcpu represents CPU weight coefficient, Snet represents network idle time (adjusted according to bandwidth utilization and packet forwarding rate), ωnet represents network weight coefficient, and ωcpu+ωnet=1.
5. The method for batch firmware update of energy storage power station equipment according to claim 4, characterized in that: The method for calculating CPU idle time is as follows: Scpu = max(0.1,min(1.0,(Umax - Ucurrent) / (Umax-Umin))), In the formula, max() represents taking the maximum value, min() represents taking the minimum value, Umin represents the CPU idle threshold, Ucurrent represents the current CPU utilization, and Umax represents the CPU busy threshold. The method for calculating the network idle time is as follows: Snet=min(Sbandwidth,Spacket), In the formula, Sbandwidth represents bandwidth idle time, and Spacket represents packet forwarding idle time.
6. The method for batch firmware update of energy storage power station equipment according to claim 5, characterized in that: The method for calculating the bandwidth idle time is as follows: Sbandwidth = max(0.1,min(1.0,(Bmax - Bcurrent) / (Bmax-Bmin))), In the formula, Bmax represents the bandwidth busy threshold, Bcurrent represents the current network interface bandwidth utilization, and Bmin represents the bandwidth idle threshold. The method for calculating the packet forwarding idle time is as follows: Spacket = max(0.1,min(1.0,(Pmax - Pcurrent) / (Pmax-Pmin))), In the formula, Pmax represents the busy packet forwarding threshold, Pcurrent represents the current packet forwarding rate, and Pmin represents the idle packet forwarding threshold.
7. The method for batch firmware update of energy storage power station equipment according to claim 3, characterized in that: The method for calculating the urgency of the firmware update is as follows: Udevice = ωs×Slevel / Smax+ ωe×min(1.0, Ecount / Ethreshold), In the formula, Slevel represents the equipment security level, Smax represents the maximum security level, ωs represents the equipment security level weight, ωe represents the error count weight, min() represents taking the minimum value, Ecount represents the number of errors in the equipment in the last 24 hours, and Ethreshold represents the error count threshold.
8. The method for batch firmware update of energy storage power station equipment according to claim 3, characterized in that: The method for calculating the firmware update period is as follows: Tdeadline= max(0.1,min(1.0,Tremaining / (Testimated×Bfactor))), In the formula, max() represents taking the maximum value, min() represents taking the minimum value, Tremaining represents the remaining time until the end of the maintenance window, Testimated represents the estimated time required to complete the device update, and Bfactor represents the buffer factor.
9. A batch firmware update system for energy storage power station equipment, characterized in that: The system includes a memory, a processor, and a main control program stored in the memory and executable on the processor. When the processor executes the main control program, it implements the batch firmware update method for energy storage power station equipment as described in any one of claims 1-8 and begins the batch firmware update process. The batch firmware update process includes: Upon receiving an instruction to perform a batch firmware update, the thread manager is initialized, and the number of thread pools is set. The thread pool manager allocates a preset number of worker threads to form a local thread pool. The device information that needs firmware update is added to the device list, and the device information includes IP address, port number, and encoded packet. The firmware update task information is added to the task queue, and the firmware update task information includes task name and firmware update task priority. After verifying the validity of the device configuration file, the task queue management is started. The task queue management includes traversing the device configuration, creating a firmware update task for each device, adding the created firmware update task to the queue, managing and monitoring the queue during its use, and deleting the task after it is completed. While managing the task queue, thread pool coordination and monitoring are also performed. The thread pool coordination and monitoring includes monitoring of active thread count, completed task count, failed task count, and thread pool queue length. After thread pool management and firmware update tasks are started, the thread scheduling loop phase begins. During the thread scheduling loop phase, all tasks in the task list are executed in parallel using all threads until all tasks on all devices are completed. To perform a single firmware update task, a TCP connection is established with the specific device to be updated. The flashing file is read into the memory cache, and after a flashing handshake interaction confirmation, the encoding packet corresponding to the specific flashing file is transmitted. After the encoding packet is transmitted, it is verified to be correct, and the flashing process is completed.
10. The batch firmware update system for energy storage power station equipment according to claim 9, characterized in that: The batch firmware update process also includes: When performing a single firmware update task, exception handling is performed simultaneously. The exception handling includes a communication failure retry mechanism, a fault recovery mechanism, a rollback mechanism after update failure, and a fault isolation mechanism. After all firmware update tasks have been completed, the process enters the termination phase. The task queue stops receiving new tasks, waits for all threads to finish executing, cleans up thread resources, and shuts down the thread pool. Output the firmware update results for all devices, including a list of devices that successfully updated, a list of devices that failed to update, statistical information, an update report, and a firmware update completion flag.