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

By introducing a self-attention mechanism into the generative adversarial network to generate sample data and training the target recognition model, the problem of low accuracy of illegal transaction detection of credit cards is solved, and high-accuracy illegal transaction detection is achieved.

CN119831744AActive Publication Date: 2025-04-15INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 21 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing illegal credit card transaction detection methods are low in accuracy and cannot effectively detect complex and diverse transaction data, affecting the financial transaction order and economic income.

Method used

Using a data processing method based on a generative adversarial network, a self-attention mechanism is introduced to generate sample data, a target recognition model is trained, and a realistic simulated transaction data is generated to balance the training sample set and improve detection accuracy.

Benefits of technology

High accuracy detection of illegal transactions on credit cards is achieved, and the target recognition model is trained by generating sample data generated by the adversarial network, which balances the training sample set and improves the accuracy of illegal transaction detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119831744A_ABST
    Figure CN119831744A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method and device, a computer readable storage medium and electronic equipment. The method comprises the following steps: acquiring transaction data of a credit card of a user; the transaction data are input to a target recognition model, a processing result is obtained through the target recognition model, the target recognition model is used for judging whether illegal transactions exist in the credit card or not according to the transaction data, and the target recognition 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; target information is determined based on the processing result, and the target information is used for representing whether illegal transactions exist in the credit card or not. Through the method and the device, the problem of low detection accuracy of illegal transaction of the 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 payment and online transactions, credit cards have become a widely used payment tool in modern society. However, illegal credit card transactions have also shown an increasing trend year by year, causing many economic 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 cannot 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 the present 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 the related art.

[0006] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a data processing method is provided. The method comprises: obtaining the transaction data of the user's credit card; 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 judge whether there is an illegal transaction of the credit card according to the transaction data, and the target recognition model is trained based on a first training sample set, and at least part of the sample data in the first training sample set is generated based on a target generator in a target generation adversarial network, and the target generation adversarial network includes a self-attention mechanism; determining target information based on the processing result, wherein the target information is used to characterize whether there is an illegal transaction of the credit card.

