Energy and carbon data prediction and diagnosis method for energy chemical enterprise

Through improved WGAN, GRU and SHAP models, the pattern collapse and gradient disappearance in the prediction of energy consumption and carbon emissions of chemical enterprises is solved, the data quality and prediction accuracy are improved, and efficient diagnosis of energy consumption and carbon emissions are achieved. .

CN119204297APending Publication Date: 2024-12-27SHANGHAI JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411194485.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

Chemical companies are difficult to predict energy consumption and carbon emission data, existing GAN models are prone to defects such as pattern collapse and gradient disappearance, and the original data set is sparse, so the generated data quality is not high.

Method used

Adopting improved WGAN model, GRU model and SHAP model, high-quality data samples are generated through data preprocessing, feature extraction and projection transformation. The improved WGAN model introduces gradient punishment technology to improve training stability and data through GRU model Forecast, SHAP model analyzes outliers.

Benefits of technology

The quality of generated data is improved, the stability and prediction effect of the model are enhanced, the problem of scarce data is solved, and accurate prediction and diagnosis of energy consumption and carbon emissions are achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119204297A_ABST
    Figure CN119204297A_ABST
Patent Text Reader

Abstract

The invention relates to an energy and carbon data prediction and diagnosis method for an energy chemical enterprise. The method comprises the following steps: S1, acquiring historical data; s2, acquiring the preprocessed data; s3, acquiring feature data; s4, calculating a covariance matrix for the feature data; s5, solving a characteristic value and a characteristic vector of the covariance matrix; s6, selecting feature vectors corresponding to the feature values as principal components; s7, synthesizing the main components into a projection matrix; s8, acquiring data after projection; s9, carrying out serialization processing on the projected data to obtain sequence data; s10, converting the sequence data into a tensor format; and S11, inputting the data in the tensor format into the trained prediction diagnosis model to obtain a prediction diagnosis result. Compared with the prior art, the method has the advantages of reducing the defects of mode collapse, gradient disappearance and the like, improving the quality of generated data and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of energy-carbon management, and in particular to a method for predicting and diagnosing energy-carbon data of energy and chemical enterprises. Background Art

[0002] At present, domestic chemical companies have the following problems that need to be solved urgently: chemical companies have multiple process plants and various products, and the process information between each process production area is independent of each other, resulting in information islands; there are data exchange barriers between the management systems at all levels of chemical companies, which makes it difficult for companies to supervise and predict energy consumption and carbon emissions; each independent system within the company needs to be maintained separately, with high operation and maintenance costs, and there is duplicate configuration of software and hardware; the data flows of multiple business systems are independent and complex, with a large number of redundant interfaces and duplicate information flows; traditional management methods rely heavily on manual statistics and calculations, making it difficult to achieve real-time monitoring, analysis and further prediction of data.

[0003] Existing technology can use the common GAN model to predict energy and carbon data of energy and chemical companies. However, the GAN model is prone to defects such as mode collapse and gradient disappearance. In addition, the original data set is sparse and the quality of the expanded generated data is not high, resulting in poor detection effect of the trained model. Summary of the invention

[0004] The purpose of the present invention is to provide a method for predicting and diagnosing energy and carbon data of energy and chemical enterprises in order to reduce defects such as mode collapse and gradient disappearance and improve the quality of generated data.

[0005] The purpose of the present invention can be achieved by the following technical solutions:

[0006] A method for predicting and diagnosing energy and carbon data of an energy and chemical enterprise, the method comprising the following steps:

[0007] S1. Obtain the historical data of the output of various products of energy and chemical enterprises and the historical data of coal consumption and electricity consumption;

[0008] S2, preprocessing the data acquired in S1 to obtain preprocessed data;

[0009] S3, standardize the preprocessed data to obtain feature data;

[0010] S4, calculating the covariance matrix for the feature data;

[0011] S5. Solve the eigenvalues ​​and eigenvectors of the covariance matrix;

