Data processing method and device, computer readable storage medium and electronic equipment

By introducing the self-attention mechanism into the generative adversarial network to generate sample data and train the target recognition model, the problem of low accuracy in detecting illegal credit card transactions is solved, and efficient identification and accurate detection of illegal transaction behaviors are achieved.

CN119831744BActive Publication Date: 2025-10-21INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411906417.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-10-21
Estimated Expiration
2044-12-23

AI Technical Summary

Technical Problem

Existing methods for detecting illegal credit card transactions have low accuracy and are unable to effectively detect complex and diverse transaction data, affecting the stability of financial transaction order and economic income.

Method used

A data processing method based on generative adversarial networks is adopted. By introducing a self-attention mechanism to generate sample data, the target recognition model is trained to detect illegal transactions, generate realistic sample data and balance the number of samples with different labels, thereby improving detection accuracy.

Benefits of technology

By generating sample data through generative adversarial networks and training target recognition models, effective learning and identification of illegal transaction behaviors are achieved, improving the accuracy of illegal credit card transaction detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119831744B_ABST
    Figure CN119831744B_ABST
Patent Text Reader

Abstract

The application discloses a data processing method and device, a computer readable storage medium and an electronic device. It relates to the field of artificial intelligence, and the method comprises: obtaining transaction data of a credit card of a user; inputting the transaction data into a target identification model to obtain a processing result through the target identification model, wherein the target identification model is used to determine whether the credit card has illegal transactions according to the transaction data, and the target identification model is obtained through training based on a first training sample set, at least part of sample data in the first training sample set is generated based on a target generator in a target generative adversarial network, and the target generative adversarial network comprises a self-attention mechanism; and determining target information based on the processing result, wherein the target information is used to represent whether the credit card has illegal transactions. Through the application, the problem of low detection accuracy of illegal transactions of a credit card in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence, and more specifically, to a data processing method, device, computer-readable storage medium, and electronic device. Background Art

[0002] With the rapid development of electronic payments and online transactions, credit cards have become a widely used payment method in modern society. However, illegal credit card transactions have also been increasing year by year, causing significant financial losses and security risks to users and financial institutions.

[0003] At present, traditional methods for detecting illegal credit card transactions are mainly based on rule engines or simple statistical models. These methods have problems such as data imbalance and overfitting when dealing with complex and diverse transaction data. They are unable to accurately and effectively detect illegal credit card transactions, thus affecting the stability of financial transaction order and economic income.

[0004] Currently, no effective solution has been proposed to the problem of low accuracy in detecting illegal credit card transactions in related technologies. Summary of the Invention

[0005] The main purpose of this application is to provide a data processing method, device, computer-readable storage medium and electronic device to solve the problem of low accuracy in detecting illegal credit card transactions in related technologies.

[0006] To achieve the above objectives, according to one aspect of the present application, a data processing method is provided. The method comprises: obtaining transaction data from a user's credit card; inputting the transaction data into a target recognition model, and obtaining a processing result using the target recognition model, wherein the target recognition model is used to determine whether the credit card transaction is illegal based on the transaction data, and the target recognition model is trained based on a first training sample set, wherein at least a portion of the sample data in the first training sample set is generated based on a target generator in a target generative adversarial network, and the target generative adversarial network includes a self-attention mechanism; and determining target information based on the processing result, wherein the target information is used to characterize whether the credit card transaction is illegal.

[0007] Furthermore, the data processing method also includes: generating first sample data based on a target generator in a target generative adversarial network, wherein the first sample data is simulated transaction data of a sample credit card, and the true label of the first sample data indicates that there is an illegal transaction in the sample credit card corresponding to the first sample data; obtaining second sample data from a target storage area, wherein the second sample data is the true transaction data of the sample credit card; constructing a first training sample set based on the first sample data and the second sample data; and training an initial recognition model based on the first training sample set to obtain a target recognition model.

[0008] Furthermore, the data processing method also includes: updating the random noise vector based on the self-attention mechanism to obtain an updated random noise vector; and generating first sample data based on the updated random noise vector.

[0009] Furthermore, the data processing method also includes: multiplying the random noise vector with the query matrix, key matrix and value matrix respectively to obtain the query vector, key vector and value vector corresponding to the random noise vector; calculating the attention score matrix based on the query vector and the key vector; and calculating the updated random noise vector based on the attention score matrix and the value vector.

[0010] Furthermore, the data processing method also includes: obtaining a second training sample set, wherein the training samples in the second training sample set are real transaction data of the sample credit card; constructing an initial generative adversarial network, wherein the initial generative adversarial network includes an initial generator and an initial discriminator, the initial generator and the initial discriminator each include a self-attention mechanism, the initial generator is used to randomly generate simulated transaction data, and the initial discriminator is used to distinguish between real transaction data and simulated transaction data; training the initial generative adversarial network based on the second training sample set and a preset loss function to obtain a target generative adversarial network.

[0011] Furthermore, the data processing method also includes: fixing the parameters of the initial generator, training the initial discriminator in the initial generative adversarial network based on the second training sample set and the loss function, and obtaining an updated initial generative adversarial network; fixing the parameters of the updated initial generative adversarial network, training the initial generator in the updated initial generative adversarial network based on the second training sample set and the loss function, and obtaining an updated initial generative adversarial network again; when the iteration of the initial generative adversarial network does not meet the preset iteration conditions, repeating the steps of training the initial generator and the initial discriminator in the initial generative adversarial network until the iteration meets the preset iteration conditions, thereby obtaining a target generative adversarial network.

[0012] Furthermore, the data processing method also includes: when the numerical value represented by the processing result is greater than or equal to the preset numerical value, determining that the target information represents that there is no illegal transaction on the credit card; when the numerical value represented by the processing result is less than the preset numerical value, determining that the target information represents that there is an illegal transaction on the credit card.

