User behavior prediction method and device, electronic device, and storage medium

The user behavior data is processed through the long-term memory network model, which solves the problem of low user behavior prediction accuracy in the prior art, realizes more accurate long-term characteristics and trend analysis, and improves prediction accuracy.

CN111221896BActive Publication Date: 2025-01-17BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN201811428883.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-11-27
Publication Date
2025-01-17
Estimated Expiration
2038-11-27

AI Technical Summary

Technical Problem

The existing user behavior prediction methods have low accuracy, mainly because feature extraction depends on manual experience and cannot effectively reflect the long-term characteristics and changing trends of user behavior.

Method used

The user's behavioral data in the last N long cycles is processed by using a long-term memory network model. By converting it into a sequence of eigenvectors, and the initial memory state of the model is synchronized, and the user's behavioral prediction results are finally determined based on the output vector. .

Benefits of technology

It improves the accuracy of user behavior prediction, can better explore the long-term characteristics and changing trends of user behavior, and avoids the limitations of artificial feature extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111221896B_ABST
    Figure CN111221896B_ABST
Patent Text Reader

Abstract

The present disclosure provides a user behavior prediction method, which relates to the field of big data technology. The method includes: obtaining the behavior data of the user to be predicted in the most recent N long periods, and converting it into N feature vectors with a sequence; inputting the first feature vector into a long short-term memory network model to obtain the first long short-term memory vector; sequentially, updating the initial memory state of the long short-term memory network model according to the i-th long short-term memory vector, and inputting the i-th feature vector into the long short-term memory network model to obtain the i-th long short-term memory vector, where i∈[2,N‑1]; updating the initial memory state of the long short-term memory network model according to the N-th long short-term memory vector, and inputting the N-th feature vector into the long short-term memory network model to obtain an output vector; determining the behavior prediction result of the user to be predicted according to the output vector. The present disclosure can mine the long-term characteristics and changing trends of user behavior and improve the accuracy of user behavior prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] With the development of big data technology, more and more companies are committed to predicting user behaviors and needs through big data analysis, so as to provide better services and attract more users.

[0003] Most of the existing user behavior prediction methods extract features from the user's historical data and obtain the user's behavior prediction results by analyzing these features. Among them, which features to extract depends on the experience of data analysts, so the effectiveness of the features is difficult to guarantee; and the historical data used is mostly recent data, which cannot reflect the long-term characteristics of user behavior and the changing trends of behavioral habits; the above two shortcomings will lead to a low accuracy rate of user behavior prediction, affecting the effect of actual application.

[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0005] The present disclosure provides a user behavior prediction method, a user behavior prediction device, an electronic device, and a computer-readable storage medium, thereby overcoming the problem of low accuracy of existing user behavior prediction methods at least to a certain extent.

