Electric energy consumption prediction method in copper electrolysis process and related equipment
Through the combination of the autoencoder and attention mechanism, the problem of poor accuracy in the prediction of electricity consumption during copper electrolysis is solved, and more accurate prediction of electricity consumption and process optimization is achieved.
Patent Information
- Application Number
- CN202510626519.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-15
- Publication Date
- 2025-08-08
AI Technical Summary
The existing data-driven modeling method based on deep learning ignores the time dependence and spatial correlation of data during copper electrolysis, resulting in poor prediction accuracy of power consumption.
The autoencoder combined with attention mechanism is used to obtain the historical values of multiple process variables related to electricity consumption during copper electrolysis for encoding and decoding, and a comprehensive loss function is constructed, and unsupervised training and fine-tuning is performed to obtain the final autoencoder for real-time prediction of electricity consumption.
It improves the accuracy of power consumption prediction, can monitor and optimize the copper electrolysis process in real time, and enhances the information capture and expression ability of the autoencoder in time and space.
Smart Images

Figure CN120450146A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of power consumption prediction, and in particular to a method for predicting power consumption in a copper electrolysis process and related equipment. Background Art
[0002] In modern copper electrolysis, the implementation of advanced process control and optimization technologies is essential to ensure production safety, improve production efficiency, and meet environmental protection requirements. Generally, real-time measurement of key quality variables (such as copper deposition rate, electrolyte concentration, and power consumption) is the most intuitive and effective means of reflecting the production status of copper electrolysis. However, due to the harsh conditions of the production environment and the limitations of measurement technology, these real-world quality variables are often difficult to monitor in real time and accurately, hindering the transformation of the copper electrolysis process towards intelligence and modernization.
[0003] To address this problem, soft sensor modeling technology has been introduced into the monitoring and control of the copper electrolysis process. This technology selects a set of measurable variables (auxiliary variables) that are highly correlated with the variable to be estimated (dominant variable), and constructs a mathematical model with the auxiliary variables as input and the dominant variable as output, thereby accurately estimating important quality indicators that cannot be directly measured online. Soft sensor technology can be divided into mechanism-based modeling methods and data-driven modeling methods. Considering the complex electrochemical reactions and interactions between multiple quality variables involved in the copper electrolysis process, the mechanism-based modeling method has great difficulties in practical application; while the data-driven modeling method does not rely on an in-depth understanding of the process mechanism. In addition, modern copper electrolysis equipment can collect and store a large amount of process data, making this method receive increasing attention in the control of the copper electrolysis process.
[0004] However, the application of deep learning-based data-driven modeling methods in copper electrolysis still faces numerous challenges. A major issue is that most deep learning models treat data as independent samples, ignoring the temporal dependencies of data during continuous production and the spatial correlations under similar operating conditions. This results in poorly accurate predictions of power consumption in copper electrolysis. Summary of the Invention
[0005] The present application provides a method for predicting electric energy consumption in a copper electrolysis process and related equipment, which can solve the problem of poor accuracy in electric energy consumption prediction.
[0006] In a first aspect, an embodiment of the present application provides a method for predicting power consumption in a copper electrolysis process, comprising:
[0007] Obtain the values of multiple process variables related to power consumption in the copper electrolysis process at multiple historical moments;
[0008] The autoencoder is used to encode and decode the values of all process variables at all historical moments to obtain the predicted value of electric energy consumption at each historical moment;
[0009] Based on the attention mechanism, a comprehensive loss function is constructed based on the predicted energy consumption values at all historical moments and the values of all process variables. The comprehensive loss function is used to describe the performance of the autoencoder in spatial and temporal neighborhoods.
[0010] Perform unsupervised training on the autoencoder according to the comprehensive loss function to obtain a trained autoencoder, and fine-tune the trained autoencoder to obtain a final autoencoder;
[0011] The real-time data of all process variables of the copper electrolysis process are input into the final autoencoder to obtain the real-time predicted value of the electric energy consumption of the copper electrolysis process.
[0012] Optionally, an autoencoder is used to encode and decode the values of all process variables at all historical moments to obtain the predicted value of electric energy consumption at each historical moment, including:
[0013] Encoding the value of each process variable to obtain a hidden representation of the value of each process variable;
[0014] Decrypt each hidden representation to obtain the characteristic representation of the value of each process variable;
[0015] For each historical moment, the power consumption is predicted based on all the characteristic representations of the historical moment to obtain the predicted value of the power consumption at the historical moment.
[0016] Optionally, the value of each process variable is encoded to obtain a hidden representation of the value of each process variable, including:
[0017] By formula:
[0018] h i =W i x i +b i
[0019] Calculate the hidden representation h of the value of the i-th process variable i ;
[0020] Among them, W i represents the encoding weight, b i represents the bias term of the encoding, x i represents the value of the i-th process variable, i = 1, 2, ..., N, and N represents the number of values of the process variable at all historical moments;
[0021] Decrypt each hidden representation to obtain the characteristic representation of the value of each process variable, including:
[0022] By formula:
[0023]
[0024] Calculate the characteristic representation of the value of the i-th process variable
[0025] Among them, W' i represents the decoding weight, b' i Represents the decoding bias term, and s() represents the nonlinear transformation function.
[0026] Optionally, based on the attention mechanism, a comprehensive loss function is constructed based on the predicted energy consumption values at all historical moments and the values of all process variables, including:
[0027] Obtaining multiple temporal neighbors and multiple spatial neighbors of the value of each process variable; the multiple temporal neighbors are the previous multiple other values closest to the value of the process variable in time, and the spatial neighbors are the previous multiple other values closest to the value of the process variable in space;
[0028] For each value of the process variable, according to the attention mechanism, the temporal neighborhood embedding distance score of the value of the process variable is calculated based on all the temporal neighbors of the value of the process variable, and the spatial neighborhood embedding distance score of the value of the process variable is calculated based on all the spatial neighbors of the value of the process variable;
[0029] A temporal neighborhood embedding loss is constructed based on the temporal neighborhood embedding distance scores of the values of all process variables, and a spatial neighborhood embedding loss is constructed based on the spatial neighborhood embedding distance scores of the values of all process variables;
[0030] A comprehensive loss function is constructed based on all temporal neighborhood embedding losses and spatial neighborhood embedding losses.
[0031] Optionally, a temporal neighborhood embedding distance score for the value of the process variable is calculated based on all of the temporal neighbors of the value of the process variable, including:
[0032] By formula:
[0033]
[0034] Calculate the temporal neighborhood embedding distance score for the value of the i-th process variable
[0035] Among them, Q represents the query vector, K represents the key-value vector, and WT q Represents the first parameter set in the attention mechanism, WT k represents the second parameter set in the attention mechanism, t i represents the historical moment corresponding to the value of the i-th process variable, The jth value of the i-th process variable t The historical moment corresponding to the nearest time neighbor, The jth value of the i-th process variable t The time interval between the ith time neighbor and the value of the ith process variable.
[0036] Optionally, the temporal neighborhood embedding loss is:
[0037]
[0038] Among them, L TNE represents the value of the temporal neighborhood embedding loss, N represents the number of process variables at all historical moments, and K T represents the number of time neighbors of the value of the i-th process variable, h i represents the hidden representation of the value of the i-th process variable, The jth value of the i-th process variable t hidden representations of temporal neighbors;
[0039] The spatial neighborhood embedding loss is:
[0040]
[0041] Among them, L SNE represents the value of spatial neighborhood embedding loss, K S represents the number of spatial neighbors of the value of the i-th process variable, The jth value of the i-th process variable s The hidden representation of the spatial neighbors, Represents the spatial neighborhood embedding distance score of the value of the i-th process variable.
[0042] Optionally, the comprehensive loss function is:
[0043]
[0044] Among them, Loss represents the value of the comprehensive loss function, L RE represents the reconstruction error, The characteristic variable representing the value of the i-th process variable, x i Represents the value of the i-th process variable.
[0045] Optionally, unsupervised training is performed on the autoencoder according to the comprehensive loss function to obtain a trained autoencoder, including:
[0046] Determine whether the value of the comprehensive loss function is less than the preset damage value;
[0047] If so, the autoencoder is taken as the trained autoencoder;
[0048] Otherwise, the parameters in the autoencoder are updated, and the step of using the autoencoder to encode and decode the values of all process variables at all historical moments to obtain the predicted value of electric energy consumption at each historical moment is returned.
[0049] Optionally, update the parameters of the autoencoder, including:
[0050] By formula:
[0051]
[0052] Update the parameters in the autoencoder to obtain the updated parameters W (r) ;
[0053] Among them, W (r-1) represents the parameters in the autoencoder, α represents the learning rate, represents the gradient of the parameter set in a layer of autoencoder.
[0054] In a second aspect, an embodiment of the present application provides a device for predicting power consumption in a copper electrolysis process, comprising:
[0055] An acquisition module, used for acquiring values of multiple process variables related to power consumption in the copper electrolysis process at multiple historical moments;
[0056] The encoding and decoding module is used to use the autoencoder to encode and decode the values of all process variables at all historical moments to obtain the predicted value of electric energy consumption at each historical moment;
[0057] A building block for constructing a comprehensive loss function based on the predicted energy consumption values at all historical moments and the values of all process variables using an attention mechanism; the comprehensive loss function is used to describe the performance of the autoencoder on spatial and temporal neighborhoods;
[0058] An unsupervised training module is used to perform unsupervised training on the autoencoder according to a comprehensive loss function to obtain a trained autoencoder, and then fine-tune the trained autoencoder to obtain a final autoencoder;
[0059] The power consumption prediction module is used to input the real-time data of all process variables of the copper electrolysis process into the final autoencoder to obtain the real-time prediction value of the power consumption of the copper electrolysis process.
[0060] In a third aspect, an embodiment of the present application provides a terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for predicting power consumption of the copper electrolysis process when executing the above-mentioned computer program.
[0061] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the above-mentioned method for predicting power consumption of the copper electrolysis process.
[0062] The above solution of the present application has the following beneficial effects:
[0063] In an embodiment of the present application, by obtaining the values of multiple process variables related to power consumption in the copper electrolysis process at multiple historical moments, the values of all process variables at all historical moments are encoded and decoded using an autoencoder to obtain a predicted value of power consumption at each historical moment, and then, according to the attention mechanism, a comprehensive loss function is constructed based on the predicted values of power consumption at all historical moments and the values of all process variables, and then the autoencoder is unsupervisedly trained according to the comprehensive loss function to obtain a trained autoencoder, and the trained autoencoder is fine-tuned to obtain a final autoencoder, and finally, the real-time data of all process variables in the copper electrolysis process are input into the final autoencoder to obtain a real-time predicted value of power consumption in the copper electrolysis process. Among them, constructing a comprehensive loss function based on the attention mechanism and the process variables can accurately measure and strengthen the similarity relationship between neighborhoods, taking into account the dynamic transformation in time and the local structure constraints in space, and training the autoencoder according to the comprehensive loss function can improve the autoencoder's ability to capture and express information in time and space, thereby improving the accuracy of power consumption prediction using the autoencoder, and facilitating real-time monitoring and optimization of the copper electrolysis process.
[0064] Other beneficial effects of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0066] Figure 1 A flow chart of a method for predicting power consumption in a copper electrolysis process according to an embodiment of the present application;
[0067] Figure 2 A schematic diagram of a copper electrolysis process provided in one embodiment of the present application;
[0068] Figure 3 A schematic diagram of the prediction results of SS-SAE provided in one embodiment of the present application;
[0069] Figure 4A schematic diagram of the prediction results of VW-SAE provided in one embodiment of the present application;
[0070] Figure 5 A schematic diagram of the prediction results of GSTAE provided in one embodiment of the present application;
[0071] Figure 6 A schematic diagram of the TSAE prediction results provided in one embodiment of the present application;
[0072] Figure 7 A schematic diagram of RF prediction results provided in one embodiment of the present application;
[0073] Figure 8 A schematic diagram of the prediction results of the method of the present application provided in one embodiment of the present application;
[0074] Figure 9 A schematic diagram of the structure of an apparatus for predicting power consumption in a copper electrolysis process according to an embodiment of the present application;
[0075] Figure 10 A schematic diagram of the structure of a terminal device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0076] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary detail.
[0077] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.
[0078] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0079] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0080] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0081] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[0082] In response to the problem of poor accuracy of existing power consumption predictions, an embodiment of the present application provides a method for predicting power consumption in a copper electrolysis process. The method obtains the values of multiple process variables related to power consumption in the copper electrolysis process at multiple historical moments, and uses an autoencoder to encode and decode the values of all process variables at all historical moments to obtain a predicted power consumption value at each historical moment. Then, according to an attention mechanism, a comprehensive loss function is constructed based on the predicted power consumption values at all historical moments and the values of all process variables. The autoencoder is then unsupervisedly trained according to the comprehensive loss function to obtain a trained autoencoder, and the trained autoencoder is fine-tuned to obtain a final autoencoder. Finally, the real-time data of all process variables in the copper electrolysis process are input into the final autoencoder to obtain a real-time predicted value of power consumption in the copper electrolysis process. Among them, a comprehensive loss function is constructed based on the attention mechanism and process variables, which can accurately measure and strengthen the similarity relationship between neighbors, taking into account the dynamic transformation in time and the local structural constraints in space. Training the autoencoder according to the comprehensive loss function can improve the autoencoder's ability to capture and express information in time and space, thereby improving the accuracy of energy consumption prediction using the autoencoder, facilitating real-time monitoring and optimization of the copper electrolysis process.
[0083] Next, the method for predicting electric energy consumption in the copper electrolysis process provided in this application is exemplified.
[0084] like Figure 1 As shown, the method for predicting electric energy consumption in the copper electrolysis process provided by the present application includes the following steps:
[0085] Step 11: Obtain values of multiple process variables related to power consumption in the copper electrolysis process at multiple historical moments.
[0086] The above process variables include copper ion concentration, sulfuric acid concentration, lead ion concentration, etc.
[0087] In some embodiments of the present application, several process variables that affect key quality indicators of industrial processes can be selected based on process mechanisms and operating experience, and the specific values of the process variables can be obtained through sensors, particle analyzers and other equipment.
[0088] It should be noted that after obtaining the values of the process variables, all process variables need to be normalized. When obtaining the values of the process variables, the actual power consumption value at each historical moment is obtained.
[0089] Step 12: Use an autoencoder to encode and decode the values of all process variables at all historical moments to obtain the predicted value of electric energy consumption at each historical moment.
[0090] In some embodiments of the present application, the step of using an autoencoder to encode and decode the values of all process variables at all historical moments to obtain a predicted value of electric energy consumption at each historical moment includes:
[0091] In the first step, the value of each process variable is encoded to obtain the hidden representation of the value of each process variable.
[0092] Specifically, through the formula:
[0093] h i =W i x i +b i
[0094] Calculate the hidden representation h of the value of the i-th process variable i .
[0095] Among them, W i represents the encoding weight, b i represents the bias term of the encoding, x i represents the value of the i-th process variable, i = 1, 2, ..., N, and N represents the number of values of the process variable at all historical moments.
[0096] In the second step, each hidden representation is decrypted to obtain the feature representation of the value of each process variable.
[0097] Specifically, through the formula:
[0098]
[0099] Calculate the characteristic representation of the value of the i-th process variable
[0100] Among them, W' i represents the decoding weight, b' i Represents the decoding bias term, and s() represents the nonlinear transformation function.
[0101] It can be understood that the above formulas for calculating hidden representation and feature representation are expressions of the autoencoder.
[0102] The third step is to predict the power consumption of each historical moment based on all the feature representations of the historical moment to obtain the predicted value of the power consumption at the historical moment.
[0103] For example, a fully connected layer or the like may be used to predict the power consumption of each feature representation to obtain a predicted value of power consumption at a historical moment.
[0104] In step 13, according to the attention mechanism, a comprehensive loss function is constructed based on the predicted values of power consumption at all historical moments and the values of all process variables.
[0105] The above comprehensive loss function is used to describe the performance of the autoencoder in spatial and temporal neighborhoods.
[0106] In some embodiments of the present application, the step of constructing a comprehensive loss function based on the values of the predicted power consumption values at all historical moments and all process variables according to the attention mechanism includes:
[0107] In the first step, multiple temporal neighbors and multiple spatial neighbors are obtained for each value of the process variable.
[0108] The multiple time neighbors are the previous multiple other values that are closest to the value of the process variable in time, and the multiple space neighbors are the previous multiple other values that are closest to the value of the process variable in space.
[0109] Exemplarily, for the value of a process variable, the time interval between the historical moment corresponding to the value of the process variable and each other historical moment is calculated, and the values of the process variables with the same attribute as the process variable in all other historical moments are sorted in order of all time intervals from small to large, and the values of the first multiple process variables in the sorting result are taken as the time neighbors of the value of the process variable. For example, the value of the copper ion concentration of the process variable at the first historical moment has 2 time neighbors, and the first two historical moments close to the first historical moment are the second historical moment and the third historical moment, then the copper ion concentration values at the second historical moment and the third historical moment are both taken as time neighbors; for the value of a process variable, the values of the process variables with the same attribute as the process variable in all historical moments are obtained. The similarity between the value of the same process variable and this value is calculated. The values of the process variables with the same attributes at all other historical moments are sorted in descending order of similarity, and the values of the first multiple process variables are used as the spatial neighbors of the value of the process variable. The similarity can be calculated by cosine similarity, such as the copper ion concentration of the process variable at the first historical moment is 54g / L, the number of spatiotemporal neighbors is 2, the copper ion concentration at the fourth historical moment is 52.3g / L, and the copper ion concentration at the sixth historical moment is 53g / L. They have the same attributes and the largest and second largest similarities, so the copper ion concentration of 52.3g / L at the fourth historical moment and the copper ion concentration of 53g / L at the sixth historical moment are used as the spatial neighbors of the copper ion concentration of 52.3g / L at the first historical moment.
[0110] In the second step, for each value of the process variable, according to the attention mechanism, the temporal neighborhood embedding distance score of the value of the process variable is calculated based on all the temporal neighbors of the value of the process variable, and the spatial neighborhood embedding distance score of the value of the process variable is calculated based on all the spatial neighbors of the value of the process variable.
[0111] Specifically, through the formula:
[0112]
[0113] Calculate the temporal neighborhood embedding distance score for the value of the i-th process variable
[0114] Among them, Q represents the query vector, K represents the key-value vector, and WT q Represents the first parameter set in the attention mechanism, WT k represents the second parameter set in the attention mechanism, t i represents the historical moment corresponding to the value of the i-th process variable, The jth value of the i-th process variable t The historical moment corresponding to the nearest time neighbor, The jth value of the i-th process variable tThe time interval between the ith time neighbor and the value of the ith process variable.
[0115] It should be noted that the expression for calculating the spatial neighborhood embedding distance score is similar to the expression for calculating the temporal neighborhood embedding distance score mentioned above. In the formula for calculating the temporal neighborhood embedding distance score, the temporal neighbors of the value of the i-th process variable are replaced with the spatial neighbors of the value of the i-th process variable to calculate the spatial neighborhood embedding distance score. The query vector and key-value vector mentioned above are calculated using the attention mechanism.
[0116] In the third step, a temporal neighborhood embedding loss is constructed based on the temporal neighborhood embedding distance scores of the values of all process variables, and a spatial neighborhood embedding loss is constructed based on the spatial neighborhood embedding distance scores of the values of all process variables.
[0117] Specifically, the temporal neighborhood embedding loss is:
[0118]
[0119] Among them, L TNE represents the value of the temporal neighborhood embedding loss, N represents the number of process variables at all historical moments, and K T represents the number of time neighbors of the value of the i-th process variable, h i represents the hidden representation of the value of the i-th process variable, The jth value of the i-th process variable t Hidden representation of temporal neighbors.
[0120] The spatial neighborhood embedding loss is:
[0121]
[0122] Among them, L SNE represents the value of spatial neighborhood embedding loss, K S represents the number of spatial neighbors of the value of the i-th process variable, The jth value of the i-th process variable s The hidden representation of the spatial neighbors, Represents the spatial neighborhood embedding distance score of the value of the i-th process variable.
[0123] In the fourth step, a comprehensive loss function is constructed based on all temporal neighborhood embedding losses and spatial neighborhood embedding losses.
[0124] Specifically, the comprehensive loss function is:
[0125]
[0126] Among them, Loss represents the value of the comprehensive loss function, L RErepresents the reconstruction error, The characteristic variable representing the value of the i-th process variable, x i Represents the value of the i-th process variable.
[0127] In step 14, the autoencoder is unsupervisedly trained according to the comprehensive loss function to obtain a trained autoencoder, and the trained autoencoder is fine-tuned to obtain a final autoencoder.
[0128] In some embodiments of the present application, the step of performing unsupervised training on the autoencoder according to the comprehensive loss function to obtain the trained autoencoder includes:
[0129] Determine whether the value of the comprehensive loss function is less than the preset damage value.
[0130] If yes, the autoencoder is taken as the trained autoencoder.
[0131] Otherwise, the parameters in the autoencoder are updated, and the process returns to the step of using the autoencoder to encode and decode all process variables at each historical moment to obtain the predicted value of electric energy consumption at each historical moment.
[0132] It should be noted that the above steps for updating the parameters in the autoencoder are specifically as follows:
[0133] By formula:
[0134]
[0135] Update the parameters in the autoencoder to obtain the updated parameters W (r) .
[0136] Among them, W (r-1) represents the parameters in the autoencoder, α represents the learning rate, represents the gradient of the parameter set in a layer of autoencoder.
[0137] For example, a small number of samples can be selected from the process variables at all historical moments to perform supervised fine-tuning on the trained autoencoder.
[0138] Step 15: Input the real-time data of all process variables of the copper electrolysis process into the final autoencoder to obtain the real-time predicted value of the power consumption of the copper electrolysis process.
[0139] The above-mentioned real-time data is the value of the process variable of the copper electrolysis process at the current moment, and the real-time predicted value is the predicted power consumption value at the next moment after the current moment.
[0140] Specifically, the values of multiple process variables of the copper electrolysis process at the current moment are obtained, the values of all process variables are input into the final autoencoder, the feature representation of the value of each process variable is obtained using the final autoencoder, and the power consumption is predicted based on all feature representations using a fully connected layer to obtain the real-time predicted value of the power consumption of the copper electrolysis process.
[0141] It is worth mentioning that constructing a comprehensive loss function based on the attention mechanism and process variables can accurately measure and strengthen the similarity relationship between neighbors, taking into account the dynamic transformation in time and the local structural constraints in space. Training the autoencoder according to the comprehensive loss function can improve the autoencoder's ability to capture and express information in time and space, thereby improving the accuracy of energy consumption prediction using the autoencoder, facilitating real-time monitoring and optimization of the copper electrolysis process.
[0142] In addition, since the constructed adaptive neighborhood-preserving spatiotemporal manifold autoencoder comprehensively utilizes manifold learning to extract the internal structural characteristics of the data, the spatiotemporal neighborhood embedding loss module to preserve the spatiotemporal neighborhood structure information of the input data, and the attention mechanism to adaptively adjust the distance scores of different spatiotemporal neighborhoods, the autoencoder can fully capture the spatiotemporal local correlations and long-range dynamic changes in industrial process data, and achieve accurate prediction of key quality variables through the fusion of multi-level spatiotemporal features and the deep feature expression of the autoencoder, thereby improving the prediction accuracy, robustness and adaptability of the model; this application combines unsupervised training with real-time data input to capture complex patterns in the time series data of the copper electrolysis process, providing reliable support for online prediction of power consumption.
[0143] The method of the present application is illustrated below with reference to a specific example.
[0144] Copper electrolysis process Figure 2 As shown, the electrolyte is purified to obtain a clean liquid, which is then put into a circulation tank, heated by adding steam in a heat exchanger, and transferred to a high-level tank. Direct current is input into the electrolytic tank through a rectifier for electrolysis to obtain an electrolyte.
[0145] From Figure 2 The 10 process variables that have the greatest impact on power consumption in the copper electrolysis process shown in Figure 1 were selected as input variables, and a total of 2,000 sets of data were extracted from the industrial site from July 17, 2024, to November 30, 2024. The 10 process variables are shown in Table 1.
[0146] Table 1
[0147] enter Process variable description enter Process variable description 1 Pole spacing 6 Lead ion concentration 2 Copper ion concentration 7 Bismuth ion concentration 3 sulfuric acid concentration 8 Iron ion concentration 4 Lead ion concentration 9 Nickel ion concentration 5 Arsenic ion concentration 10 Tank temperature
[0148] The collected data is normalized and preprocessed. The normalization formula is:
[0149]
[0150] Among them, x i* represents the value of the normalized i-th process variable, x i represents the value of the i-th process variable, x min,i Indicates the maximum value of the i-th process variable, y * Indicates the actual power consumption after normalization, y max Indicates actual power consumption.
[0151] To test the performance of the model, the first 1500 samples of the 2000 sample dataset were used as the training set to train the model parameters, and the remaining 500 samples were used as test samples to test the generalization ability of the model. The time and spatial neighborhoods of the normalized process variables were calculated.
[0152] The mean absolute error (MAE) and root mean square error (RMSE) are used to evaluate the prediction accuracy. The expressions are:
[0153]
[0154] Among them, h(x i ) represents the predicted value of electric energy consumption corresponding to the value of the i-th process variable, and yi represents the actual electric energy consumption value corresponding to the value of the i-th process variable.
[0155] The key quality indicators are predicted using the semi-supervised stacked autoencoder (SS-SAE), variational autoencoder (VW-SAE), time series autoencoder (TSAE), gated stacked target-related autoencoder (GSTAE), random forest model (RF, RandomForest) and the online prediction method of this application. The prediction results of SS-SAE are as follows: Figure 3 As shown in Figure 2, the prediction results of VW-SAE are as follows: Figure 4 As shown in Figure 2, the prediction results of GSTAE are as follows: Figure 5 As shown in Figure 2, the prediction results of TSAE are as follows: Figure 6 As shown, the prediction results of RF are as follows Figure 7 As shown, the prediction results of this application are as follows Figure 8As shown, in Figure 3 、 Figure 4 、 Figure 5 、 Figure 6 、 Figure 7 、 Figure 8 The horizontal axis represents the sampling points, the vertical axis represents the power consumption, the solid line represents the true value curve of power consumption, and the dotted line represents the predicted value curve of power consumption. The standard mean absolute error (MAE) and root mean square error (RMSE) are shown in Table 2.
[0156] Table 2
[0157]
[0158]
[0159] Wherein, NA-STMAE represents the method of this application, and MAPE represents the mean absolute percentage error.
[0160] It can be seen that the copper electrolysis process power consumption prediction method based on adaptive spatiotemporal neighborhood preservation provided in this application can achieve more accurate predictions than traditional time series prediction methods such as SS-SAE model, VW-SAE model, GSTAE model and RF model, which also verifies the effectiveness of the method of this application.
[0161] The following is an exemplary description of the power consumption prediction device for the copper electrolysis process provided in this application.
[0162] like Figure 9 As shown, an embodiment of the present application provides a device for predicting power consumption in a copper electrolysis process. The device 900 for predicting power consumption in a copper electrolysis process includes:
[0163] An acquisition module 901 is used to acquire values of multiple process variables related to power consumption in the copper electrolysis process at multiple historical moments;
[0164] The encoding and decoding module 902 is used to encode and decode the values of all process variables at all historical moments using an autoencoder to obtain a predicted value of electric energy consumption at each historical moment;
[0165] A construction module 903 is configured to construct a comprehensive loss function based on the predicted power consumption values at all historical moments and the values of all process variables according to an attention mechanism; the comprehensive loss function is used to describe the performance of the autoencoder in spatial and temporal neighborhoods;
[0166] An unsupervised training module 904 is configured to perform unsupervised training on the autoencoder according to the comprehensive loss function to obtain a trained autoencoder, and fine-tune the trained autoencoder to obtain a final autoencoder;
[0167] The power consumption prediction module 905 is used to input the real-time data of all process variables of the copper electrolysis process into the final autoencoder to obtain the real-time prediction value of the power consumption of the copper electrolysis process.
[0168] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of this application. Their specific functions and technical effects can be found in the method embodiment section and will not be repeated here.
[0169] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0170] like Figure 10 As shown, an embodiment of the present application provides a terminal device, and the terminal device D10 of this embodiment includes: at least one processor D100 ( Figure 10 Only one processor is shown in the figure), a memory D101, and a computer program D102 stored in the memory D101 and executable on the at least one processor D100, wherein the processor D100 implements the steps of any of the above method embodiments when executing the computer program D102.
[0171] Specifically, when the processor D100 executes the computer program D102, by obtaining the values of multiple process variables related to power consumption in the copper electrolysis process at multiple historical moments, the values of all process variables at all historical moments are encoded and decoded using an autoencoder to obtain a predicted power consumption value at each historical moment, and then, according to the attention mechanism, a comprehensive loss function is constructed based on the predicted power consumption values at all historical moments and the values of all process variables. The autoencoder is then unsupervisedly trained according to the comprehensive loss function to obtain a trained autoencoder, and the trained autoencoder is fine-tuned to obtain a final autoencoder. Finally, the real-time data of all process variables in the copper electrolysis process are input into the final autoencoder to obtain a real-time predicted power consumption value of the copper electrolysis process. Among them, constructing a comprehensive loss function based on the attention mechanism and the process variables can accurately measure and strengthen the similarity relationship between neighborhoods, taking into account the dynamic transformation in time and the local structure constraints in space. Training the autoencoder according to the comprehensive loss function can improve the autoencoder's ability to capture and express information in time and space, thereby improving the accuracy of power consumption prediction using the autoencoder, and facilitating real-time monitoring and optimization of the copper electrolysis process.
[0172] The processor D100 may be a central processing unit (CPU), or may be another general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor or any conventional processor.
[0173] In some embodiments, the memory D101 may be an internal storage unit of the terminal device D10, such as a hard disk or memory of the terminal device D10. In other embodiments, the memory D101 may also be an external storage device of the terminal device D10, such as a plug-in hard disk, a smart memory card (SMC, SmartMedia Card), a secure digital (SD, Secure Digital) card, a flash card, etc. equipped on the terminal device D10. Furthermore, the memory D101 may also include both an internal storage unit of the terminal device D10 and an external storage device. The memory D101 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory D101 may also be used to temporarily store data that has been output or is to be output.
[0174] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned various method embodiments can be implemented.
[0175] An embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0176] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the process in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the above-mentioned various method embodiments can be implemented. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium that can carry the computer program code to the power consumption prediction method device / terminal device of the copper electrolysis process. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0177] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0178] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0179] The above is a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles described in the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for predicting electric energy consumption in a copper electrolysis process, characterized in that: include: Obtain the values of multiple process variables related to power consumption in the copper electrolysis process at multiple historical moments; The autoencoder is used to encode and decode the values of all process variables at all historical moments to obtain the predicted value of electric energy consumption at each historical moment; According to the attention mechanism, a comprehensive loss function is constructed based on the predicted values of power consumption at all historical moments and the values of all process variables; the comprehensive loss function is used to describe the performance of the autoencoder in spatial and temporal neighborhoods; Performing unsupervised training on the autoencoder according to the comprehensive loss function to obtain a trained autoencoder, and fine-tuning the trained autoencoder to obtain a final autoencoder; The real-time data of all process variables of the copper electrolysis process are input into the final autoencoder to obtain a real-time predicted value of the electric energy consumption of the copper electrolysis process.
2. The method for predicting electric energy consumption according to claim 1, wherein: The method of using the autoencoder to encode and decode the values of all process variables at all historical moments to obtain the predicted value of electric energy consumption at each historical moment includes: encoding the value of each process variable to obtain a hidden representation of the value of each process variable; decrypting each of the hidden representations to obtain a characteristic representation of the value of each of the process variables; For each of the historical moments, electric energy consumption is predicted based on all characteristic representations of the historical moments to obtain a predicted value of electric energy consumption at the historical moments.
3. The method for predicting electric energy consumption according to claim 2, wherein: The encoding of the value of each process variable to obtain a hidden representation of the value of each process variable includes: By formula: h i =W i x i +b i Calculate the hidden representation h of the value of the i-th process variable i ; Among them, W i represents the encoding weight, b i represents the bias term of the encoding, x i represents the value of the i-th process variable, i = 1, 2, ..., N, and N represents the number of values of the process variable at all historical moments; Decrypting each of the hidden representations to obtain a characteristic representation of the value of each of the process variables includes: By formula: Calculate the characteristic representation of the value of the i-th process variable Among them, W' i represents the decoding weight, b' i Represents the decoding bias term, and s() represents the nonlinear transformation function.
4. The method for predicting electric energy consumption according to claim 3, wherein: According to the attention mechanism, a comprehensive loss function is constructed based on the predicted values of power consumption at all historical moments and the values of all process variables, including: Obtaining a plurality of temporal neighbors and a plurality of spatial neighbors of the value of each process variable; the plurality of temporal neighbors being the first plurality of other values closest to the value of the process variable in time, and the plurality of spatial neighbors being the first plurality of other values closest to the value of the process variable in space; For each value of the process variable, respectively, calculating, according to an attention mechanism, a temporal neighborhood embedding distance score of the value of the process variable based on all temporal neighbors of the value of the process variable, and calculating a spatial neighborhood embedding distance score of the value of the process variable based on all spatial neighbors of the value of the process variable; A temporal neighborhood embedding loss is constructed based on the temporal neighborhood embedding distance scores of the values of all process variables, and a spatial neighborhood embedding loss is constructed based on the spatial neighborhood embedding distance scores of the values of all process variables; A comprehensive loss function is constructed based on all temporal neighborhood embedding losses and the spatial neighborhood embedding loss.
5. The method for predicting electric energy consumption according to claim 4, characterized in that: The calculating a temporal neighborhood embedding distance score of the value of the process variable based on all temporal neighbors of the value of the process variable comprises: By formula: Calculate the temporal neighborhood embedding distance score for the value of the i-th process variable Among them, Q represents the query vector, K represents the key-value vector, and WT q Represents the first parameter set in the attention mechanism, WT k represents the second parameter set in the attention mechanism, t i represents the historical moment corresponding to the value of the i-th process variable, The jth value of the i-th process variable t The historical moment corresponding to the nearest time neighbor, The jth value of the i-th process variable t The time interval between the i-th time neighbor and the value of the i-th process variable.
6. The method for predicting electric energy consumption according to claim 5, characterized in that: The temporal neighborhood embedding loss is: Among them, L TNE represents the value of the temporal neighborhood embedding loss, N represents the number of process variables at all historical moments, and K T represents the number of time neighbors of the value of the i-th process variable, h i represents the hidden representation of the value of the i-th process variable, The jth value of the i-th process variable t hidden representations of temporal neighbors; The spatial neighborhood embedding loss is: Among them, L SNE represents the value of spatial neighborhood embedding loss, K S represents the number of spatial neighbors of the value of the i-th process variable, The jth value of the i-th process variable s The hidden representation of the spatial neighbors, Represents the spatial neighborhood embedding distance score of the value of the i-th process variable.
7. The method for predicting electric energy consumption according to claim 6, wherein: The comprehensive loss function is: Among them, Loss represents the value of the comprehensive loss function, L RE represents the reconstruction error, The characteristic variable representing the value of the i-th process variable, x i Represents the value of the i-th process variable.
8. The method for predicting electric energy consumption according to claim 1, wherein: The step of performing unsupervised training on the autoencoder according to the comprehensive loss function to obtain a trained autoencoder includes: Determining whether the value of the comprehensive loss function is less than a preset damage value; If yes, then the autoencoder is used as the trained autoencoder; Otherwise, the parameters in the autoencoder are updated, and the process returns to the step of encoding and decoding the values of all process variables at all historical moments using the autoencoder to obtain the predicted value of electric energy consumption at each historical moment.
9. The method for predicting electric energy consumption according to claim 8, wherein: The updating of the parameters in the autoencoder includes: By formula: Update the parameters in the autoencoder to obtain the updated parameters W (r) ; Among them, W (r-1) represents the parameters in the autoencoder, α represents the learning rate, represents the gradient of the parameter set in a layer of autoencoder.
10. A terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method for predicting electric energy consumption in a copper electrolysis process according to any one of claims 1 to 9 is implemented.