[0013] To achieve the above-mentioned objectives, according to another aspect of the present application, a data processing device is provided. The device includes: a first acquisition module for acquiring transaction data of a user's credit card; a processing module for inputting the transaction data into a target recognition model and obtaining a processing result through the target recognition model, wherein the target recognition model is used to determine whether the credit card has been used for illegal transactions based on the transaction data, and the target recognition model is trained based on a first training sample set, at least part of the sample data in the first training sample set is generated based on a target generator in a target generative adversarial network, and the target generative adversarial network includes a self-attention mechanism; and a determination module for determining target information based on the processing result, wherein the target information is used to characterize whether the credit card has been used for illegal transactions.

[0014] Furthermore, the data processing device also includes: a generation module, used to generate first sample data based on the target generator in the target generative adversarial network, wherein the first sample data is simulated transaction data of a sample credit card, and the true label of the first sample data represents that there is an illegal transaction in the sample credit card corresponding to the first sample data; a second acquisition module, used to obtain second sample data from the target storage area, wherein the second sample data is the true transaction data of the sample credit card; a first construction module, used to construct a first training sample set based on the first sample data and the second sample data; a first training module, used to train an initial recognition model based on the first training sample set to obtain a target recognition model.

[0015] Furthermore, the generation module also includes: an updating submodule, which is used to update the random noise vector based on the self-attention mechanism to obtain an updated random noise vector; and a generating submodule, which is used to generate first sample data based on the updated random noise vector.

[0016] Furthermore, the update submodule also includes: a first calculation unit, used to multiply the random noise vector with the query matrix, key matrix and value matrix respectively to obtain the query vector, key vector and value vector corresponding to the random noise vector; a second calculation unit, used to calculate the attention score matrix based on the query vector and the key vector; a third calculation unit, used to calculate the updated random noise vector based on the attention score matrix and the value vector.

[0017] Furthermore, the data processing device also includes: a third acquisition module, used to obtain a second training sample set, wherein the training samples in the second training sample set are real transaction data of the sample credit card; a second construction module, used to construct an initial generative adversarial network, wherein the initial generative adversarial network includes an initial generator and an initial discriminator, the initial generator and the initial discriminator each include a self-attention mechanism, the initial generator is used to randomly generate simulated transaction data, and the initial discriminator is used to distinguish between real transaction data and simulated transaction data; a second training module, used to train the initial generative adversarial network based on the second training sample set and a preset loss function to obtain a target generative adversarial network.

[0018] Furthermore, the second training module also includes: a first training submodule, which is used to fix the parameters of the initial generator, train the initial discriminator in the initial generative adversarial network based on the second training sample set and the loss function, and obtain an updated initial generative adversarial network; a second training submodule, which is used to fix the parameters of the updated initial generative adversarial network, train the initial generator in the updated initial generative adversarial network based on the second training sample set and the loss function, and obtain an updated initial generative adversarial network; a processing submodule, which is used to repeat the steps of training the initial generator and the initial discriminator in the initial generative adversarial network when the iteration of the initial generative adversarial network does not meet the preset iteration conditions, until the iteration meets the preset iteration conditions, thereby obtaining a target generative adversarial network.

[0019] Furthermore, the determination module also includes: a first determination submodule, used to determine that the target information represents that there is no illegal transaction on the credit card when the numerical value represented by the processing result is greater than or equal to a preset numerical value; a second determination submodule, used to determine that the target information represents that there is an illegal transaction on the credit card when the numerical value represented by the processing result is less than a preset numerical value.

[0020] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a computer-readable storage medium is provided, which includes a stored executable program, wherein when the executable program runs, the device where the computer-readable storage medium is located is controlled to execute the above-mentioned data processing method.

[0021] In order to achieve the above-mentioned purpose, according to another aspect of the present application, an electronic device is provided, which includes a memory storing an executable program; and a processor for running the program, wherein the above-mentioned data processing method is executed when the program is running.

[0022] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a computer program product is provided, comprising computer instructions, which implement the steps of the above-mentioned data processing method when executed by a processor.

[0023] In an embodiment of the present application, a method is adopted to generate sample data based on an optimized generative adversarial network, and a target recognition model is obtained based on training of the data to detect illegal transaction behaviors. By introducing a self-attention mechanism into the generative adversarial network, a deep capture of the complex features of the generated data is achieved, thereby generating more realistic sample data. The target recognition model is trained by using sample data generated by the optimized generative adversarial network, so that the number of samples with different labels in the first training sample set can be relatively balanced, so that the target recognition module can effectively learn and recognize the features of illegal transaction data. By judging whether there is illegal transaction behavior of a credit card based on transaction data based on the target recognition model, illegal transaction behavior of the credit card can be detected according to a better model, thereby improving the accuracy of detection.

[0024] It can be seen that the solution provided in this application achieves the purpose of generating sample data based on the optimized generative adversarial network, and training a target recognition model based on the data to detect illegal transaction behaviors, thereby achieving the technical effect of improving the accuracy of detecting illegal transaction behaviors, and further solving the problem of low accuracy in detecting illegal credit card transactions in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The accompanying drawings, which constitute part of this application, are intended to provide a further understanding of this application. The exemplary embodiments and descriptions of this application are intended to explain this application and do not constitute an improper limitation on this application. In the accompanying drawings:

[0026] Figure 1 This is a hardware structure block diagram of a computer terminal provided according to an embodiment of the present application;

[0027] Figure 2 is a schematic diagram of a data processing method provided according to an embodiment of the present application;

[0028] Figure 3 This is a training diagram of a target generative adversarial network according to an embodiment of the present application;

[0029] Figure 4 is a schematic diagram of a data processing device provided according to an embodiment of the present application;

[0030] Figure 5 This is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0031] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0032] 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 sequential order. 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 a sequence 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.

[0033] 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 the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation portals 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 portals for users to choose to agree or refuse the automated decision-making results; if the user chooses to refuse, the expert decision-making process will be entered.

[0034] Example 1

[0035] According to an embodiment of the present application, an embodiment of a data processing method is also 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.

[0036] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG1 shows a hardware structure block diagram of a computer terminal (or mobile device) for implementing a data processing method. Figure 1 As shown, the computer terminal 10 (or mobile device) may include one or more (illustrated as 102a, 102b, ..., 102n in the figure) 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 will 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 than shown, or with Figure 1 Different configurations shown.