[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.

[0007] According to one aspect of the present disclosure, a user behavior prediction method is provided, including: obtaining behavior data of a user to be predicted in the most recent N long periods, and converting them into N feature vectors with a chronological order; inputting a first feature vector into a long short-term memory network model to obtain a first long short-term memory vector; sequentially, updating an initial memory state of the long short-term memory network model according to the i-1th long short-term memory vector, and inputting an i-th feature vector into the long short-term memory network model to obtain an i-th long short-term memory vector, wherein i∈[2,N-1]; updating an initial memory state of the long short-term memory network model according to the N-1th long short-term memory vector, and inputting an N-th feature vector into the long short-term memory network model to obtain an output vector; and determining a behavior prediction result of the user to be predicted according to the output vector.

[0008] In an exemplary embodiment of the present disclosure, the obtaining of the behavior data of the user to be predicted in the most recent N long periods and converting it into N feature vectors with a chronological order includes: sequentially counting O types of behavior data of the user to be predicted in the most recent N long periods according to short periods, each long period including M short periods; and converting the behavior data into N M*O dimensional feature vectors with a chronological order.

[0009] In an exemplary embodiment of the present disclosure, the long short-term memory network model includes at least: an input layer, including M*O neurons, for inputting the M*O-dimensional feature vector; a first fully connected layer, including P neurons, for converting the feature vector into a first intermediate vector of P dimension; a long short-term memory layer, including Q neurons, for converting the first intermediate vector into a Q-dimensional long short-term memory vector according to the initial memory state, any two of the Q neurons are connected; a second fully connected layer, including R neurons, for converting the long short-term memory vector into a second intermediate vector of R dimension; an output layer, including S neurons, for converting the second intermediate vector into an S-dimensional output vector.

[0010] In an exemplary embodiment of the present disclosure, the long short-term memory layer is a forward long short-term memory layer, the long short-term memory vector is a forward long short-term memory vector, and the initial memory state is a forward initial memory state; the long short-term memory network model also includes: a backward long short-term memory layer, including T neurons, used to convert the forward long short-term memory vector into a T-dimensional backward long short-term memory vector according to the backward initial memory state, and any two neurons in the T neurons are connected; then the second fully connected layer is used to convert the backward long short-term memory vector into the second intermediate vector; the first feature vector is input into a long short-term memory network model to obtain a first long short-term memory vector The method comprises: inputting a first characteristic vector into a long short-term memory network model to obtain a first forward long short-term memory vector; sequentially updating the initial memory state of the long short-term memory network model according to the i-1th long short-term memory vector, and inputting the i-th characteristic vector into the long short-term memory network model to obtain the i-th long short-term memory vector. The method comprises: sequentially updating the forward initial memory state and the backward initial memory state of the long short-term memory network model according to the i-1th forward long short-term memory vector and the i-1th backward long short-term memory vector, and inputting the i-th characteristic vector into the long short-term memory network model to obtain the i-th forward long short-term memory vector and the i-th backward long short-term memory vector.

[0011] In an exemplary embodiment of the present disclosure, S=M+1.

[0012] In an exemplary embodiment of the present disclosure, the first fully connected layer and the second fully connected layer are ReLu (Rectified Linear Unit) activation layers; and the output layer is a Softmax (normalized exponential function) activation layer.

[0013] In an exemplary embodiment of the present disclosure, the step of inputting the first feature vector into a long short-term memory network model to obtain the first long short-term memory vector comprises: inputting the first feature vector into a long short-term memory network model to obtain the first long short-term memory vector and the first output vector;

[0014] The step of sequentially updating the initial memory state of the LSTM network model according to the i-1th LSTM vector and inputting the i-th feature vector into the LSTM network model to obtain the i-th LSTM vector comprises: sequentially updating the initial memory state of the LSTM network model according to the i-1th LSTM vector and inputting the i-th feature vector into the LSTM network model to obtain the i-th LSTM vector and the i-th output vector, wherein i∈[2,N-1];

[0015] The method further includes: determining the i-th real vector H according to the i-th feature vector in sequence i , and the i-th real vector H i and the i-1th output vector G i-1 Matching is performed; if the following condition (1) is met, the user behavior prediction is considered invalid:

[0016]

[0017] Wherein, K is a matching threshold; if the condition (1) is not satisfied, a step of determining the behavior prediction result of the user to be predicted according to the output vector is performed, wherein the output vector is the Nth output vector.

[0018] According to one aspect of the present disclosure, a user behavior prediction device is provided, including: a data acquisition module, used to obtain the behavior data of a user to be predicted within N long periods, and convert it into N feature vectors with a sequence; a model analysis module, used to input a first feature vector into a long short-term memory network model to obtain a first long short-term memory vector, sequentially, update the initial memory state of the long short-term memory network model according to the i-1th long short-term memory vector, and input the i-th feature vector into the long short-term memory network model to obtain the i-th long short-term memory vector, and update the initial memory state of the long short-term memory network model according to the N-1th long short-term memory vector, and input the N-th feature vector into the long short-term memory network model to obtain an output vector, where i∈[2,N-1]; a result output module, used to determine the behavior prediction result of the user to be predicted according to the output vector.

[0019] According to one aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned methods by executing the executable instructions.

[0020] According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, any one of the above methods is implemented.

[0021] The exemplary embodiments of the present disclosure have the following beneficial effects:

[0022] After obtaining the behavior data of the user to be predicted in the most recent N long periods and converting them into feature vectors, the long short-term memory network model is used to process them in turn, and the initial memory state of the long short-term memory network model is updated synchronously, and finally the output vector corresponding to the Nth feature vector is obtained, and the behavior prediction result of the user to be predicted is determined based on the output vector. On the one hand, by collecting the user's N long-term behavior data and analyzing them in chronological order through the long short-term memory network model, the long-term characteristics and change trends of the user's behavior can be mined, so that the user's behavior can be predicted more accurately; on the other hand, the long short-term memory network model is a special neural network model that can extract features from the feature vector data from the machine dimension, thereby avoiding the limitations of manually extracted features and improving the accuracy of user behavior prediction.

[0023] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0025] Figure 1 A flowchart schematically illustrates a method for predicting user behavior in this exemplary embodiment;

[0026] Figure 2 A schematic diagram schematically illustrates a long short-term memory network model in this exemplary embodiment;

[0027] Figure 3 A schematic diagram schematically shows a long short-term memory layer in this exemplary embodiment;

[0028] Figure 4 A schematic diagram schematically illustrates another long short-term memory network model in this exemplary embodiment;

[0029] Figure 5 A flowchart schematically illustrates another method for predicting user behavior in this exemplary embodiment;

[0030] Figure 6 A structural block diagram of a user behavior prediction device in this exemplary embodiment is schematically shown;

[0031] Figure 7 An electronic device for implementing the above method in this exemplary embodiment is schematically shown;

[0032] Figure 8 A computer-readable storage medium for implementing the above method in this exemplary embodiment is schematically shown. DETAILED DESCRIPTION

