Data processing method, electronic equipment and storage medium

By constructing the initial feature matrix and using matrix multiplication for Layer Norm calculation, the problem of traditional low computing efficiency is solved, efficient data processing and model training is realized, and the performance of deep learning models is improved.

CN119293215APending Publication Date: 2025-01-10GUANGZHOU XIAOPENG MOTORS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411426480.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-12
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

The traditional Layer Norm calculation method performs addition and division operations on the features of each sample one by one, resulting in inefficient calculation and low data processing efficiency of deep learning models.

Method used

By constructing the initial feature matrix and using preset feature vectors to multiply it by matrix, the first feature matrix is ​​generated, and then normalizing it, using matrix operations to replace traditional element-by-element addition, subtraction and division operations, simplifying the calculation process and Make full use of the matrix computing optimization capabilities of modern processors.

Benefits of technology

It significantly improves data processing efficiency, shortens computing time, improves the training efficiency and generalization capabilities of the model, especially when processing large-scale data sets, which show significant performance improvements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119293215A_ABST
    Figure CN119293215A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method, electronic equipment and a storage medium. The method comprises the following steps: constructing an initial feature matrix based on sample attributes of sample data; generating a first feature matrix by using a preset feature vector and the initial feature matrix; performing normalization processing on the sample data according to the first feature matrix to obtain target application scene data, the target application scene data comprising one of the following data: natural language processing data, computer vision data and voice recognition data; and executing an application scene control operation corresponding to the target application scene data. The technical problem of relatively low data processing efficiency in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular, to a data processing method, an electronic device, and a storage medium. Background Art

[0002] The current normalization layer, especially the layer normalization operator (Layer Norm), plays a vital role in deep learning models. The main function of Layer Norm is to locally normalize the input features of the neural network to eliminate the changes in the input distribution between layers, thereby accelerating the training process of the model and improving its generalization ability. However, the traditional LayerNorm calculation method, that is, adding and dividing the features of each sample to calculate the mean and variance, has the problem of low computational efficiency. As a result, the model has low efficiency in processing data.

[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0004] The embodiments of the present application provide a data processing method, an electronic device, and a storage medium to at least solve the technical problem of low data processing efficiency in related technologies.

[0005] According to one aspect of an embodiment of the present application, a data processing method is provided, including: constructing an initial feature matrix based on sample attributes of sample data; generating a first feature matrix using a preset feature vector and the initial feature matrix; normalizing the sample data according to the first feature matrix to obtain target application scenario data, wherein the target application scenario data includes one of the following: natural language processing data, computer vision data, speech recognition data; and executing an application scenario control operation corresponding to the target application scenario data.

[0006] According to another aspect of the embodiments of the present application, an electronic device is provided, including: a memory storing an executable program; and a processor for running the program, wherein the program executes any one of the methods in the above embodiments when running.

[0007] According to another aspect of an embodiment of the present application, a computer-readable storage medium is provided, the computer-readable storage medium including a stored executable program, wherein when the executable program is running, the device where the storage medium is located is controlled to execute any one of the methods in the above embodiments.

[0008] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the computer program implements any one of the methods in the above embodiments.

[0009] In the embodiment of the present application, an initial feature matrix is ​​constructed based on the sample attributes of the sample data; a first feature matrix is ​​generated by using a preset feature vector and the initial feature matrix; the sample data is normalized according to the first feature matrix to obtain target application scenario data, wherein the target application scenario data includes one of the following: natural language processing data, computer vision data, and speech recognition data; the application scenario control operation corresponding to the target application scenario data is executed to improve the data processing efficiency, so that the application scenario control operation corresponding to the target application scenario data can be efficiently executed; it is easy to notice that when the initial feature matrix is ​​constructed based on the sample data and the preset feature vector is used to operate with it to generate the first feature matrix, this process is essentially to realize the calculation of the weighted sum of features through matrix multiplication. Then, the first feature matrix is ​​normalized, and this process is also completed based on matrix operations. By converting feature processing and normalization operations into matrix operations, not only the calculation process is simplified, but also the optimization capability of the current processor for matrix operations is fully utilized, thereby significantly improving the data processing efficiency. And then the technical problem of low data processing efficiency in related technologies is solved. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0011] Figure 1 is a flow chart of a data processing method according to an embodiment of the present application;

[0012] Figure 2 is a flow chart of calculating the mean of K feature points by a normalization layer according to an embodiment of the present application;

[0013] Figure 3 is a schematic diagram of determining a mean value according to an embodiment of the present application;

[0014] Figure 4 is a schematic diagram of a bias operation according to an embodiment of the present application;

[0015] Figure 5 is a schematic diagram of matrix multiplication according to an embodiment of the present application;

[0016] Figure 6 is a schematic diagram of a quantization process according to an embodiment of the present application;

[0017] Figure 7 is a schematic diagram of matrix multiplication according to an embodiment of the present application;

[0018] Figure 8 is a schematic diagram of a data processing device according to an embodiment of the present application. DETAILED DESCRIPTION

[0019] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0020] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0021] According to an embodiment of the present application, a data processing method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0022] Figure 1 is a flow chart of a data processing method according to an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:

[0023] Step S102, constructing an initial feature matrix based on sample attributes of sample data;

[0024] The above-mentioned initial feature matrix constructed based on the sample attributes of the sample data can be used in the preprocessing stage to provide standardized feature input for subsequent layer normalization operator (Layer Norm operator) calculation and neural network training.

[0025] In the field of machine learning and deep learning, the sample data mentioned above refers to individual data points in the data set used to train, validate, or test the model. Different sample data contain a series of attributes, which can be different types of information such as numerical values, categories, or text.

[0026] The above sample attributes can be used to describe the characteristics of sample data. Sample attributes can include the number of features and the number of samples. The number of features refers to the number of feature dimensions of different samples, while the number of samples refers to the number of samples in the entire data set.

[0027] The above initial feature matrix is ​​the result of converting the sample data and its attributes into a matrix form. Usually, the rows of this matrix represent different samples and the columns represent the various features of the samples.

