Joint optimization method, system, equipment, product and medium of micro-grid system
By using the LSTM network in the microgrid system to predict grid load and weather, and combining random search to optimize the energy output management value, the problem of slow convergence speed and easy to fall into local optimality in the existing technology is solved, and more efficient energy management and cost reduction are achieved.
Patent Information
- Application Number
- CN202510437512.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-05-06
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When facing the scheduling of complex microgrid systems, especially hybrid energy systems, the algorithm converges slowly, easily falls into the problems of local optimal solutions and high computational complexity.
The LSTM network is used to predict the grid load and weather, and an energy output management matrix is constructed based on the prediction results. Through random search and iterative optimization, the energy output management value is obtained to achieve effective control of the microgrid system.
Through the combination of LSTM network and random search, the optimization and scheduling capabilities of the microgrid system are significantly improved, operating costs are reduced, and the adaptability and stability of the system are improved.
Smart Images

Figure CN119944853A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of energy management technology, and in particular to a joint optimization method, system, equipment, product and medium for a microgrid system. Background Art
[0002] Existing microgrid system dispatching solutions usually focus on the optimization of microgrid energy management systems, especially how to effectively integrate multiple energy resources to minimize costs and maximize efficiency. Most existing solutions are based on traditional optimization algorithms, such as particle swarm optimization, taboo search, artificial bee colony algorithm, etc. These methods are usually used to optimize power generation, energy storage, load dispatching, etc. to ensure the stable operation and cost-effectiveness of microgrids.
[0003] A common feature of these existing solutions is that although they can handle multi-objective optimization problems in microgrid energy scheduling, such as reducing energy waste, improving system reliability, and reducing operating costs, they often face problems such as slow algorithm convergence, easy to fall into local optimal solutions, and high computational complexity. Therefore, although these traditional optimization algorithms perform well in some simple scenarios, their effectiveness and efficiency are greatly limited when facing complex microgrid systems, especially the scheduling of hybrid energy systems.
[0004] Some existing technologies also use optimization methods based on existing models, such as linear programming and dynamic programming, to calculate the optimal energy allocation strategy under given load demand and energy supply. These methods often rely on the accuracy of the system model and cannot effectively cope with the uncertainty and real-time requirements of the microgrid system. In a dynamically changing environment, traditional optimization methods cannot quickly adapt to the fluctuations in real-time power demand and the volatility of renewable energy, resulting in poor flexibility in the operation of the microgrid system. Summary of the invention
[0005] The present invention aims to solve at least one of the technical problems existing in the related art. To this end, the present invention provides a joint optimization method, system, device, product and medium of a microgrid system to effectively reduce the operating cost of the microgrid system.
[0006] The present invention provides a joint optimization method for a microgrid system, comprising: S1: Select the target power grid, obtain historical data through the target power grid, and construct a feature matrix through the historical data; S2: preprocess the feature matrix, obtain the LSTM network, input the preprocessed feature matrix into the LSTM network, and obtain the prediction results including weather prediction results and power grid load prediction results; S3: Select a microgrid system, construct an objective function for energy output management of the microgrid system, and construct constraint conditions based on the prediction results; S4: obtaining an energy output management value according to the constraint condition, constructing an energy output management matrix through the energy output management value, calculating the fitness of the energy output management matrix according to the objective function to obtain a fitness matrix, and selecting a first energy output management value and a second energy output management value from the fitness matrix; S5: The first energy output management value and the second energy output management value are randomly searched in the fitness matrix, and the relative distance between the first energy output management value and the second energy output management value is determined until the relative distance is lower than the distance threshold, and the target energy output management value is determined by the relative distance, and the target energy output management value is iterated to obtain the control energy output management value; S6: Performing energy output management on the microgrid system by controlling the energy output management value to complete the control of the microgrid system.
[0007] According to the joint optimization method of the microgrid system provided by the present invention, step S1 specifically includes: S11: Select a target power grid, obtain historical data including power grid load historical data and weather data of the target power grid, and perform special time marking on special moments in the power grid load historical data and the weather data; S12: splicing the power grid load historical data and the weather data after special time marking to obtain the feature matrix.
[0008] According to the joint optimization method of the microgrid system provided by the present invention, in step S2, the preprocessing includes data cleaning, normalization and feature extraction, and the LSTM network includes a forget gate, an input gate and an output gate.
[0009] According to the joint optimization method of the microgrid system provided by the present invention, in step S2, after the grid load forecast result is obtained, the grid load forecast result will be specially time-marked according to the weather forecast result, and the value of the grid load forecast result with the special time mark will be improved.
[0010] According to the joint optimization method of the microgrid system provided by the present invention, step S4 specifically includes: S41: obtaining a maximum output value and a minimum output value, and performing randomization by the maximum output value and the minimum output value under the constraint condition to obtain the energy output management value; S42: obtaining the energy output management matrix through the energy output management value, fine-tuning the energy output management matrix according to the weather forecast result, and calculating the fitness of the energy output management matrix according to the objective function to obtain the fitness matrix; S43: selecting the energy output management value with the highest fitness in the fitness matrix as the first energy output management value, and selecting the energy output management value with the second highest fitness as the second energy output management value.
[0011] According to the joint optimization method of the microgrid system provided by the present invention, step S5 specifically includes: S51: In the fitness matrix, the first energy output management value and the second energy output management value are randomly searched by using the Levy flight strategy; S52: Obtaining the relative position of the first energy output management value and the second energy output management value, obtaining a relative distance through the relative position, obtaining a distance threshold, and selecting the target energy output management value through the relative distance when the relative distance is less than the distance threshold; S53: reducing the size of the fitness matrix, reducing the distance threshold, iterating the target energy output management value, and obtaining the controlled energy output management value.
[0012] The present invention also provides a joint optimization system for a microgrid system, comprising: Feature matrix module: used to select the target power grid, obtain historical data through the target power grid, and construct a feature matrix based on the historical data; Prediction result module: used to preprocess the feature matrix, obtain the LSTM network, input the preprocessed feature matrix into the LSTM network, and obtain the prediction results including weather forecast results and power grid load forecast results; Objective function module: used to select a microgrid system, construct an objective function for energy output management of the microgrid system, and construct constraint conditions through the prediction results; Fitness matrix module: used to obtain the energy output management value according to the constraint conditions, construct the energy output management matrix through the energy output management value, calculate the fitness of the energy output management matrix according to the objective function, obtain the fitness matrix, and select the first energy output management value and the second energy output management value from the fitness matrix; Control energy output management value module: used for randomly searching the first energy output management value and the second energy output management value in the fitness matrix, and determining the relative distance between the first energy output management value and the second energy output management value until the relative distance is lower than the distance threshold, determining the target energy output management value by the relative distance, iterating the target energy output management value, and obtaining the control energy output management value; Microgrid system control module: used to manage the energy output of the microgrid system by controlling the energy output management value, and complete the control of the microgrid system.
[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the joint optimization method for a microgrid system as described in any one of the above are implemented.
[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-described joint optimization methods for microgrid systems.
[0015] The present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the steps of the joint optimization method of the microgrid system as described in any one of the above-mentioned methods.
[0016] The above one or more technical solutions in the embodiments of the present invention have at least one of the following technical effects: The joint optimization method, system, device, product and medium of the microgrid system provided by the present invention use an LSTM network to predict the grid load and weather, and construct an energy output management matrix according to the weather forecast results and the grid load forecast results. Through random search and iteration and taking into account the influence of the weather forecast results, a control energy output management value that can effectively reduce the operating cost of the microgrid system is obtained. The LSTM network and random search are combined to provide an efficient and flexible microgrid energy management method, which can significantly improve the optimization and scheduling capability of the microgrid system, reduce operating costs, and improve the adaptability and stability of the system.
[0017] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 It is a flow chart of the joint optimization method of the microgrid system provided by the present invention.
[0020] Figure 2 It is a structural schematic diagram of the joint optimization system of the microgrid system provided by the present invention.
[0021] Figure 3 It is a structural schematic diagram of the joint optimization device of the microgrid system provided by the present invention.
[0022] Reference numerals: 100, feature matrix module; 200, prediction result module; 300, objective function module; 400, fitness matrix module; 500, control energy output management value module; 600, microgrid system control module; 810, processor; 820, communication interface; 830, memory; 840, communication bus. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical scheme and advantages of the present invention clearer, the technical scheme in the present invention will be clearly and completely described below. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present invention. The following embodiments are used to illustrate the present invention, but cannot be used to limit the scope of the present invention.
[0024] In the description of the embodiments of the present invention, it should be noted that the terms “first”, “second” and “third” are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0025] In the description of the embodiments of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "connected" and "connection" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms in the embodiments of the present invention can be understood according to specific circumstances.
[0026] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiment of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0027] Combine the following Figures 1 to 3 Describe the specific embodiment of the present invention: Figure 1 A schematic diagram of the process flow of the joint optimization method for the microgrid system provided by the present invention is shown in FIG. Figure 1 As shown, firstly, a target power grid is selected, historical data is obtained through the target power grid, a feature matrix is constructed through the historical data, and then the processed feature matrix is input into the LSTM network to obtain prediction results including weather forecast results and power grid load forecast results; then, an objective function of energy output management of the microgrid system is constructed, and constraint conditions are constructed; then, an energy output management matrix is constructed to obtain a fitness matrix, from which a first energy output management value and a second energy output management value are selected; then, a random search is performed and the relative distance is determined, so as to obtain the target energy output management value and iterate, and finally, energy output management of the microgrid system is performed to complete the control of the microgrid system.
[0028] With respect to the above steps, the specific implementation methods in this embodiment are as follows: S1: Select the target power grid, obtain historical data through the target power grid, and construct a feature matrix through the historical data; Furthermore, the purpose of this stage is to obtain historical data and grid charge through the target grid, so as to construct a feature matrix. Specifically, step S1 specifically includes: S11: Select a target power grid, obtain historical data including power grid load historical data and weather data of the target power grid, and perform special time marking on special moments in the power grid load historical data and the weather data; S12: splicing the power grid load historical data and the weather data after special time marking to obtain the feature matrix.
[0029] With respect to the above steps, the specific implementation methods in this embodiment are as follows: First, the historical data of the grid load of the target grid is obtained as the grid load historical data. The grid load historical data includes the grid load at different times that changes with time. ,in, Indicates The grid load at the time, P represents the number of times, represents the grid load at time t, where t is a time in the past. In addition, historical data also includes other factors, such as weather data that changes over time, including the temperature at time t ,humidity , wind speed In addition, some special moments also need special time marking, such as weekends, holidays, high and low temperature weather. At moments with special time markings, the power grid load is usually high. By splicing the marked power grid load historical data with weather data, the feature matrix at the input time t can be constructed. : S2: preprocessing the feature matrix, obtaining the LSTM network, inputting the preprocessed feature matrix into the LSTM network, and obtaining the prediction results including the weather prediction results and the power grid load prediction results; The purpose of this stage is to preprocess the feature matrix and obtain the prediction results through the LSTM network. Specifically, in step S2, the preprocessing includes data cleaning, normalization and feature extraction, and the LSTM network includes a forget gate, an input gate and an output gate.
[0030] In step S2, after the grid load forecast result is obtained, the grid load forecast result will be specially time-marked according to the weather forecast result, and the value of the grid load forecast result with the special time mark will be increased.
[0031] With respect to the above steps, the specific implementation methods in this embodiment are as follows: First, the data in the feature matrix is preprocessed, which includes data cleaning, normalization, and feature extraction. Data cleaning includes removing some obviously erroneous data, feature extraction includes assigning higher weights to more important data, and normalization can map data of different dimensions to the same range to reduce the impact of scale differences between features on model training. Normalized feature matrix changing over time t The calculation method is as follows: in, is the minimum value of the feature matrix, In this embodiment, the maximum value of each element in the feature matrix is obtained to form the maximum value of the feature matrix. Similarly, the minimum value of each element in the feature matrix is obtained to form the minimum value of the feature matrix.
[0032] Then, we obtain the LSTM (Long Short-Term Memory) network and input the preprocessed feature matrix into the LSTM network as the feature matrix. In the LSTM network, there are forget gates, input gates, and output gates. These gating mechanisms enable LSTM to selectively remember or forget information, thereby capturing complex time dependencies. is the hidden state at time T, where T is the future moment for prediction, is the state of the memory unit at time t, then in the LSTM network, it includes a forget gate, an input gate, and an output gate. Among them, in the forget gate at time t, the forget gate outputs for: in, () indicates that the content in the brackets is activated using an activation function. In this embodiment, the activation function is a Sigmoid function. For time The hidden state when T is 1 is 0, is the learnable forget gate weight matrix, is the learnable forget gate bias vector. The forget gate is used to control which information in the memory unit of the LSTM network needs to be forgotten.
[0033] In the input gate at time t, first calculate the output of the first input gate at time t and the second input gate output : in, is the first input weight matrix that can be learned, is the first learnable input bias vector, is the learnable second input weight matrix, is the second input bias vector that can be learned, and tanh() represents the hyperbolic tangent operation of the content in the brackets. Then, the state of the memory unit at time t can be updated through the output of the first input gate and the output of the second input gate. : in, is the state of the memory cell at time t-1, and when t is 1 Also 0.
[0034] In the output gate at time T, the output gate output at time T in the future The calculation method is: in, is the learnable output gate weight matrix, is the learnable output gate bias vector, and then calculates the hidden state at time T: By inputting the preprocessed feature matrix of different times but the same time interval into the LSTM network, the power grid load at the same time interval in the future can be predicted through the LSTM network, so as to obtain the power grid load prediction result and the weather prediction result of the area where the power grid is located. The power grid load prediction result is the prediction result of the future power grid load of the target power grid. The power grid load prediction result and the weather prediction result of the area where the power grid is located are used as the prediction result. In the power grid load prediction result, since special moments have been specially marked with time in the feature matrix, the power grid load prediction result will be specially marked with time when the weather forecast result is high or low temperature weather and other special circumstances. In addition, special time marks can be made for special times such as holidays and weekends in the power grid load prediction result according to the special time mark of the feature matrix, and the value of the power grid load prediction result with special time mark can be appropriately increased according to experience.
[0035] S3: Select a microgrid system, construct an objective function for energy output management of the microgrid system, and construct constraint conditions based on the prediction results; The purpose of this stage is to construct the objective function and constraints, and to prepare for the subsequent construction of the energy output management matrix and calculation of fitness. Specifically, first determine the microgrid system that needs energy output management and serves the target grid. Here, the microgrid system is connected to the target grid and provides energy scheduling for the target grid to maintain the stability of the microgrid system. Energy output management refers to the scheduling of various parts of the microgrid system, such as diesel generators, micro gas turbines, wind power generation equipment, etc., so that the energy output of the microgrid system can meet the needs of the external grid while minimizing the operating cost of the microgrid system. In addition, it can also cut the current unnecessary loads of consumers in the grid, or transfer the load that can be transferred to other grids. Energy output management needs to take into account the grid loss cost, equipment loss cost, greenhouse gas emission cost, power loss cost, etc. It is a multi-objective optimization problem. In the process of energy output management, it is necessary to achieve the optimal energy scheduling of the microgrid based on the objective function and constraints. Here, the objective function is for: in, is the grid cost, For fuel costs, The cost of new energy power generation equipment, is the cost of greenhouse gas emissions, The incentive cost for demand response is the cost of incentives required to achieve power demand response in the power system. is the power loss cost, and min() is the minimum value in the brackets.
[0036] In addition, in the process of energy dispatch, microgrids also need to construct constraints and comply with the constraints. Here, the constraints include power balance constraints, generator capacity constraints, consumer load constraints, and energy storage charging and discharging constraints. Among them, the power balance constraint obtained according to the prediction results of the LSTM network is: in, is the demand side load power at the future time T obtained based on the prediction results of the LSTM network, is the power change caused by the demand response at time T, is the grid loss power at time T, is the charging power of the energy storage device at time T, is the power obtained from the external grid at time T, is the power generated by the diesel generator at time T, is the power generation capacity of the wind power generation equipment at time T, is the power generation of the photovoltaic power generation equipment at time T, is the power generation of the micro gas turbine at time T, is the power generation of the fuel cell at time T, is the power generated by the DC power supply at time T.
[0037] The generator capacity constraint is: Diesel generator: Micro gas turbine: Fuel Cell: in, is the lower limit of the power generation capacity of the diesel generator, is the upper limit of the diesel generator power generation capacity, is the lower limit of power generation of micro gas turbine, is the upper limit of the power generation capacity of the micro gas turbine, is the lower limit of the power generation of the fuel cell, Here, since the response of the power generation equipment to fully restart is slow, a lower limit of power generation is set to ensure that each power generation equipment can respond quickly when needed.
[0038] The consumer load constraint is: Cutting load: Transferable load: in, is the load reduction amount for consumer z at time T, that is, limiting some unnecessary loads of consumer z, is the maximum allowable value of the load cutting amount for consumer z at time T, is the load transfer amount to consumer z at time T, that is, part of the transferable load of consumer z is transferred to other power grids, is the maximum allowable value of the load transfer amount to consumer z at time T. The maximum allowable value of the load cutting amount and the maximum allowable value of the load transfer amount can also be obtained by judging according to the prediction results of the LSTM network.
[0039] The energy storage charging and discharging constraints are: Charging constraints: Discharge constraints: in, is the charging power of the energy storage battery at time T, is the discharge power of the energy storage battery at time T. In this embodiment, the energy storage battery includes a fuel cell and a storage battery.
[0040] S4: obtaining an energy output management value according to the constraint condition, constructing an energy output management matrix through the energy output management value, calculating the fitness of the energy output management matrix according to the objective function to obtain a fitness matrix, and selecting a first energy output management value and a second energy output management value from the fitness matrix; Furthermore, the purpose of this stage is to obtain a fitness matrix and select a first energy output management value and a second energy output management value for subsequent random search. Specifically, step S4 specifically includes: S41: obtaining a maximum output value and a minimum output value, and performing randomization by the maximum output value and the minimum output value under the constraint condition to obtain the energy output management value; S42: obtaining the energy output management matrix through the energy output management value, fine-tuning the energy output management matrix according to the weather forecast result, and calculating the fitness of the energy output management matrix according to the objective function to obtain the fitness matrix; S43: selecting the energy output management value with the highest fitness in the fitness matrix as the first energy output management value, and selecting the energy output management value with the second highest fitness as the second energy output management value.
[0041] With respect to the above steps, the specific implementation methods in this embodiment are as follows: First, take the maximum and minimum values of all the values of the energy output management scheme, so as to obtain the maximum output value respectively. and output minimum Then, under the constraints, the maximum and minimum output values are randomized to obtain the Nth energy output management value. : Each energy output management value represents an energy output management scheme, where Rand() represents taking a random value of the vector in the brackets, and discarding the energy output management values that do not meet the constraints. After obtaining multiple energy output management values, the energy output management matrix Prey can be obtained: Wherein, D is the number of variables included in each energy output management value, including wind power equipment power generation, diesel engine power generation, load cutting amount, load transfer amount, energy storage battery charging power and discharge power, etc., which are determined according to the equipment conditions and internal conditions of the microgrid; N is the number of energy output management values, That is, it represents the Dth variable in the Nth energy output management value, and each row in the energy output management matrix is an energy output management value. Here, the variables in the energy output management value can be fine-tuned according to the weather forecast results. For example, when the weather forecast results predict that the temperature is low, the diesel engine power generation and battery power generation can be appropriately reduced, and the micro gas turbine power generation and fuel cell power generation can be correspondingly increased. When the weather is warm, the opposite is true, so that the energy output management value can better adapt to changes in weather conditions.
[0042] Next, calculate the fitness of each row in the energy output management matrix to obtain the fitness matrix : Among them, F() is the fitness calculation function, which is used to take the minimum value of the objective function as the starting point, calculate the fitness of each row in the energy output management matrix according to the objective function, and take the energy output management values with the highest and second highest fitness in the fitness matrix as the first energy output management value and the second energy output management value. It should be noted that the first energy output management value and the second energy output management value obtained at this time may have local optimal problems, so they cannot be used directly, and after calculating the fitness, each energy output management value in the fitness matrix still retains the values of its various variables. At this time, the fitness matrix can be regarded as a multidimensional space. In addition to the value of the fitness, each energy output management value has a position vector determined by the value of each variable inside itself in the multidimensional space. The dimension of the multidimensional space is equal to the number of variables in the energy output management value.
[0043] When the prediction results of the LSTM network show that the power of new energy power generation equipment will fluctuate sharply during the energy output management process, for example, when the weather forecast results show that weather changes will cause a sudden change in photovoltaic output, or a sharp change in grid load, an emergency response strategy will be triggered, including backup energy charging and discharging, large-scale energy injection from the external grid, etc., which will cause the energy output management value to change. Therefore, at this time, the energy output management value and its position vector need to be adaptively adjusted to make it conform to the actual situation.
[0044] S5: The first energy output management value and the second energy output management value are randomly searched in the fitness matrix, and the relative distance between the first energy output management value and the second energy output management value is determined until the relative distance is lower than the distance threshold, and the target energy output management value is determined by the relative distance, and the target energy output management value is iterated to obtain the control energy output management value; Furthermore, the purpose of this stage is to perform random search through the Levy flight strategy to determine the target energy output management value, and iterate the target energy output management value to obtain the control energy output management value. Specifically, step S5 specifically includes: S51: In the fitness matrix, the first energy output management value and the second energy output management value are randomly searched by using the Levy flight strategy; S52: Obtaining the relative position of the first energy output management value and the second energy output management value, obtaining a relative distance through the relative position, obtaining a distance threshold, and selecting the target energy output management value through the relative distance when the relative distance is less than the distance threshold; S53: reducing the size of the fitness matrix, reducing the distance threshold, iterating the target energy output management value, and obtaining the controlled energy output management value.
[0045] With respect to the above steps, the specific implementation methods in this embodiment are as follows: First, the position vectors of the first energy output management value and the second energy output management value are obtained and the distance between the first energy output management value and the second energy output management value is determined by the position vector. Then, the first energy output management value and the second energy output management value are randomly searched from their respective positions in the multidimensional space formed by the fitness matrix through the Levy flight strategy to avoid falling into the local optimal trap. Here, the random search route of the Levy flight strategy is determined by the fitness function Decide: in, is an auxiliary function, the empirical coefficient is a constant determined empirically, the first random number and the second random number The value is A random number between Represents the gamma function taking the value in the brackets.
[0046] The Levy flight strategy obeys the heavy-tailed distribution. In the heavy-tailed distribution, the probability of relatively large values appearing is high. In this way, the first energy output management value and the second energy output management value will search in the direction of the concentration of values with larger fitness during the random search process. The first energy output management value and the second energy output management value continue to perform random searches and confirm their relative positions in the multidimensional space. When the distance between the two obtained by the relative position, that is, the relative distance, is less than the distance threshold determined by experience, it means that at this time, there is a target energy output management value in the range of the circle with the midpoint of the line connecting the two as the center and the length of the line as the diameter. The fitness of all energy output management values in the range is compared, and the energy output management value with the highest fitness is used as the target energy output management value.
[0047] Finally, based on the target energy output management value, the values of each variable are adjusted slightly to obtain the energy output management value again and construct the energy output management matrix, reducing the size of the multidimensional space, that is, reducing the number of energy output management values, reducing the distance threshold, and repeating the steps from generating the energy output management value to obtaining the target energy output management value, thereby realizing the iteration of the target energy output management value until the preset iteration number threshold is reached or the fitness change of the target energy output management value caused by the iteration is less than the set fitness change threshold, and the target energy output management value at this time is used as the control energy output management value. Here, reducing the size of the multidimensional space means reducing the number of energy output management values, so that the number of rows of the energy output management matrix and the fitness matrix is reduced, thereby achieving the effect of reducing the size of the multidimensional space.
[0048] S6: Performing energy output management on the microgrid system by controlling the energy output management value to complete the control of the microgrid system.
[0049] Furthermore, in this stage, the energy output of the microgrid system is managed by controlling the energy output management value, thereby completing the control of the microgrid system.
[0050] The present invention combines LSTM network and multi-objective optimization method to predict the load of the microgrid system, and then performs multi-objective optimization on the energy output management process of the microgrid system according to the prediction results, thereby ensuring that the microgrid system meets the needs of the external power grid while minimizing the operating cost of the microgrid system.
[0051] The joint optimization device of the microgrid system provided by the present invention is described below. The joint optimization device of the microgrid system described below and the joint optimization method of the microgrid system described above can be referred to each other.
[0052] Figure 2 It is a structural diagram of the joint optimization system of the microgrid system. Figure 2 As shown, the joint optimization method for executing the microgrid system as described above includes: The feature matrix module 100 is used to select a target power grid, obtain historical data through the target power grid, and construct a feature matrix through the historical data; Prediction result module 200: used to preprocess the feature matrix, obtain the LSTM network, input the preprocessed feature matrix into the LSTM network, and obtain the prediction results including the weather prediction results and the power grid load prediction results; Objective function module 300: used to select a microgrid system, construct an objective function for energy output management of the microgrid system, and construct constraint conditions through the prediction results; Fitness matrix module 400: used to obtain the energy output management value according to the constraint condition, construct the energy output management matrix through the energy output management value, calculate the fitness of the energy output management matrix according to the objective function, obtain the fitness matrix, and select the first energy output management value and the second energy output management value from the fitness matrix; The energy output management value control module 500 is used to randomly search the first energy output management value and the second energy output management value in the fitness matrix, and determine the relative distance between the first energy output management value and the second energy output management value until the relative distance is lower than the distance threshold, determine the target energy output management value by the relative distance, iterate the target energy output management value, and obtain the energy output management value; Microgrid system control module 600: used to manage the energy output of the microgrid system by controlling the energy output management value, and complete the control of the microgrid system.
[0053] on the other hand, Figure 3 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 3 As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other through the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute the joint optimization method of the microgrid system, and the method includes: S1: Select the target power grid, obtain historical data through the target power grid, and construct a feature matrix through the historical data; S2: preprocess the feature matrix, obtain the LSTM network, input the preprocessed feature matrix into the LSTM network, and obtain the prediction results including weather prediction results and power grid load prediction results; S3: Select a microgrid system, construct an objective function for energy output management of the microgrid system, and construct constraint conditions based on the prediction results; S4: obtaining an energy output management value according to the constraint condition, constructing an energy output management matrix through the energy output management value, calculating the fitness of the energy output management matrix according to the objective function to obtain a fitness matrix, and selecting a first energy output management value and a second energy output management value from the fitness matrix; S5: The first energy output management value and the second energy output management value are randomly searched in the fitness matrix, and the relative distance between the first energy output management value and the second energy output management value is determined until the relative distance is lower than the distance threshold, and the target energy output management value is determined by the relative distance, and the target energy output management value is iterated to obtain the control energy output management value; S6: Performing energy output management on the microgrid system by controlling the energy output management value to complete the control of the microgrid system.
[0054] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0055] On the other hand, the present invention further provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer, the computer can execute the joint optimization method of the microgrid system provided by the above methods, the method comprising: S1: Select the target power grid, obtain historical data through the target power grid, and construct a feature matrix through the historical data; S2: preprocessing the feature matrix, obtaining the LSTM network, inputting the preprocessed feature matrix into the LSTM network, and obtaining the prediction results including the weather prediction results and the power grid load prediction results; S3: Select a microgrid system, construct an objective function for energy output management of the microgrid system, and construct constraint conditions based on the prediction results; S4: obtaining an energy output management value according to the constraint condition, constructing an energy output management matrix through the energy output management value, calculating the fitness of the energy output management matrix according to the objective function to obtain a fitness matrix, and selecting a first energy output management value and a second energy output management value from the fitness matrix; S5: The first energy output management value and the second energy output management value are randomly searched in the fitness matrix, and the relative distance between the first energy output management value and the second energy output management value is determined until the relative distance is lower than the distance threshold, and the target energy output management value is determined by the relative distance, and the target energy output management value is iterated to obtain the control energy output management value; S6: Performing energy output management on the microgrid system by controlling the energy output management value to complete the control of the microgrid system.
[0056] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the joint optimization method of the microgrid system provided by the above methods, the method comprising: S1: Select the target power grid, obtain historical data through the target power grid, and construct a feature matrix through the historical data; S2: preprocess the feature matrix, obtain the LSTM network, input the preprocessed feature matrix into the LSTM network, and obtain the prediction results including weather prediction results and power grid load prediction results; S3: Select a microgrid system, construct an objective function for energy output management of the microgrid system, and construct constraint conditions based on the prediction results; S4: obtaining an energy output management value according to the constraint condition, constructing an energy output management matrix through the energy output management value, calculating the fitness of the energy output management matrix according to the objective function to obtain a fitness matrix, and selecting a first energy output management value and a second energy output management value from the fitness matrix; S5: The first energy output management value and the second energy output management value are randomly searched in the fitness matrix, and the relative distance between the first energy output management value and the second energy output management value is determined until the relative distance is lower than the distance threshold, and the target energy output management value is determined by the relative distance, and the target energy output management value is iterated to obtain the control energy output management value; S6: Performing energy output management on the microgrid system by controlling the energy output management value to complete the control of the microgrid system.
[0057] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0058] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0059] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A joint optimization method for a microgrid system, characterized in that: include: S1: Select the target power grid, obtain historical data through the target power grid, and construct a feature matrix through the historical data; S2: preprocess the feature matrix, obtain the LSTM network, input the preprocessed feature matrix into the LSTM network, and obtain the prediction results including weather prediction results and power grid load prediction results; S3: Select a microgrid system, construct an objective function for energy output management of the microgrid system, and construct constraint conditions based on the prediction results; S4: obtaining an energy output management value according to the constraint condition, constructing an energy output management matrix through the energy output management value, calculating the fitness of the energy output management matrix according to the objective function to obtain a fitness matrix, and selecting a first energy output management value and a second energy output management value from the fitness matrix; S5: The first energy output management value and the second energy output management value are randomly searched in the fitness matrix, and the relative distance between the first energy output management value and the second energy output management value is determined until the relative distance is lower than the distance threshold, and the target energy output management value is determined by the relative distance, and the target energy output management value is iterated to obtain the control energy output management value; S6: Performing energy output management on the microgrid system by controlling the energy output management value to complete the control of the microgrid system.
2. The joint optimization method of the microgrid system according to claim 1, characterized in that: Step S1 specifically includes: S11: Select a target power grid, obtain historical data including power grid load historical data and weather data of the target power grid, and perform special time marking on special moments in the power grid load historical data and the weather data; S12: splicing the power grid load historical data and the weather data after special time marking to obtain the feature matrix.
3. The joint optimization method of the microgrid system according to claim 1, characterized in that: In step S2, the preprocessing includes data cleaning, normalization and feature extraction, and the LSTM network includes a forget gate, an input gate and an output gate.
4. The joint optimization method of the microgrid system according to claim 1, characterized in that: In step S2, after the grid load forecast result is obtained, the grid load forecast result will be specially time-marked according to the weather forecast result, and the value of the grid load forecast result with the special time mark will be increased.
5. The joint optimization method of the microgrid system according to claim 1, characterized in that: Step S4 specifically includes: S41: obtaining a maximum output value and a minimum output value, and performing randomization by the maximum output value and the minimum output value under the constraint condition to obtain the energy output management value; S42: obtaining the energy output management matrix through the energy output management value, fine-tuning the energy output management matrix according to the weather forecast result, and calculating the fitness of the energy output management matrix according to the objective function to obtain the fitness matrix; S43: selecting the energy output management value with the highest fitness in the fitness matrix as the first energy output management value, and selecting the energy output management value with the second highest fitness as the second energy output management value.
6. The joint optimization method of the microgrid system according to claim 1, characterized in that: Step S5 specifically includes: S51: In the fitness matrix, the first energy output management value and the second energy output management value are randomly searched by using the Levy flight strategy; S52: Obtaining the relative position of the first energy output management value and the second energy output management value, obtaining a relative distance through the relative position, obtaining a distance threshold, and selecting the target energy output management value through the relative distance when the relative distance is less than the distance threshold; S53: reducing the size of the fitness matrix, reducing the distance threshold, iterating the target energy output management value, and obtaining the controlled energy output management value.
7. A joint optimization system for a microgrid system, used to execute the joint optimization method for a microgrid system according to any one of claims 1 to 6, characterized in that: include: Feature matrix module: used to select the target power grid, obtain historical data through the target power grid, and construct a feature matrix based on the historical data; Prediction result module: used to preprocess the feature matrix, obtain the LSTM network, input the preprocessed feature matrix into the LSTM network, and obtain the prediction results including weather forecast results and power grid load forecast results; Objective function module: used to select a microgrid system, construct an objective function for energy output management of the microgrid system, and construct constraint conditions through the prediction results; Fitness matrix module: used to obtain the energy output management value according to the constraint conditions, construct the energy output management matrix through the energy output management value, calculate the fitness of the energy output management matrix according to the objective function, obtain the fitness matrix, and select the first energy output management value and the second energy output management value from the fitness matrix; Control energy output management value module: used for randomly searching the first energy output management value and the second energy output management value in the fitness matrix, and determining the relative distance between the first energy output management value and the second energy output management value until the relative distance is lower than the distance threshold, determining the target energy output management value by the relative distance, iterating the target energy output management value, and obtaining the control energy output management value; Microgrid system control module: used to manage the energy output of the microgrid system by controlling the energy output management value, and complete the control of the microgrid system.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the joint optimization method of the microgrid system as described in any one of claims 1 to 6 are implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the joint optimization method for a microgrid system as claimed in any one of claims 1 to 6 are implemented.
10. A computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, characterized in that: When the program instructions are executed by a computer, the computer can perform the steps of the joint optimization method for a microgrid system as claimed in any one of claims 1 to 6.
Citation Information
Patent Citations
Energy management control method and device for source network load storage optimization operation
CN118899831A