[0012] S6. According to the size of the eigenvalue, select the eigenvectors corresponding to the first k largest eigenvalues ​​as the principal components;

[0013] S7, principal components are synthesized into a projection matrix;

[0014] S8, projecting the feature data into a new space defined by the principal components based on the projection matrix to obtain projected data;

[0015] S9, serializing the projected data to obtain sequence data;

[0016] S10, converting the sequence data into a tensor format;

[0017] S11. Inputting the data in tensor format into the trained predictive diagnosis model to obtain a predictive diagnosis result. The trained predictive diagnosis model consists of an improved WGAN model, a GRU model and a SHAP model. The improved WGAN model is used to generate samples to achieve data expansion.

[0018] Furthermore, the training process of the improved WGAN model is:

[0019] A1. Randomly initialize the parameters of the generator G and discriminator D of the WGAN network.

[0020] A2. Extract a batch of real samples x from the real data distribution;

[0021] A3. Extract a batch of noise z from the prior noise distribution and generate a batch of initial pseudo samples G'(z) through the generator;

[0022] A4. Construct the total loss of the discriminator to update the parameters of the discriminator D to maximize the Wasserstein distance;

[0023] A5. Fix the parameters of the discriminator D and update the parameters of the generator G.

[0024] A6. Generate a pseudo sample G(z) after updating the parameters, evaluate the pseudo sample G(z) based on the discriminator D, and the output of the discriminator D is D(G(z));

[0025] A7. Construct the loss function of the generator and update the parameters of the generator G to minimize -D(G(z)).

[0026] A8. Repeat A2 to A7, alternately train the discriminator and the generator until the quality of the generated samples reaches a predetermined standard or the number of training iterations reaches a preset upper limit, then stop the training to obtain an improved WGAN model. After the improved WGAN model obtains data in tensor format, it outputs generated samples, and the generated samples are used to train the GRU model.

[0027] Furthermore, the total loss of the discriminator is:

[0028]

[0029] in, is the interpolation between the real sample x and the pseudo sample G(z), ∈ is a random number drawn from the uniform distribution U(0,1), λ is the hyperparameter of the gradient penalty, and E represents the mathematical expectation of the distribution specified in the subscript.

[0030] Furthermore, the loss function of the generator is:

[0031] L G = -E[D(G(z))]

[0032] Here, E represents the mathematical expectation of the distribution specified in the subscript.

[0033] Furthermore, the optimization process objective function of the improved WGAN model is:

[0034]

[0035] Where E is the mathematical expectation of the distribution specified in the subscript, P data(x) is the distribution of the real sample x; P z(z) is the distribution of generated data; D(x) is the discriminant function of the discriminator; G(z) is the data generated by the generator, that is, the pseudo sample.

[0036] Furthermore, the specific steps of preprocessing the data acquired by S1 are:

[0037] Extract the required data from the data obtained by S1, including the predicted target variables and feature variables;

[0038] Perform data analysis on the extracted data to obtain data statistics;

[0039] For missing values ​​in the extracted data, a linear regression model is used to predict and fill in the missing values;

[0040] The outliers and duplicate values ​​in the filled data are processed by direct deletion to obtain the preprocessed data.

[0041] Furthermore, the covariance matrix is ​​specifically:

[0042]

[0043] Where ∑ is the covariance matrix, n is the number of samples, X std Represents feature data.

[0044] Furthermore, the projected data is specifically:

[0045] Y=X std P

[0046] Where Y is the projected data, P = [v1, v2, ..., v k ] is the projection matrix, v1, v2, …, v k is the selected principal component eigenvector, X std Represents feature data.

[0047] Furthermore, the GRU model is used to predict the output data and power consumption data of various products of energy and chemical enterprises.

[0048] Furthermore, the SHAP model is used to analyze abnormal values ​​in the output data of various products and power consumption data of energy and chemical enterprises.

[0049] Compared with the prior art, the present invention has the following beneficial effects:

[0050] The present invention improves the traditional GAN ​​model and adopts an improved WGAN model structure. The improved WGAN model calculates the gradient on the straight line between the real sample and the pseudo sample and penalizes its deviation from 1 as part of the loss function. While satisfying the Lipschitz continuity constraint of the Wasserstein distance, the improved WGAN model introduces a gradient penalty technology. The gradient of the discriminator is penalized so that the gradient of the discriminator is kept within a certain range, thereby improving the stability of training. On this basis, the data samples generated based on the improved WGAN model have similar distribution characteristics to the original data samples, thereby improving the quality of the generated data. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 is a flow chart of the present invention;

[0052] Figure 2 This is a structural diagram of the energy-carbon dual control management platform corresponding to the method of the present invention;

[0053] Figure 3 This is the structural diagram of the energy-carbon dual control management platform and the data flow diagram of the prediction and diagnosis module in the energy-carbon dual control management platform. DETAILED DESCRIPTION

[0054] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.

[0055] The present invention proposes a method for predicting and diagnosing energy and carbon data of energy and chemical enterprises. The flowchart of the method is as follows: Figure 1 As shown, the method comprises the following steps:

[0056] S1. Obtain the historical data of the output of various products of energy and chemical enterprises and the historical data of coal consumption and electricity consumption;

[0057] S2, preprocessing the data acquired in S1 to obtain preprocessed data;

[0058] S3, standardize the preprocessed data to obtain feature data;

[0059] S4, calculating the covariance matrix for the feature data;

[0060] S5. Solve the eigenvalues ​​and eigenvectors of the covariance matrix;

[0061] S6. According to the size of the eigenvalue, select the eigenvectors corresponding to the first k largest eigenvalues ​​as the principal components;

[0062] S7, principal components are synthesized into a projection matrix;

[0063] S8, projecting the feature data into a new space defined by the principal components based on the projection matrix to obtain projected data;

[0064] S9, serializing the projected data to obtain sequence data;

[0065] S10, converting the sequence data into a tensor format;

[0066] S11. Inputting the data in tensor format into the trained predictive diagnosis model to obtain a predictive diagnosis result. The trained predictive diagnosis model consists of an improved WGAN model, a GRU model and a SHAP model. The improved WGAN model is used to generate samples to achieve data expansion.

[0067] In S1, historical data on the output of various products of energy and chemical enterprises as well as historical data on coal consumption and electricity consumption are obtained, including data at different time points;

[0068] In S2, useful data is extracted, the data is analyzed, and missing values, outliers, and duplicate values ​​in the data are processed to ensure data quality.

[0069] The specific steps of S2 are:

[0070] Step 2.1: Extract the required data from the data source, including the predicted target variables and feature variables;

[0071] Step 2.2: Analyze the extracted data to check the data type, missing values, outliers, and statistical data such as mean, standard deviation, maximum and minimum values;

[0072] Step 2.3: For missing values ​​in the data, use the linear regression model to predict and fill the missing values;

[0073] Step 2.4: Directly delete the outliers and duplicate values ​​in the data.

[0074] In S3, the data is standardized by subtracting the mean of each feature and then dividing it by its standard deviation to avoid the impact of different dimensions of different features on model training. The standardization formula is as follows:

[0075]

[0076] In the formula, X std represents the feature data, X represents the feature data before processing, μ represents the feature mean, and σ represents the feature standard deviation.

[0077] In S4, the covariance matrix is ​​calculated for the features. The formula for calculating the covariance matrix is ​​as follows:

[0078]

[0079] Where ∑ is the covariance matrix and n is the number of samples.

[0080] In S5, the eigenvalues ​​and eigenvectors of the covariance matrix are solved, and the solution formula is as follows:

[0081] det(∑-λI)=0

[0082] (∑-λI)v=0

[0083] Where λ is the eigenvalue, I is the identity matrix, and v is the eigenvector.