[0037] 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 circuitry". The data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuitry may be a single independent processing module, or may be incorporated in whole or in part into any of the other components of the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuitry serves as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0038] 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 data processing 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, implementing the above-mentioned data processing 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 instances, the memory 104 may further include a memory remotely located 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 combinations thereof.

[0039] 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.

[0040] 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).

[0041] Under the above operating environment, this application provides Figure 2 The data processing method shown. Figure 2 It is a schematic diagram of a data processing method provided according to an embodiment of the present application.

[0042] Step S201: Obtain the transaction data of the user's credit card.

[0043] Optionally, electronic devices, application systems, servers and other devices can be used as the execution subject of this application. In this embodiment, the data processing system is used as the execution subject to execute the above-mentioned data processing method.

[0044] Optionally, the data processing system may be a system in a target financial institution, and the data processing system may obtain the user's credit card transaction data from a storage area (eg, a database, etc.) of the target financial institution.

[0045] Optionally, the transaction data may include information such as transaction amount, transaction time, transaction object, transaction location, etc., which is used to describe the details of each transaction.

[0046] In step S202, the transaction data is input into a target recognition model, and a processing result is obtained through the target recognition model. The target recognition model is used to determine whether there is an illegal transaction involving a credit card based on the transaction data. The target recognition model is trained based on a first training sample set. At least part of the sample data in the first training sample set is generated based on a target generator in a target generative adversarial network, and the target generative adversarial network includes a self-attention mechanism.

[0047] Optionally, the target recognition model is trained based on the first training sample set, and the data processing system can input the first training sample set into the initial recognition model for training to obtain the target recognition model, wherein the target recognition model can be a neural network model.

[0048] Optionally, the sample data in the first training sample set are distinguished into legal transaction data and illegal transaction data based on the true labels, that is, the true labels of the sample data in the first training sample set are used to characterize whether there are illegal transactions in the sample credit card corresponding to the sample data, and the sample data in the first training sample set can be divided into two types based on different generation methods, namely real transaction data and simulated transaction data. The real transaction data can be obtained by the data processing system from the target storage area of ​​the target financial institution, and the simulated transaction data is generated by the target generator in the target generative adversarial network.

[0049] In some embodiments, real transaction data may include legal transaction data and illegal transaction data, and simulated transaction data may include illegal transaction data. Since in actual scenarios, illegal credit card transactions face data imbalance problems, normal transactions in real transaction data often far exceed illegal transactions. Therefore, simulated transaction data belonging to illegal transaction data can be generated through a target generator to alleviate the problem of data imbalance.

[0050] Optionally, the target generative adversarial network includes a target generator and a target discriminator, and self-attention mechanisms are introduced into the target generator and the target discriminator respectively. The target generative adversarial network is obtained by training the initial generative adversarial network based on the real transaction data of sample credit cards. The target generator in the target generative adversarial network is used to generate simulated transaction data similar to the real transaction data.

[0051] Optionally, the data processing system can use an object recognition model to extract and analyze features of the transaction data, generating a processing result that indicates whether the transaction is legal. The processing result can be in numerical form, with different numerical values ​​representing different transaction behaviors.

[0052] Step S203: determining target information based on the processing result, wherein the target information is used to indicate whether there is any illegal transaction involving the credit card.

[0053] Optionally, the processing result is in numerical form to represent different transaction behaviors. The data processing system can determine target information based on the result, and the target information is used to characterize whether there is any illegal transaction behavior on the credit card.

[0054] In some embodiments, the processing result generated by the target recognition model may be a probability value indicating that the credit card transaction is legitimate. The data processing system may determine the corresponding target information based on the processing result, based on a set threshold. For example, when the processing result is greater than or equal to the threshold, the target information is determined to represent a "legitimate transaction," and when the processing result is less than the threshold, the target information is determined to represent an "illegal transaction."

[0055] In an embodiment of the present application, a method is adopted to generate sample data based on an optimized generative adversarial network, and a target recognition model is obtained based on training of the data to detect illegal transaction behaviors. By introducing a self-attention mechanism into the generative adversarial network, a deep capture of the complex features of the generated data is achieved, thereby generating more realistic sample data. The target recognition model is trained by using sample data generated by the optimized generative adversarial network, so that the number of samples with different labels in the first training sample set can be relatively balanced, so that the target recognition module can effectively learn and recognize the features of illegal transaction data. By judging whether there is illegal transaction behavior of a credit card based on transaction data based on the target recognition model, illegal transaction behavior of the credit card can be detected according to a better model, thereby improving the accuracy of detection.

[0056] It can be seen that the solution provided in this application achieves the purpose of generating sample data based on the optimized generative adversarial network, and training a target recognition model based on the data to detect illegal transaction behaviors, thereby achieving the technical effect of improving the accuracy of detecting illegal transaction behaviors, and further solving the problem of low accuracy in detecting illegal credit card transactions in related technologies.

[0057] In an optional embodiment, the data processing system can determine the target recognition model in the following manner: generate first sample data based on the target generator in the target generative adversarial network, wherein the first sample data is simulated transaction data of a sample credit card, and the true label of the first sample data indicates that there is an illegal transaction in the sample credit card corresponding to the first sample data; obtain second sample data from the target storage area, wherein the second sample data is the true transaction data of the sample credit card; construct a first training sample set based on the first sample data and the second sample data; train the initial recognition model based on the first training sample set to obtain a target recognition model.

[0058] Optionally, the target recognition model is trained based on first sample data generated by a target generative adversarial network and second sample data extracted from actual transaction records of a sample credit card. The first sample data is simulated illegal transaction data, whose true label is used to represent "illegal transaction," and the second sample data is actual transaction data of the sample credit card, whose true label is used to represent "legal transaction" or "illegal transaction." The first training sample set is constructed by combining the two types of data, and the initial recognition model is trained to obtain the target recognition model.

[0059] Optionally, the target storage area may be a database, a cloud server, etc., from which the data processing system may obtain real transaction data of the sample credit card as the second sample data.

