Method, device and system for automatically adjusting liquid injection amount based on electrolyte temperature
Through the automatic adjustment method of liquid injection volume based on the electrolyte temperature, the predictive model is used to dynamically adjust the liquid injection volume, which solves the problem of unstable liquid injection volume in lithium battery manufacturing, and improves production efficiency and product quality.
Patent Information
- Application Number
- CN202411350052.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2024-12-17
AI Technical Summary
During the lithium battery manufacturing process, the amount of electrolyte injection is affected by temperature, which leads to the need for frequent calibration of the injection pump in the prior art, which increases production costs and labor costs.
Using the automatic adjustment method of liquid injection volume based on the electrolyte temperature, the electrolyte temperature is detected in real time and the liquid injection volume is dynamically adjusted through the pre-trained liquid injection volume prediction model, including linear transformation layer, position coding layer, and adaptive attention mechanism layer , encoder and decoder, send commands to the liquid injection machine.
The problem of unstable liquid injection volume is solved, the battery performance and quality is improved, production costs and labor costs are reduced, and the automatic adjustment of liquid injection volume is achieved.
Smart Images

Figure CN119153911A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of lithium battery electrolyte injection amount regulation, and in particular relates to an electrolyte temperature-based automatic injection amount regulation method, device and system. Background Art
[0002] In the lithium battery manufacturing process, the electrolyte injection process is one of the key steps. At present, most manufacturers use a fixed flow rate (volume) to inject electrolyte. Since the relative density of the electrolyte is affected by temperature, when the temperature changes, the amount of electrolyte injected at a fixed flow rate will be overweight or substandard. To solve this problem, production line personnel need to frequently calibrate the fixed injection volume of the injection pump, which is time-consuming, costly and labor-intensive, increasing production and labor costs. Summary of the invention
[0003] In response to the above problems, the present invention proposes a method, device and system for automatically adjusting the injection volume based on the electrolyte temperature, which can predict the current injection volume according to the real-time detected electrolyte temperature, and feed back to the injection machine through instructions, so that the injection machine can dynamically adjust the injection volume according to the instructions, thereby solving the problem of frequent calibration of the injection pump in the prior art.
[0004] In order to achieve the above technical objectives and the above technical effects, the present invention is implemented through the following technical solutions:
[0005] In a first aspect, the present invention provides a method for automatically adjusting the injection amount based on the electrolyte temperature, comprising:
[0006] Obtaining the temperature of the electrolyte;
[0007] Inputting the temperature of the electrolyte into a pre-trained injection volume prediction model to obtain a predicted injection volume;
[0008] Sending the predicted injection amount to the injection machine so that the injection machine performs the injection action according to the predicted injection amount;
[0009] Among them, the injection volume prediction model includes a linear transformation layer, a position encoding layer, an adaptive attention mechanism layer, an encoder, a decoder and an output layer arranged in sequence; the position encoding layer is used to add position encoding to the received data; the encoder includes a number of encoder layers arranged in sequence, each encoder layer includes an input layer, a multi-head self-attention layer, a first residual connection layer, a first normalization layer, a feedforward network layer, a second residual connection layer, a second normalization layer and an output layer arranged in sequence.
[0010] The above technical solution can predict the current injection volume based on the real-time detected electrolyte temperature, and feed back to the injection machine through instructions, so that the injection machine can dynamically adjust the injection volume according to the instructions, thereby solving the problem of frequent calibration of the injection pump in the prior art.
[0011] In combination with the first aspect, optionally, the linear transformation layer transforms the input vector from Dimensions are mapped to In the space of dimensions:
[0012]
[0013] in, is the input vector with dimension [ batch _ size , input _dim ] ; is the weight matrix with dimension [ d _ m o d e l , i n p u t _ d i m ] ; is the bias vector with dimension [ d _ m o d e l ] ; is the output vector with dimension [ b a t c h _ s i z e , d _ m o d e l ] ; is the dimension of the input vector, is the dimension of the injection volume prediction model, It is the number of data items processed at one time.
[0014] The above technical solution is used to embed the input data into a higher-dimensional space so that the subsequent self-attention mechanism layer can better process the data.
[0015] In combination with the first aspect, optionally, the linear transformation layer outputs a linear transformation map; and the position encoding layer generates a position code according to the following formula:
[0016] For even dimensions:
[0017]
[0018] For odd dimensions:
[0019]
[0020] in, and is the positional encoding, is the location information of the data in the linear transformation graph, ; is the dimension index of the linear transformation graph, ; is the dimension of the injection volume prediction model.
[0021] The above technical solution needs to add position information to each input element through position coding, and adding position information helps the model understand the position relationship in the sequence. The present invention uses a combination of sine and cosine functions to generate a unique code for each position, and then adds this code to the input data. In this way, the model can understand the order of elements in the sequence based on the position coding.
[0022] In combination with the first aspect, optionally, the adaptive attention mechanism layer includes several adaptive attention layers arranged in sequence, and the output of the previous adaptive attention layer is added to its input through a residual connection and then input into the next adaptive attention layer.
[0023] The above technical solution enables the model to adaptively allocate attention resources according to the input sequence, enhances the representation ability of the model, and enables it to better capture the dependencies in the sequence.
[0024] In combination with the first aspect, optionally, each encoder layer performs the following steps on the received data:
[0025] The original input data src passes through the multi-head self-attention layer to obtain the self-attention output data src2;
[0026] Using the first residual connection layer, the self-attention output data src2 is added to the original input data src;
[0027] The first normalization layer is used to perform layer normalization on the summation result to obtain the first normalized output data ;
[0028] The first normalized output data The first linear transformation layer, activation function and second linear transformation layer in the feedforward network are sent sequentially to obtain the output data of the feedforward network. ;
[0029] The output data of the feedforward network is transmitted using the second residual connection layer. With the first normalized output data Addition;
[0030] The second normalization layer is used to perform layer normalization on the summation result to obtain the second normalized output data .
[0031] The role of the encoder layer is to enable the model to focus on the correlation of different positions in the input sequence through the self-attention mechanism. The encoder layer in the above technical solution is a custom encoder layer, which adds residual connections (ResNet) and layer normalization (Layer Normalization) to the basic encoder layer (Encoder Layer) to enhance the performance and stability of the model.
[0032] In combination with the first aspect, optionally, the decoder includes a mean pooling layer, a linear decoding layer and a Swish activation function layer;
[0033] The mean pooling layer performs average processing on the output data of the encoder;
[0034] The linear decoding layer projects the output data of the mean pooling layer into the space of the target variable;
[0035] The Swish activation function performs a nonlinear transformation on the output of the linear decoding layer.
[0036] In the above technical solution, the predicted value is obtained by projecting the encoded data into the space of the target variable.
[0037] In combination with the first aspect, optionally, the Swish activation function performs a nonlinear transformation on the output of the linear decoding layer based on the following formula:
[0038]
[0039] in, is the data obtained after nonlinear transformation, is the output of the linear decoding layer.
[0040] In the above technical solution, the Swish activation function is used, which has better smoothness and differentiability than the ReLU activation function.
[0041] In combination with the first aspect, optionally, the number of the injection volume prediction models is greater than 1, and during training, each injection volume prediction model is trained using a different optimizer, and finally an average value is calculated based on the output data of each injection volume prediction model as the final predicted injection volume.
[0042] In the above scheme, the prediction accuracy of the injection volume can be improved by optimizing each injection volume prediction model separately and integrating the prediction results of each injection volume prediction model.
[0043] In a second aspect, the present invention provides an automatic adjustment device for liquid injection amount based on electrolyte temperature, comprising:
[0044] A temperature acquisition module, used to obtain the temperature of the electrolyte;
[0045] A prediction module, used for inputting the temperature of the electrolyte into a pre-trained liquid injection volume prediction model to obtain a predicted liquid injection volume;
[0046] Automatic adjustment of the injection amount, used to send the predicted injection amount to the injection machine, so that the injection machine performs the injection action according to the predicted injection amount;
[0047] Among them, the injection volume prediction model includes a linear transformation layer, a position encoding layer, an adaptive attention mechanism layer, an encoder, a decoder and an output layer arranged in sequence; the position encoding layer is used to add position encoding to the received data; the encoder includes a number of encoder layers arranged in sequence, each encoder layer includes an input layer, a multi-head self-attention layer, a first residual connection layer, a first normalization layer, a feedforward network layer, a second residual connection layer, a second normalization layer and an output layer arranged in sequence.
[0048] The above technical solution can predict the current injection volume based on the real-time detected electrolyte temperature, and feed back to the injection machine through instructions, so that the injection machine can dynamically adjust the injection volume according to the instructions, thereby solving the problem of frequent calibration of the injection pump in the prior art.
[0049] In a third aspect, the present invention provides an automatic adjustment system for electrolyte injection volume based on electrolyte temperature, comprising a storage medium and a processor;
[0050] The storage medium is used to store instructions;
[0051] The processor is configured to operate according to the instructions to execute the method according to any one of the first aspects.
[0052] Compared with the prior art, the present invention has the following beneficial effects:
[0053] The present invention can predict the injection volume through an injection volume prediction model according to the real-time detected electrolyte temperature, and dynamically adjust the injection volume, thereby solving the problem of unstable injection volume weight caused by changes in electrolyte temperature, improving the performance and quality of the battery, and can be widely used in fields such as lithium battery manufacturing, and has broad application prospects.
[0054] The present invention predicts the injection volume through the injection volume prediction model, avoids frequent calibration of the injection pump, and reduces production costs and manpower. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative labor, among which:
[0056] Figure 1 A schematic flow chart of a method for automatically adjusting the amount of electrolyte injection based on electrolyte temperature according to an embodiment of the present invention;
[0057] Figure 2 A schematic diagram of the model structure of an injection volume prediction model according to an embodiment of the present invention;
[0058] Figure 3 A schematic diagram of the structure of an encoder layer according to an embodiment of the present invention;
[0059] Figure 4 A schematic diagram of the training process of the injection volume prediction model according to an embodiment of the present invention;
[0060] Figure 5 The present invention is a flowchart of an automatic adjustment method for evaluating the effect of injection volume according to an embodiment of the present invention. DETAILED DESCRIPTION
[0061] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0062] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present invention, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0063] Example 1
[0064] An embodiment of the present invention provides a method for automatically adjusting the injection amount based on the electrolyte temperature, comprising the following steps:
[0065] (1) Obtaining the temperature of the electrolyte;
[0066] (2) inputting the temperature of the electrolyte into a pre-trained injection volume prediction model to obtain a predicted injection volume;
[0067] (3) sending the predicted injection volume to the injection machine, so that the injection machine performs the injection action according to the predicted injection volume;
[0068] The injection volume prediction model includes a linear transformation layer, a position encoding layer, an adaptive attention mechanism layer, an encoder, a decoder and an output layer, which are arranged in sequence. Figure 2 ; The position encoding layer is used to add position encoding to the received data; the encoder includes a plurality of encoder layers arranged in sequence, each of which includes an input layer, a multi-head self-attention layer, a first residual connection layer, a first normalization layer, a feedforward network layer, a second residual connection layer, a second normalization layer and an output layer arranged in sequence, see Figure 3 .
[0069] The above technical solution can predict the current injection volume based on the real-time detected electrolyte temperature, and feed back to the injection machine through instructions, so that the injection machine can dynamically adjust the injection volume according to the instructions, thereby solving the problem of frequent calibration of the injection pump in the prior art.
[0070] In a specific implementation of the embodiment of the present invention, the injection volume prediction model is a Transformer regression model, which is designed based on the Transformer architecture. Figure 1 As shown, the specific program implementation process of the automatic adjustment method of injection volume includes:
[0071] Define the request header;
[0072] Define the prediction interface;
[0073] Receive the requested data (i.e., the temperature of the electrolyte);
[0074] Create a data loader;
[0075] Load normalized data (i.e., the temperature of the electrolyte after normalization);
[0076] Apply normalized data;
[0077] Convert normalized data to PyTorch tensors;
[0078] Load the Transformer regression model;
[0079] Call the Transformer regression model;
[0080] Return the prediction result (i.e. the predicted injection volume);
[0081] Send instructions to the injection machine;
[0082] The injection machine adjusts the injection volume.
[0083] In a specific implementation of the embodiment of the present invention, the linear transformation layer is used to transform the dimension of the input data from Converted to the dimension of injection volume prediction model [ d _ m o d e l ] , mapping it to the feature space of the injection volume prediction model. This step is necessary because the dimension of the Transformer regression model is fixed, while the dimension of the input data may be different. Specifically, the linear transformation layer transforms the input vector from Dimensions are mapped to In the space of dimensions:
[0084]
[0085] in, is the input vector with dimension [ batch _ size , input _dim ] ; is the weight matrix with dimension [ d _ m o d e l , i n p u t _ d i m ] ; is the bias vector with dimension [ d _ m o d e l ] ; is the output vector with dimension [ b a t c h _ s i z e , d _ m o d e l ] ; is the dimension of the input vector, is the dimension of the injection volume prediction model, It is the number of data items processed at one time.
[0086] The above technical solution is used to embed the input data into a higher-dimensional space so that the subsequent self-attention mechanism layer can better process the data.
[0087] In a specific implementation of an embodiment of the present invention, the linear transformation layer outputs a linear transformation graph; in the Transformer regression model, since it uses a self-attention mechanism, it does not have the ability to process the sequence order itself. Therefore, it is necessary to add position information to each input element through position encoding, and adding position information helps the Transformer regression model understand the positional relationship of each input element in the sequence. A combination of sine and cosine functions is used here to generate a unique position code for each position, and then this position code is added to the corresponding input element. In this way, the Transformer regression model can understand the order of each input element in the sequence based on the position code. Specifically, the position encoding layer generates the position code according to the following formula:
[0088] For even dimensions:
[0089]
[0090] For odd dimensions:
[0091]
[0092] in, and is the positional encoding, is the location information of the data in the linear transformation graph, ; is the dimension index of the linear transformation graph, ; is the dimension of the injection volume prediction model.
[0093] The above technical solution needs to add position information to each input element through position coding, and adding position information helps the model understand the position relationship in the sequence. The present invention uses a combination of sine and cosine functions to generate a unique code for each position, and then adds this code to the input data. In this way, the model can understand the order of elements in the sequence based on the position coding.
[0094] In a specific implementation of an embodiment of the present invention, the adaptive attention mechanism layer includes several adaptive attention layers arranged in sequence, and the output of the previous adaptive attention layer is added to its input through a residual connection and then input to the next adaptive attention layer. Implementation principle: The adaptive attention mechanism layer realizes adaptability based on the multi-head attention mechanism by introducing the MultiheadAttention module. The adaptive attention mechanism layer calculates the self-attention weight of the input data, so that the Transformer regression model can adaptively allocate attention resources according to the input sequence.
[0095] Input and Output: Input data is represented as , is the dimension (depth) of the input data, is the number of heads in the multi-head attention mechanism. In the forward propagation process, the input As query, key and value are passed into the multi-head attention module, and the output is calculated This approach enables the model to adaptively allocate attention resources to generate new representations based on the input sequence.
[0096] The adaptive attention mechanism layer is introduced into the Transformer encoder after the input data has been linearly transformed and positionally encoded. In the forward propagation process of the model, the input data is sequentially passed to multiple adaptive attention layers after linear transformation and position encoding, and the output of each layer is added to the input itself through a residual connection.
[0097] The above technical solution enables the model to adaptively allocate attention resources according to the input sequence, enhances the representation ability of the model, and enables it to better capture the dependencies in the sequence.
[0098] In a specific implementation of the embodiment of the present invention, the encoder (Transformer Encoder) is composed of multiple identical encoder layers (Encoder Layer):
[0099] Encoder Layer 1: The first encoder layer, which includes a multi-head self-attention mechanism layer and a feed-forward neural network with residual connection layers and normalization layers.
[0100] Encoder Layer 2: The second encoder layer, which continues to process features the same as the first encoder layer.
[0101] ...: denotes more encoder layers.
[0102] Encoder Layer N: The Nth encoder layer, where N is the number specified by the num_layers parameter.
[0103] The basic encoder layer (Encoder Layer) contains a multi-head self-attention mechanism and a feedforward neural network. The function of the encoder layer is to process sequence data, and through the self-attention mechanism, the model can pay attention to the correlation between different positions in the input sequence. The encoder layer in the embodiment of the present invention is a custom encoder layer, which adds residual connections (ResNet) and layer normalization (Layer Normalization) to the basic encoder layer (Encoder Layer) to enhance the performance and stability of the model. This custom encoder layer inherits the basic encoder (Encoder Layer) and has the following structure: input layer, multi-head self-attention layer, first residual connection layer, first normalization layer, feedforward network (first linear transformation layer, activation function, second linear transformation layer), second residual connection layer, second normalization layer and output layer, see for details. Figure 3 ; Each encoder layer performs the following steps on the received data:
[0104] The original input data src passes through the multi-head self-attention layer to obtain the self-attention output data src2;
[0105] Using the first residual connection layer, the self-attention output data src2 is added to the original input data src;
[0106] The first normalization layer is used to perform layer normalization on the summation result to obtain the first normalized output data ;
[0107] The first normalized output data The first linear transformation layer, activation function and second linear transformation layer in the feedforward network are sent sequentially to obtain the output data of the feedforward network. ;
[0108] The output data of the feedforward network is transmitted using the second residual connection layer. With normalized output data Addition;
[0109] The second normalization layer is used to perform layer normalization on the summation result to obtain the second normalized output data .
[0110] The role of the encoder layer is to enable the model to focus on the correlation of different positions in the input sequence through the self-attention mechanism. The encoder layer in the above technical solution is a custom encoder layer, which adds residual connections (ResNet) and layer normalization (Layer Normalization) to the basic encoder layer (Encoder Layer) to enhance the performance and stability of the model.
[0111] The design of the encoder in the embodiment of the present invention allows information to flow between different positions in the sequence and extract more advanced features in each layer. By stacking multiple such encoder layers, the model can learn more complex patterns and long-distance dependencies.
[0112] The process of stacking N encoder layers is as follows:
[0113] 1) The input data first passes through the first encoder layer.
[0114] 2) The output of the first encoder layer is used as the input of the second encoder layer.
[0115] 3) The output of the second encoder layer serves as the input of the third encoder layer.
[0116] 4) This process continues until the data passes through the Nth encoder layer.
[0117] 5) The output of the Nth encoder layer is the output of the entire Transformer encoder.
[0118] The internal structure of each encoder layer is the same, but they have their own independent parameters. This design allows the model to learn features at different levels of abstraction.
[0119] In a specific implementation of the embodiment of the present invention, the decoder includes a mean pooling layer, a linear decoding layer and a Swish activation function layer;
[0120] The mean pooling layer performs average processing on the output data of the encoder;
[0121] The linear decoding layer projects the output data of the mean pooling layer into the space of the target variable;
[0122] The Swish activation function performs a nonlinear transformation on the output of the linear decoding layer;
[0123] Specifically, the decoder comprises:
[0124] Input layer: receives the output from the encoder, that is, the encoded features.
[0125] Mean Pooling: Average the output of the encoder to integrate the features of all positions.
[0126] Linear Decoder: It projects the output of the encoder to the space of the target variable. It converts the high-dimensional feature vector into the output of the specified dimension through a linear transformation, completing the conversion from ( )arrive( ). Linear transformation process: .in, is the weight matrix, is the bias vector.
[0127] Swish Activation: The Swish activation function performs a nonlinear transformation on the output of the linear layer. It has better smoothness and differentiability than the ReLU activation function.
[0128] Output layer (Output): The output after the Swish activation function is the final prediction value of the model.
[0129] In the above technical solution, the predicted value is obtained by projecting the encoded data into the space of the target variable.
[0130] In a specific implementation of the embodiment of the present invention, the Swish activation function performs a nonlinear transformation on the output of the linear decoding layer based on the following formula:
[0131]
[0132] in, is the data obtained after nonlinear transformation, is the output of the linear decoding layer.
[0133] In the above technical solution, the Swish activation function is used, which has better smoothness and differentiability than the ReLU activation function.
[0134] In a specific implementation of an embodiment of the present invention, the number of injection volume prediction models is greater than 1. During training, each injection volume prediction model is trained using a different optimizer, and finally the average value is calculated based on the output data of each injection volume prediction model as the final predicted injection volume.
[0135] In the above scheme, the prediction accuracy of the injection volume can be improved by optimizing each injection volume prediction model separately and integrating the prediction results of each injection volume prediction model.
[0136] In the specific implementation process, the following method is used to train the injection volume prediction model:
[0137] 1. Data preparation: Read the electrolyte temperature data, delete the rows containing null values, and divide them into training set and validation set.
[0138] 2. Data preprocessing: Use MinMaxScaler to standardize the data and convert the processed data into PyTorch tensors.
[0139] 3. Model definition: Build a Transformer regression model.
[0140] 4. Model instantiation: Instantiate two Transformer regression models, define two optimizers using the Adam and RMSprop optimization methods respectively, and integrate the prediction results of the two Transformer regression models to improve the final prediction accuracy.
[0141] 5. Model training: Define the training function and use Adam and RMSprop optimizers and MSE loss function for model training.
[0142] 6. Model prediction and evaluation: define the prediction function, calculate performance indicators such as MSE, and evaluate the prediction accuracy of the model.
[0143] like Figure 4 As shown in FIG. 1 , the specific program implementation process for training the injection volume prediction model includes:
[0144] Reading and preprocessing data (i.e., temperature of the electrolyte);
[0145] Divide into training set and validation set;
[0146] Data normalization processing;
[0147] Convert data into PyTorch tensors;
[0148] Create a data loader;
[0149] Define the Transformer regression model;
[0150] Transformer regression model instantiation;
[0151] Define the optimizer and loss function;
[0152] Train the Transformer regression model;
[0153] Transformer regression model prediction;
[0154] Calculate performance indicators;
[0155] Keep the Transformer regression model.
[0156] like Figure 5 As shown, in the specific implementation process, it is also necessary to evaluate the prediction effect of the Transformer regression model, which includes the following steps:
[0157] 1. On-site personnel will verify the predicted injection volume with the actual injection volume;
[0158] 2. If the verification result is inconsistent, feedback will be given to the developer.
[0159] 3. Developers can improve prediction results by adding input features or optimizing algorithms.
[0160] The method for automatically adjusting the injection amount based on the electrolyte temperature in an embodiment of the present invention is described in detail below in conjunction with a specific implementation.
[0161] 1. Data input
[0162] Input data shape: The data src is fed into the model, and the shape of the data src is a tensor of (batch_size, seq_len, input_dim).
[0163] In this model, batch_size = 32, seq_len = 6 (corresponding to 6 lags), and input_dim = 1.
[0164] batch_size: Batch size, that is, the number of data items processed at a time.
[0165] seq_len: sequence length, that is, the length of the time series data.
[0166] input_dim: The dimension of the input vector.
[0167] 2. Linear Layer
[0168] Input data shape: Input to the linear transformation layer, the shape is (seq_len, batch_size, input_dim).
[0169] Transformation operation: A linear transformation maps the dimension input_dim to d_model.
[0170] Output data shape: The shape of src_ll becomes (seq_len, batch_size, d_model).
[0171] Explanation: The linear transformation adjusts the feature dimension to adapt it to the dimension d_model of the Transformer regression model.
[0172] 3. Positional Encoding
[0173] Input data shape: Input the data src_ll to the position encoding layer with a shape of (seq_len, batch_size, d_model).
[0174] Transformation operation: Position encoding generates a position vector based on seq_len and d_model and adds it to src.
[0175] Output data shape: The shape of src_pe is still (seq_len, batch_size, d_model).
[0176] Explanation: Positional encoding provides corresponding position information for each position, helping the model understand the relative and absolute positions in the sequence.
[0177] 4. Adaptive Attention
[0178] Input data shape: src_pe is input to the adaptive attention mechanism layer (Adaptive Attention), with a shape of (seq_len, batch_size, d_model).
[0179] Transformation operation: It passes through multiple adaptive attention layers in sequence. In each layer, the model adaptively adjusts the attention allocation according to the input and adds the input and output through the residual connection.
[0180] Output data shape: The shape of src2 is (seq_len, batch_size, d_model).
[0181] Explanation: The adaptive attention mechanism layer allows the model to adaptively adjust the attention allocation based on the input, improving the ability to model long-range dependencies, thereby facilitating more accurate sequence prediction.
[0182] 5. Transformer Encoder
[0183] Input data shape: src2 is input to the Transformer encoder with a shape of (seq_len, batch_size, d_model).
[0184] Transformation operation: The Transformer encoder passes through multiple encoder layers and preserves the sequence length and batch size.
[0185] Output data shape: The shape of output_te is (seq_len, batch_size, d_model).
[0186] Explanation: The Transformer encoder extracts the complex contextual relationships of the input features.
[0187] 6. Linear Decoder
[0188] Input data shape: output_te is input to the linear decoding layer, with a shape of (seq_len, batch_size, d_model).
[0189] Transformation operation: The linear decoding layer projects the dimension from d_model to output_dim.
[0190] Output data shape: The shape of output_ld becomes (seq_len, batch_size, output_dim).
[0191] Explanation: The decoding layer projects the encoded features into the space of the target variable to obtain the predicted value.
[0192] 7. Activation Function (Swish)
[0193] Input data shape: output_ld is input to the Swish activation function, with a shape of (seq_len, batch_size, output_dim).
[0194] Transformation operation: Swish activation function performs nonlinear transformation.
[0195] Output data shape: The shape of output_s is still (seq_len, batch_size, output_dim).
[0196] Explanation: The Swish activation function enhances the nonlinear expression ability of the model.
[0197] Example 2
[0198] Based on the same inventive concept as that of Example 1, the present invention provides an automatic adjustment device for liquid injection amount based on electrolyte temperature, comprising:
[0199] A temperature acquisition module, used to obtain the temperature of the electrolyte;
[0200] A prediction module, used for inputting the temperature of the electrolyte into a pre-trained liquid injection volume prediction model to obtain a predicted liquid injection volume;
[0201] Automatic adjustment of the injection amount, used to send the predicted injection amount to the injection machine, so that the injection machine performs the injection action according to the predicted injection amount;
[0202] The injection volume prediction model includes a linear transformation layer, a position encoding layer, an adaptive attention mechanism layer, an encoder, a decoder and an output layer, which are arranged in sequence. Figure 2 ; The position encoding layer is used to add position encoding to the received data; the encoder includes a plurality of encoder layers arranged in sequence, each of which includes an input layer, a multi-head self-attention layer, a first residual connection layer, a first normalization layer, a feedforward network layer, a second residual connection layer, a second normalization layer and an output layer arranged in sequence, see Figure 3 .
[0203] The above technical solution can predict the current injection volume based on the real-time detected electrolyte temperature, and feed back to the injection machine through instructions, so that the injection machine can dynamically adjust the injection volume according to the instructions, thereby solving the problem of frequent calibration of the injection pump in the prior art.
[0204] The rest are the same as in Example 1.
[0205] Example 3
[0206] An embodiment of the present invention provides an automatic adjustment system for electrolyte injection volume based on electrolyte temperature, including a storage medium and a processor;
[0207] The storage medium is used to store instructions;
[0208] The processor is configured to operate according to the instructions to execute the method according to any one of the embodiments 1.
[0209] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0210] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0211] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0212] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0213] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the enlightenment of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the purpose of the present invention and the claims, which all fall within the protection of the present invention.
[0214] The above shows and describes the basic principles and main features of the present invention and the advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A method for automatically adjusting the injection amount based on electrolyte temperature, It is characterized in that include: Obtaining the temperature of the electrolyte; Inputting the temperature of the electrolyte into a pre-trained injection volume prediction model to obtain a predicted injection volume; Sending the predicted injection amount to the injection machine so that the injection machine performs the injection action according to the predicted injection amount; Among them, the injection volume prediction model includes a linear transformation layer, a position encoding layer, an adaptive attention mechanism layer, an encoder, a decoder and an output layer arranged in sequence; the position encoding layer is used to add position encoding to the received data; the encoder includes a number of encoder layers arranged in sequence, each encoder layer includes an input layer, a multi-head self-attention layer, a first residual connection layer, a first normalization layer, a feedforward network layer, a second residual connection layer, a second normalization layer and an output layer arranged in sequence.
2. The method for automatically adjusting the injection amount based on the electrolyte temperature according to claim 1, Features: The linear transformation layer transforms the input vector from Dimensions are mapped to In the space of dimensions: ; in, is the input vector with dimension ; is the weight matrix with dimension ; is the bias vector with dimension ; is the output vector with dimension ; is the dimension of the input vector, is the dimension of the injection volume prediction model, It is the number of data items processed at one time.
3. The method for automatically adjusting the injection amount based on the electrolyte temperature according to claim 1, Features: The linear transformation layer outputs a linear transformation map; the position encoding layer generates a position code according to the following formula: For even dimensions: ; For odd dimensions: ; in, and is the positional encoding, is the location information of the data in the linear transformation graph, ; is the dimension index of the linear transformation graph, ; is the dimension of the injection volume prediction model.
4. The method for automatically adjusting the injection amount based on the electrolyte temperature according to claim 1, Features: The adaptive attention mechanism layer includes several adaptive attention layers arranged in sequence, and the output of the previous adaptive attention layer is added to its input through a residual connection and then input into the next adaptive attention layer.
5. The method for automatically adjusting the injection amount based on the electrolyte temperature according to claim 1, Features: Each encoder layer performs the following steps on the received data: The original input data src passes through the multi-head self-attention layer to obtain the self-attention output data src2; Using the first residual connection layer, the self-attention output data src2 is added to the original input data src; The first normalization layer is used to perform layer normalization on the summation result to obtain the first normalized output data ; The first normalized output data The first linear transformation layer, activation function and second linear transformation layer in the feedforward network are sent sequentially to obtain the output data of the feedforward network. ; The output data of the feedforward network is transmitted using the second residual connection layer. With the first normalized output data Addition; The second normalization layer is used to perform layer normalization on the summation result to obtain the second normalized output data .
6. The method for automatically adjusting the injection amount based on the electrolyte temperature according to claim 1, Features: The decoder includes a mean pooling layer, a linear decoding layer and a Swish activation function layer; The mean pooling layer performs average processing on the output data of the encoder; The linear decoding layer projects the output data of the mean pooling layer into the space of the target variable; The Swish activation function performs a nonlinear transformation on the output of the linear decoding layer.
7. The method for automatically adjusting the injection amount based on the electrolyte temperature according to claim 6, Features: The Swish activation function performs a nonlinear transformation on the output of the linear decoding layer based on the following formula: ; in, is the data obtained after nonlinear transformation, is the output of the linear decoding layer.
8. The method for automatically adjusting the injection amount based on the electrolyte temperature according to claim 1, Features: The number of the injection volume prediction models is greater than 1. During training, each injection volume prediction model is trained using a different optimizer, and finally an average value is calculated based on the output data of each injection volume prediction model as the final predicted injection volume.
9. An automatic adjustment device for the amount of electrolyte injection based on the temperature of the electrolyte, It is characterized in that include: A temperature acquisition module, used to obtain the temperature of the electrolyte; A prediction module, used for inputting the temperature of the electrolyte into a pre-trained liquid injection volume prediction model to obtain a predicted liquid injection volume; Automatic adjustment of the injection amount, used to send the predicted injection amount to the injection machine, so that the injection machine performs the injection action according to the predicted injection amount; Among them, the injection volume prediction model includes a linear transformation layer, a position encoding layer, an adaptive attention mechanism layer, an encoder, a decoder and an output layer arranged in sequence; the position encoding layer is used to add position encoding to the received data; the encoder includes a number of encoder layers arranged in sequence, each encoder layer includes an input layer, a multi-head self-attention layer, a first residual connection layer, a first normalization layer, a feedforward network layer, a second residual connection layer, a second normalization layer and an output layer arranged in sequence.
10. An automatic adjustment system for electrolyte injection volume based on electrolyte temperature, It is characterized in that including storage media and processors; The storage medium is used to store instructions; The processor is configured to operate according to the instructions to perform the method according to any one of claims 1-8.
Citation Information
Patent Citations
Information prediction model construction method and device based on multi-source and multi-dimensional data and application
CN116542290A
