Cache data prediction method and device, storage medium and electronic equipment
By using deep neural network models to process linear and nonlinear autoregressive matrices in solid-state hard disk technology, the characteristics of user access data are extracted, and the problem of low prediction accuracy in cached data in the prior art is solved, and higher prediction accuracy is achieved.
Patent Information
- Application Number
- CN202411845584.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-12-13
AI Technical Summary
In the existing solid-state drive technology, the accuracy of cached data prediction is low, and it is impossible to effectively extract the nonlinear characteristics of user access data.
By obtaining candidate data vectors, performing vector autoregression operations to obtain linear autoregression matrix and nonlinear autoregression matrix, and input them into the deep neural network model. These matrices are processed using multiple sequentially stacked feature extraction layers to extract linear and nonlinear features of the data.
It improves the accuracy of cached data prediction, can predict user access data from both linear and nonlinear characteristics, and improves the accuracy of prediction results.
Smart Images

Figure CN119669628A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the computer field, and in particular, to a cache data prediction method and device, a storage medium, and an electronic device. Background Art
[0002] As the amount of data increases, the capacity and performance of data storage systems are also growing rapidly. In particular, enterprises currently need large-scale data centers to support business digitization and enterprise data storage. The huge demand for data storage has put forward higher requirements for the performance and reliability of storage devices. SSDs have been widely used in the field of data storage because of their huge advantages in performance, reliability and power consumption.
[0003] In existing SSD technology, it is necessary to predict the data that may be needed in the future by focusing on the linear characteristics of user access data and load it into the cache in advance. In actual cache prediction scenarios, user access patterns may be sparse and in a long-term, dynamically changing process. Therefore, the data accessed by users will contain nonlinear features. Only focusing on the linear characteristics of user access data cannot fully extract the features of user access data, resulting in limited accuracy of predicted data. In other words, there is a problem of low accuracy in the process of predicting cache data in related technologies.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present application provide a method and device for predicting cache data, a storage medium, and an electronic device to at least solve the problem of low accuracy in the process of predicting cache data in the related art.
[0006] According to an embodiment of the present application, a cache data prediction method is provided, comprising: obtaining a candidate data vector, wherein the vector elements included in the candidate data vector are used to indicate the data object of the historical data access operation; performing a vector autoregression operation according to the candidate data vector to obtain a linear autoregression matrix and a nonlinear autoregression matrix; inputting the linear autoregression matrix and the nonlinear autoregression matrix into a target data prediction model, wherein the target data prediction model is a deep neural network model, the target data prediction model comprises a plurality of feature extraction layers stacked in sequence, the first feature extraction layer among the plurality of feature extraction layers is used to process the nonlinear autoregression matrix to obtain a first feature matrix, the second feature extraction layer among the plurality of feature extraction layers is used to process the second feature matrix to obtain a first feature matrix to be input into the next feature extraction layer, the first feature extraction layer is the first feature extraction layer among the plurality of feature extraction layers, the second feature extraction layer is the other feature extraction layers among the plurality of feature extraction layers except the first feature extraction layer, and the second feature matrix is obtained by connecting the first feature matrix outputted at the previous feature extraction layer with the linear autoregression matrix; according to the output result of the target data prediction model, determining the target vector element from the candidate data vector, and determining the data object indicated by the target vector element as the target data object.
[0007] According to another aspect of an embodiment of the present application, a cache data prediction device is also provided, including: a vector acquisition unit, used to acquire a candidate data vector, wherein the vector elements included in the candidate data vector are used to indicate the data object of the historical data access operation; a vector autoregression unit, used to perform a vector autoregression operation according to the candidate data vector to obtain a linear autoregression matrix and a nonlinear autoregression matrix; a feature processing unit, used to input the linear autoregression matrix and the nonlinear autoregression matrix into a target data prediction model, wherein the target data prediction model is a deep neural network model, and the target data prediction model includes a plurality of feature extraction layers stacked in sequence, and the first feature extraction layer of the plurality of feature extraction layers is used to extract the nonlinear autoregression matrix. The linear autoregression matrix is processed to obtain a first feature matrix, the second feature extraction layer among the multiple feature extraction layers is used to process the second feature matrix to obtain a first feature matrix to be input into the next feature extraction layer, the first feature extraction layer is the first feature extraction layer among the multiple feature extraction layers, the second feature extraction layer is the other feature extraction layers among the multiple feature extraction layers except the first feature extraction layer, and the second feature matrix is obtained by connecting the first feature matrix output at the previous feature extraction layer with the linear autoregression matrix; a determination unit is used to determine a target vector element from the candidate data vector according to the output result of the target data prediction model, and determine the data object indicated by the target vector element as the target data object.
[0008] Optionally, the target data prediction model is a bidirectional long short-term memory network, the feature extraction layer includes a first direction feature extraction layer and a second direction feature extraction layer, and the cache data prediction device also includes a matrix acquisition unit, which is used to, when the current feature extraction layer is the second feature extraction layer, process the matrix elements in the second feature matrix according to the first direction feature extraction layer to obtain a first reference matrix; process the matrix elements in the second feature matrix according to the second direction feature extraction layer to obtain a second reference matrix; and splice the first reference matrix and the second reference matrix to obtain a first feature matrix.
[0009] Optionally, the vector autoregression unit includes: a first matrix acquisition module, used to perform vector autoregression calculation on the candidate data vector to obtain a first reference matrix; a second matrix acquisition module, used to transpose the first reference matrix to obtain a second reference matrix; a third matrix acquisition module, used to acquire a linear autoregression matrix and a nonlinear autoregression matrix from the second reference matrix, wherein the nonlinear autoregression matrix indicates a nonlinear relationship between multiple data objects, and the linear autoregression matrix indicates a linear relationship between multiple data objects.
[0010] Optionally, the matrix acquisition unit is also used to: acquire a data object set based on multiple historical data access operations, wherein the data object set includes data objects corresponding to the historical data access operations; determine a candidate data subset from the data object set based on the number of accesses corresponding to each of the data objects in the data object set, wherein the number of accesses corresponding to the data objects included in the candidate data subset is greater than or equal to a target number; determine a candidate data vector based on multiple data objects in the candidate data subset and the operation order of the historical data access operations of each of the multiple data objects.
[0011] Optionally, the cache data prediction device also includes: a sample acquisition unit, used to acquire a training sample set, wherein the training sample set includes multiple training samples, the training samples include a sample data vector and a prediction label, the sample data vector and the prediction label are determined according to the data object sequence corresponding to the sample data access operation, the sample vector elements included in the sample data vector are used to indicate the first n-1 sample data objects in the data object sequence, and the prediction label is used to indicate the nth sample data object in the data object sequence, where n is an integer greater than 1; a model training unit, used to: train a data prediction model in a training stage according to the training sample set, wherein the data prediction model in the training stage includes multiple reference feature extraction layers stacked in sequence, and the first reference feature extraction layer in the multiple reference feature extraction layers is used to train a nonlinear autoregressive sample matrix. The first sample feature matrix is processed by the method of FIG. 1 , wherein the first sample feature matrix is processed by the second reference feature extraction layer in the plurality of reference feature extraction layers, and the second sample feature matrix is processed by the second reference feature extraction layer in the plurality of reference feature extraction layers, and the first sample feature matrix is input to the next reference feature extraction layer, wherein the first feature extraction layer is the first reference feature extraction layer in the plurality of reference feature extraction layers, and the second reference feature extraction layer is the other reference feature extraction layers in the plurality of reference feature extraction layers except the first reference feature extraction layer, and the second sample feature matrix is obtained by connecting the first reference feature matrix output by the previous reference feature extraction layer with the linear autoregression sample matrix, and the linear autoregression sample matrix and the nonlinear autoregression sample matrix are obtained by performing a vector autoregression operation according to the sample data vector; and the determination unit is used to: when the data prediction model meets the training conditions, determine the data prediction model as the target data prediction model.
[0012] Optionally, the model training unit is also used to: obtain prediction results of multiple sample data vectors output by the data prediction model in the training stage; determine the current training loss of the data prediction model in the training stage based on the multiple prediction results and the prediction labels corresponding to the multiple sample data vectors; when the current training loss is greater than or equal to the target loss threshold, update at least one model parameter in the data prediction model.
[0013] Optionally, the cache data prediction device also includes: a loop prediction unit, which is used to loop the following steps until the target data object is different from the data object to be read, wherein the data object to be read is the data object currently read in the data object sequence requested by the target terminal: adding the target data object to the end position of the candidate data vector; performing a vector autoregression operation on the updated candidate data vector to obtain a linear autoregression matrix and a nonlinear autoregression matrix; inputting the linear autoregression matrix and the nonlinear autoregression matrix into a target data prediction model; and determining the output result of the target data prediction model as the next target data object.
[0014] Optionally, the cache data prediction device also includes: a sending unit, which obtains a target parameter value of a target data object; loads the target parameter value of the target data object into a cache; and in response to a data read operation sent by a target terminal, when the data object to be read is the same as the target data object, sends the target parameter value in the cache to the target terminal.
[0015] According to another aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above cache data prediction method.
[0016] According to another aspect of an embodiment of the present application, there is further provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the cache data prediction method through the computer program.
[0017] Through the present application, a candidate data vector including a user's historical access data object is first obtained, and a vector autoregression operation is performed on the above candidate data vector to obtain a linear autoregression matrix and a nonlinear autoregression matrix; and the above linear autoregression matrix and the above nonlinear autoregression matrix are input into a target data prediction model, the above target data prediction model includes a plurality of feature extraction layers stacked in sequence, the first feature extraction layer processes the above nonlinear autoregression matrix to obtain a first feature matrix, the above first feature matrix is connected with the linear autoregression matrix to obtain the input of the next feature extraction layer (the second feature matrix), and in the above target data prediction model, the input of other extraction layers except the first feature extraction layer is the connection of the output (first feature matrix) of the previous feature extraction layer and the above linear autoregression matrix, therefore, the above target data prediction model can pay attention to the nonlinear features and linear features in the user data at the same time, and then predict the user pre-fetched data from the two aspects of linear features and nonlinear features, so that the accuracy of the prediction result is improved, and the problem of low accuracy in predicting cached data existing in the related art is solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] 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:
[0019] Figure 1 It is a hardware structure block diagram of a server device of a method for adjusting a read voltage in a memory according to an embodiment of the present application;
[0020] Figure 2 is a flow chart of a method for predicting cache data according to an embodiment of the present application;
[0021] Figure 3 is a flowchart of another cache data prediction method according to an embodiment of the present application;
[0022] Figure 4 is a flow chart of another method for predicting cache data according to an embodiment of the present application;
[0023] Figure 5 is a structural diagram of a cache data prediction device according to an embodiment of the present application;
[0024] Figure 6 is a schematic diagram of a structure of a predictive electronic device for caching data according to an embodiment of the present application;
[0025] Figure 7 It is a schematic diagram of a cache data prediction method according to an embodiment of the present application. DETAILED DESCRIPTION
[0026] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0028] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 1 is a hardware structure block diagram of a server device of a cache data prediction method according to an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the server device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0029] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to a method for adjusting a read voltage in a memory in an embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to a server device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0030] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0031] As an optional implementation, Figure 2 As shown, the prediction method of cache data includes:
[0032] S202, obtaining a candidate data vector, wherein the vector elements included in the candidate data vector are used to indicate data objects of historical data access operations;
[0033] S204, performing a vector autoregression operation according to the candidate data vector to obtain a linear autoregression matrix and a nonlinear autoregression matrix;
[0034] S206, inputting the linear autoregression matrix and the nonlinear autoregression matrix into a target data prediction model, wherein the target data prediction model is a deep neural network model, the target data prediction model includes a plurality of feature extraction layers stacked in sequence, the first feature extraction layer among the plurality of feature extraction layers is used to process the nonlinear autoregression matrix to obtain a first feature matrix, the second feature extraction layer among the plurality of feature extraction layers is used to process the second feature matrix to obtain a first feature matrix to be input into a next feature extraction layer, the first feature extraction layer is the first feature extraction layer among the plurality of feature extraction layers, the second feature extraction layer is the other feature extraction layers among the plurality of feature extraction layers except the first feature extraction layer, and the second feature matrix is obtained by connecting the first feature matrix outputted from the previous feature extraction layer with the linear autoregression matrix;
[0035] S208: Determine the output result of the target data prediction model as the target data object.
[0036] Optionally, in the above step S202, obtaining the candidate data vector includes the following steps:
[0037] S202-1, acquiring a data object set according to a plurality of historical data access operations, wherein the data object set includes data objects corresponding to the historical data access operations;
[0038] S202-2, determining a candidate data subset from the data object set according to the access counts corresponding to the data objects in the data object set, wherein the access counts corresponding to the data objects included in the candidate data subset are greater than or equal to the target count;
[0039] S202 - 3 , determining a candidate data vector according to a plurality of data objects in the candidate data subset and the operation order of the historical data access operations of the plurality of data objects.
[0040] In the above step S202-1, a data object set of the user's historical access data is obtained. It should be noted that the above data object set is a vector containing the user's historical access data, which can be in the following form:
[0041] X = [x1, x2, x3, ..., x t ]
[0042] The above X is a set of data objects, x i is a data object, indicating the i-th data item accessed by the user, t is the length of the vector, and then step S202-2 is executed, according to x1 to x tThe candidate data subset is determined by the number of accesses to the data corresponding to the data object. For example, the target number is set to 3. In the above historical access operations, the number of accesses to data objects Y1 and Y2 is less than 3. Then Y1 and Y2 are deleted from the data object set X, and the data object set after deleting Y1 and Y2 is used as the candidate data subset.
[0043] Further, step S202-3 is performed to arrange the data objects in the candidate data subset according to the operation order of their respective historical data access operations to determine the candidate data vector. The candidate data vector may be in the following form:
[0044] S = [V1, V2, ..., V t ]
[0045] The above S is the candidate data vector, v i is the above vector element, t is the length of the candidate data vector. It can be understood that the length of the candidate data vector S is less than or equal to the length of the data object set X.
[0046] In the above step S204, the vector autoregression operation is performed according to the candidate data vector to obtain a linear autoregression matrix and a nonlinear autoregression matrix, including:
[0047] S1, input candidate data into the vector autoregression model;
[0048] S2, determine the linear autoregressive matrix and the nonlinear autoregressive matrix according to the target hyperparameters.
[0049] It should be noted that the above-mentioned vector autoregression model can be a next generation reservoir computing model (Next Generation Reservoir Computing, NGRC). In the case where the above-mentioned vector autoregression model is a next generation reservoir computing model, the output of the above-mentioned vector autoregression model is a linear matrix and a nonlinear matrix, wherein the linear matrix is the linear autoregression matrix, and the nonlinear matrix is the nonlinear autoregression matrix, wherein the linear matrix and the nonlinear matrix have the following relationship:
[0050]
[0051] The above X nonlin is a matrix in nonlinear form, consisting of multiple linear matrices X lin The linear matrix X involved in the operation is obtained by multiplying the corresponding values. lin The number of is determined by the above target hyperparameters. Different target hyperparameters are determined by the following mathematical model to determine the specific linear matrix X lin and the nonlinear matrix X nonlin:
[0052] X=[X lin X nonlin ] T
[0053] The above T represents the transpose, X represents the equivalent output of the vector autoregression model, and the linear matrix X determined by different target hyperparameters lin and the nonlinear matrix X nonlin The X obtained after the above mathematical model operation is the same. For example, when the value of the target hyperparameter is 2, the linear autoregression matrix X output by the above vector autoregression model is lin for:
[0054]
[0055] The nonlinear autoregression matrix X output by the above vector autoregression model is nonlin for:
[0056]
[0057] The above T represents transposition, and k represents the time extension length, which is another hyperparameter of the NGRC model and is determined in the initialization stage.
[0058] Then we get the linear autoregressive matrix X lin and the nonlinear autoregressive matrix X nonlin Then, step S206 is executed to input the linear autoregressive matrix and the nonlinear autoregressive matrix into the target data prediction model.
[0059] It should be noted that the above target data prediction model can be a long short-term memory network, a bidirectional long short-term memory network, a deep belief network, etc., and no specific limitation is made here. The above target data prediction model includes multiple feature extraction layers stacked in sequence, and the output of each feature extraction layer is a first feature matrix. The connection result of the first feature matrix and the above linear feature matrix is a second feature matrix. The second feature matrix is the input of other extraction layers (second feature extraction layers) in the target prediction model except the first feature extraction layer, and the first feature extraction layer (first feature extraction layer) in the target prediction model.
[0060] In the case where the target data prediction model is a long short-term memory network, the multiple sequentially stacked feature extraction layers included in the target data prediction model are long short-term memory layers. The following example is taken as an example with 3 long short-term memory layers:
[0061] The linear autoregressive matrix and the nonlinear autoregressive matrix are input into the long short-term memory network, wherein the nonlinear autoregressive matrix is input into the first long short-term memory layer, the first feature matrix output by the first long short-term memory layer is added to the linear autoregressive matrix according to the corresponding positions to obtain the second feature matrix, the second feature matrix is input into the second long short-term memory layer, the first feature matrix output by the second long short-term memory layer is added to the linear autoregressive matrix according to the corresponding positions to obtain the second feature matrix for inputting the third long short-term memory layer, and the second feature matrix is input into the third long short-term memory layer to obtain the first feature matrix output by the third long short-term memory layer. Optionally, the first feature matrix output by the third long short-term memory layer is input into the fully connected layer, each neuron of the fully connected layer represents a data object, the value of each neuron represents the confidence of the data object, and the data object corresponding to the neuron with the highest confidence is determined as the output value of the above target data model.
[0062] In the case where the target data prediction model is a deep belief network, the multiple sequentially stacked feature extraction layers included in the target data prediction model are restricted Boltzmann machines. The following example is given with the number of restricted Boltzmann machines being 3:
[0063] The linear autoregressive matrix and the nonlinear autoregressive matrix are input into the deep belief network, wherein the nonlinear autoregressive matrix is input into the first restricted Boltzmann machine, the first feature matrix output by the first restricted Boltzmann machine is added to the linear autoregressive matrix according to the corresponding positions to obtain the second feature matrix, the second feature matrix is input into the second restricted Boltzmann machine, the first feature matrix output by the second restricted Boltzmann machine is added to the linear autoregressive matrix according to the corresponding positions to obtain the second feature matrix for inputting the third restricted Boltzmann machine, and the second feature matrix is input into the third restricted Boltzmann machine to obtain the first feature matrix output by the third restricted Boltzmann machine. Optionally, the first feature matrix output by the third restricted Boltzmann machine is input into the fully connected layer, each neuron in the fully connected layer represents a data object, the value of each neuron represents the confidence of the data object, and the data object corresponding to the neuron with the highest confidence is determined as the output value of the above target data model.
[0064] In the case where the target data prediction model is a bidirectional long short-term memory network, the multiple sequentially stacked feature extraction layers included in the target data prediction model are bidirectional long short-term memory layers. The following example is taken as an example with 4 bidirectional long short-term memory layers:
[0065] The linear autoregressive matrix and the nonlinear autoregressive matrix are input into the bidirectional long short-term memory network, wherein the nonlinear autoregressive matrix is input into the first bidirectional long short-term memory layer, the first feature matrix output by the first bidirectional long short-term memory layer is added to the linear autoregressive matrix according to the corresponding position, and the second feature matrix for inputting the second bidirectional long short-term memory layer is obtained, and the first feature matrix output by the previous bidirectional long short-term memory layer is added to the linear autoregressive matrix according to the corresponding position, and the result is input into the next bidirectional long short-term memory layer to obtain the first feature matrix output by the next bidirectional long short-term memory layer, until the last bidirectional long short-term memory layer in the target data prediction model outputs the first feature matrix corresponding to the layer. Optionally, the first feature matrix output by the last bidirectional long short-term memory layer is input into the fully connected layer, each neuron in the fully connected layer represents a data object, and the value of each neuron represents the confidence of the data object, and the data object corresponding to the neuron with the highest confidence is determined as the output value of the above target data model.
[0066] Then, step S208 is executed to determine the output result of the target data prediction model as the target data object.
[0067] The above implementation of the present application can be applied to a web page access scenario. In the web page access scenario, a user performs an operation in an operation interface of a user terminal, for example, the user clicks button A in an operation page to open web page A.
[0068] Specifically, after the A button in the operation page is clicked, the user terminal initiates a request to the server to access the A web page. In response to the A web page access request initiated by the user terminal, the server obtains the data required to open the A web page (including the image data and text data of the A web page), and uses it as the above-mentioned data object, and uses multiple data objects indicating historical data access operations as the above-mentioned candidate data vectors.
[0069] For example, assuming that there are data objects Y1, Y2, Y3 and Y4, which correspond to the data of four web pages A, B, C and D respectively (including image data and text data). Further assuming that the user's historical data access operation is to request access to three web pages A, B and C, then the data objects Y1, Y2 and Y3 corresponding to the three web pages A, B and C are taken as candidate data vectors.
[0070] Furthermore, a vector autoregression operation is performed on the candidate data vector to obtain a linear autoregression matrix and a nonlinear autoregression matrix; the linear autoregression matrix and the nonlinear autoregression matrix are input into the target data prediction model, and the target data object is predicted to be D, that is, it is predicted that the user's next operation will be to visit the D web page.
[0071] Through the above implementation, firstly, the candidate data object is obtained, and a vector autoregression operation is performed on the candidate data vector to obtain a linear autoregression matrix and a nonlinear autoregression matrix, and the above linear autoregression matrix and a nonlinear autoregression matrix are input into the target data prediction model, wherein the nonlinear autoregression matrix is input into the first feature extraction layer, and the first feature extraction layer performs feature extraction on the nonlinear autoregression matrix, and then pays attention to the nonlinear features in the candidate data vector, and at the same time, the output of the first feature extraction layer is connected to the linear autoregression matrix to realize the fusion of linear features and nonlinear features, and the result is input into the next feature extraction layer, and this step is repeated until the last feature extraction layer completes the output, and then the entire target data prediction model can not only extract the deep linear features and deep nonlinear features of the candidate feature vector,
[0072] As an optional implementation, when the feature processing model is a bidirectional long short-term memory network, the feature extraction layer includes a first direction feature extraction layer and a second direction feature extraction layer, and after the linear autoregression matrix and the nonlinear autoregression matrix are input into the target data prediction model, it also includes:
[0073] S1, when the current feature extraction layer is the second feature extraction layer, processing the matrix elements in the second feature matrix according to the first direction according to the first direction feature extraction layer to obtain a first reference matrix;
[0074] S2, processing the matrix elements in the second feature matrix according to the second direction according to the second directional feature extraction layer to obtain a second reference matrix;
[0075] It should be noted that the first direction feature extraction layer and the second direction feature extraction layer can be long short-term memory layers in different directions. For example, the first direction feature extraction layer is a forward long short-term memory layer, and the second direction feature extraction layer is a backward long short-term memory layer. The above matrix elements are column vectors.
[0076] Furthermore, in this embodiment, when the current feature extraction layer is the second feature extraction layer, the forward long short-term memory module processes the second feature matrix input to the current feature extraction layer in the forward direction. Figure 7 For specific instructions, Figure 7 It is the process of processing the feature vector by a bidirectional long short-term memory layer. Figure 7 The bidirectional long short-term memory layer includes a forward long short-term memory layer LSTM702 and a backward long short-term memory layer LSTM712. In addition, it is assumed that the current second feature matrix is:
[0077] X=[V1 V2]
[0078] V1 and V2 are Figure 7 The column vectors 721 and 722 in the matrix are sequentially input into the forward long short-term memory layer LSTM702 to obtain the first reference matrix [L1, L2] consisting of two column vectors. L1 and L2 are Figure 7 The column vectors 731 and 732 in the matrix are sequentially input into the backward long short-term memory layer LSTM712 to obtain a second reference matrix [R1, R2] consisting of two column vectors. R1 and R2 are Figure 7 The column vector 741 and the column vector 742 in the above are then concatenated with the first reference matrix and the second reference matrix to obtain the first feature matrix [L1, R1, L2, R2] output by the current feature extraction layer.
[0079] Through the above implementation mode of the present application, the matrix elements in the above-mentioned second feature matrix are processed according to the first direction through the first direction feature extraction layer to obtain the first reference matrix; the above-mentioned matrix elements in the above-mentioned second feature matrix are processed according to the second direction through the above-mentioned second direction feature extraction layer to obtain the second reference matrix, and the above-mentioned first reference matrix and the above-mentioned second reference matrix are further spliced to obtain the above-mentioned first feature matrix, thereby realizing the modeling of the input data in two directions, making up for the limitation that the input signal can only be trained from one direction in the unidirectional network, and avoiding the defect of only focusing on linear features when the unidirectional network extracts features in one direction. Through the bidirectional feature extraction, the nonlinear features of the input are paid attention to, and then the nonlinear features of the bidirectional network are extracted and the results are connected with the linear features, so that the prediction model can pay attention to both linear features and nonlinear features at the same time, thereby improving the accuracy of the prediction model.
[0080] As an optional implementation, before obtaining the candidate data vector, the step further includes:
[0081] S1, obtaining a training sample set, wherein the training sample set includes a plurality of training samples, the training samples include a sample data vector and a prediction label, the sample data vector and the prediction label are determined according to a data object sequence corresponding to a sample data access operation, the sample vector element included in the sample data vector is used to indicate the first n-1 sample data objects in the data object sequence, and the prediction label is used to indicate the nth sample data object in the data object sequence, where n is an integer greater than 1;
[0082] S2, training a data prediction model in a training stage according to a training sample set, wherein the data prediction model in the training stage includes a plurality of reference feature extraction layers stacked in sequence, a first reference feature extraction layer among the plurality of reference feature extraction layers is used to process a nonlinear autoregressive sample matrix to obtain a first sample feature matrix, a second reference feature extraction layer among the plurality of reference feature extraction layers is used to process a second sample feature matrix to obtain a first sample feature matrix to be input into a next reference feature extraction layer, the first feature extraction layer is the first reference feature extraction layer among the plurality of reference feature extraction layers, the second reference feature extraction layer is the other reference feature extraction layers among the plurality of reference feature extraction layers except the first reference feature extraction layer, the second sample feature matrix is obtained by connecting the first reference feature matrix output from the previous reference feature extraction layer with a linear autoregressive sample matrix, and the linear autoregressive sample matrix and the nonlinear autoregressive sample matrix are obtained by performing a vector autoregressive operation according to a sample data vector;
[0083] S3: When the data prediction model meets the training conditions, the data prediction model is determined as the target data prediction model.
[0084] It should be noted that the above training sample set is used to train the data model in the training stage, and the above training sample set can be in the following form:
[0085] P = [P1, P2, ..., P n ]
[0086] P is the above training sample set, P i is a data object, indicating the i-th data item accessed by the user, and n is the length of the above training sample set.
[0087] Optionally, after determining the training sample set, the sample data vectors and prediction labels in the training sample set may be further determined. For example, when the prediction target is the next data accessed by the user, the first n-1 sample data objects (P1 to P n-1 ) as the sample data vector, and the first sample data object (P n ) as the predicted label.
[0088] Then execute the above-mentioned step S2, and train the data prediction model in the training stage according to the above-mentioned training sample set. It should be noted that the above-mentioned data prediction model in the training stage includes multiple reference feature extraction layers stacked in sequence, the first reference feature extraction layer among the multiple reference feature extraction layers stacked in sequence is the first reference feature extraction layer, and the reference feature extraction layers other than the first reference feature extraction layer are the second reference feature extraction layers. The outputs of the first reference feature extraction layer and the second reference feature extraction layer are the first sample feature matrix, the input of the first reference feature extraction layer is the nonlinear autoregressive sample matrix, and the input of the second reference feature matrix is the second sample feature matrix obtained by connecting the output of the previous feature extraction layer with the linear autoregressive sample matrix.
[0089] Optionally, the nonlinear autoregressive sample matrix and the linear autoregressive sample matrix are obtained by performing a vector autoregressive operation on the sample data vector. It should be noted that performing a vector autoregressive operation on the sample data vector includes the following steps:
[0090] S1, input sample data into the vector autoregression model;
[0091] S2, determine the linear autoregressive sample matrix and the nonlinear autoregressive sample matrix according to the target hyperparameters.
[0092] It should be noted that the above-mentioned vector autoregression model can be a NGRC model. When the above-mentioned vector autoregression model is a NGRC model, the output linear autoregression sample matrix and the nonlinear autoregression sample matrix are determined according to the target hyperparameters in the NGRC model.
[0093] It should be noted that the linear autoregressive sample matrix output by the NGRC model has the following relationship with the nonlinear autoregressive sample matrix:
[0094]
[0095] The above X nonlin is a nonlinear sample autoregressive matrix, which consists of multiple linear autoregressive sample matrices X lin The linear autoregressive sample matrix X involved in the operation is obtained by multiplying the corresponding values. lin The number of is determined by the above target hyperparameter. When the target hyperparameter value is 2
[0096] After determining the nonlinear autoregressive sample matrix and the linear autoregressive sample matrix, the nonlinear autoregressive sample matrix and the linear autoregressive sample matrix are input into the data prediction model, wherein the nonlinear autoregressive matrix is first input into the first feature extraction layer, the first sample feature matrix output by the first feature extraction layer is added to the linear autoregressive sample matrix according to the corresponding bits, and the second sample feature matrix for inputting the second reference feature extraction layer is obtained, and the first sample feature matrix output by the previous reference feature extraction layer is added to the linear autoregressive sample matrix according to the corresponding bits, and the result is input into the next reference feature extraction layer to obtain the first sample feature matrix output by the next reference feature extraction layer, until the last reference feature extraction layer in the target data prediction model outputs the first sample feature matrix corresponding to the module. Optionally, the first feature matrix output by the last reference feature extraction layer is input into the fully connected layer, each neuron in the fully connected layer represents a data object, and the value of each neuron represents the confidence of the data object, and the data object corresponding to the neuron with the highest confidence is determined as the output value of the data prediction model.
[0097] Optionally, the data prediction model can be a long short-term memory network, a bidirectional long short-term memory network, a deep belief network, etc., and no specific limitation is made here. It should be noted that when the data prediction model is a long short-term memory network, the reference feature extraction layer is a long short-term memory module, when the data prediction model is a bidirectional long short-term memory network, the reference feature extraction layer is a bidirectional long short-term memory module, and when the data prediction model is a deep belief network, the reference feature extraction layer is a restricted Boltzmann machine.
[0098] It should be noted that, in the above step S3, when the above data prediction model meets the training condition, the above data prediction model is determined as the above target data prediction model, and the above training condition is that the loss function of the data prediction model converges.
[0099] Through the above-mentioned implementation mode of the present application, a candidate sample set is first obtained, and a sample data vector and a prediction label are further determined based on the candidate sample set. A vector autoregression operation is performed on the sample data vector to obtain a linear autoregression sample matrix and a nonlinear autoregression sample matrix. The linear autoregression sample matrix and the nonlinear autoregression sample matrix are further input into a data prediction model in a training stage and trained. When the above-mentioned data prediction model meets the training conditions, the above-mentioned data prediction model is determined as the above-mentioned target data prediction model, thereby realizing the acquisition of the target prediction model.
[0100] As an optional implementation, training the data prediction model in the training phase according to the training sample set includes:
[0101] S1, obtaining the prediction results output by multiple sample data vectors of the data prediction model in the training stage;
[0102] S2, determining a current training loss of a data prediction model in a training phase according to the multiple prediction results and the prediction labels corresponding to each of the multiple sample data vectors;
[0103] S3: When the current training loss is greater than or equal to the target loss threshold, at least one model parameter in the data prediction model is updated.
[0104] In the above steps S1-S3, the above multiple sample data vectors are the historical access data of different users under a certain service. For example, in a page video playback service, the historical access data of each user can constitute a sample data vector. After each sample data vector is input into the data prediction model, a prediction result is output. The current training loss is calculated according to the prediction result and the actual label. Specifically, the current training loss can be calculated by the following formula:
[0105]
[0106] The above MSE is the mean square error formula, which is used to calculate the current training loss. Y is the actual output, Y t is the predicted output, n is Y t total.
[0107] When the current training loss is greater than or equal to the target loss threshold, at least one model parameter in the above data prediction model is updated. Optionally, the updating method can be to update the weights of the above multiple reference feature extraction layers using an adaptive moment estimation (ADAM) optimizer.
[0108] Through the above implementation of the present application, the prediction results of the multiple sample data vectors output by the data prediction model in the training stage are first obtained. Further, the current training loss of the data prediction model in the training stage is determined according to the multiple prediction results and the prediction labels corresponding to the multiple sample data vectors; finally, when the current training loss is greater than or equal to the target loss threshold, at least one model parameter in the data prediction model is updated so that the data prediction model can meet the training conditions.
[0109] In an optional implementation, after determining the output result of the target data prediction model as the target data object, the method further includes:
[0110] The following steps are executed in a loop until the target data object is different from the data object to be read, wherein the data object to be read is the data object of the current reading position in the data object sequence requested by the target terminal:
[0111] S1, add the target object to the end of the candidate data vector;
[0112] S2, performing a vector autoregression operation on the updated candidate data vector to obtain a linear autoregression matrix and a nonlinear autoregression matrix;
[0113] S3, inputting the linear autoregressive matrix and the nonlinear autoregressive matrix into the target data prediction model;
[0114] S4, determining the output result of the target data prediction model as the next target data object.
[0115] It can be understood that the above steps S1 to S4 are sequential predictions of multiple pre-fetched data of the user, and the termination condition of the sequential prediction is that the user's to-be-read data object is inconsistent with the predicted data object. It should be noted that the above-mentioned to-be-read data object is the data returned to the user terminal by the server associated with the current operation instruction of the user terminal (target terminal). Taking the web page access scenario as an example, in the web page access scenario, the user clicks the A button in the operation interface of the user terminal in the user terminal. After the A button is clicked, it will trigger the opening of the A web page. In this process, the user terminal will send a request to the server to return the instruction for opening the A web page. The data required to open the A web page is the user's to-be-read data object, such as the image data and text data in the A web page, etc., which are not specifically limited here.
[0116] The above step S1 is an update operation performed on the candidate data vector, specifically: adding the target object as the last element of the candidate data vector to the candidate data vector to form a new candidate data vector, and further executing step S2, performing a vector autoregression operation on the candidate data vector to obtain a linear autoregression matrix and the above nonlinear autoregression matrix, and then executing step S3, inputting the above linear autoregression matrix and the above nonlinear autoregression matrix into the above target data prediction model, and finally, determining the output result of the above target data prediction model as the target data object. The following is a specific description:
[0117] Assume that the current target data object is Y1, and Y1 is the data required to open web page A, wherein data object Y1 includes image data and text data of web page A, and then perform the above steps S1 to S4 to obtain a new target data object Y2, where Y2 is the image data and text data of web page B. Web page B is opened when the user clicks button B in the operation interface of the user terminal, and the user's first operation is to click button A in the operation interface. At this time, the data object to be read corresponding to the current reading position in the data object sequence is Y1, which is the same as the result of the corresponding reading position output by the target data prediction model. At this time, the loop from S1 to S4 is not stopped, and the user's next operation is to click button C in the operation interface. At this time, the data object to be read corresponding to the current reading position in the data object sequence is Y3, that is, the data that the user needs to read at this time is the image data and text data of web page C, and the result of the corresponding reading position output by the target data prediction model is Y2, that is, for this operation of the user, the image data and text data of web page B are pre-stored in the cache, which is inconsistent with the data actually required by the user, and the loop from S1 to S4 is terminated at this time.
[0118] Through the above implementation of the present application, the target object is first added to the end of the above candidate data vector to form a new candidate data vector and the prediction operation is performed cyclically, thereby improving the prediction efficiency of the target data prediction model.
[0119] In an optional implementation, after determining the output result of the target data prediction model as the target data object, the method further includes:
[0120] S1, obtaining a target parameter value of the target data object;
[0121] S2, loading the target parameter value of the target data object into the cache;
[0122] S3, in response to the data reading operation sent by the target terminal, when the data object to be read is the same as the target data object, sending the target parameter value in the cache to the target terminal.
[0123] It should be noted that the application scenario of the above steps S1 to S3 is a scenario of interaction between the server and the user's client. The above data reading operation is that the server determines to predict the user's pre-fetched data to the target terminal on the server side, and loads the data corresponding to the prediction result from the storage device on the server side to the cache on the server side. When the user needs to read the data, the server side can directly send the data in the cache to the user's client. Specifically, the above data object to be read is the data that the server side needs to return to the user terminal associated with the current operation instruction of the user terminal (target terminal). The above target parameter value is the data associated with the above data object to be read and stored in the server-side memory. For example, the user clicks the A button in the operation interface of the user terminal in the user terminal. After the A button is clicked, it will trigger the opening of the A webpage. The image data and text data of the A webpage that the server needs to return to the user terminal are the data objects to be read, and the data corresponding to the object to be read and stored in the server-side memory are the target parameter values. Assuming that the prediction model has previously predicted that A web page data Y1 (including the image data and text data of A web page) is the user's data object to be retrieved, the server will pre-load the target parameter value corresponding to the data object Y1 to be read and stored in the server-side memory into the server's cache. When the user clicks the A button in the operation interface of the user terminal, the server will send the image data and text data of A web page stored in the server-side memory from the cache to the user terminal.
[0124] Through the above-mentioned implementation mode of the present application, when a user performs a certain operation on a user terminal and the server sends certain data to the user terminal in response to the operation, the server can directly send the data in the cache to the user terminal, thereby avoiding the need to load the data into the cache when the user reads the data from the server, thereby improving the efficiency of the user in reading data.
[0125] The following combination Figure 3 , Figure 4 The following is an explanation of the training and use process of a complete data prediction model:
[0126] First, the training samples and prediction samples of the data prediction model can be obtained through steps S302 to S312, specifically:
[0127] S302: Obtain a cache data object set.
[0128] The cache data object set in the above step S302 is obtained according to a specific business, and different businesses correspond to different cache object sets. For example, in a cloud video playback business, the historical access data set generated by different users under the business is used as a cache data object set.
[0129] S304: Filter data objects whose access times are less than a threshold.
[0130] It should be noted that the threshold is a threshold acting on a user's access data. For example, the threshold is set to 3 to filter out data objects with access times less than 3 in historical access data sets of different users.
[0131] S306, record the user access sequence.
[0132] In the above step S306, recording the user access sequence is to arrange the data objects in the historical access data set of different users after filtering according to the historical access order to form multiple vectors.
[0133] S308, setting training data and prediction labels.
[0134] The first n-1 items of each of the multiple vectors obtained in S306 are used as training data, and the nth item is used as a prediction label.
[0135] S310, divide the training set and the test set into proportions.
[0136] In the above step S310, all the vectors determined in step S306 may be divided into a training set and a test set according to a ratio of 8 to 2, and a Z-score normalization process may be performed.
[0137] Then, the training set after Z-sCore standardization is used to train the data prediction model in the training phase. The specific training process is as follows: Figure 4 As shown:
[0138] First, step S402 is executed to perform vector autoregression calculation on the training set (standard user access sequence 402) after Z-sCore standardization processing. It should be noted that the above step S402 specifically includes the following steps:
[0139] S402-1, input the standard user access sequence into the next generation reserve pool calculation model;
[0140] S402-2, determining a linear autoregressive matrix and a nonlinear autoregressive matrix according to the target hyperparameters.
[0141] It should be noted that the above linear autoregressive matrix ( Figure 6 The linear feature matrix 406 in the figure contains the linear features of the standard user access sequence. The nonlinear autoregressive matrix ( Figure 6 The nonlinear feature matrix 404) contains the nonlinear features of the standard user sequence. The linear autoregressive matrix and the nonlinear autoregressive matrix have the following relationship:
[0142]
[0143] The above X nonlin is a nonlinear autoregressive matrix, consisting of multiple linear autoregressive matrices X lin The linear matrix X involved in the operation is obtained by multiplying the corresponding values. lin The number of is determined by the above target hyperparameters. Different target hyperparameters are determined by the following mathematical model to determine the specific linear matrix X lin and the nonlinear matrix X nonlin :
[0144] X=[X lin X nonlin ] T
[0145] The above T represents the transpose, X represents the equivalent output of the vector autoregression model, and the linear matrix X determined by different target hyperparameters lin and the nonlinear matrix X nonlin The X obtained by the above mathematical model operation is the same. For example, when the value of the target hyperparameter is 2, the linear autoregressive matrix X output by the above next-generation reserve pool calculation model is lin for:
[0146]
[0147] The nonlinear autoregressive matrix X output by the next generation reservoir calculation model is nonlin for:
[0148]
[0149] The above T represents transposition, and k represents the time extension length, which is another hyperparameter of the NGRC model and is determined in the initialization stage.
[0150] After that, the linear autoregression matrix X lin and the nonlinear autoregressive matrix X nonlin The data is input into a data prediction model including a plurality of feature extraction layers stacked in sequence. It should be noted that the number of feature extraction layers and the number of hidden layer neurons in each feature extraction layer are hyperparameters of the data prediction model, which are determined in the initialization stage.
[0151] It should be noted that Figure 4 The 4-layer feature extraction layer structure in ( Figure 4 The first feature extraction layer 408 to the fourth feature extraction layer 414) is only an example. In fact, the number of multiple feature extraction layers stacked in sequence in the present application can be more or less, and is not limited here. The following is an example of a feature extraction layer that is a bidirectional long-short-time memory layer.
[0152] The nonlinear autoregressive matrix X calculated in step S402 is nonlinThe input is to the first bidirectional long short-term memory layer (the first feature extraction layer 408), and the output of the first long short-term memory layer is calculated through forward propagation.
[0153] The output of the first layer of long short-term memory module is combined with the linear autoregressive matrix X calculated in step S402. lin Perform a bitwise addition operation and use the calculation result as the input of the next bidirectional long short-term memory layer.
[0154] Repeat the calculation in the previous step until the output of the last bidirectional long short-term memory layer is calculated.
[0155] The final output Y of the data prediction model is calculated based on the output of the last bidirectional long short-term memory layer. t ( Figure 4 (416) in the prediction output).
[0156] S404, calculate error.
[0157] The error in step S404 can be calculated by the following mathematical formula:
[0158]
[0159] The above formula is the mean square error formula, which is used to calculate the current training loss. Y is the actual output ( Figure 4 The actual output is 418), Y t is the predicted output ( Figure 4 In the prediction output 416), n is Y t total.
[0160] Afterwards, all weights of the bidirectional long short-term memory layer are updated through the Adam optimizer, and the training data prediction model is iterated until the MSE converges.
[0161] S406, prediction results.
[0162] Input a user access sequence in the test set into the trained data prediction model and output the prediction result Y t And the normalized mean square error index is calculated by the following formula:
[0163]
[0164] The above NMSE is the normalized mean square error, Y is the actual output, Y t is the predicted output, n is Y t total.
[0165] Set the prediction confidence threshold. If the NMSE value is greater than the confidence threshold, the prediction is considered wrong. If it is less than the confidence threshold, the prediction is correct.
[0166] According to another aspect of the embodiments of the present application, a cache data prediction device for implementing the cache data prediction method is also provided. Figure 5 As shown, the device comprises:
[0167] A vector acquisition unit 502 is used to acquire a candidate data vector, wherein the vector elements included in the candidate data vector are used to indicate the data object of the historical data access operation;
[0168] A vector autoregression unit 504 is used to perform a vector autoregression operation according to the candidate data vector to obtain a linear autoregression matrix and a nonlinear autoregression matrix;
[0169] A feature processing unit 506 is used to input the linear autoregression matrix and the nonlinear autoregression matrix into a target data prediction model, wherein the target data prediction model is a deep neural network model, and the target data prediction model includes a plurality of feature extraction layers stacked in sequence, a first feature extraction layer among the plurality of feature extraction layers is used to process the nonlinear autoregression matrix to obtain a first feature matrix, a second feature extraction layer among the plurality of feature extraction layers is used to process the second feature matrix to obtain the first feature matrix to be input into the next feature extraction layer, the first feature extraction layer is the first feature extraction layer among the plurality of feature extraction layers, the second feature extraction layer is the feature extraction layer other than the first feature extraction layer among the plurality of feature extraction layers, and the second feature matrix is obtained by connecting the first feature matrix output from the previous feature extraction layer with the linear autoregression matrix;
[0170] The determination unit 508 is used to determine the output result of the above target data prediction model as the target data object.
[0171] Optionally, the target data prediction model is a bidirectional long short-term memory network, the feature extraction layer includes a first direction feature extraction layer and a second direction feature extraction layer, and the cache data prediction device also includes a matrix acquisition unit, which is used for, when the current feature extraction layer is the second feature extraction layer, processing the matrix elements in the second feature matrix according to the first direction according to the first direction feature extraction layer to obtain a first reference matrix; processing the matrix elements in the second feature matrix according to the second direction according to the second direction feature extraction layer to obtain a second reference matrix; and splicing the first reference matrix and the second reference matrix to obtain the first feature matrix.
[0172] Optionally, the above-mentioned vector autoregression unit 504 includes: a first matrix acquisition module, used to perform vector autoregression calculation on the above-mentioned candidate data vector to obtain a first reference matrix; a second matrix acquisition module, used to transpose the above-mentioned first reference matrix to obtain a second reference matrix; a third matrix acquisition module, used to obtain the above-mentioned linear autoregression matrix and the above-mentioned nonlinear autoregression matrix from the above-mentioned second reference matrix, wherein the above-mentioned nonlinear autoregression matrix indicates the nonlinear relationship between the multiple data objects above, and the above-mentioned linear autoregression matrix indicates the linear relationship between the multiple data objects above.
[0173] Optionally, the matrix acquisition unit is further used to: acquire a data object set based on multiple historical data access operations, wherein the data object set includes the data objects corresponding to the historical data access operations; determine a candidate data subset from the data object set based on the number of accesses corresponding to each of the data objects in the data object set, wherein the number of accesses corresponding to the data objects included in the candidate data subset is greater than or equal to a target number; determine the candidate data vector based on multiple data objects in the candidate data subset and the operation order of the historical data access operations of each of the multiple data objects.
[0174] Optionally, the cache data prediction device further includes: a sample acquisition unit, used to acquire a training sample set, wherein the training sample set includes multiple training samples, the training samples include a sample data vector and a prediction label, the sample data vector and the prediction label are determined according to a data object sequence corresponding to a sample data access operation, the sample vector elements included in the sample data vector are used to indicate the first n-1 sample data objects in the data object sequence, the prediction label is used to indicate the nth sample data object in the data object sequence, and n is an integer greater than 1; a model training unit, used to: train a data prediction model in a training stage according to the training sample set, wherein the data prediction model in the training stage includes multiple reference feature extraction layers stacked in sequence, and the first reference feature extraction layer among the multiple reference feature extraction layers is used to process a nonlinear autoregressive sample matrix, A first sample feature matrix is obtained, and a second reference feature extraction layer among the multiple reference feature extraction layers is used to process the second sample feature matrix to obtain the first sample feature matrix to be input into the next reference feature extraction layer. The first feature extraction layer is the first reference feature extraction layer among the multiple reference feature extraction layers, and the second reference feature extraction layer is the other reference feature extraction layers among the multiple reference feature extraction layers except the first reference feature extraction layer. The second sample feature matrix is obtained by connecting the first reference feature matrix output from the previous reference feature extraction layer with a linear autoregressive sample matrix. The linear autoregressive sample matrix and the nonlinear autoregressive sample matrix are obtained by performing a vector autoregressive operation according to the sample data vector. A determination unit is used to: when the data prediction model meets the training conditions, determine the data prediction model as the target data prediction model.
[0175] Optionally, the above-mentioned model training unit is also used to: obtain prediction results of multiple sample data vectors output by the data prediction model in the training stage; determine the current training loss of the data prediction model in the training stage based on the multiple prediction results and the prediction labels corresponding to each of the multiple sample data vectors; and update at least one model parameter in the above-mentioned data prediction model when the above-mentioned current training loss is greater than or equal to the target loss threshold.
[0176] Optionally, the cache data prediction device also includes: a loop prediction unit, which is used to loop the following steps until the target data object is different from the data object to be read, wherein the data object to be read is the data object currently read in the data object sequence requested by the target terminal: adding the target data object to the end position of the candidate data vector; performing a vector autoregression operation on the updated candidate data vector to obtain a linear autoregression matrix and a nonlinear autoregression matrix; inputting the linear autoregression matrix and the nonlinear autoregression matrix into a target data prediction model; and determining the output result of the target data prediction model as the next target data object.
[0177] Optionally, the cache data prediction device also includes: a sending unit, which obtains a target parameter value of a target data object; loads the target parameter value of the target data object into a cache; and in response to a data read operation sent by a target terminal, when the data object to be read is the same as the target data object, sends the target parameter value in the cache to the target terminal.
[0178] According to another aspect of the embodiment of the present application, an electronic device for implementing the above-mentioned method for processing data in a memory is also provided. The electronic device may be Figure 1 The terminal device or server shown in the figure. This embodiment is described by taking the electronic device as a mobile phone or a computer as an example. Figure 6 As shown, the electronic device includes a memory 602 and a processor 604. The memory 602 stores a computer program, and the processor 604 is configured to execute the steps in any of the above method embodiments through the computer program.
[0179] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.
[0180] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0181] S1, obtaining a candidate data vector, wherein the vector elements included in the candidate data vector are used to indicate data objects of historical data access operations;
[0182] S2, performing a vector autoregression operation on the candidate data vector to obtain a linear autoregression matrix and a nonlinear autoregression matrix;
[0183] S3, inputting the linear autoregressive matrix and the nonlinear autoregressive matrix into a target data prediction model, wherein the target data prediction model is a deep neural network model, and the target data prediction model includes a plurality of feature extraction layers stacked in sequence, the first feature extraction layer among the plurality of feature extraction layers is used to process the nonlinear autoregressive matrix to obtain a first feature matrix, the second feature extraction layer among the plurality of feature extraction layers is used to process the second feature matrix to obtain the first feature matrix to be input into the next feature extraction layer, the first feature extraction layer is the first feature extraction layer among the plurality of feature extraction layers, the second feature extraction layer is the feature extraction layer other than the first feature extraction layer among the plurality of feature extraction layers, and the second feature matrix is obtained by connecting the first feature matrix output from the previous feature extraction layer with the linear autoregressive matrix;
[0184] S4, determining the output result of the above target data prediction model as the target data object.
[0185] Optionally, a person of ordinary skill in the art may understand that the structure shown in FIG. 6 is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (MID), a PAD, or other terminal devices. Figure 5 The structure of the electronic device is not limited. Figure 5 More or fewer components (such as network interfaces, etc.) as shown in, or with Figure 5 Different configurations shown.
[0186] Among them, the memory 602 can be used to store software programs and modules, such as the program instructions / modules corresponding to the cache data prediction method and device in the embodiment of the present application. The processor 604 executes various functional applications and data processing by running the software programs and modules stored in the memory 602, that is, to implement the above-mentioned method for adjusting the read voltage in the memory. The memory 602 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 602 may further include a memory remotely located relative to the processor 604, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 602 can be specifically, but not limited to, used to store information such as page elements and page styles. As an example, such as Figure 6As shown, the memory 602 may include, but is not limited to, the vector acquisition unit 502, the vector autoregression unit 504, the feature processing unit 506, and the determination unit 508 in the cache data prediction device. In addition, it may also include, but is not limited to, other module units in the read voltage adjustment device in the memory, which will not be repeated in this example.
[0187] Optionally, the transmission device 606 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wired network and a wireless network. In one example, the transmission device 606 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 606 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0188] In addition, the electronic device further includes: a display 608 for displaying the target page; and a connection bus 610 for connecting various module components in the electronic device.
[0189] In other embodiments, the terminal device or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes through network communication. The nodes may form a point-to-point network, and any form of computing device, such as a server, terminal or other electronic device, may become a node in the blockchain system by joining the point-to-point network.
[0190] According to one aspect of the present application, a computer-readable storage medium is provided, and a processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided in the above various optional implementations;
[0191] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0192] S1, obtaining a candidate data vector, wherein the vector elements included in the candidate data vector are used to indicate data objects of historical data access operations;
[0193] S2, performing a vector autoregression operation according to the candidate data vector to obtain a linear autoregression matrix and a nonlinear autoregression matrix;
[0194] S3, inputting the linear autoregression matrix and the nonlinear autoregression matrix into the target data prediction model, wherein the target data prediction model is a deep neural network model, the target data prediction model includes a plurality of feature extraction layers stacked in sequence, the first feature extraction layer among the plurality of feature extraction layers is used to process the nonlinear autoregression matrix to obtain a first feature matrix, the second feature extraction layer among the plurality of feature extraction layers is used to process the second feature matrix to obtain a first feature matrix to be input into the next feature extraction layer, the first feature extraction layer is the first feature extraction layer among the plurality of feature extraction layers, the second feature extraction layer is the other feature extraction layers among the plurality of feature extraction layers except the first feature extraction layer, and the second feature matrix is obtained by connecting the first feature matrix outputted from the previous feature extraction layer with the linear autoregression matrix;
[0195] S4, determining the output result of the target data prediction model as the target data object.
[0196] Optionally, in the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0197] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0198] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above 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, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to execute all or part of the steps of the methods of each embodiment of the present application.
[0199] 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.
[0200] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and 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.
[0201] 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 network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0202] 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.
[0203] The above are only preferred implementations 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.
[0204] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0205] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.
[0206] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0207] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0208] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0209] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0210] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0211] The embodiments of the present application also provide a computer program, which includes computer instructions, which are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in any one of the above method embodiments.
[0212] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0213] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0214] The above are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for predicting cache data, characterized in that: include: Acquire a candidate data vector, wherein the vector elements included in the candidate data vector are used to indicate data objects of historical data access operations; Perform a vector autoregression operation according to the candidate data vector to obtain a linear autoregression matrix and a nonlinear autoregression matrix; Input the linear autoregressive matrix and the nonlinear autoregressive matrix into a target data prediction model, wherein the target data prediction model is a deep neural network model, and the target data prediction model includes a plurality of feature extraction layers stacked in sequence, a first feature extraction layer among the plurality of feature extraction layers is used to process the nonlinear autoregressive matrix to obtain a first feature matrix, a second feature extraction layer among the plurality of feature extraction layers is used to process a second feature matrix to obtain the first feature matrix to be input into the next feature extraction layer, the first feature extraction layer is the first feature extraction layer among the plurality of feature extraction layers, the second feature extraction layer is the other feature extraction layers among the plurality of feature extraction layers except the first feature extraction layer, and the second feature matrix is obtained by connecting the first feature matrix output by the previous feature extraction layer with the linear autoregressive matrix; The target data object is determined according to the output result of the target data prediction model.
2. The method according to claim 1, characterized in that The target data prediction model is a bidirectional long short-term memory network, the feature extraction layer includes a first direction feature extraction layer and a second direction feature extraction layer, and after the linear autoregression matrix and the nonlinear autoregression matrix are input into the target data prediction model, the method further includes: When the current feature extraction layer is the second feature extraction layer, processing the matrix elements in the second feature matrix according to the first direction according to the first direction feature extraction layer to obtain a first reference matrix; Processing the matrix elements in the second feature matrix according to the second direction according to the second direction feature extraction layer to obtain a second reference matrix; The first reference matrix and the second reference matrix are concatenated to obtain the first characteristic matrix.
3. The method according to claim 2, characterized in that The step of obtaining a candidate data vector comprises: According to a plurality of historical data access operations, a data object set is acquired, wherein the data object set includes the data object corresponding to the historical data access operation; Determine a candidate data subset from the data object set according to the access times corresponding to each of the data objects in the data object set, wherein the access times corresponding to the data objects included in the candidate data subset are greater than or equal to a target number; The candidate data vector is determined according to the plurality of data objects in the candidate data subset and the operation order of the respective historical data access operations of the plurality of data objects.
4. The method according to claim 1, characterized in that: Before obtaining the candidate data vector, the method further includes: Acquire a training sample set, wherein the training sample set includes a plurality of training samples, the training samples include a sample data vector and a prediction label, the sample data vector and the prediction label are determined according to a data object sequence corresponding to a sample data access operation, the sample vector elements included in the sample data vector are used to indicate the first n-1 sample data objects in the data object sequence, the prediction label is used to indicate the nth sample data object in the data object sequence, and n is an integer greater than 1; The data prediction model in the training stage is trained according to the training sample set, wherein the data prediction model in the training stage includes a plurality of reference feature extraction layers stacked in sequence, a first reference feature extraction layer among the plurality of reference feature extraction layers is used to process a nonlinear autoregressive sample matrix to obtain a first sample feature matrix, a second reference feature extraction layer among the plurality of reference feature extraction layers is used to process a second sample feature matrix to obtain the first sample feature matrix to be input into the next reference feature extraction layer, the first reference feature extraction layer is the first reference feature extraction layer among the plurality of reference feature extraction layers, the second reference feature extraction layer is the other reference feature extraction layers among the plurality of reference feature extraction layers except the first reference feature extraction layer, the second sample feature matrix is obtained by connecting the first sample feature matrix output by the previous reference feature extraction layer with a linear autoregressive sample matrix, and the linear autoregressive sample matrix and the nonlinear autoregressive sample matrix are obtained by performing a vector autoregressive operation according to the sample data vector; When the data prediction model meets the training condition, the data prediction model is determined as the target data prediction model.
5. The method according to claim 4, characterized in that The step of training the data prediction model in the training phase according to the training sample set includes: Obtain prediction results output by a plurality of sample data vectors of a data prediction model in a training phase; Determine the current training loss of the data prediction model in the training phase according to the plurality of prediction results and the prediction labels corresponding to each of the plurality of sample data vectors; When the current training loss is greater than or equal to a target loss threshold, at least one model parameter in the data prediction model is updated.
6. The method according to claim 1, characterized in that After determining the output result of the target data prediction model as the target data object, the method further includes: The following steps are executed in a loop until the target data object is different from the data object to be read, wherein the data object to be read is the data object of the current reading position in the data object sequence requested by the target terminal: Adding the target data object to the end position of the candidate data vector; Performing the vector autoregression operation on the updated candidate data vector to obtain the linear autoregression matrix and the nonlinear autoregression matrix; Inputting the linear autoregressive matrix and the nonlinear autoregressive matrix into the target data prediction model; The output result of the target data prediction model is determined as the next target data object.
7. The method according to claim 6, characterized in that After determining the output result of the target data prediction model as the target data object, the method further includes: Obtaining a target parameter value of the target data object; Loading the target parameter value of the target data object into a cache; In response to a data read operation sent by a target terminal, when the to-be-read data object is identical to the target data object, the target parameter value in the cache is sent to the target terminal.
8. A cache data prediction device, characterized in that: include: A vector acquisition unit, used to acquire a candidate data vector, wherein the vector elements included in the candidate data vector are used to indicate a data object of a historical data access operation; A vector autoregression unit, used to perform a vector autoregression operation according to the candidate data vector to obtain a linear autoregression matrix and a nonlinear autoregression matrix; A feature processing unit, used for inputting the linear autoregressive matrix and the nonlinear autoregressive matrix into a target data prediction model, wherein the target data prediction model is a deep neural network model, and the target data prediction model includes a plurality of feature extraction layers stacked in sequence, a first feature extraction layer among the plurality of feature extraction layers is used for processing the nonlinear autoregressive matrix to obtain a first feature matrix, a second feature extraction layer among the plurality of feature extraction layers is used for processing a second feature matrix to obtain the first feature matrix to be input into the next feature extraction layer, the first feature extraction layer is the first feature extraction layer among the plurality of feature extraction layers, the second feature extraction layer is the other feature extraction layers among the plurality of feature extraction layers except the first feature extraction layer, and the second feature matrix is obtained by connecting the first feature matrix output by the previous feature extraction layer with the linear autoregressive matrix; A determination unit is used to determine the output result of the target data prediction model as a target data object.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 7 when executed by a processor.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Multivariate time series prediction method and system, computer product and storage medium
CN114493014A
Business operation adjustment method and device, electronic equipment and medium
CN117808163A
Time sequence social network prediction method and system based on autoregression non-negative matrix factorization
CN118313508A