[0028] For example, when processing an image classification task, each image (sample data) is converted into a vector with 256 features (such as color intensity, texture, etc.). If the dataset contains 10,000 images, then the "number of samples" is 10,000 and the "number of features" is 256. Based on these sample attributes, an initial feature matrix of 10,000×256 can be constructed. Each row of this matrix will correspond to an image, and each column will correspond to a feature.

[0029] The process of constructing the initial feature matrix involves standardizing the sample attributes, that is, collecting and organizing the features of each sample to ensure that they can be correctly processed by the model. This process is the prerequisite for the calculation of the Layer Norm operator. LayerNorm needs to normalize the feature matrix to optimize the model training process.

[0030] Constructing the initial feature matrix can provide a structured and standardized data format for the calculation of the Layer Norm operator, allowing the operator to operate more efficiently. By organizing the attributes of the sample data into a matrix form, the efficiency of matrix operations can be used to accelerate the calculation, especially when processing large-scale data sets, which will greatly improve the calculation speed and model training efficiency.

[0031] In the application scenario of the autonomous driving system, the neural network needs to process a large amount of environmental perception data, and images from the camera can be used. Assume that each image is converted into a vector containing 256 features, and there are 10,000 such images in the entire data set. Before model training, an initial feature matrix of 10,000×256 can be constructed based on these sample attributes. Subsequently, the characteristics of matrix multiplication can be used to convert a large number of independent addition, subtraction, and multiplication operations into multiplication-accumulation, bias, and quantization operations in matrix multiplication, thereby significantly improving computational efficiency and model performance. In this way, not only can the convergence of the model be accelerated and the training efficiency be improved, but also the generalization ability of the model can be enhanced, so that it performs better when facing new environmental data, which is crucial for the stability and safety of the autonomous driving system under different weather and road conditions.

[0032] Step S104, generating a first characteristic matrix using the preset characteristic vector and the initial characteristic matrix;

[0033] The above-mentioned preset feature vector is to construct a vector with a length of K and all eigenvalues ​​being 1. The eigenvalues ​​of the preset feature vector are not specifically limited here.

[0034] For example, the initial feature matrix is ​​'KM', where 'K' is the feature dimension (e.g. 256) and 'M' is the number of samples (e.g. 10000). For each channel (i.e. each column) in the 'KM' matrix, its mean 'U' can be calculated. A vector 'Vector' with a length of 'K' and multiple eigenvalues ​​of 1 can be pre-constructed. Then, the 'Vector' can be dot-producted with the 'KM' matrix (i.e., corresponding elements are multiplied and then accumulated), and the result will be a vector containing the mean of each channel.

[0035] By constructing a specific preset eigenvector and multiplying it with the initial eigenmatrix, the first eigenmatrix containing key statistical information, such as the mean 'U', can be quickly generated. Compared with the traditional element-by-element calculation, this method can significantly improve the computational efficiency. For example, when using matrix multiplication to calculate the mean, the present application only needs to perform one matrix multiplication operation, while the traditional element-by-element calculation requires 'K' additions and one division. When 'K' is large, the efficiency gap will be very significant. In addition, the use of matrix operations can better utilize the parallel processing capabilities of modern computing hardware, further speed up the calculation speed, and improve performance. The advantages of matrix multiplication are utilized to avoid a large number of repeated element-by-element addition operations, thereby improving computational efficiency.

[0036] Step S106, normalizing the sample data according to the first feature matrix to obtain target application scenario data;

[0037] Among them, the target application scenario data includes one of the following: natural language processing data, computer vision data, and speech recognition data.

[0038] The first feature matrix mentioned above refers to a feature representation in matrix form obtained by processing the original data in a deep learning model. The first feature matrix may contain multiple feature vectors, each of which corresponds to a dimension of the data.

[0039] In the calculation of the Layer Norm operator, the first feature matrix refers to the matrix form of the input data X, where each element represents a certain eigenvalue in the feature tensor. For example, for a sentence in natural language processing, after the embedding layer, a feature matrix of size K×M can be obtained, where K represents the dimension of word embedding and M represents the number of words in the sentence.

[0040] The above-mentioned sample data refers to one or more data points in the data set used to train or test the deep learning model, which can be different types of data such as images, text, and speech. Sample data can be a sentence in a natural language processing task, an image in computer vision, or an audio clip in speech recognition. In this application, sample data is data that has been preliminarily processed to form a feature matrix.

[0041] The above-mentioned normalization is a data preprocessing technique used to adjust the numerical range of the data so that it has the same feature scale, which helps to improve the training efficiency and generalization ability of the model. In Layer Norm, normalization is performed by converting the data on each dimension of the feature matrix into a standard normal distribution with a mean of 0 and a variance of 1. For example, for speech recognition data, each element in the speech feature vector can be subtracted from the mean of its dimension and divided by the variance of its dimension.

[0042] The target application scenario data mentioned above refers to data that can be applied to specific fields or tasks after being processed by the deep learning model. These data are preprocessed and learned by the model and contain information useful for specific tasks. The feature matrix normalized by the LayerNorm operator can be used for specific applications such as text classification in natural language processing, image recognition in computer vision, or audio classification in speech recognition. For example, in computer vision, the target application scenario data can be a normalized image feature matrix for subsequent object recognition.

[0043] In an optional embodiment, the sample data can be normalized using a pre-constructed first feature matrix. This process usually involves calculating the mean and variance of the feature matrix, and then scaling and translating each eigenvalue using the Layer Norm operator formula to achieve data standardization. This process can improve the performance of data in the deep learning model, enhance the stability and convergence speed of the model, and improve the generalization ability of the model. By using matrix multiplication instead of traditional element-by-element addition, subtraction and division, the efficiency and performance of the normalization process are significantly improved. Using matrix multiplication to perform the fusion operation of addition and multiplication reduces the calculation steps, especially for large-scale data sets, it can greatly shorten the calculation time. Matrix multiplication usually has higher parallelism on modern hardware (such as GPU). Therefore, through the calculation method of the present application, the processing speed can be greatly improved while ensuring the accuracy of the calculation. Through the optimized Layer Norm operator, the covariate offset problem in the deep learning model can be better controlled, so that the model has a stronger generalization ability when facing new data sets.

