Electrolytic aluminum parameter identification method, system and equipment based on Nto1 mode RNN algorithm and medium
By processing electrolytic aluminum production data using an RNN algorithm based on the Nto1 model, the problem of accuracy in identifying electrolytic aluminum load parameters was solved, resulting in more accurate adjustable capacity estimation and improved system stability.
Patent Information
- Application Number
- CN202510915056.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-03
- Publication Date
- 2025-10-31
AI Technical Summary
In existing technologies, the accuracy of obtaining the total resistance and back electromotive force of electrolytic aluminum load using machine learning methods is insufficient, which affects the accuracy of adjustable capacity estimation.
An RNN algorithm based on the Nto1 model is adopted. By preprocessing the DC voltage and current sequence in electrolytic aluminum production, input and target data matrices are constructed. The RNN model and linear regression layer are used to calculate the current prediction value and electrolytic aluminum production parameters. The model parameters are optimized by combining forget gate, input gate, output gate and memory state update mechanism.
It improves the accuracy and robustness of electrolytic aluminum parameter identification, effectively captures the nonlinear relationship of time series, adapts to dynamic changes in the system, reduces the impact of noise and external disturbances, and provides more accurate adjustable capacity estimation.
Smart Images

Figure CN120874008A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electrolytic aluminum load participation in power system operation and control technology, specifically to an electrolytic aluminum parameter identification method, system, equipment, and medium based on an Nto1 mode RNN algorithm. Background Technology
[0002] As a high-energy-consuming industry, the electrolytic aluminum industry plays a crucial role in the stability of the power grid and the balance of power supply. Due to the unique nature of electrolytic aluminum loads, the ability to regulate their power demand is critical to the flexibility and operation of the power grid. Even small adjustments to the electrolytic aluminum load can provide the grid with significant regulation resources, contributing to load balancing and improving power system stability. Therefore, assessing the adjustable capacity of the electrolytic aluminum load is particularly necessary.
[0003] In related technologies, the total resistance and back electromotive force of an electrolytic aluminum load are typically obtained using machine learning methods. However, the training accuracy of machine learning is limited by the quality of the sample data, resulting in insufficient accuracy in determining the total resistance and back electromotive force, thus affecting the accuracy of adjustable capacity estimation.
[0004] Compared to traditional linear fitting methods, RNNs have significant advantages in voltage and current modeling. They can capture time-series dependencies, handle dynamic changes, adapt to nonlinear relationships between voltage and current, and possess stronger adaptability and generalization capabilities. RNNs perform exceptionally well when processing long-term data series, effectively handling noise and system variations, and automatically adjusting model parameters to reduce the impact of external disturbances. This makes RNNs more suitable for modeling complex electrical systems, especially when the data exhibits time-dependent and nonlinear characteristics, outperforming traditional linear regression methods. Summary of the Invention
[0005] In view of the above-mentioned problems, the present invention is proposed.
[0006] Therefore, the purpose of this invention is to provide a method and apparatus for identifying electrolytic aluminum parameters based on short-term memory, which can improve the accuracy of adjusting capacity estimation.
[0007] To solve the above-mentioned technical problems, the present invention provides the following technical solution: a method for identifying electrolytic aluminum parameters based on an Nto1 mode RNN algorithm, comprising,
[0008] The DC voltage and current sequences in electrolytic aluminum production are obtained and preprocessed. An input data matrix is constructed based on the preprocessed current sequence, and a target data matrix is constructed based on the preprocessed voltage sequence. The input data matrix is organized in an Nto1 mode according to a preset time step. The preprocessed current sequence is input into an RNN model to create an RNN training dataset and obtain the hidden state at the final time step. Based on the hidden state, the predicted current value and electrolytic aluminum production parameters are calculated through a linear regression layer.
[0009] As a preferred embodiment of the electrolytic aluminum parameter identification method based on the Nto1 mode RNN algorithm described in this invention, the preprocessing includes normalizing the DC voltage and DC current sequences using the MinMaxScaler function.
[0010] The mean and standard deviation of the DC voltage sequence and DC current sequence are calculated respectively, and the respective sequences are standardized and scaled based on the mean and standard deviation.
[0011] As a preferred embodiment of the electrolytic aluminum parameter identification method based on the Nto1 mode RNN algorithm described in this invention, the Nto1 mode includes: extracting normalized current sequences of continuous time steps as samples of the input data matrix in a sliding window manner, and using the normalized voltage data of the next time step after the end of the corresponding time window as samples of the target data matrix.
[0012] As a preferred embodiment of the electrolytic aluminum parameter identification method based on the Nto1 mode RNN algorithm described in this invention, the RNN model includes constructing an identification model containing an RNN layer and a linear regression layer.
[0013] The RNN layer uses a forget gate, input gate, output gate, candidate memory layer, and memory state update mechanism to calculate the current hidden state by combining the current input, the previous hidden state, and the memory state.
[0014] Specifically, the forget gate controls the degree of retention of the memory state at the previous moment, the input gate and the candidate memory layer generate the candidate memory information at the current moment, the memory state is updated by combining the output of the forget gate and the output of the input gate, and the hidden state at the current moment is generated by the output gate and the updated memory state.
[0015] The linear regression layer maps the hidden state of the last time step to the current prediction value.
[0016] As a preferred embodiment of the electrolytic aluminum parameter identification method based on the Nto1 mode RNN algorithm described in this invention, the linear regression layer includes multiplying the hidden state of the last time step with the regression weight matrix and superimposing the bias vector to generate a normalized current prediction value.
[0017] The regression weight matrix and bias vector contain the mapping relationship of electrolytic aluminum production parameters.
[0018] As a preferred embodiment of the electrolytic aluminum parameter identification method based on the Nto1 mode RNN algorithm described in this invention, the linear regression layer further includes: using the target data matrix as a benchmark, calculating the loss of the current prediction value through the mean square error function, and iteratively updating the parameters of the identification model using an optimization algorithm.
[0019] An adaptive learning rate adjustment mechanism is adopted, which updates the model parameters by adjusting the gradient direction of the loss function.
[0020] As a preferred embodiment of the electrolytic aluminum parameter identification method based on the Nto1 mode RNN algorithm described in this invention, the electrolytic aluminum production parameters are obtained by analyzing the weight matrix and bias vector of the linear regression layer.
[0021] Another objective of this invention is to provide a parameter identification system for electrolytic aluminum based on an Nto1 mode RNN algorithm.
[0022] To solve the above technical problems, the present invention provides the following technical solution: an electrolytic aluminum parameter identification system based on the Nto1 mode RNN algorithm, comprising: a data processing module, a time series dataset construction module, a parameter identification model module, and a production parameter parsing module;
[0023] The data processing module acquires the DC voltage and current sequence during electrolytic aluminum production and preprocesses the DC voltage and current sequence.
[0024] The time series dataset construction module constructs an input data matrix based on the preprocessed current sequence and a target data matrix based on the preprocessed voltage sequence. The input data matrix is organized in an Nto1 mode according to a preset time step.
[0025] The parameter identification model module inputs the preprocessed current sequence into the RNN model, creates an RNN training dataset, and obtains the hidden state at the final time step.
[0026] The production parameter analysis module calculates the predicted current value and electrolytic aluminum production parameters based on the hidden state through a linear regression layer.
[0027] The present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, characterized in that the processor executes the computer program to implement the steps of the electrolytic aluminum parameter identification method based on the Nto1 mode RNN algorithm.
[0028] The present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that, when the computer program is executed by a processor, it implements the steps of the electrolytic aluminum parameter identification method based on the Nto1 mode RNN algorithm.
[0029] The beneficial effects of this invention are as follows: The recurrent neural network (RNN) of this invention exhibits significant advantages in voltage and current modeling. RNNs can effectively capture the temporal dependencies in time-series data, adapt to the dynamic changes of the system, and handle the complex nonlinear relationships between voltage and current through their nonlinear activation functions. Furthermore, RNNs possess strong adaptability and generalization ability, maintaining long-term information dependencies when dealing with long-term data series, and demonstrating high robustness against noise and external disturbances. Overall, in modeling electrical systems with temporal and nonlinear characteristics, RNNs provide more accurate and reliable fitting results compared to traditional linear regression methods. Attached Figure Description
[0030] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0031] Figure 1 The overall flowchart of the electrolytic aluminum parameter identification method based on the Nto1 mode RNN algorithm provided in one embodiment of the present invention is shown. Detailed Implementation
[0032] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.
[0033] Example 1, referring to Figure 1 This is one embodiment of the present invention, which provides a method for identifying electrolytic aluminum parameters based on an Nto1 mode RNN algorithm, including:
[0034] S1. Obtain the DC voltage and current sequence in the electrolytic aluminum production process and preprocess the DC voltage and current sequence.
[0035] Furthermore, obtain the DC voltage and current data sequence for electrolytic aluminum production:
[0036] V = [V1, V2, ..., V N ]
[0037] I = [I1, I2, ..., I N ]
[0038] Where V1, V2, ..., V N The data are DC voltages measured at each step size, I1, I2, ..., I... N The data represents the DC current measured at each step size, with the subscript N indicating the step size.
[0039] It should be noted that the DC voltage and DC current sequences are normalized using the MinMaxScaler function;
[0040] The mean and standard deviation of the DC voltage and DC current sequences are calculated separately, and the sequences are standardized and scaled based on the mean and standard deviation. In one embodiment of the invention, the DC voltage and DC current sequences are normalized using the MinMaxScaler function in Python.
[0041]
[0042] Where μ V , σ V and μ I , σ I These are the mean and standard deviation of voltage and current, respectively.
[0043] In an optional embodiment, the normalization process can involve obtaining the DC voltage and current sequences from electrolytic aluminum production, preprocessing the sequences, and calculating the mean and standard deviation of the voltage and current sequences respectively. Then, each data point is standardized: each value in the voltage sequence is subtracted from the voltage mean and then divided by the voltage standard deviation; each value in the current sequence is subtracted from the current mean and then divided by the current standard deviation. After processing, the data distribution is centered on the mean and has a standard deviation of 1, reducing the impact of dimensional differences on subsequent models.
[0044] In another optional embodiment, the normalization process can be achieved by calculating the median and interquartile range (IQR) of the voltage and current sequences respectively, and then scaling each data point: subtracting the voltage median from each value in the voltage sequence and dividing by the voltage IQR, and subtracting the current median from each value in the current sequence and dividing by the current IQR. After processing, the data is centered based on the median and scaled by the IQR, reducing the interference of outliers.
[0045] S2. Construct an input data matrix based on the preprocessed current sequence and a target data matrix based on the preprocessed voltage sequence. The input data matrix is organized in an Nto1 mode according to a preset time step.
[0046] The normalized current sequence of continuous time steps is extracted using a sliding window method as a sample of the input data matrix, and the normalized voltage data of the next time step after the end of the corresponding time window is used as a sample of the target data matrix.
[0047] In this process, an RNN training dataset is created based on voltage and current sequences, with a time step of 10. The current sequence is converted into an input data matrix and the voltage sequence is converted into a target data matrix using the append function in Python.
[0048] A sliding window mechanism is employed to establish an Nto1 mapping between the current sequence of 10 consecutive time steps (timestep=10) and the voltage value at the next time step, innovatively transforming the problem of electrolytic aluminum parameter identification into a time series prediction problem. Compared to the traditional 1to1 model, this design enables the model to learn the dynamic characteristics of the previous 10 steps and the nonlinear relationship between voltage changes. Matrix processing is achieved through Python's append function, significantly improving data batch processing efficiency.
[0049] S3. Input the preprocessed current sequence into the RNN model, create the RNN training dataset, and obtain the hidden state at the final time step.
[0050] Construct an identification model that includes an RNN layer and a linear regression layer;
[0051] The RNN layer uses a forget gate, input gate, output gate, candidate memory layer, and memory state update mechanism to calculate the current hidden state by combining the current input, the previous hidden state, and the memory state.
[0052] Specifically, the forget gate controls the degree of retention of the memory state at the previous moment, the input gate and the candidate memory layer generate the candidate memory information at the current moment, the memory state is updated by combining the output of the forget gate and the output of the input gate, and the hidden state at the current moment is generated by the output gate and the updated memory state.
[0053] Specifically, the RNN forget gate, input gate, and output gate are designed as follows:
[0054] f t =σ(W f [h t-1 ,x t ]+b f )
[0055] i t =σ(W i [h t-1 ,x t ]+b i )
[0056] ot =σ(W o [h t-1 ,x t ]+b o )
[0057] The candidate memory layer is designed as follows:
[0058]
[0059] The memory update design is as follows:
[0060]
[0061] The hidden layer design of RNN is as follows:
[0062] h t =o t ⊙tanh(C t )
[0063] Where x t =[V t ,I t [] is the input for time step t, h t It is the hidden state of time step t, C t It is the memory state at time step t, W f W i W o W C It is the weight matrix, b f ,b i ,b o ,b C σ is the bias term, σ is the Sigmoid activation function, and ⊙ is element-wise multiplication.
[0064] The linear regression layer maps the hidden state of the last time step to the predicted current value. Specifically, the linear regression layer is designed as follows:
[0065]
[0066] in, This is the predicted current value, W. hy It is the weight matrix, b y It is a bias term, h N This represents the hidden state of the regression layer.
[0067] It should be noted that the hidden state of the last time step is multiplied by the regression weight matrix and the bias vector is superimposed to generate the normalized current prediction value.
[0068] The regression weight matrix and bias vector contain the mapping relationship of electrolytic aluminum production parameters.
[0069] The design incorporates a triple gating mechanism (forget gate / input gate / output gate) and a memory state update mechanism.
[0070] The forget gate uses the Sigmoid function to dynamically control the degree of historical memory retention, solving the gradient vanishing problem caused by long-term reliance in traditional RNNs and extending the memory retention time in continuous electrolytic aluminum production scenarios. The candidate memory layer introduces the tanh activation function to generate features at the current time step, which works in conjunction with the input gate to filter effective information, improving the robustness of parameter identification under abnormal operating conditions. The memory state update mechanism achieves feature fusion through element-wise multiplication, which reduces the key parameter identification error compared to the simple weighted average method.
[0071] The linear regression layer innovatively maps the final hidden state to the current prediction value. Its weight matrix contains the physical relationship of key parameters such as the internal resistance of the electrolytic cell and the electrode spacing, laying a mathematical foundation for the parameter analysis of the S4 step.
[0072] It should also be noted that, based on the target data matrix, the loss of the current prediction value is calculated using the mean square error function, and the parameters of the identification model are iteratively updated using an optimization algorithm.
[0073] In one embodiment of the present invention, mean squared error is used as the loss function for optimization:
[0074]
[0075] Where y i This is the actual current value. Here, M represents the predicted current value, and M represents the sample size.
[0076] In an optional embodiment, the optimization can be performed by calculating the loss of the current prediction value using the mean squared error function based on the preprocessed current sequence input matrix and the target voltage matrix after constructing the RNN identification model. A stochastic gradient descent (SGD) optimizer is employed: a fixed learning rate is set, and the model parameters (such as the weight matrix and bias vector) are updated iteratively. In each iteration, a batch of data is randomly selected, the gradient of the loss function with respect to the parameters is calculated, and the parameter values are updated in the reverse direction of the gradient.
[0077] In another alternative embodiment, optimization can be achieved by calculating the loss of the current prediction using a mean squared error function, based on the preprocessed current sequence input matrix and the target voltage matrix, after constructing the RNN identification model. An Adagrad optimizer is employed: adaptively adjusting the learning rate for each parameter based on the cumulative sum of squared historical gradients. After initializing the learning rate, in each iteration, the learning rate is dynamically scaled according to the magnitude of the historical gradients of the parameters; the update step size decreases for parameters with larger gradients and increases for parameters with smaller gradients.
[0078] An adaptive learning rate adjustment mechanism is employed, updating the model parameters based on the gradient direction of the loss function. In Python, the Adam optimizer is used to update the model parameters.
[0079]
[0080] Where θ represents the model parameters and η represents the RNN learning rate. It is the gradient of the loss function with respect to the parameters.
[0081] S4. Calculate the predicted current value and electrolytic aluminum production parameters based on the hidden state through a linear regression layer.
[0082] The production parameters for electrolytic aluminum are obtained by analyzing the weight matrix and bias vector of the linear regression layer.
[0083] Example 2 is an embodiment of the present invention. This embodiment provides an electrolytic aluminum parameter identification system based on the Nto1 mode RNN algorithm, including: a data processing module, a time series dataset construction module, a parameter identification model module, and a production parameter parsing module;
[0084] The data processing module acquires the DC voltage and current sequence during electrolytic aluminum production and preprocesses the DC voltage and current sequence.
[0085] The time series dataset construction module constructs an input data matrix based on the preprocessed current sequence and a target data matrix based on the preprocessed voltage sequence. The input data matrix is organized in an Nto1 mode according to a preset time step.
[0086] The parameter identification model module inputs the preprocessed current sequence into the RNN model, creates the RNN training dataset, and obtains the hidden state at the final time step.
[0087] The production parameter analysis module calculates the predicted current value and electrolytic aluminum production parameters based on the hidden state through a linear regression layer.
[0088] This embodiment also provides an electronic device applicable to the electrolytic aluminum parameter identification method based on the Nto1 mode RNN algorithm, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the electrolytic aluminum parameter identification method based on the Nto1 mode RNN algorithm proposed in the above embodiment.
[0089] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements the electrolytic aluminum parameter identification method based on the Nto1 mode RNN algorithm proposed in the above embodiment.
[0090] The storage medium proposed in this embodiment and the electrolytic aluminum parameter identification method based on the Nto1 mode RNN algorithm proposed in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.
[0091] Based on the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.
[0092] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for identifying electrolytic aluminum parameters based on an Nto1 mode RNN algorithm, characterized in that: include, Obtain the DC voltage and current sequence in the electrolytic aluminum production process, and preprocess the DC voltage and current sequence; An input data matrix is constructed based on the preprocessed current sequence, and a target data matrix is constructed based on the preprocessed voltage sequence. The input data matrix is organized in an Nto1 mode according to a preset time step. The preprocessed current sequence is input into the RNN model to create an RNN training dataset and obtain the hidden state at the final time step. Current prediction values and electrolytic aluminum production parameters are calculated based on the hidden state through a linear regression layer.
2. The method for identifying electrolytic aluminum parameters based on the Nto1 mode RNN algorithm as described in claim 1, characterized in that: The preprocessing includes normalizing the DC voltage and DC current sequences using the MinMaxScaler function; The mean and standard deviation of the DC voltage sequence and DC current sequence are calculated respectively, and the respective sequences are standardized and scaled based on the mean and standard deviation.
3. The method for identifying electrolytic aluminum parameters based on the Nto1 mode RNN algorithm as described in claim 2, characterized in that: The Nto1 mode includes using a sliding window to extract normalized current sequences of continuous time steps as samples of the input data matrix, and using the normalized voltage data of the next time step after the end of the corresponding time window as samples of the target data matrix.
4. The method for identifying electrolytic aluminum parameters based on the Nto1 mode RNN algorithm as described in claim 3, characterized in that: The RNN model includes constructing an identification model that includes an RNN layer and a linear regression layer; The RNN layer uses a forget gate, input gate, output gate, candidate memory layer, and memory state update mechanism to calculate the current hidden state by combining the current input, the previous hidden state, and the memory state. Specifically, the forget gate controls the degree of retention of the memory state at the previous moment, the input gate and the candidate memory layer generate the candidate memory information at the current moment, the memory state is updated by combining the output of the forget gate and the output of the input gate, and the hidden state at the current moment is generated by the output gate and the updated memory state. The linear regression layer maps the hidden state of the last time step to the current prediction value.
5. The electrolytic aluminum parameter identification method based on the Nto1 mode RNN algorithm as described in claim 4, characterized in that: The linear regression layer includes, The hidden state at the last time step is multiplied by the regression weight matrix and the bias vector is superimposed to generate the normalized current prediction value. The regression weight matrix and bias vector contain the mapping relationship of electrolytic aluminum production parameters.
6. The method for identifying electrolytic aluminum parameters based on the Nto1 mode RNN algorithm as described in claim 5, characterized in that: The linear regression layer further includes calculating the loss of the current prediction value using the mean square error function based on the target data matrix, and iteratively updating the parameters of the identification model using an optimization algorithm. An adaptive learning rate adjustment mechanism is adopted, which updates the model parameters by adjusting the gradient direction of the loss function.
7. The electrolytic aluminum parameter identification method based on the Nto1 mode RNN algorithm as described in claim 6, characterized in that: The electrolytic aluminum production parameters are obtained by analyzing the weight matrix and bias vector of the linear regression layer.
8. An electrolytic aluminum parameter identification system based on an Nto1 mode RNN algorithm, wherein the electrolytic aluminum parameter identification method based on an Nto1 mode RNN algorithm as described in any one of claims 1 to 7 is characterized in that, include: Data processing module, time series dataset construction module, parameter identification model module, production parameter parsing module; The data processing module acquires the DC voltage and current sequence during electrolytic aluminum production and preprocesses the DC voltage and current sequence. The time series dataset construction module constructs an input data matrix based on the preprocessed current sequence and a target data matrix based on the preprocessed voltage sequence. The input data matrix is organized in an Nto1 mode according to a preset time step. The parameter identification model module inputs the preprocessed current sequence into the RNN model, creates an RNN training dataset, and obtains the hidden state at the final time step. The production parameter analysis module calculates the predicted current value and electrolytic aluminum production parameters based on the hidden state through a linear regression layer.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the electrolytic aluminum parameter identification method based on the Nto1 mode RNN algorithm as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the electrolytic aluminum parameter identification method based on the Nto1 mode RNN algorithm as described in any one of claims 1 to 7.