[0084] In S6, according to the size of the eigenvalues, the eigenvectors corresponding to the first k largest eigenvalues ​​are selected as principal components. These eigenvalues ​​represent the variance of the data in the direction of these eigenvectors, that is, the amount of information in the data.

[0085] In S7, the selected eigenvectors are synthesized into a projection matrix P = [v1, v2, ...v k ], where v1, v2, …, v k is the selected principal component eigenvector.

[0086] In S8, the projection matrix is ​​used to project the original data into a new space defined by the principal components. The projection formula is as follows:

[0087] Y=X std P

[0088] Where Y is the projected data.

[0089] In S9, the projected data is serialized to convert the time series data into sequence data suitable for neural network input.

[0090] In S10, the data is converted into a format suitable for neural network input, and the tensor format is used to facilitate the subsequent neural network input.

[0091] In S11, the improved WGAN-GRU-SHAP model is trained using the data, and the actual data is input into the trained model.

[0092] The improved WGAN-GRU-SHAP model includes:

[0093] In response to the defects of traditional GAN ​​models such as mode collapse and gradient disappearance, the improved WGAN model introduces the Wasserstein distance to solve the training instability and achieve uniform distribution of generated samples, thereby improving the quality of samples.

[0094] The objective function of the improved WGAN model optimization process is as follows:

[0095]

[0096] Where E is the mathematical expectation of the distribution specified in the subscript; Pdata(x) is the distribution of the real data x; Pz(z) is the distribution of the generated data; D(x) is the discriminant function of the discriminator; G(z) is the data generated by the updated generator.

[0097] The generator network of the improved WGAN model consists of an input layer, a fully connected layer, a convolutional layer, a deconvolutional layer, a batch normalization layer, and an output layer. The generator network is responsible for generating realistic data samples.

[0098] The discriminator network of the improved WGAN model consists of an input layer, a convolution layer, a reshape layer, a softmax layer, and an output layer. The discriminator network is responsible for distinguishing between generated fake samples and real samples.

[0099] In order to satisfy the Lipschitz continuity constraint of the Wasserstein distance, the improved WGAN model introduces the gradient penalty technology. By penalizing the gradient of the discriminator, the gradient of the discriminator is kept within a certain range, thereby improving the stability of training.

[0100] The improved WGAN model is trained on the processed data. The generator and discriminator are trained by minimizing the Wasserstein distance. During the training process, the generator and discriminator compete with each other until a balance is reached.

[0101] The processed data is expanded by generating new data samples through the trained generator to solve the problem of sparse data in the original data set. The generated data samples have similar distribution characteristics to the original data samples.

[0102] The original data samples are mixed with the generated data samples to form a new data set, which is divided into a training set and a test set. 80% of the data is used for training and 20% of the data is used for testing.

[0103] The improved GRU model is based on RMSProp optimization. The RMSprop optimizer has the advantages of high computational efficiency and applicability to unstable objective functions.

[0104] The improved GRU model adds a Dropout layer to reduce the risk of overfitting;

[0105] Each gated recurrent unit of the improved GRU model includes: an update gate and a reset gate; the update gate is used to control the hidden state output of the previous moment and the degree to which the hidden state input of the current moment is brought into the hidden state of the current moment; the reset gate is used to control the hidden state output of the previous moment to flow into the candidate hidden state of the current moment;

[0106] Determine the hyperparameters of the improved GRU model, such as the number of layers and the number of neurons in each layer, design and build a suitable network structure, select the mean square error loss function as the loss function of the model, select the Adam optimizer as the optimizer of the model, and compile the neural network model.

[0107] The improved GRU model optimized the hyperparameters based on the Bayesian optimization algorithm, with 30 optimization iterations.

[0108] The improved GRU model introduces the attention mechanism, which can assign weights according to the importance of elements, using high weights for important information and low weights for irrelevant or unimportant information;