[0044] For example, for natural language processing tasks, the task is sentiment analysis, that is, judging whether a text is positive, negative or neutral. The original data is a text collection containing multiple sentences. After each sentence passes through the word embedding layer, it forms a 256-dimensional (K=256) vector, and the entire text collection forms a 256×M matrix (M is the number of sentences). You can first construct a 256×256 matrix KK with 1 elements on the diagonal and 0 elements on the rest, and then calculate the mean and variance through matrix multiplication. Finally, perform Layer Norm processing on the feature matrix of the entire text collection to obtain the normalized feature matrix, that is, the target application scenario data. In practical applications, data processed by the optimized Layer Norm operator can be more efficiently used for subsequent deep learning model training, such as sentiment classification models, which not only speeds up the training speed of the model, but also improves the classification accuracy of the model on new text data, showing obvious computational efficiency and performance improvement effects.

[0045] Step S108, executing the application scenario control operation corresponding to the target application scenario data.

[0046] The above application scenarios can be data fields that require deep learning model processing, such as natural language processing, computer vision, speech recognition, etc. The Layer Norm operator is a method used for normalization processing in deep learning networks. Its introduction makes the training and inference of models in these application scenarios more efficient.

[0047] By constructing specific matrices and vectors and integrating the calculation steps in Layer Norm into matrix multiplication, the calculation time can be significantly reduced and the control operation efficiency of the model in the target application scenario can be improved. For example, in computer vision, rapid processing of image data can adjust the parameters of the model in real time to adapt to different lighting, angles and background changes, thereby improving the accuracy and speed of image recognition. In natural language processing, the adjusted Layer Norm operator can process text sequences faster, improve semantic understanding and generation speed, and enhance user experience.

[0048] Executing application scenario control operations corresponding to the target application scenario data actually refers to applying the optimized Layer Norm operator to actual data processing and model training to improve computing efficiency and performance and better serve various deep learning application scenarios.

[0049] In an embodiment of the present application, an initial feature matrix is ​​constructed based on the sample attributes of the sample data; a first feature matrix is ​​generated using a preset feature vector and the initial feature matrix; the sample data is normalized according to the first feature matrix to obtain target application scenario data, wherein the target application scenario data includes one of the following: natural language processing data, computer vision data, and speech recognition data; the application scenario control operation corresponding to the target application scenario data is executed, thereby improving the data processing efficiency, so that the application scenario control operation corresponding to the target application scenario data can be efficiently executed. It is easy to notice that by replacing the traditional element-by-element operation with matrix operations, the calculation steps can be significantly reduced and the operation speed can be improved. Specifically, when an initial feature matrix is ​​constructed based on the sample data, and a preset feature vector is used to operate with it to generate a first feature matrix, this process is essentially to calculate the weighted sum of features through matrix multiplication. Next, the first feature matrix is ​​normalized, which is also completed based on matrix operations, specifically including calculating the mean and variance of the features, and then using these statistics to scale and translate each element in the matrix.

[0050] In this process, the key is how to use the efficiency of matrix operations, that is, how to convert traditional operations such as element-by-element weighting, averaging, and variance into matrix multiplication and matrix operations by constructing appropriate matrices and vectors. For example, when calculating the mean, you can quickly get the mean by constructing a vector of all 1s and multiplying it with the feature matrix, and then dividing it by the number of features. When calculating the variance, you can quickly calculate the variance by constructing a diagonal matrix whose diagonal elements are the squares of the eigenvalues ​​minus the mean, multiplying it with the feature matrix, and then performing appropriate summation and averaging operations.

[0051] This application not only simplifies the calculation process by converting feature processing and normalization operations into matrix operations, but also makes full use of the optimization capabilities of modern processors for matrix operations, thereby significantly improving data processing efficiency. This improvement is particularly suitable for processing large-scale data sets, such as natural language processing, computer vision, and speech recognition, because these scenarios usually involve a large amount of feature data, and matrix operations can significantly reduce the computing time required to process this data, thereby solving the technical problem of low data processing efficiency in related technologies.

[0052] In summary, this application achieves the goal of efficient processing of large-scale data sets by converting traditional element-by-element operations into matrix operations, especially in normalization processing, thereby improving data processing efficiency and solving problems existing in related technologies.

[0053] This application makes full use of the advantages of a large number of matrix multiplication logics in neural networks. Since matrix multiplication calculations are usually more efficient, matrix operations can be used to replace the current summation and division operations of the normalization layer, making the normalization layer output more efficient and having relatively better performance. Based on this, this application proposes a calculation method for operators in the normalization layer based on matrix multiplication and addition, and its performance is greatly improved compared to traditional calculation methods. Figure 2 is a flow chart of calculating the mean of K feature points by a normalization layer according to an embodiment of the present application, such as Figure 2 As shown, data can be loaded K times, matrix multiplication operations can be performed K / n times, and data can be loaded Data, perform matrix multiplication on the data, load K times, load Data, and perform matrix multiplication on the data. In the process of calculating the mean u of K feature points by the operator of the normalization layer, the traditional method is to load K feature data points, perform K-1 addition operations and one division operation to obtain the mean u; and the present application converts the addition operation into a matrix multiplication operation for multiplication and accumulation. It only needs to load K feature data points, perform K / n matrix multiplication operations, and then perform a quantization to obtain the mean u. The more data loaded each time, the higher the calculation efficiency of this method. For example, for K of 256, M of 10000, and n of 16, the time used for normalization calculation using the method proposed in this application is greatly shortened compared to the time calculated by the traditional calculation method, and the performance is improved by about 5 times.

