Transaction data analysis method and device, storage medium and electronic equipment
By using a neural network model optimized through feature selection and cross-validation, combined with a GRU network to process credit card transaction data, the problem of low accuracy in identifying abnormal transactions in existing technologies is solved. This enables the capture of long-term dependencies and accurate identification of abnormal transactions, thereby improving the efficiency and accuracy of transaction risk management.
Patent Information
- Application Number
- CN202411974377.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-12-30
AI Technical Summary
Existing technologies have low accuracy in identifying abnormal transactions in credit card transaction data analysis, especially when processing long-sequence data, making it difficult to capture long-term dependencies in transaction data. Furthermore, traditional methods are not well-suited for handling large-scale, high-dimensional time-series data.
By acquiring the transaction data of target users, feature selection is performed, and an abnormal transaction is identified using a target neural network model. The model optimizes the hyperparameter combination through feature engineering and cross-validation, and combines it with a GRU network to process time-series features to identify abnormal transactions.
It improves the accuracy and efficiency of abnormal transaction identification, can capture long-term dependencies, enhances the model's generalization ability and real-time response capability, and provides a more powerful transaction risk management and fraud detection tool.
Smart Images

Figure CN119887388B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of artificial intelligence, in particular, to a transaction data analysis method and device, a storage medium and an electronic device. BACKGROUND
[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 in processing credit card transaction data are often limited by the limitations of traditional statistical methods and machine learning techniques, particularly in the accuracy of identifying abnormal transactions.
[0003] Traditional data analysis methods such as logistic regression and decision trees, while stable in handling static data sets, struggle to capture the temporal characteristics and dynamic patterns inherent in transaction data. Credit card transaction details are a typical time series data, each transaction is not only affected by immediate factors, but also constrained by historical transaction behavior. On the other hand, while RNN (Recurrent Neural Network) is introduced into credit card transaction analysis due to its ability to handle sequence data, RNN faces a serious gradient vanishing problem when dealing with long sequence data, making it difficult for the model to learn long-term dependencies in the data. This means that in complex credit card transaction scenarios, RNN models may not accurately identify abnormal transactions, especially those that require long-term transaction patterns to determine abnormal behavior. In addition, with the surge in credit card transactions, the dimensionality and complexity of transaction data are constantly increasing, further increasing the difficulty of identifying abnormal transactions. Existing methods often struggle to handle such large-scale, high-dimensional time series data, resulting in limited accuracy of analysis results.
[0004] To address the above problems, no effective solutions have been proposed. SUMMARY
[0005] The present application provides a transaction data analysis method and device, a storage medium and an 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] In order to achieve the above object, according to one aspect of the present application, a transaction data analysis method is provided, comprising: obtaining 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 a feature in the target feature sequence has a probability of appearing in abnormal transaction data that is greater than a probability of appearing in normal transaction data; inputting the transaction data features of the target user into a target neural network model to 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 stage, wherein the target neural network model is a model obtained by updating an initial neural network model according to a target hyperparameter combination, the initial neural network model is used to process and analyze time sequence 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 manner 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, 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 the target feature sequence from each first data in the N first data to obtain N feature value sequences; arranging the N feature value sequences in a transaction time sequence to obtain a target time sequence; and performing multiple iteration training and validation operations on the initial neural network model according to the target time sequence to obtain the target neural network model, wherein the multiple iteration training is used to determine 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 manner.
[0008] Optionally, the multiple iteration training and validation operations on the initial neural network model according to the target time sequence to obtain the target neural network model comprise: initializing the initial neural network using a preset hyperparameter combination to obtain a first model; dividing the target time sequence into a model training set and a model validation set; inputting the model training set into the first model for iteration 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 to obtain target weights and target biases of the first model; updating the first model to a second model according to the target weights and the target biases; and performing multiple validation operations on the second model according to the model validation set to obtain the target neural network model.
[0009] Optionally, each iteration training comprises the following steps: when there are T training sets in the model training set, performing data analysis on the T training sets by using the first model to obtain an analysis result corresponding to each training set, wherein 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; and adjusting the weight and bias of the first model according to the T error values.
[0010] Optionally, the second model is subjected to multiple verification operations according to the model verification set to obtain a target neural network model, comprising: setting S groups of hyperparameter combinations, wherein different hyperparameter combinations are used to configure different parameters for the second model, and 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 identification accuracies, wherein each verification operation is used to perform cross-validation on the second model determined using a group of hyperparameter combinations to obtain an identification accuracy; selecting an identification accuracy greater than or equal to a preset threshold from the S identification accuracies as a target accuracy; taking the hyperparameter combination corresponding to the target accuracy as a target hyperparameter combination; and determining the target neural network model according to the target hyperparameter combination and the second model.
[0011] Optionally, the verification operation comprises the following steps: performing K rounds of test operations on the second model to obtain K identification results, wherein K is an integer greater than or equal to 1, each round of test operation is used to select any one sequence in the model verification set as a target test set, and sequences other than the target test set are taken as a target training set, the second model is trained using the target training set, and the trained second model is used to analyze the target test set to obtain an identification result; determining K accuracies of the second model according to the K identification results, wherein the Rth accuracy in the K accuracies represents the identification accuracy of the second model after the Rth round of test operation in the K rounds of test operation is completed, and R is a positive integer less than or equal to K; and calculating the average of the K accuracies as the identification accuracy of the second model.
[0012] Optionally, after extracting the feature values corresponding to the features in the target feature sequence from each of the N first data to obtain N feature value sequences, the transaction data analysis method further comprises: performing encoding processing on 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 convert non-numeric data in the N feature value sequences into numeric feature data.
[0013] To achieve the above object, according to another aspect of the present application, there is further provided an analysis device for transaction data, comprising: an acquisition unit configured to acquire transaction data of a target user; a selection unit configured 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 a feature in the target feature sequence has a probability of appearing in abnormal transaction data that is greater than a probability of appearing in normal transaction data; and a determination unit configured 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 prior knowledge learned by the target neural network model in a model training stage, wherein the target neural network model is a model obtained by updating an initial neural network model according to a target hyperparameter combination, the initial neural network model is configured to process and analyze time sequence 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 manner during pre-training.
[0014] According to another aspect of the present application, there is further provided a computer readable storage medium having a computer program stored therein, wherein the computer program, when executed, causes a device in which the computer readable storage medium is located to perform the analysis method for transaction data.
[0015] According to another aspect of the present application, there is further provided an electronic device comprising one or more processors and a memory configured to store one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the analysis method for transaction data.
[0016] According to another aspect of the present application, there is further provided a computer program product comprising computer instructions configured to implement the steps of the analysis method for transaction data when executed by a processor.
[0017] In the present application, first, the transaction data of the target user is acquired, then the transaction data of the target user is selected according to the target feature sequence, and the transaction data features of the target user are obtained, 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 transaction in the transaction data of the target user is determined based on 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 sequence 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 the pre-training, that is, by selecting features from the user transaction data to obtain transaction data features, inputting the obtained transaction data features into the target neural network model constructed by comprehensive feature engineering and model parameter optimization for identification, the purpose of accurate modeling and abnormal detection is achieved, thereby realizing 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. BRIEF DESCRIPTION OF DRAWINGS
[0018] The accompanying drawings, which form a part of this application, are included to provide a further understanding of the application and are incorporated in and constitute a part of this application. The embodiments of this application and their
[0019] Figure 1 A hardware structure block diagram of a computer terminal for implementing the 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 7is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to make the personnel in the technical field better understand the scheme of the present application, the technical scheme in the embodiments of the present application will be clearly and completely described below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work should belong to the scope of protection of the present application.
[0027] It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units 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 equipment information, user personal information, etc.) and data (including but not limited to data for display, analyzed data, etc.) involved in the present application are information and data authorized by the user or authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of related data comply with relevant laws, regulations and standards, necessary security measures are taken, do not violate public order and good customs, and provide corresponding operation portal for user to choose authorization or refusal. For example, the system and related users or institutions are provided with an interface to provide the user with a corresponding operation portal for the user to choose to agree or refuse the automatic decision result; if the user chooses to refuse, the expert decision process is entered.
[0029] Embodiment 1
[0030] According to an embodiment of the present application, an embodiment of a transaction data analysis method is provided. It should be noted that the steps shown in the flowchart of the 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 herein can be executed in an order different from that shown herein.
[0031] It should be noted that a data processing system can be used as an execution subject of the transaction data analysis method of the embodiments of the present application. It can be understood that the transaction data analysis method provided by the embodiments of the present application can also be used as an execution subject by other systems or devices, which are not limited in the embodiments of the present application.
[0032] The method embodiments provided in the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing the transaction data analysis method is shown. As shown in the figure, Figure 1 The computer terminal 10 (or mobile device) can include one or more processors 102 (the processor 102 can 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 can also include a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which can be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. Those skilled in the art can understand that, Figure 1 The structure shown in the figure is only schematic, and does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 10 can include more or less components than those shown in the figure, or have a different configuration from that shown in the figure. Figure 1 For example, the computer terminal 10 can include more or less components than those shown in the figure, or have a different configuration from that shown in the figure. Figure 1 For example, the computer terminal 10 can include more or less components than those shown in the figure, or have a different configuration from that shown in the figure.
[0033] It should be noted that the one or more processors 102 and / or other data processing circuits described above can be referred to as "data processing circuits" herein. The data processing circuit can be embodied in whole or in part as software, hardware, firmware or any combination thereof. In addition, the data processing circuit can be a single independent processing module, or any one of the other elements combined into the computer terminal 10 (or mobile device) in whole or in part. As the transaction data analysis method involved in the embodiments of the present application, the data processing circuit is used as a processor control (for example, the selection of the variable resistance terminal path connected with the interface).
[0034] Memory 104 can be used to store software programs and modules for application software, such as the program instructions / data storage device corresponding to the transaction data analysis method in the embodiments of the present application. Processor 102 executes the software programs and modules stored in memory 104 to perform various functional applications and data processing, thereby implementing the transaction data analysis method described above. Memory 104 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 104 may further include memory remotely located relative to processor 102, and such remote memory may be connected to computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0035] The transmission device 106 is configured to receive or transmit data via a network. A specific example of the aforementioned network may include a wireless network provided by the communications provider of the computer terminal 10. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module, which is configured 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 flow chart of an optional transaction data analysis method according to an embodiment of the present application. Figure 2 As shown, the method includes the following steps:
[0038] Step S201: Acquire transaction data of the target user.
[0039] Optionally, the data processing system obtains the target user's transaction data, 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 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.
[0042] Optionally, the target feature sequence is a series of predefined features, the probability of which appearing in the abnormal transaction data is higher than in the normal transaction data. For example, 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 filters out those features that can effectively distinguish between normal transactions and abnormal transactions, forming the transaction data features of the target user.
[0044] In step S203, 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 prior knowledge learned by the target neural network model in the model training stage.
[0045] In step S203, the target neural network model is the 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, and the target hyperparameter combination is the hyperparameters of the model determined based on cross-validation during pre-training.
[0047] Optionally, the data processing system takes the transaction data features of the target user after feature selection as input for the target neural network model to analyze. The model evaluates the target transaction data features based on the prior knowledge learned in the training stage to determine which transactions may belong to the abnormal category.
[0048] Optionally, the initial neural network model is used to process and analyze the long-term dependence and time series features in the transaction data, where the long-term dependence refers to the fact that in time series data, the current output depends not only on the most recent input, but also on earlier inputs in the sequence; the time series feature refers to the fact that in time series data, the value of a data point is not only influenced by the current time, but also associated with data points at one or more past times, which indicates that the distribution and pattern of data change 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), which is a special RNN structure and an improved recurrent neural network unit designed to process sequence data and has a significant advantage in capturing long-term dependencies. It controls the flow of information by introducing update and reset gates, effectively solving the gradient vanishing and gradient explosion problems that occur when traditional RNNs process long sequence data, allowing the network to maintain a stable learning state over long time sequences. RNN is an artificial neural network used to process sequence data, characterized by the presence of recurrent connections in the network, allowing the network to maintain certain states or memories. 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 phenomenon that during the training of deep neural networks, the error gradient gradually decreases during backpropagation, resulting in slow network weight updates or almost no updates, making it difficult for the network to learn long-term dependencies in the data. This phenomenon is particularly pronounced in recurrent neural networks, as they need to capture long-term dependencies in time series data through multiple layers of network structure.
[0050] It should be noted that the core of the GRU network model lies in its two key components: update and reset gates. These two gates control the flow of information, allowing the network to capture long-term dependencies while mitigating the gradient vanishing problem. The update gate is responsible for determining which information should be passed from short-term memory to long-term memory, and it is implemented using a sigmoid function with an output value between 0 and 1, indicating the degree of information retention. The reset gate determines which information should be forgotten, also using a sigmoid function, but the output value determines the degree of information discard. When processing credit card transaction details, each transaction data is first preprocessed, including desensitization to protect user privacy. Then, these data are input into the GRU network model. At each time step, the network updates its hidden state through the coordinated work of the update and reset gates. This hidden state is the network's "memory" 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, such as normal consumption behavior and potential fraudulent behavior, based on historical transaction data.
[0051] Optionally, the data processing system obtains the transaction data of the target user, which contains the transaction record of each transaction of the user, including the transaction amount, transaction time, transaction type, etc. Then, the system cleans the data, removes duplicate and useless records, fills or deletes missing values, to ensure the accuracy and reliability of the data. Then, the data processing system selects the features corresponding to the features in the target feature sequence from the cleaned data, which can capture the dynamic changes and rules of transaction behavior, and help the model learn. Then, feature engineering is performed, including data normalization, encoding and conversion, to optimize the feature input format, and data de-identification is performed to ensure user privacy. Then, the processed features are input into the target neural network model based on the GRU network, which has learned the time sequence features in a large amount of transaction data in the previous model training stage and has the ability to identify normal and abnormal transactions. The system analyzes the transaction data features of the target user based on the prior knowledge accumulated by the model in the training stage, and identifies the abnormal transactions in the transaction data of the target user.
[0052] As can be seen from steps S201 to S205, in the present application, the transaction data of the target user is first obtained, then the transaction data of the target user is selected according to the target feature sequence, and the transaction data features of the target user are obtained, 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, 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 the 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 sequence 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, i.e. through feature selection on user transaction data to obtain transaction data features, and inputting the obtained transaction data features into the target neural network model constructed through comprehensive feature engineering and model parameter optimization for identification, the purpose of precise modeling and anomaly detection is achieved, thereby realizing 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, each of which represents historical transaction data of a user, where N is an integer greater than or equal to 1, and the historical transaction data is either abnormal transaction data or normal transaction data of the user, then extracts feature values corresponding to features in the target feature sequence from each of the N first data to obtain N feature value sequences, then arranges the N feature value sequences in chronological order of transactions to obtain a target time sequence, and finally performs multiple iteration training and validation operations on the initial neural network model according to the target time sequence to obtain a target neural network model, where the multiple iteration training is 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 manner.
[0054] Optionally, the historical transaction data refers to the credit card transaction records of the user in the past, including but not limited to transaction time, transaction amount, transaction location and other detailed information; the abnormal transaction data refers to transaction records that do not conform to the user's normal transaction pattern, such as large abnormal consumption, transactions at unusual times or places, etc.; and the 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, and performs data backup regularly.
[0056] Optionally, the data processing system obtains N sets of historical credit card transaction data, each set of transaction data corresponding to the historical transaction records of a user, including the user's normal transaction records and abnormal transaction records, to obtain N first data. The data processing system then performs feature extraction on each first data to filter feature values corresponding to features in the target feature sequence from the historical transaction data, where the target feature sequence pre-defines data features that have a significantly higher occurrence probability in abnormal transactions than in normal transactions, which can include transaction frequency, transaction amount, transaction location change, etc. The extracted feature values are then organized into N feature value sequences and arranged in chronological order of transaction occurrence to form a target time sequence. After the feature value sequences and time sequences are constructed, the data processing system uses the target time sequence to perform multiple iteration training and validation operations on the initial neural network model to continuously adjust the weights and biases of the model and optimize hyperparameters such as learning rate and number of hidden layer units to improve the model's ability to identify abnormal transactions, and finally obtains a 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, as shown in Figure 3 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, an immediate analysis result y1 and a 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 serve as input for the second time step. Through calculation, an immediate analysis result y2 and an 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 of 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 This is a flow chart of an optional model training according to an embodiment of the present application, such as Figure 4As shown, the data processing system first acquires a large amount of historical transaction data from the bank database or other financial institution's data storage system as the data source input for the model, then performs desensitization processing on the acquired data to protect user privacy, while performing normalization and other operations to ensure that the data is in the appropriate format and range before model training, and then inputs the data processed as above into the GRU model for training and verification. In this stage, the model learns the patterns and trends in the data to optimize its parameters, while using a portion of the data for verification to adjust the model and prevent overfitting, increasing the model's generalization ability. Then the trained GRU model outputs the analysis results, such as transaction classification or anomaly detection, which are then saved for reloading the model 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 (by analyzing transaction patterns and behavior characteristics to mark abnormal transactions), and personalized service configuration (a process of customizing services or products according to customers' specific needs, preferences, and behavior patterns), which can help banks and financial institutions develop strategies, optimize customer experience, improve customer satisfaction, and improve operational efficiency.
[0059] As can be seen from the above, the data processing system realizes efficient training and optimal configuration selection of the deep learning model (i.e., the target neural network model) for abnormal transaction identification by systematically acquiring, processing, and analyzing user historical transaction data, combining the pertinence of feature sequences and the construction of time series, i.e., by constructing a highly accurate target neural network model through comprehensive feature engineering and model optimization strategies based on cross-validation, significantly improving the accuracy and real-time response speed of abnormal transaction identification, solving the problem of low accuracy of abnormal transaction identification in the prior art, and providing financial institutions with more powerful and reliable transaction risk management and fraud detection tools.
[0060] In an alternative embodiment, the data processing system first initializes an 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 validation set, 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, obtaining the target weight and target bias of the first model, then updating the first model to a second model according to the target weight and target bias, and finally performing multiple validation operations on the second model according to the model validation set to obtain the target neural network model.
[0061] Optionally, the data processing system initializes the GRU neural network model using a preset combination of hyperparameters (such as learning rate, number of hidden layer units, batch size, etc.), obtains a first model, and then divides the target time series data into a model training set (e.g., containing 70% of the data) and a model validation set (e.g., containing 30% of the data) for model training and performance evaluation. The first model is iteratively trained multiple times using the model training set data until the number of model iterations exceeds a preset number (e.g., 100 times) or the model training error is below a set threshold (e.g., 0.01). In this process, the model continuously adjusts its weights and biases to reduce the identification error for normal transactions and abnormal transactions. When the first model reaches the preset training target, the data processing system can obtain the target weights and target biases of the model, and then update the first model to a second model, i.e., a GRU model with optimized weights and biases, using the target weights and target biases obtained during the iterative training process. The second model is then validated multiple times using the model validation set data, each validation operation being based on a 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 and the stability and accuracy of the model on different data sets. After multiple validation operations, the target neural network model is finally obtained.
[0062] As can be seen from the above, the data processing system can make the model learn more complex transaction behavior patterns through multiple iterations and validations, improve the identification accuracy of abnormal transactions, and ensure the stability of the model on unseen data based on cross-validation and the use of validation sets, thereby enhancing the generalization ability of the model and making it more reliable in real-time transaction monitoring. Moreover, the model based on the GRU network can capture the time sequence features and long-term dependencies of transaction data, analyze user behavior in real time, and automatically identify potential abnormal transactions, thereby improving 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 performs data analysis on the T training sets using the first model to obtain an analysis result corresponding to each training set, where T is an integer greater than or equal to 1, then calculates 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, and finally adjusts the weights and biases of the first model according to the T error values.
[0064] Optionally, the actual transaction label is the known classification of each transaction data point, i.e., whether the transaction is an abnormal transaction. Transaction data with a normal transaction label can be marked as 0, and abnormal transaction data 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 according to the current weight and bias, and obtain the preliminary analysis result corresponding to the 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 the mean square error, cross-entropy loss, etc.), and T error values are obtained. According to the T error values calculated, the weight and bias of the first model are adjusted using the back propagation algorithm and gradient descent optimization strategy to reduce the prediction error and improve the accuracy of the model. The above process constitutes an iterative training process. The above steps are repeated until the adjustment of the model weight and bias makes the overall prediction error lower than the set threshold, or the preset number of iterations is reached, that is, the target weight and target bias of the first model are obtained.
[0066] As can be seen from the above, 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 recognition accuracy of abnormal transactions. At the same time, since the model is trained on multiple training sets (T training sets), it helps the model to maintain stability and accuracy on different types of transaction data and enhance the generalization ability.
[0067] In an optional embodiment, the data processing system sets S groups of hyperparameter combinations, wherein different hyperparameter combinations are used to configure the second model with different parameters, and S is an integer greater than or equal to 1. Then, S validation operations are performed on the second model according to the model validation set and the S groups of hyperparameter combinations, and S identification accuracies are obtained. Each validation operation is used to perform cross-validation on the second model determined using a group of hyperparameter combinations to obtain an identification accuracy. Then, an identification accuracy greater than or equal to a preset threshold is selected as the target identification accuracy from the S identification accuracies. The hyperparameter combination corresponding to the target identification accuracy is used as the target hyperparameter combination. Then, the target neural network model is determined according to 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 contains different combinations of 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 group of hyperparameter combinations for cross-validation to obtain S identification accuracies. The identification accuracy with the highest accuracy is selected as the target identification accuracy from the S identification accuracies. A group of hyperparameter combinations corresponding to the target identification accuracy is used to finally configure the second model to obtain the target neural network model.
[0070] For example, the data processing system sets S = 5 groups of hyperparameter combinations, each group including different learning rates, hidden layer unit numbers, batch sizes, and the like. First, the second model is verified 5 times, each time using a group of hyperparameter combinations for cross-validation, obtaining 5 recognition accuracies. For example, after training using the first group of hyperparameter combinations, the model is evaluated on the model validation set to obtain a recognition accuracy of 92%. Then, a preset threshold of 90% is obtained, that is, the recognition accuracy of the model must be greater than or equal to 90% to be accepted. From the 5 recognition accuracies obtained, select the accuracies that reach or exceed 90%. Assuming that 3 accuracies exceed 90%, the corresponding 3 groups of hyperparameter combinations will become candidate target hyperparameter combinations. Then, select the group with the best model performance from the 3 groups of hyperparameter combinations as the target hyperparameter combination. Finally, the target hyperparameter combination is used to configure the second model to obtain the target neural network model.
[0071] As can be seen from the above, the data processing system compares the model recognition accuracies under different hyperparameter combinations, selects the optimal combination, can improve the accuracy of the model in abnormal transaction detection, reduce false positives and omissions, and cross-validation ensures that the model not only performs well on training data, but also maintains high accuracy on unseen validation data, enhancing the stability and reliability of the model.
[0072] In an optional embodiment, the data processing system performs 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 one sequence in the model validation set as a target test set, and the sequences other than the target test set as a target training set. The second model is trained using the target training set for one round, and the trained second model is used to analyze the target test set to obtain a recognition result. Then, K accuracies of the second model are determined according to the K recognition results, where the Rth accuracy in the K accuracies is used to represent the recognition accuracy of the second model after completing the Rth round of test operation in the K rounds of test operation, where R is a positive integer less than or equal to K. Finally, the average of the K accuracies is calculated as the recognition accuracy of the second model.
[0073] Optionally, the data processing system performs K rounds of test operations on the second model, each round of operation including: training the second model using the target training set for one round, updating the model parameters, using the trained second model to analyze the target test set to obtain a recognition result, and then calculating the recognition accuracy of the second model on the target test set according to the recognition result. After completing the K rounds of test operations, K accuracies are obtained, and the average of the K accuracies is calculated as the recognition accuracy of the second model.
[0074] From the above, 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 test operation uses a different target test set for verification, which can effectively prevent the model from over-optimizing on a specific data set and reduce the risk of overfitting.
[0075] In an optional embodiment, the data processing system encodes the N feature value sequences, wherein the encoding process is used to one-hot encode the variable information corresponding to each feature value in the N feature value sequences, and convert non-numeric data in the N feature value sequences into numeric feature data.
[0076] Optionally, for classification features such as transaction type and transaction location, the data processing system uses one-hot encoding to convert the N feature value sequences into numeric features, wherein one-hot encoding is a technique for converting categorical variables into binary vectors. For non-numeric data such as transaction categories and merchant types, the system uses a numerical method to convert them into numeric feature data.
[0077] Optionally, Figure 5 is an optional flowchart of transaction data processing according to an embodiment of the present application, as Figure 5 shown, 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, handling missing values, etc., to ensure the quality and consistency of the data set, then performs feature selection to filter out features that have a significant impact on identifying the target from the cleaned data, the purpose is to reduce unnecessary features, which can reduce the complexity of the model, improve training efficiency, and reduce the risk of overfitting, then further process the selected features (feature engineering), such as normalization, encoding and conversion, in this step, data de-identification is also performed to ensure that all sensitive information is properly processed to protect the personal privacy information of users, after that, the processed data is divided into training set, validation set and test set (data set division), this division allows the model to be trained and evaluated on different data sets, thereby verifying its performance and generalization ability, finally, the time series is constructed, i.e. the above processed features are sorted according to the time sequence of transactions, this step involves organizing data into a time series format, which is crucial for capturing the time dependence 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 the effective training and reliable analysis of the model.
[0078] From the above, the data processing system enhances the understanding and processing ability of the model for different types of features through the above preprocessing operation, and the encoded feature data is uniform in form, which is conducive to the rapid learning and training of the model, thereby improving the running efficiency of the entire system, and through the encoding processing of the feature data, the model can 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), and ensuring that the format and structure of the data match the requirements of the GRU network model.
[0079] Embodiment 2
[0080] The embodiment of the application further provides a transaction data analysis device. It should be noted that the transaction data analysis device of the embodiment of the application can be used to execute the transaction data analysis method provided by the embodiment of the application. The transaction data analysis device provided by the embodiment of the application is introduced as follows.
[0081] According to the embodiment of the application, a device for implementing the above transaction data analysis method is further provided, Figure 6 is a schematic diagram of an optional transaction data analysis device according to the embodiment of the application, as Figure 6 shown, the device comprises an acquisition unit 601, a selection unit 602 and a determination unit 603.
[0082] Optionally, the acquisition unit 601 is configured to acquire transaction data of a target user; the selection unit 602 is configured 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 probability of a feature in the target feature sequence appearing in abnormal transaction data is greater than the probability of the feature appearing in normal transaction data; and the determination unit 603 is configured to input the transaction data features of the target user into a target neural network model, and determine an abnormal transaction 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 stage, wherein the target neural network model is a model obtained by updating an initial neural network model according to a target hyperparameter combination, the initial neural network model is used to process and analyze time sequence 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 manner during pre-training.
[0083] Optionally, the determining unit 603 comprises a first obtaining subunit, a first extracting subunit, a first arranging subunit, and a first training subunit. The first obtaining subunit is configured to obtain N first data, wherein each first data represents historical transaction data of a user, 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. The first extracting subunit is configured to extract a feature value corresponding to a feature in the target feature sequence from each first data in the N first data, to obtain N feature value sequences. The first arranging subunit is configured to arrange the N feature value sequences in chronological order of transactions, to obtain a target time sequence. The first training subunit is configured to perform multiple iteration training and verification operations on an initial neural network model according to the target time sequence, to obtain a target neural network model, wherein the multiple iteration training is used to determine target weights and target biases of the model, and the verification operation is used to determine a target hyperparameter combination of the model based on a cross-validation manner.
[0084] Optionally, the first training subunit comprises a first processing module, a first dividing module, a first training module, a first updating module, and a first verification module. The first processing module is configured to initialize the initial neural network using a preset hyperparameter combination, to obtain a first model. The first dividing module is configured to divide the target time sequence into a model training set and a model verification set. The first training module is configured to input the model training set into the first model for iteration 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, to obtain target weights and target biases of the first model. The first updating module is configured to update the first model to a second model according to the target weights and the target biases. The first verification module is configured to perform multiple verification operations on the second model according to the model verification set, to obtain the target neural network model.
[0085] Optionally, the first training module comprises a first analysis sub-module, a first calculation sub-module, and a first adjustment sub-module. The first analysis sub-module is configured to perform data analysis on T training sets using the first model when there are T training sets in the model training set, to obtain an analysis result corresponding to each training set, wherein T is an integer greater than or equal to 1. The first calculation sub-module is configured to calculate an error between the analysis result corresponding to each training set and an actual transaction label corresponding to each training set, to obtain T error values. The first adjustment sub-module is configured to adjust the weights and biases 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 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 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 This 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 7The processor 702, the memory 704, a storage controller, and a peripheral interface are shown in FIG. 7. The peripheral interface is connected with a radio frequency module, an audio module, and a display.
[0091] 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. The processor executes various functions and data processing by running the software programs and modules stored in the memory, that is, implements the above-described methods. The memory can include a high-speed random access memory, and can further include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory can further include a memory remotely arranged with respect to the processor, which can be connected to the terminal through 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.
[0092] The processor can call information and application programs stored in the memory through the transmission device to perform the following steps: obtaining 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 probability of a feature in the target feature sequence appearing in abnormal transaction data is greater than the probability of the feature appearing in normal transaction data; inputting the transaction data features of the target user into a target neural network model to determine an abnormal transaction 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 stage, wherein the target neural network model is a model obtained by updating an initial neural network model according to a target hyperparameter combination, the initial neural network model is used to process and analyze time sequence 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 manner during pre-training.
[0093] The processor can call information and application programs stored in the memory through the transmission device to perform the following steps: obtaining N first data, wherein each first data represents historical transaction data of a user, 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 a transaction time sequence to obtain a target time sequence; performing multiple iteration training and verification operations on an initial neural network model according to the target time sequence to obtain a target neural network model, wherein the multiple iteration training is used to determine target weights and target biases of the model, and the verification operation determines a target hyperparameter combination of the model based on a cross-validation manner.
[0094] The processor can call information and application programs stored in the memory through the transmission device to perform the following steps: initializing an initial neural network using a preset hyperparameter combination to obtain a first model; dividing a 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 to obtain target weights and target biases of the first model; updating the first model to a second model according to the target weights and the target biases; performing multiple validation operations on the second model according to the model validation set to obtain a target neural network model.
[0095] The processor can call information and application programs stored in the memory through the transmission device to perform the following steps: when there are T training sets in the model training set, performing data analysis on the T training sets using the first model to obtain an analysis result corresponding to each training set, wherein 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; and adjusting the weights and biases of the first model according to the T error values.
[0096] The processor can call information and application programs stored in the memory through the transmission device to perform the following steps: setting S groups of hyperparameter combinations, wherein different hyperparameter combinations are used for different parameter configurations of the second model, and 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 the S groups of hyperparameter combinations to obtain S identification accuracies, wherein each validation operation is used to perform cross-validation on the second model determined using a group of hyperparameter combinations to obtain an identification accuracy; selecting an identification accuracy greater than or equal to a preset threshold from the S identification accuracies as a target accuracy; selecting the hyperparameter combination corresponding to the target accuracy as a target hyperparameter combination; and determining a target neural network model according to the target hyperparameter combination and the second model.
[0097] The processor can call information and application programs stored in the memory through the transmission device to perform the following steps: performing K rounds of test operations on the second model to obtain K identification results, wherein K is an integer greater than or equal to 1, each round of test operation is used to select any one sequence in the model validation set as a target test set and sequences other than the target test set as a target training set, use the target training set to train the second model for one round, and use the trained second model to analyze the target test set to obtain an identification result; determining K accuracies of the second model according to the K identification results, wherein the Rth accuracy in the K accuracies represents the identification accuracy of the second model after the Rth round of test operation in the K rounds of test operation, and R is a positive integer less than or equal to K; and calculating the average of the K accuracies as the identification accuracy of the second model.
[0098] The processor can call the information and the application program stored in the memory through the transmission device to perform the following steps: performing encoding processing on the N characteristic value sequences, wherein the encoding processing is used for one-hot encoding of variable information corresponding to each characteristic value in the N characteristic value sequences, and converting non-numeric data in the N characteristic value sequences into numeric characteristic data.
[0099] Those skilled in the art can understand that, Figure 7 The structure shown is only schematic, and the electronic device can also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, or the like. Figure 7 It does not limit the structure of the electronic device. For example, the electronic device can further include more or less components (such as a network interface, a display device, etc.) than Figure 7 shown, or have a different configuration than Figure 7 shown.
[0100] Those skilled 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 by a program, and the program can be stored in a computer readable storage medium, which can include a flash disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, etc.
[0101] Embodiment 4
[0102] The embodiments of the present application also provide a storage medium. Optionally, in the embodiment, the storage medium can be used to save the program code executed by the transaction data analysis method provided in Embodiment 1.
[0103] Optionally, in the embodiment, the storage medium can be located in any one of the computer terminals in the computer terminal group in the computer network, or in any one of the mobile terminals in the mobile terminal group.
[0104] The present application also provides a computer program product adapted to execute the steps of the transaction data analysis method when executed on a data processing device.
[0105] The above-mentioned serial numbers of the embodiments of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.
[0106] In the above-described embodiments of the present application, the description of each embodiment focuses on different aspects, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.
[0107] In several embodiments provided in the present application, it should be understood that the disclosed technical contents can be implemented by other ways. Among them, the above-described device embodiments are only schematic, for example, the division of the units can be a logical function division, and actual implementation can have another division way, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units or modules shown or discussed can be indirect coupling or communication connection through some interfaces, units or modules, which can be electrical or other forms.
[0108] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, they can be located in one place or distributed to multiple units. Part or all of the units can be selected to achieve the purpose of the embodiment scheme according to actual needs.
[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, or two or more units can be integrated into one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0110] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a plurality of instructions for causing a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes: a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.
[0111] The above is only the preferred embodiment of the present application, and it should be pointed out that for ordinary skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, which should be considered as the protection scope 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 target user's transaction data according to a target feature sequence to obtain transaction data features of the target user, wherein features in the target feature sequence have a higher probability of appearing in abnormal transaction data than in 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 during the model training phase, 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 transaction data analysis method according to claim 1, characterized in that: The target neural network model is obtained by the following steps: Acquire N first data, where each first data represents historical transaction data of a user, where 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 order of transaction time to obtain a target time sequence; The initial neural network model is subjected to multiple iterative training and validation operations according to the target time series to obtain the target neural network model, 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 validation 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, using 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; 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; Adjust the weights and biases of the first model according to the T error values.
5. The transaction data analysis method 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, 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; 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 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 a target accuracy rate; Using the 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 transaction data analysis method 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 operations 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; Determining K accuracy rates of the second model based on the K recognition results, wherein an R-th accuracy rate among the K accuracy rates is used to represent the recognition accuracy of the second model after completing the R-th round of test operations among 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 of the second model.
7. The transaction data analysis method 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 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 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 features in the target feature sequence have a higher probability of appearing in abnormal transaction data than in normal transaction data; A determination unit inputs the transaction data characteristics 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 characteristics 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 the target hyperparameter combination, wherein the initial neural network model is used to process and analyze the time series characteristics 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.
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 according to 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