[0109] The pre-processed training data is input into the compiled model, with the historical data of the output of each product of the energy and chemical enterprises as features, and the historical data of coal consumption and electricity consumption as labels. The model is trained and the model parameters are continuously adjusted through the back propagation algorithm to minimize the loss function. At the same time, the performance of the model on the training set is monitored, and the changes in the loss function are observed to avoid overfitting or underfitting.

[0110] Input the test set into the trained model, evaluate the model's performance on unseen data, and calculate the error between the predicted result and the true value;

[0111] Analyze the performance of the model on the test set to understand the model's predictive and generalization capabilities;

[0112] According to the characteristics of the prediction results and data sets, the SHAP model is input for analysis to obtain the impact of different characteristics on the prediction results and realize the diagnosis of energy and chemical enterprises.

[0113] The improved WGAN model training method in the above model is:

[0114] Step 1: Randomly initialize the parameters of the generator G and the discriminator D;

[0115] Step 2: Extract a batch of real samples x from the real data distribution;

[0116] Step 3: Extract a batch of noise z from the prior noise distribution and generate a batch of pseudo samples G(z) through the generator;

[0117] Step 4: Update the parameters of the discriminator D so that the Wasserstein distance can be maximized. The loss function of the discriminator consists of two parts: the distance between the real sample and the fake sample, and the gradient penalty term. The gradient penalty is implemented by calculating the gradient on the straight line between the real sample and the fake sample and penalizing its deviation from 1. The total loss L of the discriminator is D The calculation formula is as follows:

[0118]

[0119] In the formula, is the interpolation between the real sample x and the pseudo sample G(z), ∈ is a random number drawn from the uniform distribution U(0,1), and λ is the hyperparameter of the gradient penalty;

[0120] Step 5: Fix the parameters of the discriminator D and update the parameters of the generator G;

[0121] Step 6: Generate a batch of pseudo samples G(z) and evaluate them through the discriminator D;

[0122] Step 7: Update the parameters of the generator G to minimize -D(G(z)). The loss function of the generator is calculated as follows:

[0123] L G = -E{D(G(z))]

[0124] Step 8: Repeat steps 2 to 7, alternately training the discriminator and the generator. During the training process, regularly evaluate the quality of the samples generated by the generator. If the quality of the generated samples reaches the predetermined standard or the number of training iterations reaches the preset upper limit, stop the training.

[0125] The processed data is expanded by generating new data samples through the trained generator to solve the problem of sparse data in the original data set. The generated data samples have similar distribution characteristics to the original data samples.

[0126] The original data samples are mixed with the generated data samples to form a new data set, which is divided into a training set and a test set. 80% of the data is used for training and 20% of the data is used for testing.

[0127] By adopting the above method, the present invention can establish an energy-carbon dual control management platform corresponding to the method, and the structure diagram of the platform is as follows: Figure 2 As shown, the management platform includes a data acquisition module, a data transmission module, a data preprocessing module, a data storage module, and a data application module;

[0128] Data acquisition module: The data acquisition module collects real-time data related to energy consumption from different equipment in different plants of energy and chemical enterprises, and obtains historical data from the historical database of the original data monitoring center of the plant, including various sensors and other acquisition equipment;

[0129] The data transmission module is responsible for data transmission between various modules, including transmitting the real-time data collected by the data acquisition module to the data preprocessing module, transmitting the data processed by the data preprocessing module to the data storage module, and transmitting the data between the data storage module and the data application module;

[0130] Data preprocessing module: The data preprocessing module is responsible for cleaning the raw data transmitted from the data acquisition module and summarizing the cleaned data;

[0131] The data storage module is responsible for storing the data processed by the data preprocessing module in layers, which is convenient for subsequent modules to view and call the data. On the other hand, it is also responsible for storing the real energy consumption and carbon emission data analyzed by the data application module and the predicted values ​​of future energy consumption and carbon emission data;