[0054] Through the above steps, an initial feature matrix is ​​constructed based on the sample attributes of the sample data; a first feature matrix is ​​generated by using the preset feature vector and the initial feature matrix; the sample data is normalized according to the first feature matrix to obtain target application scenario data, wherein the target application scenario data includes one of the following: natural language processing data, computer vision data, and speech recognition data; the application scenario control operation corresponding to the target application scenario data is executed to improve the data processing efficiency, so that the application scenario control operation corresponding to the target application scenario data can be efficiently executed; it is easy to notice that when the initial feature matrix is ​​constructed based on the sample data and the preset feature vector is used to operate with it to generate the first feature matrix, this process is essentially to realize the calculation of the feature weighted sum through matrix multiplication. Then, the first feature matrix is ​​normalized, which is also completed based on matrix operation. By converting the feature processing and normalization operation into matrix operation, not only the calculation process is simplified, but also the optimization capability of the current processor for matrix operation is fully utilized, thereby significantly improving the data processing efficiency, thereby solving the technical problem of low data processing efficiency in related technologies.

[0055] In the above embodiment of the present application, the sample data is normalized according to the first feature matrix to obtain the target application scenario data, including: generating a quantization matrix based on the preset feature matrix and the first feature matrix, wherein the element values ​​corresponding to the elements in the diagonal area of ​​the preset feature matrix are the first preset values, and the element values ​​corresponding to the elements in other areas of the preset feature matrix except the diagonal area are the second preset values; the sample data is normalized based on the quantization matrix and the preset feature matrix to obtain the target application scenario data.

[0056] The above-mentioned preset characteristic matrix is ​​a matrix with a specific structure, which is used to assist calculation. In Layer Norm, the preset characteristic matrix can be a diagonal matrix, with the elements on the diagonal being 1 and the non-diagonal elements being 0, so that it can be used for the addition of bias and the multiplication of scaling factors. The above-mentioned first preset value can be 1, and the second preset value can be 0, which is not specifically limited here.

[0057] The above quantization matrix is ​​a matrix generated by combining the first characteristic matrix and the preset characteristic matrix information, and is used for more efficient normalization processing. This matrix is ​​designed to more effectively utilize the characteristics of matrix multiplication in the calculation process.

[0058] The target application scenario data mentioned above refers to the normalized data, which is more suitable for the training and inference of deep learning models and can enhance the stability and generalization ability of the model.

[0059] In an optional embodiment, a preset feature matrix is ​​constructed, and the element values ​​of the diagonal area of ​​the matrix are set to a first preset value, usually 1, and the element values ​​of the non-diagonal area are set to a second preset value, usually 0. This construction method ensures that when matrix multiplication is executed, it can accurately correspond to the elements of the feature matrix without generating unnecessary calculations. The quantization matrix is ​​obtained by operating the preset feature matrix and the first feature matrix, and the quantization matrix can efficiently normalize the sample data. In the Layer Norm operator, through the use of matrix multiplication and quantization matrix, data scaling and translation operations can be implemented, and sample data can be normalized based on the quantization matrix and the preset feature matrix to obtain target application scenario data.

[0060] Exemplarily, there may be a set of sample data, each sample contains 256 features (K=256), and there are a total of 10,000 samples (M=10,000). In order to perform Layer Norm operations, the traditional method needs to calculate the mean and variance of each feature of each sample, which involves a large number of addition and division operations. However, in this application, this process can be optimized by constructing a preset feature matrix and a quantization matrix. First, a preset feature matrix KK is constructed in which all diagonal eigenvalues ​​are 1 and all other position eigenvalues ​​are 0. This matrix can assist in subtraction (bias operation) and multiplication (scaling factor application). Based on the first feature matrix and the preset feature matrix KK, a quantization matrix is ​​generated. The design of this quantization matrix is ​​based on the mathematical formula of LayerNorm, and the purpose of normalization is achieved through matrix operations instead of directly using addition and division. The original sample data is normalized using the quantization matrix and the preset feature matrix KK to obtain the target application scenario data. This process actually takes advantage of matrix multiplication to quickly calculate the mean and variance of different features, thereby accelerating the calculation of LayerNorm and improving performance.

[0061] Exemplarily, a preset feature matrix KK can be constructed, and after a quantization matrix is ​​generated based on the first feature matrix, the mean and variance of each feature can be quickly obtained through matrix operations, and then all sample data can be normalized using Layer Norm, which can significantly reduce calculation time and improve calculation efficiency. This performance improvement is particularly evident when processing large-scale data sets.

[0062] In the above embodiment of the present application, a quantization matrix is ​​generated based on a preset characteristic matrix and a first characteristic matrix, including: transposing the first characteristic matrix to obtain a second characteristic matrix; performing matrix multiplication processing on the second characteristic matrix and the first characteristic matrix to obtain a root mean square error value, wherein the root mean square error value is used to describe the degree of discreteness of the sample data; and quantizing the first characteristic matrix based on the preset characteristic matrix and the root mean square error value to generate a quantization matrix.

[0063] The first feature matrix (denoted as KM) mentioned above represents the output of a layer in the neural network. K represents the number of features, and M represents the number of samples. That is, each row represents a different feature value of a sample, and each column represents the performance of a feature on different samples.

[0064] The above-mentioned second characteristic matrix is ​​a new matrix obtained by transposing the first characteristic matrix. In the present application, the first characteristic matrix KM is transposed to obtain the second characteristic matrix MK, that is, the positions of rows and columns are interchanged, which is convenient for subsequent calculations. Matrix multiplication is a mathematical operation, a process in which two matrices A and B are multiplied to obtain a matrix C, where each element in C is the sum of the products of the corresponding elements of each row of A and each column of B. In the present application, the first characteristic matrix and its transposed second characteristic matrix are subjected to matrix multiplication operations, and the root mean square error value of the eigenvalue can be efficiently calculated.

[0065] The above RMS value can be a statistic used to describe the degree of dispersion of data distribution. The calculation method is to first find the average of the squares of the difference between each data point and the mean, and then take its square root. In the calculation of the Layer Norm operator, the RMS value is used to measure the degree of fluctuation of the input features and is an important basis for subsequent normalization operations.

[0066] The above quantization refers to converting continuous values ​​into discrete values, usually to reduce the number of bits of data, reduce storage requirements or speed up calculations. The quantization matrix is ​​a form of Layer Norm operator output. The final Layer Norm operator output is obtained by combining the normalized data with the scaling factor and the shift factor.

