A charging capacity prediction method and terminal based on LSTM model
Through the Seq2Seq framework based on the LSTM model, the charging capacity of the optical storage charging inspection station is predicted, the problem of charging capacity prediction is solved, the prediction accuracy is improved, and better operational planning and energy scheduling are supported.
Patent Information
- Application Number
- CN202311450565.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-02
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2043-11-02
AI Technical Summary
How to effectively predict the charge amount of the optical storage charging station to help the operation work plan and optimize energy scheduling in advance.
The charging amount prediction method based on the LSTM model is adopted to construct a charging information sequence by obtaining historical charging data, and encoding and decoding is used to implement the Seq2Seq framework to predict the charge amount.
It realizes effective prediction of the charge capacity of the optical storage charging station, improves the prediction accuracy, and helps better planning and scheduling of operational work.
Smart Images

Figure CN118133884B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of charge capacity prediction, and in particular to a charge capacity prediction method and terminal based on an LSTM model. Background Art
[0002] As the popularity of electric vehicles increases, more and more charging stations are being built as supporting facilities. One type of charging station is called a photovoltaic, energy storage, charging and inspection station, which has the functions of photovoltaic + energy storage + charging + inspection. In the daily operation of the station, reasonable arrangement of the charging time of energy storage facilities is conducive to reducing operating costs and meeting peak charging needs, which is of great significance to the energy scheduling of photovoltaic, energy storage, charging and inspection stations.
[0003] Therefore, it is very necessary to predict the charging capacity of the photovoltaic storage charging and inspection station, which helps to carry out operations that need to use the charging capacity for advance planning. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a charging capacity prediction method and terminal based on the LSTM model to realize the charging capacity prediction of the solar storage and charging inspection station.
[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0006] A charging capacity prediction method based on an LSTM model comprises the following steps:
[0007] S1. Acquire historical charging data of a target station, and construct a charging information sequence according to the historical charging data;
[0008] S2. Encode each of the charging information sequences by an encoder through an LSTM model to obtain encoding information of each of the charging information sequences;
[0009] S3. Extract and concatenate information according to the encoded information, and use a multi-layer LSTM model to decode to obtain predicted data.
[0010] In order to solve the above technical problems, another technical solution adopted by the present invention is:
[0011] A charging capacity prediction terminal based on an LSTM model comprises a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the charging capacity prediction method based on the LSTM model described above are implemented.
[0012] The beneficial effects of the present invention are as follows: a charging capacity prediction method and terminal based on the LSTM model of the present invention constructs a charging information sequence according to historical charging data, encodes it through an LSTM model, and uses a multi-layer LSTM model to decode it after information extraction and splicing, thereby realizing a Seq2Seq framework based on the LSTM model, which can effectively predict the charging capacity of a light storage and charging inspection station. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 This is a flow chart of a charging capacity prediction method based on an LSTM model according to an embodiment of the present invention;
[0014] Figure 2 This is a structural diagram of a charging capacity prediction terminal based on an LSTM model according to an embodiment of the present invention;
[0015] Figure 3 This is a structural example diagram of an unstable small charge capacity scenario prediction model of a charge capacity prediction method based on an LSTM model according to an embodiment of the present invention;
[0016] Figure 4 This is a structural example diagram of a stable small charging capacity scenario prediction model of a charging capacity prediction method based on an LSTM model in an embodiment of the present invention;
[0017] Figure 5 This is a structural example diagram of a stable large charging capacity scenario prediction model of a charging capacity prediction method based on an LSTM model according to an embodiment of the present invention;
[0018] Figure 6 This is a structural example diagram of an unstable large charging capacity scenario prediction model of a charging capacity prediction method based on an LSTM model according to an embodiment of the present invention;
[0019] Figure 7 This is a scenario-based flow chart of a charging capacity prediction method based on an LSTM model according to an embodiment of the present invention;
[0020] Figure 8 This is an example diagram of an LSTM unit structure of a charging capacity prediction method based on an LSTM model according to an embodiment of the present invention;
[0021] Fig. 9 This is an example diagram of a fully connected layer of a charging capacity prediction method based on an LSTM model according to an embodiment of the present invention;
[0022] Description of labels:
[0023] 1. A charging capacity prediction terminal based on LSTM model; 2. Processor; 3. Memory. DETAILED DESCRIPTION
[0024] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.
[0025] Please refer to Figure 1 as well as Figure 3 , a charging capacity prediction method based on LSTM model, comprising the steps of:
[0026] S1. Acquire historical charging data of a target station, and construct a charging information sequence according to the historical charging data;
[0027] S2. Encode each of the charging information sequences by an encoder through an LSTM model to obtain encoding information of each of the charging information sequences;
[0028] S3. Extract and concatenate information according to the encoded information, and use a multi-layer LSTM model to decode to obtain predicted data.
[0029] From the above description, it can be seen that the beneficial effects of the present invention are: a charging capacity prediction method and terminal based on the LSTM model of the present invention constructs a charging information sequence according to historical charging data, encodes it through the LSTM model, and uses a multi-layer LSTM model to decode it after information extraction and splicing, realizing a Seq2Seq framework based on the LSTM model, which can effectively predict the charging capacity of the optical storage and charging inspection station.
[0030] Furthermore, the charging information sequence includes a historical charging sequence within a first preset number of days, a charging sequence on the same day of each week within a first preset number of weeks, and holiday information within a second preset number of days and a corresponding charging sequence;
[0031] Step S3 includes the steps of:
[0032] S31, extracting information from the encoded information through a fully connected layer to obtain an information vector;
[0033] S32, concatenating the information vectors obtained by extracting the coded information of each charging information sequence;
[0034] S33. Use a multi-layer LSTM model to decode the concatenated data, and obtain the predicted data through the fully connected layer.
[0035] From the above description, we can see that the charging information sequence considers holiday factors and the periodic factors of each day of the week to predict the charging amount and improve the prediction accuracy. At the same time, the construction of the charging information sequence and the prediction of the charging amount on a daily basis are more suitable for charging scenarios where there is no car charging for most of the day, and there are cars charging in two or three periods, but the charging period is very random. From the long-term historical data, the charging period has no regularity.
[0036] Furthermore, the charging information sequence includes a historical charging sequence within a first preset number of days, a charging sequence within a first preset number of weeks at the same time of the same day of each week, a charging sequence within a second preset number of weeks at the same time of each day, and holiday information within a second preset number of days and the corresponding charging sequence;
[0037] Step S1 is specifically as follows:
[0038] S11, obtaining the peak, valley and flat electricity price time periods and historical charging data of the target station, aggregating and calculating the daily charging data of the target station according to the peak, valley and flat electricity price time periods, and obtaining the charging amount of the target station in each time period every day;
[0039] S12: construct a historical charging sequence within a first preset number of days, a charging sequence for the same day and time period of each week within a first preset number of weeks, a charging sequence for the same time period of each day within a second preset number of weeks, holiday information within a second preset number of days and a corresponding charging sequence.
[0040] From the above description, it can be seen that in addition to considering holiday factors and periodic factors of each day of the week, the peak, valley and flat electricity price periods of the target station are also considered, and the charging volume data is aggregated and calculated according to the peak, valley and flat electricity price periods. A charging sequence based on the peak, valley and flat electricity price periods is constructed for charging volume prediction, which improves the accuracy of charging volume prediction. It is especially suitable for charging scenarios where there is no car charging in most periods, and cars are charging in a few individual periods, but the charging periods are regular. From the long-term historical data, the charging periods are relatively concentrated every day.
[0041] Further, step S3 comprises the steps of:
[0042] S31, extracting information from the encoded information through a fully connected layer to obtain an information vector;
[0043] S32, concatenating the information vectors obtained by extracting the coded information of each charging information sequence;
[0044] S33, repeat the spliced data, and then use the multi-layer LSTM model to decode it, and obtain the charging amount prediction data for each time period of each day through the fully connected layer.
[0045] From the above description, it can be seen that performing the Repeat action on the concatenated data is more beneficial to the prediction of the Seq2Seq architecture of the encoder-decoder and improves the accuracy of the prediction.
[0046] Furthermore, the charging information sequence includes a historical charging sequence within a first preset number of days, a charging sequence within a first preset number of weeks on the same day and at the same time of the week, a historical weather sequence, and holiday information within a second preset number of days and the corresponding charging sequence;
[0047] Step S1 is specifically as follows:
[0048] S11, obtaining historical charging data of the target station, performing aggregate calculation in units of hours, and obtaining the charging capacity of the target station per hour per day;
[0049] S12, creating a historical charging sequence within a first preset number of days, a charging sequence within a first preset number of weeks on the same day and hour of each week, a historical weather sequence, holiday information within a second preset number of days, and a corresponding charging sequence.
[0050] From the above description, it can be seen that in addition to considering holiday factors and periodic factors of each day of the week, combined with weather factors, and aggregating charging information in hours, data series are constructed to improve the accuracy of charging capacity prediction. This is especially suitable for scenarios where vehicles are charged during most of the day and the charging capacity in the same period fluctuates around a value on different days, with relatively good regularity and stable large charging capacity at the hour level. This provides accurate charging prediction at the hour level.
[0051] Further, step S3 comprises the steps of:
[0052] S31, extracting information from the encoded information through a fully connected layer to obtain an information vector;
[0053] S32, concatenating the information vectors obtained by extracting the coded information of each charging information sequence;
[0054] S33, performing a Repeat action on the spliced data, and splicing it with the weather information and holiday information of the sample day;
[0055] S34. According to the data obtained in step S33, a multi-layer LSTM model is used for decoding, and the charging amount prediction data for each hour per day is obtained through a fully connected layer.
[0056] From the above description, it can be seen that after the data is repeated, the weather information and holiday information of the sample day are spliced to predict the charging capacity, thereby improving the accuracy of the prediction.
[0057] Further, step S1 also includes constructing a short-term charging sequence;
[0058] The short-term charging sequence includes a charging sequence within a preset number of hours and charging information of the previous hour;
[0059] Wherein, the preset number of hours is not less than two;
[0060] Step S2 also includes the steps of:
[0061] Encode each of the short-term charging sequences through an LSTM model to obtain encoding information of each short-term charging sequence;
[0062] Step S3 is replaced by:
[0063] Execute steps S31 to S33 on the coded information of each charging information sequence, and decode using a multi-layer LSTM model according to the data obtained in step S33 to obtain benchmark prediction data for each hour of each day;
[0064] Execute steps S31 to S32 for the coded information of each charging information sequence and each short-term charging sequence, and perform a Repeat action on the spliced data. According to the obtained data, use a multi-layer LSTM model to perform decoding to obtain fluctuation prediction data for each hour of each day.
[0065] The charge amount prediction data for each hour of each day is obtained according to the sum of the reference prediction data and the fluctuation prediction data for each hour of each day.
[0066] From the above description, it can be seen that on the basis of the charging prediction of the hourly stable large charging volume scenario, a fluctuation prediction structure is added, and a short-term charging sequence is introduced to perform fluctuating power prediction. The charging prediction results of the hourly stable large charging volume scenario are corrected according to the obtained fluctuation prediction data to improve the prediction accuracy. This is especially suitable for scenarios where there is charging volume in 24 time periods every day, but the charging volume fluctuates greatly.
[0067] Please refer to Figure 2 A charging capacity prediction terminal based on an LSTM model comprises a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the charging capacity prediction method based on the LSTM model are implemented.
[0068] The present invention discloses a charging capacity prediction method and terminal based on an LSTM model, which are suitable for predicting the charging capacity of a photovoltaic storage and charging inspection station.
[0069] Please refer to Figure 1 and Figure 3 , Embodiment 1 of the present invention is:
[0070] A charging capacity prediction method based on an LSTM model comprises the following steps:
[0071] S1. Acquire historical charging data of a target station, and construct a charging information sequence according to the historical charging data;
[0072] The charging information sequence includes a historical charging sequence within a first preset number of days, a charging sequence on the same day of each week within a first preset number of weeks, and holiday information within a second preset number of days and a corresponding charging sequence.
[0073] In this embodiment, the historical charging data of the target station is obtained, and the daily data is aggregated and calculated to obtain the daily charging capacity information of the station. The historical charging sequence of the past 30 days, the historical charging sequence of the same day of the week in the past 8 weeks, and the holiday information and corresponding charging sequence in the past 360 days are constructed.
[0074] In this embodiment, the first preset number of days is 30 days, the first preset number of weeks is 8 weeks, and the second preset number of days is 360. In other equivalent embodiments, the first preset number of days, the first preset number of weeks, and the second preset number of days can be adjusted according to actual needs.
[0075] S2. Encode each of the charging information sequences through an LSTM model to obtain encoding information of each of the charging information sequences.
[0076] In this embodiment, each historical sequence is encoded through the LSTM model to obtain the information of each historical sequence.
[0077] S3, extracting and splicing information according to the encoded information, and decoding using a multi-layer LSTM model to obtain predicted data;
[0078] Step S3 includes the steps of:
[0079] S31, extracting information from the encoded information through a fully connected layer to obtain an information vector;
[0080] S32, concatenating the information vectors obtained by extracting the coded information of each charging information sequence;
[0081] S33. Use a multi-layer LSTM model to decode the concatenated data, and obtain the predicted data through the fully connected layer.
[0082] In this embodiment, the encoded sequence information is further extracted through the fully connected layer; the information vectors extracted from each sequence are spliced; the spliced information is decoded using a multi-layer LSTM; and the decoded information is used for daily charging capacity prediction through the fully connected layer.
[0083] The deep model structure can be referred to Figure 3 shown.
[0084] The core of the charging capacity prediction scenario model of this embodiment is to aggregate the charging capacity of 24 time periods every day into the charging capacity of one day, and convert the charging capacity prediction problem of this type of scenario into the daily charging capacity problem of the charging station, avoiding the problem of large randomness of the charging period.
[0085] Please refer to Figure 1 and Figure 4 , Embodiment 2 of the present invention is:
[0086] A charging capacity prediction method based on an LSTM model, which differs from the first embodiment in that the charging information sequence includes a historical charging sequence within a first preset number of days, a charging sequence at the same time period on the same day of each week within a first preset number of weeks, a charging sequence at the same time period every day within a second preset number of weeks, and holiday information within a second preset number of days and the corresponding charging sequence;
[0087] Step S1 is specifically as follows:
[0088] S11, obtaining the peak, valley and flat electricity price time periods and historical charging data of the target station, aggregating and calculating the daily charging data of the target station according to the peak, valley and flat electricity price time periods, and obtaining the charging amount of the target station in each time period every day;
[0089] In this embodiment, the peak, valley and flat electricity price time periods of the target station are obtained, and the daily data of the charging station is aggregated and calculated according to the peak, valley and flat time periods to obtain the charging amount of the station in each time period of each day.
[0090] S12: construct a historical charging sequence within a first preset number of days, a charging sequence for the same day and time period of each week within a first preset number of weeks, a charging sequence for the same time period of each day within a second preset number of weeks, holiday information within a second preset number of days and a corresponding charging sequence.
[0091] In this embodiment, a charging sequence for the past 30 days, a charging sequence for the same time period on the same day of the week for the past 8 weeks, a charging sequence for the same time period for the past 2 weeks, and holiday information for the past 360 days are constructed.
[0092] In this embodiment, the first preset number of days is 30 days, the first preset number of weeks is 8 weeks, the second preset number of weeks is 2 weeks, and the second preset number of days is 360 days. In other equivalent embodiments, the first preset number of days, the first preset number of weeks, the second preset number of weeks, and the second preset number of days can be adjusted according to actual needs.
[0093] Step S3 includes the steps of:
[0094] S31, extracting information from the encoded information through a fully connected layer to obtain an information vector;
[0095] S32, concatenating the information vectors obtained by extracting the coded information of each charging information sequence;
[0096] S33, repeat the spliced data, and then use the multi-layer LSTM model to decode it, and obtain the charging amount prediction data for each time period of each day through the fully connected layer.
[0097] In this embodiment, each historical sequence is encoded through the LSTM model to obtain the information of each historical sequence; the encoded sequence information is further extracted through the fully connected layer; the information vectors extracted from each sequence are spliced; the spliced information is repeated to facilitate Seq2Seq prediction, and the information after the Repeat action is decoded using a multi-layer LSTM, and the decoded information is used for charging capacity prediction in each time period of each day through the fully connected layer.
[0098] The deep model structure can be referred to Figure 4 shown.
[0099] The core of the charging capacity prediction scenario model of this embodiment is the charging capacity in 24 time periods every day. The time periods are divided according to the peak, valley and flat electricity prices of the charging station, and the charging capacity is aggregated into each time period of the day. The charging capacity prediction problem of this type of scenario is converted into the charging capacity problem of each time period of the day at the charging station, avoiding the problem of charging capacity fluctuations caused by small charging hours.
[0100] Please refer to Figure 1 and Figure 5 , Embodiment 3 of the present invention is:
[0101] A charging capacity prediction method based on an LSTM model, which differs from the first or second embodiment in that the charging information sequence includes a historical charging sequence within a first preset number of days, a charging sequence at the same time of the same day of each week within a first preset number of weeks, a charging sequence at the same hour of each day within a second preset number of weeks, a historical weather sequence, holiday information within a second preset number of days, and a corresponding charging sequence;
[0102] Step S1 is specifically as follows:
[0103] S11, obtaining historical charging data of the target station, performing aggregate calculation in units of hours, and obtaining the charging capacity of the target station per hour per day;
[0104] In this embodiment, the data of the charging station every day is aggregated and calculated on an hourly basis to obtain the charging amount of the station every hour every day.
[0105] S12, creating a historical charging sequence within a first preset number of days, a charging sequence on the same day and hour of each week within a first preset number of weeks, a historical weather sequence, a charging sequence on the same hour of each day within a second preset number of weeks, holiday information within a second preset number of days and a corresponding charging sequence.
[0106] In this embodiment, a charging sequence for the past 30 days, a charging sequence for the same hour on the same day of the week for the past 8 weeks, a charging sequence for the same hour for the past 2 weeks, holiday information for the past 360 days, a historical weather sequence, etc. are constructed.
[0107] In this embodiment, the first preset number of days is 30 days, the first preset number of weeks is 8 weeks, the second preset number of weeks is 2 weeks, and the second preset number of days is 360 days. In other equivalent embodiments, the first preset number of days, the first preset number of weeks, the second preset number of weeks, and the second preset number of days can be adjusted according to actual needs.
[0108] Step S3 includes the steps of:
[0109] S31, extracting information from the encoded information through a fully connected layer to obtain an information vector;
[0110] S32, concatenating the information vectors obtained by extracting the coded information of each charging information sequence;
[0111] S33, performing a Repeat action on the spliced data, and splicing it with the weather information and holiday information of the sample day;
[0112] S34. According to the data obtained in step S33, a multi-layer LSTM model is used for decoding, and the charging amount prediction data for each hour per day is obtained through a fully connected layer.
[0113] In this embodiment, each historical sequence is encoded through the LSTM model to obtain the information of each historical sequence; the encoded sequence information is further extracted through the fully connected layer; the information vectors extracted from each sequence are spliced; the spliced information is repeated to facilitate Seq2Seq prediction; the vector after the Repeat action is spliced with the weather information and holiday information of the sample day; multi-layer LSTM is used to decode the information; and the decoded information is used for charging capacity prediction in each time period of each day through the fully connected layer.
[0114] The deep model structure can be referred to Figure 5 shown.
[0115] The core of the charging capacity prediction scenario model of this embodiment is that the charging capacity in the 24 time periods of a day is relatively stable. This type of scenario can directly predict the charging capacity for each time period.
[0116] Please refer to Figure 1 and Figure 6 , Embodiment 4 of the present invention is:
[0117] A charging capacity prediction method based on an LSTM model, which differs from the third embodiment in that step S1 further includes constructing a short-term charging sequence;
[0118] The short-term charging sequence includes a charging sequence within a preset number of hours and charging information of the previous hour;
[0119] Wherein, the preset number of hours is not less than two.
[0120] In this embodiment, the data of the charging station is aggregated and calculated on an hourly basis to obtain the charging amount of the station every hour every day. The charging sequence of the historical period in the past 30 days, the historical charging sequence of the same day of the week and the same period in the past 8 weeks, the historical charging sequence of the same period in the past 2 weeks, the holiday information in the past 360 days, the historical weather sequence, etc., the short-term 24-hour charging sequence, and the charging data of the previous hour are constructed.
[0121] In the embodiment of this city, the first preset number of days is 30 days, the first preset number of weeks is 8 weeks, the second preset number of weeks is 2 weeks, the second preset number of days is 360 days, and the preset number of hours is 24 hours. In other equivalent embodiments, the first preset number of days, the first preset number of weeks, the second preset number of weeks, the preset number of hours and the second preset number of days can be adjusted according to actual needs, among which the preset number of hours can be adjusted to 3 hours, 6 hours or other values according to needs.
[0122] Step S2 also includes the steps of:
[0123] Each of the short-term charging sequences is encoded by an encoder through an LSTM model to obtain encoding information of each short-term charging sequence.
[0124] Step S3 is replaced by:
[0125] Steps S31 to S33 are executed on the coded information of each charging information sequence, and according to the data obtained in step S33, a multi-layer LSTM model is used to perform decoding to obtain benchmark prediction data for each hour of each day.
[0126] In this embodiment, the acquisition of the benchmark prediction data may refer to the acquisition of the charging capacity prediction data for each hour every day in the third embodiment.
[0127] Steps S31 to S32 are executed for the coded information of each charging information sequence and each short-term charging sequence, and a Repeat action is performed on the spliced data. Based on the obtained data, a multi-layer LSTM model is used for decoding to obtain fluctuation prediction data for each hour of each day.
[0128] In this embodiment, each charging information sequence and each short-term charging sequence are respectively encoded through the LSTM model to obtain the information of each historical sequence; the encoded sequence information is further extracted through the fully connected layer; the information vectors extracted from each sequence are spliced; the spliced information is repeated to facilitate Seq2Seq prediction; the information after the Repeat action is decoded using a multi-layer LSTM; the decoded information is used for the prediction of the fluctuating charging amount in each time period of each day through the fully connected layer to obtain the fluctuation prediction data.
[0129] The charge amount prediction data for each hour of each day is obtained according to the sum of the reference prediction data and the fluctuation prediction data for each hour of each day.
[0130] In this embodiment, the reference prediction data and the fluctuation prediction data are added to obtain a final charge capacity prediction value.
[0131] The deep model structure can be referred to Figure 6 shown.
[0132] The core of the charging capacity prediction scenario model of this embodiment is that there is charging capacity in 24 time periods every day, but the charging capacity fluctuates greatly. For this type of scenario, a fluctuation prediction structure can be added to the stable large charging capacity prediction model to optimize the model and directly predict the charging capacity for each time period.
[0133] Please refer to Figure 7 , Embodiment 5 of the present invention is:
[0134] A charging capacity prediction method based on an LSTM model, which differs from embodiments one to four in that, according to statistics of historical charging data of a target station, the steps in the charging capacity prediction method based on an LSTM model in the above embodiments one to four are selected to be used.
[0135] Please refer to Figure 7 In this embodiment, the charging scenarios are divided into unstable small charging scenario (using the steps in a charging capacity prediction method based on an LSTM model in Embodiment 1), stable small charging scenario (using the steps in a charging capacity prediction method based on an LSTM model in Embodiment 2), stable large charging scenario (using the steps in a charging capacity prediction method based on an LSTM model in Embodiment 3) and unstable large charging scenario (using the steps in a charging capacity prediction method based on an LSTM model in Embodiment 4).
[0136] Among them, the unstable small charging volume scenario: 24 hours a day, there are no cars charging during most of the time, and there are cars charging during two or three periods, but the charging period is very random. From the long-term historical data, there is no regularity in the charging period.
[0137] Stable small charging volume scenario: 24 hours a day, there are no cars charging during most of the time, and there are cars charging during a few individual periods, but the charging periods are regular. From the long-term historical data, the daily charging periods are relatively concentrated.
[0138] Stable large charging volume scenario: 24 hours a day, there are cars charging most of the time, and the charging volume in the same period fluctuates around a value on different days, with good regularity.
[0139] Unstable large charging volume scenario: 24 hours a day, there are cars charging most of the time, but the charging volume in the same period will fluctuate on different days, with poor regularity.
[0140] The specific steps for scene division are as follows:
[0141] S1. Obtain historical charging data of the solar-storage charging inspection station and collect statistics on the historical charging data;
[0142] S2. Obtain and divide the charging scenarios to which the solar-storage-charging inspection station belongs based on the statistically obtained degree of overlap of daily charging time, daily charging duration, and hourly charging amount;
[0143] Step S2 comprises the steps of:
[0144] S21, obtaining the statistically obtained degree of overlap of charging time per day, charging time per day, and charging amount per hour;
[0145] The calculation of the degree of overlap is specifically as follows:
[0146] Divide a day into time periods, record whether there is charging behavior in each time period, and generate a binary array of charging status in each time period of the day;
[0147] The binary array of the charging conditions of the preset days is subjected to time period overlap statistics, and the degree of overlap is calculated according to the number of time periods n with the same charging conditions:
[0148] Overlap = n / 24;
[0149] In this embodiment, each day is divided into 24 hours. If there is charging behavior in this period, it is recorded as 1, and if there is no charging behavior, it is recorded as 0. The degree of overlap is determined based on the charging period data of the past three days. If the charging conditions in the same period of the past three days are consistent, this period is defined as the charging condition and recorded as 1, otherwise it is recorded as 0. If the charging conditions in 21 of the 24 periods overlap, the degree of overlap is defined as 21 / 24=0.875. S22. According to the degree of overlap, the charging scene is divided into stable or unstable;
[0150] Step S22 is specifically as follows:
[0151] It is determined whether the overlap degree Overlap is greater than a preset stability threshold, and if so, it is classified as a stable charging scene, otherwise it is classified as an unstable charging scene.
[0152] In this embodiment, the stability threshold is set to 0.5. If the overlap value is greater than 0.5, it is defined as a stable scene, otherwise it is an unstable scene. In other equivalent embodiments, the stability threshold can be adjusted according to actual needs.
[0153] S23, calculating the charging amount threshold according to the number of charging piles and the charging pile power of the solar storage charging inspection station, and further dividing the charging scene into a large charging amount or a small charging amount according to the daily charging time, the charging amount of each charging time and the charging amount threshold;
[0154] Step S23 is specifically as follows:
[0155] According to the daily charging time and the charging amount in each time period, the actual daily charging amount P_CHARGE of the solar storage charging inspection station is calculated;
[0156] Get the number of charging piles N and the charging power P of each charging pile at the solar storage and charging inspection station i , (i≤N), calculate the total rated charging power W per hour of the solar storage charging and inspection station:
[0157]
[0158] If the actual total charge amount P_CHARGE>k*24*W, it is classified as a large charge amount scenario, otherwise it is classified as a small charge amount scenario;
[0159] Wherein, k represents a preset ratio.
[0160] In this embodiment, assuming that a station has N charging piles and the power of each charging pile is P, the total rated charging power of the station is NP. For 24 hours a day, if the charging amount of a station per day P_CHARGE>0.2*24*NP, it is defined as a large charging amount scenario, otherwise it is defined as a small charging amount scenario.
[0161] In this embodiment, the preset ratio is 0.2. In other equivalent embodiments, the ratio can be adjusted according to actual needs.
[0162] S3, selecting a corresponding pre-trained prediction model to predict the charging capacity according to the charging scenario to which the solar storage charging inspection station belongs;
[0163] Step S3 is specifically as follows:
[0164] According to the stable / unstable, large / small charging scenarios of the solar storage and charging inspection station, the corresponding pre-trained prediction model is selected to predict the charging amount.
[0165] Please refer to Figure 2 , Embodiment 6 of the present invention is:
[0166] A charging capacity prediction terminal 1 based on an LSTM model comprises a processor 2, a memory 3, and a computer program stored in the memory 3 and executable on the processor 2. When the processor 2 executes the computer program, the steps of a charging capacity prediction method based on an LSTM model described in any one of the above embodiments 1 to 5 are implemented.
[0167] The following is an explanation of some technical terms in the article:
[0168] Encoder-Decoder structure: Encoder-decoder is a commonly used framework in machine learning, which contains two main components: encoder and decoder. The encoder is responsible for processing the input data and capturing its representation in a compact and meaningful form. In charge prediction, the input data can be a series of historical charge amounts. The encoder is usually composed of a recurrent neural network (RNN), such as long short-term memory (LSTM) or gated recurrent unit (GRU), or more advanced models such as Transformer. The encoder reads the input sequence step by step, updates its internal state at each step, and generates a fixed-length vector representation, often called a "context vector" or "thinking vector", which encodes the meaning of the input sequence. On the other hand, the decoder uses the context vector generated by the encoder and generates the desired output sequence. Similar to the encoder, the decoder is usually implemented using RNN or Transformer. It takes the context vector as the initial input and generates the output sequence step by step, one element at a time. At each step, the decoder considers the previously generated elements and its own internal state to predict the next element in the sequence. This process continues until the entire output sequence is generated. During training, the encoder-decoder model is trained by minimizing an appropriate loss function that measures the difference between the predicted output sequence and the true sequence. This is achieved by comparing the predicted sequence to the target sequence and adjusting the model's parameters through techniques such as backpropagation and gradient descent.
[0169] LSTM: See Figure 8, represents a single LSTM unit, where: x(t) represents the input at time step t; h(t-1) represents the hidden state at time step t-1 (the output of the previous time step); h(t) represents the hidden state at time step t (the output of the current time step); y(t) represents the output at time step t. There are three key components inside the LSTM unit: Input Gate: controls which information will be input into the memory cells in the LSTM unit; Forget Gate: controls which information will be forgotten or deleted from the memory cells; Output Gate: controls the flow of information from the memory cells to the hidden state and outputs to the output of the current time step. The input gate, forget gate, and output gate of the LSTM unit generate probability values between 0 and 1 through the sigmoid function. The outputs of these gates are multiplied by the state of the memory cell to control the flow of information. The LSTM unit also has a memory cell (Cell) for storing and transmitting information. The information in the memory cell can be updated based on the input gate, forget gate, and new input. The entire LSTM model can be composed of multiple LSTM units, each of which is connected sequentially in time to achieve modeling and prediction of sequence data.
[0170] Fully connected layer: please refer to Fig. 9 , represents a fully connected layer, where: x represents the input vector (or the output from the previous layer); y represents the output vector (or the input passed to the next layer); W represents the weight matrix used to connect the input to the output; b represents the bias vector used to offset the output value. In a fully connected layer, there is a connection between each input and each output. The input and weight are multiplied by matrix multiplication, and the bias vector is added to obtain the output vector. This process can be expressed as the following formula: y = W*x + b. Each neuron in the fully connected layer is connected to all neurons in the previous layer, so it can capture the complex relationships in the input vector. Fully connected layers are often used in the middle layer of deep neural networks to extract high-level features of the input data and pass them to subsequent layers for further processing and prediction.
[0171] Repeat: RepeatVector, in deep learning, RepeatVector is an operation for data repetition. Its function is to repeat the input data multiple times to generate a new tensor. Specifically, the RepeatVector operation receives an input vector and repeats it multiple times to generate a new tensor. The purpose of this operation is to expand the input vector to a size that matches the target shape. It is often used in sequence generation tasks, where a vector is required as input and the vector is repeated at each time step to generate a complete sequence. For example, suppose we have an input vector x of shape (batch_size, input_dim), and we want to repeat it n times to generate a new tensor of shape (batch_size, n, input_dim). We can use the RepeatVector operation to achieve this goal. The mathematical representation of RepeatVector can be expressed as: output = RepeatVector (n) (x) where n represents the number of repetitions and x represents the input vector. By using the RepeatVector operation, we can copy and repeat the input vector in sequence generation tasks to generate longer sequences. This is very useful for some models that need to utilize previous context information, such as recurrent neural networks or sequence-to-sequence models. It should be noted that the RepeatVector operation simply repeats the input vector multiple times and does not have any learning parameters. It is a pure data repetition operation.
[0172] Seq2Seq: Seq2Seq (Sequence-to-Sequence) is a deep learning framework for sequence-to-sequence tasks. It is based on an encoder-decoder architecture that maps one sequence to another by taking one sequence as input and generating another sequence as output. The Seq2Seq model consists of two main components: an encoder and a decoder. The encoder is responsible for encoding the input sequence into a fixed-length vector representation that captures the semantic and contextual information of the input sequence. Common encoder models include recurrent neural networks (RNNs) such as LSTM or GRU, as well as more advanced models such as Transformers. The encoder updates its internal state by gradually processing each element in the input sequence, and finally generates a context vector or "encoder output". The decoder receives the encoder output and partial input of the target sequence (usually a special start token), and gradually generates elements of the target sequence. The decoder is also usually implemented based on RNN or Transformer. At each time step, the decoder uses the output of the previous time step, the encoder output, and its own internal state to generate the next output element. This process continues until the entire target sequence is generated. During training, the Seq2Seq model optimizes the parameters of the model by minimizing an appropriate loss function (such as cross entropy loss) so that the generated sequence is as close to the target sequence as possible. This usually involves using standard optimization techniques such as backpropagation and gradient descent. In summary, the Seq2Seq model encodes the input sequence into a fixed-length vector through an encoder and then decodes the vector into an output sequence through a decoder, thereby achieving the sequence-to-sequence mapping task. This framework has been widely used in multiple fields and has achieved remarkable results.
[0173] In summary, the charging capacity prediction method and terminal based on the LSTM model provided by the present invention construct a charging information sequence according to historical charging data, encode it through the LSTM model, and use a multi-layer LSTM model for decoding after information extraction and splicing, thereby realizing a Seq2Seq framework based on the LSTM model, which can effectively predict the charging capacity of the optical storage and charging inspection station.
[0174] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A charging capacity prediction method based on LSTM model, characterized in that: Includes steps: S1. Acquire historical charging data of a target station, and construct a charging information sequence according to the historical charging data; S2. Encode each of the charging information sequences by an encoder through an LSTM model to obtain encoding information of each of the charging information sequences; S3, extracting and splicing information according to the encoded information, and decoding using a multi-layer LSTM model to obtain predicted data; Before step S1, the method further includes the following steps: According to the historical charging data of the photovoltaic storage charging inspection station, the charging scenarios of the photovoltaic storage charging inspection station are divided, specifically, the historical charging data of the photovoltaic storage charging inspection station is obtained and the historical charging data is counted; the overlapping degree of daily charging time, daily charging time and charging amount per hour obtained by statistics are obtained and the charging scenarios of the photovoltaic storage charging inspection station are divided into unstable small charging amount scenario, stable small charging amount scenario, stable large charging amount scenario or unstable large charging amount scenario; Charging scenarios for solar storage and charging inspection stations: If it is an unstable small charging amount scenario, the charging information sequence constructed in step S1 includes the historical charging sequence within the first preset number of days, the charging sequence on the same day of each week within the first preset number of weeks, and the holiday information within the second preset number of days and the corresponding charging sequence; If it is a stable small charging amount scenario, the charging information sequence constructed in step S1 includes the historical charging sequence within the first preset number of days, the charging sequence of the same day and time period of each week within the first preset number of weeks, the charging sequence of the same time period of each day within the second preset number of weeks, and the holiday information within the second preset number of days and the corresponding charging sequence; If it is a stable large charging volume scenario, the charging information sequence constructed in step S1 includes the historical charging sequence within the first preset number of days, the charging sequence of the same day and time period of each week within the first preset number of weeks, the charging sequence of the same hour of each day within the second preset number of weeks, the historical weather sequence, the holiday information within the second preset number of days and the corresponding charging sequence; If it is an unstable and large charging volume scenario, the charging information sequence constructed in step S1 includes the historical charging sequence within the first preset number of days, the charging sequence at the same day and time of each week within the first preset number of weeks, the charging sequence at the same hour of each day within the second preset number of weeks, the historical weather sequence, the holiday information within the second preset number of days and the corresponding charging sequence; and step S1 also includes constructing a short-term charging sequence; the short-term charging sequence includes the charging sequence within the preset number of hours and the charging information of the previous hour.
2. According to a charging capacity prediction method based on LSTM model according to claim 1, it is characterized in that: If the charging scenario to which the photovoltaic storage charging inspection station belongs is an unstable small charging amount scenario, step S3 includes the following steps: S31, extracting information from the encoded information through a fully connected layer to obtain an information vector; S32, concatenating the information vectors obtained by extracting the coded information of each charging information sequence; S33. Use a multi-layer LSTM model to decode the concatenated data, and obtain the predicted data through the fully connected layer.
3. The charging capacity prediction method based on the LSTM model according to claim 1, characterized in that: If the charging scenario to which the solar storage charging inspection station belongs is a stable small charging scenario, step S1 is specifically as follows: S11, obtaining the peak, valley and flat electricity price time periods and historical charging data of the target station, aggregating and calculating the daily charging data of the target station according to the peak, valley and flat electricity price time periods, and obtaining the charging amount of the target station in each time period every day; S12: construct a historical charging sequence within a first preset number of days, a charging sequence for the same day and time period of each week within a first preset number of weeks, a charging sequence for the same time period of each day within a second preset number of weeks, holiday information within a second preset number of days and a corresponding charging sequence.
4. A charging capacity prediction method based on LSTM model according to claim 3, characterized in that: If the charging scenario to which the solar storage charging inspection station belongs is a stable small charging scenario, step S3 includes the following steps: S31, extracting information from the encoded information through a fully connected layer to obtain an information vector; S32, concatenating the information vectors obtained by extracting the coded information of each charging information sequence; S33, repeat the spliced data, and then use the multi-layer LSTM model to decode it, and obtain the charging amount prediction data for each time period of each day through the fully connected layer.
5. The charging capacity prediction method based on the LSTM model according to claim 1, characterized in that: If the charging scenario to which the solar storage charging inspection station belongs is a stable large charging scenario, step S1 is specifically as follows: S11, obtaining historical charging data of the target station, performing aggregate calculation in units of hours, and obtaining the charging capacity of the target station per hour per day; S12, constructing a historical charging sequence within a first preset number of days, a charging sequence at the same hour of the same day of each week within a first preset number of weeks, a charging sequence at the same time of each day within a second preset number of weeks, a historical weather sequence, holiday information within a second preset number of days and a corresponding charging sequence.
6. A charging capacity prediction method based on LSTM model according to claim 5, characterized in that: If the charging scenario to which the photovoltaic storage charging inspection station belongs is a stable large charging scenario, step S3 includes the following steps: S31, extracting information from the encoded information through a fully connected layer to obtain an information vector; S32, concatenating the information vectors obtained by extracting the coded information of each charging information sequence; S33, performing a Repeat action on the spliced data, and splicing it with the weather information and holiday information of the sample day; S34. According to the data obtained in step S33, a multi-layer LSTM model is used for decoding, and the charging amount prediction data for each hour per day is obtained through a fully connected layer.
7. A charging capacity prediction method based on LSTM model according to claim 6, characterized in that: If the charging scenario of the solar storage charging inspection station is an unstable and high-charge scenario, then Step S2 also includes the steps of: Encode each of the short-term charging sequences through an LSTM model to obtain encoding information of each short-term charging sequence; Step S3 is replaced by: Execute steps S31 to S33 on the coded information of each charging information sequence, and decode using a multi-layer LSTM model according to the data obtained in step S33 to obtain benchmark prediction data for each hour of each day; Execute steps S31 to S32 for the coded information of each charging information sequence and each short-term charging sequence, and perform a Repeat action on the spliced data. According to the obtained data, use a multi-layer LSTM model to perform decoding to obtain fluctuation prediction data for each hour of each day. The charge amount prediction data for each hour of each day is obtained according to the sum of the reference prediction data and the fluctuation prediction data for each hour of each day.
8. A charging capacity prediction terminal based on an LSTM model, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps in the charging capacity prediction method based on the LSTM model described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
A method for predicting a charge amount of a charging pile system
CN109146156A
Hierarchical conversational machine reading understanding system and method
CN113010662A
Power dispatching method and terminal for optical storage charging station
CN116436008A
Charging quantity prediction method based on scene division and terminal
CN117172390A
Charging quantity prediction method and terminal capable of distinguishing scenes and models
CN118396151A