[0033] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0034] The exemplary embodiments of the present disclosure first provide a method for predicting user behavior. User behavior prediction refers to predicting whether a user will perform or not perform a certain behavior within a certain period of time in the future, or the degree of a certain behavior, such as predicting whether a user will receive a coupon and the number of times the coupon will be received within the next week, or predicting whether a user will log in to a client program within the next three days and the time of login, etc.

[0035] refer to Figure 1 As shown, the user behavior prediction method may include steps S110 to S150:

[0036] Step S110, obtaining the behavior data of the user to be predicted in the latest N long periods, and converting it into N feature vectors with a chronological order.

[0037] In this exemplary embodiment, the long period can be a time period for predicting user behavior, for example, predicting user behavior in the next week, and the long period can be one week. In step S110, the behavior data of the user to be predicted in the last N weeks can be counted. The behavior data of each long period can be converted into a feature vector. For example, multiple behavior data in each long period can be counted and arranged as a feature vector in a certain order, or the behavior data in each long period can be arranged as a feature vector in chronological order. The behavior data of each long period should be converted into a feature vector of the same form and dimension according to the same rule. According to the time sequence of N long periods, the N feature vectors can be numbered. The feature vector corresponding to the earliest long period is the first feature vector, and the feature vector corresponding to the most recent long period is the Nth feature vector. N can be any positive integer. The larger the value of N, the more sufficient the behavior data of the user to be predicted is obtained, and the more conducive it is to subsequent accurate prediction. However, it is also necessary to consider the difficulty of obtaining behavior data and the subsequent amount of calculation. The value of N can be set according to the actual situation and the above factors can be combined.

[0038] Step S120, inputting the first feature vector into a long short-term memory network model to obtain a first long short-term memory vector.

[0039] The long short-term memory network model refers to a type of neural network model that uses a long short-term memory layer as a recurrent intermediate layer. In this exemplary embodiment, a trained long short-term memory network model is used to predict user behavior. By inputting the feature vector into the long short-term memory network model, the value of each neuron and the output vector can be obtained; by arranging the values ​​of the long short-term memory layer in the order of neurons, a long short-term memory vector, i.e., an intermediate layer vector of the model, can be obtained. Among them, the first feature vector corresponds to the first long short-term memory vector, the second feature vector corresponds to the second long short-term memory vector, and so on.

[0040] Step S130, sequentially, update the initial memory state of the long short-term memory network model according to the i-1th long short-term memory vector, and input the i-th feature vector into the long short-term memory network model to obtain the i-th long short-term memory vector, where i∈[2,N-1].

[0041] In this exemplary embodiment, the long short-term memory layer of the long short-term memory network model has an initial memory state, and the initial memory state can be regarded as a hidden neuron. The first neuron of the long short-term memory layer is determined by the initial memory state and the previous intermediate layer. Therefore, when using the long short-term memory network model to process the i-th eigenvector, in addition to the need to input the i-th eigenvector, it is also necessary to update the initial memory state. In particular, for the first eigenvector, the initial memory state can be considered to be 0, or it can be artificially set to other values; thereafter, the initial memory state of the current long short-term memory network model can be determined based on the previous long short-term memory vector, so that each eigenvector can be processed in turn using the long short-term memory network model.

[0042] Step S140, updating the initial memory state of the LSTM network model according to the N-1th LSTM vector, and inputting the Nth feature vector into the LSTM network model to obtain an output vector.

[0043] The LSTM network model is used to process each feature vector in sequence until the last feature vector, i.e., the Nth feature vector. When processing the Nth feature vector, the method for determining the initial memory state is the same as step S130. After updating the initial memory state, the Nth feature vector is input into the LSTM network model to obtain the Nth LSTM vector and the output vector. In this exemplary embodiment, the output vector specifically refers to the output vector corresponding to the Nth feature vector.

[0044] Step S150, determining the behavior prediction result of the user to be predicted according to the output vector.

[0045] The dimensions of the output vector usually have practical significance, representing the classification results of behavior prediction. For example, to predict whether a user will receive a coupon in the next week, the output vector can be a two-dimensional vector, and the values ​​of the two dimensions can respectively represent the probability of the user receiving or not receiving the coupon, or to predict the number of coupons the user will receive in the next week. The output vector can be a B+1-dimensional vector, and the value of the first dimension represents the probability of the user receiving one coupon, and the value of the second dimension represents the probability of the user receiving two coupons... The value of the Bth dimension represents the probability of the user receiving B coupons, and the value of the B+1th dimension represents the probability of the user not receiving the coupon.

