Fused salt heat storage system frequency modulation instruction prediction method and system based on machine learning
By analyzing the error and correlation coefficient of the decision tree count, determining the optimal number of decision trees, and using a random forest algorithm to predict the frequency modulation instruction of the molten salt heat storage system, the prediction accuracy and calculation amount problems caused by improper selection of the decision tree count are solved, and efficient grid frequency modulation is achieved.
Patent Information
- Application Number
- CN202510884713.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2045-06-30
AI Technical Summary
Inappropriate selection of decision trees in existing random forest algorithms leads to poor accuracy of frequency modulation instruction prediction results and large amount of calculation, which cannot effectively balance the grid stability and calculation efficiency.
By constructing several decision trees, analyzing the errors and correlation coefficients under different decision trees, determining the optimal number of decision trees, and using a random forest algorithm to predict the frequency modulation instruction signal data.
It improves the accuracy of frequency modulation command prediction, reduces the calculation amount, and improves the stability and operational efficiency of the power grid.
Smart Images

Figure CN120387034A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power grid frequency modulation, and particularly to a method and system for predicting frequency modulation commands of a molten salt thermal energy storage system based on machine learning. Background Art
[0002] The molten salt thermal energy storage system combines molten salt energy storage technology with the peak shaving and frequency modulation functions of the power system, can balance the supply and demand fluctuations of energy, and improve the stability of the power grid. The molten salt thermal energy storage system is mainly used to store excess electric energy and release the stored energy during peak demand, thereby balancing the load fluctuations of the power grid. Molten salt thermal energy storage stores thermal energy by heating molten salt; when needed, the molten salt can release thermal energy to drive thermoelectric conversion devices (such as steam turbines, combined heat and power, etc.) to generate electricity.
[0003] To ensure the stability and reliability of the power grid, solve problems such as power grid load and power generation fluctuations, unstable renewable energy power generation, and frequency fluctuations. By predicting the frequency modulation command signal, the generator output and energy storage system can be adjusted in advance to avoid frequency anomalies, system overloads, and large-scale power outages, thereby improving the stability of the power grid, reducing operating costs, and enhancing the power grid's ability to respond to emergencies.
[0004] When predicting the frequency modulation command signal using existing methods, a decision tree can be constructed through the random forest algorithm for prediction. However, in the conventional prediction process, the number of decision trees is randomly determined manually, and the number of decision trees also has a certain degree of influence on the prediction process; when the number of decision trees is small, the accuracy of the predicted result is poor, and when the number of decision trees is large, although the accuracy of the prediction result can be improved, due to the large number of decision trees, the computational amount and memory overhead will increase during the prediction process, reducing the operation efficiency. Summary of the Invention
[0005] The present invention provides a method and system for predicting frequency modulation commands of a molten salt thermal energy storage system based on machine learning, which is used to solve the problem of the number selection of decision trees in the existing random forest algorithm.
[0006] The object of the present invention can be achieved by the following technical solutions: The first aspect of the present invention is to provide a method for predicting frequency modulation commands of a molten salt thermal energy storage system based on machine learning, including: Continuously obtain frequency modulation command signal data and various characteristic data affecting the stability of the power system at several moments; obtain several sample data points through the frequency modulation command signal data and various characteristic data at several moments; Sort a number of sample data points by time to obtain a data point sequence; divide the data point sequence into a front data point sequence and a back data point sequence; form a sequence of the frequency modulation command signal data corresponding to all data points in the back data point sequence into a group sequence, denoted as the back command signal data sequence; randomly select data points from the front data point sequence with replacement to obtain a number of data sets; where each data set contains a number of data points; construct a number of decision trees through the number of data sets; predict the command signal data through the number of decision trees to obtain a number of predicted command signal data sequences, and obtain the errors under different numbers of decision trees through the differences between the number of predicted command signal data sequences and the back command signal data sequence; obtain the error trend change factors under different numbers of decision trees through the errors under different numbers of decision trees; Pairwise match the predicted command signal data sequences corresponding to all decision trees under different numbers of decision trees to obtain a number of sequence combinations; obtain the increasing degree of the number of decision trees under different numbers of decision trees according to the correlation coefficients between two predicted command signal data sequences in all sequence combinations under different numbers of decision trees; obtain the decision tree number increasing factor under different numbers of decision trees through the increasing degree of the number of decision trees and the error trend change factor; obtain the optimal number of decision trees through the decision tree number increasing factor; Predict the frequency modulation command signal data according to the optimal number of decision trees by the random forest algorithm.
[0007] Further, obtaining a number of sample data points through the frequency modulation command signal data and various characteristic data at a number of moments includes: Form each moment's data of all dimensions into a sample data point, then a number of sample data points are obtained; where all dimensions include all characteristic data and frequency modulation command signal data.
[0008] Further, dividing the data point sequence into a front data point sequence and a back data point sequence includes: Form the first data points in the data point sequence into a sequence, denoted as the front data point sequence; form the last data points in the data point sequence into a sequence, denoted as the back data point sequence; where, is a preset division percentage factor.
[0009] Further, data points are selected from the previous data point sequence with replacement to obtain a number of data sets; wherein each data set contains a number of data points; a number of decision trees are constructed through the number of data sets; the instruction signal data is predicted through the number of decision trees to obtain a number of predicted instruction signal data sequences, and the error under different numbers of decision trees is obtained through the difference between the number of predicted instruction signal data sequences and the subsequent instruction signal data sequence, including: Step 1: Select in a way of replacement from the previous data point sequence times, and each time select data points to form a decision tree, obtaining decision trees; predict the frequency modulation instruction signal data through each decision tree to obtain a predicted instruction signal data sequence; predict respectively for decision trees in turn to obtain predicted instruction signal data sequences; then jump to Step 2; Step 2: Take the mean of the data at the corresponding positions in predicted instruction signal data sequences to form a new data sequence, denoted as the th mean prediction signal data sequence; calculate the error between the th mean prediction signal data sequence and the subsequent instruction signal data sequence through MAPE, denoted as the th error; then jump to Step 3; Step 3: Add 1 to , and then jump to Step 1; Obtain the error under different numbers of decision trees through the above steps; wherein, represents the loop parameter in the iterative traversal process.
[0010] Further, obtaining the error trend change factor under different numbers of decision trees through the error under different numbers of decision trees includes: Construct a reference coordinate system with the number of decision trees as the horizontal axis and the error corresponding to the number of decision trees as the vertical axis; map the errors under different numbers of decision trees in the reference coordinate system to obtain a number of reference data points;
[0011] In the formula, represents the slope between two reference data points corresponding to when the number of decision trees is and when the number of decision trees is , represents the slope between two reference data points corresponding to when the number of decision trees is and when the number of decision trees is , represents the absolute value symbol, Indicates the error trend change factor when the number of decision trees is .
[0012] Further, obtaining the degree of increase in the number of decision trees under different numbers of decision trees according to the correlation coefficient between two predicted instruction signal data sequences in all sequence combinations under different numbers of decision trees includes:
[0013] In the formula, Indicates the correlation coefficient between two predicted instruction signal data sequences in the th sequence combination when the number of decision trees is , Indicates the total number of all sequence combinations when the number of decision trees is , Indicates the degree of increase in the number of decision trees when the number of decision trees is , Indicates the exponential function with the natural constant as the base.
[0014] Further, obtaining the decision tree number increase factor under different numbers of decision trees through the degree of increase in the number of decision trees and the error trend change factor; obtaining the optimal number of decision trees through the decision tree number increase factor includes: Among them, the decision tree number increase factor is specifically expressed by the formula:
[0015] In the formula, Indicates the error trend change factor when the number of decision trees is , Indicates the degree of increase in the number of decision trees when the number of decision trees is , Indicates the decision tree number increase factor when the number of decision trees is , Indicates the linear normalization function; Start traversing and iterating from when the number of decision trees is 2, and judge the decision tree number increase factor when the number of decision trees is 2 and the decision tree number increase factor when the number of decision trees is 3. When , stop the iteration and take 2 as the optimal number of decision trees; when , then continue to judge the size relationship between the decision tree number increase factor when the number of decision trees is 3 and the decision tree number increase factor when the number of decision trees is 4; When , the iteration stops, and 3 is taken as the optimal number of decision trees; when , continue with the decision tree quantity increase factor when the number of decision trees is 4 and the decision tree quantity increase factor when the number of decision trees is 5 for the magnitude relationship; And so on until an optimal number of decision trees is obtained and the process stops.
[0016] The second aspect of the present invention is to provide a frequency modulation command prediction system for a molten salt thermal energy storage system based on machine learning, including: Data acquisition module: used to continuously obtain frequency modulation command signal data and various characteristic data affecting the stability of the power system at several moments; through the frequency modulation command signal data and various characteristic data at several moments, several sample data points are obtained; Error analysis module: used to sort several sample data points according to time to obtain a data point sequence; divide the data point sequence into a front data point sequence and a back data point sequence; form a group of sequences with the frequency modulation command signal data corresponding to all data points in the back data point sequence, denoted as the back command signal data sequence; randomly select data points from the front data point sequence with replacement to obtain several data sets; where each data set contains several data points; construct several decision trees through several data sets; predict the command signal data through several decision trees to obtain several predicted command signal data sequences, and obtain the errors under different numbers of decision trees through the differences between several predicted command signal data sequences and the back command signal data sequence; obtain the error trend change factor under different numbers of decision trees through the errors under different numbers of decision trees; Optimal number determination module: used to pairwise match the predicted command signal data sequences corresponding to all decision trees under different numbers of decision trees to obtain several sequence combinations; obtain the degree of increase in the number of decision trees under different numbers of decision trees according to the correlation coefficients between two predicted command signal data sequences in all sequence combinations under different numbers of decision trees; obtain the decision tree quantity increase factor under different numbers of decision trees through the degree of increase in the number of decision trees and the error trend change factor; obtain the optimal number of decision trees through the decision tree quantity increase factor; Prediction module: used to predict the frequency modulation command signal data through the random forest algorithm according to the optimal number of decision trees.
[0017] The third aspect of the present invention is to provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, it implements the method for predicting frequency modulation commands of a molten salt thermal energy storage system based on machine learning.
[0018] The fourth aspect of the present invention is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method for predicting frequency modulation command of a molten salt thermal energy storage system based on machine learning.
[0019] Compared with the prior art, the beneficial effects of the present invention are as follows: several decision trees are constructed through several data sets; the instruction signal data is predicted through several decision trees to obtain several predicted instruction signal data sequences, and the errors under different numbers of decision trees are obtained through the differences between the several predicted instruction signal data sequences and the subsequent instruction signal data sequences; the error trend change factors under different numbers of decision trees are obtained through the errors under different numbers of decision trees, and the accuracy of analyzing the number of decision trees is improved through the error trend change under different numbers of decision trees; all the predicted instruction signal data sequences corresponding to the decision trees under different numbers of decision trees are pairwise matched to obtain several sequence combinations; the increase degree of the number of decision trees under different numbers of decision trees is obtained according to the correlation coefficients between two predicted instruction signal data sequences in all the sequence combinations under different numbers of decision trees; the decision tree number increase factor under different numbers of decision trees is obtained through the increase degree of the number of decision trees and the error trend change factor; the optimal number of decision trees is obtained through the decision tree number increase factor, and the accuracy of analyzing the randomness of different decision trees is improved; according to the optimal number of decision trees, the frequency modulation command signal data is predicted through the random forest algorithm, which improves the accuracy of frequency modulation command prediction and reduces the calculation amount. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0021] Figure 1 It is a schematic flowchart of the steps of the method for predicting frequency modulation command of a molten salt thermal energy storage system based on machine learning provided by the present invention; Figure 2 It is a schematic module flowchart of the system for predicting frequency modulation command of a molten salt thermal energy storage system based on machine learning provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0022] To enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0023] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0024] In view of the problems existing in the background technology, it is of great practical significance to research and design a frequency modulation command prediction method and system for a molten salt energy storage system based on machine learning.
[0025] As Figure 1 shown, the first aspect of the present invention is to provide a frequency modulation command prediction method for a molten salt energy storage system based on machine learning, including the following steps: Step S001: Continuously collect frequency modulation command signal data and various characteristic data affecting the stability of the power system at several moments.
[0026] It should be noted that when there is a deviation in the power supply and demand balance (such as load changes, power generation fluctuations, etc.). The dispatching center or automation system of the power system generates a frequency modulation command according to the frequency fluctuation situation, load demand and power generation situation of the system, and maintains frequency stability through the frequency modulation command, which can respond to emergencies and reduce the possibility of failures.
[0027] Further, it should be noted that during the normal power generation process of the power system, the power system is vulnerable to interference from the environment, weather, etc., and its stability is poor when the power system is interfered; when the power system is interfered, in order to maintain the stability of the system, the molten salt thermal energy storage system will perform frequency modulation and peak shaving to maintain the stability of the power system; therefore, the frequencies in the command signal data corresponding to different environmental conditions are different, so the frequency in the command signal data can be determined by the environmental and weather data, and thus all types of data related to the frequency in the command signal data need to be collected.
[0028] Specifically, at a preset time interval to obtain the frequency modulation command signal data and various characteristic data of all moments of the power system dispatching center for a preset duration hours before the current moment; among them, various characteristic data include humidity, temperature, wind speed, and load, etc.
[0029] Combining the data of all dimensions at each moment into a sample data point, several sample data points can be obtained; among them, all dimensions include all characteristic data and frequency modulation command signal data.
[0030] Among them, in this embodiment, the preset duration wherein, in this embodiment, the preset duration is not specifically limited, and the implementer can determine it according to the specific situation. Among them, in this embodiment, the preset time interval seconds, wherein the preset time interval is not specifically limited, and the implementer can determine it according to the specific situation.
[0031] So far, several sample data points are obtained.
[0032] Step S002: Obtain a data point sequence, divide it into a front data point sequence and a back data point sequence; obtain a back command signal data sequence; randomly select data points from the front data point sequence with replacement to obtain several decision trees; predict the command signal data through the several decision trees to obtain several predicted command signal data sequences, and obtain the errors under different numbers of decision trees through the differences between the several predicted command signal data sequences and the back command signal data sequence; obtain the error trend change factors under different numbers of decision trees through the errors under different numbers of decision trees.
[0033] It should be noted that in order to determine the prediction accuracy of each constructed decision tree and the number of decision trees in the random forest, an error analysis method is used to determine the optimal number of decision trees.
[0034] It should be further noted that since a small number of decision trees have a poor prediction effect on signal instructions when constructing a decision tree, the number of the best decision trees is iteratively analyzed from less to more.
[0035] Specifically, a number of sample data points are sorted in chronological order to form a sequence, denoted as the data point sequence; the first sample data points in the data point sequence are formed into a sequence, denoted as the front data point sequence; the last sample data points in the data point sequence are formed into a sequence, denoted as the back data point sequence; all the frequency modulation instruction signal data corresponding to the sample data points in the back data point sequence are formed into a sequence, denoted as the back instruction signal data sequence. Wherein, is a preset division percentage factor.
[0036] Wherein, in this embodiment, the preset division percentage factor , and in this embodiment, the preset division percentage factor is not specifically limited, and the implementer can determine it according to the specific situation.
[0037] Wherein, the steps for obtaining the errors under different numbers of decision trees are as follows: Step 1: Select times with replacement from the front data point sequence, and each time select data points to form a decision tree, obtaining decision trees; predict the frequency modulation instruction signal data through each decision tree to obtain a predicted instruction signal data sequence; predict each of the decision trees in turn to obtain predicted instruction signal data sequences; then jump to Step 2; Step 2: The means of the data at the corresponding positions in the predicted instruction signal data sequences are formed into a new data sequence, denoted as the th mean predicted signal data sequence; through MAPE, calculate the error between the th mean predicted signal data sequence and the back instruction signal data sequence, denoted as the th error; then jump to Step 3; Step 3: Add 1 to , and then jump to Step 1; The errors under different numbers of decision trees are obtained through the above steps; wherein, represents the loop parameter in the iterative traversal process.
[0038] Wherein, the detailed process for obtaining the errors under different numbers of decision trees is: Select with replacement from the front data point sequence the preset parameter A number of data points form the first data set. A decision tree in the random forest is constructed through the first data set, denoted as the first decision tree. The predicted frequency modulation command signal data is used to form a sequence in chronological order, denoted as the first predicted command signal data sequence. The error between the first predicted command signal data sequence and the subsequent command signal data sequence is calculated through MAPE (Mean Absolute Percentage Error), denoted as the first error. ; Take the first error as the error corresponding to the case where the number of decision trees is 1. Continue to randomly select a preset number of data points from the previous data point sequence with replacement to form the second data set. A decision tree in the random forest is constructed through the second data set, denoted as the second decision tree. The predicted frequency modulation command signal data is used to form a sequence in chronological order, denoted as the second predicted command signal data sequence. The mean values of the corresponding position data in the first predicted command signal data sequence and the second predicted command signal data sequence are used to form a new data sequence, denoted as the second mean predicted signal data sequence. The error between the second mean predicted signal data sequence and the subsequent command signal data sequence is calculated through MAPE, denoted as the second error. ; Take the second error as the error corresponding to the case where the number of decision trees is 2. Continue to randomly select a preset number of data points from the previous data point sequence with replacement to form the third data set. A decision tree in the random forest is constructed through the third data set, denoted as the third decision tree. The predicted frequency modulation command signal data is used to form a sequence in chronological order, denoted as the third predicted command signal data sequence. The mean values of the corresponding position data in the first predicted command signal data sequence, the second predicted command signal data sequence, and the third predicted command signal data sequence are used to form a new data sequence, denoted as the third mean predicted signal data sequence. The error between the third mean predicted signal data sequence and the subsequent command signal data sequence is calculated through MAPE, denoted as the third error. ; Take the third error as the error corresponding to the case where the number of decision trees is 3. And so on, obtaining the errors under different numbers of decision trees in sequence.
[0039] Among them, in this embodiment, the preset parameter , where in this embodiment, the preset parameters are not specifically limited, and the implementer can determine according to the specific situation. Among them, MAPE is a well-known technology and will not be specifically described here. Among them, the number of data for each prediction by each decision tree is the same as the number of data in the post-instruction signal data sequence. Among them, in this embodiment, the maximum number of decision trees in the iterative loop traversal process is 500 decision trees, but in this embodiment, the maximum number of decision trees is not specifically limited, and the implementer can determine according to the specific situation.
[0040] It should be noted that in the process of determining the decision tree, a smaller number of decision trees corresponds to a poorer prediction result of the instruction signal. Therefore, in order to improve the prediction performance of the decision tree, it is necessary to increase the number of decision trees; in the process of increasing the number of decision trees, its prediction performance gradually improves. When it reaches a certain level, increasing the number of decision trees may not improve the prediction effect or the improvement speed is slow. Therefore, at this time, there is no need to increase the number of decision trees. At this time, increasing the number of decision trees will only increase the computing amount of the computer and reduce the computing efficiency of the computer. That is, as the number of decision trees increases, the corresponding prediction error first decreases rapidly, and then after an inflection point, the reduction rate of the prediction error gradually decreases.
[0041] Specifically, taking the number of decision trees as the horizontal axis and the error corresponding to the number of decision trees as the vertical axis to construct a reference coordinate system; mapping the errors under different numbers of decision trees in the reference coordinate system to obtain several reference data points; calculating the slope difference between each data point and the adjacent two data points to obtain the error trend change factor under different numbers of decision trees; the error trend change factor is specifically expressed by the formula:
[0042] In the formula, represents the slope between two reference data points corresponding to when the number of decision trees is and when the number of decision trees is , represents the slope between two reference data points corresponding to when the number of decision trees is and when the number of decision trees is , represents the absolute value symbol, represents the error trend change factor when the number of decision trees is .
[0043] Among them, when the trend difference change factor is larger, the more necessary it is to increase the number of decision trees; when the trend difference change factor is smaller, the less necessary it is to increase the number of decision trees.
[0044] So far, the error trend change factors under different numbers of decision trees are obtained through the above method.
[0045] Step S003: Calculate the correlation between the prediction instruction signal data sequences corresponding to all decision trees under different numbers of decision trees, and obtain the increasing degree of the number of decision trees under different numbers of decision trees; based on the increasing degree of the number of decision trees and the error trend change factor, obtain the decision tree number increase factor under different numbers of decision trees; based on the decision tree number increase factor, obtain the optimal number of decision trees.
[0046] It should be noted that when making predictions through the random forest algorithm, multiple different decision trees are constructed. At this time, the greater the difference between all decision trees, the more it indicates the diversity in all data, which means that there is still a relatively large amount of data diversity. Therefore, continuing to increase the number of decision trees can still significantly improve the prediction performance.
[0047] Furthermore, it should be noted that when the difference between the prediction data of multiple decision trees is smaller, it indicates that the difference between the decision trees is smaller, which means that the data diversity has reached the saturation point. At this time, if we continue to randomly select data sets to construct decision trees, there may be similarities with the previously selected data sets. Therefore, when the difference between the prediction data of multiple decision trees is smaller, we should not increase the number of decision trees or increase only a small number of decision trees.
[0048] Specifically, pair - match the prediction instruction signal data sequences corresponding to all decision trees under different numbers of decision trees to obtain several sequence combinations; Based on the correlation coefficients between two prediction instruction signal data sequences in all sequence combinations under different numbers of decision trees, obtain the increasing degree of the number of decision trees under different numbers of decision trees; the increasing degree is specifically expressed by the formula:
[0049] In the formula, represents the correlation coefficient between two prediction instruction signal data sequences in the th sequence combination when the number of decision trees is ; represents the total number of all sequence combinations when the number of decision trees is ; represents the increasing degree of the number of decision trees when the number of decision trees is ; represents the exponential function with the natural constant as the base. Among them, in this embodiment, the correlation coefficient is the Pearson correlation coefficient, and the Pearson correlation coefficient is a well - known technology, so it will not be specifically described here.
[0050] Among them, when the number of decision trees is , the larger the Pearson correlation coefficient between the two predicted instruction signal data sequences in all sequence combinations, the more it indicates that the diversity of the data has reached saturation. At this time, increasing the number of decision trees will improve the performance of the prediction more slowly. In this case, increasing the number of decision trees will only increase the computational amount and will not improve the performance; while when the number of decision trees is , the smaller the Pearson correlation coefficient between the two predicted instruction signal data sequences in all sequence combinations, it indicates that the prediction results between the decision trees are quite different, meaning that the diversity between the decision trees is relatively high. In this case, adding more decision trees may further improve the performance because the new decision trees can bring more information and diversity and improve the performance of the model.
[0051] It should be noted that when the error trend change factor under different numbers of decision trees is getting larger and the increase degree of the number of decision trees under different numbers of decision trees is greater, it indicates that the number of decision trees should be increased more.
[0052] Specifically, through the increase degree of the number of decision trees and the error trend change factor, the increase factor of the number of decision trees under different numbers of decision trees is obtained; the increase factor of the number of decision trees is specifically expressed by the formula:
[0053] In the formula, represents the error trend change factor when the number of decision trees is , represents the increase degree of the number of decision trees when the number of decision trees is , represents the increase factor of the number of decision trees when the number of decision trees is , represents the linear normalization function.
[0054] Starting from when the number of decision trees is 2, iterate through and judge the increase factor of the number of decision trees when the number of decision trees is 2 and the increase factor of the number of decision trees when the number of decision trees is 3. When , stop the iteration and take 2 as the optimal number of decision trees; when , then continue to judge the relationship between the increase factor of the number of decision trees when the number of decision trees is 3 and the increase factor of the number of decision trees when the number of decision trees is 4; When , stop the iteration and take 3 as the optimal number of decision trees; when , then continue with the increase factor of the number of decision trees when the number of decision trees is 4 The relationship with the decision tree quantity increase factor when the number of decision trees is 5 ; And so on until the optimal number of decision trees is obtained and then stop; Thus, the optimal number of decision trees is obtained through the above method.
[0055] Step S004: According to the optimal number of decision trees, use the random forest algorithm to predict the frequency modulation command signal data.
[0056] According to the optimal number of decision trees, use the random forest algorithm to predict the frequency modulation command signal data, so as to improve the prediction accuracy and reduce the computational amount in the prediction process.
[0057] As Figure 2 shown, the second aspect of the present invention is to provide a frequency modulation command prediction system for a molten salt thermal energy storage system based on machine learning, including the following modules: Data acquisition module 101: used to continuously obtain the frequency modulation command signal data at several moments and various characteristic data affecting the stability of the power system; through the frequency modulation command signal data and various characteristic data at several moments, obtain several sample data points; Error analysis module 102: used to sort several sample data points according to time to obtain a data point sequence; divide the data point sequence into a front data point sequence and a rear data point sequence; form a group of sequences with the frequency modulation command signal data corresponding to all data points in the rear data point sequence, denoted as the rear command signal data sequence; randomly select data points from the front data point sequence with replacement to obtain several data sets; where each data set contains several data points; construct several decision trees through several data sets; use several decision trees to predict the command signal data to obtain several predicted command signal data sequences, and obtain the errors under different numbers of decision trees through the differences between several predicted command signal data sequences and the rear command signal data sequence; obtain the error trend change factor under different numbers of decision trees through the errors under different numbers of decision trees; Optimal number determination module 103: used to pairwise match the predicted command signal data sequences corresponding to all decision trees under different numbers of decision trees to obtain several sequence combinations; obtain the increase degree of the number of decision trees under different numbers of decision trees according to the correlation coefficient between two predicted command signal data sequences in all sequence combinations under different numbers of decision trees; obtain the decision tree quantity increase factor under different numbers of decision trees through the increase degree of the decision tree quantity and the error trend change factor; obtain the optimal number of decision trees through the decision tree quantity increase factor; Prediction module 104: used to predict the frequency modulation command signal data according to the optimal number of decision trees by using the random forest algorithm.
[0058] The third aspect of the present invention is to provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, a frequency modulation instruction prediction method for a molten salt thermal energy storage system based on machine learning is implemented.
[0059] The fourth aspect of the present invention is to provide a computer-readable storage medium storing a computer program, which when executed by a processor, implements a frequency modulation instruction prediction method for a molten salt thermal energy storage system based on machine learning.
[0060] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, optical storage, etc.) containing computer-usable program code.
[0061] The present invention is described with reference to the flowcharts and / or block diagrams of methods, systems, and computer program products according to the embodiments of the present invention. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, as well as the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the specified functions in Figure 1 one or more flows and / or blocks Figure 1 one or more blocks.
[0062] These computer program instructions can also be stored in a computer-readable memory capable of guiding a computer or other programmable data processing devices to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device implements the specified functions in Figure 1 one or more flows and / or blocks Figure 1 one or more blocks.
[0063] These computer program instructions can also be loaded onto a computer or other programmable data processing devices, such that a series of operation steps are executed on the computer or other programmable devices to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable devices provide for implementing the specified functions in Figure 1 one or more flows and / or blocksFigure 1 Steps of functions specified in one or more boxes.
[0064] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those of ordinary skill in the art should understand that: modifications or equivalent replacements can still be made to the specific implementation manners of the present invention, and any modifications or equivalent replacements that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the present invention.
Claims
1. A method for predicting frequency modulation commands of a molten salt thermal energy storage system based on machine learning, characterized in that, Including: Continuously obtaining frequency modulation command signal data at several moments and various characteristic data affecting the stability of the power system; Obtaining several sample data points through the frequency modulation command signal data and various characteristic data at several moments; Sorting the several sample data points according to time to obtain a data point sequence; dividing the data point sequence into a front data point sequence and a back data point sequence; forming a set of sequences with the frequency modulation command signal data corresponding to all data points in the back data point sequence, denoted as the back command signal data sequence; randomly selecting data points from the front data point sequence with replacement to obtain several data sets; where each data set contains several data points; constructing several decision trees through the several data sets; predicting command signal data through the several decision trees to obtain several predicted command signal data sequences; obtaining the errors under different numbers of decision trees through the differences between the several predicted command signal data sequences and the back command signal data sequence; obtaining the error trend change factors under different numbers of decision trees through the errors under different numbers of decision trees; Pairwise matching the predicted command signal data sequences corresponding to all decision trees under different numbers of decision trees to obtain several sequence combinations; obtaining the increasing degree of the number of decision trees under different numbers of decision trees according to the correlation coefficients between two predicted command signal data sequences in all sequence combinations under different numbers of decision trees; obtaining the decision tree number increase factor under different numbers of decision trees through the increasing degree of the number of decision trees and the error trend change factor; obtaining the optimal number of decision trees through the decision tree number increase factor; According to the optimal number of decision trees, predicting the frequency modulation command signal data through the random forest algorithm.
2. The method for predicting the frequency modulation instruction of the molten salt thermal energy storage system based on machine learning according to claim 1, wherein The obtaining of several sample data points through the frequency modulation command signal data and various characteristic data at several moments includes: Combining the data of all dimensions at each moment into a sample data point, then several sample data points are obtained; where all dimensions include all characteristic data and frequency modulation command signal data.
3. The method for predicting frequency modulation commands of a molten salt thermal energy storage system based on machine learning according to claim 1, wherein The dividing of the data point sequence into a front data point sequence and a back data point sequence includes: The first data points in the data point sequence are grouped into a sequence, denoted as the front data point sequence; the last data points in the data point sequence are grouped into a sequence, denoted as the back data point sequence; Among them, is a preset division percentage factor.
4. The method for predicting the frequency modulation instruction of the molten salt thermal energy storage system based on machine learning according to claim 1, wherein The randomly selecting data points from the front data point sequence with replacement to obtain several data sets; where each data set contains several data points; constructing several decision trees through the several data sets; predicting command signal data through the several decision trees to obtain several predicted command signal data sequences; obtaining the errors under different numbers of decision trees through the differences between the several predicted command signal data sequences and the back command signal data sequence includes: Step 1: Select times with replacement from the previous data point sequence. Each time, select data points to form a decision tree and obtain decision trees. Predict the frequency modulation command signal data through each decision tree to obtain a predicted command signal data sequence. Predict respectively for decision trees in turn to obtain predicted command signal data sequences. Then jump to Step 2; Step 2: Combine the means of the data at the corresponding positions in the predictive instruction signal data sequences to form a new data sequence, denoted as the mean predictive signal data sequence; Calculate the error between the mean predictive signal data sequence and the post-instruction signal data sequence through MAPE, denoted as the error; Then jump to Step 3; Step 3: Add 1 to and then jump to Step 1; Obtain the errors under different numbers of decision trees through the above steps; among them, represents the loop parameter during the iterative traversal process.
5. The method for predicting frequency modulation instructions of a molten salt thermal energy storage system based on machine learning according to claim 1, wherein The obtaining of the error trend change factors under different numbers of decision trees through the errors under different numbers of decision trees includes: Constructing a reference coordinate system with the number of decision trees as the horizontal axis and the error corresponding to the number of decision trees as the vertical axis; mapping the errors under different numbers of decision trees in the reference coordinate system to obtain several reference data points; In the formula, represents the slope between two reference data points corresponding to when the number of decision trees is and when the number of decision trees is ; represents the slope between two reference data points corresponding to when the number of decision trees is and when the number of decision trees is ; represents the absolute value symbol, represents the error trend change factor when the number of decision trees is .
6. The method for predicting the frequency modulation command of the molten salt thermal energy storage system based on machine learning according to claim 1, wherein The obtaining of the increasing degree of the number of decision trees under different numbers of decision trees according to the correlation coefficients between two predicted command signal data sequences in all sequence combinations under different numbers of decision trees includes: Wherein, represents the correlation coefficient between two predicted instruction signal data sequences in the -th sequence combination when the number of decision trees is ; represents the total number of all sequence combinations when the number of decision trees is ; represents the degree of increase in the number of decision trees when the number of decision trees is ; represents the exponential function with the natural constant as the base.
7. The method for predicting the frequency modulation command of the molten salt thermal energy storage system based on machine learning according to claim 1, wherein Obtain the decision tree number increase factor under different decision tree numbers through the degree of increase in the number of decision trees and the error trend change factor; obtain the optimal number of decision trees through the decision tree number increase factor. It includes: Among them, the decision tree number increase factor is specifically expressed by the formula: In the formula, represents the error trend change factor when the number of decision trees is , represents the degree of increase in the number of decision trees when the number of decision trees is , represents the increase factor of the number of decision trees when the number of decision trees is , represents a linear normalization function; Start traversing and iterating from when the number of decision trees is 2, and judge the decision tree number increase factor when the number of decision trees is 2 and the decision tree number increase factor when the number of decision trees is 3 for their size relationship. When , stop the iteration and take 2 as the optimal number of decision trees; when , then continue to compare the decision tree number increase factor when the number of decision trees is 3 with the decision tree number increase factor when the number of decision trees is 4 for their size relationship; When , stop the iteration and take 3 as the optimal number of decision trees; when , continue to compare the decision tree quantity increase factor when the number of decision trees is 4 with the decision tree quantity increase factor when the number of decision trees is 5 in terms of size relationship; And so on, until the optimal number of a decision tree is obtained and then stop.
8. A frequency modulation command prediction system for a molten salt thermal energy storage system based on machine learning, characterized in that It includes: Data acquisition module: used to continuously obtain the frequency modulation command signal data at several moments and various characteristic data affecting the stability of the power system; Obtain several sample data points through the frequency modulation command signal data and various characteristic data at several moments; Error analysis module: used to sort several sample data points according to time to obtain a data point sequence; divide the data point sequence into a front data point sequence and a back data point sequence; form a group of sequences with the frequency modulation command signal data corresponding to all data points in the back data point sequence, denoted as the back command signal data sequence; randomly select data points from the front data point sequence with replacement to obtain several data sets; where each data set contains several data points; construct several decision trees through several data sets; predict the command signal data through several decision trees to obtain several predicted command signal data sequences, obtain the errors under different decision tree numbers through the differences between several predicted command signal data sequences and the back command signal data sequence; obtain the error trend change factor under different decision tree numbers through the errors under different decision tree numbers; Optimal number determination module: used to pairwise match the predicted command signal data sequences corresponding to all decision trees under different decision tree numbers to obtain several sequence combinations; obtain the degree of increase in the number of decision trees under different decision tree numbers according to the correlation coefficients between two predicted command signal data sequences in all sequence combinations under different decision tree numbers; obtain the decision tree number increase factor under different decision tree numbers through the degree of increase in the number of decision trees and the error trend change factor; obtain the optimal number of decision trees through the decision tree number increase factor; Prediction module: used to predict the frequency modulation command signal data according to the optimal number of decision trees through the random forest algorithm.
9. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the machine learning-based frequency modulation command prediction method for the molten salt thermal energy storage system according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, it implements the machine learning-based frequency modulation command prediction method for the molten salt thermal energy storage system according to any one of claims 1-7.
Citation Information
Patent Citations
Method and device for establishing timing sequence prediction model
CN106682414A
Improved WOA-GRU-based flood flow prediction method and system
CN113468803A
Water plant intelligent PAC adding method and system based on random forest algorithm
CN114563988A
Remote monitoring management system based on RF algorithm
CN115914883A
Farmland nitrogen leaching loss prediction method based on random forest regression
CN115965121A