[0060] In some embodiments, in the credit card illegal transaction detection task, assume a data set D = {(x1, y1), (x2, y2), ..., (x n ,y n )}, where x i ∈R d is the feature vector of credit card transaction data, y i ∈{0,1} is the true label, when y i =1, indicating legal transaction, when y i =0, it indicates illegal transaction.

[0061] Optionally, during the training process, the data processing system can input the first training sample set into the initial recognition model, and then calculate the loss function value based on the prediction results output by the initial recognition model, the loss function and the true label of the first training sample set, so that when the loss function value is greater than a preset threshold, the model parameters of the initial recognition model are updated, and the aforementioned steps of calculating the loss function value are continued until the loss function value is less than or equal to the preset threshold, and the current initial recognition model is determined as the target recognition model.

[0062] It should be noted that by constructing a training sample set based on simulated transaction data and real transaction data generated by the target generative adversarial network, the data balance of the target recognition model is ensured. The simulated transaction data can supplement the illegal transaction patterns that are lacking in the real transaction data, thereby improving the target recognition model's ability to detect unknown illegal transaction behaviors, thereby improving the model's accuracy in detecting illegal credit card transactions.

[0063] In an optional embodiment, in the process of generating first sample data based on the target generator in the target generative adversarial network, the data processing system can update the random noise vector based on the self-attention mechanism to obtain an updated random noise vector; and generate the first sample data based on the updated random noise vector.

[0064] Optionally, the target generator is trained using real sample credit card transaction data to train the initial generator in the initial generative adversarial network. The initial generator in the initial generative adversarial network incorporates a self-attention mechanism. The self-attention mechanism in the target generator captures global dependencies in the sample transaction data and updates the random noise vector, allowing the target generator to generate simulated transaction data based on the updated random noise vector. The updated random noise vector embeds the characteristic information of the sample transaction data, ensuring that the generated simulated transaction data more closely matches the characteristic distribution of real transaction data.

[0065] Optionally, random noise is the input to the generator in the generative adversarial network and is the basis for generating simulated trading data. The random noise can be sampled from a standard normal distribution N(0,1) or a Gaussian distribution.

[0066] It's important to note that by introducing a self-attention mechanism into the initial generator, we optimized the feature extraction capabilities of the random noise vector, enabling the generated simulated transaction data to better reflect the complex characteristics of illegal transaction data. The self-attention mechanism effectively enhances global dependencies during data generation. By continuously updating the random noise vector to embed more feature information from real transaction data, we generate higher-quality simulated transaction data.

[0067] In an optional embodiment, in the process of updating the random noise vector based on the self-attention mechanism to obtain an updated random noise vector, the data processing system can multiply the random noise vector with the query matrix, key matrix and value matrix respectively to obtain the query vector, key vector and value vector corresponding to the random noise vector; calculate the attention score matrix based on the query vector and the key vector; and calculate the updated random noise vector based on the attention score matrix and the value vector.

[0068] Optionally, the self-attention mechanism of the target generative adversarial network calculates the correlation between the features of the input sample data, giving higher weights to key features while reducing the weights of unimportant features, to help the generator better capture the patterns and characteristics of transaction data.

[0069] Optionally, the self-attention mechanism consists of three vectors: query vector Q, key vector K, and value vector V. Each vector is obtained by multiplying a random noise vector by the corresponding matrix. The calculation formula is as follows:

[0070] Q=z·W q

[0071] K=z·W k

[0072] V=z·W v

[0073] Where z represents the random noise vector, W q represents the query matrix, W k represents the bond matrix, W v Represents a matrix of values.

[0074] Optionally, the attention score matrix is ​​a correlation matrix between the random noise vector and the sample transaction data, calculated based on the query vector Q and the key vector K, and represents the attention weights between different features. By calculating the weighted representation of each element (i.e., self-attention) based on the attention score matrix and the value vector, an updated random noise vector is generated, where the updated random noise vector integrates the global feature information in the sample transaction data. The calculation formula for self-attention is as follows:

[0075]

[0076] Among them, Attention(Q,K,V) represents the updated random noise vector, T represents the transposition operation, QK T Equivalent to the attention score matrix, d k Represents the dimension of the vector, by dividing by The result of the dot product can be scaled; The function converts the raw scores into a probability distribution, ensuring that the sum of the output attention weights is 1.

[0077] In some embodiments, the attention score matrix can be an N×N matrix, where N represents the number of features extracted from the sample transaction data. The i-th row represents the degree of attention of the i-th feature to all other features, and the j-th column represents the degree to which the j-th feature is paid attention to by all other features. It describes the importance of the j-th feature in the overall input data. If the value of the j-th column in the i-th row of the attention score matrix is ​​high, it means that the attention weight of the i-th feature to the j-th feature is large, indicating that the correlation between the two features is stronger, and the generator will be more inclined to pay attention to these features during the training process; if the values ​​of all columns in the i-th row of the attention score matrix are close to the average, it means that the i-th feature has a low correlation with all other features, and their importance in the inter-feature dependency relationship is weaker, and the generator will pay less attention to these features during the training process.

[0078] It should be noted that updating the random noise vector through the self-attention mechanism enables more accurate feature representation and data generation in generative adversarial networks. By multiplying the random noise vector with the query matrix, key matrix, and value matrix to calculate the attention score matrix, and then calculating the attention weights between different features based on the attention score matrix, the random noise vector can dynamically focus on the key features of the input sample transaction data, thereby capturing the dependencies between features and ensuring that important features of the data are prioritized. This in turn generates simulated transaction data that more closely matches the distribution of real data, improving the accuracy of illegal transaction detection.

[0079] In an optional embodiment, the data processing system can determine the target generative adversarial network in the following manner: obtain a second training sample set, wherein the training samples in the second training sample set are real transaction data of a sample credit card; construct an initial generative adversarial network, wherein the initial generative adversarial network includes an initial generator and an initial discriminator, the initial generator and the initial discriminator each include a self-attention mechanism, the initial generator is used to randomly generate simulated transaction data, and the initial discriminator is used to distinguish between real transaction data and simulated transaction data; train the initial generative adversarial network based on the second training sample set and a preset loss function to obtain a target generative adversarial network.

