Electric carbon factor prediction method and device, computer equipment and readable storage medium
By using a target carbon factor prediction model, based on interval time characteristics and the extraction of residual, trend, and periodic features from time series data, the problem of low prediction accuracy of carbon factor is solved, and more accurate prediction of carbon factor is achieved.
Patent Information
- Application Number
- CN202511402685.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-28
- Publication Date
- 2025-11-28
AI Technical Summary
In existing technologies, the prediction accuracy of the carbon factor is low, and the difficulty in obtaining real-time details of power dispatch leads to inaccurate predictions.
A target carbon factor prediction model is adopted. By inputting the time characteristics of the time interval to be predicted and the historical time interval, as well as the historical carbon factor time series data, residual features, trend features and periodic features are extracted using multiple sequentially connected blocks to predict the carbon factor time series data.
It can improve the prediction accuracy of the carbon factor without obtaining details of power dispatch, and fully capture the temporal characteristics of the carbon factor time series data to achieve more accurate prediction.
Smart Images

Figure CN121034448A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to an electric carbon factor prediction method and device, computer equipment, computer readable storage medium and computer program product. BACKGROUND
[0002] The electric carbon factor is used to represent the emission intensity of carbon dioxide or equivalent greenhouse gases, such as emission amount, when a unit of electricity is consumed. The electric carbon factor is a key parameter for measuring indirect carbon emissions of electricity consumption, and the accuracy of its prediction is directly related to the fair distribution of emission reduction responsibilities, the effective operation of the carbon market, and the scientificity of enterprise green power procurement decisions.
[0003] In related technologies, the electric carbon factor is usually predicted based on the marginal emission factor method. The marginal emission factor method takes into account the dynamic influence of power dispatching and can reflect the "instant" emission cost when the load changes. The marginal emission factor method relies heavily on the details of power dispatching. However, in practice, it is difficult to obtain the details of power dispatching completely and in real time, which leads to low prediction accuracy of the electric carbon factor. SUMMARY
[0004] Therefore, it is necessary to provide an electric carbon factor prediction method, device, computer equipment, computer readable storage medium and computer program product capable of improving the prediction accuracy of the electric carbon factor to solve the technical problem of low prediction accuracy of the electric carbon factor.
[0005] In a first aspect, the present application provides an electric carbon factor prediction method, comprising:
[0006] determining a to-be-predicted time interval and a historical time interval of the to-be-predicted time interval;
[0007] obtaining interval time features of the to-be-predicted time interval and the historical time interval, and historical electric carbon factor time series data under the historical time interval;
[0008] inputting the interval time features of the to-be-predicted time interval, the interval time features of the historical time interval and the historical electric carbon factor time series data as input information of a target electric carbon factor prediction model to the target electric carbon factor prediction model to obtain an electric carbon factor time series data prediction result under the to-be-predicted time interval;
[0009] The target electricity carbon factor prediction model comprises a plurality of sequentially connected blocks; each block is configured to obtain fitted historical electricity carbon factor time series data and predicted electricity carbon factor time series data in the to-be-predicted time interval according to input information of the block, extract residual feature between the fitted historical electricity carbon factor time series data and the historical electricity carbon factor time series data, extract trend feature and periodic feature of the fitted historical electricity carbon factor time series data and the predicted electricity carbon factor time series data, and obtain target residual information of the block based on fusion processing of the input information of the block, the residual feature, the trend feature and the periodic feature; the input information of the first block in each block comprises input information of the target electricity carbon factor prediction model, and the input information of each block other than the first block in the plurality of blocks comprises target residual information of a previous block of the block.
[0010] In one of the embodiments, interval time features of each of the to-be-predicted time interval and the historical time interval are obtained in the following manner:
[0011] Each time point included in the time interval is determined by taking a natural day as a time scale; the time interval comprises the to-be-predicted time interval and the historical time interval;
[0012] For each of the time points, the time point is subjected to sine coding to obtain a sine coding result of the time point, cosine coding to obtain a cosine coding result of the time point, and normalization processing to obtain a normalization result of the time point, and the sine coding result, the cosine coding result and the normalization result of the time point are combined as time point time features of the time point;
[0013] The interval time features of the time interval are obtained based on the time point time features of each of the time points.
[0014] In one of the embodiments, the target electricity carbon factor prediction model is obtained by training in the following manner:
[0015] A plurality of sample time intervals are determined, and sample electricity carbon factor time series data in each of the sample time intervals is obtained;
[0016] Each of the sample electricity carbon factor time series data is subjected to sliding window processing to obtain a plurality of time series data segments;
[0017] For each of the time series data segments, the time series data segment is divided into a first data segment and a second data segment after the first data segment;
[0018] The target electric carbon factor prediction model is trained by taking each of the first data segments, interval time characteristics of a sub-interval corresponding to each of the first data segments, and sub-interval time characteristics of an interval corresponding to each of the second data segments as input information, and taking each of the second data segments as supervision information.
[0019] In one of the embodiments, each of the sample time intervals is determined in a natural day unit; and the plurality of sample time intervals are arranged in a corresponding time sequence in sequence.
[0020] The sample electric carbon factor time sequence data in each of the sample time intervals is obtained by:
[0021] For each first sample time interval, first initial electric carbon factor time sequence data in the first sample time interval is obtained; the first sample time interval is any one of the sample time intervals.
[0022] Based on the first initial electric carbon factor time sequence data, a target moment corresponding to the first sample time interval is determined; the target moment is a moment of missing electric carbon factor.
[0023] A plurality of adjacent sample time intervals of the first sample time interval are obtained to obtain each second sample time interval.
[0024] Based on the first initial electric carbon factor time sequence data and second initial electric carbon factor time sequence data in each of the second sample time intervals, a target electric carbon factor of the target moment in the first sample time interval is determined.
[0025] The first initial electric carbon factor time sequence data in the first sample time interval and the target electric carbon factor of the target moment in the first sample time interval are combined to obtain sample electric carbon factor time sequence data in the first sample time interval.
[0026] In one of the embodiments, the target electric carbon factor of the target moment in the first sample time interval is determined based on the first initial electric carbon factor time sequence data and the second initial electric carbon factor time sequence data in each of the second sample time intervals, comprising:
[0027] A target time interval including the target moment is determined in the first sample time interval with the target moment as the center.
[0028] In the first initial electric carbon factor time sequence data, first sub-time sequence data corresponding to the target time interval is determined, and in each of the second initial electric carbon factor time sequence data, second sub-time sequence data corresponding to the target time interval is determined.
[0029] According to the first sub time sequence data and each second sub time sequence data, a target electric carbon factor of the target moment in the first sample time interval is determined.
[0030] In one of the embodiments, the determining of the target electric carbon factor of the target moment in the first sample time interval according to the first sub time sequence data and each second sub time sequence data comprises:
[0031] determining a similarity between the first sub time sequence data and each second sub time sequence data;
[0032] performing a fusion processing on an electric carbon factor corresponding to the target moment in each second sub time sequence data based on a similarity corresponding to each second sub time sequence data, to obtain the target electric carbon factor of the target moment in the first sample time interval.
[0033] In a second aspect, the present application further provides an electric carbon factor prediction device, comprising:
[0034] a time interval determination module configured to determine a to-be-predicted time interval and a historical time interval of the to-be-predicted time interval;
[0035] a time feature determination module configured to obtain an interval time feature of the to-be-predicted time interval and an interval time feature of the historical time interval;
[0036] a time sequence data determination module configured to obtain historical electric carbon factor time sequence data in the historical time interval;
[0037] an electric carbon factor prediction module configured to input the interval time feature of the to-be-predicted time interval, the interval time feature of the historical time interval and the historical electric carbon factor time sequence data as input information of a target electric carbon factor prediction model to the target electric carbon factor prediction model, to obtain an electric carbon factor time sequence data prediction result in the to-be-predicted time interval;
[0038] The target electricity carbon factor prediction model comprises a plurality of sequentially connected blocks; each block is configured to obtain fitted historical electricity carbon factor time series data and predicted electricity carbon factor time series data in the to-be-predicted time interval according to input information of the block, extract residual feature between the fitted historical electricity carbon factor time series data and the historical electricity carbon factor time series data, extract trend feature and periodic feature of the fitted historical electricity carbon factor time series data and the predicted electricity carbon factor time series data, and obtain target residual information of the block based on fusion processing of the input information of the block, the residual feature, the trend feature and the periodic feature.
[0039] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0040] determining a to-be-predicted time interval and a historical time interval of the to-be-predicted time interval;
[0041] obtaining interval time feature of the to-be-predicted time interval and interval time feature of the historical time interval, and historical electricity carbon factor time series data in the historical time interval;
[0042] inputting the interval time feature of the to-be-predicted time interval, the interval time feature of the historical time interval and the historical electricity carbon factor time series data as input information of a target electricity carbon factor prediction model into the target electricity carbon factor prediction model, to obtain an electricity carbon factor time series data prediction result in the to-be-predicted time interval;
[0043] The target electricity carbon factor prediction model comprises a plurality of sequentially connected blocks; each block is configured to obtain fitted historical electricity carbon factor time series data and predicted electricity carbon factor time series data in the to-be-predicted time interval according to input information of the block, extract residual feature between the fitted historical electricity carbon factor time series data and the historical electricity carbon factor time series data, extract trend feature and periodic feature of the fitted historical electricity carbon factor time series data and the predicted electricity carbon factor time series data, and obtain target residual information of the block based on fusion processing of the input information of the block, the residual feature, the trend feature and the periodic feature; input information of a first block in each block comprises input information of the target electricity carbon factor prediction model, and input information of each block except the first block in the plurality of blocks comprises target residual information of a previous block of the block.
[0044] In a fourth aspect, the present application also provides a computer readable storage medium, having stored thereon a computer program, which, when executed by a processor, implements the following steps:
[0045] determining a to-be-predicted time interval and a historical time interval of the to-be-predicted time interval;
[0046] obtaining interval time features of the to-be-predicted time interval and the historical time interval, and historical electric carbon factor time series data under the historical time interval;
[0047] inputting the interval time features of the to-be-predicted time interval, the interval time features of the historical time interval and the historical electric carbon factor time series data as input information of a target electric carbon factor prediction model into the target electric carbon factor prediction model, to obtain an electric carbon factor time series data prediction result under the to-be-predicted time interval;
[0048] The target electric carbon factor prediction model comprises a plurality of sequentially connected blocks; each block is configured to obtain fitted historical electric carbon factor time series data and predicted electric carbon factor time series data under the to-be-predicted time interval according to input information of the block, extract residual feature between the fitted historical electric carbon factor time series data and the historical electric carbon factor time series data, extract trend feature and periodic feature of the fitted historical electric carbon factor time series data and the predicted electric carbon factor time series data, and obtain target residual information of the block based on fusion processing of the input information of the block, the residual feature, the trend feature and the periodic feature; the input information of the first block in each block comprises the input information of the target electric carbon factor prediction model, and the input information of each block other than the first block in the plurality of blocks comprises target residual information of a previous block of the block.
[0049] In a fifth aspect, the present application also provides a computer program product, comprising a computer program, which, when executed by a processor, implements the following steps:
[0050] determining a to-be-predicted time interval and a historical time interval of the to-be-predicted time interval;
[0051] obtaining interval time features of the to-be-predicted time interval and the historical time interval, and historical electric carbon factor time series data under the historical time interval;
[0052] inputting the interval time features of the to-be-predicted time interval, the interval time features of the historical time interval and the historical electric carbon factor time series data as input information of a target electric carbon factor prediction model into the target electric carbon factor prediction model, to obtain an electric carbon factor time series data prediction result under the to-be-predicted time interval;
[0053] The target electricity-carbon factor prediction model comprises a plurality of sequentially connected blocks; each block is configured to obtain fitted historical electricity-carbon factor time series data and predicted electricity-carbon factor time series data in the to-be-predicted time interval based on input information of the block, extract residual feature between the fitted historical electricity-carbon factor time series data and the historical electricity-carbon factor time series data, extract trend feature and periodic feature of the fitted historical electricity-carbon factor time series data and the predicted electricity-carbon factor time series data, and obtain target residual information of the block based on fusion processing of the input information of the block, the residual feature, the trend feature and the periodic feature; the input information of the first block in each block comprises input information of the target electricity-carbon factor prediction model, and the input information of each block other than the first block in the plurality of blocks comprises target residual information of a previous block of the block.
[0054] The electricity-carbon factor prediction method, device, computer equipment, computer readable storage medium and computer program product can predict the electricity-carbon factor time series data in the to-be-predicted time interval based on the interval time feature of the to-be-predicted time interval, the interval time feature of the historical time interval of the to-be-predicted time interval, the historical electricity-carbon factor time series data in the historical time interval and the target electricity-carbon factor prediction model, without the need to know the details of power dispatching. In addition, the residual feature extraction, trend feature extraction and periodic feature extraction of each block in the target electricity-carbon factor prediction model can fully capture the time series features of the electricity-carbon factor time series data, thereby more accurately predicting the electricity-carbon factor time series data in the to-be-predicted time interval. Therefore, the electricity-carbon factor prediction method based on the above process improves the prediction accuracy of the electricity-carbon factor. BRIEF DESCRIPTION OF DRAWINGS
[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the description of the embodiments of the present application or the related art will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other related drawings can be obtained by those skilled in the art without creative labor.
[0056] Figure 1 A flowchart of an electricity-carbon factor prediction method in an embodiment;
[0057] Figure 2 A structural diagram of a block in a target electricity-carbon factor prediction model in an embodiment;
[0058] Figure 3 A flowchart of a method for predicting an electricity-carbon factor based on an N-BEATS deep learning model in an embodiment;
[0059] Figure 4 A structural block diagram of an electric carbon factor prediction device in an embodiment is shown in the figure;
[0060] Figure 5 An internal structure diagram of a computer device in an embodiment is shown in the figure. DETAILED DESCRIPTION
[0061] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application.
[0062] It should be noted that the terms "first", "second", and the like used in the present application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "include" and "have" and any variations thereof used in the present application are intended to cover non-exclusive inclusion. The term "multiple" used in the present application refers to two or more. The term "and / or" used in the present application refers to one of the options or any combination of multiple options.
[0063] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant regulations.
[0064] In an exemplary embodiment, as shown in Figure 1 A method for predicting electric carbon factor is provided, and the embodiment is exemplified by applying the method to a server. It should be understood that the method can also be applied to a terminal, and can also be applied to a system including a server and a terminal, and can be realized through the interaction of the server and the terminal. The server can be a stand-alone physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services; the terminal can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, unmanned aerial vehicles, low-altitude flying vehicles, Internet of Things devices, and portable wearable devices. The Internet of Things device can be a smart speaker, a smart television, a smart air conditioner, a smart vehicle device, a projection device, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. The head-mounted device can be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. In the embodiment, the method includes the following steps S102 to S106:
[0065] In step S102, a time interval to be predicted and a historical time interval of the time interval to be predicted are determined.
[0066] Specifically, the server determines a time interval of an electric carbon factor to be predicted, obtains the time interval to be predicted, and obtains a time interval located in time before the time interval to be predicted, to obtain the historical time interval.
[0067] In step S104, interval time features of the time interval to be predicted and the historical time interval, and historical electric carbon factor time series data under the historical time interval are obtained.
[0068] The interval time features refer to time features of the time interval.
[0069] The electric carbon factor time series data includes electric carbon factors at respective time points of the corresponding time interval; in the electric carbon factor time series data, the electric carbon factors are arranged in time sequence according to the respective time points.
[0070] Specifically, the server performs time feature extraction processing on the time interval to be predicted and the historical time interval respectively, to obtain the interval time features of the time interval to be predicted and the interval time features of the historical time interval, and the server obtains the historical electric carbon factor time series data under the historical time interval.
[0071] In step S106, the interval time features of the time interval to be predicted, the interval time features of the historical time interval, and the historical electric carbon factor time series data are input to a target electric carbon factor prediction model as input information of the target electric carbon factor prediction model, to obtain an electric carbon factor time series data prediction result under the time interval to be predicted.
[0072] The electric carbon factor time series data prediction result is the predicted electric carbon factor time series data under the time interval to be predicted.
[0073] The target electricity-carbon factor prediction model comprises a plurality of sequentially connected blocks. Each block is configured to fit the historical electricity-carbon factor time series data in the historical time interval according to input information of the block, to obtain fitted historical electricity-carbon factor time series data, and to predict the electricity-carbon factor time series data in the to-be-predicted time interval, to obtain predicted electricity-carbon factor time series data. The target electricity-carbon factor prediction model obtains the electricity-carbon factor time series data prediction result based on the predicted electricity-carbon factor time series data of each block. The fitted historical electricity-carbon factor time series data is the fitting result of the corresponding block for the electricity-carbon factor time series data in the historical time interval. The predicted electricity-carbon factor time series data is the prediction result of the corresponding block for the electricity-carbon factor time series data in the to-be-predicted time interval. In a specific application, the target electricity-carbon factor prediction model is a neural network model trained in advance. Preferably, the target electricity-carbon factor prediction model is an N-BEATS model (a time series prediction model based on a deep learning neural network and an autoregressive model), the block included in the target electricity-carbon factor prediction model is a Block in the N-BEATS model, the fitted historical electricity-carbon factor time series data is a backcast generated by the Block, and the predicted electricity-carbon factor time series data is a forecast generated by the Block.
[0074] The input information of the first block in each block comprises the input information of the target electricity-carbon factor prediction model, i.e., the interval time features of the to-be-predicted time interval, the interval time features of the historical time interval, and the historical electricity-carbon factor time series data. The input information of each block other than the first block in the plurality of blocks comprises the target residual information of the previous block of the block, and further comprises the input information of the target electricity-carbon factor prediction model, i.e., the interval time features of the to-be-predicted time interval, the interval time features of the historical time interval, and the historical electricity-carbon factor time series data.
[0075] As shown in FIG. 1, each block comprises a residual branch, a trend branch, and a periodic branch. The residual branch is configured to extract residual features between the fitted historical electricity-carbon factor time series data and the historical electricity-carbon factor time series data. The trend branch is configured to extract trend features of the fitted historical electricity-carbon factor time series data and the predicted electricity-carbon factor time series data. The periodic branch is configured to extract periodic features of the fitted historical electricity-carbon factor time series data and the predicted electricity-carbon factor time series data. Each block is further configured to obtain the target residual information of the block based on fusion processing of the input information, the residual features, the trend features, and the periodic features of the block, and transmit the target residual information to the next block as the input information of the next block. Figure 2 In a specific application, each block obtains the target residual information based on the following formula 1:
[0076] (Formula 1)
[0077] wherein k is the serial number of the block, target residual information output for the k-th block; for a residual branch, residual features extracted for the k-th block; for a trend branch, trend features extracted for the k-th block; for a periodic branch, periodic features extracted for the k-th block.
[0078] Specifically, the server inputs the interval time feature of the to-be-predicted time interval, the interval time feature of the historical time interval, and the historical electric carbon factor time series data into the target electric carbon factor prediction model, extracts and learns the features of the interval time feature of the to-be-predicted time interval, the interval time feature of the historical time interval, and the historical electric carbon factor time series data through each block in the target electric carbon factor prediction model, and predicts the electric carbon factor time series data under the to-be-predicted time interval to obtain the prediction result of the electric carbon factor time series data under the to-be-predicted time interval.
[0079] In the above electric carbon factor prediction method, on the one hand, the server can predict the electric carbon factor time series data under the to-be-predicted time interval based on the interval time feature of the to-be-predicted time interval, the interval time feature of the historical time interval of the to-be-predicted time interval, the historical electric carbon factor time series data under the historical time interval, and the target electric carbon factor prediction model, without needing to know the details of power dispatching; on the other hand, the server can fully capture the time series features of the electric carbon factor time series data based on the residual feature extraction, trend feature extraction, and periodic feature extraction of each block in the target electric carbon factor prediction model, thereby more accurately predicting the electric carbon factor time series data under the to-be-predicted time interval; therefore, the electric carbon factor prediction method based on the above process improves the prediction accuracy of the electric carbon factor.
[0080] In an exemplary embodiment, the interval time feature of each time interval in the to-be-predicted time interval and the historical time interval is obtained in the following manner: taking a natural day as a time scale, determining each time point included in the time interval; for each time point, performing sine encoding on the time point to obtain a sine encoding result of the time point, performing cosine encoding on the time point to obtain a cosine encoding result of the time point, performing standardization processing on the time point to obtain a standardization result of the time point, and combining the sine encoding result, the cosine encoding result, and the standardization result of the time point to obtain a time point time feature of the time point; and obtaining the interval time feature of the time interval based on the time point time features of the time points.
[0081] The time point time feature refers to the time feature of the time point.
[0082] Specifically, for each time interval, the server determines the time instants included in the time interval with the natural day as the time scale, for example, determines that the time interval includes 0 o'clock, 1 o'clock, 2 o'clock, 3 o'clock, 4 o'clock, 5 o'clock, 6 o'clock, …, 23 o'clock.
[0083] For each time instant, the server performs sinusoidal encoding on the time instant based on the following formula 2:
[0084] (Formula 2)
[0085] wherein, is the time instant; is the sinusoidal encoding result of the time instant.
[0086] The server performs cosine encoding on the time instant based on the following formula 3:
[0087] (Formula 3)
[0088] wherein, is the time instant; is the cosine encoding result of the time instant.
[0089] The server performs standardization on the time instant based on the following formula 4:
[0090] (Formula 4)
[0091] wherein, is the time instant; is the standardization result of the time instant.
[0092] Then, the server combines the sinusoidal encoding result, the cosine encoding result, and the standardization result of the time instant into a time-instant time feature vector of the time instant , and determines the time-instant time feature vector of the time instant as the time-instant time feature of the time instant.
[0093] Finally, the server combines the time-instant time features of the time instants in the time interval to obtain an interval time feature of the time interval .
[0094] In this embodiment, the power data usually has obvious periodic characteristics, especially daily periodic characteristics (for example, 24-hour fluctuations). In order to make the target electric carbon factor prediction model better capture these periodic characteristics, the server encodes the time instants using sinusoidal transformation, cosine transformation, and standardization, and the target electric carbon factor prediction model can better capture the periodic characteristics of the data and represent the time periodic changes of the data based on the encoded interval time features.
[0095] In an example embodiment, the target electric carbon factor prediction model is trained by determining a plurality of sample time intervals, obtaining sample electric carbon factor time series data in each sample time interval, performing sliding window processing on each sample electric carbon factor time series data to obtain a plurality of time series data segments, dividing each time series data segment into a first data segment and a second data segment after the first data segment for each time series data segment, taking each first data segment, interval time characteristics of a sub-time interval corresponding to each first data segment, and interval time characteristics of a sub-time interval corresponding to each second data segment as input information, taking each second data segment as supervision information, training the electric carbon factor prediction model to be trained to obtain the target electric carbon factor prediction model.
[0096] Each time series data segment includes at least two electric carbon factors.
[0097] Each data segment includes at least one electric carbon factor. The sub-time interval corresponding to each data segment is the sub-time interval corresponding to the data segment in the corresponding sample time interval. The sample time interval corresponding to each data segment is the sample time interval corresponding to the sample electric carbon factor time series data to which the data segment belongs. For example, assuming that each electric carbon factor included in a data segment is an electric carbon factor at the mth moment to the nth moment in the sample time interval corresponding to the data segment, the time interval corresponding to the mth moment to the nth moment in the sample time interval is the sub-time interval corresponding to the data segment.
[0098] Specifically, first, the server determines a plurality of sample time intervals and obtains sample electric carbon factor time series data in each sample time interval.
[0099] Then, the server performs sliding window processing on each sample electric carbon factor time series data. In each sliding window processing process, each electric carbon factor in the window constitutes a time series data segment. The server performs sliding window processing on each sample electric carbon factor time series data based on the above process to obtain a plurality of time series data segments.
[0100] Next, for each time series data segment, the server determines the first L electric carbon factors in the time series data segment as the first data segment and the last L electric carbon factors as the second data segment.
[0101] Finally, for each first data segment, the server takes the first data segment, the interval time feature of the sub-time interval corresponding to the first data segment, and the interval time feature of the sub-time interval corresponding to the second data segment after the first data segment as a group of input information, takes the second data segment after the first data segment as the supervision information of the group of input information, and obtains an input information-supervision information pair corresponding to the first data segment. Then, the server trains the to-be-trained electric carbon factor prediction model based on the input information-supervision information pairs, and obtains the target electric carbon factor prediction model.
[0102] In a specific application, the interval time feature of the sub-time interval is obtained in the same way as the interval time features of the to-be-predicted time interval and the historical time interval, which will not be described herein.
[0103] In this embodiment, based on the sliding window processing and the data segment division processing, the time series data can be effectively converted into standard supervised learning data, so that in the training process, each group of input can correspond to a target. This process helps to convert the time series problem into a traditional regression problem, which is convenient for using a deep learning or machine learning model for prediction.
[0104] In an exemplary embodiment, each sample time interval is determined in units of natural days, that is, each natural day is taken as a sample time interval in the present application. A plurality of sample time intervals are arranged in a corresponding time sequence, for example, the first natural day corresponds to the sample time interval 1, the second natural day corresponds to the sample time interval 2, the third natural day corresponds to the sample time interval 3, and the fourth natural day corresponds to the sample time interval 4. Each sample time interval is arranged in the order of sample time interval 1, sample time interval 2, sample time interval 3, and sample time interval 4.
[0105] The time points included in the sample time interval are determined in units of natural days.
[0106] The above step S202 obtains the sample electric carbon factor time series data under each sample time interval, which specifically includes the following steps: for each first sample time interval, obtaining first initial electric carbon factor time series data under the first sample time interval; determining a target time point corresponding to the first sample time interval based on the first initial electric carbon factor time series data; obtaining a plurality of adjacent sample time intervals of the first sample time interval to obtain each second sample time interval; determining a target electric carbon factor of the target time point under the first sample time interval based on the first initial electric carbon factor time series data and second initial electric carbon factor time series data under each second sample time interval; and combining the first initial electric carbon factor time series data under the first sample time interval and the target electric carbon factor of the target time point under the first sample time interval to obtain the sample electric carbon factor time series data under the first sample time interval.
[0107] The first sample time interval is any one of the sample time intervals.
[0108] The target time is a time at which the missing electricity carbon factor is missing.
[0109] Specifically, for each sample time interval, first, the server determines the sample time interval as the first sample time interval, then determines the initial electricity carbon factor time series data under the first sample time interval as the first initial electricity carbon factor time series data, and then determines the time at which the electricity carbon factor is missing in the first sample time interval based on the first initial electricity carbon factor time series data, to obtain the target time corresponding to the first sample time interval; for example, if the electricity carbon factor corresponding to 13 o'clock is missing in the first initial electricity carbon factor time series data, the server determines 13 o'clock as the target time corresponding to the first sample time interval.
[0110] Next, the server determines each sample time interval adjacent to the first sample time interval as the second sample time interval, and determines the initial electricity carbon factor time series data under each second sample time interval as the second initial electricity carbon factor time series data; for example, the server obtains the first 3 sample time intervals before the first sample time interval and the last 3 sample time intervals after the first sample time interval as the second sample time interval, and determines the initial electricity carbon factor time series data under the 6 second sample time intervals as the second initial electricity carbon factor time series data.
[0111] Then, the server fills in the electricity carbon factor missing at the target time in the first sample time interval based on the first initial electricity carbon factor time series data and each second electricity carbon factor time series data, to determine the target electricity carbon factor at the target time in the first sample time interval; for example, the server determines the electricity carbon factor at 13 o'clock in the first sample time interval based on the initial electricity carbon factor time series data under the first 3 sample time intervals and the last 3 sample time intervals.
[0112] Finally, the server inserts the target electricity carbon factor at the target time in the first sample time interval into the first initial electricity carbon factor time series data to obtain the sample electricity carbon factor time series data in the first sample time interval; for example, the server inserts the determined electricity carbon factor at 13 o'clock in the first sample time interval into the first initial electricity carbon factor time series data to obtain the sample electricity carbon factor time series data in the first sample time interval.
[0113] In this embodiment, the server can fill in the missing electricity carbon factor in the sample time interval based on the initial electricity carbon factor time series data in the adjacent sample time interval, to obtain complete sample electricity carbon factor time series data.
[0114] In one example embodiment, the step of determining the target electric carbon factor of the target time point in the first sample time interval based on the first initial electric carbon factor time series data and the second initial electric carbon factor time series data in each second sample time interval comprises the following steps: determining a target time interval including the target time point in the first sample time interval with the target time point as the center; determining first sub time series data corresponding to the target time interval in the first initial electric carbon factor time series data, and determining second sub time series data corresponding to the target time interval in each second initial electric carbon factor time series data; and determining the target electric carbon factor of the target time point in the first sample time interval according to the first sub time series data and the second sub time series data.
[0115] Specifically, first, the server determines a target time interval including the target time point in the first sample time interval with the target time point as the center; for example, assuming that the target time point is 13 o'clock, the server determines the sub time interval [13-f, 13+f] in the first sample time interval as the target time interval.
[0116] Then, the server determines the sub time series data corresponding to the target time interval in the first initial electric carbon factor time series data as the first sub time series data corresponding to the target time interval, and for each second initial electric carbon factor time series data, the server determines the sub time series data corresponding to the target time interval in the second initial electric carbon factor time series data as the second sub time series data corresponding to the target time interval; for example, the server obtains the time series data corresponding to the time point falling into the target time interval [13-f, 13+f] in the first initial electric carbon factor time series data to obtain the first sub time series data corresponding to the target time interval, and obtains the time series data corresponding to the time point falling into the target time interval [13-f, 13+f] in each second initial electric carbon factor time series data to obtain the second sub time series data corresponding to the target time interval.
[0117] Next, the server fills in the missing electric carbon factor of the target time point in the first sample time interval according to the first sub time series data and the second sub time series data to obtain the target electric carbon factor of the target time point in the first sample time interval.
[0118] In this embodiment, the server can fill in the missing electric carbon factor in the current sample time interval based on the initial electric carbon factor time series data of the same period in the adjacent sample time interval to obtain the complete sample electric carbon factor time series data in the current sample time interval.
[0119] In an example embodiment, the step of determining the target carbon factor of the target time point in the first sample time interval according to the first sub-time sequence data and each second sub-time sequence data comprises the following steps: determining the similarity between the first sub-time sequence data and each second sub-time sequence data; and performing fusion processing on the carbon factor corresponding to the target time point in each second sub-time sequence data based on the similarity corresponding to each second sub-time sequence data to obtain the target carbon factor of the target time point in the first sample time interval.
[0120] Specifically, for each second sub-time sequence data, the server determines the distance between the second sub-time sequence data and the first sub-time sequence data based on DTW (Dynamic Time Warping, DTW) as the similarity between the second sub-time sequence data and the first sub-time sequence data.
[0121] Then, the server normalizes the similarity corresponding to each second sub-time sequence data and takes the normalization result of the similarity corresponding to each second sub-time sequence data as the weight corresponding to the second sub-time sequence data. Then, the server performs fusion processing on the carbon factor corresponding to the target time point in each second sub-time sequence data based on the weight corresponding to each second sub-time sequence data to obtain the target carbon factor of the target time point in the first sample time interval, as shown in formula 5:
[0122] (Formula 5)
[0123] wherein, is the target carbon factor of the target time point in the first sample time interval; is the target carbon factor of the target time point in the first sample time interval; is the number of second sub-time sequence data; is the weight corresponding to the jth second sub-time sequence data; is the target carbon factor of the target time point in the first sample time interval; is the target carbon factor of the target time point in the first sample time interval.
[0124] In a specific application, if the carbon factor corresponding to the target time point is also missing in the second sub-time sequence data, the server determines the carbon factor corresponding to the time point closest to the target time point in the second sub-time sequence data as the carbon factor corresponding to the target time point in the second sub-time sequence data.
[0125] In a specific application, the server can also perform z-score processing on the second sub-time sequence data and the first sub-time sequence data before performing DTW on the second sub-time sequence data and the first sub-time sequence data.
[0126] In this embodiment, the server can fill in the missing electric carbon factor of the current sample time interval based on the electric carbon factor of the same time in the adjacent sample time interval and the similarity between each adjacent sample time interval and the current sample time interval, thereby obtaining the complete sample electric carbon factor time series data of the current sample time interval.
[0127] In one exemplary embodiment, when there is a significant long-term trend in the data, data detrending and differencing operation is an important step in time series analysis. In order to eliminate the trend component in the electric carbon factor time series data (including sample electric carbon factor time series data and historical electric carbon factor time series data), the server converts the time series into a stationary sequence through differencing operation, which helps the stability and accuracy in the subsequent modeling process. Specifically, the differencing operation is implemented through the following formula 6:
[0128] (Formula 6)
[0129] Wherein, is the difference of the electric carbon factor corresponding to the t-th time; is the electric carbon factor before the difference corresponding to the t-th time.
[0130] The server trains the electric carbon factor prediction model to be trained based on the sample electric carbon factor time series data after the differencing operation, or inputs the historical electric carbon factor time series data after the differencing operation into the target electric carbon factor prediction model for electric carbon factor prediction.
[0131] After completing the differencing operation, the data usually has the problem of skew distribution. In order to solve this problem, the server adopts quantization normalization processing to map the original data to the standard normal distribution space, which is realized through the inverse function of the empirical distribution function (i.e. the inverse cumulative distribution function), as shown in formula 7:
[0132] (Formula 7)
[0133] Wherein, is the quantized data value; is the probability value of the original data in the empirical distribution; and is the inverse cumulative distribution function of the empirical distribution. Through formula 7, the original data is effectively mapped to the standard normal distribution space, thereby eliminating the skew distribution problem of the data and providing a more balanced input for subsequent modeling.
[0134] Further, in order to restore the output of the target electric carbon factor prediction model to the original physical scale, the server first performs inverse standardization on the electric carbon factor time series data prediction result, as shown in formula 8:
[0135] (Formula 8)
[0136] where, is the de-normalized value; is the inverse transform function of Formula 7; is the “standard normal domain” value of the model output.
[0137] Then, the server performs a difference sequence restoration, based on the last actual observation value , converts the difference sequence of the model output into the actual electrical carbon factor value through Formula 9, effectively avoiding the cumulative error drift problem:
[0138] (Formula 9)
[0139] where, is the predicted value of the kth prediction point.
[0140] To quantify the prediction uncertainty, the server generates a prediction confidence interval using quantile regression technology, as shown in Formula 10:
[0141] (Formula 10)
[0142] where, is the q-quantile prediction value, is the point prediction value, is the quantile value corresponding to the standard normal distribution, is the prediction standard deviation.
[0143] Innovatively, adaptive Kalman filtering is used to perform post-smoothing processing on the prediction sequence through the state equation as shown in Formula 11 and the observation equation as shown in Formula 12:
[0144] (Formula 11)
[0145] where, is the system state vector, is the state transition matrix, which is dynamically adjusted based on the historical fluctuation pattern within the sliding window, is the process noise.
[0146] (Formula 12)
[0147] where, is the observation value of the system at time k, H is the observation matrix, is the observation noise.
[0148] In order to more clearly illustrate the electric carbon factor prediction method provided by the embodiments of the present application, the electric carbon factor prediction method is specifically described below with one specific embodiment, but it should be understood that the embodiments of the present application are not limited to this. As shown in Figure 3 In one of the exemplary embodiments, the present application also provides a method for predicting electric carbon factor based on N-BEATS deep learning model, specifically comprising the following steps:
[0149] 1. Data preprocessing; reading original data, data interpolation processing, generating interpolation data and performing difference operation and standardization processing. Specifically, input the electric carbon factor flow data, automatically detect and mark abnormal values and missing points, use the day cycle pattern matching algorithm and dynamic time warping algorithm to dynamically fill in the missing values; normalize and standardize the data.
[0150] 2. Training sample generation; divide the training set and the test set. Specifically, the continuous time series is divided into input samples and prediction targets by the sliding window mechanism, forming a supervised learning data set that can be processed by the model and dividing it into a training set and a test set. Further, periodic feature encoding is introduced, such as sine and cosine functions and standardization.
[0151] 3. Model training; initialize the N-BEATS model. Specifically, build the N-BEATS neural network model and train the model using the training set data.
[0152] 4. Model inference; specifically, use the trained model to predict the future electric carbon factor; perform inverse normalization and inverse difference processing on the prediction results to obtain the final electric carbon factor prediction value, achieving accurate dynamic electric carbon factor prediction.
[0153] In this embodiment, the electric carbon factor prediction method based on N-BEATS model is proposed, which can automatically learn the seasonal changes from the data and does not rely on explicit feature engineering, with stronger adaptive ability. Secondly, periodic feature encoding (through hour sine and cosine functions and standardization) is introduced to enhance the model's ability to capture periodic fluctuations of electric carbon factor such as daily and annual cycles. This feature encoding enables the model to automatically adapt to changes in time periodicity in electric carbon factor, improving prediction accuracy. Thirdly, a day cycle pattern matching interpolation method based on electric carbon factor characteristics is proposed, which uses the dynamic time warping algorithm (DTW) to calculate the similarity weight of missing values. This method not only improves the accuracy of data filling, but also can flexibly adjust the filling strategy according to the actual characteristics of the time series.
[0154] It should be understood that although each step in the flowchart involved in the above-described embodiments is shown in sequence according to the direction of the arrow, these steps are not necessarily executed in the order indicated by the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other orders. Moreover, at least some of the steps in the flowchart involved in the above-described embodiments can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least some of the other steps or steps or stages in other steps. It can be understood that the steps in different embodiments can be freely combined as needed, and various non-contradictory schemes formed by the combination are within the scope of protection of the present application.
[0155] Based on the same inventive concept, the embodiments of the present application also provide an electric carbon factor prediction device for implementing the above-mentioned electric carbon factor prediction method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more electric carbon factor prediction device embodiments provided below can refer to the limitations of the electric carbon factor prediction method in the above text, which will not be repeated here.
[0156] In one exemplary embodiment, as shown in Figure 4 An electric carbon factor prediction device is provided, comprising: a time interval determination module 402, a time feature determination module 404, a time series data determination module 406, and an electric carbon factor prediction module 408, wherein:
[0157] The time interval determination module 402 is configured to determine a to-be-predicted time interval and a historical time interval of the to-be-predicted time interval.
[0158] The time feature determination module 404 is configured to obtain interval time features of the to-be-predicted time interval and interval time features of the historical time interval.
[0159] The time series data determination module 406 is configured to obtain historical electric carbon factor time series data in the historical time interval.
[0160] The electric carbon factor prediction module 408 is configured to input the interval time features of the to-be-predicted time interval, the interval time features of the historical time interval, and the historical electric carbon factor time series data as input information of a target electric carbon factor prediction model into the target electric carbon factor prediction model, to obtain an electric carbon factor time series data prediction result in the to-be-predicted time interval.
[0161] The target carbon factor prediction model comprises multiple sequentially connected blocks. Each block is used to obtain fitted historical carbon factor time-series data and predicted carbon factor time-series data for the time interval to be predicted, based on the block's input information. It also extracts residual features between the fitted historical carbon factor time-series data and the predicted carbon factor time-series data, as well as trend and periodic features. Based on the fusion processing of the block's input information, residual features, trend features, and periodic features, the target residual information for the block is obtained. The input information of the first block in each block includes the input information of the target carbon factor prediction model. The input information of each block (excluding the first block) includes the target residual information of the block preceding it.
[0162] In an exemplary embodiment, the time feature determination module 404 is further configured to determine the moments included in the time interval using natural days as the time scale; the time interval is determined in units of natural days; for each moment, the moment is sine-encoded to obtain the sine-encoded result of the moment, the moment is cosine-encoded to obtain the cosine-encoded result of the moment, the moment is standardized to obtain the standardized result of the moment, and the sine-encoded result, cosine-encoded result and standardized result of the moment are combined to form the moment time feature of the moment; based on the moment time feature of each moment, the interval time feature of the time interval is obtained.
[0163] In an exemplary embodiment, the electrocarbon factor prediction device further includes a prediction model training module, which is used to determine multiple sample time intervals, acquire sample electrocarbon factor time series data for each sample time interval; perform sliding window processing on each sample electrocarbon factor time series data to obtain multiple time series data segments; for each time series data segment, divide the time series data segment into a first data segment and a second data segment after the first data segment; use the time features of each first data segment, the time features of the sub-time intervals corresponding to each first data segment, and the time features of the sub-intervals of the time intervals corresponding to each second data segment as input information, and use each second data segment as supervision information to train the electrocarbon factor prediction model to be trained, and obtain the target electrocarbon factor prediction model.
[0164] In one exemplary embodiment, each sample time interval is determined in calendar days; multiple sample time intervals are arranged sequentially according to their corresponding time order.
[0165] The prediction model training module is further configured to, for each first sample time interval, acquire first initial electric carbon factor time series data in the first sample time interval; the first sample time interval is any one of the sample time intervals; determine a target moment corresponding to the first sample time interval based on the first initial electric carbon factor time series data; the target moment is a moment at which the electric carbon factor is missing; acquire a plurality of adjacent sample time intervals of the first sample time interval to obtain each second sample time interval; determine a target electric carbon factor of the target moment in the first sample time interval based on the first initial electric carbon factor time series data and second initial electric carbon factor time series data in each second sample time interval; and combine the first initial electric carbon factor time series data in the first sample time interval and the target electric carbon factor of the target moment in the first sample time interval to obtain sample electric carbon factor time series data in the first sample time interval.
[0166] In an exemplary embodiment, the prediction model training module is further configured to determine a target time interval including the target moment in the first sample time interval with the target moment as the center; determine first sub-time series data corresponding to the target time interval in the first initial electric carbon factor time series data, and determine second sub-time series data corresponding to the target time interval in each second initial electric carbon factor time series data; and determine the target electric carbon factor of the target moment in the first sample time interval according to the first sub-time series data and each second sub-time series data.
[0167] In an exemplary embodiment, the prediction model training module is further configured to determine a similarity between the first sub-time series data and each second sub-time series data; and perform fusion processing on the electric carbon factor of the target moment corresponding to each second sub-time series data based on the similarity corresponding to each second sub-time series data to obtain the target electric carbon factor of the target moment in the first sample time interval.
[0168] Each of the above electric carbon factor prediction devices can be realized by software, hardware, and a combination thereof in whole or in part. Each of the above modules can be embedded in or independent of a processor in a computer device in a hardware form, or can be stored in a memory in a computer device in a software form, so as to be called and executed by a processor to perform operations corresponding to each of the above modules.
[0169] In an exemplary embodiment, a computer device is provided, which can be a server, and an internal structure diagram of the computer device can be as shown in Figure 5As shown in the figure. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through the system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capability. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the electric carbon factor data. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with the terminal outside through the network connection. The computer program is executed by the processor to realize an electric carbon factor prediction method.
[0170] Those skilled in the art can understand that, Figure 5 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0171] In an exemplary embodiment, a computer device is also provided, including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to realize the steps in each of the method embodiments described above.
[0172] In an exemplary embodiment, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to realize the steps in each of the method embodiments described above.
[0173] In an exemplary embodiment, a computer program product is provided, including a computer program, and the computer program is executed by a processor to realize the steps in each of the method embodiments described above.
[0174] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. The non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. The volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., without being limited thereto.
[0175] The technical features of the above embodiments can be combined in any manner. To make the description concise, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not exist contradictions, they should be considered as the scope of the present application.
[0176] The above-described embodiments are merely illustrative of several embodiments of the present application, and the description is relatively specific and detailed, but should not be understood as a limitation on the scope of the patent. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.
Claims
1. A method for predicting the electrocarbon factor, characterized in that, The method includes: Determine the time interval to be predicted and the historical time interval of the time interval to be predicted; Obtain the interval time characteristics of the time interval to be predicted and the interval time characteristics of the historical time interval, as well as the historical time series data of the carbon factor under the historical time interval; The time characteristics of the time interval to be predicted, the time characteristics of the historical time interval, and the historical time series data of the electric carbon factor are used as input information to the target electric carbon factor prediction model to obtain the prediction result of the time series data of the electric carbon factor under the time interval to be predicted. The target carbon factor prediction model comprises multiple sequentially connected blocks. Each block is used to obtain fitted historical carbon factor time-series data and predicted carbon factor time-series data under the time interval to be predicted based on the input information of the block; extract residual features between the fitted historical carbon factor time-series data and the historical carbon factor time-series data; extract trend features and periodic features between the fitted historical carbon factor time-series data and the predicted carbon factor time-series data; and obtain target residual information of the block based on the fusion processing of the input information, residual features, trend features, and periodic features of the block. The input information of the first block in each block includes the input information of the target carbon factor prediction model, and the input information of each block other than the first block includes the target residual information of the block preceding the block.
2. The method according to claim 1, characterized in that, The interval time characteristics of each time interval in the time interval to be predicted and the historical time interval are obtained in the following way: Using the calendar day as the time scale, determine the moments included in the time interval; For each time moment, sine coding is performed on the time moment to obtain the sine coding result of the time moment, cosine coding is performed on the time moment to obtain the cosine coding result of the time moment, and standardization processing is performed on the time moment to obtain the standardization result of the time moment. The sine coding result, the cosine coding result and the standardization result of the time moment are combined to form the time feature of the time moment. Based on the time characteristics of each of the stated moments, the time characteristics of the time interval are obtained.
3. The method according to claim 1 or 2, characterized in that, The target electrocarbon factor prediction model was trained in the following manner: Multiple sample time intervals are determined, and time-series data of sample carbon factor under each sample time interval are obtained; A sliding window process is performed on the time-series data of the electrocarbon factor of each sample to obtain multiple time-series data segments; For each time-series data segment, the time-series data segment is divided into a first data segment and a second data segment following the first data segment; Using the time features of each first data segment, the time intervals of the sub-time intervals corresponding to each first data segment, and the time features of the sub-intervals of the time intervals corresponding to each second data segment as input information, and using each second data segment as supervision information, the target carbon factor prediction model is trained to obtain the target carbon factor prediction model.
4. The method according to claim 3, characterized in that, Each of the sample time intervals is determined in calendar days; multiple sample time intervals are arranged sequentially according to their corresponding time order. The acquisition of time-series data of sample electrocarbon factor for each of the sample time intervals includes: For each first sample time interval, the time series data of the first initial electrocarbon factor under the first sample time interval is obtained; the first sample time interval is any one of the sample time intervals. Based on the time series data of the first initial electrocarbon factor, the target time corresponding to the first sample time interval is determined; the target time is the time when the electrocarbon factor is missing. Obtain multiple adjacent sample time intervals of the first sample time interval to obtain each second sample time interval; Based on the first initial electrocarbon factor time series data and the second initial electrocarbon factor time series data under each second sample time interval, the target electrocarbon factor at the target time under the first sample time interval is determined. By combining the time series data of the first initial electrocarbon factor under the first sample time interval and the target electrocarbon factor at the target time under the first sample time interval, the time series data of the sample electrocarbon factor under the first sample time interval is obtained.
5. The method according to claim 4, characterized in that, The step of determining the target carbon factor at the target time within the first sample time interval based on the first initial carbon factor time series data and the second initial carbon factor time series data for each of the second sample time intervals includes: Centered on the target time, a target time interval including the target time is determined in the first sample time interval; In the first initial electric carbon factor time series data, a first sub-time series data corresponding to the target time interval is determined, and in each second initial electric carbon factor time series data, a second sub-time series data corresponding to the target time interval is determined; Based on the first sub-time series data and each of the second sub-time series data, the target electrocarbon factor at the target time within the first sample time interval is determined.
6. The method according to claim 5, characterized in that, The step of determining the target electrocarbon factor of the target time within the first sample time interval based on the first sub-time series data and each of the second sub-time series data includes: Determine the similarity between the first sub-time series data and each of the second sub-time series data; Based on the similarity of each of the second sub-time series data, the electrocarbon factor corresponding to the target time in each of the second sub-time series data is fused to obtain the target electrocarbon factor of the target time in the first sample time interval.
7. A device for predicting electrocarbon factors, characterized in that, The device includes: The time interval determination module is used to determine the time interval to be predicted and the historical time interval of the time interval to be predicted; The time feature determination module is used to obtain the interval time features of the time interval to be predicted and the interval time features of the historical time interval. The time-series data determination module is used to acquire historical time-series data of the electric carbon factor within the historical time interval; The electric carbon factor prediction module is used to input the interval time characteristics of the time interval to be predicted, the interval time characteristics of the historical time interval, and the historical electric carbon factor time series data as input information to the target electric carbon factor prediction model, and obtain the electric carbon factor time series data prediction result under the time interval to be predicted. The target carbon factor prediction model comprises multiple sequentially connected blocks. Each block is used to obtain fitted historical carbon factor time-series data and predicted carbon factor time-series data under the time interval to be predicted based on the input information of the block; extract residual features between the fitted historical carbon factor time-series data and the historical carbon factor time-series data; extract trend features and periodic features between the fitted historical carbon factor time-series data and the predicted carbon factor time-series data; and obtain target residual information of the block based on the fusion processing of the input information, residual features, trend features, and periodic features of the block. The input information of the first block in each block includes the input information of the target carbon factor prediction model, and the input information of each block other than the first block includes the target residual information of the block preceding the block.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.