Transaction data analysis method and device, storage medium and electronic equipment
By using a combination method of feature selection and GRU network model in credit card transaction data analysis, the problem of low accuracy of abnormal transaction recognition in the prior art is solved, and more efficient abnormal transaction recognition is achieved.
Patent Information
- Application Number
- CN202411974377.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2044-12-30
Smart Images

Figure CN119887388A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and more specifically, to a transaction data analysis method, device, storage medium and electronic device. Background Art
[0002] In the contemporary financial industry, credit card transactions are a core component of daily economic activities, and the analysis and mining of their data are crucial for risk control, customer service optimization, and market strategy formulation. However, existing technologies are often limited by the limitations of traditional statistical methods and machine learning technologies when processing credit card transaction data, especially in terms of the accuracy of abnormal transaction identification.
[0003] Traditional data analysis methods, such as logistic regression and decision trees, are stable when processing static data sets, but they are difficult to capture the temporal characteristics and dynamic patterns contained in transaction data. Credit card transaction details are a typical time series data, and each transaction is not only affected by immediate factors, but also constrained by historical transaction behaviors. On the other hand, although RNN (Recurrent Neural Network) has been introduced into credit card transaction analysis due to its ability to process sequence data, RNN faces a serious gradient vanishing problem when processing long sequence data, which makes it difficult for the model to learn long-term dependencies in the data. This means that in complex credit card transaction scenarios, the RNN model may not be able to accurately identify abnormal transactions, especially those abnormal behaviors that need to be judged based on transaction patterns over a long time span. In addition, with the surge in credit card transaction volume, the dimension and complexity of transaction data are also increasing, which further increases the difficulty of identifying abnormal transactions. Existing methods often have difficulty dealing with such large-scale, high-dimensional time series data, resulting in limited accuracy of analysis results.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The present application provides a transaction data analysis method, device, storage medium and electronic device to at least solve the technical problem of low accuracy in identifying abnormal transactions in the analysis of transaction data in the prior art.
[0006] To achieve the above-mentioned purpose, according to one aspect of the present application, a method for analyzing transaction data is provided, comprising: obtaining the transaction data of a target user; performing feature selection on the transaction data of the target user according to a target feature sequence to obtain transaction data features of the target user, wherein the features in the target feature sequence have a higher probability of appearing in abnormal transaction data than in normal transaction data; inputting the transaction data features of the target user into a target neural network model, and determining abnormal transactions in the transaction data of the target user based on the transaction data features of the target user according to prior knowledge learned by the target neural network model in a model training phase, wherein the target neural network model is a model obtained by updating an initial neural network model according to a target hyperparameter combination, wherein the initial neural network model is used to process and analyze time series features in transaction data and identify abnormal transactions, and the target hyperparameter combination is a hyperparameter of the model determined based on a cross-validation method during pre-training.
[0007] Optionally, the target neural network model is obtained by the following steps: obtaining N first data, wherein each first data represents historical transaction data of a user, wherein N is an integer greater than or equal to 1, and the historical transaction data is abnormal transaction data or normal transaction data of the user; extracting feature values corresponding to features in a target feature sequence from each of the N first data to obtain N feature value sequences; arranging the N feature value sequences in order of transaction time to obtain a target time series; performing multiple iterative training and verification operations on the initial neural network model according to the target time series to obtain a target neural network model, wherein the multiple iterative trainings are used to determine the target weights and target biases of the model, and the verification operation determines the target hyperparameter combination of the model based on cross-validation.
[0008] Optionally, the initial neural network model is subjected to multiple iterative training and verification operations according to the target time series to obtain a target neural network model, including: initializing the initial neural network using a preset hyperparameter combination to obtain a first model; dividing the target time series into a model training set and a model verification set; inputting the model training set into the first model for iterative training until the number of model iterations is greater than a preset number or the training error of the model is lower than a set threshold, thereby obtaining a target weight and a target bias of the first model; updating the first model to a second model according to the target weight and the target bias; and performing multiple verification operations on the second model according to the model verification set to obtain the target neural network model.
[0009] Optionally, each iterative training includes the following steps: when there are T training sets in the model training set, using the first model to perform data analysis on the T training sets to obtain analysis results corresponding to each training set, where T is an integer greater than or equal to 1; calculating the error between the analysis result corresponding to each training set and the actual transaction label corresponding to each training set to obtain T error values; adjusting the weight and bias of the first model according to the T error values.
[0010] Optionally, multiple verification operations are performed on the second model according to the model verification set to obtain a target neural network model, including: setting S groups of hyperparameter combinations, wherein different hyperparameter combinations are used to perform different parameter configurations on the second model, wherein S is an integer greater than or equal to 1; performing S verification operations on the second model according to the model verification set and the S groups of hyperparameter combinations to obtain S recognition accuracy rates, wherein each verification operation is used to cross-validate the second model determined using a set of hyperparameter combinations to obtain a recognition accuracy rate; selecting a recognition accuracy rate greater than or equal to a preset threshold from the S recognition accuracy rates as the target accuracy rate; using the hyperparameter combination corresponding to the target accuracy rate as the target hyperparameter combination; and determining the target neural network model based on the target hyperparameter combination and the second model.
[0011] Optionally, the verification operation includes the following steps: performing K rounds of test operations on the second model to obtain K recognition results, where K is an integer greater than or equal to 1, each round of test operation is used to select any sequence in the model verification set as a target test set, and use the sequences other than the target test set as a target training set, use the target training set to perform a round of training on the second model, and use the trained second model to analyze the target test set to obtain a recognition result; determine K accuracy rates of the second model based on the K recognition results, where the Rth accuracy rate among the K accuracy rates is used to characterize the recognition accuracy of the second model after completing the Rth round of test operations in the K rounds of test operations, where R is a positive integer less than or equal to K; and calculate the average of the K accuracy rates as the recognition accuracy rate of the second model.
[0012] Optionally, after extracting the feature value corresponding to the feature in the target feature sequence from each of the N first data to obtain N feature value sequences, the transaction data analysis method also includes: encoding the N feature value sequences, wherein the encoding processing is used to perform one-hot encoding on the variable information corresponding to each feature value in the N feature value sequences, and converting the non-numeric data in the N feature value sequences into numerical feature data.
[0013] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a transaction data analysis device is also provided, including: an acquisition unit, which acquires the transaction data of a target user; a selection unit, which performs feature selection on the transaction data of the target user according to a target feature sequence to obtain the transaction data features of the target user, wherein the probability of the features in the target feature sequence appearing in abnormal transaction data is greater than the probability of appearing in normal transaction data; a determination unit, which inputs the transaction data features of the target user into a target neural network model, and determines abnormal transactions in the transaction data of the target user based on the transaction data features of the target user according to the prior knowledge learned by the target neural network model in the model training stage, wherein the target neural network model is a model obtained by updating the initial neural network model according to a target hyperparameter combination, wherein the initial neural network model is used to process and analyze the time series features in the transaction data and identify abnormal transactions, and the target hyperparameter combination is the hyperparameters of the model determined based on a cross-validation method during pre-training.
[0014] According to another aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed, the device where the computer-readable storage medium is located executes the above-mentioned transaction data analysis method.
[0015] According to another aspect of an embodiment of the present application, there is also provided an electronic device, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the above-mentioned transaction data analysis method.
[0016] According to another aspect of an embodiment of the present application, a computer program product is also provided, including computer instructions, which implement the steps of the above-mentioned transaction data analysis method when executed by a processor.
[0017] In the present application, the transaction data of the target user is first obtained, and then the transaction data of the target user is feature selected according to the target feature sequence to obtain the transaction data features of the target user, wherein the probability of the features in the target feature sequence appearing in the abnormal transaction data is greater than the probability of appearing in the normal transaction data, and finally the transaction data features of the target user are input into the target neural network model, and the abnormal transactions in the transaction data of the target user are determined based on the transaction data features of the target user according to the prior knowledge learned by the target neural network model in the model training stage, wherein the target neural network model is a model obtained by updating the initial neural network model according to the target hyperparameter combination, wherein the initial neural network model is used to process and analyze the time series features in the transaction data and identify abnormal transactions, and the target hyperparameter combination is the hyperparameter of the model determined based on the cross-validation method during pre-training, that is, by performing feature selection on the user transaction data to obtain the transaction data features, the obtained transaction data features are input into the target neural network model constructed by comprehensive feature engineering and model parameter optimization for identification, thereby achieving the purpose of accurate modeling and anomaly detection, thereby achieving the technical effect of improving the accuracy of abnormal transaction identification, and thus solving the technical problem of low accuracy of abnormal transaction identification in the analysis of transaction data in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0019] Figure 1 A hardware structure block diagram of a computer terminal for implementing a transaction data analysis method is shown;
[0020] Figure 2 is a flowchart of an optional transaction data analysis method according to an embodiment of the present application;
[0021] Figure 3 is a schematic diagram of an optional model structure according to an embodiment of the present application;
[0022] Figure 4 is a flowchart of an optional model training according to an embodiment of the present application;
[0023] Figure 5 is a flowchart of an optional transaction data processing according to an embodiment of the present application;
[0024] Figure 6 is a schematic diagram of an optional transaction data analysis device according to an embodiment of the present application;
[0025] Figure 7It is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] It should be noted that the collected information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this application are information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data are in compliance with relevant laws, regulations and standards, necessary confidentiality measures are taken, and public order and good customs are not violated, and corresponding operation entrances are provided for users to choose to authorize or refuse. For example, an interface is set up between this system and relevant users or institutions to provide users with corresponding operation entrances for users to choose to agree or refuse the results of automated decision-making; if the user chooses to refuse, the expert decision-making process will be entered.
[0029] Example 1
[0030] According to an embodiment of the present application, an embodiment of a method for analyzing transaction data is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0031] It should be noted that a data processing system can be used as the execution subject of the transaction data analysis method of the embodiment of the present application. It is understandable that the transaction data analysis method provided in the embodiment of the present application can also be executed by other systems or devices, and the embodiment of the present application does not specifically limit this.
[0032] The method embodiments provided in the present application may be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 The hardware structure block diagram of a computer terminal (or mobile device) for implementing a method for analyzing transaction data is shown. Figure 1 As shown, the computer terminal 10 (or mobile device) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0033] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuit may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be fully or partially integrated into any of the other components in the computer terminal 10 (or mobile device). As in the transaction data analysis method involved in the embodiments of the present application, the data processing circuit serves as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0034] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the transaction data analysis method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, realizing the above-mentioned transaction data analysis method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0035] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0036] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0037] Under the above operating environment, this application provides Figure 2 The analysis method of the transaction data shown. Figure 2 FIG. 1 is a flowchart of an optional transaction data analysis method according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:
[0038] Step S201, obtaining transaction data of a target user.
[0039] Optionally, the data processing system obtains the transaction data of the target user, including detailed information of all transactions of the target user, such as transaction time, transaction amount, transaction location, transaction type, etc.
[0040] Step S202: performing feature selection on the target user's transaction data according to the target feature sequence to obtain the target user's transaction data features.
[0041] In step S202, the probability of a feature in the target feature sequence appearing in abnormal transaction data is greater than the probability of appearing in normal transaction data.
[0042] Optionally, the target feature sequence is a predefined series of features that are more likely to appear in abnormal transaction data than in normal transaction data, such as large-amount transactions, late-night transactions, multiple transactions in a short period of time, etc.
[0043] Optionally, by matching with the target feature sequence, the data processing system selects features that can effectively distinguish normal transactions from abnormal transactions to form transaction data features of the target user.
[0044] Step S203, inputting the transaction data features of the target user into the target neural network model, and determining abnormal transactions in the transaction data of the target user based on the transaction data features of the target user according to the prior knowledge learned by the target neural network model in the model training phase.
[0045] In step S203, the target neural network model is a model obtained by updating the initial neural network model according to the target hyperparameter combination.
[0046] In step S203, the initial neural network model is used to process and analyze the time series features in the transaction data and identify abnormal transactions. The target hyperparameter combination is the hyperparameter of the model determined based on cross-validation during pre-training.
[0047] Optionally, the data processing system uses the transaction data features of the target user after feature selection as input for analysis by the target neural network model. The model evaluates the target transaction data features based on the prior knowledge learned during the training phase and determines which transactions may belong to the abnormal category.
[0048] Optionally, the initial neural network model is used to process and analyze long-term dependencies and time series features in the transaction data, where long-term dependency means that in time series data, the current output depends not only on the most recent input, but also on the earlier input in the sequence; time series features mean that in time series data, the value of a data point is not only affected by the current moment, but also has an association with data points at one or more moments in the past. This feature indicates that the distribution and pattern of data changes over time and is a core element of time series analysis.
[0049] Optionally, the initial neural network model is an untrained GRU model (Gated Recurrent Unit). The GRU model is a special RNN structure and an improved recurrent neural network unit. It is designed to process sequence data and has significant advantages in capturing long-term dependencies. It controls the flow of information by introducing update gates and reset gates, thereby effectively solving the gradient vanishing and gradient exploding problems that occur in traditional RNNs when processing long sequence data, so that the network can maintain a stable learning state in long time sequences. Among them, RNN is an artificial neural network for processing sequence data, which is characterized by the existence of cyclic connections in the network, so that the network can maintain a certain state or memory. RNN is particularly suitable for processing data with time series dependencies, such as natural language text or time series analysis; gradient vanishing refers to the fact that when training a deep neural network, the error gradient gradually becomes smaller during the back propagation process, resulting in a slow update of the network weights or even almost no update, making it difficult for the network to learn the long-term dependencies in the data. This phenomenon is particularly prominent in recurrent neural networks because they need to capture long-term dependencies in time series data through a multi-layer network structure.
[0050] It should be noted that the core of the GRU network model lies in its two key components: the update gate and the reset gate. These two gates control the flow of information, allowing the network to capture long-term dependencies while alleviating the gradient vanishing problem. The update gate is responsible for deciding which information should be passed from short-term memory to long-term memory. It does this through a sigmoid function (SigmoidFunction, S-shaped function), with an output value between 0 and 1, indicating the degree of information retention. The reset gate determines which information should be forgotten. It also uses the sigmoid function, but the output value determines the degree of information discarded. When processing credit card transaction details, each transaction data first undergoes data preprocessing, including desensitization to protect user privacy. Then, the data is input into the GRU network model. At each time step, the network updates its hidden state through the collaborative work of the update gate and the reset gate. This hidden state is the "memory" of the network and contains past transaction information. Finally, the network outputs a state that reflects the cumulative impact of all transactions so far. Through training, the GRU network model can learn how to predict future transaction patterns based on historical transaction data, such as normal consumption behavior and potential fraud.
[0051] Optionally, the data processing system obtains the transaction data of the target user, which contains each transaction record of the user, including the transaction amount, transaction time, transaction type, etc. Subsequently, the system cleans the data, removes duplicate and useless records, and fills or deletes missing values to ensure the accuracy and reliability of the data. Then, the data processing system selects features corresponding to the features in the target feature sequence from the cleaned data. These features can capture the dynamic changes and laws of transaction behavior and help the learning of the model. Subsequently, feature engineering is performed, including data normalization, encoding, and conversion to optimize the feature input format, while performing data desensitization to ensure that user privacy is protected. The processed features are then input into the target neural network model based on the GRU network. The model has mastered the ability to identify normal and abnormal transactions by learning the temporal features in a large amount of transaction data in the previous model training stage. The system conducts in-depth analysis of the transaction data features of the target user based on the prior knowledge accumulated by the model in the training stage to identify abnormal transactions in the target user's transaction data.
[0052] It can be seen from the contents of step S201 to step S205 that in the present application, the transaction data of the target user is first obtained, and then the transaction data of the target user is subjected to feature selection according to the target feature sequence to obtain the transaction data features of the target user, wherein the probability of the features in the target feature sequence appearing in the abnormal transaction data is greater than the probability of appearing in the normal transaction data, and finally the transaction data features of the target user are input into the target neural network model, and the abnormal transactions in the transaction data of the target user are determined based on the transaction data features of the target user according to the prior knowledge learned by the target neural network model in the model training stage, wherein the target neural network model is an initial neural network model according to the target hyperparameter combination. The model obtained after the model is updated, wherein the initial neural network model is used to process and analyze the time series features in the transaction data and identify abnormal transactions, and the target hyperparameter combination is the hyperparameter of the model determined based on the cross-validation method during pre-training, that is, by performing feature selection on the user transaction data, the transaction data features are obtained, and the obtained transaction data features are input into the target neural network model constructed through comprehensive feature engineering and model parameter optimization for identification, thereby achieving the purpose of accurate modeling and anomaly detection, thereby achieving the technical effect of improving the accuracy of abnormal transaction identification, and further solving the technical problem of low accuracy of abnormal transaction identification in the analysis of transaction data in the prior art.
[0053] In an optional embodiment, the data processing system first obtains N first data, wherein each first data represents historical transaction data of a user, wherein N is an integer greater than or equal to 1, and the historical transaction data is the user's abnormal transaction data or normal transaction data, and then extracts a feature value corresponding to a feature in a target feature sequence from each of the N first data to obtain N feature value sequences, and then arranges the N feature value sequences in order of transaction time to obtain a target time sequence, and finally performs multiple iterative training and verification operations on the initial neural network model according to the target time sequence to obtain a target neural network model, wherein the multiple iterative trainings are used to determine the target weights and target biases of the model, and the verification operation determines the target hyperparameter combination of the model based on cross-validation.
[0054] Optionally, historical transaction data refers to the user's past credit card transaction records, including but not limited to detailed information such as transaction time, transaction amount, transaction location, etc.; abnormal transaction data refers to transaction records that do not conform to the user's normal transaction pattern, for example, large abnormal consumption, transactions conducted at unusual times or locations, etc.; normal transaction data refers to transaction records that conform to the user's regular consumption pattern.
[0055] Optionally, the data processing system encrypts all transaction data during storage and transmission, and establishes a comprehensive audit and monitoring system to record and track data access, as well as perform regular data backup.
[0056] Optionally, the data processing system obtains N groups of historical credit card transaction data, each group of transaction data corresponds to a historical transaction record of a user, which includes the user's normal transaction records and abnormal transaction records, and obtains N first data. The data processing system then performs feature extraction on each first data, and screens out feature values corresponding to the features in the target feature sequence from the historical transaction data, wherein the target feature sequence predefines those data features that have a significantly higher probability of appearing in abnormal transactions than in normal transactions, which may include transaction frequency, transaction amount, change in transaction location, etc. The extracted feature values are then organized into N feature value sequences and arranged in chronological order of the transactions to form a target time series. After the feature value sequence and time series are constructed, the data processing system uses the target time series to perform multiple iterative training and verification operations on the initial neural network model to continuously adjust the model's weights and biases, and optimize hyperparameters, such as the learning rate and the number of hidden layer units, to improve the model's ability to identify abnormal transactions, and ultimately obtain the target neural network model.
[0057] Optionally, Figure 3 is a schematic diagram of an optional model structure according to an embodiment of the present application, such as Figure 3 As shown, including the input layer x i(i is a positive integer less than or equal to t), representing the transaction data at different time points after receiving and processing; one or more hidden layers, composed of GRU units (GRUCell), each unit contains an update gate and a reset gate, which are responsible for controlling the transmission of information. The input of each GRUCell is x i and the hidden state h passed down from the previous GRUCell i ; and the output layer y i , used to generate analysis results. For example, taking the analysis of credit card transaction data as an example, the data processing system obtains a series of transaction data, which occur at different time points (t=1, 2, 3, ...). At t=1, the GRU network receives the first transaction data x1, and assumes that the initial hidden state h0 is a zero state or a predefined initial state. x1 and h0 pass through the first unit of the GRU network, and through the calculation of the update gate and the reset gate, the instant analysis result y1 and the new hidden state h1 are generated. h1 may contain important information about x1 and information retained from h0. Suppose the next transaction x2 is a large online shopping transaction. x2 and h1 are used as inputs for the second time step. Through calculation, the instant analysis result y2 and the updated hidden state h2 are generated, which integrates the information of x2 and the "memory" in h1, reflecting a potential change in behavior pattern. The same is true at t=3. Each new transaction data x i will be the same as the hidden state h at the previous time step i-1 Perform matching and generate instant analysis results i and the new hidden state h i Until the entire transaction sequence is processed, the continuous update of the hidden state helps the network build a dynamic "memory" of the customer's transaction behavior. Finally, the GRU network generates the final output y based on the hidden state of the entire sequence. t .
[0058] Optionally, Figure 4 is a flowchart of an optional model training according to an embodiment of the present application, such as Figure 4As shown, the data processing system first obtains a large amount of historical transaction data from the bank database or other financial institution's data storage system as the data source input of the model, then desensitizes the obtained data to protect user privacy, and performs normalization and other operations to ensure that the data is in an appropriate format and range before model training. The data after the above processing is then input into the GRU model for training and verification. At this stage, the model optimizes its parameters by learning patterns and trends in the data. At the same time, a portion of the data is used for verification to adjust the model and prevent overfitting, thereby increasing the generalization ability of the model. The trained GRU model then outputs analysis results, such as transaction classification or anomaly detection, which are then saved so that the model can be reloaded or used for subsequent decision support. Finally, the data processing system can use the analysis results of the GRU model to provide decision support, such as risk assessment, fraud detection (marking abnormal transactions by analyzing transaction patterns and behavioral characteristics) and personalized service configuration (the process of customizing services or products based on customers' specific needs, preferences and behavioral patterns). This information can help banks and financial institutions formulate strategies, optimize customer experience, improve customer satisfaction and improve operational efficiency.
[0059] From the above content, it can be seen that the data processing system systematically acquires, processes and analyzes user historical transaction data, combines the targeted feature sequence and time series construction, and realizes efficient training and optimal configuration selection of the deep learning model (i.e., the target neural network model) for abnormal transaction identification. That is, through comprehensive feature engineering and cross-validation-based model optimization strategy, a highly accurate target neural network model is constructed, which significantly improves the accuracy of abnormal transaction identification and real-time response speed, solves the problem of low accuracy of abnormal transaction identification in the existing technology, and provides financial institutions with more powerful and reliable transaction risk management and fraud detection tools.
[0060] In an optional embodiment, the data processing system first initializes the initial neural network using a preset hyperparameter combination to obtain a first model, then divides the target time series into a model training set and a model verification set, and then inputs the model training set into the first model for iterative training until the number of model iterations is greater than a preset number or the training error of the model is lower than a set threshold, thereby obtaining the target weight and target bias of the first model, and then updating the first model to a second model according to the target weight and target bias, and finally performing multiple verification operations on the second model according to the model verification set to obtain a target neural network model.
[0061] Optionally, the data processing system initializes the GRU neural network model using a preset hyperparameter combination (such as learning rate, number of hidden layer units, batch size, etc.) to obtain a first model, and then divides the target time series data into a model training set (for example, containing 70% of the data) and a model verification set (for example, containing 30% of the data) for model training and performance evaluation. The first model is iteratively trained using the model training set data for multiple times until the number of model iterations exceeds a preset number (for example, 100 times) or the model training error is lower than a set threshold (for example, 0.01). In this process, the model will continuously adjust its weights and biases to reduce the impact on normal interactions. The recognition errors of easy and abnormal transactions, when the first model reaches the preset training target, the data processing system can obtain the target weights and target bias of the model, and then use the target weights and target bias obtained in the iterative training process to update the first model to the second model, that is, the GRU model with optimized weights and biases. Thereafter, the second model is verified multiple times using the model verification set data. Each verification operation is based on the cross-validation strategy to evaluate the performance of the model on new data, which helps to determine whether the model is overfitting the training data, as well as the stability and accuracy of the model on different data sets. After multiple verification operations, the target neural network model is finally obtained.
[0062] From the above content, it can be seen that the data processing system enables the model to learn more complex transaction behavior patterns and improve the accuracy of identifying abnormal transactions through multiple iterations and verifications of the model. At the same time, based on the use of cross-validation and validation sets, the stability of the model on unseen data is ensured, and the generalization ability of the model is enhanced, making it more reliable in real-time transaction monitoring. The model based on the GRU network can capture the temporal characteristics and long-term dependencies of transaction data, analyze user behavior in real time, and automatically identify potential abnormal transactions, which can improve the efficiency and accuracy of risk control.
[0063] In an optional embodiment, when there are T training sets in the model training set, the data processing system uses the first model to perform data analysis on the T training sets to obtain analysis results corresponding to each training set, where T is an integer greater than or equal to 1, and then calculates the error between the analysis results corresponding to each training set and the actual transaction label corresponding to each training set to obtain T error values, and finally adjusts the weight and bias of the first model according to the T error values.
[0064] Optionally, the actual transaction label is a known classification of each transaction data point, that is, whether the transaction is an abnormal transaction. Transaction data labeled as normal transactions can be marked as 0, and abnormal transactions can be marked as 1.
[0065] Optionally, when there are multiple training sets in the model training set, the data processing system uses the first model to perform data analysis on the multiple training sets. The model will identify the classification result (normal transaction or abnormal transaction) of each transaction based on the current weight and bias, and obtain the preliminary analysis results corresponding to T training sets. For each training set, the error between the analysis result of the model and the actual transaction label is calculated (for example, using indicators such as mean square error and cross entropy loss), and T error values are obtained. According to the calculated T error values, the weight and bias of the first model are adjusted using optimization strategies such as back propagation algorithm and gradient descent to reduce the prediction error and improve the accuracy of the model. The above process constitutes an iterative training process. Repeat the above steps until the adjustment of the model weight and bias makes the overall prediction error lower than the set threshold, or reaches the preset number of iterations, and the target weight and target bias of the first model can be obtained.
[0066] From the above content, it can be seen that the data processing system calculates the prediction error by using the actual transaction label and adjusts the weight and bias of the model according to the error. The model can gradually learn the pattern of transaction behavior and improve the accuracy of identifying abnormal transactions. At the same time, since the model is trained on multiple training sets (T training sets), this helps the model maintain stability and accuracy on different types of transaction data and enhances generalization capabilities.
[0067] In an optional embodiment, the data processing system sets S groups of hyperparameter combinations, wherein different hyperparameter combinations are used to perform different parameter configurations on the second model, wherein S is an integer greater than or equal to 1, and then the second model is subjected to S verification operations based on the model verification set and the S groups of hyperparameter combinations to obtain S recognition accuracy rates, wherein each verification operation is used to cross-validate the second model determined using a set of hyperparameter combinations to obtain a recognition accuracy rate, and then a recognition accuracy rate greater than or equal to a preset threshold is selected from the S recognition accuracy rates as the target accuracy rate, and the hyperparameter combination corresponding to the target accuracy rate is used as the target hyperparameter combination, and then the target neural network model is determined based on the target hyperparameter combination and the second model.
[0068] Optionally, the S groups of hyperparameter combinations refer to a plurality of pre-set hyperparameter settings, each group of hyperparameter settings including different combinations of parameters such as learning rate, number of hidden layer units, batch size, etc.
[0069] Optionally, the data processing system performs S validation operations on the second model, each time using a set of hyperparameter combinations for cross-validation to obtain S recognition accuracy rates, selects the highest recognition accuracy rate from the S recognition accuracy rates as the target accuracy rate, and uses a set of hyperparameter combinations corresponding to the target accuracy rate to finally configure the second model to obtain a target neural network model.
[0070] For example, the data processing system sets S=5 sets of hyperparameter combinations, each set includes different learning rates, number of hidden layer units, batch size and other parameters. First, the second model is verified 5 times, each time using a set of hyperparameter combinations for cross-validation to obtain 5 recognition accuracy rates. For example, after training with the first set of hyperparameter combinations, it is evaluated on the model verification set and the recognition accuracy rate is 92%. Then the preset threshold is set to 90%, that is, the recognition accuracy rate of the model must be greater than or equal to 90% to be accepted. From the 5 recognition accuracy rates obtained, select an accuracy rate that reaches or exceeds 90%. Assuming that 3 accuracy rates exceed 90%, the corresponding 3 sets of hyperparameter combinations will become candidate target hyperparameter combinations. Subsequently, the set of hyperparameter combinations that makes the model perform best is selected as the target hyperparameter combination. Finally, the target hyperparameter combination is used to perform the final configuration of the second model to obtain the target neural network model.
[0071] From the above content, we can see that the data processing system can improve the accuracy of the model in abnormal transaction detection and reduce false positives and negatives by comparing the model recognition accuracy under different hyperparameter combinations and selecting the optimal combination. Cross-validation also ensures that the model not only performs well on training data, but also maintains high accuracy on unseen verification data, thereby enhancing the stability and reliability of the model.
[0072] In an optional embodiment, the data processing system performs K rounds of testing operations on the second model to obtain K recognition results, where K is an integer greater than or equal to 1, and each round of testing operations is used to select any sequence in the model verification set as a target test set, and use sequences other than the target test set as a target training set, use the target training set to perform a round of training on the second model, use the trained second model to analyze the target test set to obtain a recognition result, and then determine K accuracy rates of the second model based on the K recognition results, where the Rth accuracy rate among the K accuracy rates is used to characterize the recognition accuracy of the second model after completing the Rth round of testing operations in the K rounds of testing operations, where R is a positive integer less than or equal to K, and finally calculate the average of the K accuracy rates as the recognition accuracy rate of the second model.
[0073] Optionally, the data processing system performs K rounds of testing operations on the second model, and each round of operations includes: using the target training set to perform a round of training on the second model, updating the model parameters, using the trained second model to analyze the target test set to obtain recognition results, and then calculating the recognition accuracy of the second model on the target test set based on the recognition results. After completing K rounds of testing operations, K accuracy rates are obtained, and the average of the K accuracy rates is calculated, and the average value is used as the recognition accuracy of the second model.
[0074] From the above content, it can be seen that the data processing system ensures that the model can be trained and tested on all data through cross-validation, improves the performance of the model on unseen data, enhances the generalization ability of the model, and each round of testing operations uses a different target test set for verification, which can effectively prevent the model from being over-optimized on a specific data set and reduce the risk of overfitting.
[0075] In an optional embodiment, the data processing system performs encoding processing on N feature value sequences, wherein the encoding processing is used to perform one-hot encoding on variable information corresponding to each feature value in the N feature value sequences, and to convert non-numeric data in the N feature value sequences into numerical feature data.
[0076] Optionally, for categorical features, such as transaction type and transaction location, the data processing system uses one-hot encoding to convert N feature value sequences into numerical features, where one-hot encoding is a technique for converting categorical variables into binary vectors. For non-numeric data, such as transaction category, merchant type, etc., the system uses digitization methods to convert them into numerical feature data.
[0077] Optionally, Figure 5 is a flowchart of an optional transaction data processing according to an embodiment of the present application, such as Figure 5 As shown in the figure, the data processing system first performs data cleaning operations on the acquired user historical transaction data, including identifying and correcting errors in the data, removing duplicate records, processing missing values, etc., to ensure the quality and consistency of the data set, and then performs feature selection to screen out features that have a significant impact on the identification target from the cleaned data. The purpose is to reduce the complexity of the model, improve training efficiency, and reduce the risk of overfitting by reducing unnecessary features. Then, the selected features are further processed (feature engineering), such as normalization, encoding, and conversion. In this step, data desensitization is performed at the same time to ensure that all sensitive information is properly processed to protect the user's personal privacy information. The processed data is then divided into training set, validation set, and test set (data set partitioning). This division allows the model to be trained and evaluated on different data sets to verify its performance and generalization ability. Finally, a time series is constructed, that is, the above-mentioned processed features are sorted in the chronological order of transactions. This step involves organizing the data into a time series format, which is crucial for capturing the time dependency of transaction behavior. Through this series of data preprocessing steps, the data processing system can ensure that the data input into the GRU network model is both accurate and secure, providing a guarantee for effective training and reliable analysis of the model.
[0078] From the above content, it can be seen that the data processing system enhances the model's understanding and processing capabilities of different types of features through the above preprocessing operations. The encoded feature data is in a unified form, which is conducive to the rapid learning and training of the model, thereby improving the operating efficiency of the entire system. In addition, the encoding processing of the feature data can help the model better capture the differences and information between features, thereby improving the accuracy of the model in identifying normal transactions and abnormal transactions (such as fraudulent transactions), while ensuring that the format and structure of the data match the requirements of the GRU network model.
[0079] Example 2
[0080] The embodiment of the present application also provides a transaction data analysis device. It should be noted that the transaction data analysis device of the embodiment of the present application can be used to execute the transaction data analysis method provided in the embodiment of the present application. The transaction data analysis device provided in the embodiment of the present application is introduced below.
[0081] According to an embodiment of the present application, a device for implementing the above transaction data analysis method is also provided. Figure 6 is a schematic diagram of an optional transaction data analysis device according to an embodiment of the present application, such as Figure 6 As shown, the device includes: an acquisition unit 601, a selection unit 602, and a determination unit 603.
[0082] Optionally, an acquisition unit 601 is used to acquire the transaction data of a target user; a selection unit 602 is used to perform feature selection on the transaction data of the target user according to a target feature sequence to obtain transaction data features of the target user, wherein the features in the target feature sequence have a higher probability of appearing in abnormal transaction data than in normal transaction data; a determination unit 603 is used to input the transaction data features of the target user into a target neural network model, and determine abnormal transactions in the transaction data of the target user based on the transaction data features of the target user according to prior knowledge learned by the target neural network model in a model training phase, wherein the target neural network model is a model obtained by updating an initial neural network model according to a target hyperparameter combination, wherein the initial neural network model is used to process and analyze time series features in transaction data and identify abnormal transactions, and the target hyperparameter combination is a hyperparameter of the model determined based on a cross-validation method during pre-training.
[0083] Optionally, the determination unit 603 includes: a first acquisition subunit, a first extraction subunit, a first arrangement subunit, and a first training subunit. The first acquisition subunit is used to acquire N first data, wherein each first data represents the historical transaction data of a user, wherein N is an integer greater than or equal to 1, and the historical transaction data is the abnormal transaction data or normal transaction data of the user; the first extraction subunit is used to extract the feature value corresponding to the feature in the target feature sequence from each of the N first data to obtain N feature value sequences; the first arrangement subunit is used to arrange the N feature value sequences in the order of transaction time to obtain the target time sequence; the first training subunit is used to perform multiple iterative training and verification operations on the initial neural network model according to the target time sequence to obtain the target neural network model, wherein the multiple iterative training is used to determine the target weight and target bias of the model, and the verification operation determines the target hyperparameter combination of the model based on the cross-validation method.
[0084] Optionally, the first training subunit includes: a first processing module, a first partitioning module, a first training module, a first updating module, and a first verification module. Among them, the first processing module is used to initialize the initial neural network using a preset hyperparameter combination to obtain a first model; the first partitioning module is used to divide the target time series into a model training set and a model verification set; the first training module is used to input the model training set into the first model for iterative training until the number of model iterations is greater than a preset number or the training error of the model is lower than a set threshold, and the target weight and target bias of the first model are obtained; the first updating module is used to update the first model to a second model according to the target weight and target bias; the first verification module is used to perform multiple verification operations on the second model according to the model verification set to obtain a target neural network model.
[0085] Optionally, the first training module includes: a first analysis submodule, a first calculation submodule, and a first adjustment submodule. The first analysis submodule is used to perform data analysis on the T training sets using the first model when there are T training sets in the model training set, and obtain the analysis results corresponding to each training set, wherein T is an integer greater than or equal to 1; the first calculation submodule is used to calculate the error between the analysis result corresponding to each training set and the actual transaction label corresponding to each training set, and obtain T error values; the first adjustment submodule is used to adjust the weight and bias of the first model according to the T error values.
[0086] Optionally, the first verification module includes: a first setting submodule, a first verification submodule, a first selection submodule, a first determination submodule, and a second determination submodule. The first setting submodule is used to set S groups of hyperparameter combinations, wherein different hyperparameter combinations are used to perform different parameter configurations on the second model, wherein S is an integer greater than or equal to 1; the first verification submodule is used to perform S verification operations on the second model according to the model verification set and the S groups of hyperparameter combinations to obtain S recognition accuracy rates, wherein each verification operation is used to cross-validate the second model determined using a set of hyperparameter combinations to obtain a recognition accuracy rate; the first selection submodule is used to select a recognition accuracy rate greater than or equal to a preset threshold from the S recognition accuracy rates as the target accuracy rate; the first determination submodule is used to use the hyperparameter combination corresponding to the target accuracy rate as the target hyperparameter combination; the second determination submodule is used to determine the target neural network model according to the target hyperparameter combination and the second model.
[0087] Optionally, the first verification submodule includes: a first test component, a first determination component, and a first calculation component. The first test component is used to perform K rounds of test operations on the second model to obtain K recognition results, wherein K is an integer greater than or equal to 1, and each round of test operation is used to select any sequence in the model verification set as the target test set, and use the sequence other than the target test set as the target training set, use the target training set to perform a round of training on the second model, and use the trained second model to analyze the target test set to obtain a recognition result; the first determination component is used to determine K accuracy rates of the second model based on the K recognition results, wherein the Rth accuracy rate among the K accuracy rates is used to characterize the recognition accuracy of the second model after completing the Rth round of test operations in the K rounds of test operations, wherein R is a positive integer less than or equal to K; the first calculation component is used to calculate the average value of the K accuracy rates as the recognition accuracy rate of the second model.
[0088] Optionally, the transaction data analysis device also includes: a first processing unit, used to encode the N feature value sequences, wherein the encoding processing is used to uniquely encode the variable information corresponding to each feature value in the N feature value sequences, and to convert non-numeric data in the N feature value sequences into numerical feature data.
[0089] Example 3
[0090] An embodiment of the present application may provide an electronic device, Figure 7 is a structural block diagram of an electronic device according to an embodiment of the present application. Figure 7 As shown, the electronic device may include: one or more ( Figure 7(only one is shown) processor 702, memory 704, storage controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.
[0091] Among them, the memory can be used to store software programs and modules, such as program instructions / modules corresponding to the methods and devices in the embodiments of the present application, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0092] The processor can call the information and application programs stored in the memory through the transmission device to perform the following steps: obtain the transaction data of the target user; perform feature selection on the transaction data of the target user according to the target feature sequence to obtain the transaction data features of the target user, wherein the probability of the features in the target feature sequence appearing in the abnormal transaction data is greater than the probability of appearing in the normal transaction data; input the transaction data features of the target user into the target neural network model, and determine the abnormal transactions in the transaction data of the target user based on the transaction data features of the target user according to the prior knowledge learned by the target neural network model in the model training stage, wherein the target neural network model is a model obtained by updating the initial neural network model according to the target hyperparameter combination, wherein the initial neural network model is used to process and analyze the time series features in the transaction data and identify abnormal transactions, and the target hyperparameter combination is the hyperparameters of the model determined based on the cross-validation method during pre-training.
[0093] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: obtain N first data, wherein each first data represents the historical transaction data of a user, wherein N is an integer greater than or equal to 1, and the historical transaction data is the user's abnormal transaction data or normal transaction data; extract the feature value corresponding to the feature in the target feature sequence from each first data of the N first data to obtain N feature value sequences; arrange the N feature value sequences in order of transaction time to obtain a target time series; perform multiple iterative training and verification operations on the initial neural network model according to the target time series to obtain a target neural network model, wherein the multiple iterative training is used to determine the target weight and target bias of the model, and the verification operation determines the target hyperparameter combination of the model based on a cross-validation method.
[0094] The processor can call the information and application programs stored in the memory through the transmission device to perform the following steps: initialize the initial neural network using a preset hyperparameter combination to obtain a first model; divide the target time series into a model training set and a model verification set; input the model training set into the first model for iterative training until the number of model iterations is greater than a preset number or the training error of the model is lower than a set threshold, thereby obtaining the target weight and target bias of the first model; update the first model to a second model according to the target weight and target bias; and perform multiple verification operations on the second model according to the model verification set to obtain a target neural network model.
[0095] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: when there are T training sets in the model training set, use the first model to perform data analysis on the T training sets to obtain analysis results corresponding to each training set, where T is an integer greater than or equal to 1; calculate the error between the analysis result corresponding to each training set and the actual transaction label corresponding to each training set to obtain T error values; adjust the weight and bias of the first model according to the T error values.
[0096] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: set S groups of hyperparameter combinations, where different hyperparameter combinations are used to perform different parameter configurations on the second model, where S is an integer greater than or equal to 1; perform S verification operations on the second model according to the model verification set and the S groups of hyperparameter combinations to obtain S recognition accuracy rates, where each verification operation is used to cross-validate the second model determined using a set of hyperparameter combinations to obtain a recognition accuracy rate; select a recognition accuracy rate greater than or equal to a preset threshold from the S recognition accuracy rates as the target accuracy rate; use the hyperparameter combination corresponding to the target accuracy rate as the target hyperparameter combination; and determine the target neural network model based on the target hyperparameter combination and the second model.
[0097] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: perform K rounds of test operations on the second model to obtain K recognition results, wherein K is an integer greater than or equal to 1, and each round of test operation is used to select any sequence in the model verification set as the target test set, and use the sequences other than the target test set as the target training set, use the target training set to perform a round of training on the second model, and use the trained second model to analyze the target test set to obtain a recognition result; determine K accuracy rates of the second model based on the K recognition results, wherein the Rth accuracy rate among the K accuracy rates is used to characterize the recognition accuracy of the second model after completing the Rth round of test operations in the K rounds of test operations, wherein R is a positive integer less than or equal to K; calculate the average of the K accuracy rates as the recognition accuracy rate of the second model.
[0098] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: encode the N feature value sequences, wherein the encoding process is used to uniquely encode the variable information corresponding to each feature value in the N feature value sequences, and convert the non-numeric data in the N feature value sequences into numerical feature data.
[0099] It can be understood by those skilled in the art that Figure 7 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, or other terminal devices. Figure 7 The structure of the electronic device is not limited. Figure 7 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 7 Different configurations are shown.
[0100] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0101] Example 4
[0102] The embodiment of the present application further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the transaction data analysis method provided in the first embodiment.
[0103] Optionally, in this embodiment, the above storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.
[0104] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing the program steps of the method for analyzing transaction data.
[0105] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0106] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0107] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0108] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0109] In addition, each functional unit in each embodiment of the present application can be integrated into a training unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units.
[0110] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0111] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for analyzing transaction data, characterized in that: include: Obtain transaction data of target users; Performing feature selection on the transaction data of the target user according to the target feature sequence to obtain transaction data features of the target user, wherein the probability of the features in the target feature sequence appearing in the abnormal transaction data is greater than the probability of appearing in the normal transaction data; The transaction data features of the target user are input into the target neural network model, and based on the prior knowledge learned by the target neural network model in the model training stage, the abnormal transactions in the transaction data of the target user are determined based on the transaction data features of the target user, wherein the target neural network model is a model obtained by updating the initial neural network model according to the target hyperparameter combination, wherein the initial neural network model is used to process and analyze the time series features in the transaction data and identify abnormal transactions, and the target hyperparameter combination is the hyperparameters of the model determined based on cross-validation during pre-training.
2. The method for analyzing transaction data according to claim 1, characterized in that: The target neural network model is obtained by the following steps: Acquire N first data, wherein each first data represents historical transaction data of a user, wherein N is an integer greater than or equal to 1, and the historical transaction data is abnormal transaction data or normal transaction data of the user; Extracting a feature value corresponding to a feature in the target feature sequence from each of the N first data to obtain N feature value sequences; Arrange the N characteristic value sequences in the order of transaction time to obtain a target time series; The target neural network model is obtained by performing multiple iterative training and validation operations on the initial neural network model according to the target time series, wherein the multiple iterative trainings are used to determine the target weights and target biases of the model, and the validation operation determines the target hyperparameter combination of the model based on a cross-validation method.
3. The transaction data analysis method according to claim 2, characterized in that: Performing multiple iterative training and verification operations on the initial neural network model according to the target time series to obtain the target neural network model, including: Initializing the initial neural network using a preset hyperparameter combination to obtain a first model; Dividing the target time series into a model training set and a model validation set; Inputting the model training set into the first model for iterative training until the number of model iterations is greater than a preset number or the training error of the model is lower than a set threshold, thereby obtaining the target weight and target bias of the first model; Updating the first model to a second model according to the target weight and the target bias; The verification operation is performed multiple times on the second model according to the model verification set to obtain the target neural network model.
4. The transaction data analysis method according to claim 3, characterized in that: Each training iteration consists of the following steps: When there are T training sets in the model training set, use the first model to perform data analysis on the T training sets to obtain an analysis result corresponding to each training set, where T is an integer greater than or equal to 1; Calculate the error between the analysis result corresponding to each training set and the actual transaction label corresponding to each training set to obtain T error values; The weights and biases of the first model are adjusted according to the T error values.
5. The method for analyzing transaction data according to claim 3, characterized in that: Performing the verification operation on the second model multiple times according to the model verification set to obtain the target neural network model includes: Setting S groups of hyperparameter combinations, wherein different hyperparameter combinations are used to perform different parameter configurations on the second model, wherein S is an integer greater than or equal to 1; Performing S validation operations on the second model according to the model validation set and S groups of hyperparameter combinations to obtain S recognition accuracy rates, wherein each validation operation is used to cross-validate the second model determined using a group of hyperparameter combinations to obtain a recognition accuracy rate; Selecting a recognition accuracy rate greater than or equal to a preset threshold from the S recognition accuracy rates as a target accuracy rate; Using a hyperparameter combination corresponding to the target accuracy as the target hyperparameter combination; The target neural network model is determined according to the target hyperparameter combination and the second model.
6. The method for analyzing transaction data according to claim 5, characterized in that: The verification operation includes the following steps: Performing K rounds of testing operations on the second model to obtain K recognition results, where K is an integer greater than or equal to 1, and each round of testing operation is used to select any sequence in the model validation set as a target test set, and use sequences other than the target test set as a target training set, perform one round of training on the second model using the target training set, and use the trained second model to analyze the target test set to obtain a recognition result; Determine K accuracy rates of the second model according to the K recognition results, wherein an Rth accuracy rate among the K accuracy rates is used to characterize the recognition accuracy of the second model after the Rth round of test operations in the K rounds of test operations are completed, wherein R is a positive integer less than or equal to K; Calculate an average of the K accuracy rates as the recognition accuracy rate of the second model.
7. The method for analyzing transaction data according to claim 2, characterized in that: After extracting a feature value corresponding to a feature in the target feature sequence from each of the N first data to obtain N feature value sequences, the transaction data analysis method further includes: The N feature value sequences are encoded, wherein the encoding process is used to perform one-hot encoding on the variable information corresponding to each feature value in the N feature value sequences, and to convert the non-numeric data in the N feature value sequences into numeric feature data.
8. A transaction data analysis device, characterized in that: include: An acquisition unit, which acquires transaction data of a target user; a selection unit, performing feature selection on the transaction data of the target user according to a target feature sequence to obtain transaction data features of the target user, wherein the probability of the features in the target feature sequence appearing in the abnormal transaction data is greater than the probability of the features appearing in the normal transaction data; A determination unit inputs the transaction data features of the target user into a target neural network model, and determines abnormal transactions in the transaction data of the target user based on the transaction data features of the target user according to the prior knowledge learned by the target neural network model in the model training phase, wherein the target neural network model is a model obtained by updating the initial neural network model according to a target hyperparameter combination, wherein the initial neural network model is used to process and analyze time series features in transaction data and identify abnormal transactions, and the target hyperparameter combination is a hyperparameter of the model determined based on a cross-validation method during pre-training.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located executes the transaction data analysis method according to any one of claims 1 to 7.
10. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the transaction data analysis method described in any one of claims 1 to 7.
11. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the steps of the transaction data analysis method described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
User type determination method and device, computer equipment and storage medium
CN117272108A
Transaction early warning method and device, computer equipment and storage medium
CN117273922A
Transaction risk prediction method, model training method, device, equipment, medium and program product
CN117934154A
Methods and arrangements to detect fraudulent transactions
US20200065812A1