[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 represents that there are illegal transactions 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; 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, and obtaining the target generative adversarial network.

[0012] Furthermore, the data processing method also includes: when the value represented by the processing result is greater than or equal to the preset value, determining that the target information represents that the credit card does not have illegal transactions; when the value represented by the processing result is less than the preset value, determining that the target information represents that the credit card has illegal transactions.

[0013] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a data processing device is provided. The device includes: a first acquisition module, which is used to acquire the transaction data of the user's credit card; a processing module, which is used 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 used to determine whether there is an illegal transaction of the credit card based on the transaction data, and the target recognition model is trained based on a first training sample set, and at least part of the sample data in the first training sample set is generated based on a target generator in a target generation adversarial network, and the target generation adversarial network includes a self-attention mechanism; a determination module, which is used to determine target information based on the processing result, wherein the target information is used to characterize whether there is an illegal transaction of the credit card.

[0014] Furthermore, the data processing device also includes: a generation module, which is used to generate 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 represents that there are illegal transactions in the sample credit card corresponding to the first sample data; a second acquisition module, which is used to acquire second sample data from a target storage area, wherein the second sample data is true transaction data of the sample credit card; a first construction module, which is used to construct a first training sample set based on the first sample data and the second sample data; and a first training module, which is 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 the 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 acquire 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 sub-module, 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 sub-module, 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 sub-module, 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, and the target generative adversarial network is obtained.

[0019] Furthermore, the determination module also includes: a first determination submodule, used to determine that the target information represents that the credit card does not have illegal transactions 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 the credit card does have illegal transactions 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, and the computer-readable storage medium 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, the electronic device comprising 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, including 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 of generating sample data based on an optimized generative adversarial network and training a target recognition model based on the data to detect illegal transaction behaviors is adopted. By introducing a self-attention mechanism in 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 a credit card has illegal transaction behaviors based on transaction data based on the target recognition model, illegal transaction behaviors of credit cards can be detected according to a better model, thereby improving the accuracy of detection.

[0024] It can be seen that the solution provided in the present application achieves the purpose of generating sample data based on an 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 detection accuracy of illegal credit card transactions in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0026] Figure 1 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 It is a training diagram of a target generative adversarial network provided 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 It 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 solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present 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 sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[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 relevant data are in compliance with relevant laws, regulations and standards, necessary confidentiality measures are taken, and public order and good customs are not violated, and corresponding operation entrances are provided for users to choose to authorize or refuse. For example, an interface is set up between this system and relevant users or institutions to provide users with corresponding operation entrances for users to choose to agree or refuse the results of automated decision-making; if the user chooses to refuse, the expert decision-making process will be entered.

[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 FIG. 1 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 (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[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 circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts 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 program instructions / data storage devices 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, realizing 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 examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0039] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[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, obtaining the transaction data of the user's credit card.

[0043] Optionally, electronic devices, application systems, servers and other devices may be used as the execution subject of the present application. In this embodiment, a 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] Step S202: 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 used to determine whether there is an illegal transaction of the credit card based on the transaction data, and the target recognition model is trained based on a first training sample set, and 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 label, that is, the true label of the sample data in the first training sample set is used to characterize whether there is an illegal transaction for 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 the 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. In actual scenarios, illegal credit card transactions face data imbalance problems, and 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. Self-attention mechanisms are introduced into the target generator and the target discriminator respectively. The target generative adversarial network is obtained by training an initial generative adversarial network based on 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 real transaction data.

[0051] Optionally, the data processing system can use the target recognition model to extract and analyze the transaction data to generate a processing result, which is used to characterize whether the transaction is legal. The processing result can be in numerical form, and different numerical values ​​can represent different transaction behaviors.

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

[0053] Optionally, the processing result is in numerical form to represent different transaction behaviors, and 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 that the credit card is a legal transaction, and the data processing system may determine the corresponding target information according to 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 "legal 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 of generating sample data based on an optimized generative adversarial network and training a target recognition model based on the data to detect illegal transaction behaviors is adopted. By introducing a self-attention mechanism in 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 a credit card has illegal transaction behaviors based on transaction data based on the target recognition model, illegal transaction behaviors of credit cards can be detected according to a better model, thereby improving the accuracy of detection.

[0056] It can be seen that the solution provided in the present application achieves the purpose of generating sample data based on an 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 detection accuracy of 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 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 represents that there are illegal transactions in the sample credit card corresponding to the first sample data; obtain second sample data from a 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; and train an 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 the target generative adversarial network and second sample data extracted from actual transaction records of sample credit cards. The first sample data is simulated illegal transaction data, whose real label is used to characterize "illegal transaction", and the second sample data is real transaction data of the sample credit card, whose real label is used to characterize "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 a legal transaction. i =0, it indicates illegal transaction.

[0061] Optionally, during the training process, the data processing system may 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 as to update the model parameters of the initial recognition model when the loss function value is greater than a preset threshold, and continue to execute the aforementioned steps of calculating the loss function value 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, and enhance the target recognition model's ability to detect unknown illegal transaction behaviors, thereby improving the accuracy of the model 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 obtained by training the initial generator in the initial generative adversarial network based on the real transaction data of the sample credit card, and a self-attention mechanism is introduced into the initial generator in the initial generative adversarial network. The self-attention mechanism in the target generator updates the random noise vector by capturing the global dependencies in the sample transaction data, so that the target generator generates simulated transaction data based on the updated random noise vector. The updated random noise vector embeds the feature information of the sample transaction data, so that the generated simulated transaction data is closer to the feature distribution of the real transaction data.

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

[0066] It should be noted that by introducing the self-attention mechanism in the initial generator, the feature extraction capability of the random noise vector is optimized, so that the generated simulated transaction data can better reflect the complex characteristics of illegal transaction data. The self-attention mechanism can effectively enhance the global dependencies in the data generation process, and generate higher quality simulated transaction data by continuously updating the random noise vector to embed more feature information of real 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 may 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, gives higher weights to key features, and reduces the weights of unimportant features, to help the generator better capture the patterns and characteristics of the transaction data.

[0069] Optionally, the self-attention mechanism consists of three vectors, namely the query vector Q, the key vector K and the value vector V. Each vector is obtained by multiplying the random noise vector and 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, which is 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 probability distributions, 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, which 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 training; 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 dependency relationship between features is weaker, and the generator will pay less attention to these features during training.

[0078] It should be noted that the random noise vector is updated through the self-attention mechanism, which enables more accurate feature expression and data generation in the generative adversarial network. The attention score matrix is ​​calculated by multiplying the random noise vector with the query matrix, key matrix and value matrix, and the attention weights between different features are calculated based on the attention score matrix, so that the random noise vector can dynamically focus on the key features of the input sample transaction data, thereby capturing the dependency between features, ensuring that the important features of the data are given priority, and then generating simulated transaction data that is more in line with the real data distribution, 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), and the data processing system may perform data preprocessing, such as standardization and normalization, on the acquired real transaction data, wherein the mathematical expression of standardization is:

[0081]

[0082] 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 the 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, and the initial generator and the initial discriminator each include a self-attention mechanism. The initial generator is used to generate simulated transaction data with similar characteristics and distribution to real transaction data, so that it is difficult for the initial discriminator to distinguish between true and false; 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 generative adversarial network, the data processing system can train the initial generative adversarial network based on the second training sample set and a preset loss function to obtain the target generative adversarial network. Optionally, the loss function is an optimization target in the generative adversarial network training process, which is used to measure the performance of the generator and the discriminator. By calculating the loss function, the generator and the discriminator can be gradually optimized in adversarial training to achieve balance. The target generative adversarial network is a mature model obtained by continuously training and optimizing the initial generative adversarial network based on the second training sample set and the loss function, and can generate simulated transaction data similar to real transaction data.

[0087] It should be noted that by introducing the self-attention mechanism, the generator can better capture the complex characteristics of sample transaction data to generate more realistic simulated transaction data, and the discriminator can more accurately distinguish between real and generated transaction data. By training and optimizing the initial generative adversarial network based on real transaction data and loss function to obtain the target generative adversarial network, more realistic simulated transaction data can be generated, thereby improving the detection ability and accuracy of the target recognition model for illegal transaction behaviors.

[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 the 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 the 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 the 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, and 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, and 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, and the preset iteration condition 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 3is a schematic diagram of training a target generative adversarial network according to an embodiment of the present application, such as Figure 3 As shown in Figure 1, the following are the basic steps for alternately optimizing network parameters during training of a generative adversarial network:

[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 and minimize 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, and the loss function of the generator is based on the classification results of the generated data by the discriminator. Simulated transaction data is generated through random noise. The generator optimizes its own parameters through the feedback information of the discriminator to reduce the probability that the discriminator will misidentify the simulated transaction data it generates. This results in the updated initial generative adversarial network.

[0096] (4) Alternating training: The initial generator and the initial discriminator in the initial generative adversarial network are trained alternately. This process is repeated until the network reaches an equilibrium state, that is, the simulated transaction data generated by the generator is so close to the real transaction data that the discriminator cannot distinguish between the true and the false, and finally the target generative adversarial network 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 (z), D represents the discriminator, which outputs the probability D(i) that i is the real data, indicating the possibility that the input data feature i is the real data, i is from the real data distribution P data (i) The sample drawn. min G It indicates that 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 maximize the loss function value and the probability of the discriminator distinguishing between real data and generated data. D(G(z)) indicates 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) with respect to 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 the initial discriminator, the generation and discrimination capabilities of the generative adversarial network are continuously improved during the iteration process, and the convergence of the target generative adversarial network on the final target point is achieved. The fixed parameter optimization method can avoid the instability that may occur in the generator and discriminator during the training process, improve the fidelity of the data generated by the generator and the accuracy of the discriminator, and provide higher quality training samples for the target recognition model, thereby improving 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 of 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 of 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 the processing result of the transaction detection in numerical form, indicating the possibility of a legal credit card transaction. In this embodiment, when the probability value represented by the processing result is greater than or equal to a preset value, it is determined that there is no illegal transaction on the credit card; when the processing result is less than the preset value, it is determined that there is an illegal transaction on the credit card.

[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 of generating sample data based on an optimized generative adversarial network and training a target recognition model based on the data to detect illegal transaction behaviors is adopted. By introducing a self-attention mechanism in 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 a credit card has illegal transaction behaviors based on transaction data based on the target recognition model, illegal transaction behaviors of credit cards can be detected according to a better model, thereby improving the accuracy of detection.

[0106] It can be seen that the solution provided in the present application achieves the purpose of generating sample data based on an 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 detection accuracy of 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 embodiment of the present application also provides a data processing device. It should be noted that the data processing device of the embodiment of the present application can be used to execute the data processing method provided by the embodiment of the present application. The data processing device provided by the embodiment of 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 comprises:

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

[0112] A processing module 402 is used 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 used to determine whether there is an illegal transaction of the credit card according to the transaction data, and the target recognition model is trained based on a first training sample set, and at least part of the sample data in the first training sample set is generated based on a target generator in a target generation adversarial network, and the target generation adversarial network includes a self-attention mechanism;

[0113] The determination module 403 is used to determine target information based on the processing result, wherein the target information is used to characterize whether there is any illegal transaction in 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, and the instances 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.

[0115] In an embodiment of the present application, a method of generating sample data based on an optimized generative adversarial network and training a target recognition model based on the data to detect illegal transaction behaviors is adopted. By introducing a self-attention mechanism in 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 a credit card has illegal transaction behaviors based on transaction data based on the target recognition model, illegal transaction behaviors of credit cards can be detected according to a better model, thereby improving the accuracy of detection.

[0116] It can be seen that the solution provided in the present application achieves the purpose of generating sample data based on an 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 detection accuracy of 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 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 represents that there are illegal transactions in the sample credit card corresponding to the first sample data; a second acquisition module, used to acquire second sample data from a 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; and 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 updating 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 acquire 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, and the target generative adversarial network is obtained.

[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 the credit card does not have illegal transactions 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 the credit card does not have illegal transactions 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, the processing module 402 and the determination module 403 correspond to steps S201 to S203 in Example 1, and the three modules and the corresponding steps implement the same examples and application scenarios, 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 may 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), and the above-mentioned modules may also be part of the device and may be run 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 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, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[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 of 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 of the credit card.

[0128] The processor can also call the information and application programs 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 represents that there are illegal transactions 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 an 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 programs 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; and generating first sample data based on the updated random noise vector.

[0130] The processor can also call the information and application programs 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 the key vector; and calculate the updated random noise vector based on the attention score matrix and the value vector.

[0131] The processor can also call the information and application programs 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 programs 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 the credit card does not have illegal transactions; when the numerical value represented by the processing result is less than the preset numerical value, determine that the target information represents that the credit card has illegal transactions.

[0134] In an embodiment of the present application, a method of generating sample data based on an optimized generative adversarial network and training a target recognition model based on the data to detect illegal transaction behaviors is adopted. By introducing a self-attention mechanism in 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 a credit card has illegal transaction behaviors based on transaction data based on the target recognition model, illegal transaction behaviors of credit cards can be detected according to a better model, thereby improving the accuracy of detection.

[0135] It can be seen that the solution provided in the present application achieves the purpose of generating sample data based on an 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 detection accuracy of 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 5The structure of the electronic device is not limited. Figure 5 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 5 Different configurations are shown.

[0137] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[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 above storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.

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

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

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

[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. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

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

[0146] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of 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, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

[0148] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A data processing method, characterized in that: include: Get the user's credit card transaction data; 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 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 a first training sample set, and at least part of the sample data in the first training sample set is generated based on a target generator in a target generation adversarial network, and the target generation adversarial network includes a self-attention mechanism; Target information is determined based on the processing result, wherein the target information is used to characterize whether there is any illegal transaction involving the credit card.

2. The method according to claim 1, characterized in that: The target recognition model is obtained by: 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 the sample credit card corresponding to the first sample data has an illegal transaction; Acquire second sample data from the target storage area, wherein the second sample data is real transaction data of a sample credit card; Constructing the first training sample set based on the first sample data and the second sample data; An initial recognition model is trained based on the first training sample set to obtain the target recognition model.

3. The method according to claim 2, characterized in that The target generator includes the self-attention mechanism, wherein generating first sample data based on the target generator in the target generative adversarial network includes: The random noise vector is updated based on the self-attention mechanism to obtain an updated random noise vector; The first sample data is generated based on the updated random noise vector.

4. The method according to claim 3, characterized in that: 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 the query matrix, the key matrix and the value matrix respectively to obtain the query vector, the key vector and the value vector corresponding to the random noise vector; Calculate an attention score matrix based on the query vector and the key vector; The updated random noise vector is calculated based on the attention score matrix and the value vector.

5. 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, the initial generator and the initial discriminator each include 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.

6. The method according to claim 5, 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, 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, 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.

7. The method according to claim 1, characterized in that The processing result is in numerical form, wherein determining the target information based on the processing result includes: In the 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 of 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.

8. A data processing device, characterized in that: include: A first acquisition module is used to acquire 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 used to determine whether the credit card has any illegal transactions according to the transaction data, and the target recognition model is trained based on a first training sample set, and at least part of the sample data in the first training sample set is generated based on a target generator in a target generation adversarial network, and the target generation adversarial network includes 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 characterize whether there is any illegal transaction with the credit card.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored executable program, wherein when the executable program is executed, 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 7.

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

11. 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 7 are implemented.

Citation Information

Patent Citations

  • Training sample generation method and device

    CN111126503A

  • Malicious code detection method based on generative adversarial network

    CN111832019A

  • Generative adversarial network cardiac beat signal generation system and method based on space attention

    CN114159069A

  • Credit card limit evaluation method, device, equipment and medium

    CN114820164A

  • Abnormal fund transaction data identification method and apparatus, and electronic device

    CN115049497A