Risk identification method and apparatus, and device and storage medium
By performing feature encoding and sequence block division on mobile payment transaction data and using a risk identification model to handle payment risks, the problem of inaccurate risk identification in existing technologies has been solved, enabling more efficient interception of illegal payment activities and improving the security of mobile payments.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2025-10-10
- Publication Date
- 2026-05-07
AI Technical Summary
In existing mobile payment scenarios, risk identification rule-based methods are easily bypassed by malicious actors, making it difficult to effectively distinguish between normal transactions and fraudulent activities, resulting in inaccurate risk identification.
By acquiring multiple payment transaction data of an object and encoding their features, a first payment feature sequence is generated and divided into multiple sequence blocks. A risk identification model is then used to process these sequence blocks for payment risk identification, capturing the object's local and global payment features.
It improves the accuracy of payment risk identification, can promptly intercept illegal payment activities, and enhances the security of mobile payments.
Smart Images

Figure CN2025126843_07052026_PF_FP_ABST
Abstract
Description
Risk identification methods, devices, equipment and storage media Technical Field
[0001] This application claims priority to Chinese Patent Application No. 2024115643426, filed on November 4, 2024, entitled "Risk Identification Method, Apparatus, Device and Storage Medium", the entire contents of which are incorporated herein by reference.
[0002] Technical Field
[0003] This application relates to the field of computer technology, and in particular to a risk identification method, apparatus, device, and storage medium. Background Technology
[0004] Mobile payment services, which allow users to make payments and transfers through applications, are convenient and have been widely promoted and applied. However, with the development and popularization of mobile payment technology, some illegal activities (such as fraud) have been carried out through mobile payments. Therefore, in mobile payment scenarios, it is particularly important to identify abnormal payments (such as fraudulent payments).
[0005] Currently, in mobile payment scenarios, risk identification rules are typically formulated based on historical fraud cases and business logic, and then used to identify risks. However, this risk identification method based on risk identification rules is easily bypassed by malicious actors and cannot effectively distinguish between legitimate transactions and fraudulent activities, leading to inaccurate risk identification. Summary of the Invention
[0006] This application provides a risk identification method, apparatus, device, and storage medium, which can improve the accuracy of payment risk identification, thereby enabling timely interception of illegal payment activities and enhancing the security of mobile payments.
[0007] Firstly, this application provides a risk identification method, including:
[0008] Retrieve M payment transaction records of the object within a recent period, where M is a positive integer;
[0009] Each payment transaction data is feature-encoded to obtain the feature representation information of each payment transaction data, and a first payment feature sequence is determined based on the feature representation information of the M payment transaction data.
[0010] The first payment feature sequence of the object is divided into K sequence blocks, where K is a positive integer greater than 1;
[0011] The K sequence blocks are processed for payment risk identification to obtain the risk prediction result for each of the M payment transaction data.
[0012] Secondly, this application provides a method for training a risk identification model, including:
[0013] Retrieve M payment transaction records for each of N objects, where N and M are both positive integers;
[0014] For the i-th object among the N objects, feature encoding is performed on each of the M payment transaction data of the i-th object to obtain the feature representation information of each payment transaction data. Based on the feature representation information of the M payment transaction data, the first payment feature sequence of the i-th object is determined, where i is a positive integer less than or equal to N.
[0015] The first payment feature sequence of the i-th object is divided into K sequence blocks, where K is a positive integer greater than 1;
[0016] Using a risk identification model, payment risk identification processing is performed on K sequence blocks of each of the N objects to obtain the risk prediction result for each payment transaction data of the N objects;
[0017] Based on the risk prediction results of each payment transaction data of the N objects, the model loss of the risk identification model is determined, and the parameters in the risk identification model are adjusted based on the model loss to obtain the risk identification model.
[0018] Thirdly, this application provides a risk identification device, comprising:
[0019] The acquisition unit is used to acquire M payment transaction data of the object within a recent period, where M is a positive integer;
[0020] The feature encoding unit is used to encode the features of each payment transaction data to obtain the feature representation information of each payment transaction data, and to determine the first payment feature sequence based on the feature representation information of the M payment transaction data.
[0021] A block partitioning unit is used to divide the first payment feature sequence of the object into K sequence blocks, where K is a positive integer greater than 1;
[0022] The risk identification unit is used to perform payment risk identification processing on the K sequence blocks to obtain the risk prediction result of each payment transaction data in the M payment transaction data.
[0023] In some embodiments, the feature encoding unit is specifically configured to, for the j-th payment transaction data in the M payment transaction data, select P payment information belonging to the payment information type based on a preset payment information type, where P is a positive integer and j is a positive integer less than or equal to M; perform feature encoding on the P payment information respectively to obtain the encoding information of each of the P payment information; perform feature fusion on the encoding information of the P payment information to obtain the feature representation information of the j-th payment transaction data; and perform data format conversion processing based on the feature representation information of each payment data in the M payment transaction data to determine the first payment feature sequence.
[0024] In some embodiments, the feature encoding unit is specifically used to concatenate the encoded information of the P payment information to obtain the feature representation information of the j-th payment transaction data.
[0025] In some embodiments, the feature encoding unit is specifically used to perform data format conversion processing based on the feature representation information of the M payment transaction data to determine the first payment feature sequence.
[0026] In some embodiments, the feature encoding unit is specifically used to embed the feature representation information of the M payment transaction data respectively, so as to map the feature information representation of the payment transaction data to a low-dimensional feature space, thereby obtaining the embedded representation of the feature representation information of each payment data in the M payment transaction data; and to perform data format conversion processing on the embedded representation of the feature representation information of the M payment transaction data to obtain the first payment feature sequence.
[0027] In some embodiments, the feature encoding unit is specifically used to combine the embedded representations of the feature representation information of the M payment transaction data to obtain a second payment feature sequence; and to interchange the feature dimension and the payment transaction data entry dimension M in the second payment feature sequence to obtain the first payment feature sequence.
[0028] In some embodiments, the feature encoding unit is specifically used to arrange the embedded representations of the feature representation information of the M payment transaction data based on the time order of the M payment transaction data to obtain the second payment feature sequence.
[0029] In some embodiments, the block partitioning unit is specifically used to slide on the first payment feature sequence with a preset block length as the size of the sliding window and a preset block step size as the sliding step size of the sliding window, thereby dividing the first payment feature sequence into K sequence blocks.
[0030] In some embodiments, the risk identification unit is specifically used to perform payment risk identification processing on the K sequence blocks through a risk identification model to obtain the risk prediction result of each payment transaction data in the M payment transaction data.
[0031] In some embodiments, the risk identification model includes an embedding layer, Q attention modules, and an output layer, where Q is a positive integer. The risk identification unit is specifically used to perform embedding processing on each of the K sequence blocks through the embedding layer to obtain an input embedding representation; to perform attention analysis processing on the input embedding representation through the Q attention modules to obtain attention feature information; and to perform risk calculation on the attention feature information through the output layer to obtain the risk prediction result for each of the M payment transaction data.
[0032] In some embodiments, the embedding layer includes a feature embedding layer and a position embedding layer. The risk identification unit is specifically configured to perform feature embedding processing on each of the K sequence blocks through the feature embedding layer to obtain a feature embedding representation of the K sequence blocks; perform position embedding processing on each of the K sequence blocks through the position embedding layer to obtain a position embedding representation of the K sequence blocks; and fuse the feature embedding representation and the position embedding representation of the K sequence blocks to obtain the input embedding representation.
[0033] In some embodiments, each of the Q attention modules includes a multi-head attention layer, a first residual connection and normalization layer, a feedforward network layer, and a second residual connection and normalization layer. The risk identification unit is specifically configured to perform attention analysis processing on the input embedding representation using the multi-head attention layer, the first residual connection and normalization layer, the feedforward network layer, and the second residual connection and normalization layer included in the first of the Q attention modules to obtain first attention feature information; perform attention analysis processing on the first attention feature information using the multi-head attention layer, the first residual connection and normalization layer, the feedforward network layer, and the second residual connection and normalization layer included in the second of the Q attention modules to obtain second attention feature information; and perform this sequentially to obtain the Qth attention feature information; and obtain the attention feature information based on the Qth attention feature information.
[0034] In some embodiments, the output layer includes an activation function and a risk identification unit, specifically used to perform nonlinear mapping on the attention feature information through the activation function to obtain first feature information; to normalize the first feature information to obtain second feature information; and to perform risk classification processing on the second feature information to obtain the risk prediction result for each of the M payment transaction data.
[0035] Fourthly, this application provides a training device for a risk identification model, comprising:
[0036] The acquisition unit is used to acquire M payment transaction data for each of N objects, where N and M are both positive integers.
[0037] The feature encoding unit is used to encode the features of each of the M payment transaction data of the i-th object among the N objects, to obtain the feature representation information of each payment transaction data, and to determine the first payment feature sequence of the i-th object based on the feature representation information of the M payment transaction data, where i is a positive integer less than or equal to N;
[0038] A block partitioning unit is used to slide on the first payment feature sequence with a preset block length as the size of the sliding window and a preset block step size as the sliding step size of the sliding window, so as to divide the first payment feature sequence of the i-th object into K sequence blocks, where K is a positive integer greater than 1;
[0039] The risk identification unit is used to perform payment risk identification processing on K sequence blocks of each of the N objects through a risk identification model, and obtain the risk prediction result of each payment transaction data in the N objects;
[0040] Training unit 25 is used to determine the model loss of the risk identification model based on the risk prediction results of each payment transaction data of the N objects, and to adjust the parameters in the risk identification model based on the model loss to obtain the trained risk identification model.
[0041] In some embodiments, the risk identification model includes an embedding layer, Q attention modules, and an output layer, where Q is a positive integer. Specifically, the risk identification unit is used to: for the i-th object among the N objects, perform embedding processing on each of the K sequence blocks of the i-th object through the embedding layer to obtain the input embedding representation of the i-th object; perform attention analysis processing on the input embedding representation of the i-th object through the Q attention modules to obtain the attention feature information of the i-th object; and perform risk calculation on the attention feature information of the i-th object through the output layer to obtain the risk prediction result for each of the M payment transaction data of the i-th object.
[0042] In some embodiments, the embedding layer includes a feature embedding layer and a position embedding layer. The risk identification unit is configured to perform feature embedding processing on each of the K sequence blocks of the i-th object through the feature embedding layer to obtain the feature embedding representation of the K sequence blocks; perform position embedding processing on each of the K sequence blocks of the i-th object through the position embedding layer to obtain the position embedding representation of the K sequence blocks; and fuse the feature embedding representation and the position embedding representation of the K sequence blocks to obtain the input embedding representation of the i-th object.
[0043] In some embodiments, each of the Q attention modules includes a multi-head attention layer, a first residual connection and normalization layer, a feedforward network layer, and a second residual connection and normalization layer. The risk identification unit is configured to perform attention analysis processing on the input embedding representation corresponding to the i-th object using the multi-head attention layer, the first residual connection and normalization layer, the feedforward network layer, and the second residual connection and normalization layer included in the first attention module of the Q attention modules, to obtain the first attention feature information of the i-th object; perform attention analysis processing on the first attention feature information of the i-th object using the multi-head attention layer, the first residual connection and normalization layer, the feedforward network layer, and the second residual connection and normalization layer included in the second attention module of the Q attention modules, to obtain the second attention feature information of the i-th object, and so on, sequentially, to obtain the Q-th attention feature information of the i-th object; and obtain the attention feature information of the i-th object based on the Q-th attention feature information of the i-th object.
[0044] In some embodiments, the training unit 25 is specifically used to adjust the parameters included in the location embedding layer and the normalization layer in the risk identification model based on the model loss, so as to obtain the trained risk identification model.
[0045] Fifthly, an electronic device is provided, including a processor and a memory. The memory is used to store a computer program, and the processor is used to invoke and run the computer program stored in the memory to perform the methods described in the first or second aspect and their respective implementations.
[0046] In a sixth aspect, a chip is provided for implementing the methods of any one of the first aspects and their respective implementations. Specifically, the chip includes a processor for calling and running a computer program from a memory, causing a device on which the chip is installed to perform the methods of any one of the first or second aspects and their respective implementations.
[0047] In a seventh aspect, a computer-readable storage medium is provided for storing a computer program that causes a computer to perform the methods described in the first aspect and its various implementations.
[0048] Eighthly, a computer program product is provided, including computer program instructions that cause a computer to perform the methods described in the first aspect and its various implementations.
[0049] Ninthly, a computer program is provided that, when run on a computer, causes the computer to perform the methods described in the first aspect and its various implementations.
[0050] In summary, this embodiment of the application obtains M payment transaction data of an object, and then encodes the features of each of these M payment transaction data to obtain the object's first payment feature sequence. Next, a sliding window is slid across the first payment feature sequence with a preset block length and a preset block step size, dividing the object's first payment feature sequence into K sequence blocks. Payment risk identification processing is then performed on the K sequence blocks of the object to obtain the risk prediction result for each of the object's M payment transaction data. Therefore, in this embodiment of the application, by performing feature encoding processing on multiple payment transaction data of an object, the object's first payment feature sequence is obtained. This first payment feature sequence can reflect the object's payment behavior. Then, the first payment feature sequence is divided into multiple sequence blocks, and payment risk identification processing is performed on these multiple sequence blocks to capture the object's local and global payment features, thereby achieving accurate identification of payment transaction data risks. Attached Figure Description
[0051] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0052] Figure 1 is a schematic diagram of an implementation environment for the risk identification method and the training method for the risk identification model provided in the embodiments of this application;
[0053] Figure 2 is a flowchart illustrating a risk identification method provided in an embodiment of this application;
[0054] Figure 3 is a schematic diagram illustrating the determination of feature representation information of payment transaction data involved in an embodiment of this application;
[0055] Figure 4 is a schematic diagram illustrating one method of embedding payment transaction data in an embodiment of this application.
[0056] Figure 5 is a block partitioning diagram according to an embodiment of this application;
[0057] Figure 6 is a schematic diagram of a model training method according to an embodiment of this application;
[0058] Figure 7 is a schematic diagram of a network structure for a pre-trained risk identification model;
[0059] Figure 8 is a schematic diagram of a network structure for the embedding layer;
[0060] Figure 9 is a schematic diagram of a network structure for the attention module;
[0061] Figure 10 is a schematic diagram of the connection of Q attention modules;
[0062] Figure 11 is a schematic diagram of an output layer;
[0063] Figure 12 is a schematic flowchart of a training method for a risk identification model provided in an embodiment of this application;
[0064] Figure 13 is a flowchart illustrating a risk identification method provided in an embodiment of this application;
[0065] Figure 14 is a schematic block diagram of a risk identification device provided in an embodiment of this application;
[0066] Figure 15 is a schematic block diagram of a model training device provided in an embodiment of this application;
[0067] Figure 16 is a schematic block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0068] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0069] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in sequences other than those illustrated or described herein. In embodiments of the invention, "B corresponding to A" means that B is associated with A. In one implementation, B can be determined based on A. However, it should also be understood that determining B based on A does not mean determining B solely based on A; B can also be determined based on A and / or other information. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or devices. In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0070] The technical solution proposed in this application can be applied to the fields of mobile payment, risk identification and other technologies to improve the accuracy of payment risk identification, thereby enabling timely interception of illegal payment activities and improving the security of mobile payment.
[0071] The relevant concepts involved in the embodiments of this application are introduced below.
[0072] Mobile payments: Allows users to make payments and transfers through applications (such as instant messaging applications).
[0073] Social payment scenarios refer to payment activities conducted on social media or communication applications, such as payments between friends or sending red envelopes.
[0074] Anti-fraud algorithm: A machine learning algorithm that identifies potential fraudulent activities by analyzing an object's payment transaction data.
[0075] Deep neural networks: a type of machine learning model used to handle complex nonlinear data modeling tasks.
[0076] LSTM: Long Short-Term Memory.
[0077] RNN: Recurrent Neural Network.
[0078] Transformer: A deep learning model based on self-attention mechanism.
[0079] In social payment scenarios, it's necessary to assess the risk of an entity's (e.g., a user's) payment activity. A typical strategy involves using a series of logical judgments to determine the entity's risk. For example, if an entity has a high risk payment score, it's considered too risky and its payment is blocked.
[0080] Current risk identification methods primarily rely on predefined rule sets, typically formulated by experts based on historical fraud cases and business logic, making them easily bypassed by malicious actors. In some embodiments, supervised machine learning algorithms (such as logistic regression, decision trees, and random forests) are used to learn fraud features from historical data to predict fraudulent behavior. However, these models usually require extensive feature engineering, including feature selection and transformation. Feature selection often relies on manual selection, easily overlooking potentially crucial features. Furthermore, the models only learn low-order features, limiting their expressive power. When dealing with fraud detection in social payment scenarios, they may fail to effectively distinguish between legitimate transactions and fraudulent activities, resulting in limited accuracy in payment risk identification.
[0081] To address this technical problem, this application proposes a novel risk identification method. First, M payment transaction data points of an object are acquired. Then, each of these M payment transaction data points is feature-encoded to obtain a first payment feature sequence of the object. Next, a sliding window is slid across the first payment feature sequence with a preset block length and a preset block step size, dividing the object's first payment feature sequence into K sequence blocks. Payment risk identification processing is then performed on these K sequence blocks to obtain the risk prediction result for each payment transaction data point among the object's M payment transaction data points. Therefore, in this application embodiment, by feature-encoding multiple payment transaction data points of an object, a first payment feature sequence of the object is obtained. This first payment feature sequence can reflect the object's payment behavior. Then, this first payment feature sequence is divided into multiple sequence blocks, and payment risk identification processing is performed on these multiple sequence blocks to capture the object's local and global payment features, thereby achieving accurate identification of payment transaction data risks.
[0082] The implementation environment of the risk identification method and the training method of the risk identification model provided in the embodiments of this application will be described below.
[0083] Figure 1 is a schematic diagram of an implementation environment for the risk identification method and risk identification model training method provided in this application, including a terminal device 101 and a server 102. The terminal device 101 and the server 102 can communicate with each other via wired or wireless means.
[0084] In this embodiment, an object (e.g., a user) can interact with the terminal device 101. For example, the object can load a risk identification model to be trained on the terminal device 101 or input payment transaction data. In some embodiments, the terminal device 101 can also present the risk identification results to the object. The server 102 has data processing capabilities.
[0085] In some embodiments, if the risk identification method of this application is completed by calling a risk identification model, then before performing risk identification, the risk identification model is first trained using the training method of the risk identification model of this application to obtain a trained risk identification model. In some embodiments, the initial model of the risk identification model is a pre-trained risk identification model, which is trained on large-scale data.
[0086] In this embodiment of the application, the training method of the risk identification model can be completed by the terminal device 101 or the server 102.
[0087] In some embodiments, if the training method of the risk identification model in this application is completed by the server 102, the server 102 calls the pre-trained risk identification model, for example, the server 102 locally stores the pre-trained risk identification model, or the server 102 loads the pre-trained risk identification model from the network. Next, server 102 acquires M payment transaction data for each of the N objects, where N and M are both positive integers. For the i-th object among the N objects, feature encoding is performed on each of the M payment transaction data for the i-th object to obtain the feature representation information of each payment transaction data. Based on the feature representation information of the M payment transaction data, the first payment feature sequence of the i-th object is determined, where i is a positive integer less than or equal to N. The first payment feature sequence of the i-th object is divided into K sequence blocks, where K is a positive integer greater than 1. Through a pre-trained risk identification model, payment risk identification processing is performed on the K sequence blocks of each of the N objects to obtain the risk prediction result for each payment transaction data of the N objects. Based on the risk prediction result for each payment transaction data of the N objects, the model loss of the risk identification model is determined, and based on the model loss, the parameters in the risk identification model are adjusted to obtain the trained risk identification model.
[0088] As described above, in this embodiment, during model training, server 102 performs feature encoding processing on multiple payment transaction data of each of the N objects to obtain a first payment feature sequence for each object. This first payment feature sequence can reflect the payment behavior of the object. Then, the first payment feature sequence of each object is divided into multiple sequence blocks. This allows the risk model to accurately capture the local and global payment features of each object when performing payment risk identification processing on multiple sequence blocks of each object, thereby improving the prediction accuracy of the model's risk identification combination. In some embodiments, if the initial model of the risk identification model in this embodiment is a pre-trained risk identification model, server 102 adjusts some parameters in the pre-trained risk identification model based on the model loss to obtain a trained risk prediction model. Since the pre-trained risk identification model is trained on large-scale data, it can transfer cross-domain knowledge to the risk identification task, reducing the computational burden during training and reducing dependence on specific domain data, avoiding model overfitting, and further improving the risk identification accuracy of the risk identification model.
[0089] In this embodiment of the application, the server 102 can save the trained risk identification model locally or send the trained risk identification model to the terminal device 101.
[0090] In this embodiment of the application, the risk identification method can be executed by server 102 or terminal device 101.
[0091] In some embodiments, when the risk identification method of this application is executed by terminal device 101, terminal device 101 acquires M payment transaction data of an object within a recent period. For example, in response to a payment transaction request from an object, terminal device 101 acquires M payment transaction data of the object. Next, terminal device 101 performs feature encoding on each of the M payment transaction data of the object to obtain feature representation information for each payment transaction data, and determines a first payment feature sequence of the object based on the feature representation information of the M payment transaction data. Then, terminal device 101 divides the first payment feature sequence into K sequence blocks, where K is a positive integer greater than 1. Finally, terminal device 101 performs payment risk identification processing on the K sequence blocks to obtain a risk prediction result for each of the M payment transaction data of the object, and then determines the risk prediction result of the object based on the risk prediction result of the object's M payment transaction data, for example, determining whether the object is a normal object or a high-risk object (e.g., a fraud object).
[0092] In some embodiments, when the risk identification method of this application is executed by server 102, server 102 obtains M payment transaction data of an object. For example, if the object initiates a transaction request on terminal device 101, terminal device 101 sends the object's transaction request to server 102, and the transaction request includes the object's identification information. Thus, server 102 can obtain the object's M payment transaction data based on the object's identification information. Next, server 102 performs feature encoding on each of the object's M payment transaction data to obtain the object's first payment feature sequence. Then, server 102 slides across the first payment feature sequence with a preset block length as the size of the sliding window and a preset block step size as the sliding step size, dividing the object's first payment feature sequence into K sequence blocks, where K is a positive integer greater than 1. Finally, server 102 performs payment risk identification processing on the object's K sequence blocks to obtain the risk prediction result for each of the object's M payment transaction data. For example, server 102 calls the trained risk identification model to perform payment risk identification processing on K sequence blocks of the object, obtaining the risk prediction result for each of the M payment transaction data of the object. Optionally, server 102 can display the risk prediction result to terminal device 101.
[0093] This application does not limit the specific type of the terminal device 101. In some embodiments, the terminal device 101 may include, but is not limited to: mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, wearable smart devices, medical devices, etc. The device is often equipped with a display device, which may also be a monitor, display screen, touch screen, etc., and the touch screen may also be a touch screen, touch panel, etc.
[0094] In some embodiments, server 102 can be one or more servers. When there are multiple servers, at least two servers are used to provide different services, and / or at least two servers are used to provide the same service, such as providing the same service in a load-balanced manner. This application embodiment does not limit this. The aforementioned servers can be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Servers can also become nodes in a blockchain.
[0095] In this embodiment, the terminal device 101 and the server 102 can be directly or indirectly connected through wired or wireless communication, and this application does not impose any restrictions.
[0096] It should be noted that the implementation environment of this application embodiment includes, but is not limited to, the one shown in FIG1.
[0097] The technical solutions of the embodiments of this application will be described in detail below through some examples. The following embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0098] First, the training process of the risk identification model will be introduced.
[0099] Figure 2 is a schematic flowchart of a risk identification method provided in an embodiment of this application. The executing entity in this embodiment is a device with risk identification function, such as a risk identification device. In some embodiments, the risk identification device in this embodiment can be the server in Figure 1, or the terminal device in Figure 1, or a system composed of the server and terminal device in Figure 1. For ease of description, this embodiment uses an electronic device as an example for illustration.
[0100] As shown in Figure 2, the risk identification method of this application embodiment includes the following steps:
[0101] S101. The electronic device obtains M payment transaction data of the object within a recent period.
[0102] It should be noted that the data obtained in the risk identification process of this application embodiment, as well as the process of obtaining this data, comply with relevant regulations.
[0103] The risk identification method of this application can be applied to anti-fraud scenarios or illegal transaction scenarios. By analyzing the payment transaction data of an object (e.g., a user), potential fraudulent activities can be identified. For example, if the risk identification result of an object is determined to be high-risk based on the object's payment transaction data, the object's relevant payment transaction behavior can be intercepted. Conversely, if the risk identification result of an object is determined to be low-risk based on the object's payment transaction data, the object's relevant payment transaction behavior can be processed normally. This can improve the security of mobile payments.
[0104] This application embodiment does not restrict the specific triggering conditions for the electronic device to acquire M payment transaction data of the object.
[0105] For example, an electronic device receives a payment transaction request from an object, and then, based on the object's payment transaction request, obtains M payment transaction data records of the object within a recent period.
[0106] For example, electronic devices periodically acquire M payment transaction data points of an object within a recent period to assess the object's risk.
[0107] In some embodiments, if the number of payment transaction data for the object in a recent period is less than M, for example, if the number of payment transaction data for the object in the recent period is B, which is less than M, then the B payment transaction data for the object are obtained, and the remaining M payment transaction data are filled with data. The data filling method includes at least mean filling, median filling, or k-nearest neighbor filling, etc.
[0108] In some embodiments, the M payment transaction data of the object are payment transaction data on a payment transaction platform, such as payment transaction data on an instant messaging application.
[0109] In some embodiments, the M payment transaction records of the object are payment transaction data from multiple payment transaction platforms, such as payment transaction data on instant messaging applications and payment transaction data on third-party payment platforms. For example, an electronic device can collect the object's payment transaction data from different mobile payment platforms within a recent period based on the object's identifier.
[0110] The payment transaction data in this application embodiment includes information such as transaction records, payment methods, and payment times.
[0111] In this embodiment of the application, after the electronic device obtains M payment transaction data of the object based on the above steps, it executes the following step S102.
[0112] S102. The electronic device encodes each payment transaction data to obtain the feature representation information of each payment transaction data, and determines the first payment feature sequence based on the feature representation information of M payment transaction data.
[0113] In this embodiment, after acquiring M payment transaction data points of an object, the electronic device uses these M payment transaction data points for risk identification. That is, it determines whether these M payment transaction data points are normal or abnormal transaction data, thereby assessing the risk status of the object. In this embodiment, these payment transaction data points are first encoded to obtain a payment feature sequence of the object, denoted as the first payment feature sequence. This first payment feature sequence includes the payment-related features of the object.
[0114] This application embodiment does not limit the specific method for determining the first payment feature sequence of an object based on M payment transaction data.
[0115] In some embodiments, the electronic device uses a trained feature extraction module to encode the features of each of the M payment transaction data points for the object, thereby obtaining the feature information of each payment transaction data point. Then, the feature information of these M payment transaction data points is fused to obtain the first payment feature sequence of the object. For example, the feature information of the M payment transaction data points of the object is added together to obtain the first payment feature sequence of the object. Another example is that the feature information of the M payment transaction data points of the object is concatenated to obtain the first payment feature sequence of the object.
[0116] In some embodiments, the electronic device may obtain the first payment feature sequence of the object through the following steps S102-A to S102-D:
[0117] S102-A. For the j-th payment transaction data in M payment transaction data, the electronic device selects P payment information belonging to the payment information type from the j-th payment transaction data based on the preset payment information type, where P is a positive integer and j is a positive integer less than or equal to M.
[0118] S102-B, The electronic device performs feature encoding on P payment information pieces respectively, and obtains the encoding information of each feature in the P payment information pieces;
[0119] S102-C: The electronic device performs feature fusion on the encoded information of P payment information to obtain the feature representation information of the j-th payment transaction data;
[0120] S102-D: The electronic device performs data conversion processing based on the feature representation information of each payment data in the M payment transaction data to determine the first payment feature sequence.
[0121] In this implementation, for each of the M payment transaction data of the object, for example, the j-th payment transaction data, data cleaning is performed on the j-th payment transaction data to extract P payment information related to the payment.
[0122] In this embodiment, a preset payment feature type is defined. For example, the preset payment information type includes at least one of the following: payment method, payment amount, geographical location, time interval since the last transaction, payment time, and counterparty account information. Thus, the electronic device can select P payment information items belonging to the preset payment feature type from the features included in the j-th payment transaction data. For example, assuming the preset payment information type includes: payment method, payment amount, geographical location, and time interval since the last transaction, the electronic device can extract the payment method, payment amount, geographical location, and time interval since the last transaction features from the j-th payment transaction data. For instance, the j-th payment transaction data after data cleaning can be represented as {payment method, payment amount, geographical location, time interval since the last transaction}.
[0123] According to the embodiments of this application, P payment information belonging to the preset payment information type are selected from the j-th payment transaction data, so that these P payment information conform to the payment business logic, and invalid data unrelated to payment are eliminated, thereby ensuring data quality.
[0124] Next, the electronic device performs feature encoding on the aforementioned P payment information pieces, obtaining the encoded information of each of these P payment information pieces. For example, the electronic device uses binning encoding to encode the P payment information pieces of the j-th payment transaction data of the object separately, obtaining the encoded information of each of the P payment information pieces of the j-th payment transaction data. For example, the j-th payment transaction data of the object includes 5 payment information pieces. These 5 payment information pieces are feature encoded separately, for example, each payment information piece is encoded as a 4-dimensional vector, and this 4-dimensional vector is recorded as the encoded information of that payment information piece. That is, in this embodiment of the application, the encoded information of each of the 5 payment information pieces is a 4-dimensional vector.
[0125] Based on the above steps, after determining the encoding information of each of the P payment information in the j-th payment transaction data of the object, the electronic device executes the above steps S102-C to perform feature fusion on the encoding information of the P payment information to obtain the feature representation information of the j-th payment transaction data.
[0126] This application embodiment does not limit the specific method by which the electronic device performs feature fusion on the encoded information of P payment information of the i-th payment transaction data to obtain the feature representation information of the j-th payment transaction data.
[0127] In one possible implementation, the electronic device sums the features of the P payment information segments of the j-th payment transaction to obtain the feature representation information of the j-th payment transaction. For example, if the j-th payment transaction includes 5 payment information segments, and the encoding information of these 5 payment information segments is a 4-dimensional vector, then the corresponding elements in the encoding information of these 5 payment information segments can be summed to obtain a 5-dimensional vector. That is, the feature representation information of the j-th payment transaction is a 5-dimensional vector.
[0128] In one possible implementation, the electronic device concatenates the encoded information of the P payment information in the j-th payment transaction to obtain the feature representation information of the j-th payment transaction. For example, if the j-th payment transaction includes 5 payment information items, and the encoded information of these 5 payment information items is a 4-dimensional vector, then the encoded information of these 5 payment information items can be concatenated to obtain a 20-dimensional vector, that is, the feature representation information of the j-th payment transaction is a 20-dimensional vector.
[0129] For example, as shown in Figure 3, the electronic device selects P payment information related to the payment from the j-th payment transaction data. For instance, it selects five payment information items, denoted as payment information A1, A2, A3, A4, and A5. Next, it encodes the features of each of these five payment information items, for example, encoding each feature into a 4-dimensional vector, resulting in the encoded representation of the five payment information items. Then, the electronic device concatenates the encoded information of these five payment information items to obtain a 20-dimensional vector, denoted as the feature representation information of the j-th payment transaction data.
[0130] The above describes the specific process by which an electronic device determines the feature representation information of the j-th payment transaction data of an object. Referring to the above method, the electronic device can determine the feature representation information of each of the M payment transaction data of an object.
[0131] In this way, the electronic device can perform the steps of S102-D above, that is, determine the first payment feature sequence of the object based on the feature representation information of each payment data in the M payment transaction data of the object.
[0132] This application embodiment does not limit the specific method by which the electronic device determines the first payment feature sequence of the object based on the feature representation information of each payment data in the M payment transaction data of the object.
[0133] In some embodiments, the electronic device can perform feature fusion on the feature representation information of each payment data in M payment transaction data of an object. In one example, the encoded information of the same payment information in P payment information of M payment transaction data is added together to obtain the first payment feature sequence of the object. For example, referring to FIG5, the encoded information of payment information A1 (which is a 4-dimensional vector) of each payment transaction data in 5 payment transaction data is added element-wise to obtain a new encoded information of payment information A1 (which is also a 4-dimensional vector). The encoded information of payment information A2 (which is a 4-dimensional vector) of 5 payment transaction data is added element-wise to obtain a new encoded information of payment information A2 (which is also a 4-dimensional vector), and so on, finally obtaining a 20-dimensional first payment feature sequence. In another example, the feature representation information of M payment transaction data is concatenated to obtain the first payment feature sequence of the object. For example, referring to Figure 5, the feature representation information of each of the five payment transaction data is a 20-dimensional vector. These five 20-dimensional vectors are concatenated to obtain a 5*20-dimensional matrix, which is denoted as the first payment feature sequence of the object.
[0134] In some embodiments, the electronic device may determine the first payment feature sequence of the object through the following steps S102-D1 and S102-D2:
[0135] S102-D1. The electronic device performs embedding processing on the feature representation information of the M payment transaction data of the object, respectively, to obtain the embedded representation of the feature representation information of each payment data in the M payment transaction data.
[0136] In this implementation, the electronic device obtains the feature representation information of each of the M payment transaction data of the object based on the above steps. Then, the electronic device performs an embedding representation on the feature representation information of each of the M payment transaction data to map the feature information representation of the payment transaction data into a low-dimensional feature space, thereby obtaining the embedded representation of the feature representation information of each payment transaction data.
[0137] In one example, if the j-th payment transaction data of an object includes 5 payment information pieces, and the encoded information of each of these 5 payment information pieces is a 4-dimensional vector, the feature representation information of the j-th payment transaction data formed by concatenating the encoded information of these 5 payment information pieces is a 20-dimensional vector. During embedding processing, this 20-dimensional vector can be embedded, for example, transformed into a lower-dimensional space to obtain a 10-dimensional embedding representation. Optionally, during embedding processing, the electronic device can perform embedding processing on the encoded information of these 5 payment information pieces separately, for example, transforming the 4-dimensional encoded information of each payment information piece into 2-dimensional information, so that the 5 payment information pieces finally obtain a 10-dimensional embedding representation after embedding processing.
[0138] In this embodiment of the application, the embedding process of feature representation information of payment transaction data includes feature embedding process, or includes feature embedding process and location embedding process.
[0139] In one possible implementation, for each of the M payment transaction data of the object, such as the j-th payment transaction data, the electronic device performs feature embedding processing on the feature representation information of the j-th payment transaction data to obtain the embedded representation of the feature representation information of the j-th payment transaction data.
[0140] In one possible implementation, for each of the M payment transaction data of an object, such as the j-th payment transaction data, the electronic device performs feature embedding processing on the feature representation information of the j-th payment transaction data to obtain a feature embedding representation of the feature representation information of the j-th payment transaction data. Simultaneously, it performs position embedding processing on the feature representation information of the j-th payment transaction data to obtain a position embedding representation of the feature representation information of the j-th payment transaction data. Then, the feature embedding representation and the position embedding representation of the feature representation information of the j-th payment transaction data are added together to obtain the embedded representation of the feature representation information of the j-th payment transaction data.
[0141] The electronic device can use the above method to determine the embedded representation of the feature representation information of each of the M payment transaction data of the object. Then, it executes the steps S102-D2 above.
[0142] S102-D2, The electronic device performs data format conversion processing on the embedded representation of the feature representation information of the M payment transaction data of the object to obtain the first payment feature sequence of the object.
[0143] The embodiments of this application perform data format conversion processing on the embedded representation of the feature representation information of M payment transaction data of an object by an electronic device to obtain the first payment feature sequence of the object. The specific method is not limited.
[0144] In one possible implementation, the electronic device combines the embedded representations of the feature representations of M payment transaction data of an object to obtain a second payment feature sequence of the object. For example, the electronic device can arrange the embedded representations of the feature representations of the M payment transaction data of the object according to the time order, either from oldest to newest or from newest to oldest, to obtain the second payment feature sequence of the object. Then, the feature dimension F and the payment transaction data entry dimension M in the second payment feature sequence of the object are interchanged to obtain the first payment feature sequence of the object.
[0145] For example, suppose an electronic device combines the embedded representations of the feature representations of M payment transaction data points of an object to obtain the second payment feature sequence of the object in the format [batch, length, features]. Here, `batch` represents the number of objects (in this case, Batch = 1), `length` represents the number of payment transaction data points (which can be understood as the dimension of the payment transaction data entries), and `features` represents the number of features (which can be understood as the dimension of the embedded representation of the feature representation information of each payment transaction data point). For example, if M equals 8, after the above steps, the embedded representation of the feature representation of each of the 8 payment transaction data points of the object can be obtained. Assuming that the embedded representation of the feature representation of each payment transaction data point is a 10-dimensional vector, the embedded representations of the feature representations of the 8 payment transaction data points of the object form a 1×8×10 matrix. That is, the data dimension of the second payment feature sequence of the object is 1×8×10, where `length = M = 8` and `features = 10`.
[0146] Next, the electronic device converts the data format of the object's second payment feature sequence into a format suitable for subsequent processing. This is typically to separate the feature dimensions and time steps for separate processing. For example, the electronic device swaps the feature dimensions and payment transaction data entry dimensions in the object's second payment feature sequence to obtain the object's first payment feature sequence. For instance, swapping the length and features converts the 1×8×10 data format of the second payment feature sequence to 1×10×8, resulting in the object's first payment feature sequence.
[0147] Based on the above steps, the electronic device can determine the first payment feature sequence of the object and then execute the following step S103.
[0148] S103, The electronic device divides the first payment feature sequence into K sequence blocks.
[0149] Where K is a positive integer greater than 1.
[0150] In some embodiments, the electronic device obtains a pre-set block length and block stride; uses the block length as the size of a sliding window, and uses the block stride as the sliding step of the sliding window to slide on the first payment feature sequence of the object, and divides the first payment feature sequence of the object into K sequence blocks. As described above, the first payment feature sequence is obtained based on M payment transaction data of the object in a recent period of time, and its sequence length is M. In this way, the first payment feature sequence of the object is divided into multiple small blocks of a fixed size, so that the time between different sequence blocks is continuous, and the relevant feature information of several payment transaction data with continuous transaction time in the same sequence block. By performing recognition processing on the K sequence blocks, local time dependence can be captured while maintaining time continuity, so as to better understand the information in the first payment feature sequence, and then improve the accuracy of risk recognition of the object.
[0151] Specifically, the electronic device obtains a pre-set block length patch_size and block stride stride. Among them, the block length patch_size can be understood as the time step of each block. For example, if patch_size = 16, it means that each block contains data of 16 consecutive time points. The block stride stride determines the degree of overlap between small blocks. If stride = patch_size, there is no overlap between blocks, and it is continuously segmented. If stride < patch_size, there is overlap between blocks. Then, the electronic device uses the block length patch_size as the size of the sliding window and the block stride stride as the sliding step of the sliding window to slide on the first payment feature sequence of the object, and divides the payment feature sequence of the object into K sequence blocks. At this time, the data format becomes [batch, newlength, newfeatures], where new_length is the number of blocks included in the sequence after segmentation, which is the new "sequence length". new_features is the total feature dimension included in each block. Because each block consists of patch_size original time points, and each time point has features features, these features are concatenated into a huge feature vector. Exemplarily, when stride = patch_size, the electronic device can calculate the new feature dimension newfeatures and the sequence length dimension newlength based on this formula, where newfeatures = features * patch_size, where features is the feature dimension corresponding to a payment transaction data (or a time point).
[0152] For example, assuming M equals 120, these 120 payment transaction data entries are arranged by transaction time with time indices from 1 to 120, meaning there are 120 original time points. Assume both patch_size and stride are 20. The electronic device will then divide the feature data corresponding to payment transaction data with time indices 1-20 in the first payment feature sequence into the first block, the feature data corresponding to payment transaction data with time indices 21-40 into the second block, and so on, dividing the feature data corresponding to payment transaction data with time indices 101-120 into the sixth block.
[0153] For example, as shown in Figure 5, the electronic device divides the first payment feature sequence of the object into 6 sequence blocks according to the preset block length and block step size.
[0154] The above describes the specific process of dividing the first payment feature sequence of an object into K sequence blocks, using an object as an example. Next, the electronic device executes the following step S104.
[0155] S104. The electronic device performs payment risk identification processing on K sequence blocks to obtain the risk prediction result of each payment transaction data in M payment transaction data.
[0156] The specific method by which the electronic device performs payment risk identification processing on K sequence blocks of an object to obtain the risk prediction result of each payment transaction data in M payment transaction data of the object is not limited.
[0157] In some embodiments, the electronic device uses a risk identification model to perform payment risk identification processing on K sequence blocks of an object, and obtains the risk prediction result for each of the M payment transaction data of the object.
[0158] The embodiments of this application do not limit the specific network structure of the risk identification model.
[0159] In some embodiments, the initial model of the risk identification model is a pre-trained risk identification model. For example, it can be any large model trained on large-scale data. For instance, the pre-trained risk identification model could be GPT-2 (Generative Pre-trained Transformer 2). GPT-2 is a pre-trained Transformer model commonly used for natural language processing tasks. The GPT-2 model is renowned for its powerful language understanding and generation capabilities.
[0160] In some embodiments, the risk identification model used in this application can be a risk identification model trained by the model training method described below. The specific model training process is described in the following embodiments.
[0161] In this embodiment of the application, as shown in FIG6, the electronic device inputs the K sequence blocks of the determined object into the risk identification model to perform payment risk identification processing and obtain the risk prediction result of each payment transaction data in the M payment transaction data of the object.
[0162] In some embodiments, as shown in FIG7, the risk identification model of this application embodiment includes an embedding layer, Q attention modules, and an output layer. In this case, S104 may include the following steps S104-A to S104-C:
[0163] S104-A: The electronic device performs embedding processing on each of the K sequence blocks through the embedding layer to obtain the input embedding representation;
[0164] S104-B: The electronic device performs attention analysis on the input embedded representation through Q attention modules to obtain attention feature information;
[0165] S104-C: The electronic device performs risk calculations on the attention feature information through the output layer to obtain the risk prediction results for each of the M payment transaction data.
[0166] In this embodiment, the electronic device converts the numerical data of the object's first payment feature sequence into a high-dimensional feature vector that the model can understand through an embedding layer. Specifically, each of the object's K sequence blocks is mapped to a continuous high-dimensional vector space. These vectors can capture the local features and contextual information of the object's payment transaction data. These vectors constitute the object's input embedding representation.
[0167] This application does not limit the specific network structure of the embedding layer. For example, the embedding layer may only include a feature embedding layer. In this way, the electronic device can input K sequence blocks of an object into the feature embedding layer for feature embedding processing to obtain the input embedding representation of the object.
[0168] In some embodiments, as shown in FIG8, the embedding layer of this application embodiment includes a feature embedding layer and a position embedding layer. In this case, the electronic device can perform feature embedding processing on each of the K sequence blocks of the object through the feature embedding layer to obtain the feature embedding representation of the K sequence blocks. Next, the position embedding layer performs position embedding processing on each of the K sequence blocks of the object to obtain the position embedding representation of the K sequence blocks. For example, the position embedding representation of the K sequence blocks is determined based on the position information of these K sequence blocks in the first payment feature sequence. Finally, the feature embedding representation and the position embedding representation of the K sequence blocks are fused to obtain the input embedding representation of the object. For example, the feature embedding representation and the position embedding representation of the K sequence blocks are element-wise added to obtain the input embedding representation of the object. In this embodiment, each of the K sequence blocks can be treated as a processing unit to determine the feature embedding representation of each sequence block, that is, each sequence block is mapped to a continuous vector space, which facilitates the capture of local features and contextual information of the object's payment transaction data. This improves the accuracy of subsequent analysis and prediction based on the embedding representation information of the object's K sequence blocks.
[0169] Based on the above steps, after determining the input embedding representation of the object, the electronic device performs attention analysis processing on the input embedding representation of the object through Q attention modules to obtain the attention feature information of the object.
[0170] The risk identification model in this application includes Q attention modules. The network structures of these Q attention modules can be completely identical, completely different, partially identical, or partially different. This application does not limit the specific network structure of these Q attention modules.
[0171] This application does not limit the network connection relationship of the Q attention modules. For example, the Q attention modules can be connected in series, or the Q attention modules can be arranged in parallel, or some of the Q attention modules can be connected in series and some can be arranged in parallel.
[0172] In some embodiments, the network structures of the Q attention modules included in the risk identification model of this application are consistent. As shown in FIG9, each of these Q attention modules includes a multi-head attention layer, a first residual connection and normalization layer, a feedforward network layer, and a second residual connection and normalization layer. In this case, S104-B may include the following steps S104-B1 to S104-B3:
[0173] S104-B1, the electronic device performs attention analysis processing on the input embedded representation through the multi-head attention layer, the first residual connection and normalization layer, the feedforward network layer and the second residual connection and normalization layer included in the first attention module of Q attention modules, and obtains the first attention feature information;
[0174] S104-B2. The electronic device performs attention analysis processing on the first attention feature information through the multi-head attention layer, the first residual connection and normalization layer, the feedforward network layer and the second residual connection and normalization layer included in the second attention module of Q attention modules, to obtain the second attention feature information. The processes are executed sequentially to obtain the Qth attention feature information.
[0175] S104-B3: The electronic device obtains attention feature information based on the Qth attention feature information.
[0176] In this implementation, as shown in Figure 10, the Q attention modules are connected in series. The input of the first attention module is connected to the output of the model's embedding layer, and the output of the Qth attention module is connected to the input of the model's output layer. Each attention module includes a multi-head self-attention layer, a first residual connection and normalization layer (ADD & Layer Normalization), a feedforward layer, and a second residual connection and normalization layer.
[0177] In this way, the electronic device can perform attention analysis processing on the input embedding representation corresponding to the object through the multi-head attention layer, the first residual connection and normalization layer, the feedforward network layer, and the second residual connection and normalization layer included in the first attention module of Q attention modules, to obtain the first attention feature information of the object. Specifically, the electronic device inputs the input embedding representation B corresponding to the object into the multi-head attention layer included in the first attention module for multi-head attention processing to obtain an attention feature information C. Then, the input embedding representation B is added to the attention feature information C and normalized to obtain normalized feature information D. Next, the electronic device inputs the feature information D into the feedforward network layer included in the first attention module for processing to obtain a feature information E. At the same time, the electronic device adds the feature information E to the feature information D element by element and then normalizes it to obtain normalized feature information G. The normalized feature information G is recorded as the first attention feature information of the object. Next, the electronic device inputs the feature information G into the multi-head attention layer of the second attention module for processing, obtaining attention feature information H. Then, feature information G and attention feature information H are added element-wise and then normalized to obtain normalized feature information I. Feature information I is input into the feedforward network layer of the second attention module for processing, obtaining feature information K. Feature information K is added element-wise to feature information I and then normalized to obtain feature information L, which is denoted as the second attention feature information of the object. Feature information L is input into the third attention module, and so on, until the Qth attention feature information of the object is obtained from the output of the Qth attention module.
[0178] Next, the electronic device obtains the object's attention feature information based on the object's Qth attention feature information. For example, the object's Qth attention feature information is determined as the object's attention feature information. Another example is to perform feature re-extraction or other processing on the object's Qth attention feature information to obtain the object's attention feature information.
[0179] In some embodiments, the feature dimension of the output of the last attention module among the Q attention modules is set to be consistent with the dimension of the input information of the embedding layer.
[0180] After the electronic device performs attention analysis on the input embedded representation of the object through the above Q attention modules to obtain the attention feature information of the object, it executes the above S104-C steps. As shown in Figure 11, the output layer performs risk calculation on the attention feature information of the object to obtain the risk prediction result of each payment transaction data in the object's M payment transaction data.
[0181] The embodiments of this application do not impose restrictions on the specific network structure of the output layer.
[0182] In some embodiments, a DNN is used as the output layer of the model to learn the mapping from features extracted from the attention mechanism to binary classification results, thereby completing the time series data classification task and realizing object fraud behavior identification.
[0183] In some embodiments, the output layer of this application includes an activation function, which allows the electronic device to perform a non-linear mapping of attention feature information to obtain first feature information. This application does not limit the type of activation function; optionally, the activation function is a GELU activation function. In one example, the electronic device can use this formula. Obtain the object's first feature information B. Here, A represents the object's attention feature information, and B represents the object's first feature information. The cumulative distribution function is the standard normal distribution, which is a normal distribution with a mean of 0 and a standard deviation of 1. GELU's characteristic is that it smoothly multiplies the cumulative distribution function of the standard normal distribution with the object's attention feature information A, thus producing a non-monotonic feature information, denoted as the object's first feature information. Next, the object's first feature information is normalized to obtain the object's second feature information C. Finally, the object's second feature information C is subjected to risk classification processing to obtain the risk prediction result for each of the object's M payment transaction data. For example, the object's second feature information can be input into the Sigmoid function to perform a binary classification task, outputting the classification result for each of the object's M payment transaction data, thereby obtaining the risk prediction result for each of the object's M payment transaction data, such as obtaining the fraud risk probability for each of the object's M payment transaction data. For example, the object's second feature information can be input into this formula. We can obtain the risk prediction result for each of the M payment transaction data of the object. Here, C represents the object's second characteristic information.
[0184] Through the above steps, electronic devices can determine the risk prediction result for each of the M payment transaction data of an object.
[0185] In some embodiments, the electronic device can also determine the risk prediction result of an object based on the risk prediction result of each of the M payment transaction data. For example, if the risk prediction result of the M payment transaction data indicates that the number of illegal payments is greater than or equal to a preset value, then the object is determined to be a high-risk object, i.e., a fraud object. As another example, if the risk prediction result of the M payment transaction data indicates that the number of illegal payments is less than the preset value, then the object is determined to be a normal object, i.e., a non-fraud object.
[0186] In some embodiments, if an object is determined to be a high-risk object, its related payment activities can be intercepted in a timely manner to improve the security of mobile payments.
[0187] The risk identification method provided in this application embodiment encodes the features of each of the M payment transaction data of an object within a recent period to obtain the feature representation information of each payment transaction data. Based on the feature representation information of the M payment transaction data, a first payment feature sequence is determined. Then, the first payment feature sequence of the object is divided into K sequence blocks, and payment risk identification processing is performed on the K sequence blocks to obtain the risk prediction result for each of the M payment transaction data of the object. Therefore, in this application embodiment, by encoding the features of multiple payment transaction data of an object, a first payment feature sequence of the object is obtained. This first payment feature sequence can reflect the payment behavior of the object. Then, dividing the first payment feature sequence into multiple sequence blocks allows for the capture of both local and global payment features of the object, thereby achieving accurate identification of payment transaction data risks.
[0188] The risk identification method provided in the embodiments of this application has been described above. The training process of the risk identification model will be described below.
[0189] Figure 12 is a schematic flowchart of a risk identification model training method provided in an embodiment of this application. The execution subject of this embodiment is a device with model training functionality, such as a model training apparatus. In some embodiments, the model training apparatus of this embodiment can be the server in Figure 1, the terminal device in Figure 1, or a system composed of the server and terminal device in Figure 1. For ease of description, this embodiment uses an electronic device as an example for illustration.
[0190] As shown in Figure 12, the training process of the risk identification model in this embodiment includes:
[0191] S201. The electronic device acquires M payment transaction data for each of N objects.
[0192] It should be noted that the data obtained during the model training process in this application embodiment, as well as the process of obtaining this data, comply with relevant regulations.
[0193] In this embodiment, the electronic device first acquires training data before model training. In this embodiment, the risk identification model is trained by acquiring multiple payment transaction data from different objects.
[0194] In this embodiment of the application, to facilitate subsequent data processing, M payment transaction data entries are obtained for each of the N objects. That is, for each of the N objects, the number of payment transaction data entries obtained is the same, M. For example, M payment transaction data entries for each of the N objects within a recent period are obtained.
[0195] In some embodiments, for each of the N objects, if the number of payment transaction data for that object in a recent period is less than M, for example, if the number of payment transaction data for an object in the recent period is B, which is less than M, then the B payment transaction data for that object are obtained, and the remaining M payment transaction data are filled with data. The data filling method includes at least mean filling, median filling, or k-nearest neighbor filling, etc.
[0196] In some embodiments, for each of the above N objects, the M payment transaction data of that object are payment transaction data on a payment transaction platform, such as payment transaction data on an instant messaging application.
[0197] In some embodiments, for each of the N objects described above, the M payment transaction data for that object are payment transaction data from multiple payment transaction platforms, such as payment transaction data from instant messaging applications and payment transaction data from third-party payment platforms. For example, an electronic device can collect payment transaction data for that object from different mobile payment platforms within a recent period based on the object's identifier.
[0198] The payment transaction data in this application embodiment includes information such as transaction records, payment methods, and payment times.
[0199] In this embodiment, the electronic device also labels each payment transaction data in M payment transaction data for each of the N objects to distinguish between normal transactions and fraudulent transactions, providing labels for model training.
[0200] In this embodiment of the application, after the electronic device obtains M payment transaction data for each of the N objects based on the above steps, it executes the following step S202.
[0201] S202. For the i-th object among N objects, the electronic device performs feature encoding on each of the M payment transaction data of the i-th object to obtain the feature representation information of each payment transaction data, and determines the first payment feature sequence of the i-th object based on the feature representation information of the M payment transaction data.
[0202] Where i is a positive integer less than or equal to N.
[0203] In this embodiment, the electronic device acquires M payment transaction data points for each of N objects and then uses these payment transaction data points for model training. To improve the training effect of the model, before training the model using these payment transaction data points, the data is first processed to obtain a payment feature sequence for each object, denoted as the first payment feature sequence. This first payment feature sequence includes the payment-related features of the object.
[0204] The following describes the specific process of determining the first payment feature sequence for each of the N objects.
[0205] In this embodiment of the application, for each of the N objects, the method of determining the first payment feature sequence of each object based on the M payment transaction data of each object is basically the same. For ease of description, the i-th object among the N objects is used as an example for illustration.
[0206] This application embodiment does not limit the specific method for determining the first payment feature sequence of the i-th object based on M payment transaction data of the i-th object.
[0207] In some embodiments, the electronic device uses a trained feature extraction module to encode the features of each of the M payment transaction data for the i-th object, thereby obtaining the feature information of each payment transaction data. Then, the feature information of these M payment transaction data is fused to obtain the first payment feature sequence for the i-th object. For example, the feature information of the M payment transaction data for the i-th object is added together to obtain the first payment feature sequence for the i-th object. Another example is that the feature information of the M payment transaction data for the i-th object is concatenated to obtain the first payment feature sequence for the i-th object.
[0208] In some embodiments, the electronic device may obtain the first payment feature sequence of the i-th object through the following steps S202-A to S202-D:
[0209] S202-A. For the j-th payment transaction data in the M payment transaction data of the i-th object, the electronic device selects P payment information belonging to the payment information type from the j-th payment transaction data based on the preset payment information type, where P is a positive integer and j is a positive integer less than or equal to M.
[0210] S202-B, The electronic device performs feature encoding on P payment information pieces respectively to obtain the encoding information of each feature in the P payment information pieces;
[0211] S202-C: Electronic devices perform feature fusion on the encoded information of P payment information to obtain the feature representation information of the j-th payment transaction data;
[0212] S202-D: The electronic device performs data transformation processing based on the feature representation information of each payment data in the M payment transaction data of the i-th object to determine the first payment feature sequence of the i-th object.
[0213] In this implementation, for each of the M payment transaction data of the i-th object, for example, the j-th payment transaction data, the electronic device performs data cleaning on the j-th payment transaction data and extracts P payment information related to the payment.
[0214] Next, the electronic device encodes each of the P payment information pieces to obtain the encoded information for each of the P payment information pieces. For example, the electronic device uses binning encoding to encode each of the P payment information pieces of the j-th payment transaction data for the i-th object, thus obtaining the encoded information for each of the P payment information pieces of the j-th payment transaction data.
[0215] Based on the above steps, after determining the encoding information of each of the P payment information in the j-th payment transaction data of the i-th object, the electronic device executes the above steps S202-C to fuse the encoding information of the P payment information to obtain the feature representation information of the j-th payment transaction data.
[0216] This application embodiment does not limit the specific method by which the electronic device fuses the encoded information of P payment information of the i-th payment transaction data to obtain the feature representation information of the j-th payment transaction data.
[0217] In one possible implementation, the electronic device concatenates the encoded information of the P payment information segments of the j-th payment transaction to obtain the feature representation information of the j-th payment transaction. For example, the j-th payment transaction includes 5 payment information segments, each encoded as a 4-dimensional vector. These 5 encoded information segments can be concatenated to obtain a 20-dimensional vector; that is, the feature representation information of the j-th payment transaction is a 20-dimensional vector.
[0218] In this way, the electronic device can perform the steps of S202-D above, that is, determine the first payment feature sequence of the i-th object based on the feature representation information of each payment data in the M payment transaction data of the i-th object.
[0219] This application embodiment does not limit the specific method by which the electronic device determines the first payment feature sequence of the i-th object based on the feature representation information of each payment data in the M payment transaction data of the i-th object.
[0220] In some embodiments, the electronic device may determine the first payment feature sequence of the i-th object through the following steps S202-D1 and S202-D2:
[0221] S202-D1. The electronic device performs embedding processing on the feature representation information of the M payment transaction data of the i-th object to obtain the embedded representation of the feature representation information of each payment data in the M payment transaction data;
[0222] S202-D2, The electronic device performs data format conversion processing on the embedded representation of the feature representation information of the M payment transaction data of the i-th object to obtain the first payment feature sequence of the i-th object.
[0223] In one example, if the j-th payment transaction data of the i-th object includes 5 payment information pieces, and the encoded information of each of these 5 payment information pieces is a 4-dimensional vector, the feature representation information of the j-th payment transaction data formed by concatenating the encoded information of these 5 payment information pieces is a 20-dimensional vector. During embedding processing, this 20-dimensional vector can be embedded, for example, transformed into a lower-dimensional space, to obtain a 10-dimensional embedding representation. Optionally, during embedding processing, the electronic device can perform embedding processing on the encoded information of these 5 payment information pieces separately, for example, transforming the 4-dimensional encoded information of each payment information piece into 2-dimensional information, so that the 5 payment information pieces finally obtain a 10-dimensional embedding representation after embedding processing.
[0224] In this embodiment of the application, the embedding process of feature representation information of payment transaction data includes feature embedding process, or includes feature embedding process and location embedding process.
[0225] The electronic device can use the above method to determine the embedded representation of the feature representation information of each of the M payment transaction data of the i-th object. Then, it performs the above steps S202-D2 to perform data format conversion processing on the embedded representation of the feature representation information of the M payment transaction data of the i-th object to obtain the first payment feature sequence of the i-th object.
[0226] The embodiments of this application perform data format conversion processing on the embedded representation of the feature representation information of M payment transaction data of the i-th object by the electronic device to obtain the first payment feature sequence of the i-th object. The specific method is not limited.
[0227] In one possible implementation, the electronic device combines the embedded representations of the feature representation information of the M payment transaction data of the i-th object to obtain a second payment feature sequence for the i-th object. For example, the electronic device can arrange the embedded representations of the feature representation information of the M payment transaction data of the i-th object according to the time order, either from far to near or from near to far, to obtain a second payment feature sequence for the i-th object. Then, the feature dimension F and the payment transaction data entry dimension M in the second payment feature sequence of the i-th object are interchanged to obtain a first payment feature sequence for the i-th object.
[0228] In one example, the electronic device can arrange the embedded representations of the feature representation information of the M payment transaction data of the i-th object according to the time order of the M payment transaction data of the i-th object, either from the original to the recent or from the recent to the distant, to obtain the second payment feature sequence of the i-th object.
[0229] The specific implementation process of S202 can be referred to the relevant description of S102 above, and will not be repeated here.
[0230] Based on the above steps, the electronic device can determine each of the N objects, such as the first payment feature sequence of the i-th object, and then execute the following step S203.
[0231] S203. The electronic device divides the first payment feature sequence of the i-th object into K sequence blocks.
[0232] In some embodiments, the sliding window is sized with a preset block length and the sliding window is sized with a preset block step size. The sliding window slides on the first payment feature sequence to divide the first payment feature sequence of the i-th object into K sequence blocks.
[0233] The specific implementation process of S203 can be referred to the relevant description of S103 above, and will not be repeated here.
[0234] The electronic device can refer to the above embodiments to determine K sequence blocks for each of the N objects.
[0235] S204. Electronic devices use a risk identification model to perform payment risk identification processing on K sequence blocks of each of N objects, and obtain the risk prediction result for each payment transaction data of N objects.
[0236] This application does not limit the specific type and network structure of the initial model of the risk identification model.
[0237] In some embodiments, the initial model of the risk identification model described above is a pre-trained risk identification model. The pre-trained risk identification model can be any pre-trained large model. Since the large model has already been trained on large-scale data, it can be fine-tuned using a small amount of payment transaction data to enable the large model to have risk identification capabilities. This can greatly reduce the training workload of the model, reduce the computational burden during the training process, maintain model performance, avoid model overfitting, and thus improve the risk identification accuracy of the trained risk identification model.
[0238] In some embodiments, the aforementioned risk identification model can be GPT-2 (Generative Pre-trained Transformer 2). GPT-2 is a pre-trained Transformer model commonly used for natural language processing tasks. The GPT-2 model is renowned for its powerful language understanding and generation capabilities. In this embodiment, after the electronic device loads the pre-trained risk identification model (e.g., GPT-2), it applies layer limits and freezes the model.
[0239] In this embodiment of the application, as shown in Figure 6, the electronic device inputs K sequence blocks of each of the N objects determined above into the risk identification model to perform payment risk identification processing, and obtains the risk prediction result of each payment transaction data in M payment transaction data of each of the N objects.
[0240] In some embodiments, as shown in FIG7, the risk identification model of this application embodiment includes an embedding layer, Q attention modules, and an output layer. In this case, S204 may include the following steps S204-A to S204-C:
[0241] S204-A: The electronic device performs embedding processing on each of the K sequence blocks of the i-th object through the embedding layer to obtain the input embedding representation of the i-th object;
[0242] S204-B: The electronic device performs attention analysis on the input embedding representation of the i-th object through Q attention modules to obtain the attention feature information of the i-th object;
[0243] S204-C: The electronic device performs risk calculation on the attention feature information of the i-th object through the output layer, and obtains the risk prediction result of each payment transaction data in the M payment transaction data of the i-th object.
[0244] In some embodiments, as shown in FIG8, the embedding layer of this application embodiment includes a feature embedding layer and a position embedding layer. In this case, the electronic device can perform feature embedding processing on each of the K sequence blocks of the i-th object through the feature embedding layer to obtain the feature embedding representation of the K sequence blocks. Next, the position embedding layer performs position embedding processing on each of the K sequence blocks of the i-th object to obtain the position embedding representation of the K sequence blocks. For example, the position embedding representation of the K sequence blocks is determined based on the position information of these K sequence blocks in the first payment feature sequence of the i-th object. Finally, the feature embedding representation and the position embedding representation of the K sequence blocks are fused to obtain the input embedding representation of the i-th object. For example, the feature embedding representation and the position embedding representation of the K sequence blocks are element-wise added to obtain the input embedding representation of the i-th object. In this embodiment, each of the K sequence blocks can be treated as a processing unit to determine the feature embedding representation of each sequence block, that is, each sequence block is mapped to a continuous vector space, which facilitates the capture of local features and contextual information of the payment transaction data of the i-th object. This approach, based on the embedded representation information of the K sequence blocks of the i-th object, can improve the accuracy of subsequent analysis and prediction.
[0245] In some embodiments, the network structures of the Q attention modules included in the pre-trained risk identification model of this application are consistent. As shown in FIG9, each of these Q attention modules includes a multi-head attention layer, a first residual connection and normalization layer, a feedforward network layer, and a second residual connection and normalization layer. In this case, the above S204-B may include the following steps S204-B1 to S204-B3:
[0246] S204-B1. The electronic device performs attention analysis processing on the input embedding representation corresponding to the i-th object through the multi-head attention layer, the first residual connection and normalization layer, the feedforward network layer and the second residual connection and normalization layer included in the first attention module of Q attention modules, and obtains the first attention feature information of the i-th object.
[0247] S204-B2. The electronic device performs attention analysis processing on the first attention feature information of the i-th object through the multi-head attention layer, the first residual connection and normalization layer, the feedforward network layer and the second residual connection and normalization layer included in the second attention module of the Q attention modules, to obtain the second attention feature information of the i-th object. The process is executed sequentially to obtain the Q-th attention feature information of the i-th object.
[0248] S204-B3. The electronic device obtains the attention feature information of the i-th object based on the Q-th attention feature information of the i-th object.
[0249] In this implementation, as shown in Figure 10, the Q attention modules are connected in series. The input of the first attention module is connected to the output of the model's embedding layer, and the output of the Qth attention module is connected to the input of the model's output layer. Each attention module includes a multi-head self-attention layer, a first residual connection and normalization (ADD & Layer Normalization) layer, a feedforward layer, and a second residual connection and normalization layer. Multi-head self-attention is an attention mechanism that allows the model to consider all positions in the sequence when processing each element, enabling the model to capture long-range dependencies within the sequence. Layer Normalization is a technique used in neural networks to stabilize the training process by averaging each feature of each sample. ADD refers to directly adding the input to the output of a sub-layer (such as a self-attention or feedforward network), which helps solve the gradient vanishing problem in deep networks. FeedForward performs a further non-linear transformation on the output of the self-attention layer.
[0250] In some embodiments, the risk identification model of this application is limited to using only a subset of layers of the GPT-2 model, for example, using the first 6 layers for feature representation of time-series data, with each layer being an attention module, where Q equals 6. This reduces computational complexity; reducing the number of layers lowers the computational burden on the model, making it more suitable for real-time or resource-constrained applications. Furthermore, in this application embodiment, using fewer layers is sufficient to capture the features of the data, while avoiding overfitting caused by an overly complex model. This ensures flexibility for fine-tuning, allowing adjustments to a subset of the model's layers during subsequent training for specific tasks to adapt to the characteristics of new tasks.
[0251] The embodiments of this application do not impose restrictions on the specific network structure of the output layer.
[0252] In some embodiments, a DNN is used as the output layer of the model to learn the mapping from features extracted from the self-attention mechanism to binary classification results, thereby completing the time-series data classification task and realizing object fraud behavior identification.
[0253] In some embodiments, the output layer of this application includes an activation function, which allows the electronic device to perform a non-linear mapping on the attention feature information of the i-th object to obtain the first feature information of the i-th object. Next, the first feature information of the i-th object is normalized to obtain the second feature information C of the i-th object. Finally, the second feature information C of the i-th object is subjected to risk classification processing to obtain the risk prediction result for each of the M payment transaction data of the i-th object.
[0254] The specific implementation process of S204 can be referred to the relevant description of S104 above, and will not be repeated here.
[0255] After the electronic device has determined the risk prediction result for each of the M payment transaction data within each of the N objects through the above steps, it then executes step S205 as follows.
[0256] S205. Based on the risk prediction results of each payment transaction data in M payment transaction data included in each of N objects, the electronic device determines the model loss of the risk identification model, and adjusts the parameters in the risk identification model based on the model loss to obtain the trained risk identification model.
[0257] In this embodiment of the application, the electronic device can obtain the risk prediction result of each payment transaction data in the M payment transaction data included in each of the N objects based on the above processing, and then determine the model loss of the risk identification model based on the risk prediction result of each payment transaction data in the M payment transaction data included in each of the N objects.
[0258] This application does not limit the specific method by which the electronic device determines the model loss of the risk identification model based on the risk prediction results of each of the M payment transaction data included in each of the N objects. For example, the electronic device can use a preset loss function to determine the model loss of the risk identification model.
[0259] In some embodiments, as described above, each of the M payment transaction data for each of the N objects is tagged as either a normal transaction or an abnormal transaction (e.g., a fraudulent transaction). Thus, the model loss can be determined based on the tag information and risk prediction results of each of the M payment transaction data included in each of the N objects. For example, for each payment transaction data, the electronic device determines the corresponding loss based on the tag information and risk prediction results, and then adds the losses corresponding to the M payment transaction data included in each of the N objects to obtain the model loss.
[0260] Next, the electronic device determines whether the model loss has reached the preset loss. If it has, the model fine-tuning stops, and the parameters of the current model are fixed to obtain the target risk prediction model. If the model loss has not reached the preset loss, the parameters of the risk prediction model are adjusted based on the model loss.
[0261] In some embodiments, if the initial model of the risk identification model is a pre-trained risk identification model, the electronic device adjusts some parameters in the pre-trained risk identification model based on the model loss calculated above. This application embodiment does not limit the specific parameters to be adjusted.
[0262] In some embodiments, during parameter tuning, only the parameters included in the normalization layer and positional encoding layer of the pre-trained risk prediction model are adjusted. For example, as shown in Figure 9, the grayscale box portion is adjusted, while the self-attention mechanism layer and the feedforward neural network layer are frozen. The aim is to retain most of the knowledge learned by the model during the pre-training phase while only adjusting a portion of the model to adapt to the new time series analysis task. By updating only a part of the model, the risk of overfitting to the training data for the new task can be reduced. Freezing the parameters reduces the computational cost during training because it eliminates the need to calculate the gradients of these parameters.
[0263] Next, the electronic device can acquire payment transaction data from a new batch of objects and iteratively train the risk prediction model with the adjusted parameters again until the model training results are met. The final trained risk prediction model is then obtained.
[0264] The risk identification model training method provided in this application involves acquiring M payment transaction data for each of N objects. For the i-th object among the N objects, feature encoding is performed on each of the M payment transaction data for the i-th object to obtain feature representation information for each payment transaction data. Based on the feature representation information of the M payment transaction data, the first payment feature sequence of the i-th object is determined. The first payment feature sequence of the i-th object is divided into K sequence blocks with a preset block length as the sliding window size. Then, through the risk identification model, payment risk identification processing is performed on the K sequence blocks of each of the N objects to obtain the risk prediction result for each payment transaction data of the N objects. Based on the risk prediction result for each payment transaction data of the N objects, the model loss of the risk identification model is determined, and based on the model loss, the parameters in the risk identification model are adjusted to obtain the trained risk identification model. As can be seen from the above, during model training, feature encoding processing is performed on multiple payment transaction data of each of the N objects to obtain the first payment feature sequence of each object. This first payment feature sequence can reflect the payment information of the object. Next, the first payment feature sequence of each object is divided into multiple sequence blocks. When the risk model processes these multiple sequence blocks for each object, it can accurately capture the local payment features of each object, thereby improving the model's prediction accuracy. Furthermore, if the initial model of the risk identification model in this embodiment is a pre-trained risk identification model, the electronic device adjusts some parameters in the pre-trained model. Since this pre-trained risk identification model is trained on large-scale data, it can transfer cross-domain knowledge to the risk identification task, reducing the computational burden during training and reducing dependence on specific domain data, avoiding model overfitting, further improving the model's training effect and enhancing the risk identification accuracy of the risk identification model.
[0265] The preceding text introduced the risk identification method and the training method of the risk identification model. The following text, with reference to Figure 13, provides an overall description of the risk identification method of this application embodiment when using the risk identification model for risk identification.
[0266] Figure 13 is a flowchart illustrating a risk identification method provided in an embodiment of this application.
[0267] As shown in Figure 13, the risk identification method of this application embodiment includes the following steps:
[0268] S301. The electronic device acquires M payment transaction data for each of N objects.
[0269] The specific implementation process of S301 can be referred to the relevant description of S201 above, and will not be repeated here.
[0270] S302. For the i-th object among N objects, the electronic device performs feature encoding on each of the M payment transaction data of the i-th object to obtain the feature representation information of each payment transaction data, and determines the first payment feature sequence of the i-th object based on the feature representation information of the M payment transaction data.
[0271] The specific implementation process of S302 can be referred to the relevant description of S202 above, and will not be repeated here.
[0272] S303. Using a preset block length as the size of the sliding window and a preset block step size as the sliding step size of the sliding window, slide the first payment feature sequence of the i-th object into K sequence blocks.
[0273] The specific implementation process of S303 can be referred to the relevant description of S203 above, and will not be repeated here.
[0274] S304. Electronic devices use a risk identification model to perform payment risk identification processing on K sequence blocks of each of N objects, and obtain the risk prediction result for each payment transaction data of N objects.
[0275] The specific implementation process of S304 can be referred to the relevant description of S204 above, and will not be repeated here.
[0276] S305. Based on the risk prediction results of each payment transaction data in M payment transaction data included in each of N objects, the electronic device determines the model loss of the risk identification model, and adjusts the parameters in the risk identification model based on the model loss to obtain the trained risk identification model.
[0277] The specific implementation process of S305 can be referred to the relevant description of S205 above, and will not be repeated here.
[0278] The above S310 to S305 describe the training process of the risk identification model.
[0279] S306. Electronic devices acquire M payment transaction data entries from the target device within a recent period.
[0280] The specific implementation process of S306 can be referred to the relevant description of S101 above, and will not be repeated here.
[0281] S307. Encode each payment transaction data for its features to obtain the feature representation information of each payment transaction data, and determine the first payment feature sequence based on the feature representation information of the M payment transaction data.
[0282] The specific implementation process of S307 can be referred to the relevant description of S102 above, and will not be repeated here.
[0283] S308. The electronic device slides on the first payment feature sequence with a preset block length as the size of the sliding window and a preset block step size as the sliding step size of the sliding window, dividing the first payment feature sequence into K sequence blocks.
[0284] The specific implementation process of S308 can be referred to the relevant description of S103 above, and will not be repeated here.
[0285] S309. The electronic device uses the trained risk identification model to perform payment risk identification processing on K sequence blocks, and obtains the risk prediction result for each payment transaction data in M payment transaction data.
[0286] The specific implementation process of S309 can be referred to the relevant description of S104 above, and will not be repeated here.
[0287] The above S306 to S309 describe the process of risk identification using the trained risk identification model.
[0288] The risk identification method provided in this application first trains a risk identification model, then uses the trained model to identify payment risks in M payment transaction data of an object, obtaining a risk prediction result for each of the M payment transaction data. Based on the risk prediction results for each of the object's M payment transaction data, the payment risk of the object can be accurately predicted, thereby improving the security of social payments.
[0289] The embodiments of the risk identification model training and risk identification method of this application have been described in detail above with reference to Figures 2 to 12. The apparatus embodiments of this application have been described in detail below with reference to Figure 14.
[0290] Figure 14 is a schematic block diagram of a risk identification device provided in an embodiment of this application.
[0291] As shown in Figure 14, the risk identification device 10 includes:
[0292] Acquisition unit 11 is used to acquire M payment transaction data of the object in a recent period of time, where M is a positive integer;
[0293] The feature encoding unit 12 is used to encode the features of each payment transaction data to obtain the feature representation information of each payment transaction data, and to determine the first payment feature sequence based on the feature representation information of the M payment transaction data.
[0294] Block partitioning unit 13 is used to divide the first payment feature sequence of the object into K sequence blocks, where K is a positive integer greater than 1;
[0295] The risk identification unit 14 is used to perform payment risk identification processing on the K sequence blocks to obtain the risk prediction result of each payment transaction data in the M payment transaction data.
[0296] In some embodiments, the feature encoding unit 12 is specifically configured to, for the j-th payment transaction data in the M payment transaction data, select P payment information belonging to the payment information type based on a preset payment information type, where P is a positive integer and j is a positive integer less than or equal to M; perform feature encoding on the P payment information respectively to obtain the encoding information of each of the P payment information; perform feature fusion on the encoding information of the P payment information to obtain the feature representation information of the j-th payment transaction data; and perform data format conversion processing based on the feature representation information of each payment data in the M payment transaction data to determine the first payment feature sequence.
[0297] In some embodiments, the feature encoding unit 12 is specifically used to concatenate the encoded information of the P payment information to obtain the feature representation information of the j-th payment transaction data.
[0298] In some embodiments, the feature encoding unit 12 is specifically used to perform data format conversion processing based on the feature representation information of the M payment transaction data to determine the first payment feature sequence.
[0299] In some embodiments, the feature encoding unit 12 is specifically used to perform embedding processing on the feature representation information of the M payment transaction data respectively, so as to map the feature information representation of the payment transaction data to a low-dimensional feature space to obtain the embedded representation of the feature representation information of each payment data in the M payment transaction data; and to perform data format conversion processing on the embedded representation of the feature representation information of the M payment transaction data to obtain the first payment feature sequence.
[0300] In some embodiments, the feature encoding unit 12 is specifically used to combine the embedded representations of the feature representation information of the M payment transaction data to obtain a second payment feature sequence; and to interchange the feature dimension and the payment transaction data entry dimension M in the second payment feature sequence to obtain the first payment feature sequence.
[0301] In some embodiments, the feature encoding unit 12 is specifically used to arrange the embedded representation of the feature representation information of the M payment transaction data based on the time order of the M payment transaction data to obtain the second payment feature sequence.
[0302] In some embodiments, the block division unit 13 is specifically used to slide on the first payment feature sequence with a preset block length as the size of the sliding window and a preset block step size as the sliding step size of the sliding window, thereby dividing the first payment feature sequence into K sequence blocks.
[0303] In some embodiments, the risk identification unit 14 is specifically used to perform payment risk identification processing on the K sequence blocks through a risk identification model to obtain the risk prediction result of each payment transaction data in the M payment transaction data.
[0304] In some embodiments, the risk identification model includes an embedding layer, Q attention modules, and an output layer, where Q is a positive integer. The risk identification unit 14 is specifically used to perform embedding processing on each of the K sequence blocks through the embedding layer to obtain an input embedding representation; to perform attention analysis processing on the input embedding representation through the Q attention modules to obtain attention feature information; and to perform risk calculation on the attention feature information through the output layer to obtain the risk prediction result for each of the M payment transaction data.
[0305] In some embodiments, the embedding layer includes a feature embedding layer and a position embedding layer. The risk identification unit 14 is specifically configured to perform feature embedding processing on each of the K sequence blocks through the feature embedding layer to obtain a feature embedding representation of the K sequence blocks; perform position embedding processing on each of the K sequence blocks through the position embedding layer to obtain a position embedding representation of the K sequence blocks; and fuse the feature embedding representation and the position embedding representation of the K sequence blocks to obtain the input embedding representation.
[0306] In some embodiments, each of the Q attention modules includes a multi-head attention layer, a first residual connection and normalization layer, a feedforward network layer, and a second residual connection and normalization layer. The risk identification unit 14 is specifically used to perform attention analysis processing on the input embedding representation through the multi-head attention layer, the first residual connection and normalization layer, the feedforward network layer, and the second residual connection and normalization layer included in the first attention module of the Q attention modules to obtain first attention feature information; to perform attention analysis processing on the first attention feature information through the multi-head attention layer, the first residual connection and normalization layer, the feedforward network layer, and the second residual connection and normalization layer included in the second attention module of the Q attention modules to obtain second attention feature information, and so on, to obtain the Qth attention feature information; and to obtain the attention feature information based on the Qth attention feature information.
[0307] In some embodiments, the output layer includes an activation function and a risk identification unit 14, specifically used to perform nonlinear mapping on the attention feature information through the activation function to obtain first feature information; to perform normalization processing on the first feature information to obtain second feature information; and to perform risk classification processing on the second feature information to obtain the risk prediction result of each payment transaction data in the M payment transaction data.
[0308] It should be understood that the device embodiments and method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, they will not be repeated here. Specifically, the device shown in FIG14 can execute the above-described risk identification method embodiments, and the foregoing and other operations and / or functions of each module in the device are respectively for implementing the method embodiments corresponding to the electronic devices. For the sake of brevity, they will not be repeated here.
[0309] Figure 15 is a schematic block diagram of a model training device provided in an embodiment of this application.
[0310] As shown in Figure 15, the model training device 20 is applied to the terminal device and includes:
[0311] Acquisition unit 21 is used to acquire M payment transaction data for each of N objects, where N and M are both positive integers;
[0312] The feature encoding unit 22 is used to encode the feature of each of the M payment transaction data of the i-th object among the N objects, to obtain the feature representation information of each payment transaction data, and to determine the first payment feature sequence of the i-th object based on the feature representation information of the M payment transaction data, where i is a positive integer less than or equal to N;
[0313] The block partitioning unit 23 is used to slide on the first payment feature sequence with a preset block length as the size of the sliding window and a preset block step size as the sliding step size of the sliding window, so as to divide the first payment feature sequence of the i-th object into K sequence blocks, where K is a positive integer greater than 1.
[0314] The risk identification unit 24 is used to perform payment risk identification processing on K sequence blocks of each of the N objects through a risk identification model, and obtain the risk prediction result of each payment transaction data in the N objects;
[0315] Training unit 25 is used to determine the model loss of the risk identification model based on the risk prediction results of each payment transaction data of the N objects, and to adjust the parameters in the risk identification model based on the model loss to obtain the trained risk identification model.
[0316] In some embodiments, the risk identification model includes an embedding layer, Q attention modules, and an output layer, where Q is a positive integer. The risk identification unit 24 is specifically used to, for the i-th object among the N objects, perform embedding processing on each of the K sequence blocks of the i-th object through the embedding layer to obtain the input embedding representation of the i-th object; perform attention analysis processing on the input embedding representation of the i-th object through the Q attention modules to obtain the attention feature information of the i-th object; and perform risk calculation on the attention feature information of the i-th object through the output layer to obtain the risk prediction result of each of the M payment transaction data of the i-th object.
[0317] In some embodiments, the embedding layer includes a feature embedding layer and a position embedding layer. The risk identification unit 24 is configured to perform feature embedding processing on each of the K sequence blocks of the i-th object through the feature embedding layer to obtain the feature embedding representation of the K sequence blocks; perform position embedding processing on each of the K sequence blocks of the i-th object through the position embedding layer to obtain the position embedding representation of the K sequence blocks; and fuse the feature embedding representation and the position embedding representation of the K sequence blocks to obtain the input embedding representation of the i-th object.
[0318] In some embodiments, each of the Q attention modules includes a multi-head attention layer, a first residual connection and normalization layer, a feedforward network layer, and a second residual connection and normalization layer. The risk identification unit 24 is used to perform attention analysis processing on the input embedding representation corresponding to the i-th object through the multi-head attention layer, the first residual connection and normalization layer, the feedforward network layer, and the second residual connection and normalization layer included in the first attention module of the Q attention modules to obtain the first attention feature information of the i-th object; to perform attention analysis processing on the first attention feature information of the i-th object through the multi-head attention layer, the first residual connection and normalization layer, the feedforward network layer, and the second residual connection and normalization layer included in the second attention module of the Q attention modules to obtain the second attention feature information of the i-th object, and so on, to obtain the Q-th attention feature information of the i-th object; and to obtain the attention feature information of the i-th object based on the Q-th attention feature information of the i-th object.
[0319] In some embodiments, the training unit 25 is specifically used to adjust the parameters included in the location embedding layer and the normalization layer in the risk identification model based on the model loss, so as to obtain the trained risk identification model.
[0320] It should be understood that the device embodiments and method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, they will not be repeated here. Specifically, the device shown in FIG15 can execute the above-described model training method embodiments, and the foregoing and other operations and / or functions of each module in the device are respectively for implementing the method embodiments corresponding to the electronic device. For the sake of brevity, they will not be repeated here.
[0321] The apparatus of this application embodiment has been described above from the perspective of functional modules in conjunction with the accompanying drawings. It should be understood that this functional module can be implemented in hardware, in software instructions, or in a combination of hardware and software modules. Specifically, the steps of the method embodiments in this application can be completed by integrated logic circuits in the processor's hardware and / or by software instructions. The steps of the method disclosed in this application embodiment can be directly embodied as being executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. Optionally, the software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps in the above method embodiments.
[0322] Figure 16 is a schematic block diagram of an electronic device provided in an embodiment of this application. The electronic device in Figure 15 can be a terminal device or a server, and can be used to execute the above method embodiments.
[0323] As shown in Figure 16, the electronic device 30 may include:
[0324] The system includes a memory 31 and a processor 32. The memory 31 stores a computer program 33 and transfers the program code 33 to the processor 32. In other words, the processor 32 can retrieve and run the computer program 33 from the memory 31 to implement the methods described in the embodiments of this application.
[0325] For example, the processor 32 can be used to execute the steps in the above method according to the instructions in the computer program 33.
[0326] In some embodiments of this application, the processor 32 may include, but is not limited to:
[0327] General-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0328] In some embodiments of this application, the memory 31 includes, but is not limited to:
[0329] Volatile memory and / or non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).
[0330] In some embodiments of this application, the computer program 33 may be divided into one or more modules, which are stored in the memory 31 and executed by the processor 32 to complete the page recording method provided in this application. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program 33 in the electronic device.
[0331] As shown in Figure 16, the electronic device 30 may further include:
[0332] Transceiver 34, which can be connected to processor 32 or memory 31.
[0333] The processor 32 can control the transceiver 34 to communicate with other devices; specifically, it can send information or data to other devices or receive information or data sent by other devices. The transceiver 34 may include a transmitter and a receiver. The transceiver 34 may further include antennas, and the number of antennas may be one or more.
[0334] It should be understood that the various components in the electronic device 30 are connected through a bus system, which includes a data bus, a power bus, a control bus, and a status signal bus.
[0335] According to one aspect of this application, a computer storage medium is provided that stores a computer program thereon, which, when executed by a computer, enables the computer to perform the methods of the above-described method embodiments. Alternatively, embodiments of this application also provide a computer program product containing instructions that, when executed by a computer, cause the computer to perform the methods of the above-described method embodiments.
[0336] According to another aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method described in the above-described method embodiments.
[0337] In other words, when implemented using software, it can be implemented wholly or partially in the form of a computer program product. This computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disc (DVD)), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0338] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0339] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.
[0340] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. For example, the functional modules in the various embodiments of this application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0341] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
A risk identification method, characterized in that, include: Retrieve M payment transaction records of the object within a recent period, where M is a positive integer; Each payment transaction data is feature-encoded to obtain the feature representation information of each payment transaction data, and a first payment feature sequence is determined based on the feature representation information of the M payment transaction data. The first payment feature sequence is divided into K sequence blocks, where K is a positive integer greater than 1; The K sequence blocks are processed for payment risk identification to obtain the risk prediction result for each of the M payment transaction data. The method according to claim 1, characterized in that, The process of encoding each payment transaction data point to obtain its feature representation information includes: For the j-th payment transaction among the M payment transaction data, based on the preset payment information type, P payment information belonging to the payment information type are selected from the j-th payment transaction data, where P is a positive integer and j is a positive integer less than or equal to M; Each of the P payment information pieces is feature-encoded to obtain the encoded information of each of the P payment information pieces; Feature fusion is performed on the encoded information of the P payment information to obtain the feature representation information of the j-th payment transaction data. The method according to claim 2, characterized in that, The feature fusion of the encoded information of the P payment information to obtain the feature representation information of the j-th payment transaction data includes: The encoded information of the P payment information is concatenated to obtain the feature representation information of the j-th payment transaction data. The method according to any one of claims 1-3, characterized in that, The determination of the first payment feature sequence based on the feature representation information of the M payment transaction data includes: Based on the feature representation information of the M payment transaction data, data format conversion processing is performed to determine the first payment feature sequence. The method according to claim 4, characterized in that, The process of performing data format conversion based on the feature representation information of the M payment transaction data to determine the first payment feature sequence includes: The feature representation information of the M payment transaction data is embedded to map the feature information representation of the payment transaction data to a low-dimensional feature space, thereby obtaining the embedded representation of the feature representation information of each payment data in the M payment transaction data; The embedded representation of the feature representation information of the M payment transaction data is subjected to data format conversion processing to obtain the first payment feature sequence. The method according to claim 5, characterized in that, The embedding representation of the feature representation information of the M payment transaction data is subjected to data format conversion processing to obtain the first payment feature sequence, including: The embedded representations of the feature representation information of the M payment transaction data are combined to obtain a second payment feature sequence; The first payment feature sequence is obtained by swapping the feature dimension and the payment transaction data entry dimension M in the second payment feature sequence. The method according to claim 6, characterized in that, The embedding representation of the feature representation information of the M payment transaction data is combined to obtain the second payment feature sequence, including: Based on the time sequence of the M payment transaction data, the embedded representations of the feature representation information of the M payment transaction data are arranged to obtain the second payment feature sequence. The method according to any one of claims 1-7, characterized in that, The step of dividing the first payment feature sequence into K sequence blocks includes: The sliding window is sized with a preset block length and the sliding window is sized with a preset block step size. The sliding window is then slid across the first payment feature sequence to divide the first payment feature sequence into K sequence blocks. The method according to any one of claims 1-8, characterized in that, The process of performing payment risk identification on the K sequence blocks to obtain the risk prediction result for each of the M payment transaction data includes: Using a risk identification model, payment risk identification processing is performed on the K sequence blocks to obtain the risk prediction result for each of the M payment transaction data. The method according to claim 9, characterized in that, The risk identification model includes an embedding layer, Q attention modules, and an output layer, where Q is a positive integer. The model performs payment risk identification processing on the K sequence blocks to obtain the risk prediction result for each of the M payment transaction data, including: The embedding layer is used to embed each of the K sequence blocks to obtain the input embedding representation; The input embedding representation is subjected to attention analysis processing through the Q attention modules to obtain attention feature information; The risk prediction result for each of the M payment transaction data is obtained by performing risk calculation on the attention feature information through the output layer. The method according to claim 10, characterized in that, The embedding layer includes a feature embedding layer and a position embedding layer. The embedding layer performs embedding processing on each of the K sequence blocks to obtain an input embedding representation, including: The feature embedding layer is used to perform feature embedding processing on each of the K sequence blocks to obtain the feature embedding representation of the K sequence blocks; The position embedding layer is used to perform position embedding processing on each of the K sequence blocks to obtain the position embedding representation of the K sequence blocks; The feature embedding representation and position embedding representation of the K sequence blocks are fused to obtain the input embedding representation. The method according to claim 11, characterized in that, Each of the Q attention modules includes a multi-head attention layer, a first residual connection and normalization layer, a feedforward network layer, and a second residual connection and normalization layer. The attention feature information obtained by performing attention analysis processing on the input embedding representation through the Q attention modules includes: The input embedding representation is subjected to attention analysis processing through the multi-head attention layer, the first residual connection and normalization layer, the feedforward network layer and the second residual connection and normalization layer included in the first attention module of the Q attention modules to obtain the first attention feature information; The first attention feature information is processed by the multi-head attention layer, the first residual connection and normalization layer, the feedforward network layer and the second residual connection and normalization layer included in the second attention module of the Q attention modules to obtain the second attention feature information. The processes are executed sequentially to obtain the Qth attention feature information. The attention feature information is obtained based on the Qth attention feature information. The method according to any one of claims 10-12, characterized in that, The output layer includes an activation function. The step of performing risk calculations on the attention feature information through the output layer to obtain the risk prediction result for each of the M payment transaction data includes: The attention feature information is non-linearly mapped using the activation function to obtain the first feature information; The first feature information is normalized to obtain the second feature information; The second feature information is processed for risk classification to obtain the risk prediction result for each of the M payment transaction data. A method for training a risk identification model, characterized in that, include: Retrieve M payment transaction records for each of N objects, where N and M are both positive integers; For the i-th object among the N objects, feature encoding is performed on each of the M payment transaction data of the i-th object to obtain the feature representation information of each payment transaction data. Based on the feature representation information of the M payment transaction data, the first payment feature sequence of the i-th object is determined, where i is a positive integer less than or equal to N. The first payment feature sequence is divided into K sequence blocks, where K is a positive integer greater than 1; Using a risk identification model, payment risk identification processing is performed on K sequence blocks of each of the N objects to obtain the risk prediction result for each payment transaction data of the N objects; Based on the risk prediction results of each payment transaction data of the N objects, the model loss of the risk identification model is determined, and the parameters in the risk identification model are adjusted based on the model loss to obtain the trained risk identification model. The method according to claim 14, characterized in that, The risk identification model includes an embedding layer, Q attention modules, and an output layer, where Q is a positive integer. The pre-trained risk identification model performs payment risk identification processing on K sequence blocks of each of the N objects to obtain a risk prediction result for each payment transaction data point of the N objects, including: For the i-th object among the N objects, the embedding layer is used to embed each of the K sequence blocks of the i-th object to obtain the input embedding representation of the i-th object; The input embedding representation of the i-th object is subjected to attention analysis processing by the Q attention modules to obtain the attention feature information of the i-th object; The risk prediction result of each payment transaction in the M payment transaction data of the i-th object is obtained by performing risk calculation on the attention feature information of the i-th object through the output layer. The method according to claim 15, characterized in that, The embedding layer includes a feature embedding layer and a position embedding layer. The embedding layer performs embedding processing on each of the K sequence blocks of the i-th object to obtain the input embedding representation of the i-th object, including: The feature embedding layer is used to perform feature embedding processing on each of the K sequence blocks of the i-th object to obtain the feature embedding representation of the K sequence blocks; The position embedding layer is used to perform position embedding processing on each of the K sequence blocks of the i-th object to obtain the position embedding representation of the K sequence blocks; The feature embedding representations and position embedding representations of the K sequence blocks are fused to obtain the input embedding representation of the i-th object. The method according to claim 16, characterized in that, Each of the Q attention modules includes a multi-head attention layer, a first residual connection and normalization layer, a feedforward network layer, and a second residual connection and normalization layer. The attention analysis processing of the input embedding representation of the i-th object through the Q attention modules to obtain the attention feature information of the i-th object includes: The first attention module in the Q attention modules includes a multi-head attention layer, a first residual connection and normalization layer, a feedforward network layer, and a second residual connection and normalization layer. Attention analysis processing is performed on the input embedding representation corresponding to the i-th object to obtain the first attention feature information of the i-th object. The first attention feature information of the i-th object is processed by the multi-head attention layer, the first residual connection and normalization layer, the feedforward network layer and the second residual connection and normalization layer included in the second attention module of the Q attention modules to obtain the second attention feature information of the i-th object. The processes are executed sequentially to obtain the Q-th attention feature information of the i-th object. Based on the Qth attention feature information of the i-th object, the attention feature information of the i-th object is obtained. The method according to claim 17, characterized in that, The step of adjusting some parameters in the risk identification model based on the model loss to obtain the trained risk identification model includes: Based on the model loss, the parameters included in the location embedding layer and the normalization layer in the risk identification model are adjusted to obtain the risk identification model. A risk identification device, characterized in that, include: The acquisition unit is used to acquire M payment transaction data of the object within a recent period, where M is a positive integer; The feature encoding unit is used to encode the features of each payment transaction data to obtain the feature representation information of each payment transaction data, and to determine the first payment feature sequence based on the feature representation information of the M payment transaction data. A block partitioning unit is used to divide the first payment feature sequence into K sequence blocks, where K is a positive integer greater than 1; The risk identification unit is used to perform payment risk identification processing on the K sequence blocks to obtain the risk prediction result of each payment transaction data in the M payment transaction data. A training device for a risk identification model, characterized in that, include: The acquisition unit is used to acquire M payment transaction data for each of N objects, where N and M are both positive integers. The feature encoding unit is used to encode the features of each of the M payment transaction data of the i-th object among the N objects, to obtain the feature representation information of each payment transaction data, and to determine the first payment feature sequence of the i-th object based on the feature representation information of the M payment transaction data, where i is a positive integer less than or equal to N; A block partitioning unit is used to divide the first payment feature sequence into K sequence blocks, where K is a positive integer greater than 1; The risk identification unit is used to perform payment risk identification processing on K sequence blocks of each of the N objects through a risk identification model, and obtain the risk prediction result of each payment transaction data in the N objects; The training unit is used to determine the model loss of the risk identification model based on the risk prediction results of each payment transaction data of the N objects, and to adjust the parameters in the risk identification model based on the model loss to obtain the trained risk identification model. An electronic device, comprising a processor and a memory; The memory is used to store computer programs; The processor is configured to execute the computer program to implement the method as described in any one of claims 1 to 13 or 14 to 18. A computer-readable storage medium, characterized in that, Used to store computer programs; The computer program causes the computer to perform the method as described in any one of claims 1 to 13 or 14 to 18. A computer program product, characterized in that, The computer program product includes at least one program segment stored in a computer-readable storage medium, a processor of a computer device reading the at least one program segment from the computer-readable storage medium, and the processor executing the at least one program segment to cause the computer device to perform the method according to any one of claims 1 to 13 or 14 to 18.
Citation Information
Patent Citations
Transaction behavior risk identification method and device, storage medium and computer equipment
CN111340506A
Abnormal transaction processing method and device, equipment and storage medium
CN115082070A
Data processing method and device, equipment and storage medium
CN116957585A
Payment security identification method and system of payment terminal
CN118365334A
Fraud prevention for payment instruments
US20210004809A1