[0046] In this exemplary embodiment, the output vector represents the behavior prediction classification of the N+1th long period (i.e., a long period in the future), so the output vector can be converted into a behavior prediction result. Specifically, the dimension with the largest value in the output vector can be used as the behavior prediction result. For example, in the above example of predicting the number of coupons that a user will receive in the next week, if the value of the Cth dimension of the output vector is the largest, the prediction result is that the user will receive C coupons in the next week; in addition, a certain threshold can also be set. When the largest value in the output vector reaches the threshold, the model prediction is considered to be successful and the behavior prediction result is output. Otherwise, the model prediction can be considered to have failed and more behavior data is needed. For example, when predicting whether a user will receive a coupon in the next week, the output vector obtained is [0.6, 0.4], indicating that the probability of the user receiving the coupon in the next week is 60%, and the probability of not receiving the coupon is 40%. If the threshold is set to 70%, although the model predicts that the probability of the user receiving the coupon in the next week is relatively high, it is less than 70%, and the result of the prediction is not credible enough, and the prediction failure result can be output. Subsequently, the process may return to step S110, increase the value of N, or increase the type of behavior data, and then repeat the above steps S120 to S150.

[0047] Based on the above description, in this exemplary embodiment, the behavior data of the user to be predicted in the most recent N long periods is obtained and converted into a feature vector, which is then processed in turn using the long short-term memory network model, and the initial memory state of the long short-term memory network model is synchronously updated, and finally the output vector corresponding to the Nth feature vector is obtained, and the behavior prediction result of the user to be predicted is determined according to the output vector. On the one hand, by collecting the user's N long-term behavior data and analyzing it in chronological order in turn through the long short-term memory network model, the long-term characteristics and change trends of the user's behavior can be mined, so that the user's behavior can be predicted more accurately; on the other hand, the long short-term memory network model is a special neural network model that can extract features from the feature vector data from the machine dimension, thereby avoiding the limitations of manually extracted features and improving the accuracy of user behavior prediction.

[0048] In an exemplary embodiment, step S110 may be implemented by the following steps:

[0049] According to the short cycle, O types of behavior data of the user to be predicted in N long cycles are counted in sequence, and each long cycle includes M short cycles.

[0050] The behavior data is converted into N M*O dimensional feature vectors with a sequence.

[0051] The short cycle refers to a basic data statistical cycle, corresponding to the long cycle, for example, the long cycle may be one week, the short cycle may be one day, and each long cycle includes 7 short cycles. In this exemplary embodiment, the long cycle is an integer multiple of the short cycle.

[0052] When counting behavioral data, you can count a variety of related behavioral data based on the behavior that needs to be predicted. For example, in the scenario of predicting users to receive coupons, with one day as a short period, you can count the following five types of behavioral data: whether the user signs in at the coupon collection platform every day, which can be represented by 0 / 1; the number of times the user signs in at the platform every day; whether the user receives a coupon every day, which can be represented by 0 / 1; the number of times the user uses a coupon every day; the total value of the coupons received by the user every day. With a week as a long period, count the five types of data every day, and get 35 data, so each long-term behavioral data can be converted into a 35-dimensional feature vector. By counting behavioral data for multiple long periods, you can get multiple 35-dimensional feature vectors, and these feature vectors have a sequence corresponding to the long period.

[0053] According to the needs of practical applications, M and O can be any positive integers, and the present disclosure does not make any special limitations on this.

[0054] In an exemplary embodiment, reference Figure 2 As shown, the long short-term memory network model can include at least the following neural network layers:

[0055] The input layer includes M*O neurons, which are used to input M*O dimensional feature vectors;

[0056] The first fully connected layer includes P neurons and is used to convert the feature vector into a first intermediate vector of P dimensions;

[0057] A long short-term memory layer, comprising Q neurons, for converting the first intermediate vector into a Q-dimensional long short-term memory vector according to an initial memory state, wherein any two neurons among the Q neurons are connected;

[0058] The second fully connected layer includes R neurons, which are used to convert the long short-term memory vector into a second intermediate vector of R dimension;

[0059] The output layer includes S neurons and is used to transform the second intermediate vector into an S-dimensional output vector.

[0060] Among them, the feature vector input by the input layer represents the user's M short-term behavioral data, which has certain time series characteristics. Sufficient feature extraction can be performed in the first fully connected layer, and then the time series association can be mined in the long short-term memory layer, and sorted through the second fully connected layer, and finally converted into an output vector through the output layer.

[0061] In this exemplary embodiment, reference Figure 3 As shown, any two of the Q neurons in the long short-term memory layer are connected and a certain weight is set, indicating that the state can be transmitted between any two or more neurons. In addition, it is also possible to set the state to be transmitted only in one direction within the long short-term memory layer, for example, the Q neurons are arranged in order as C1, C2...C Q Then, for any i, j∈[1,Q], when i>j, there is C i to C j The connection weight W(C i ->C j )=0. In particular, it is also possible to set the state to be transmitted only by the previous neuron, that is, if and only if i=j-1, there is C i to C j The connection weight W(C i ->C j )≠0. This disclosure does not make any special limitation on this.

[0062] In an exemplary embodiment, the number of neurons in the long short-term memory layer may be in the order of 1000, for example, Q may be 512, 1024, 1536, etc.

[0063] like Figure 2 As shown in the figure, when each feature vector is processed by the long short-term memory network model, the long short-term memory vector obtained by the long short-term memory layer can be used to calculate the initial memory state in the next round of model processing and participate in the next round of model processing. In this way, the temporal characteristics of the previous long-term behavior data are transferred to the processing of the next long-term behavior data, realizing the mining of the temporal characteristics of long-term behavior data.