[0132] Data application module: The data application module obtains processed real-time data and historical data from the data storage module, calculates the relevant data in accordance with relevant national standards, obtains the company's energy consumption data and carbon emission data, and generates corresponding reports for managers to view. The data application module will also train prediction models for historical data and generate and call prediction models for real-time data to obtain and display prediction results, and diagnose the impact of features on prediction results.

[0133] The data acquisition module includes various sensors and other acquisition devices, which directly collect relevant data from the underlying equipment of energy and chemical enterprises.

[0134] The data transmission module uses MQTT and AMQP protocols as data transmission protocols, and uses RabbitMQ to build a data cache queue.

[0135] The data preprocessing module performs data cleaning and data aggregation on the original data. The data cleaning includes outlier detection, data filtering and missing value interpolation processing.

[0136] The data storage module stores the cleaned real-time data and historical data in the relational MySQL and non-relational MongDB databases, and stores the energy consumption and carbon emission data of different plant areas that need to be calculated separately.

[0137] The data application modules include:

[0138] Accounting module: The accounting module obtains real-time data and historical data that have been cleaned from the data storage module, and obtains energy consumption and carbon emission algorithms for different plant areas based on relevant national standards and the process algorithm logic of energy and chemical companies producing various products, and inputs the data into the algorithm for accounting;

[0139] Report module: The report module integrates the results calculated by the accounting module, and obtains the energy consumption and carbon emission report of the entire energy and chemical enterprise according to the time sequence of different years and months and the spatial sequence of different plant areas;

[0140] Monitoring module: The monitoring module can monitor the current metering quantity of different equipment in different factory areas in real time, and can also display the historical data of factory equipment through calling;

[0141] Planning module: The planning module can comparatively display the gap between current energy consumption and emissions and planned energy consumption and emissions, so that managers can better regulate future energy consumption and carbon emissions;

[0142] Prediction and diagnosis module: The prediction and diagnosis module first trains the historical data obtained from the data storage module to generate a corresponding training model to predict the energy consumption and emissions in the future. Then, it obtains real-time data from the data storage module and inputs the previously trained prediction model to obtain the energy consumption and emissions in the future. Finally, it performs feature analysis on the prediction results to realize the diagnosis of energy consumption and carbon emissions. The data flow diagram of the prediction and diagnosis module is shown below. Figure 3 shown.

[0143] The present invention optimizes the data flow according to the actual data characteristics of energy and chemical enterprises, effectively solves the problems of real-time processing and storage of massive data, and uses big data processing to realize data acquisition, data cleaning, data aggregation, algorithm development, prediction model training, cycle prediction and other functions, and finally realizes the optimization of energy consumption and carbon emissions of energy and chemical enterprises, and can provide energy consumption and carbon emissions prediction results for a period of time in the future. The system provided by the present invention integrates intelligent equipment, big data processing platform and core algorithm, with a high level of integration, which can meet the needs of intelligent operation of energy and chemical enterprises in the future, improve the intelligence level of energy and chemical enterprises, and help energy and chemical enterprises improve operating income and reduce energy consumption and carbon emissions.

[0144] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.

Claims

1. A method for predicting and diagnosing energy and carbon data of energy and chemical enterprises, characterized in that: The method comprises the following steps: S1. Obtain the historical data of the output of various products of energy and chemical enterprises and the historical data of coal consumption and electricity consumption; S2, preprocessing the data acquired in S1 to obtain preprocessed data; S3, standardize the preprocessed data to obtain feature data; S4, calculating the covariance matrix for the feature data; S5. Solve the eigenvalues ​​and eigenvectors of the covariance matrix; S6. According to the size of the eigenvalue, select the eigenvectors corresponding to the first k largest eigenvalues ​​as the principal components; S7, principal components are synthesized into a projection matrix; S8, projecting the feature data into a new space defined by the principal components based on the projection matrix to obtain projected data; S9, serializing the projected data to obtain sequence data; S10, converting the sequence data into a tensor format; S11. Inputting the data in tensor format into the trained predictive diagnosis model to obtain a predictive diagnosis result. The trained predictive diagnosis model consists of an improved WGAN model, a GRU model and a SHAP model. The improved WGAN model is used to generate samples to achieve data expansion.