[0067] In an optional embodiment, the first feature matrix KM is first transposed to obtain MK, and then MK is subjected to matrix multiplication with the original KM matrix, so that the mean square error value of each feature can be calculated. Then, the first feature matrix is ​​quantized using the obtained root mean square error value and the preset feature matrix to generate a quantization matrix. By integrating multiple independent calculation steps of the traditional Layer Norm operator into matrix multiplication, the calculation speed and efficiency can be significantly improved. When processing large-scale data, since matrix multiplication can utilize the parallel computing power of current processors for batch processing, the time for data loading and single operation can be reduced, thereby greatly shortening the overall calculation time of the Layer Norm operator.

[0068] Exemplarily, assume that there is an intermediate layer output data of a deep learning model, and its shape is KM, K=8, M=10 (i.e., 8 features, 10 samples). According to the calculation method of the traditional Layer Norm operator, a series of independent operations such as summing, averaging, and calculating variance are required for each feature, which is very time-consuming on a large data set. Using the method of the present application, the KM matrix can be transposed to the MK matrix. Then, KM and MK are matrix multiplied to obtain a KxK matrix, in which the diagonal elements are the sum of the squares of the variance values ​​of each feature, and the non-diagonal elements are 0. Next, the elements on the diagonal are squared to obtain a root mean square error matrix. After that, the first feature matrix KM is quantized using the preset feature matrix and the root mean square error matrix. In this step, each element of the KM matrix is ​​subtracted from the mean of the corresponding feature, and then divided by the root mean square error of the feature to obtain the normalized eigenvalue. Finally, the normalized eigenvalues ​​are subjected to matrix multiplication with the scaling factors and displacement factors in the preset feature matrix to generate the final quantization matrix.

[0069] Through the above method, the Layer Norm operator calculation process that originally required multiple independent operations was adjusted to several matrix operations, which greatly improved the calculation efficiency and provided performance advantages for the training and deployment of deep learning models.

[0070] In the above embodiment of the present application, matrix multiplication is performed on the second characteristic matrix and the first characteristic matrix to obtain a root mean square error value, including: matrix multiplication is performed on the second characteristic matrix and the first characteristic matrix to obtain a variance; shifting the variance based on a preset number of bits to obtain a root mean square error value; determining a root mean square error value corresponding to the root mean square error value based on a preset corresponding relationship, wherein the preset corresponding relationship is used to represent the corresponding relationship between average values ​​of different variances and different root mean square error values.

[0071] The above variance can be obtained by performing matrix multiplication on the second characteristic matrix and the first characteristic matrix.

[0072] The above RMS value is a way to measure the average deviation of a set of values. It is obtained by first calculating the variance of the deviation (that is, the average of the square of the deviation), and then taking the square root of this variance. In Layer Norm, the RMS value is the value obtained by averaging the variance of each feature in the feature matrix and then taking the square root, which is used to adjust the scale of the normalized data.

[0073] The above-mentioned shift processing refers to shifting a binary data sequence to the left or right by a specific number of bits. In the present application, the shift processing may involve a process of converting a variance value into a mean square error value, that is, reducing the variance value by a shift operation to approach the mean value of the variance. For example, if the variance is a 32-bit floating point number, it needs to be shifted right by a certain number of bits to reduce its value so that it is closer to the mean square error value.

[0074] The preset corresponding relationship may refer to a lookup table or function for quickly looking up or calculating the root mean square error value corresponding to the mean square error value during the calculation process. In the optimization calculation of Layer Norm, the preset corresponding relationship may be a pre-calculated lookup table for quickly finding the square root of the mean square error value.

[0075] The root mean square error value can be quickly obtained in the Layer Norm process. The variance can be directly calculated through matrix multiplication, and then the average value of the variance can be approximated by shift processing, and finally the root mean square error value corresponding to the average variance can be quickly found using the preset corresponding relationship. This calculation method abandons the traditional point-by-point addition and average calculation, and instead adopts the high efficiency of matrix operations. The present application can directly obtain the variance through a single matrix multiplication, and then quickly obtain the root mean square error value through shift processing, and finally determine the root mean square error value using a preset lookup table, which greatly reduces the calculation steps and improves the calculation efficiency.

[0076] For example, for a K×M feature matrix, the traditional method may require K additions and sums, M divisions and averages, and square root operations to obtain the root mean square error value. The improved calculation method only requires one matrix multiplication and one shift operation, which can significantly improve the calculation speed and reduce energy consumption when processing large-scale data.

[0077] For example, suppose there is a feature matrix KM with a shape of 256×10000, where 256 is the feature dimension and 10000 is the number of samples. This matrix can be transposed to a 10000×256 MK matrix. Then, this MK matrix is ​​used to perform matrix multiplication with the original KM matrix, and the result is a 256×256 matrix, in which the average value of the diagonal elements is the average value of the variance. Next, the variance matrix can be shifted to reduce the variance to an appropriate number of bits and approximate the average value of the variance. Finally, the root mean square error corresponding to the average variance value is quickly found using a preset lookup table. Throughout the process, fast calculation is achieved through matrix operations. In this way, the calculation of the Layer Norm operator is not only more efficient, but also easier to accelerate on modern hardware architectures, because matrix operations can make full use of the parallel computing capabilities of the hardware. This has important practical application value for processing large-volume deep learning tasks such as image recognition and natural language processing.

[0078] In the above embodiments of the present application, the sample data is normalized based on the quantization matrix and the preset feature matrix to obtain the target application scenario data, including: performing matrix multiplication on the quantization matrix and the preset feature matrix to obtain the normalized matrix; adjusting the normalized matrix based on the scale parameter and the bias parameter to obtain the target application scenario data, wherein the scale parameter is used to adjust the variance of the normalized matrix, and the bias parameter is used to adjust the mean of the normalized matrix.