[0064] It should be noted that in one user behavior prediction, a total of N rounds of predictions were performed using the LSTM network model, where the LSTM network model used in each round of predictions was connected to the LSTM network model of the previous round through a LSTM layer, and the connection weight can be regarded as the recurrent connection weight of the LSTM layer (i.e., the weight for calculating the initial memory state). For any round of prediction, the weight is a parameter in the model and should be the same.

[0065] For the above-mentioned long short-term memory network model, a large amount of historical user data can be used for training. For example, the behavior data of multiple users in N+1 historical long periods are obtained, and the behavior data of the earlier N long periods are converted into sample feature vectors, and the behavior data of the 2nd to N+1th long periods are converted into behavior labels, thereby generating two correspondences between feature vectors and behavior labels: one is that each feature vector corresponds to the behavior label of the next long period; the other is that each group of feature vectors (containing N feature vectors) corresponds to the behavior label of the N+1th long period. The internal connection weights of the long short-term memory network model and the recurrent connection weights of the long short-term memory layer (i.e., the weights for calculating the initial memory state) can be trained through the correspondence between the two feature vectors and behavior labels.

[0066] Furthermore, the long short-term memory layer is a forward long short-term memory layer, the long short-term memory vector is a forward long short-term memory vector, and the initial memory state is a forward initial memory state; then refer to Figure 4 As shown, the long short-term memory network model may further include: a backward long short-term memory layer, including T neurons, used to convert the forward long short-term memory vector into a backward long short-term memory vector of T dimensions according to the backward initial memory state, and any two neurons among the T neurons are connected;

[0067] Accordingly, the second fully connected layer can be used to convert the backward long short-term memory vector into a second intermediate vector.

[0068] Step S120 may include: inputting the first feature vector into a long short-term memory network model to obtain a first forward long short-term memory vector and a first backward long short-term memory vector.

[0069] Step S130 may include: sequentially, updating the forward initial memory state and the backward initial memory state of the long short-term memory network model according to the i-1th forward long short-term memory vector and the i-1th backward long short-term memory vector, and inputting the i-th feature vector into the long short-term memory network model to obtain the i-th forward long short-term memory vector and the i-th backward long short-term memory vector.

[0070] By adding a long short-term memory layer, the vectors in the first fully connected layer can be fully mined for time series features, further improving the accuracy of user behavior prediction. It should be understood that according to actual needs, a third or more long short-term memory layers can be set, and other intermediate layers can be inserted between the long short-term memory layers, and a third fully connected layer, a fourth fully connected layer, etc. can also be added, and the present disclosure does not specifically limit this.

[0071] It should be noted that the above P, Q, R, S, and T are the number of neurons in different layers of the long short-term memory network model, and the number of neurons is determined by the parameter settings of the developer and the training of the model, which is related to multiple factors such as the application scenario, the complexity of user behavior data, the number of sample data, and training parameters. Therefore, P, Q, R, S, and T can be any positive integers, and this disclosure does not specifically limit this.

[0072] In an exemplary embodiment, in the above-mentioned long short-term memory network model, bias units (which can be formally regarded as special neurons) can also be set in any one or more layers.

[0073] In an exemplary embodiment, the long short-term memory network model can be used to predict the number of short periods in which the user will perform a certain behavior in the next M short periods, such as the number of days to receive coupons in the next 7 days. The prediction result should be an integer between [0, M], and the user behavior prediction can be converted into a classification problem with M+1 results, so it can be concluded that S=M+1.

[0074] In an exemplary embodiment, the first fully connected layer and the second fully connected layer may be ReLu activation layers; and the output layer may be a Softmax activation layer. The ReLu activation function is used in the fully connected layer to perform sparseness while extracting features. The Softmax activation function is suitable for normalizing the output values ​​to obtain classification results.

[0075] In an exemplary embodiment, the user behavior prediction method can refer to Figure 5 As shown, the following steps are included:

[0076] Step S510, collecting statistics of the behavior data of the user to be predicted in the latest N long periods and converting them into N feature vectors with a chronological order;

[0077] Step S520, inputting the first feature vector into a long short-term memory network model to obtain a first long short-term memory vector and a first output vector G1;

[0078] Step S530, sequentially, updating the initial memory state of the LSTM network model according to the i-1th LSTM vector, and inputting the i-th feature vector into the LSTM network model to obtain the i-th LSTM vector and the i-th output vector G i , where i∈[2,N-1];

[0079] Step S540, updating the initial memory state of the LSTM network model according to the N-1th LSTM vector, and inputting the Nth feature vector into the LSTM network model to obtain the Nth output vector;

[0080] Step S550, determine the i-th true vector Hi according to the i-th eigenvector in turn, and convert the i-th true vector H i and the i-1th output vector G i-1 Make a match;