[0080] Optionally, the training samples in the second training sample set are obtained by acquiring real transaction data of sample credit cards from a target storage area (e.g., a database, a cloud server). The data processing system may perform data preprocessing, such as standardization and normalization, on the acquired real transaction data. The mathematical expression for standardization is:

[0081]

[0082] Among them, the normalized mathematical expression is:

[0083]

[0084] Among them, x represents the original feature value in the real transaction data, x ′ and x″ represent the standardized feature values ​​corresponding to the standardization operation and normalization operation respectively, μ represents the mean value of x, and σ represents the standard deviation value of x.

[0085] Optionally, the initial generative adversarial network includes an initial generator and an initial discriminator, each of which includes a self-attention mechanism. The initial generator is used to generate simulated transaction data with characteristics and distribution similar to real transaction data, making it difficult for the initial discriminator to distinguish between real and fake. The initial discriminator is used to distinguish between real transaction data and simulated transaction data generated by the generator, helping the initial generator to continuously improve the authenticity of the generated simulated transaction data.

[0086] Optionally, after obtaining the second training sample set and the initial GAN, the data processing system may train the initial GAN ​​based on the second training sample set and a preset loss function to obtain the target GAN. Optionally, the loss function is an optimization objective during GAN training, used to measure the performance of the generator and discriminator. By calculating the loss function, the generator and discriminator can be gradually optimized during adversarial training, thereby achieving a balance. The target GAN is a mature model obtained by continuously training and optimizing the initial GAN ​​based on the second training sample set and the loss function, and can generate simulated transaction data similar to real transaction data.

[0087] It's important to note that by introducing a self-attention mechanism, the generator can better capture the complex characteristics of sample transaction data, generating more realistic simulated transaction data. This allows the discriminator to more accurately distinguish between real and generated transaction data. By training and optimizing the initial GAN ​​based on real transaction data and a loss function to generate the target GAN, we can generate more realistic simulated transaction data, thereby improving the target recognition model's ability and accuracy in detecting illegal transactions.

[0088] In an optional embodiment, in the process of training the initial generative adversarial network based on the second training sample set and the preset loss function to obtain the target generative adversarial network, the data processing system can fix the parameters of the initial generator, train the initial discriminator in the initial generative adversarial network based on the second training sample set and the loss function, and obtain an updated initial generative adversarial network; fix the parameters of the updated initial generative adversarial network, train the initial generator in the updated initial generative adversarial network based on the second training sample set and the loss function, and obtain an updated initial generative adversarial network again; if the iteration of the initial generative adversarial network does not meet the preset iteration conditions, repeat the steps of training the initial generator and initial discriminator in the initial generative adversarial network until the iteration meets the preset iteration conditions and the target generative adversarial network is obtained.

[0089] Optionally, the iterative optimization of the target generative adversarial network is performed alternately by fixing the parameters of the initial generator and the initial discriminator. The performance of the initial generator and the initial discriminator is evaluated in each round of training until the preset iteration conditions are met, and the target generative adversarial network is determined to be obtained. The target generative adversarial network can generate more realistic simulated illegal transaction data.

[0090] Optionally, the training samples in the second training sample set are obtained by acquiring real transaction data of sample credit cards from the target storage area. The parameters of the initial generative adversarial network may include the dimension of random noise, the dimension of input data, the weights and bias parameters of the network layer, the parameters of the self-attention mechanism, and the type and parameters of the activation function, etc.

[0091] Optionally, the end condition of the initial generative adversarial network training process is to meet a preset iteration condition, which is that the loss function value of the generative adversarial network is less than a preset value (that is, the data generated by the generator is so close to the real data that the discriminator cannot distinguish between true and false) or the set number of iterations is reached.

[0092] Optionally, the initial generator and initial discriminator of the initial generative adversarial network compete with each other during the training process and reach a balance point by alternately optimizing their respective parameters. Figure 3This is a training diagram of a target-generating adversarial network according to an embodiment of the present application. Figure 3 As shown in Figure 2, the following are the basic steps for alternately optimizing network parameters during generative adversarial network training:

[0093] (1) Initialize network parameters: Randomly initialize the network parameters of the generator G and the discriminator D, such as weights, activation functions, and loss functions.

[0094] (2) Training the discriminator: The data processing system obtains real transaction data from the target storage area as the second training sample set and fixes the parameters of the generator. The generator generates simulated transaction data based on the random noise vector and the self-attention mechanism. The discriminator optimizes the parameters through the loss function (such as the cross-entropy loss function) and the self-attention mechanism to maximize its correct recognition probability of real transaction data while minimizing the probability of incorrect recognition of the generated simulated transaction data. The loss function of the discriminator consists of two parts: the loss of real transaction data and the loss of simulated transaction data. The goal of the discriminator is to minimize the sum of these two losses. This results in an updated initial generative adversarial network.

[0095] (3) Training the Generator: The parameters of the discriminator are fixed. The generator's loss function is based on the discriminator's classification results of the generated data. Simulated transaction data is generated using random noise. The generator optimizes its own parameters using the discriminator's feedback information to reduce the probability that the discriminator will misidentify the generated simulated transaction data. This results in an updated initial generative adversarial network.

[0096] (4) Alternating training: The initial generator and the initial discriminator in the initial GAN ​​are trained alternately. This process is repeated until the network reaches an equilibrium state, where the simulated transaction data generated by the generator is so close to the real transaction data that the discriminator cannot distinguish between true and false. Finally, the target GAN is obtained.

[0097] Optionally, the loss function for the training process is as follows:

[0098]

[0099] Among them, V(G,D) represents the loss function, G represents the generator, which converts random noise z into generated data G(z), where z is obtained from the random noise distribution P z The noise vector sampled in (z) is the discriminator, D represents the probability D(i) that the discriminator outputs is the real data, which represents the possibility that the input data feature i is the real data, i is the real data distribution P data The sample drawn in (i). min G The optimization goal of the generator is to minimize the loss function value and generate more realistic simulated data to deceive the discriminator; maxD The optimization goal of the discriminator is to try to maximize the loss function value and maximize the probability of the discriminator distinguishing between real data and generated data. D(G(z)) represents the probability that the discriminator judges that the data G(z) generated by the generator is real data. Indicates that the calculation is based on the real data distribution P data (i) the expectation of log(D(i)), Indicates that the calculation is in the random noise distribution ~P z The expectation of log(1-D(G(z))) on (z).

