A charging and discharging control method, device, equipment and storage medium
By constructing a quadratic programming objective function and physical logic constraints for the charging and discharging system, the problem of imprecise charging and discharging control in the existing technology is solved, achieving balanced power management among devices and extending the service life of the equipment.
Patent Information
- Application Number
- CN202610231665.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-27
- Publication Date
- 2026-05-29
AI Technical Summary
Existing charging and discharging control methods cannot achieve precise control, resulting in uneven losses between devices and accelerated equipment aging.
The quadratic programming objective function and physical and logical constraints of the charging and discharging system are constructed. Power control is performed by solving the optimal solution vector to ensure that the power of each controlled device is managed in a refined manner within the demand limit.
It enables precise control of the power of each controlled device, avoids uneven equipment wear, and extends the service life of the equipment.
Smart Images

Figure CN122119002A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power system management and automated dispatching technology, and more specifically, to a charging and discharging control method, device, equipment, and storage medium. Background Technology
[0002] In modern power systems, especially in applications such as microgrids, energy storage power stations, and V2G (Vehicle-to-Grid) charging stations, there are typically numerous charging and discharging units, such as energy storage converters, chargers, and battery packs. The system requires a central dispatcher to coordinate and control the charging and discharging behavior of these units based on the total power target issued from the upper layer. However, existing charging and discharging control methods often only perform simple averaging or proportional allocation, failing to achieve fine-grained control and easily leading to uneven losses between devices, thus accelerating equipment aging. Summary of the Invention
[0003] In view of this, the purpose of the present invention is to provide a charging and discharging control method, apparatus, device and storage medium to solve the problem that the existing charging and discharging control methods are not precise enough.
[0004] To achieve the above objectives, the technical solution adopted by the present invention is as follows: In a first aspect, the present invention provides a charging and discharging control method applied to a charging and discharging system, the method comprising: Obtain the state data of the charging and discharging system, and construct a quadratic programming objective function for the power control of the charging and discharging system based on the state data; Physical and logical constraints are constructed based on the controlled devices of the charging and discharging system; The optimal solution vector is obtained by solving the quadratic programming objective function and the physical and logical constraints. Power control of the controlled device is performed based on the optimal solution vector.
[0005] In an optional implementation, the step of acquiring the state data of the charging and discharging system includes: Obtain the real-time power readings of each meter in the charging and discharging system, and read the currently preset charging and discharging strategy of the charging and discharging system; Obtain the current actual power and charge / discharge capacity boundary of each controlled device in the charging / discharging system, and determine the controlled device corresponding to the electricity meter and the controlled device corresponding to the charging / discharging strategy.
[0006] In an optional implementation, the step of constructing the quadratic programming objective function for the power control of the charging and discharging system based on the state data includes: Construct a target matrix based on the controlled device corresponding to the electricity meter and the controlled device corresponding to the charging and discharging strategy; A linear coefficient vector is constructed based on the real-time power readings of each meter and the charging and discharging strategy; The quadratic programming objective function is constructed based on the objective matrix and the linear coefficient vector.
[0007] In an optional implementation, the step of constructing a target matrix based on the controlled device corresponding to the electricity meter and the controlled device corresponding to the charging / discharging strategy includes: A Hessian matrix is constructed based on the number of controlled devices. The diagonal elements of the Hessian matrix are determined based on the weights of the controlled devices. The off-diagonal elements of the Hessian matrix are determined based on the constraints of the controlled devices to obtain the target matrix.
[0008] In an optional implementation, the step of constructing physical and logical constraints for the controlled device based on the charging and discharging system includes: A constraint relationship matrix is constructed based on the controlled device, the charging and discharging strategy, and the controlled device corresponding to the electricity meter; The physical boundary of the controlled device is constructed based on its power, the strategy boundary is constructed based on its charging and discharging strategy, and the dynamic boundary of the meter is constructed based on its protection requirements.
[0009] In an optional implementation, the step of constructing the dynamic boundary of the electricity meter based on the protection requirements of the electricity meter includes: Based on the over-limit protection requirements of the electricity meter, construct the upper boundary of the meter's dynamics:
[0010] Based on the backflow prevention requirements of the meter, the lower boundary of the meter's dynamics is constructed as follows:
[0011] in, For demand, To prevent backflow limits, For the meter reading, This represents the current power of the controlled devices under the meter.
[0012] In an optional implementation, the step of power control of the controlled device based on the optimal solution vector includes: Analyze the first preset number of elements of the optimal solution vector; The preset number of elements are sent as the control power of the controlled device to the corresponding controlled device controller, and the preset number of elements correspond to the number of controlled devices.
[0013] In a second aspect, the present invention provides a charge / discharge control device, comprising: The data acquisition module is used to acquire the status data of the charging and discharging system and construct a quadratic programming objective function for the power control of the charging and discharging system based on the status data. A constraint construction module is used to construct physical and logical constraints based on the controlled devices of the charging and discharging system. The vector solving module is used to obtain the optimal solution vector based on the quadratic programming objective function and the physical and logical constraints; A power control module is used to perform power control on the controlled device based on the optimal solution vector.
[0014] Thirdly, the present invention provides an electronic device including a processor and a memory, the memory storing machine-executable instructions executable by the processor, the processor executing the machine-executable instructions to implement the charging and discharging control method described in the first aspect.
[0015] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the charging and discharging control method described in the first aspect.
[0016] The present invention provides a charging and discharging control method, device, equipment and storage medium. It constructs a quadratic programming objective function based on the state data of the charging and discharging system, and then constrains and solves the quadratic programming objective function through the physical and logical constraints of the controlled devices, so that the calculated instructions will not exceed the demand limit, and can realize fine control of the power of each controlled device.
[0017] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 A block diagram of an electronic device provided by an embodiment of the present invention is shown; Figure 2 A schematic flowchart of a charging and discharging control method provided by an embodiment of the present invention is shown; Figure 3 A schematic diagram of a charging and discharging system provided in an embodiment of the present invention is shown; Figure 4A schematic diagram illustrating the dynamic boundary calculation principle provided in an embodiment of the present invention is shown; Figure 5 A functional block diagram of a charge / discharge control device provided in an embodiment of the present invention is shown.
[0020] icon: 100 - Electronic equipment; 110 - Memory; 120 - Processor; 130 - Communication module; 500 - Charge and discharge control device; 510 - Data acquisition module; 520 - Constraint construction module; 530 - Vector solution module; 540 - Power control module. Detailed Implementation
[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0022] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0023] It should be noted that relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0024] Please refer to Figure 1 , Figure 1 This is a block diagram of an electronic device 100 provided in this embodiment. The electronic device 100 includes a memory 110, a processor 120, and a communication module 130. The memory 110, processor 120, and communication module 130 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.
[0025] The memory 110 is used to store programs or data. The memory 110 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.
[0026] The processor 120 is used to read / write data or programs stored in the memory 110 and to perform corresponding functions.
[0027] The communication module 130 is used to establish a communication connection between the electronic device 100 and other communication terminals through the network, and to send and receive data through the network.
[0028] It should be understood that, Figure 1 The structure shown is only a schematic diagram of the electronic device 100. The electronic device 100 may also include components that are larger than... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown. Figure 1 The components shown can be implemented using hardware, software, or a combination thereof.
[0029] Please refer to Figure 2 , Figure 2 This is a flowchart illustrating a charging and discharging control method provided in this embodiment, applied to a charging and discharging system. The method includes: S210. Obtain the state data of the charging and discharging system, and construct a quadratic programming objective function for the power control of the charging and discharging system based on the state data.
[0030] Please refer to Figure 3 , Figure 3 This is a schematic diagram of a charging and discharging system provided in this embodiment.
[0031] The charging and discharging system mainly includes: power grid, gate meter, plant AC bus, central controller, sub-meter, load and controlled equipment cluster. The controlled equipment cluster may include several energy storage branches or battery packs. The gate meter is used to measure the total power, while the sub-meter is used to measure the power of the corresponding load branch. The central controller is connected to the controlled equipment cluster and gate meter through a communication bus to collect data and issue power commands in real time.
[0032] The status data of the charging and discharging system is Figure 3 The charging and discharging data of devices such as meters, loads, and controlled equipment clusters, as well as data related to charging and discharging, are used to construct a quadratic programming objective function based on the state data to represent the total charging and discharging power of the system.
[0033] S220. Based on the controlled device of the charging and discharging system, construct physical and logical constraints.
[0034] Each controlled device has its corresponding constraints, such as common minimum power, maximum power, etc. By constructing corresponding physical and logical constraints based on all controlled devices in the charging and discharging system, the reasonable range of power of the charging and discharging system during charging and discharging is limited.
[0035] S230. The optimal solution vector is obtained by solving the quadratic programming objective function and the physical and logical constraints.
[0036] After determining the quadratic programming objective function and the physical and logical constraints, a joint solution can be performed to obtain the optimal solution vector for the charge and discharge control of the charging and discharging system.
[0037] S240. Power control is performed on the controlled device based on the optimal solution vector.
[0038] Since there are many controlled devices in the charging and discharging system, each controlled device can be numbered and sorted in advance, and then power control can be performed on each controlled device based on the optimal solution vector and the order relationship between each controlled device.
[0039] In this embodiment, a quadratic programming objective function is constructed based on the state data of the charging and discharging system. Then, the quadratic programming objective function is constrained and solved by the physical and logical constraints of the controlled devices, so that the calculated instructions will not exceed the demand limit and the power of each controlled device can be finely controlled.
[0040] In one embodiment, the step of acquiring the state data of the charging and discharging system includes: Obtain the real-time power readings of each meter in the charging and discharging system, and read the currently preset charging and discharging strategy of the charging and discharging system; Obtain the current actual power and charge / discharge capacity boundary of each controlled device in the charging / discharging system, and determine the controlled device corresponding to the electricity meter and the controlled device corresponding to the charging / discharging strategy.
[0041] Status data can be divided into equipment status data, power grid status data, and strategy target data. Among them, equipment status data includes the current actual power and charging / discharging capacity boundary of each device, power grid status data includes the actual power readings of the gate meter and each sub-meter, and strategy target data is the target total power corresponding to the current preset charging / discharging strategy.
[0042] Then, based on the controlled devices, strategies, and meters, a corresponding topology mapping relationship is constructed, that is, which charging and discharging strategy corresponds to each controlled device, and the controlled devices managed by each meter, etc.
[0043] This embodiment acquires the state data of the charging and discharging system and constructs a corresponding topology mapping relationship based on the state data, making the influence and relationship between different data clearer and providing a data foundation for subsequent charging and discharging control.
[0044] In one implementation, the step of constructing the quadratic programming objective function for the power control of the charging and discharging system based on the state data includes: Construct a target matrix based on the controlled device corresponding to the electricity meter and the controlled device corresponding to the charging and discharging strategy; A linear coefficient vector is constructed based on the real-time power readings of each meter and the charging and discharging strategy; The quadratic programming objective function is constructed based on the objective matrix and the linear coefficient vector.
[0045] First, a Hessian matrix is constructed based on the number of controlled devices. , The size of the matrix is , among which the former Row / column correspondence A controlled device, This represents the total number of controlled devices.
[0046] The diagonal elements of the Hessian matrix are determined based on the weights of the controlled devices. In order to achieve the equipment power As close to the average as possible According to the formula Expanding the derivation: It can be set to .
[0047] The off-diagonal elements of the Hessian matrix are determined based on the constraints of the controlled device to obtain the target matrix.
[0048] For non-diagonal elements ( ): Set as This represents the mutual coupling between devices, and the resulting target matrix is:
[0049] Wherein, the linear coefficient vector Used to guide total power close to the strategy target For those belonging to the target value Devices under the policy group ,That Element assignment value This setting makes the objective function... The sum is close to It reaches its minimum value at that time.
[0050] In one implementation, the step of constructing physical and logical constraints for the controlled device based on the charging and discharging system includes: A constraint relationship matrix is constructed based on the controlled device, the charging and discharging strategy, and the controlled device corresponding to the electricity meter; The physical boundary of the controlled device is constructed based on its power, the strategy boundary is constructed based on its charging and discharging strategy, and the dynamic boundary of the meter is constructed based on its protection requirements.
[0051] Constructing constraints .
[0052] in, It is a sparse matrix describing three types of relationships: device self-constraint rows, with corresponding positions set to 1; policy constraint rows, with corresponding positions of all devices under this policy set to 1; and meter / topology constraint rows, with corresponding positions of all devices under this meter set to 1.
[0053] Then construct the lower boundary constraints. and upper boundary .
[0054] (Maximum discharge power, negative value).
[0055] (Maximum charging power, positive value).
[0056] Please refer to Figure 4 , Figure 4 This is a schematic diagram illustrating the principle of dynamic boundary calculation provided in this embodiment.
[0057] In one implementation, the step of constructing the dynamic boundary of the electricity meter based on the protection requirements of the electricity meter includes: Based on the over-limit protection requirements of the electricity meter, construct the upper boundary of the meter's dynamics:
[0058] according to Figure 4 The upper boundary formula can calculate the total target power that all controlled devices are allowed to output without triggering demand exceedances. Even if Severe fluctuations will also force the solver to limit its operations. The sum of .
[0059] Based on the backflow prevention requirements of the meter, the lower boundary of the meter's dynamics is constructed as follows:
[0060] like Set to 0 (anti-reverse current) or a small positive value (load following), this constraint forces the equipment's discharge power to prevent the grid-side power from falling below this lower limit.
[0061] in, For demand, To prevent backflow limits, For the meter reading, This represents the current power of the controlled devices under the meter.
[0062] Then, input the above formula into the solver to output the optimal solution vector. Analyze the first preset number of elements of the optimal solution vector and send the first preset number of elements as the control power of the controlled device to the corresponding controlled device controller. The first preset number of elements corresponds to the number of controlled devices.
[0063] For example, the first d elements of the optimal solution vector can be parsed and sent as a power command to the corresponding PCS controller.
[0064] To perform the corresponding steps in the above embodiments and various possible methods, an implementation of a charge / discharge control device is given below. Please refer to [link / reference needed]. Figure 5 , Figure 5 This is a functional block diagram of a charge / discharge control device provided in an embodiment of the present invention. It should be noted that the basic principle and technical effects of the charge / discharge control device provided in this embodiment are the same as those in the above embodiments. For the sake of brevity, any parts not mentioned in this embodiment can be referred to the corresponding content in the above embodiments. The charge / discharge control device 500 includes: The data acquisition module 510 is used to acquire the status data of the charging and discharging system and construct a quadratic programming objective function for the power control of the charging and discharging system based on the status data. Constraint construction module 520 is used to construct physical and logical constraints based on the controlled devices of the charging and discharging system; The vector solving module 530 is used to solve for the optimal solution vector based on the quadratic programming objective function and the physical and logical constraints; The power control module 540 is used to perform power control on the controlled device based on the optimal solution vector.
[0065] Optionally, the above modules can be stored in the form of software or firmware. Figure 1 The memory shown is either stored in or embedded in the operating system (OS) of the electronic device, and can be used by... Figure 1 The processor executes the commands. Meanwhile, the data and program code required to execute these modules can be stored in memory.
[0066] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the present invention. 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 marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive 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 a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0067] In addition, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0068] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0069] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A charging and discharging control method, characterized in that, Applied to a charging and discharging system, the method includes: Obtain the state data of the charging and discharging system, and construct a quadratic programming objective function for the power control of the charging and discharging system based on the state data; Physical and logical constraints are constructed based on the controlled devices of the charging and discharging system; The optimal solution vector is obtained by solving the quadratic programming objective function and the physical and logical constraints. Power control of the controlled device is performed based on the optimal solution vector.
2. The charging and discharging control method according to claim 1, characterized in that, The step of acquiring the status data of the charging and discharging system includes: Obtain the real-time power readings of each meter in the charging and discharging system, and read the currently preset charging and discharging strategy of the charging and discharging system; Obtain the current actual power and charge / discharge capacity boundary of each controlled device in the charging / discharging system, and determine the controlled device corresponding to the electricity meter and the controlled device corresponding to the charging / discharging strategy.
3. The charging and discharging control method according to claim 2, characterized in that, The step of constructing the quadratic programming objective function for the power control of the charging and discharging system based on the state data includes: Construct a target matrix based on the controlled device corresponding to the electricity meter and the controlled device corresponding to the charging and discharging strategy; A linear coefficient vector is constructed based on the real-time power readings of each meter and the charging and discharging strategy; The quadratic programming objective function is constructed based on the objective matrix and the linear coefficient vector.
4. The charging and discharging control method according to claim 3, characterized in that, The step of constructing a target matrix based on the controlled device corresponding to the electricity meter and the controlled device corresponding to the charging and discharging strategy includes: A Hessian matrix is constructed based on the number of controlled devices. The diagonal elements of the Hessian matrix are determined based on the weights of the controlled devices. The off-diagonal elements of the Hessian matrix are determined based on the constraints of the controlled devices to obtain the target matrix.
5. The charging and discharging control method according to claim 2, characterized in that, The steps for constructing physical and logical constraints for the controlled device based on the charging and discharging system include: A constraint relationship matrix is constructed based on the controlled device, the charging and discharging strategy, and the controlled device corresponding to the electricity meter; The physical boundary of the controlled device is constructed based on its power, the strategy boundary is constructed based on its charging and discharging strategy, and the dynamic boundary of the meter is constructed based on its protection requirements.
6. The charging and discharging control method according to claim 5, characterized in that, The step of constructing the dynamic boundary of the electricity meter based on the protection requirements of the electricity meter includes: Based on the over-limit protection requirements of the electricity meter, construct the upper boundary of the meter's dynamics: Based on the backflow prevention requirements of the meter, the lower boundary of the meter's dynamics is constructed as follows: in, For demand, To prevent backflow limits, For the meter reading, This represents the current power of the controlled devices under the meter.
7. The charging and discharging control method according to claim 1, characterized in that, The step of power control of the controlled device based on the optimal solution vector includes: Analyze the first preset number of elements of the optimal solution vector; The preset number of elements are sent as the control power of the controlled device to the corresponding controlled device controller, and the preset number of elements correspond to the number of controlled devices.
8. A charging and discharging control device, characterized in that, include: The data acquisition module is used to acquire the status data of the charging and discharging system and construct a quadratic programming objective function for the power control of the charging and discharging system based on the status data. A constraint construction module is used to construct physical and logical constraints based on the controlled devices of the charging and discharging system. The vector solving module is used to obtain the optimal solution vector based on the quadratic programming objective function and the physical and logical constraints; A power control module is used to perform power control on the controlled device based on the optimal solution vector.
9. An electronic device, characterized in that, It includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the charge-discharge control method according to any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the charging and discharging control method as described in any one of claims 1-7.