[0081] Step S560: If the following condition (1) is met, the user behavior prediction is determined to be invalid:

[0082]

[0083] Where K is the matching threshold, Ⅱ(·) is the indicator function, and takes the values ​​1 and 0 when · in the brackets is true and false, respectively;

[0084] Step S570: If condition (1) is not satisfied, the behavior prediction result of the user to be predicted is determined according to the Nth output vector.

[0085] In the LSTM network model, the output vector represents the prediction of the user behavior for the next long period. For example, the first output vector G1 corresponding to the first feature vector is the prediction result of the second long period. In this exemplary embodiment, the first long period to the Nth long period are the most recent N long periods, that is, the historical period. The real behavior result can be obtained based on the second feature vector of the second long period, represented by the real vector H2. By comparing H2 with G1, it can be known whether the prediction result of G1 is accurate. In this exemplary embodiment, G N is the output vector that needs to be obtained in the end to predict the user's behavior in a long period in the future, and G1~G N-1 It can be regarded as the intermediate data generated in the model processing process, which can reflect the accuracy of the model prediction to a certain extent. i With G i-1 , and accumulate the statistical matching degree, using The larger the value, the higher the model accuracy. You can set the matching threshold K as the judgment standard. This means that the model's prediction effect in the first N-1 rounds is not good, and the prediction result in the Nth round is also unreliable, so it can be determined that the user behavior prediction is invalid. On the contrary, it means that the prediction effect is good and can be verified by G N Determine the final behavior prediction result. The value of K can be set based on experience, for example, K = 0.7·(N-1), which means that the model needs to make accurate predictions in at least 70% of the first N-1 rounds of predictions. The value of K can also be optimized in actual application. For example, if the effective user behavior prediction results are compared with the subsequent actual user behavior, if there are many inconsistencies, the value of K can be appropriately increased; if the invalid user behavior prediction results are compared with the subsequent actual user behavior, if there are many consistent results, the value of K can be appropriately reduced, etc. This disclosure does not specifically limit this.

[0086] In other embodiments, since the long short-term memory network model has a time series accumulation effect, the greater the number of prediction rounds, the more reliable the prediction results are. Therefore, weighted statistics can be performed on the matching conditions of each round of prediction results. That is, when the following condition (2) is met, it can be determined that the user behavior prediction is invalid:

[0087]

[0088] The weight of each round of prediction may be equal to the number of rounds. K in condition (2) and K in condition (1) are different forms of matching thresholds, and their values ​​are usually not equal. For example, K in condition (1) is 0.7·(N-1), and K in condition (2) may be 0.7.

[0089] The present disclosure does not specifically limit which determination condition is adopted.

[0090] The exemplary embodiments of the present disclosure also provide a user behavior prediction device, referring to Figure 6 As shown, the device 600 may include: a data acquisition module 610, used to obtain the behavior data of the user to be predicted within N long periods, and convert it into N feature vectors with a sequence; a model analysis module 620, used to input the first feature vector into a long short-term memory network model to obtain a first long short-term memory vector, and sequentially, update the initial memory state of the long short-term memory network model according to the i-1th long short-term memory vector, and input the i-th feature vector into the long short-term memory network model to obtain the i-th long short-term memory vector, and update the initial memory state of the long short-term memory network model according to the N-1th long short-term memory vector, and input the N-th feature vector into the long short-term memory network model to obtain an output vector, where i∈[2,N-1]; a result output module 630, used to determine the behavior prediction result of the user to be predicted according to the output vector.

[0091] In an exemplary embodiment, the data acquisition module can also be used to count the O types of behavioral data of the user to be predicted in the last N long periods in sequence according to short periods, where each long period includes M short periods, and convert the behavioral data into N M*O dimensional feature vectors with a chronological order.

[0092] In an exemplary embodiment, the long short-term memory network model includes at least: an input layer, including M*O neurons, for inputting an M*O-dimensional feature vector; a first fully connected layer, including P neurons, for converting the feature vector into a first intermediate vector of P dimension; a long short-term memory layer, including Q neurons, for converting the first intermediate vector into a Q-dimensional long short-term memory vector according to an initial memory state, and any two of the Q neurons are connected; a second fully connected layer, including R neurons, for converting the long short-term memory vector into a second intermediate vector of R dimension; an output layer, including S neurons, for converting the second intermediate vector into an S-dimensional output vector.

[0093] In an exemplary embodiment, the above-mentioned long short-term memory layer is a forward long short-term memory layer, the long short-term memory vector is a forward long short-term memory vector, and the initial memory state is a forward initial memory state; the long short-term memory network model may also include: a backward long short-term memory layer, including T neurons, used to convert the forward long short-term memory vector into a T-dimensional backward long short-term memory vector according to the backward initial memory state, and any two neurons in the T neurons are connected; then the second fully connected layer is used to convert the backward long short-term memory vector into a second intermediate vector; the model analysis module may also be used to input the first feature vector into a long short-term memory network model to obtain a first forward long short-term memory vector, and sequentially, update the forward initial memory state and the backward initial memory state of the long short-term memory network model according to the i-1th forward long short-term memory vector and the i-1th backward long short-term memory vector, and input the i-th feature vector into the long short-term memory network model to obtain the i-th forward long short-term memory vector and the i-th backward long short-term memory vector.