[0100] It should be noted that by alternately training to optimize the parameters of the initial generator and discriminator, the generative adversarial network's generative and discriminative capabilities are continuously improved during the iterative process, achieving convergence of the target generative adversarial network to the final target point. This fixed parameter optimization approach avoids potential instabilities in the generator and discriminator during training, improving the fidelity of the generator's generated data and the accuracy of the discriminator. This provides higher-quality training samples for the target recognition model, thereby enhancing the accuracy of illegal transaction detection.

[0101] In an optional embodiment, in the process of determining the target information based on the processing result, the data processing system can determine that the target information represents that there is no illegal transaction on the credit card when the numerical value represented by the processing result is greater than or equal to the preset numerical value; and determine that the target information represents that there is an illegal transaction on the credit card when the numerical value represented by the processing result is less than the preset numerical value.

[0102] Optionally, the target recognition model outputs a transaction detection result in numerical form, indicating the likelihood that the credit card transaction was legitimate. In this embodiment, if the probability value represented by the processing result is greater than or equal to a preset value, the credit card transaction is determined to be non-illegal; if the processing result is less than the preset value, the credit card transaction is determined to be illegal.

[0103] In some embodiments, assuming that the threshold of the processing result set by the system is 0.6, if the result of detection by the target recognition model for a certain transaction is 0.3, then this transaction may be an illegal transaction.

[0104] It should be noted that by setting clear thresholds and judging whether illegal transactions exist based on the relationship between the processing results and the thresholds, illegal transactions can be detected more accurately and efficiently, thereby improving the accuracy and reliability of the data processing system in detecting illegal transactions, thereby reducing the incidence of illegal transactions in actual scenarios.

[0105] In an embodiment of the present application, a method is adopted to generate sample data based on an optimized generative adversarial network, and a target recognition model is obtained based on training of the data to detect illegal transaction behaviors. By introducing a self-attention mechanism into the generative adversarial network, a deep capture of the complex features of the generated data is achieved, thereby generating more realistic sample data. The target recognition model is trained by using sample data generated by the optimized generative adversarial network, so that the number of samples with different labels in the first training sample set can be relatively balanced, so that the target recognition module can effectively learn and recognize the features of illegal transaction data. By judging whether there is illegal transaction behavior of a credit card based on transaction data based on the target recognition model, illegal transaction behavior of the credit card can be detected according to a better model, thereby improving the accuracy of detection.

[0106] It can be seen that the solution provided in this application achieves the purpose of generating sample data based on the optimized generative adversarial network, and training a target recognition model based on the data to detect illegal transaction behaviors, thereby achieving the technical effect of improving the accuracy of detecting illegal transaction behaviors, and further solving the problem of low accuracy in detecting illegal credit card transactions in related technologies.

[0107] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0108] Example 2

[0109] The present application also provides a data processing device. It should be noted that the data processing device of the present application can be used to execute the data processing method provided in the present application. The data processing device provided in the present application is introduced below.

[0110] According to an embodiment of the present application, a device for implementing the above data processing method is also provided, such as Figure 4 As shown, the device includes:

[0111] The first acquisition module 401 is used to obtain the transaction data of the user's credit card;

[0112] Processing module 402 is configured to input the transaction data into a target recognition model and obtain a processing result using the target recognition model, wherein the target recognition model is configured to determine whether a credit card transaction is illegal based on the transaction data, and the target recognition model is trained based on a first training sample set, wherein at least a portion of the sample data in the first training sample set is generated based on a target generator in a target generative adversarial network, and the target generative adversarial network includes a self-attention mechanism;

[0113] The determination module 403 is configured to determine target information based on the processing result, wherein the target information is used to indicate whether there is any illegal transaction involving the credit card.

[0114] It should be noted that the above-mentioned first acquisition module 401, processing module 402 and determination module 403 correspond to steps S201 to S203 in Example 1. The three modules and the corresponding steps implement the same instances and application scenarios, but are not limited to the contents disclosed in the above-mentioned Example 1.

[0115] In an embodiment of the present application, a method is adopted to generate sample data based on an optimized generative adversarial network, and a target recognition model is obtained based on training of the data to detect illegal transaction behaviors. By introducing a self-attention mechanism into the generative adversarial network, a deep capture of the complex features of the generated data is achieved, thereby generating more realistic sample data. The target recognition model is trained by using sample data generated by the optimized generative adversarial network, so that the number of samples with different labels in the first training sample set can be relatively balanced, so that the target recognition module can effectively learn and recognize the features of illegal transaction data. By judging whether there is illegal transaction behavior of a credit card based on transaction data based on the target recognition model, illegal transaction behavior of the credit card can be detected according to a better model, thereby improving the accuracy of detection.

[0116] It can be seen that the solution provided in this application achieves the purpose of generating sample data based on the optimized generative adversarial network, and training a target recognition model based on the data to detect illegal transaction behaviors, thereby achieving the technical effect of improving the accuracy of detecting illegal transaction behaviors, and further solving the problem of low accuracy in detecting illegal credit card transactions in related technologies.

[0117] Optionally, in the data processing device provided in the embodiment of the present application, the data processing device also includes: a generation module, used to generate first sample data based on the target generator in the target generative adversarial network, wherein the first sample data is simulated transaction data of a sample credit card, and the true label of the first sample data represents that there is an illegal transaction in the sample credit card corresponding to the first sample data; a second acquisition module, used to obtain second sample data from the target storage area, wherein the second sample data is the true transaction data of the sample credit card; a first construction module, used to construct a first training sample set based on the first sample data and the second sample data; a first training module, used to train an initial recognition model based on the first training sample set to obtain a target recognition model.