[0079] The above-mentioned quantization matrix can be used to convert the weights or activation values ​​represented by floating point numbers into a more memory-saving data type, such as an integer or a lower-order floating point number. For example, in an embodiment of the present application, the quantization matrix can be a matrix used to process the output result of the Layer Norm operator to ensure that the output is not only normalized, but also adapted to the accuracy required for subsequent calculations.

[0080] The above-mentioned normalized matrix is ​​a matrix processed by normalization methods such as Layer Norm. The data in its feature dimension is adjusted to a distribution with 0 mean and 1 standard deviation, thereby reducing the gradient vanishing or exploding problem in network training and improving the generalization ability of the model.

[0081] The scale parameter mentioned above is a parameter used in Layer Norm to adjust the normalized data distribution, which is usually a learnable vector. After each element of the normalized matrix is ​​multiplied by γ, its variance can be changed, so that the network can automatically adjust the normalized data distribution during training to better adapt to the task.

[0082] The above bias parameter is used to adjust the mean of the normalized matrix, which is also a learnable vector. After adding β to each element of the normalized matrix, its mean can be adjusted to further enhance the flexibility and adaptability of the model.

[0083] In an embodiment of the present application, the calculation process of the Layer Norm operator is redesigned to take advantage of matrix operations. First, a normalized matrix is ​​obtained by matrix multiplication of a quantization matrix and a preset feature matrix. This step takes advantage of the efficiency of matrix multiplication. Then, the normalized matrix is ​​adjusted using a scale parameter γ and a bias parameter β to control the variance and mean of the output data to obtain the final target application scenario data.

[0084] At present, the calculation of the Layer Norm operator relies on a large number of independent addition, subtraction and multiplication operations, which is not only computationally inefficient, but may also be limited by the computing speed of the hardware. This application greatly improves the computational efficiency by converting these independent operations into multiplication-accumulation and bias operations in matrix multiplication. By constructing a specific quantization matrix and a preset feature matrix, the efficiency of matrix multiplication is used to calculate the mean and variance, avoiding the element-by-element operation in the traditional method. The introduction of the scale parameter γ and the bias parameter β allows the normalized data to adjust its distribution according to the model parameters, enhancing the adaptability and training stability of the model.

[0085] The core of this application is to utilize the characteristics of matrix operations to reflect the computational efficiency of the Layer Norm operator. By cleverly constructing specific matrices and vectors and adjusting the calculation steps, it achieves a significant improvement in computational efficiency and performance, providing an effective way for accelerated training and real-time inference of deep learning models.

[0086] In the above embodiment of the present application, the normalization matrix is ​​adjusted based on the scale parameter and the bias parameter to obtain the target application scenario data, including: constructing a first functional relationship based on the sum of the first product and the bias parameter, wherein the first product is the product of the scale parameter and the normalization matrix; converting the first functional relationship to obtain a second functional relationship, wherein the second functional relationship is the product of the scale parameter and the preset parameter, and the preset parameter is constructed based on the bias parameter and the normalization matrix; and determining the target application scenario data based on the second functional relationship.

[0087] The first functional relationship mentioned above is the original Layer Norm operator formula expression, which indicates how to process input data through scale parameters, normalization operations and bias parameters.

[0088] The second functional relationship mentioned above is the adjusted Layer Norm operator formula expression. The original formula is decomposed through mathematical transformation, making the calculation process more conducive to the efficient execution of matrix operations.

[0089] The above preset parameters are parameters introduced in the optimized Layer Norm operator formula to simplify calculations and are used to be directly applied in matrix multiplication to avoid repeated calculations.

[0090] The optimization method of the embodiment of the present application mainly reconstructs the calculation process of the Layer Norm operator through two stages. First, a first functional relationship, that is, the original Layer Norm formula, is constructed based on the scale parameter and the normalized matrix. Then, through mathematical transformation, the calculation steps in the first functional relationship are reorganized to construct a second functional relationship. This process includes converting certain calculation steps into multiplication of preset parameters, so that the entire calculation process is more suitable for efficient execution of matrix multiplication. Finally, the target application scenario data, that is, the output result of the optimized Layer Norm operator, is determined through the second functional relationship.

[0091] In this application, by constructing matrices of special values ​​(such as diagonal matrices and vectors), independent operations are integrated into matrix multiplication. This approach takes advantage of the efficiency of matrix multiplication. For example, the calculation of preset parameters can be completed once during the calculation process, avoiding repeated calculations at each iteration, thereby improving the calculation efficiency of the Layer Norm operator. In addition, the adjustment of scale parameters and bias parameters is achieved through multiplication and accumulation operations, which significantly reduces the number of calculation steps and improves performance.

[0092] Exemplarily, the deep learning model receives a matrix of shape 256×10000 as input, that is, K=256 feature points, M=10000 samples, and the calculation using the traditional Layer Norm operator involves a large number of independent addition, subtraction, and division operations. First, a vector of length 256, all 1s, is constructed, multiplied with the input matrix and shifted, and the mean u is quickly calculated. Then, by constructing a specific diagonal matrix (diagonal is 1, the rest is 0) and multiplying it with the input matrix, adding a bias to quickly obtain the value xu of each feature point minus the mean. Next, matrix multiplication is used to calculate σ, and its root is obtained by table lookup. Finally, the root of σ is inversely calculated, and the bias parameter β and scale parameter γ are combined through matrix multiplication to realize the function of the Layer Norm operator and obtain the final optimized data matrix.

[0093] Through the above optimization, the Layer Norm operator can not only maintain the original effects of accelerated convergence and enhanced generalization ability, but also significantly improve the computing speed, providing stronger support for the application of deep learning models in autonomous driving, intelligent voice and other fields.

[0094] In the above embodiment of the present application, a first characteristic matrix is ​​generated using a preset characteristic vector and the initial characteristic matrix, including: performing matrix multiplication processing on the preset characteristic vector and the initial characteristic matrix to obtain a third characteristic matrix; performing mean processing on the third characteristic matrix based on the characteristic dimension of the sample data to obtain the first characteristic matrix.