[0094] In an exemplary embodiment, S=M+1.

[0095] In an exemplary embodiment, the first fully connected layer and the second fully connected layer may be ReLu activation layers; and the output layer may be a Softmax activation layer.

[0096] In an exemplary embodiment, the model analysis module can also be used to input the first feature vector into a long short-term memory network model to obtain a first long short-term memory vector and a first output vector, and sequentially update the initial memory state of the long short-term memory network model according to the i-1th long short-term memory vector, and input the i-th feature vector into the long short-term memory network model to obtain the i-th long short-term memory vector and the i-th output vector, where i∈[2,N-1]; the result output module can also be used to determine the i-th real vector H according to the i-th feature vector in turn. i , and the i-th real vector H i and the i-1th output vector G i-1Matching is performed, and if the following condition (1) is met, the user behavior prediction is determined to be invalid; if the condition (1) is not met, the behavior prediction result of the user to be predicted is determined according to the output vector, where the output vector is the Nth output vector;

[0097]

[0098] Among them, K is the matching threshold.

[0099] The specific details of the above modules have been described in detail in the embodiments of the method part, so they will not be repeated here.

[0100] Exemplary embodiments of the present disclosure also provide an electronic device capable of implementing the above method.

[0101] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".

[0102] Refer to the following Figure 7 An electronic device 700 according to such an exemplary embodiment of the present disclosure is described below. Figure 7 The electronic device 700 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0103] like Figure 7 As shown, the electronic device 700 is in the form of a general computing device. The components of the electronic device 700 may include, but are not limited to: the at least one processing unit 710, the at least one storage unit 720, a bus 730 connecting different system components (including the storage unit 720 and the processing unit 710), and a display unit 740.

[0104] The storage unit stores program codes, which can be executed by the processing unit 710, so that the processing unit 710 executes the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processing unit 710 can execute Figure 1 Steps S110 to S150 shown in FIG. 1 may also be performed Figure 5 Steps S510 to S570 etc. are shown.

[0105] The storage unit 720 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 721 and / or a cache memory unit 722 , and may further include a read-only memory unit (ROM) 723 .

[0106] The storage unit 720 may also include a program / utility 724 having a set (at least one) of program modules 725, such program modules 725 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0107] Bus 730 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0108] The electronic device 700 may also communicate with one or more external devices 900 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 700, and / or communicate with any device that enables the electronic device 700 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 750. Furthermore, the electronic device 700 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 760. As shown, the network adapter 760 communicates with other modules of the electronic device 700 via a bus 730. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0109] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the exemplary embodiment of the present disclosure.

[0110] The exemplary embodiments of the present disclosure also provide a computer-readable storage medium on which a program product capable of implementing the above-mentioned method of the present specification is stored. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary implementations of the present disclosure described in the above-mentioned "Exemplary Method" section of the present specification.

[0111] refer to Figure 8 As shown, a program product 800 for implementing the above method according to an exemplary embodiment of the present disclosure is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.

[0112] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0113] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0114] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0115] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0116] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0117] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to exemplary embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0118] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.

[0119] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A user behavior prediction method, characterized in that: include: Obtain the behavior data of the user to be predicted in the last N long periods and convert it into N feature vectors with a chronological order; Inputting the first feature vector into a long short-term memory network model to obtain a first long short-term memory vector; Sequentially, the initial memory state of the long short-term memory network model is updated according to the i-1th long short-term memory vector, and the i-th feature vector is input into the long short-term memory network model to obtain the i-th long short-term memory vector, where i∈[2,N-1]; Updating the initial memory state of the long short-term memory network model according to the N-1th long short-term memory vector, and inputting the Nth feature vector into the long short-term memory network model to obtain an output vector; Determine the behavior prediction result of the to-be-predicted user according to the output vector; The step of inputting the first feature vector into a long short-term memory network model to obtain the first long short-term memory vector comprises: inputting the first feature vector into a long short-term memory network model to obtain the first long short-term memory vector and the first output vector; The step of sequentially updating the initial memory state of the long short-term memory network model according to the i-1th long short-term memory vector and inputting the i-th feature vector into the long short-term memory network model to obtain the i-th long short-term memory vector comprises: sequentially updating the initial memory state of the long short-term memory network model according to the i-1th long short-term memory vector and inputting the i-th feature vector into the long short-term memory network model to obtain the i-th long short-term memory vector and the i-th output vector; The method further includes: determining the i-th real vector H according to the i-th feature vector in sequence i , and the i-th real vector H i and the i-1th output vector G i-1 Matching is performed, and a statistical value is obtained by accumulating statistical matching degrees; if the statistical value is less than the matching threshold, it is determined that the user behavior prediction is invalid; if the statistical value is not less than the matching threshold, the step of determining the behavior prediction result of the user to be predicted according to the output vector is executed, wherein the output vector is the Nth output vector.