[0118] Optionally, in the data processing device provided in an embodiment of the present application, the generation module also includes: an update submodule, used to update the random noise vector based on the self-attention mechanism to obtain an updated random noise vector; and a generation submodule, used to generate first sample data based on the updated random noise vector.

[0119] Optionally, in the data processing device provided in an embodiment of the present application, the update submodule also includes: a first calculation unit, used to multiply the random noise vector with the query matrix, key matrix and value matrix respectively to obtain the query vector, key vector and value vector corresponding to the random noise vector; a second calculation unit, used to calculate the attention score matrix based on the query vector and the key vector; and a third calculation unit, used to calculate the updated random noise vector based on the attention score matrix and the value vector.

[0120] Optionally, in the data processing device provided in the embodiment of the present application, the data processing device also includes: a third acquisition module, used to obtain a second training sample set, wherein the training samples in the second training sample set are real transaction data of the sample credit card; a second construction module, used to construct an initial generative adversarial network, wherein the initial generative adversarial network includes an initial generator and an initial discriminator, the initial generator and the initial discriminator each include a self-attention mechanism, the initial generator is used to randomly generate simulated transaction data, and the initial discriminator is used to distinguish between real transaction data and simulated transaction data; a second training module, used to train the initial generative adversarial network based on the second training sample set and a preset loss function to obtain a target generative adversarial network.

[0121] Optionally, in the data processing device provided in the embodiment of the present application, the second training module also includes: a first training sub-module, used to fix the parameters of the initial generator, and train the initial discriminator in the initial generative adversarial network based on the second training sample set and the loss function to obtain an updated initial generative adversarial network; a second training sub-module, used to fix the parameters of the updated initial generative adversarial network, and train the initial generator in the updated initial generative adversarial network based on the second training sample set and the loss function to obtain an updated initial generative adversarial network; a processing sub-module, used to repeat the steps of training the initial generator and the initial discriminator in the initial generative adversarial network when the iteration of the initial generative adversarial network does not meet the preset iteration conditions, until the iteration meets the preset iteration conditions, thereby obtaining the target generative adversarial network.

[0122] Optionally, in the data processing device provided in the embodiment of the present application, the determination module also includes: a first determination submodule, used to determine that the target information represents that there is no illegal transaction on the credit card when the numerical value represented by the processing result is greater than or equal to a preset numerical value; and a second determination submodule, used to determine that the target information represents that there is an illegal transaction on the credit card when the numerical value represented by the processing result is less than a preset numerical value.

[0123] It should be noted that the first acquisition module 401, processing module 402, and determination module 403 correspond to steps S201 to S203 in Example 1. The examples and application scenarios implemented by the three modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules or units can be hardware components or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The above-mentioned modules can also be run as part of the device in the computer terminal 10 provided in Example 1.

[0124] Example 3

[0125] An embodiment of the present application may provide an electronic device, Figure 5 This is a structural block diagram of an electronic device according to an embodiment of the present application. Figure 5 As shown, the electronic device may include: one or more ( Figure 5 Only one is shown) processor 1002, memory 1004, storage controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.

[0126] 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. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, implementing 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 a combination thereof.

[0127] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: obtain the transaction data of the user's credit card; input the transaction data into the target recognition model, and obtain the processing result through the target recognition model, wherein the target recognition model is used to determine whether there is an illegal transaction on the credit card based on the transaction data, and the target recognition model is trained based on the first training sample set, and at least part of the sample data in the first training sample set is generated based on the target generator in the target generation adversarial network, and the target generation adversarial network includes a self-attention mechanism; determine the target information based on the processing result, wherein the target information is used to characterize whether there is an illegal transaction on the credit card.

[0128] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: generate first sample data based on the target generator in the target generative adversarial network, wherein the first sample data is simulated transaction data of a sample credit card, and the true label of the first sample data indicates that there is an illegal transaction in the sample credit card corresponding to the first sample data; obtain second sample data from the target storage area, wherein the second sample data is the true transaction data of the sample credit card; construct a first training sample set based on the first sample data and the second sample data; train the initial recognition model based on the first training sample set to obtain a target recognition model.

[0129] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: updating the random noise vector based on the self-attention mechanism to obtain an updated random noise vector; generating first sample data based on the updated random noise vector.

[0130] The processor can also call the information and applications stored in the memory through the transmission device to perform the following steps: multiply the random noise vector with the query matrix, key matrix and value matrix respectively to obtain the query vector, key vector and value vector corresponding to the random noise vector; calculate the attention score matrix based on the query vector and key vector; and calculate the updated random noise vector based on the attention score matrix and value vector.

[0131] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: obtain a second training sample set, wherein the training samples in the second training sample set are real transaction data of the sample credit card; construct an initial generative adversarial network, wherein the initial generative adversarial network includes an initial generator and an initial discriminator, the initial generator and the initial discriminator each include a self-attention mechanism, the initial generator is used to randomly generate simulated transaction data, and the initial discriminator is used to distinguish between real transaction data and simulated transaction data; train the initial generative adversarial network based on the second training sample set and a preset loss function to obtain a target generative adversarial network.

[0132] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: fix the parameters of the initial generator, train the initial discriminator in the initial generative adversarial network based on the second training sample set and the loss function, and obtain an updated initial generative adversarial network; fix the parameters of the updated initial generative adversarial network, train the initial generator in the updated initial generative adversarial network based on the second training sample set and the loss function, and obtain an updated initial generative adversarial network; if the iteration of the initial generative adversarial network does not meet the preset iteration conditions, repeat the steps of training the initial generator and initial discriminator in the initial generative adversarial network until the iteration meets the preset iteration conditions, and obtain the target generative adversarial network.

[0133] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: when the numerical value represented by the processing result is greater than or equal to the preset numerical value, determine that the target information represents that there is no illegal transaction on the credit card; when the numerical value represented by the processing result is less than the preset numerical value, determine that the target information represents that there is an illegal transaction on the credit card.