[0095] The above-mentioned mean processing refers to the process of calculating the average value of a set of data, which can be applied to the rows or columns of the matrix. In the calculation of Layer Norm, the mean processing usually calculates the average value of all eigenvalues ​​of each sample to obtain a mean vector.

[0096] In an optional embodiment, a third feature matrix is ​​generated by performing matrix multiplication using a preset feature vector (all element values ​​are 1) and an initial feature matrix (K×M data matrix), which is essentially calculating the sum of the eigenvalues ​​of each sample. Afterwards, based on the feature dimension (i.e., K) of the sample data, the third feature matrix is ​​averaged, i.e., the feature mean of each sample is calculated, and finally the first feature matrix is ​​obtained, which stores the feature mean information of all samples.

[0097] Exemplarily, a preset eigenvector is first constructed, assuming that this vector is (1, 1, ..., 1) (a total of 256 1s). Then, this preset eigenvector is multiplied by the initial eigenmatrix through matrix multiplication to obtain a 1×10000 third eigenmatrix, each element of which represents the sum of all eigenvalues ​​of the corresponding column (sample) in the initial eigenmatrix. The third eigenmatrix is ​​mean processed, that is, the sum of the eigenvalues ​​of each sample is quantized to obtain a vector of mean u, which is the first eigenmatrix with a shape of (1, 10000) and stores the eigenmean of each sample. In this way, it is no longer necessary to perform addition, division and other operations on each eigenvalue independently, but it can be completed at one time through matrix operations, which significantly improves the computational efficiency of the Layer Norm operator. When processing large-scale data sets, the performance improvement is more obvious.

[0098] In the process of data processing, the present application utilizes the efficient and fast characteristics of matrix multiplication, by converting addition operations into multiplication-accumulation operations in matrix multiplication, converting subtraction operations into bias operations in matrix multiplication, and converting a large number of single multiplication operations into matrix multiplication operations, etc., making full use of the characteristics of matrix multiplication to achieve the purpose of significantly improving operator performance.

[0099] In this application, Figure 3 is a schematic diagram of determining a mean value according to an embodiment of the present application, such as Figure 3 As shown, a Vector vector with a length of K and eigenvalues ​​all being 1 (that is, the preset eigenvector mentioned above) can be constructed. The Vector is multiplied by the KM matrix, and then the mean of each channel is obtained by shifting. The specific calculation process is as follows. The result obtained by multiplying the Vector by the KM matrix is:

[0100] = , ... , = ), thus obtaining the mean feature , U according to , …, Sure.

[0101] Figure 4 is a schematic diagram of a bias operation according to an embodiment of the present application, such as Figure 4 As shown, we can construct a matrix KK (that is, the preset feature matrix mentioned above) with all diagonal eigenvalues ​​being 1 and all other eigenvalues ​​being 0. By multiplying the matrix KK with the original matrix KM and adding the bias (bias is -U), we can get the features of different feature points. The specific calculation process is as follows: the calculation of the first feature point is ( )+(- )= - , so we get the first feature point In a similar way, the values ​​of other feature points are The values ​​are calculated, so that the KM surface is obtained for multiple points value.

[0102] Combining the above process, we can get The KM matrix, Figure 5 is a schematic diagram of matrix multiplication according to an embodiment of the present application, such as Figure 5 As shown, the KM matrix can be used as the right matrix, and then the KM matrix can be transposed to become the MK matrix. The transposed MK matrix can be used as the left matrix. After multiplying the MK matrix and the KM matrix, we can get Value, and then by shifting and looking up the table, get the root mean square error value , the specific calculation process is as follows:

[0103] = = ;

[0104] Figure 6 is a schematic diagram of a quantization process according to an embodiment of the present application, such as Figure 6 As shown, for the root mean square error The KM matrix is ​​constructed by taking the inverse Value, and then construct a KK matrix with all diagonal eigenvalues ​​1 and all other eigenvalues ​​0. This matrix is ​​multiplied by The KM matrix composed of As its quantization parameter, we can get The specific calculation process is as follows. The calculation of the first feature point is:

[0105] (1 + 0 + ... + 0 ) = ( - ) .

[0106] Figure 7 is a schematic diagram of a matrix multiplication according to an embodiment of the present application, such as Figure 7 As shown, It can be constructed as a matrix multiplication. The left matrix is ​​the value itself, and the right matrix is ​​a KK matrix with the value of the diagonal feature points being 1 and the values ​​of the other feature points being 0. is the bias, is a quantization factor, so the Layer Norm operator function can be realized through matrix multiplication to obtain the final result. Adjust to ,Through this change, the operation steps can be integrated into the matrix ,multiplication, achieving the effect of accelerating the operation and improving ,performance.

[0107] In summary, the present application proposes an implementation method that is different from the traditional Layer Norm operator. By integrating the single independent addition operation, the single independent subtraction operation, the single independent multiplication operation and other calculations in the operator into the matrix multiplication, the purpose of improving the calculation efficiency and enhancing the performance is achieved. From the currently available data, it can be seen that for shapes with K of 256 and M of 10000, the Layer Norm operator is implemented using the method provided by this application, and the calculation time is greatly shortened compared to the traditional method, and the performance is improved by about 5 times. The numerical values ​​here are only for example and are not specifically limited.

[0108] Example 2

[0109] According to an embodiment of the present application, a data processing device for implementing the above data processing method is also provided. Figure 8 is a schematic diagram of a data processing device according to an embodiment of the present application, such as Figure 8 As shown, the device 800 includes: a construction module 802 , a generation module 804 , a normalization module 806 , and an execution module 808 .

[0110] Among them, the construction module is used to construct an initial feature matrix based on sample attributes of sample data; the generation module is used to generate a first feature matrix using a preset feature vector and the initial feature matrix; the normalization module is used to normalize the sample data according to the first feature matrix to obtain target application scenario data, wherein the target application scenario data includes one of the following: natural language processing data, computer vision data, speech recognition data; the execution module is used to execute the application scenario control operation corresponding to the target application scenario data.

