Behavior prediction method and device, computer equipment and storage medium
By dividing the account historical data in time periods and processing characteristics, combined with iterative training of the behavior prediction model, the problem of failure to consider the differences between account behaviors in different times and scenarios in traditional methods is solved, and a higher behavior prediction is achieved accuracy.
Patent Information
- Application Number
- CN202411727168.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-02-11
AI Technical Summary
Traditional behavior prediction methods fail to fully consider the differences between account historical behaviors in different times and scenarios, resulting in low accuracy of behavior prediction.
By dividing the time information of account historical data, account feature samples for multiple historical time periods are obtained, and these samples are input into the behavior prediction model in chronological order, for feature conversion, encoding, combination, attention mechanism and decoding processing , and finally obtain the target behavior prediction model through iterative training.
This method can more accurately predict the behavior information of the account in the target time period, improve the accuracy of behavior prediction, and consider the behavior evolution pattern of the account in different time periods.
Smart Images

Figure CN119416979A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data technology, and in particular to a behavior prediction method, apparatus, computer equipment, storage medium and computer program product. Background Art
[0002] Behavior prediction is an important application in the field of data science and machine learning. It aims to predict the future behavior patterns of accounts by analyzing their historical data. The browsing, clicking and purchasing conversion behaviors of accounts are affected by multiple factors, including personalized recommendations, market trends and account preferences.
[0003] In traditional technologies, account behavior prediction models are often built through algorithms such as decision trees, neural networks, and collaborative filtering to predict the potential behavior of accounts. However, these methods often regard the historical behavior of accounts as static, without considering the differences in behavior at different times and in different scenarios, resulting in low accuracy in behavior prediction. Summary of the invention
[0004] Based on this, it is necessary to provide a behavior prediction method, device, computer equipment, computer-readable storage medium and computer program product that can accurately predict behavior in response to the above technical problems.
[0005] In a first aspect, the present application provides a behavior prediction method. The method comprises:
[0006] According to the time information corresponding to the account historical data, the feature vector of the account historical data is divided to obtain account feature samples corresponding to multiple historical time periods;
[0007] The account feature samples corresponding to each historical time period are input into the behavior prediction model in the time sequence of the historical time periods, so that the account feature samples are sequentially subjected to feature conversion processing, encoding processing, feature combination processing, attention mechanism processing and decoding processing through the behavior prediction model to obtain the predicted behavior information corresponding to each historical time period;
[0008] The behavior prediction model is iteratively trained according to the predicted behavior information corresponding to each historical time period and the historical behavior information corresponding to each historical time period to obtain a trained target behavior prediction model; the target behavior prediction model is used to predict the behavior information of the account in the target time period.
[0009] In one embodiment, the behavior prediction model includes an embedding layer, an encoder, a combination layer, an attention layer, and a decoder; each of the historical time periods also includes a plurality of sub-time periods;
[0010] The behavior prediction model sequentially performs feature conversion processing, encoding processing, feature combination processing, attention mechanism processing and decoding processing on the account feature samples to obtain the predicted behavior information corresponding to each historical time period, including:
[0011] The account feature samples corresponding to each of the sub-time periods are sequentially input into the embedding layer in chronological order, so that the account feature samples corresponding to each of the sub-time periods are converted from a discrete form to a multi-dimensional continuous form through the embedding layer to obtain converted features corresponding to each of the sub-time periods;
[0012] By means of the encoder, the converted features corresponding to each sub-time period are encoded to obtain the encoded features corresponding to each sub-time period;
[0013] Through the combination layer, feature combination processing is performed on the encoded features corresponding to the multiple sub-time periods to obtain the combined features corresponding to each historical time period;
[0014] Through the attention layer, the combined features are processed by the attention mechanism to obtain the attention features corresponding to each historical time period;
[0015] The attention feature is decoded by the decoder to obtain the predicted behavior information corresponding to each historical time period.
[0016] In one embodiment, the attention layer includes an individual attention layer and a common attention layer;
[0017] The attention layer performs attention mechanism processing on the combined features to obtain attention features corresponding to each historical time period, including:
[0018] Input the combined features into the individual attention layer and the common attention layer respectively;
[0019] Through the individual attention layer, the combined features are subjected to feature extraction processing for the behavior scene to obtain attention features for the behavior scene;
[0020] Through the common attention layer, the combined features are subjected to feature extraction processing for common behaviors to obtain attention features for common behaviors.
[0021] In one embodiment, the encoded features corresponding to the multiple sub-time periods are subjected to feature combination processing through the combination layer to obtain the combined features corresponding to each historical time period, including:
[0022] For the account feature sample corresponding to the first historical time period among the multiple historical time periods, input the encoded features corresponding to the multiple sub-time periods into the combination layer to obtain the combined features corresponding to the first historical time period;
[0023] For the account feature samples corresponding to the historical time periods other than the first historical time period in the multiple historical time periods, the attention features for the common behaviors and the encoded features corresponding to the multiple sub-time periods are input into the combination layer to obtain the combined features corresponding to the historical time periods other than the first historical time period.
[0024] In one embodiment, before dividing the feature vector of the account history data according to the time information corresponding to the account history data to obtain account feature samples corresponding to multiple historical time periods, the method further includes:
[0025] Obtain historical account data for different scenarios and time periods;
[0026] Perform feature extraction and data preprocessing on the account history data to obtain a feature vector of the account history data.
[0027] In one embodiment, after iteratively training the behavior prediction model according to the predicted behavior information and the historical behavior information corresponding to each historical time period to obtain a trained target behavior prediction model, the method further includes:
[0028] Obtain the account data of the target account in the target time period;
[0029] The feature vector of the account data is input into the target behavior prediction model to obtain the predicted behavior information corresponding to the target account in the target time period.
[0030] In a second aspect, the present application also provides a behavior prediction device. The device comprises:
[0031] A sample acquisition module, used to divide the feature vectors of the account historical data according to the time information corresponding to the account historical data, and obtain account feature samples corresponding to multiple historical time periods;
[0032] A behavior prediction module is used to input the account feature samples corresponding to each historical time period into the behavior prediction model in the time sequence of the historical time periods, so as to perform feature conversion processing, encoding processing, feature combination processing, attention mechanism processing and decoding processing on the account feature samples in sequence through the behavior prediction model to obtain the predicted behavior information corresponding to each historical time period;
[0033] The model training module is used to iteratively train the behavior prediction model according to the predicted behavior information corresponding to each historical time period and the historical behavior information corresponding to each historical time period to obtain a trained target behavior prediction model; the target behavior prediction model is used to predict the behavior information of the account in the target time period.
[0034] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0035] According to the time information corresponding to the account historical data, the feature vector of the account historical data is divided to obtain account feature samples corresponding to multiple historical time periods;
[0036] The account feature samples corresponding to each historical time period are input into the behavior prediction model in the time sequence of the historical time periods, so that the account feature samples are sequentially subjected to feature conversion processing, encoding processing, feature combination processing, attention mechanism processing and decoding processing through the behavior prediction model to obtain the predicted behavior information corresponding to each historical time period;
[0037] The behavior prediction model is iteratively trained according to the predicted behavior information corresponding to each historical time period and the historical behavior information corresponding to each historical time period to obtain a trained target behavior prediction model; the target behavior prediction model is used to predict the behavior information of the account in the target time period.
[0038] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0039] According to the time information corresponding to the account historical data, the feature vector of the account historical data is divided to obtain account feature samples corresponding to multiple historical time periods;
[0040] The account feature samples corresponding to each historical time period are input into the behavior prediction model in the time sequence of the historical time periods, so that the account feature samples are sequentially subjected to feature conversion processing, encoding processing, feature combination processing, attention mechanism processing and decoding processing through the behavior prediction model to obtain the predicted behavior information corresponding to each historical time period;
[0041] The behavior prediction model is iteratively trained according to the predicted behavior information corresponding to each historical time period and the historical behavior information corresponding to each historical time period to obtain a trained target behavior prediction model; the target behavior prediction model is used to predict the behavior information of the account in the target time period.
[0042] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0043] According to the time information corresponding to the account historical data, the feature vector of the account historical data is divided to obtain account feature samples corresponding to multiple historical time periods;
[0044] The account feature samples corresponding to each historical time period are input into the behavior prediction model in the time sequence of the historical time periods, so that the account feature samples are sequentially subjected to feature conversion processing, encoding processing, feature combination processing, attention mechanism processing and decoding processing through the behavior prediction model to obtain the predicted behavior information corresponding to each historical time period;
[0045] The behavior prediction model is iteratively trained according to the predicted behavior information corresponding to each historical time period and the historical behavior information corresponding to each historical time period to obtain a trained target behavior prediction model; the target behavior prediction model is used to predict the behavior information of the account in the target time period.
[0046] The above-mentioned behavior prediction method, device, computer equipment, storage medium and computer program product divide the feature vector of the account historical data according to the time information corresponding to the account historical data to obtain account feature samples corresponding to multiple historical time periods; the account feature samples corresponding to each historical time period are respectively input into the behavior prediction model according to the time sequence of the historical time periods, so that the account feature samples are sequentially subjected to feature conversion processing, encoding processing, feature combination processing, attention mechanism processing and decoding processing through the behavior prediction model to obtain the predicted behavior information corresponding to each historical time period; the behavior prediction model is iteratively trained according to the predicted behavior information corresponding to each historical time period and the historical behavior information corresponding to each historical time period to obtain the trained target behavior prediction model; the target behavior prediction model is used to predict the behavior information of the account in the target time period. By adopting this method, the behavior prediction model can be trained using the data of the account in different historical time periods, so that the trained target behavior prediction model can fully consider the behavior evolution pattern of the account in different time periods, thereby improving the accuracy of behavior prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1A process environment diagram of a behavior prediction method in one embodiment;
[0048] Figure 2 A schematic diagram of the overall process of a behavior prediction model in one embodiment;
[0049] Figure 3 A schematic diagram of a flow chart of steps for obtaining predicted behavior information corresponding to each historical time period in one embodiment;
[0050] Figure 4 A schematic diagram of the principle of inputting account feature samples corresponding to each historical time period into the embedding layer in chronological order in one embodiment;
[0051] Figure 5 A schematic diagram of the structure of an encoder and a combination layer in a behavior prediction model in one embodiment;
[0052] Figure 6 A schematic diagram of the structure of an attention layer and a decoder in a behavior prediction model in one embodiment;
[0053] Figure 7 A flow chart of a behavior prediction method in another embodiment;
[0054] Figure 8 is a structural block diagram of a behavior prediction device in one embodiment;
[0055] Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0057] It should be noted that the account information (including but not limited to account device information, account personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the account or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0058] In one embodiment, Figure 1 As shown, a behavior prediction method is provided. This embodiment uses the method applied to a terminal as an example for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0059] Step S101 , dividing the feature vectors of the account history data according to the time information corresponding to the account history data, and obtaining account feature samples corresponding to multiple historical time periods.
[0060] Among them, account historical data refers to the account's demands, interactions and other data in the historical time period.
[0061] Specifically, after the account is authorized, the account's historical data is obtained by collecting data from multiple scenarios / channels in the past through legal and compliant channels and methods and in combination with business rules / experience; feature vectors can be extracted from the account's historical data first, and then the feature vectors can be divided according to time information; the account's historical data can also be divided first according to time information, and then feature extraction processing can be performed on the account's historical data corresponding to each historical time period obtained by the division; finally, the feature vector corresponding to each historical time period obtained by the processing is used as an account feature sample.
[0062] Step S102, the account feature samples corresponding to each historical time period are input into the behavior prediction model in the chronological order of the historical time periods, so that the account feature samples are sequentially subjected to feature conversion processing, encoding processing, feature combination processing, attention mechanism processing and decoding processing through the behavior prediction model to obtain the predicted behavior information corresponding to each historical time period.
[0063] Among them, the behavior prediction model refers to a model used to predict the behavior that an account may generate in a target time period. Figure 2 Schematic diagram of the overall process of the behavior prediction model.
[0064] Step S103, iteratively train the behavior prediction model according to the predicted behavior information corresponding to each historical time period and the historical behavior information corresponding to each historical time period to obtain a trained target behavior prediction model; the target behavior prediction model is used to predict the behavior information of the account in the target time period.
[0065] Specifically, in the training process of the behavior prediction model, only one account feature sample corresponding to a historical time period is input in each round; through the behavior prediction model, the account feature sample is sequentially subjected to feature conversion processing, encoding processing, feature combination processing, attention mechanism processing and decoding processing to obtain the predicted behavior information corresponding to each historical time period. Then, according to the predicted behavior information corresponding to each historical time period and the historical behavior information corresponding to each historical time period, the loss value is calculated, and the model parameters of the behavior prediction model are updated using the loss value to obtain the updated behavior prediction model. In the next round, the account feature sample corresponding to the next historical time period is input into the behavior prediction model, so that the behavior prediction model sequentially performs feature conversion processing, encoding processing, feature combination processing, attention mechanism processing and decoding processing to obtain the predicted behavior information corresponding to each historical time period. The target behavior prediction model finally trained can learn the behavior information of the account in different scenarios and different time periods, extract the commonality and individuality information of the account behavior pattern, and better predict the personalized needs of the account in different scenarios, thereby improving the accuracy of behavior prediction.
[0066] In the above behavior prediction method, the feature vector of the account historical data is divided according to the time information corresponding to the account historical data to obtain account feature samples corresponding to multiple historical time periods; the account feature samples corresponding to each historical time period are respectively input into the behavior prediction model in the time order of the historical time periods, so that the account feature samples are sequentially subjected to feature conversion processing, encoding processing, feature combination processing, attention mechanism processing and decoding processing through the behavior prediction model to obtain the predicted behavior information corresponding to each historical time period; the behavior prediction model is iteratively trained according to the predicted behavior information corresponding to each historical time period and the historical behavior information corresponding to each historical time period to obtain the trained target behavior prediction model; the target behavior prediction model is used to predict the behavior information of the account in the target time period. By adopting this method, the data of the account in different historical time periods can be used to train the behavior prediction model, so that the trained target behavior prediction model can fully consider the behavior evolution pattern of the account in different time periods, thereby improving the accuracy of behavior prediction.
[0067] In one embodiment, the behavior prediction model includes an embedding layer, an encoder, a combination layer, an attention layer, and a decoder; each historical time period also includes multiple sub-time periods. Figure 3 As shown, in the above step S102, the account feature samples are sequentially subjected to feature conversion processing, encoding processing, feature combination processing, attention mechanism processing and decoding processing through the behavior prediction model to obtain the predicted behavior information corresponding to each historical time period, which specifically includes the following contents:
[0068] Step S301, the account feature samples corresponding to each sub-time period are input into the embedding layer in chronological order, so that the account feature samples corresponding to each sub-time period are converted from discrete form to multi-dimensional continuous form through the embedding layer to obtain the converted features corresponding to each sub-time period.
[0069] Figure 4 The schematic diagram is a principle diagram for inputting the account feature samples corresponding to each historical time period into the embedding layer in chronological order. Specifically, the account feature samples corresponding to each historical time period are input into the embedding layer of the behavior prediction model in batches in each round of training according to chronological order, such as Figure 4 As shown, in the first round, the account feature samples corresponding to the historical time period T0 are input, in the second round, the account feature samples corresponding to the historical time period T1 are input, and so on, in the m+1th round, the account feature samples corresponding to the historical time period T m Corresponding account feature samples. In addition, each historical time period can be further subdivided into multiple sub-time periods, and the account feature samples corresponding to each sub-time period are input into the embedding layer of the behavior prediction model in chronological order. Then, through the embedding layer, the account feature samples are converted from discrete forms (such as text, discrete data, etc.) to multi-dimensional continuous vector forms; then the account feature samples in the form of multi-dimensional continuous vectors and account feature samples are spliced and processed to output the converted features corresponding to each sub-time period.
[0070] It should be noted that compared with account feature samples in discrete form, account feature samples in the form of multi-dimensional continuous vectors are more conducive to the training and learning of current behavior prediction models.
[0071] Step S302: encoding the converted features corresponding to each sub-time period through an encoder to obtain the encoded features corresponding to each sub-time period.
[0072] Figure 5 The diagram is a structural diagram of the encoder and combination layer in the behavior prediction model. Specifically, according to the time sequence of each sub-time period, the converted features corresponding to each sub-time period are sequentially input into the encoder in the behavior prediction model; for example, the converted features corresponding to sub-time period t0 are input into encoder 1, the converted features corresponding to sub-time period t1 are input into encoder 2, the converted features corresponding to sub-time period t2 are input into encoder 3, and so on. Through each encoder, the converted features corresponding to each sub-time period are independently processed, and then each encoder outputs the encoded features to obtain the encoded features corresponding to all sub-time periods in the historical time period.
[0073] In addition, in the process of training the model using account feature samples corresponding to historical time periods other than the first historical time period in multiple historical time periods, the account feature samples of the previous historical time period can be used as additional supplementary information and input into the encoder together with the account feature samples of the current historical time period for encoding processing, so that the behavior prediction model can better learn the data residuals between account features.
[0074] Step S303, performing feature combination processing on the encoded features corresponding to the multiple sub-time periods through the combination layer, to obtain the combined features corresponding to each historical time period.
[0075] Specifically, Figure 5 As shown, the encoded features corresponding to all sub-time periods in the historical time period are input into the combination layer in the behavior prediction model, so that the encoded features corresponding to all sub-time periods in the historical time period are combined through the combination layer to obtain the combined features corresponding to the historical time period. By combining the encoded features corresponding to different sub-time periods together, the behavior prediction model can mine the associations between different scenarios through the combined features during training.
[0076] Step S304, through the attention layer, the combined features are processed by the attention mechanism to obtain the attention features corresponding to each historical time period.
[0077] Figure 6 It is a structural diagram of the attention layer and decoder in the behavior prediction model. Specifically, the behavior prediction model contains at least two attention layers, namely the individual attention layer and the common attention layer. Among them, the common attention layer is used to mine the common behavioral characteristics of accounts in different time periods and different scenarios. The individual attention layer is used to mine the personalized needs / identity characteristics of accounts in different time periods and different scenarios. The terminal inputs the combined features into the individual attention layer and the common attention layer respectively, and obtains the attention features output by the individual attention layer and the attention features output by the common attention layer respectively.
[0078] Step S305: decode the attention features through a decoder to obtain the predicted behavior information corresponding to each historical time period.
[0079] Specifically, Figure 6 As shown, the attention features for common behaviors output by the common attention layer and the attention features for behavior scenarios output by the individual attention layer are respectively input into different decoders to decode the predicted behavior information corresponding to the attention features for common behaviors and the predicted behavior information corresponding to the attention features for behavior scenarios. The predicted behavior information corresponding to the attention features for behavior scenarios is used as the predicted behavior information corresponding to this round of historical time periods.
[0080] Among them, the predicted behavior information may include the predicted probabilities for different behaviors, such as Figure 6 Channel purchasing behavior prediction A, channel purchasing behavior prediction B, and channel purchasing behavior prediction C are shown in the figure.
[0081] In this embodiment, the input data is processed differently through the embedding layer, encoder, combination layer, attention layer and decoder in the behavior prediction model, so that the behavior prediction model can learn multi-faceted and multi-angle information of the account, thereby improving the training effect of the behavior prediction model, so that the trained target behavior prediction model can more comprehensively consider the behavior evolution pattern of the account in different time periods, thereby improving the accuracy of behavior prediction, and also helping to improve the richness and comprehensiveness of the predicted behavior information.
[0082] In one embodiment, the attention layer includes a personal attention layer and a common attention layer. The above step S304, through the attention layer, performs attention mechanism processing on the combined features to obtain the attention features corresponding to each historical time period, specifically including the following contents: inputting the combined features into the personal attention layer and the common attention layer respectively; performing feature extraction processing on the combined features for the behavior scene through the personal attention layer to obtain the attention features for the behavior scene; performing feature extraction processing on the combined features for the common behavior through the common attention layer to obtain the attention features for the common behavior.
[0083] Specifically, the terminal inputs the combined features into the individual attention layer and the common attention layer respectively. Through the individual attention layer, the combined features are processed for the attention features of the account's behavior scenarios to extract the attention features for the behavior scenarios; wherein the attention features for the behavior scenarios represent the personalized features of the account, that is, the personalized needs or identity features of the account in different scenarios, and provide the personalized information of the account for the behavior prediction model to perform behavior prediction. Through the common attention layer, the combined features are processed for feature extraction of the common behaviors of the account in different time periods to obtain the attention features for the common behaviors; wherein the attention features for the common behaviors represent the common behavioral characteristics of the account, which are used to help the behavior prediction model understand the common behavior of the account, learn the behavioral characteristics of the entire process of the account, and reflect the behavior pattern of the account as a whole.
[0084] In this embodiment, the common behavior characteristics and individual behavior characteristics of the account at different times and in different scenarios are fully explored through the individual attention layer and the common attention layer, so that the behavior prediction model can comprehensively learn the evolution patterns of the account's behavior and needs at different times, thereby improving the behavior prediction accuracy of the trained target behavior prediction model.
[0085] In one embodiment, the above step S303, through the combination layer, performs feature combination processing on the encoded features corresponding to multiple sub-time periods to obtain the combined features corresponding to each historical time period, specifically including the following contents: for the account feature samples corresponding to the first historical time period among the multiple historical time periods, the encoded features corresponding to the multiple sub-time periods are input into the combination layer to obtain the combined features corresponding to the first historical time period; for the account feature samples corresponding to the historical time periods other than the first historical time period among the multiple historical time periods, the attention features for the general behavior and the encoded features corresponding to the multiple sub-time periods are input into the combination layer to obtain the combined features corresponding to the historical time periods other than the first historical time period.
[0086] Specifically, Figure 5 As shown, there are differences in the input data in the combination layer for the first round of training and subsequent rounds of training of the behavior prediction model. For the first round of training of the behavior prediction model, the encoded features corresponding to the multiple sub-time periods output by the combination layer are input into the combination layer to obtain the combined features corresponding to the first historical time period. For subsequent rounds of training of the behavior prediction model, the predicted behavior information output by the previous round of decoder based on the attention features of the general behavior and the encoded features corresponding to the multiple sub-time periods output by the combination layer are input into the combination layer together to obtain the combined features corresponding to the historical time period.
[0087] In this embodiment, different input data are used in the combination layer for the first round of training and subsequent rounds of training of the behavior prediction model, which enables the behavior prediction model to learn the behavior information of the previous time period and the common information of the behavior information, so as to assist the behavior prediction model to make more accurate behavior decisions in this round, thereby greatly improving the accuracy of behavior prediction of the trained target behavior prediction model.
[0088] In one embodiment, in the above step S101, before dividing the feature vector of the account historical data according to the time information corresponding to the account historical data to obtain the account feature samples corresponding to multiple historical time periods, it also includes: obtaining the account historical data of the account in different scenarios and different historical time periods; performing feature extraction processing and data preprocessing on the account historical data to obtain the feature vector of the account historical data.
[0089] The account history data may be in various formats such as text and data.
[0090] Specifically, the terminal can collect the account history data of the account in different scenarios and different historical time periods, and then perform feature extraction processing on the account history data to obtain account feature data. Then, the account feature data is preprocessed, such as dirty data removal processing, missing value processing, etc., and the data obtained after preprocessing is used as the feature vector of the account history data.
[0091] In this embodiment, by dividing the account historical data into time periods, the behavior prediction model can fully understand the behavior change characteristics of the account in different historical time periods during the learning process, thereby improving the performance of the behavior prediction model. Feature extraction processing and data preprocessing are also used to improve the data quality of the feature vector used to train the model, thereby further improving the training effect of the behavior prediction model, thereby greatly improving the model performance of the trained target behavior prediction model.
[0092] In one embodiment, in the above step S103, the behavior prediction model is iteratively trained according to the predicted behavior information corresponding to each historical time period and the historical behavior information corresponding to each historical time period to obtain the trained target behavior prediction model, and it also includes: obtaining the account data of the target account in the target time period; inputting the feature vector of the account data into the target behavior prediction model to obtain the predicted behavior information corresponding to the target account in the target time period.
[0093] Specifically, if you want to predict the behavior of the selected target account, after the authorization of the target account, you can collect the account data of the target account in the target time period in a legal and compliant manner; then perform feature extraction and data preprocessing on the account data to obtain the feature vector of the account data. The feature vector of the account data is input into the target behavior prediction model, so that the feature vector is subjected to feature conversion processing, encoding processing, feature combination processing, attention mechanism processing and decoding processing through the target behavior prediction model, and finally, through the decoder in the target behavior prediction model, based on the attention features for the behavior scenario output by the individual attention layer, the predicted behavior information corresponding to the target account in the target time period is predicted. Furthermore, corresponding products can be recommended to the target account based on the predicted behavior information.
[0094] In this embodiment, the target behavior prediction model is used to predict the behavior of the target account's account data in the target time period, so that the potential personalized needs of the target account can be accurately predicted, which not only improves the accuracy of the behavior prediction, but also improves the richness of the behavior prediction.
[0095] In one embodiment, Figure 7 As shown, another behavior prediction method is provided, which is described by taking the method applied to a terminal as an example, and includes the following steps:
[0096] Step S701 , dividing the feature vector of the account historical data according to the time information corresponding to the account historical data, and obtaining account feature samples corresponding to multiple historical time periods; each historical time period also includes multiple sub-time periods.
[0097] Step S702, the account feature samples corresponding to each sub-time period are input into the embedding layer in chronological order, so that the account feature samples corresponding to each sub-time period are converted from discrete form to multi-dimensional continuous form through the embedding layer to obtain the converted features corresponding to each sub-time period.
[0098] Step S703: encoding the converted features corresponding to each sub-time period through an encoder to obtain the encoded features corresponding to each sub-time period.
[0099] Step S704, performing feature combination processing on the encoded features corresponding to the multiple sub-time periods through the combination layer to obtain the combined features corresponding to each historical time period.
[0100] Step S705, through the attention layer, the combined features are processed by the attention mechanism to obtain the attention features corresponding to each historical time period.
[0101] Step S706: The attention features are decoded through a decoder to obtain predicted behavior information corresponding to each historical time period.
[0102] Step S707, iteratively training the behavior prediction model according to the predicted behavior information corresponding to each historical time period and the historical behavior information corresponding to each historical time period to obtain a trained target behavior prediction model.
[0103] Step S708, obtaining the account data of the target account in the target time period.
[0104] Step S709: input the feature vector of the account data into the target behavior prediction model to obtain the predicted behavior information corresponding to the target account in the target time period.
[0105] The above-mentioned behavior prediction method can achieve the following beneficial effects: it can use the data of the account in different historical time periods to train the behavior prediction model, so that the trained target behavior prediction model can fully consider the behavior evolution pattern of the account in different time periods, thereby improving the accuracy of behavior prediction.
[0106] In order to more clearly illustrate the behavior prediction method provided by the embodiment of the present disclosure, the above behavior prediction method is specifically described below with a specific embodiment. Another behavior prediction method is provided, which can be applied to a terminal, and specifically includes the following contents:
[0107] like Figure 2 As shown, firstly, the data of multiple scenarios / channels in the past of the account are collected in combination with business rules / experience, and the data are divided according to time; then, the characteristic information of each scenario / channel is extracted according to the business characteristics, including text, data, etc., and data preprocessing is performed, mainly including dirty data and missing value processing; then, the discrete features of each scenario / touch point are input into the embedding layer in the behavior prediction model, and then the discrete features are converted into multi-dimensional continuous vectors through the embedding layer, and the original continuous features are spliced to form complete input data, and then the input data is divided according to time periods and input into the encoder in the behavior prediction model respectively; the output data of each encoder is combined, and the combined data of different scenarios are input into the attention layer in the behavior prediction model respectively, and the common and individual information in the input data are learned respectively. For the output of the individual attention layer, the decoder in the behavior prediction model predicts the purchase behavior of multiple scenarios / channels in the corresponding time period, and learns the diverse identity and needs of the account. For the output of the common attention layer, it will be used as the pre-data and input into the behavior prediction model of the next time period, so that the model can learn the common pattern of temporal behavior and the information extracted in the previous time period that can assist the current decision-making. Finally, the target behavior prediction model is obtained through training, and the target behavior prediction model can be used to perform real-time or offline behavior prediction processing for the account.
[0108] In this embodiment, the historical behavior information of the account is used to comprehensively model the needs of different scenarios, and fully explore the potential personalized needs of the account at different time nodes and scenarios. On the one hand, compared with the general static single-scenario recommendation model, this application takes into account the behavior and needs of the account in different scenarios; on the other hand, compared with the multi-scenario recommendation model of the scenario, the historical behavior information of the account is taken into account to fully explore the user's behavior evolution pattern; on the other hand, the feature information of multiple scenarios / channels in the historical information is used to model the account information, which improves the accuracy of model learning and the richness of the prediction results.
[0109] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0110] Based on the same inventive concept, the embodiment of the present application also provides a behavior prediction device for implementing the behavior prediction method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more behavior prediction device embodiments provided below can refer to the limitations on the behavior prediction method above, and will not be repeated here.
[0111] In one embodiment, Figure 8 As shown, a behavior prediction device 800 is provided, comprising: a sample acquisition module 801, a behavior prediction module 802 and a model training module 803, wherein:
[0112] The sample acquisition module 801 is used to divide the feature vectors of the account history data according to the time information corresponding to the account history data, and obtain account feature samples corresponding to multiple historical time periods.
[0113] The behavior prediction module 802 is used to input the account feature samples corresponding to each historical time period into the behavior prediction model in the chronological order of the historical time periods, so as to perform feature conversion processing, encoding processing, feature combination processing, attention mechanism processing and decoding processing on the account feature samples in sequence through the behavior prediction model to obtain the predicted behavior information corresponding to each historical time period.
[0114] The model training module 803 is used to iteratively train the behavior prediction model according to the predicted behavior information corresponding to each historical time period and the historical behavior information corresponding to each historical time period to obtain a trained target behavior prediction model; the target behavior prediction model is used to predict the behavior information of the account in the target time period.
[0115] In one embodiment, the behavior prediction model includes an embedding layer, an encoder, a combination layer, an attention layer, and a decoder; each historical time period also includes multiple sub-time periods. The behavior prediction module 802 is also used to input the account feature samples corresponding to each sub-time period into the embedding layer in chronological order, so as to convert the account feature samples corresponding to each sub-time period from a discrete form to a multi-dimensional continuous form through the embedding layer to obtain the converted features corresponding to each sub-time period; through the encoder, the converted features corresponding to each sub-time period are encoded to obtain the encoded features corresponding to each sub-time period; through the combination layer, the encoded features corresponding to multiple sub-time periods are combined to obtain the combined features corresponding to each historical time period; through the attention layer, the combined features are processed by the attention mechanism to obtain the attention features corresponding to each historical time period; through the decoder, the attention features are decoded to obtain the predicted behavior information corresponding to each historical time period.
[0116] In one embodiment, the attention layer includes a personal attention layer and a common attention layer. The behavior prediction device 800 also includes an attention processing module, which is used to input the combined features into the personal attention layer and the common attention layer respectively; through the personal attention layer, the combined features are subjected to feature extraction processing for the behavior scene to obtain the attention features for the behavior scene; through the common attention layer, the combined features are subjected to feature extraction processing for the common behavior to obtain the attention features for the common behavior.
[0117] In one embodiment, the behavior prediction device 800 also includes a feature combination module, which is used to input the encoded features corresponding to multiple sub-time periods into the combination layer for the account feature samples corresponding to the first historical time period among the multiple historical time periods, so as to obtain the combined features corresponding to the first historical time period; for the account feature samples corresponding to the historical time periods other than the first historical time period among the multiple historical time periods, the attention features for the common behaviors and the encoded features corresponding to the multiple sub-time periods are input into the combination layer, so as to obtain the combined features corresponding to the historical time periods other than the first historical time period.
[0118] In one embodiment, the behavior prediction device 800 further includes a feature extraction module for obtaining account history data of an account in different scenarios and different historical time periods; performing feature extraction processing and data preprocessing on the account history data to obtain a feature vector of the account history data.
[0119] In one embodiment, the behavior prediction device 800 also includes a data acquisition module for acquiring account data of the target account in the target time period; inputting the feature vector of the account data into the target behavior prediction model to obtain the predicted behavior information corresponding to the target account in the target time period.
[0120] Each module in the above-mentioned behavior prediction device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0121] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 8As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a behavior prediction method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0122] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0123] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0124] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0125] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0126] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0127] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0128] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A behavior prediction method, characterized in that: The method comprises: According to the time information corresponding to the account historical data, the feature vector of the account historical data is divided to obtain account feature samples corresponding to multiple historical time periods; The account feature samples corresponding to each historical time period are input into the behavior prediction model in the time sequence of the historical time periods, so that the account feature samples are sequentially subjected to feature conversion processing, encoding processing, feature combination processing, attention mechanism processing and decoding processing through the behavior prediction model to obtain the predicted behavior information corresponding to each historical time period; The behavior prediction model is iteratively trained according to the predicted behavior information corresponding to each historical time period and the historical behavior information corresponding to each historical time period to obtain a trained target behavior prediction model; the target behavior prediction model is used to predict the behavior information of the account in the target time period.
2. The method according to claim 1, characterized in that The behavior prediction model includes an embedding layer, an encoder, a combination layer, an attention layer and a decoder; each historical time period also includes multiple sub-time periods; The behavior prediction model sequentially performs feature conversion processing, encoding processing, feature combination processing, attention mechanism processing and decoding processing on the account feature samples to obtain the predicted behavior information corresponding to each historical time period, including: The account feature samples corresponding to each of the sub-time periods are sequentially input into the embedding layer in chronological order, so that the account feature samples corresponding to each of the sub-time periods are converted from a discrete form to a multi-dimensional continuous form through the embedding layer to obtain converted features corresponding to each of the sub-time periods; By means of the encoder, encoding is performed on the converted features corresponding to each sub-time period to obtain the encoded features corresponding to each sub-time period; Through the combination layer, feature combination processing is performed on the encoded features corresponding to the multiple sub-time periods to obtain the combined features corresponding to each historical time period; Through the attention layer, the combined features are processed by the attention mechanism to obtain the attention features corresponding to each historical time period; The attention feature is decoded by the decoder to obtain the predicted behavior information corresponding to each historical time period.
3. The method according to claim 2, characterized in that The attention layer includes an individual attention layer and a common attention layer; The attention layer performs attention mechanism processing on the combined features to obtain the attention features corresponding to each historical time period, including: Input the combined features into the individual attention layer and the common attention layer respectively; Through the individual attention layer, the combined features are subjected to feature extraction processing for the behavior scene to obtain attention features for the behavior scene; Through the common attention layer, the combined features are subjected to feature extraction processing for common behaviors to obtain attention features for common behaviors.
4. The method according to claim 3, characterized in that The step of performing feature combination processing on the encoded features corresponding to the multiple sub-time periods through the combination layer to obtain the combined features corresponding to each historical time period includes: For the account feature sample corresponding to the first historical time period among the multiple historical time periods, input the encoded features corresponding to the multiple sub-time periods into the combination layer to obtain the combined features corresponding to the first historical time period; For the account feature samples corresponding to the historical time periods other than the first historical time period in the multiple historical time periods, the attention features for the common behaviors and the encoded features corresponding to the multiple sub-time periods are input into the combination layer to obtain the combined features corresponding to the historical time periods other than the first historical time period.
5. The method according to claim 1, characterized in that Before dividing the feature vector of the account historical data according to the time information corresponding to the account historical data to obtain account feature samples corresponding to multiple historical time periods, the method further includes: Obtain historical account data for different scenarios and time periods; Perform feature extraction and data preprocessing on the account history data to obtain a feature vector of the account history data.
6. The method according to any one of claims 1 to 5, characterized in that: After iteratively training the behavior prediction model according to the predicted behavior information corresponding to each historical time period and the historical behavior information corresponding to each historical time period to obtain a trained target behavior prediction model, the method further includes: Obtain the account data of the target account in the target time period; The feature vector of the account data is input into the target behavior prediction model to obtain the predicted behavior information corresponding to the target account in the target time period.
7. A behavior prediction device, characterized in that: The device comprises: A sample acquisition module, used to divide the feature vectors of the account historical data according to the time information corresponding to the account historical data, and obtain account feature samples corresponding to multiple historical time periods; A behavior prediction module is used to input the account feature samples corresponding to each historical time period into the behavior prediction model in the time sequence of the historical time periods, so as to perform feature conversion processing, encoding processing, feature combination processing, attention mechanism processing and decoding processing on the account feature samples in sequence through the behavior prediction model to obtain the predicted behavior information corresponding to each historical time period; The model training module is used to iteratively train the behavior prediction model according to the predicted behavior information corresponding to each historical time period and the historical behavior information corresponding to each historical time period to obtain a trained target behavior prediction model; the target behavior prediction model is used to predict the behavior information of the account in the target time period.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.