User type determination method and apparatus, computer device, and storage medium
By converting user transaction data into time-series features through feature extraction algorithms and standard data formats, and combining this with a temporal convolutional neural network model, the problem of low prediction accuracy in traditional machine learning models is solved, enabling high-precision identification of abnormal transaction behavior.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INDUSTRIAL AND COMMERCIAL BANK OF CHINA
- Filing Date
- 2023-09-27
- Publication Date
- 2026-05-01
AI Technical Summary
In existing technologies, traditional machine learning models built using derived variables have low prediction accuracy when used to identify abnormal trading behavior. This is because the features of derived variables have low dimensionality, and the features mined are only superficial and cannot effectively identify abnormal trading behavior of users.
Using a pre-defined feature extraction algorithm and standard data format, the transaction time-series features of users are extracted and transformed, and then input into a pre-trained user type prediction model. A temporal convolutional neural network is used to predict user types, and the model parameters are optimized through a loss function to improve prediction accuracy.
By extracting users' implicit features and arranging them by time, a feature sequence with a time dimension is generated, which significantly improves the prediction accuracy of abnormal users and can more accurately identify abnormal transaction behavior.
Smart Images

Figure CN117272108B_ABST
Abstract
Description
User type determination method, apparatus, computer equipment, and storage medium Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a user type determination method, apparatus, computer device, storage medium, and computer program product. Background Technology
[0002] In recent years, with economic development, the number and amount of user transactions have increased year by year. At the same time, the number of users exhibiting abnormal behavior during transactions has also gradually increased, including fraudulent activities. Therefore, it is necessary to identify which users exhibit abnormal transaction behavior. Since users have specific behavioral patterns during transactions, feature extraction can be used to identify whether users exhibit abnormal transaction behavior.
[0003] In related technologies, abnormal trading behavior is identified by constructing traditional machine learning models using derived variables. However, the construction of derived variables is based on human experience to extract information from data. The features of derived variables have low dimensionality, and the features mined are only surface-level features of the data, resulting in low prediction accuracy of machine learning models based on these features. Summary of the Invention
[0004] Therefore, it is necessary to provide a user type determination method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve prediction accuracy in response to the above-mentioned technical problems.
[0005] Firstly, this application provides a method for determining user type, including:
[0006] Obtain the target transaction data of the user to be tested;
[0007] Based on a preset feature extraction algorithm and a standard data format, the transaction time sequence features corresponding to the target transaction data are determined. The transaction time sequence features include fixed-length feature data of the user to be detected.
[0008] The transaction time-series features of the user to be detected are input into the trained user type prediction model to obtain the type prediction result of the user type prediction model, and the user type of the user to be detected is determined based on the type prediction result.
[0009] In one embodiment, obtaining the target transaction data of the user to be detected includes:
[0010] Obtain the initial transaction data of the user to be tested within a preset time range;
[0011] Based on preset data filtering conditions, the initial transaction data of the user to be detected within a preset time range is filtered to obtain target transaction data containing the target field.
[0012] In one embodiment, determining the transaction time-series features corresponding to the target transaction data based on a preset feature extraction algorithm and a data standard format includes:
[0013] Perform statistical processing on the target transaction data to obtain the derived fields corresponding to the target transaction data;
[0014] Based on a preset feature extraction algorithm, feature extraction processing is performed on the data corresponding to the derived fields and the target transaction data to obtain initial transaction features;
[0015] The time period corresponding to each sequence number is determined by the sequence number and preset total duration contained in the data standard format;
[0016] Based on the time period corresponding to each sequence number, target transaction features that conform to the time period are determined from the initial transaction features, and the target transaction features corresponding to each sequence number are merged to obtain the transaction time sequence features corresponding to the target transaction data.
[0017] In one embodiment, the type prediction result includes a user anomaly probability value; determining the user type of the user to be detected based on the type prediction result includes:
[0018] If the user anomaly probability value included in the type prediction result matches the preset threshold range, then the user type of the user to be detected is determined to be an abnormal user with abnormal transaction behavior.
[0019] The transaction activity of the user to be detected is closed.
[0020] In one embodiment, the method further includes:
[0021] Obtain a sample training set, which includes the sample transaction time sequence features of each sample user within a preset time period and the sample user type of each sample user;
[0022] The user anomaly prediction value corresponding to each of the sample users is obtained by using the user type prediction model to be trained and the sample transaction time sequence characteristics of each sample user.
[0023] Based on the sample user type of each sample user and the user anomaly prediction value of each sample user, calculate the loss function;
[0024] If it is determined that the user type prediction model to be trained does not meet the training completion conditions, the parameters of the user type prediction model to be trained are updated based on the loss function, and the step of predicting using the user type prediction model to be trained and the sample transaction time series features of each sample user is re-executed until a trained user type prediction model is obtained.
[0025] In one embodiment, obtaining the sample training set includes:
[0026] Based on preset data filtering conditions, the initial sample transaction data of each sample user within a preset time range is filtered to obtain target sample transaction data containing the target field.
[0027] Statistical processing is performed on the target sample transaction data to obtain the derived fields corresponding to the target sample transaction data. Based on a preset feature extraction algorithm, feature extraction processing is performed on the data corresponding to the derived fields and the target sample transaction data to obtain the initial sample transaction features.
[0028] By using the sequence number and preset total duration included in the data standard format, the time period corresponding to each sequence number is determined. Based on the time period corresponding to each sequence number, the target sample transaction features that conform to the time period are determined in the initial sample transaction features. The target sample transaction features corresponding to each sequence number are then merged to obtain the transaction time sequence features corresponding to the target sample transaction data.
[0029] The sample training set is obtained by matching the sample user type of each of the preset sample users with the transaction time sequence features corresponding to each sample user.
[0030] Secondly, this application also provides a user type determination device, comprising:
[0031] The transaction data acquisition module is used to acquire the target transaction data of the user to be detected;
[0032] The time-series feature determination module is used to determine the transaction time-series features corresponding to the target transaction data based on a preset feature extraction algorithm and a data standard format. The transaction time-series features include fixed-length feature data of the user to be detected.
[0033] The user type determination module is used to input the transaction time sequence features of the user to be detected into the trained user type prediction model, obtain the type prediction result of the user type prediction model, and determine the user type of the user to be detected based on the type prediction result.
[0034] In one embodiment, the transaction data acquisition module is specifically used to: acquire the initial transaction data of the user to be detected within a preset time range; and filter the initial transaction data of the user to be detected within the preset time range based on preset data filtering conditions to obtain target transaction data containing the target field.
[0035] In one embodiment, the timing feature determination module is specifically used for:
[0036] Perform statistical processing on the target transaction data to obtain the derived fields corresponding to the target transaction data;
[0037] Based on a preset feature extraction algorithm, feature extraction processing is performed on the data corresponding to the derived fields and the target transaction data to obtain initial transaction features;
[0038] The time period corresponding to each sequence number is determined by the sequence number and preset total duration contained in the data standard format;
[0039] Based on the time period corresponding to each sequence number, target transaction features that conform to the time period are determined from the initial transaction features, and the target transaction features corresponding to each sequence number are merged to obtain the transaction time sequence features corresponding to the target transaction data.
[0040] In one embodiment, the type prediction result includes a user anomaly probability value, and the user type determination module is specifically used for:
[0041] If the user anomaly probability value included in the type prediction result matches the preset threshold range, then the user type of the user to be detected is determined to be an abnormal user with abnormal transaction behavior.
[0042] The transaction activity of the user to be detected is closed.
[0043] In one embodiment, the apparatus further includes a model training module, specifically used for:
[0044] Obtain a sample training set, which includes the sample transaction time sequence features of each sample user within a preset time period and the sample user type of each sample user;
[0045] The user anomaly prediction value corresponding to each of the sample users is obtained by using the user type prediction model to be trained and the sample transaction time sequence characteristics of each sample user.
[0046] Based on the sample user type of each sample user and the user anomaly prediction value of each sample user, calculate the loss function;
[0047] If it is determined that the user type prediction model to be trained does not meet the training completion conditions, the parameters of the user type prediction model to be trained are updated based on the loss function, and the step of predicting using the user type prediction model to be trained and the sample transaction time series features of each sample user is re-executed until a trained user type prediction model is obtained.
[0048] In one embodiment, the apparatus further includes a sample training set acquisition module, specifically used for:
[0049] Based on preset data filtering conditions, the initial sample transaction data of each sample user within a preset time range is filtered to obtain target sample transaction data containing the target field.
[0050] Statistical processing is performed on the target sample transaction data to obtain the derived fields corresponding to the target sample transaction data. Based on a preset feature extraction algorithm, feature extraction processing is performed on the data corresponding to the derived fields and the target sample transaction data to obtain the initial sample transaction features.
[0051] By using the sequence number and preset total duration included in the data standard format, the time period corresponding to each sequence number is determined. Based on the time period corresponding to each sequence number, the target sample transaction features that conform to the time period are determined in the initial sample transaction features. The target sample transaction features corresponding to each sequence number are then merged to obtain the transaction time sequence features corresponding to the target sample transaction data.
[0052] The sample training set is obtained by matching the sample user type of each of the preset sample users with the transaction time sequence features corresponding to each sample user.
[0053] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method described in the first aspect.
[0054] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the method described in the first aspect.
[0055] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps of the method as described in the first aspect.
[0056] The aforementioned user type determination method, apparatus, computer equipment, storage medium, and computer program product involve a server acquiring target transaction data of the user to be detected from all transaction data of the user to be detected. A feature extraction algorithm extracts transaction features from the target transaction data, and the transaction features are further converted into transaction time-series features of the target transaction data using a standard data format. Based on this, the transaction time-series features are input into a trained user type prediction model. The user type prediction model can calculate the type prediction result corresponding to the transaction time-series features, and the user type can be determined based on the type prediction result. By using this method, the user type of the user to be detected can be determined based on the target transaction data and the user type prediction model, thereby enabling the implementation of restrictive measures against that user. The feature extraction algorithm can extract the implicit features of the target transaction data, and the standard data format can arrange the implicit features according to time, thus obtaining a feature sequence with a time dimension. Therefore, the user type predicted using this method has higher accuracy, thereby improving the prediction accuracy of the prediction model for abnormal users with abnormal transaction behavior. Attached Figure Description
[0057] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0058] Figure 1 is an application environment diagram of a user type determination method in one embodiment;
[0059] Figure 2 is a flowchart illustrating a user type determination method in one embodiment;
[0060] Figure 3 is a flowchart illustrating the steps for obtaining target transaction data in one embodiment;
[0061] Figure 4 is a flowchart illustrating the steps for determining transaction timing characteristics in one embodiment;
[0062] Figure 5 is a flowchart illustrating the steps for determining the user type in one embodiment;
[0063] Figure 6 is a flowchart illustrating the steps of training a user type prediction model in one embodiment;
[0064] Figure 7 is a flowchart illustrating the steps for obtaining a sample training set in one embodiment;
[0065] Figure 8 is a schematic diagram of the structure of a temporal convolutional neural network in one embodiment;
[0066] Figure 9 is a structural block diagram of a user type determination device in one embodiment;
[0067] Figure 10 is an internal structure diagram of a computer device in one embodiment. Detailed Implementation
[0068] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0069] The user type determination method provided in this application embodiment can be applied to the application environment shown in Figure 1. The terminal 102 communicates with the server 104 via a network. The terminal 102 can input user information of the user to be detected. The server 104 retrieves all transaction data of the user to be detected from the data storage system based on the user information and processes all transaction data. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104 or placed on the cloud or other network servers. The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. Portable wearable devices can be smartwatches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented using a standalone server or a server cluster composed of multiple servers.
[0070] In an exemplary embodiment, as shown in FIG2, a user type determination method is provided. Taking the application of this method to the server in FIG1 as an example, the method includes the following steps.
[0071] Step S202: Obtain the target transaction data of the user to be detected.
[0072] The user to be detected is someone whose abnormal behavior in transactions needs to be determined, such as a potential victim of fraud or someone who is currently being scammed. Target transaction data can be obtained from all transaction data of the user to be detected stored in the system. This target transaction data contains multi-dimensional transaction characteristics of the user to be detected, such as transaction time, transaction amount, remaining balance, and the account of the counterparty.
[0073] Specifically, the server can obtain historical transaction data and currently executing transaction data for each user to be monitored in the system. Based on preset fields, the server filters target transaction data that can represent transaction characteristics from the historical transaction data and the transaction data corresponding to the currently executing transactions.
[0074] Optionally, the server obtains the current transaction data corresponding to the current transaction of the user to be detected from the client, and the server obtains the historical transaction data of the user to be detected within a preset time period from the database. The historical transaction data can be transaction data within a preset time period from the current time, such as three months, six months, or one year. The server uses the current transaction data and historical transaction data that meet the preset fields as the target transaction data.
[0075] Step S204: Based on the preset feature extraction algorithm and data standard format, determine the transaction time sequence features corresponding to the target transaction data.
[0076] Among them, the feature extraction algorithm can obtain the feature data corresponding to each field from the target transaction data. The data standard format is used to limit the fixed length of data contained in each time unit. The transaction time series features contain fixed length feature data of the user to be detected.
[0077] Specifically, the server inputs the target transaction data into a feature extraction algorithm. The algorithm iterates through the target transaction data in a preset order. For each data point, multiple feature values corresponding to different fields are obtained. These feature values are then merged to obtain the feature data for that target transaction data. This process continues until all data has been extracted. Based on the limitations of the time field in the data standard format, the server determines the feature data contained in each time field and merges the feature data from multiple time fields according to their chronological order to obtain the transaction time-series features corresponding to the target transaction data.
[0078] Optionally, the server can divide the target transaction data into multiple segments based on the time field, and extract the feature data corresponding to each segment of the target transaction data in chronological order using a preset feature extraction algorithm. Based on this, the server can merge the multiple feature data segments to obtain the transaction time series data corresponding to the target transaction data.
[0079] Step S206: Input the transaction time series features of the user to be detected into the trained user type prediction model to obtain the type prediction result of the user type prediction model, and determine the user type of the user to be detected based on the type prediction result.
[0080] The user type prediction model can be a supervised learning model, trained on a training sample set containing transaction data from multiple sample users and their user types. It can also be a machine learning model incorporating temporal features. The prediction result can be a numerical value; a higher value indicates a higher probability that the user being detected has engaged in abnormal transaction behavior. User types can be categorized into abnormal transaction users and normal users.
[0081] Specifically, the server inputs the transaction time-series features of the user to be detected within a preset time period into the trained user type prediction model. The user type prediction model performs convolution processing on the transaction time-series features and calculates the output results through multiple hidden layers. The preset activation function is used to determine the output results of the user type prediction model. If the output results meet the user type classification rules, the user type of the user to be detected is determined.
[0082] Optionally, the server can input the transaction time-series features of the user to be detected into a trained temporal convolutional neural network. The temporal convolutional neural network performs convolution processing on the transaction time-series features, calculates the output result through multiple hidden layers, and uses a preset activation function to determine the output result of the temporal convolutional neural network, obtaining the type prediction result of the user type prediction model. Based on the type prediction result, the user type of the user to be detected is determined. The hidden layers can be dilated causal 1D convolutional layers. For example, the server can use a temporal convolutional neural network model with 2 convolutional layers and a kernel size of 6.
[0083] Based on the aforementioned user type determination method, the server obtains the target transaction data of the user to be detected from all transaction data of the user to be detected. It then extracts transaction features from the target transaction data using a feature extraction algorithm and further converts these features into transaction time-series features using a standard data format. Based on this, the transaction time-series features are input into a trained user type prediction model. The user type prediction model calculates the type prediction result corresponding to these features, and the user type of the user to be detected can be determined based on the type prediction result. By using this method, the user type of the user to be detected can be determined based on the target transaction data and the user type prediction model, thus enabling the implementation of restrictive measures against that user. The feature extraction algorithm can extract the implicit features of the target transaction data, and the standard data format can arrange the implicit features according to time, resulting in a feature sequence with a time dimension. Therefore, the user type predicted using this method has higher accuracy, thereby improving the prediction accuracy of the prediction model for abnormal users with abnormal transaction behavior.
[0084] In an exemplary embodiment, as shown in Figure 3, the specific implementation process of the step "obtaining the target transaction data of the user to be detected" includes:
[0085] Step S302: Obtain the initial transaction data of the user to be detected within a preset time range.
[0086] The initial transaction data within the preset time range consists of the transaction data of the user to be detected stored in the system, and the time field of the transaction data matches the preset time range.
[0087] Specifically, the server determines all the data of the user to be tested in the database based on the user information of the user to be tested. Based on this, the server filters the initial transaction data that meets the preset time range from all the data of the user to be tested.
[0088] Step S304: Based on preset data filtering conditions, filter the initial transaction data of the user to be detected within a preset time range to obtain target transaction data containing the target field.
[0089] Among them, the data filtering conditions are used to filter out the data of the required fields from the initial transaction data; the target field can be used to represent the characteristics of the user to be detected.
[0090] Specifically, since the initial transaction data contains redundant data that cannot represent the characteristics of the user to be detected, the server can remove redundant transaction data using data filtering conditions. Based on this, the server can search for fields in the initial transaction data that match the target field, retain all transaction data corresponding to that matching field, and delete transaction data corresponding to fields other than the target field.
[0091] In this embodiment, target fields that can represent the characteristics of the user to be detected can be obtained through data filtering conditions, thereby obtaining more accurate target transaction data. Based on more accurate target transaction data, more precise feature data can be obtained.
[0092] In an exemplary embodiment, as shown in Figure 4, the specific implementation process of the step "determining the transaction time series features corresponding to the target transaction data based on a preset feature extraction algorithm and data standard format" includes:
[0093] Step S402: Perform statistical processing on the target transaction data to obtain the derived fields corresponding to the target transaction data.
[0094] The derived fields can be calculated based on the base fields of the target transaction data, or they can be obtained from the data information table corresponding to the base fields of the target transaction data. The base fields are the various fields contained in the target transaction data. The data information table can be a table in the database where each field of the transaction data serves as the primary key. For example, the server can determine the detailed information of the two parties involved in the target transaction data using an account table and the unique identifiers of both parties.
[0095] Specifically, the server determines the required basic fields in the target transaction data based on a preset conversion algorithm between derived fields and basic fields. The server inputs the field values corresponding to each required basic field into the conversion algorithm to obtain the calculated field values, and uses the calculated field values as the field values of the derived fields.
[0096] Optionally, the server can determine the number of transactions contained in the target transaction data within each time range based on the time field in the target transaction data and multiple preset time ranges, thereby creating a derived field corresponding to the number of transactions and the field value corresponding to the number of transactions.
[0097] Step S404: Based on the preset feature extraction algorithm, perform feature extraction processing on the data corresponding to the derived fields and the target transaction data to obtain the initial transaction features.
[0098] The data corresponding to the derived fields can be the field values of the derived fields. The initial transaction features include the feature data corresponding to both the target transaction data and the data of the derived fields.
[0099] Specifically, the server uses a preset feature extraction algorithm to obtain the feature vectors corresponding to the derived fields and the feature vectors of each field in the target transaction data, and then merges the feature vectors corresponding to the derived fields and the feature vectors of each field in the target transaction data into a vector matrix.
[0100] Step S406: Determine the time period corresponding to each sequence number by using the sequence number and preset total duration contained in the data standard format.
[0101] In this system, a sequence number can serve as the identifier for a time period, and multiple time periods can form a time series. The time series can store feature data. The preset total duration can be used to calculate how much duration can be allocated to each sequence number.
[0102] Specifically, the server divides the preset total duration by the number of serial numbers to obtain the time period corresponding to each serial number.
[0103] Step S408: Based on the time period corresponding to each sequence number, determine the target transaction features that match the time period in the initial transaction features, and merge the target transaction features corresponding to each sequence number to obtain the transaction time sequence features corresponding to the target transaction data.
[0104] Specifically, for each sequence number and the corresponding time period, the server determines the target transaction data that matches the time period and uses the initial transaction features corresponding to the target transaction data that matches the time period as the target transaction features. Based on this, the server obtains the target transaction features for each time period sequentially according to the above process. The server can merge multiple target transaction features according to the order of the sequence numbers to obtain transaction time sequence features that include the time order.
[0105] In one example, the serial numbers are 1 to 10, and the preset total duration is ten months. By dividing the preset total duration by the number of serial numbers, we can obtain that each serial number corresponds to a one-month time period. Based on this, we obtain the target transaction data for the month currently present, as well as the target transaction features corresponding to that month. Similarly, we obtain the target transaction features for the month to two months currently present, the target transaction features for the two to three months currently present, and so on, until we obtain the target transaction features for the nine to ten months currently present. The server then merges these ten target transaction features in chronological order to obtain the transaction time sequence features.
[0106] In this embodiment, derived fields are created through statistical processing, transaction features corresponding to the derived fields and target transaction data are extracted, and transaction time series features corresponding to each time period arranged in chronological order are obtained according to the data standard format. Thus, feature data containing multiple dimensions such as derived fields and time series information is obtained. It can be seen that the richer the feature data input into the user type prediction model, the more accurate the prediction result. Therefore, this embodiment can improve the accuracy of the prediction result.
[0107] In an exemplary embodiment, the type prediction result includes a user anomaly probability value. As shown in Figure 5, the specific implementation process of the step "determine the user type of the user to be detected based on the type prediction result" includes:
[0108] Step S502: If the user anomaly probability value included in the type prediction result matches the preset threshold range, then the user type of the user to be detected is determined to be an abnormal user with abnormal transaction behavior.
[0109] The user anomaly probability value can be a value calculated based on the activation function, and its value range can be from 0 to 1. The threshold range can be a numerical range between 0 and 1, for example [0.8, 1].
[0110] Specifically, the server obtains the user's abnormal probability value and determines whether the user's abnormal probability value is within a threshold range. If the user's abnormal probability value is within the threshold range, the user type of the user to be detected is determined to be an abnormal user with abnormal transaction behavior; if the user's abnormal probability value is not within the threshold range, the user type of the user to be detected is determined to be a normal user without abnormal transaction behavior.
[0111] Step S504: Close the transaction behavior corresponding to the user to be detected.
[0112] Specifically, after the server determines that the user to be detected is an abnormal user, it revokes the abnormal user's transaction privileges. Alternatively, the server closes any ongoing transactions by the abnormal user.
[0113] In this embodiment, a threshold is used to determine whether a user to be detected is an abnormal user, and transactions of abnormal users are closed, thereby reducing the probability of users making abnormal transactions and ensuring the safety of users' funds.
[0114] In an exemplary embodiment, as shown in FIG6, the user type determination method further includes:
[0115] Step S602: Obtain the sample training set.
[0116] The training set includes the transaction time-series features of each sample user within a preset time period and the sample user type for each user. The transaction time-series features contain fixed-length feature data of the sample users, and the sample user types can be divided into abnormal transaction users and normal users.
[0117] Specifically, the server retrieves sample transaction data from multiple sample users within a preset time period from the database and determines the temporal characteristics of the sample transactions using a feature extraction algorithm. The server then matches the sample user types of the preset multiple sample users with the temporal characteristics of the sample transactions to obtain a sample training set.
[0118] Step S604: The user anomaly prediction value corresponding to each sample user is obtained by using the user type prediction model to be trained and the sample transaction time sequence characteristics of each sample user.
[0119] The user type prediction model to be trained is one that has not been trained on a sample training set and whose model parameters have not been tuned. The user anomaly prediction value is the output of the user type prediction model, used to predict the sample user type. The user type prediction model can be a temporal convolutional neural network.
[0120] Specifically, the temporal convolutional neural network to be trained includes initial values for each model parameter, such as the number of convolutional layers, kernel size, and learning rate. Based on these initial values, the server can input the temporal transaction features of sample users into the temporal convolutional neural network to be trained, and calculate the user anomaly prediction value corresponding to the user type prediction model to be trained.
[0121] Step S606: Calculate the loss function based on the sample user type of each sample user and the predicted user anomaly value of each sample user.
[0122] The loss function is used to represent the difference between the prediction results of the user type prediction model and the actual results.
[0123] Specifically, the server determines the numerical value corresponding to the sample user type; for example, the normal user type is 0, and the sample user type is 1. The numerical value corresponding to the sample user type and the predicted anomaly value for each sample user are input into the loss function to determine the corresponding loss value.
[0124] Step S608: If it is determined that the user type prediction model to be trained does not meet the training completion conditions, the parameters of the user type prediction model to be trained are updated based on the loss function, and the step of predicting using the user type prediction model to be trained and the sample transaction time sequence features of each sample user is re-executed until a trained user type prediction model is obtained.
[0125] Among them, the training completion condition can be that the current number of training iterations meets the preset training iteration number threshold, or that the loss value corresponding to the loss function meets the preset convergence condition. The preset convergence condition can be that the loss value is less than the threshold corresponding to the loss value.
[0126] Specifically, if the server determines that the current number of training iterations meets the preset training iteration threshold, and the server determines that the loss value of the loss function is less than the threshold corresponding to the loss value, then the user type prediction model is a trained user type prediction model. If the server determines that the current number of training iterations does not meet the preset training iteration threshold, or the server determines that the loss value of the loss function is greater than the threshold corresponding to the loss value, then according to the loss value of the loss function and the preset weights, the model parameters of the user type prediction model to be trained are adjusted to obtain an updated user type prediction model, and the process returns to step S604 for iterative training.
[0127] Optionally, the server can divide the sample training set into a target training set and a target test set according to a preset ratio. After the target training set is trained on the user type prediction model based on the training completion conditions, the target test set is input into the trained user type prediction model to obtain a test result set. The evaluation score of the test result set is determined by accuracy, recall, and F1 score. If the evaluation score of the test result set is lower than a preset threshold, the training completion conditions and the model parameters of the user type prediction model are readjusted, and the process returns to step S604 for iterative training. If the evaluation score of the test result set is not lower than the preset threshold, the trained user type prediction model is obtained.
[0128] In this embodiment, the user type prediction model is trained iteratively multiple times using a sample training set and a loss function. Once the training completion condition is met, a well-trained user type prediction model is obtained, thus resulting in a user type prediction model with higher prediction accuracy.
[0129] In an exemplary embodiment, as shown in Figure 7, the specific implementation process of the step "obtaining the sample training set" includes:
[0130] Step S702: Based on preset data filtering conditions, filter the initial sample transaction data of each sample user within a preset time range to obtain target sample transaction data containing the target field.
[0131] Among them, the data filtering conditions are used to filter out the data of the required fields from the initial sample transaction data; the target fields can be used to represent the characteristics of the sample users.
[0132] Specifically, since the initial sample transaction data contains redundant transaction data that cannot represent the characteristics of the sample users, the server can remove redundant transaction data using data filtering conditions. Based on this, the server can search for fields in the initial sample transaction data that match the target field, based on the target field included in the data filtering conditions. It will then retain all transaction data corresponding to that matching field and delete transaction data corresponding to fields other than the target field.
[0133] Step S704: Perform statistical processing on the target sample transaction data to obtain the derived fields corresponding to the target sample transaction data. Based on the preset feature extraction algorithm, perform feature extraction processing on the data corresponding to the derived fields and the target sample transaction data to obtain the initial sample transaction features.
[0134] The derived fields can be calculated based on the base fields of the target sample transaction data, or they can be obtained from the data information table corresponding to the base fields of the target sample transaction data. The data corresponding to the derived fields can be the field values of the derived fields. The initial sample transaction features include the feature data corresponding to both the target sample transaction data and the derived fields.
[0135] Specifically, the server determines the required basic fields in the target sample transaction data based on a preset conversion algorithm between derived fields and basic fields. The server inputs the field values corresponding to each required basic field into the conversion algorithm to obtain the calculated field values, which are then used as the field values of the derived fields. The server obtains the feature vectors corresponding to the derived fields and the feature vectors of each field in the target sample transaction data through a preset feature extraction algorithm, and merges the feature vectors corresponding to the derived fields and the feature vectors of each field in the target sample transaction data into a vector matrix.
[0136] Step S706: Determine the time period corresponding to each sequence number through the sequence number and preset total duration contained in the data standard format; based on the time period corresponding to each sequence number, determine the target sample transaction features that conform to the time period in the initial sample transaction features; and merge the target sample transaction features corresponding to each sequence number to obtain the transaction time sequence features corresponding to the target sample transaction data.
[0137] Specifically, the server divides the preset total duration by the number of sequence numbers to obtain the time period corresponding to each sequence number. For each time period corresponding to a sequence number, and based on the time field in the target sample transaction data, the server determines the target sample transaction data that matches the time period. The server then uses the initial sample transaction features corresponding to the target sample transaction data that matches the time period as the target sample transaction features. Based on this, the server sequentially obtains the target sample transaction features for each time period according to the above process. The server can merge multiple target sample transaction features according to the order of the sequence numbers to obtain transaction time sequence features that include the time order.
[0138] Step S708: Match the preset sample user types of each sample user with the corresponding transaction time series features of each sample user to obtain the sample training set.
[0139] Specifically, the server stores the pre-set sample user type and the corresponding transaction time series characteristics of the sample users into a key-value pair to indicate that each transaction time series characteristic matches each sample user type one by one.
[0140] In this embodiment, the initial sample transaction features are determined by the target sample transaction data and derived fields of the sample users, and the transaction time series features corresponding to the target sample transaction data are obtained by the data format standard, thereby creating a high-quality sample training set. Finally, the user type prediction model is trained by the high-quality sample training set to obtain a high-accuracy user type prediction model.
[0141] In one exemplary embodiment, and in conjunction with a specific embodiment, the specific execution process of the user type determination method is described in detail, including the following steps:
[0142] Step 1: Extraction and standardization of time-series behavioral data.
[0143] Step 1.a: The server collects a total of 100,000 positive and negative sample data. The negative samples are defrauded customers, and the positive samples are normal customers. Extract the transaction behavior data of each sample customer over the past 6 months. For example, if a customer makes a transaction at time a, the transaction amount is b, the transaction object is c, and the account balance is d.
[0144] Step 1.b: Time-series behavior standardization, standardizing the time-series transaction behavior pipeline into a sequence of transactions of equal length, such as a customer performing b1 transactions between times a1 and a2, with a transaction amount of c1 yuan; a customer performing b2 transactions between times a2 and a3, with a transaction amount of c2 yuan, etc. In other words, the variable-length input in Step 1.a is standardized into a fixed-length input.
[0145] Step 2: The model used in this application is a temporal convolutional neural network model, which consists of dilated causal 1D convolutional layers with the same input and output lengths. As shown in Figure 8, the temporal convolutional neural network contains layers X = x0, x1, x2, ... x T-2 ,x T-1 ,x T The input sequence is composed of multiple hidden layers containing dilated causal 1D convolutional layers for computation, ultimately yielding the output sequence. The output sequence can be represented as:
[0146] Y = y0, y1, y2, ... y T-2 ,y T-1 ,y T
[0147] In one example, the receptive field determines how long ago a temporal convolutional neural network (TCNN) model can convolve the current transaction with transactions from a previous time period, thereby uncovering deep transaction connections over a specific time span. The size of the receptive field of a TCNN model is determined by factors such as the number of hidden layers and the kernel size. For instance, a TCN network structure with 2 convolutional layers and a kernel size of 6 can be used in fraud victim behavior identification.
[0148] Step 3: Train the model. Using the normalized samples from Step 1, the network structure from Step 2, and the normalized data from Step 1.b, divide the user data into a training set and a test set. Train the model using the training set, evaluate the model using the test set, and adjust the model parameters to obtain results that meet the preset conditions on the test set. The gradient descent function can be used to train the model parameters.
[0149] Through comparative experiments, compared with traditional machine learning modeling schemes, the temporal convolutional neural network model of this application improves the recall rate by 4.9% under the premise that the top 5% of customers with the highest scores are identified as defrauded customers and transaction control is implemented.
[0150] Step 4: Deploy the model. Deploy the data processing flow from Step 1 and the model training results from Step 3. When a potential victim of fraud makes a transaction, collect the customer's transaction history for the past 6 months and organize it into the format described in Step 1.a. Then, perform the standardization process described in Step 1.b. Finally, use the model from Step 3 to make a prediction and decide whether to control the transaction based on the prediction results.
[0151] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0152] Based on the same inventive concept, this application also provides a user type determination apparatus for implementing the user type determination method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more user type determination apparatus embodiments provided below can be found in the limitations of the user type determination method described above, and will not be repeated here.
[0153] In an exemplary embodiment, as shown in FIG9, a user type determination device 900 is provided, including: a transaction data acquisition module 901, a time series feature determination module 902, and a user type determination module 903, wherein:
[0154] The transaction data acquisition module 901 is used to acquire the target transaction data of the user to be detected.
[0155] The time-series feature determination module 902 is used to determine the transaction time-series features corresponding to the target transaction data based on a preset feature extraction algorithm and data standard format. The transaction time-series features include fixed-length feature data of the user to be detected.
[0156] The user type determination module 903 is used to input the transaction time sequence features of the user to be detected into the trained user type prediction model, obtain the type prediction result of the user type prediction model, and determine the user type of the user to be detected based on the type prediction result.
[0157] Furthermore, the transaction data acquisition module 901 is specifically used to: acquire the initial transaction data of the user to be detected within a preset time range; and, based on preset data filtering conditions, filter the initial transaction data of the user to be detected within the preset time range to obtain target transaction data containing the target field.
[0158] Furthermore, the time-series feature determination module 902 is specifically used for:
[0159] Perform statistical processing on the target transaction data to obtain the corresponding derived fields;
[0160] Based on a preset feature extraction algorithm, feature extraction processing is performed on the data corresponding to the derived fields and the target transaction data to obtain initial transaction features;
[0161] The time period corresponding to each sequence number is determined by the sequence number and preset total duration contained in the data standard format;
[0162] Based on the time period corresponding to each sequence number, target transaction features that match the time period are determined from the initial transaction features, and the target transaction features corresponding to each sequence number are merged to obtain the transaction time series features corresponding to the target transaction data.
[0163] Furthermore, the type prediction result includes a user anomaly probability value. The user type determination module 803 is specifically used for:
[0164] If the user anomaly probability value included in the type prediction result matches the preset threshold range, then the user type of the user to be detected is determined to be an abnormal user with abnormal transaction behavior.
[0165] The transaction activity of the user being monitored will be shut down.
[0166] Furthermore, the device also includes a model training module, specifically used for:
[0167] Obtain the sample training set, which includes the sample transaction time sequence characteristics of each sample user within a preset time period and the sample user type of each sample user;
[0168] The user anomaly prediction value corresponding to each sample user is obtained by using the user type prediction model to be trained and the sample transaction time sequence characteristics of each sample user.
[0169] The loss function is calculated based on the sample user type of each sample user and the predicted user anomaly value of each sample user.
[0170] If it is determined that the user type prediction model to be trained does not meet the training completion conditions, the parameters of the user type prediction model to be trained are updated based on the loss function, and the steps of prediction using the user type prediction model to be trained and the sample transaction time series features of each sample user are re-executed until a well-trained user type prediction model is obtained.
[0171] Furthermore, the device also includes a sample training set acquisition module, specifically used for:
[0172] Based on preset data filtering conditions, the initial sample transaction data of each sample user within a preset time range is filtered to obtain target sample transaction data containing the target field.
[0173] Statistical processing is performed on the target sample transaction data to obtain the derived fields corresponding to the target sample transaction data. Based on the preset feature extraction algorithm, feature extraction processing is performed on the data corresponding to the derived fields and the target sample transaction data to obtain the initial sample transaction features.
[0174] By using the sequence number and preset total duration included in the data standard format, the time period corresponding to each sequence number is determined. Based on the time period corresponding to each sequence number, the target sample transaction features that conform to the time period are determined in the initial sample transaction features. The target sample transaction features corresponding to each sequence number are then merged to obtain the transaction time sequence features corresponding to the target sample transaction data.
[0175] The sample training set is obtained by matching the sample user type of each sample user with the corresponding transaction time sequence features.
[0176] The modules in the aforementioned user type determination device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0177] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram is shown in Figure 10. The computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is connected to the system bus via the I / O interfaces. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of the computer device stores target transaction data for each user. The I / O interfaces of the computer device are used for exchanging information between the processor and external devices. The communication interface of the computer device is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a user type determination method.
[0178] Those skilled in the art will understand that the structure shown in Figure 10 is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or may combine certain components, or may have different component arrangements.
[0179] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0180] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0181] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0182] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0183] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media 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), magnetic 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. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0184] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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.
[0185] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for determining user type, characterized in that, The method includes: acquiring target transaction data of a user to be detected; determining transaction time-series features corresponding to the target transaction data based on a preset feature extraction algorithm and a data standard format, wherein the transaction time-series features include fixed-length feature data of the user to be detected; inputting the transaction time-series features of the user to be detected into a trained user type prediction model to obtain the type prediction result of the user type prediction model, and determining the user type of the user to be detected based on the type prediction result; wherein, determining the transaction time-series features corresponding to the target transaction data based on the preset feature extraction algorithm and data standard format includes: performing statistical processing on the target transaction data to obtain the target transaction data. The corresponding derived fields; based on a preset feature extraction algorithm, feature extraction processing is performed on the data corresponding to the derived fields and the target transaction data to obtain initial transaction features; the time period corresponding to each sequence number is determined by the sequence number included in the data standard format and the preset total duration; based on the time period corresponding to each sequence number, target transaction features that conform to the time period are determined in the initial transaction features, and the target transaction features corresponding to each sequence number are merged to obtain the transaction time sequence features corresponding to the target transaction data; wherein, the derived fields are calculated based on the basic fields of the target transaction data, or are obtained based on the data information table corresponding to the basic fields of the target transaction data.
2. The method according to claim 1, characterized in that, The step of obtaining the target transaction data of the user to be detected includes: obtaining the initial transaction data of the user to be detected within a preset time range; and filtering the initial transaction data of the user to be detected within the preset time range based on preset data filtering conditions to obtain target transaction data containing the target field.
3. The method according to claim 1, characterized in that, The type prediction result includes a user anomaly probability value; determining the user type of the user to be detected based on the type prediction result includes: if the user anomaly probability value included in the type prediction result matches a preset threshold range, then determining that the user type of the user to be detected is an abnormal user with abnormal transaction behavior; and closing the transaction behavior corresponding to the user to be detected.
4. The method according to claim 1, characterized in that, The method further includes: acquiring a sample training set, the sample training set containing the sample transaction time-series features of each sample user within a preset time period and the sample user type of each sample user; making predictions using the user type prediction model to be trained and the sample transaction time-series features of each sample user to obtain the user anomaly prediction value corresponding to each sample user; calculating a loss function based on the sample user type of each sample user and the user anomaly prediction value of each sample user; if it is determined that the user type prediction model to be trained does not meet the training completion condition, updating the parameters of the user type prediction model to be trained based on the loss function, and re-executing the step of making predictions using the user type prediction model to be trained and the sample transaction time-series features of each sample user until a trained user type prediction model is obtained.
5. The method according to claim 4, characterized in that, The process of obtaining the sample training set includes: filtering initial sample transaction data within a preset time range for each sample user based on preset data filtering conditions to obtain target sample transaction data containing target fields; performing statistical processing on the target sample transaction data to obtain derived fields corresponding to the target sample transaction data; performing feature extraction processing on the data corresponding to the derived fields and the target sample transaction data based on a preset feature extraction algorithm to obtain initial sample transaction features; determining the time period corresponding to each sequence number through the sequence number and preset total duration contained in the data standard format; determining target sample transaction features that conform to the time period in the initial sample transaction features based on the time period corresponding to each sequence number; merging the target sample transaction features corresponding to each sequence number to obtain the transaction time sequence features corresponding to the target sample transaction data; and matching the preset sample user type of each sample user with the transaction time sequence features corresponding to each sample user to obtain the sample training set.
6. A user type determination device, characterized in that, The device includes: a transaction data acquisition module for acquiring target transaction data of a user to be detected; a time-series feature determination module for determining the transaction time-series features corresponding to the target transaction data based on a preset feature extraction algorithm and a data standard format, wherein the transaction time-series features include fixed-length feature data of the user to be detected; and a user type determination module for inputting the transaction time-series features of the user to be detected into a trained user type prediction model to obtain the type prediction result of the user type prediction model, and determining the user type of the user to be detected based on the type prediction result; wherein, the time-series feature determination module is specifically used for: performing statistical processing on the target transaction data to obtain the target transaction data. The data includes derived fields; based on a preset feature extraction algorithm, feature extraction processing is performed on the data corresponding to the derived fields and the target transaction data to obtain initial transaction features; the time period corresponding to each sequence number is determined by the sequence number included in the data standard format and the preset total duration; based on the time period corresponding to each sequence number, target transaction features that conform to the time period are determined in the initial transaction features, and the target transaction features corresponding to each sequence number are merged to obtain the transaction time sequence features corresponding to the target transaction data; wherein, the derived fields are calculated based on the basic fields of the target transaction data, or obtained based on the data information table corresponding to the basic fields of the target transaction data.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Abnormal transaction identification method and device based on financial time series characteristics and readable storage medium
CN109165950A