[0111] In an embodiment of the present application, a normalization module is used to generate a quantization matrix based on a preset feature matrix and a first feature matrix, wherein the element values ​​corresponding to the elements in the diagonal area of ​​the preset feature matrix are the first preset values, and the element values ​​corresponding to the elements in other areas of the preset feature matrix except the diagonal area are the second preset values; the sample data is normalized based on the quantization matrix and the preset feature matrix to obtain the target application scenario data.

[0112] In an embodiment of the present application, a normalization module is used to transpose a first characteristic matrix to obtain a second characteristic matrix; perform matrix multiplication on the second characteristic matrix and the first characteristic matrix to obtain a root mean square error value, wherein the root mean square error value is used to describe the degree of discreteness of sample data; and quantize the first characteristic matrix based on a preset characteristic matrix and the root mean square error value to generate a quantization matrix.

[0113] In an embodiment of the present application, a normalization module is used to perform matrix multiplication processing on the second characteristic matrix and the first characteristic matrix to obtain a variance; shift the variance based on a preset number of bits to obtain a mean square error value; and determine the root mean square error value corresponding to the mean square error value based on a preset corresponding relationship, wherein the preset corresponding relationship is used to represent the corresponding relationship between the average values ​​of different variances and different root mean square error values.

[0114] In an embodiment of the present application, a normalization module is used to perform matrix multiplication on a quantization matrix and a preset feature matrix to obtain a normalized matrix; the normalized matrix is ​​adjusted based on a scale parameter and a bias parameter to obtain target application scenario data, wherein the scale parameter is used to adjust the variance of the normalized matrix, and the bias parameter is used to adjust the mean of the normalized matrix.

[0115] In an embodiment of the present application, a normalization module is used to construct a first functional relationship based on the sum of a first product and a bias parameter, wherein the first product is the product of a scale parameter and a normalization matrix; the first functional relationship is transformed to obtain a second functional relationship, wherein the second functional relationship is the product of a scale parameter and a preset parameter, and the preset parameter is constructed based on the bias parameter and the normalization matrix; and the target application scenario data is determined based on the second functional relationship.

[0116] In an embodiment of the present application, the generation module is used to perform matrix multiplication on the preset feature vector and the initial feature matrix to obtain a third feature matrix; and perform mean processing on the third feature matrix based on the feature dimension of the sample data to obtain a first feature matrix.

[0117] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0118] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0119] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0120] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0121] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0122] 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 technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc., which can store program code.

[0123] The above is only a preferred implementation 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 of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A data processing method, characterized in that: include: Construct an initial feature matrix based on sample attributes of sample data; Generate a first feature matrix using the preset feature vector and the initial feature matrix; Normalizing the sample data according to the first feature matrix to obtain target application scenario data, wherein the target application scenario data includes one of the following: natural language processing data, computer vision data, and speech recognition data; Execute the application scenario control operation corresponding to the target application scenario data.

2. The data processing method according to claim 1, characterized in that: The sample data is normalized according to the first feature matrix to obtain target application scenario data, including: Generate a quantization matrix based on a preset characteristic matrix and the first characteristic matrix, wherein the element values ​​corresponding to the elements in the diagonal area of ​​the preset characteristic matrix are first preset values, and the element values ​​corresponding to the elements in other areas of the preset characteristic matrix except the diagonal area are second preset values; The sample data is normalized based on the quantization matrix and the preset feature matrix to obtain the target application scenario data.

3. The data processing method according to claim 2, characterized in that: Generating a quantization matrix based on a preset characteristic matrix and the first characteristic matrix includes: Transposing the first characteristic matrix to obtain a second characteristic matrix; Performing matrix multiplication processing on the second characteristic matrix and the first characteristic matrix to obtain a root mean square error value, wherein the root mean square error value is used to describe the discrete degree of the sample data; The first characteristic matrix is ​​quantized based on the preset characteristic matrix and the root mean square error value to generate the quantization matrix.

4. The data processing method according to claim 3, characterized in that: Performing matrix multiplication processing on the second characteristic matrix and the first characteristic matrix to obtain a root mean square error value includes: Performing matrix multiplication processing on the second characteristic matrix and the first characteristic matrix to obtain a variance; Performing a shift process on the variance based on a preset number of bits to obtain a mean square error value; The root mean square error value corresponding to the mean square error value is determined based on a preset corresponding relationship, wherein the preset corresponding relationship is used to represent the corresponding relationship between average values ​​of different variances and different root mean square error values.

5. The data processing method according to claim 2, characterized in that: Normalizing the sample data based on the quantization matrix and the preset feature matrix to obtain target application scenario data includes: Performing matrix multiplication processing on the quantization matrix and the preset feature matrix to obtain a normalized matrix; The normalized matrix is ​​adjusted based on a scale parameter and a bias parameter to obtain the target application scenario data, wherein the scale parameter is used to adjust the variance of the normalized matrix, and the bias parameter is used to adjust the mean of the normalized matrix.

6. The data processing method according to claim 5, characterized in that: The normalization matrix is ​​adjusted based on the scale parameter and the bias parameter to obtain the target application scenario data, including: Constructing a first functional relationship based on a first product and a sum of the bias parameters, wherein the first product is a product of the scale parameter and the normalization matrix; Converting the first functional relationship to obtain a second functional relationship, wherein the second functional relationship is a product of the scale parameter and a preset parameter, and the preset parameter is constructed based on the bias parameter and the normalization matrix; The target application scenario data is determined based on the second functional relationship.

7. The data processing method according to claim 1, characterized in that: Performing matrix multiplication processing on the preset feature vector and the initial feature matrix to obtain a first feature matrix, including: Performing matrix multiplication processing on the preset feature vector and the initial feature matrix to obtain a third feature matrix; The third feature matrix is ​​averaged based on the feature dimension of the sample data to obtain the first feature matrix.

8. An electronic device, characterized in that: include: A memory storing an executable program; A processor, configured to run the program, wherein the program executes the method according to any one of claims 1 to 7 when running.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored executable program, wherein when the executable program is executed, the device where the storage medium is located is controlled to execute the method according to any one of claims 1 to 7.

10. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 7.