2. The energy and carbon data prediction and diagnosis method for energy and chemical enterprises according to claim 1 is characterized in that: The training process of the improved WGAN model is: A1. Randomly initialize the parameters of the generator G and discriminator D of the WGAN network. A2. Extract a batch of real samples x from the real data distribution; A3. Extract a batch of noise z from the prior noise distribution and generate a batch of initial pseudo samples G'(z) through the generator; A4. Construct the total loss of the discriminator to update the parameters of the discriminator D to maximize the Wasserstein distance; A5. Fix the parameters of the discriminator D and update the parameters of the generator G. A6. Generate a pseudo sample G(z) after updating the parameters, evaluate the pseudo sample G(z) based on the discriminator D, and the output of the discriminator D is D(G(z)); A7. Construct the loss function of the generator and update the parameters of the generator G to minimize -D(G(z)). A8. Repeat A2 to A7, alternately train the discriminator and the generator until the quality of the generated samples reaches a predetermined standard or the number of training iterations reaches a preset upper limit, then stop the training to obtain an improved WGAN model. After the improved WGAN model obtains data in tensor format, it outputs generated samples, and the generated samples are used to train the GRU model.

3. The energy and carbon data prediction and diagnosis method for energy and chemical enterprises according to claim 2 is characterized in that: The total loss of the discriminator is: in, is the interpolation between the real sample x and the pseudo sample G(z), ∈ is a random number drawn from the uniform distribution U(0,1), λ is the hyperparameter of the gradient penalty, and E represents the mathematical expectation of the distribution specified in the subscript.

4. The energy and carbon data prediction and diagnosis method for energy and chemical enterprises according to claim 3 is characterized in that: The loss function of the generator is: L G =-E[D(G(z))] Here, E represents the mathematical expectation of the distribution specified in the subscript.

5. The energy and carbon data prediction and diagnosis method for energy and chemical enterprises according to claim 4 is characterized in that: The optimization process objective function of the improved WGAN model is: Where E is the mathematical expectation of the distribution specified in the subscript, P data(x) is the distribution of the real sample x; P z(z) is the distribution of generated data; D(x) is the discriminant function of the discriminator; G(z) is the data generated by the generator, that is, the pseudo sample.

6. The energy and carbon data prediction and diagnosis method for energy and chemical enterprises according to claim 1 is characterized in that: The specific steps of preprocessing the data obtained by S1 are: Extract the required data from the data obtained by S1, including the predicted target variables and feature variables; Perform data analysis on the extracted data to obtain data statistics; For missing values ​​in the extracted data, a linear regression model is used to predict and fill in the missing values; The outliers and duplicate values ​​in the filled data are processed by direct deletion to obtain the preprocessed data.

7. The energy and carbon data prediction and diagnosis method for energy and chemical enterprises according to claim 1 is characterized in that: The covariance matrix is ​​specifically: Where Σ is the covariance matrix, n is the number of samples, X std Represents feature data.

8. The energy and carbon data prediction and diagnosis method for energy and chemical enterprises according to claim 1 is characterized in that: The projected data is specifically: Y=X std P Among them, Y is the projected data, P = [v1, v2, ..., v k ] is the projection matrix, ν1, ν2, …, ν k is the selected principal component eigenvector, X std Represents feature data.

9. The energy and carbon data prediction and diagnosis method for energy and chemical enterprises according to claim 1 is characterized in that: The GRU model is used to predict the output data and power consumption data of various products of energy and chemical enterprises.

10. The energy and carbon data prediction and diagnosis method for energy and chemical enterprises according to claim 1, characterized in that: The SHAP model is used to analyze abnormal values ​​in the output data and power consumption data of various products of energy and chemical enterprises.