2. The method according to claim 1, characterized in that The step of obtaining the behavior data of the user to be predicted in the most recent N long periods and converting the behavior data into N feature vectors in a sequential order includes: According to the short cycle, the O types of behavior data of the user to be predicted in the latest N long cycles are counted in sequence, and each long cycle includes M short cycles; The behavior data is converted into N M*O dimensional feature vectors with a sequence.

3. The method according to claim 2, characterized in that The long short-term memory network model at least includes: An input layer, comprising M*O neurons, for inputting the M*O dimensional feature vector; A first fully connected layer, including P neurons, is used to convert the feature vector into a first intermediate vector of P dimension; a long short-term memory layer, comprising Q neurons, configured to convert the first intermediate vector into a Q-dimensional long short-term memory vector according to the initial memory state, wherein any two neurons among the Q neurons are connected; A second fully connected layer, including R neurons, is used to convert the long short-term memory vector into a second intermediate vector of R dimension; The output layer includes S neurons and is used to convert the second intermediate vector into an S-dimensional output vector.

4. The method according to claim 3, characterized in that The long short-term memory layer is a forward long short-term memory layer, the long short-term memory vector is a forward long short-term memory vector, and the initial memory state is a forward initial memory state; The long short-term memory network model also includes: A backward long short-term memory layer, comprising T neurons, for converting the forward long short-term memory vector into a T-dimensional backward long short-term memory vector according to a backward initial memory state, wherein any two neurons among the T neurons are connected; Then the second fully connected layer is used to convert the backward long short-term memory vector into the second intermediate vector; The step of inputting the first feature vector into a long short-term memory network model to obtain the first long short-term memory vector comprises: Inputting the first feature vector into a long short-term memory network model to obtain a first forward long short-term memory vector; The step of sequentially updating the initial memory state of the long short-term memory network model according to the i-1th long short-term memory vector and inputting the i-th feature vector into the long short-term memory network model to obtain the i-th long short-term memory vector comprises: Sequentially, the forward initial memory state and the backward initial memory state of the long short-term memory network model are updated according to the i-1th forward long short-term memory vector and the i-1th backward long short-term memory vector, and the i-th feature vector is input into the long short-term memory network model to obtain the i-th forward long short-term memory vector and the i-th backward long short-term memory vector.

5. The method according to claim 3, characterized in that: S=M+1.

6. The method according to claim 3, characterized in that The first fully connected layer and the second fully connected layer are rectified linear unit ReLu activation layers; the output layer is a normalized exponential function Softmax activation layer.

7. The method according to claim 1, characterized in that The statistical value is less than the matching threshold, including at least one of the following situations: Among them, K is the matching threshold.

8. A user behavior prediction device, characterized in that: include: The data acquisition module is used to obtain the behavior data of the user to be predicted in N long periods and convert it into N feature vectors with a chronological order; A model analysis module, used for inputting a first feature vector into a long short-term memory network model to obtain a first long short-term memory vector, sequentially, updating an initial memory state of the long short-term memory network model according to the i-1th long short-term memory vector, and inputting the i-th feature vector into the long short-term memory network model to obtain the i-th long short-term memory vector, and updating the initial memory state of the long short-term memory network model according to the N-1th long short-term memory vector, and inputting the N-th feature vector into the long short-term memory network model to obtain an output vector, wherein i∈[2,N-1]; A result output module, used to determine the behavior prediction result of the user to be predicted according to the output vector; The step of inputting the first feature vector into a long short-term memory network model to obtain the first long short-term memory vector comprises: inputting the first feature vector into a long short-term memory network model to obtain the first long short-term memory vector and the first output vector; The step of sequentially updating the initial memory state of the long short-term memory network model according to the i-1th long short-term memory vector and inputting the i-th feature vector into the long short-term memory network model to obtain the i-th long short-term memory vector comprises: sequentially updating the initial memory state of the long short-term memory network model according to the i-1th long short-term memory vector and inputting the i-th feature vector into the long short-term memory network model to obtain the i-th long short-term memory vector and the i-th output vector; The result output module is also used to determine the i-th real vector H according to the i-th feature vector in turn. i , and the i-th real vector H i and the i-1th output vector G i-1 Matching is performed, and a statistical value is obtained by accumulating statistical matching degrees; if the statistical value is less than the matching threshold, it is determined that the user behavior prediction is invalid; if the statistical value is not less than the matching threshold, the step of determining the behavior prediction result of the user to be predicted according to the output vector is executed, wherein the output vector is the Nth output vector.

9. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 7 by executing the executable instructions.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Online traditional Chinese medicine text named entity identifying method based on deep learning

    CN106682220A

  • Prediction model training method, data monitoring method and device, equipment and medium

    CN107730087A

  • User behavior prediction method and device and electronic equipment

    CN108305094A