[0134] In an embodiment of the present application, a method is adopted to generate sample data based on an optimized generative adversarial network, and a target recognition model is obtained based on training of the data to detect illegal transaction behaviors. By introducing a self-attention mechanism into the generative adversarial network, a deep capture of the complex features of the generated data is achieved, thereby generating more realistic sample data. The target recognition model is trained by using sample data generated by the optimized generative adversarial network, so that the number of samples with different labels in the first training sample set can be relatively balanced, so that the target recognition module can effectively learn and recognize the features of illegal transaction data. By judging whether there is illegal transaction behavior of a credit card based on transaction data based on the target recognition model, illegal transaction behavior of the credit card can be detected according to a better model, thereby improving the accuracy of detection.

[0135] It can be seen that the solution provided in this application achieves the purpose of generating sample data based on the optimized generative adversarial network, and training a target recognition model based on the data to detect illegal transaction behaviors, thereby achieving the technical effect of improving the accuracy of detecting illegal transaction behaviors, and further solving the problem of low accuracy in detecting illegal credit card transactions in related technologies.

[0136] It can be understood by those skilled in the art that Figure 5 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 5It does not limit the structure of the above electronic device. For example, the electronic device may also include Figure 5 More or fewer components (such as network interfaces, display devices, etc.) shown in, or with Figure 5 Different configurations shown.

[0137] A person skilled in the art will 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, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0138] Example 4

[0139] 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 data processing method provided in the first embodiment.

[0140] Optionally, in this embodiment, the 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.

[0141] The present application also provides a computer program product, which, when executed on a data processing device, is adapted to perform the steps of the data processing method.

[0142] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0143] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0144] 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 is only a logical function division. In actual implementation, there may be other division methods, such as 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.

[0145] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0146] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0147] 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 is essentially 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 for enabling 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 aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0148] The above is only a preferred embodiment 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 data processing method, characterized in that: include: Get the user's credit card transaction data; Inputting the transaction data into a target recognition model and obtaining a processing result through the target recognition model, wherein the target recognition model is used to determine whether the credit card transaction is illegal based on the transaction data, and the target recognition model is trained based on a first training sample set, at least part of the sample data in the first training sample set is generated based on a target generator in a target generative adversarial network, and the target generative adversarial network includes a self-attention mechanism; determining target information based on the processing result, wherein the target information is used to indicate whether there is any illegal transaction involving the credit card; The target recognition model is obtained by: generating first sample data based on a target generator in the target generative adversarial network, wherein the first sample data is simulated transaction data of a sample credit card, and the true label of the first sample data indicates that the sample credit card corresponding to the first sample data has an illegal transaction; obtaining second sample data from a target storage area, wherein the second sample data is true transaction data of the sample credit card; constructing a first training sample set based on the first sample data and the second sample data; and training an initial recognition model based on the first training sample set to obtain the target recognition model; The target generator includes the self-attention mechanism, wherein generating the first sample data based on the target generator in the target generative adversarial network includes: updating the random noise vector based on the self-attention mechanism to obtain an updated random noise vector; and generating the first sample data based on the updated random noise vector; The random noise vector is updated based on the self-attention mechanism to obtain an updated random noise vector, including: multiplying the random noise vector with a query matrix, a key matrix, and a value matrix respectively to obtain a query vector, a key vector, and a value vector corresponding to the random noise vector; calculating an attention score matrix based on the query vector and the key vector; and calculating the updated random noise vector based on the attention score matrix and the value vector.

2. The method according to claim 1, characterized in that The target generative adversarial network is obtained by: Obtaining a second training sample set, wherein the training samples in the second training sample set are real transaction data of a sample credit card; Constructing an initial generative adversarial network, wherein the initial generative adversarial network includes an initial generator and an initial discriminator, each of the initial generator and the initial discriminator includes the self-attention mechanism, the initial generator is used to randomly generate simulated transaction data, and the initial discriminator is used to distinguish between the real transaction data and the simulated transaction data; The initial generative adversarial network is trained based on the second training sample set and a preset loss function to obtain the target generative adversarial network.

3. The method according to claim 2, characterized in that Training the initial generative adversarial network based on the second training sample set and a preset loss function to obtain the target generative adversarial network includes: Fixing the parameters of the initial generator, and training the initial discriminator in the initial generative adversarial network based on the second training sample set and the loss function to obtain an updated initial generative adversarial network; Fixing the parameters of the updated initial generative adversarial network, and training the initial generator in the updated initial generative adversarial network based on the second training sample set and the loss function to obtain a further updated initial generative adversarial network; When the iteration of the initial generative adversarial network does not meet the preset iteration conditions, the steps of training the initial generator and the initial discriminator in the initial generative adversarial network are repeatedly performed until the iteration meets the preset iteration conditions, thereby obtaining the target generative adversarial network.

4. The method according to claim 1, wherein The processing result is in numerical form, wherein determining target information based on the processing result includes: In a case where the value represented by the processing result is greater than or equal to a preset value, determining that the target information represents that there is no illegal transaction on the credit card; When the value represented by the processing result is smaller than the preset value, it is determined that the target information represents that an illegal transaction has occurred on the credit card.

5. A data processing device for executing the data processing method according to any one of claims 1 to 4, characterized in that: include: A first acquisition module is used to obtain the transaction data of the user's credit card; a processing module, configured to input the transaction data into a target recognition model and obtain a processing result through the target recognition model, wherein the target recognition model is configured to determine whether the credit card transaction involves illegal transactions based on the transaction data, the target recognition model being trained based on a first training sample set, at least a portion of the sample data in the first training sample set being generated based on a target generator in a target generative adversarial network, the target generative adversarial network including a self-attention mechanism; A determination module is used to determine target information based on the processing result, wherein the target information is used to indicate whether there is any illegal transaction with the credit card.

6. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored executable program, wherein when the executable program is run, the device where the computer-readable storage medium is located is controlled to execute the data processing method according to any one of claims 1 to 4.

7. An electronic device, characterized in that: include: a memory storing an executable program; A processor, configured to run the program, wherein the program executes the data processing method according to any one of claims 1 to 4 when running.

8. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by a processor, the steps of the data processing method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Training sample generation method and device

    CN111126503A

  • Malicious code detection method based on generative adversarial network

    CN111832019A