Risk identification method and device, equipment and storage medium

By performing feature encoding and sequence block division on mobile payment transaction data, and combining the risk identification model with the embedding layer and attention module, the problem of inaccurate risk identification in existing technologies is solved, and accurate risk identification and timely interception of illegal activities in payment transaction data are achieved.

CN121998642APending Publication Date: 2026-05-08TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2024-11-04
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

In existing mobile payment scenarios, risk identification methods based on risk identification rules are easily bypassed by criminals, making it difficult to effectively distinguish between normal transactions and fraudulent activities, resulting in inaccurate risk identification.

Method used

By acquiring payment transaction data of the target object, performing feature encoding, dividing it into multiple sequence blocks, and using a risk identification model to perform payment risk identification processing on these sequence blocks, including a combination of an embedding layer, an attention module, and an output layer, the risk prediction of payment transaction data can be achieved.

Benefits of technology

It improves the accuracy of payment risk identification, can promptly intercept illegal payment activities, and enhances the security of mobile payments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121998642A_ABST
    Figure CN121998642A_ABST
Patent Text Reader

Abstract

The invention provides a risk identification method and device, equipment and a storage medium, which can be applied to the technical fields of mobile payment, risk identification and the like, and comprises the following steps: obtaining M payment transaction data of a target object; performing feature coding on each piece of payment transaction data in the M pieces of payment transaction data to obtain a first payment feature sequence of the target object; dividing the first payment feature sequence of the target object into K sequence blocks; and performing payment risk identification processing on the K sequence blocks of the target object to obtain a risk prediction result of each piece of payment transaction data in the M pieces of payment transaction data of the target object. According to the method, the first payment feature sequence of the target object is divided into the plurality of sequence blocks, so that the model can accurately capture the local payment feature data of the target object, and accurate identification of the payment risk is further realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a risk identification method, apparatus, device, and storage medium. Background Technology

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

[0003] 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

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

[0005] Firstly, this application provides a risk identification method, including:

[0006] Obtain M payment transaction data entries for the target object, where M is a positive integer;

[0007] Each payment transaction in the M payment transaction data of the target object is feature-encoded to obtain the first payment feature sequence of the target object;

[0008] 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 over the first payment feature sequence to divide the first payment feature sequence of the target object into K sequence blocks, where K is a positive integer greater than 1.

[0009] The payment risk identification process is performed on K sequence blocks of the target object to obtain the risk prediction result of each payment transaction data in the M payment transaction data.

[0010] Secondly, this application provides a method for training a risk identification model, including:

[0011] Retrieve M payment transaction records for each of N objects, where N and M are both positive integers;

[0012] 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 first payment feature sequence of the i-th object, where i is a positive integer less than or equal to N;

[0013] 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, where K is a positive integer greater than 1.

[0014] 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;

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

[0016] Thirdly, this application provides a risk identification device, comprising:

[0017] The acquisition unit is used to acquire M payment transaction data of the target object, where M is a positive integer;

[0018] The feature encoding unit is used to encode the features of each of the M payment transaction data of the target object to obtain the first payment feature sequence of the target object;

[0019] 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, thereby dividing the first payment feature sequence of the target object into K sequence blocks, where K is a positive integer greater than 1.

[0020] The risk identification unit is used to perform payment risk identification processing on K sequence blocks of the target object to obtain the risk prediction result of each payment transaction data in the M payment transaction data.

[0021] In some embodiments, the feature encoding unit is specifically configured to, for the j-th payment transaction data among the M payment transaction data of the target object, 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 among the M payment transaction data of the target object to determine the first payment feature sequence of the target object.

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

[0023] In some embodiments, the feature encoding unit is specifically used to embed the feature representation information of M payment transaction data of the target object respectively 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 of the target object to obtain the first payment feature sequence of the target object.

[0024] In some embodiments, the feature encoding unit is specifically used to combine the embedded representations of the feature representation information of M payment transaction data of the target object to obtain a second payment feature sequence of the target object; and to interchange the feature dimension and the payment transaction data entry dimension M in the second payment feature sequence of the target object to obtain a first payment feature sequence of the target object.

[0025] In some embodiments, the risk identification unit is specifically used to perform payment risk identification processing on K sequence blocks of the target object through a risk identification model, so as to obtain the risk prediction result of each payment transaction data in the M payment transaction data.

[0026] 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 of the target object through the embedding layer to obtain the input embedding representation of the target object; to perform attention analysis processing on the input embedding representation of the target object through the Q attention modules to obtain the attention feature information of the target object; and to perform risk calculation on the attention feature information of the target object through the output layer to obtain the risk prediction result for each of the M payment transaction data of the target object.

[0027] In some embodiments, the embedding layer includes a feature embedding layer and a location embedding layer. The risk identification unit is specifically configured to perform feature embedding processing on each of the K sequence blocks of the target object through the feature embedding layer to obtain a feature embedding representation of the K sequence blocks; perform location embedding processing on each of the K sequence blocks of the target object through the location embedding layer to obtain a location embedding representation of the K sequence blocks; and fuse the feature embedding representation and the location embedding representation of the K sequence blocks to obtain an input embedding representation of the target object.

[0028] 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 used to perform attention analysis processing on the input embedding representation corresponding to the target 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 of the Q attention modules, to obtain the first attention feature information of the target object; to perform attention analysis processing on the first attention feature information of the target 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 of the Q attention modules, to obtain the second attention feature information of the target object; and to perform this sequentially to obtain the Qth attention feature information of the target object; and to obtain the attention feature information of the target object based on the Qth attention feature information of the target object.

[0029] 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 of the target object through the activation function to obtain the first feature information of the target object; to normalize the first feature information of the target object to obtain the second feature information of the target object; and to perform risk classification processing on the second feature information of the target object to obtain the risk prediction result of each payment transaction data in the M payment transaction data of the target object.

[0030] Fourthly, this application provides a training device for a risk identification model, comprising:

[0031] The acquisition unit is used to acquire M payment transaction data for each of N objects, where N and M are both positive integers.

[0032] 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, so as to obtain the first payment feature sequence of the i-th object, where i is a positive integer less than or equal to N;

[0033] 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;

[0034] 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;

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

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

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

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

[0039] In some embodiments, the training unit 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.

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

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

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

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

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

[0045] In summary, this embodiment of the application obtains M payment transaction data of a target object, and then encodes the features of each of these M payment transaction data to obtain a first payment feature sequence of the target 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 first payment feature sequence of the target object into K sequence blocks. Payment risk identification processing is then performed on the K sequence blocks of the target object to obtain the risk prediction result for each of the M payment transaction data of the target object. Therefore, in this embodiment of the application, by performing feature encoding processing on multiple payment transaction data of the target object, a first payment feature sequence of the target object is obtained. This first payment feature sequence can reflect the payment behavior of the target object. 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 local and global payment features of the target object, thereby achieving accurate identification of payment transaction data risks. Attached Figure Description

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

[0047] Figure 1 A schematic diagram of an implementation environment for the risk identification method and the risk identification model training method provided in the embodiments of this application;

[0048] Figure 2 A flowchart illustrating a risk identification method provided in an embodiment of this application;

[0049] Figure 3 This is a schematic diagram illustrating the determination of feature representation information of payment transaction data involved in an embodiment of this application;

[0050] Figure 4 This is a schematic diagram illustrating the embedded representation of payment transaction data involved in an embodiment of this application;

[0051] Figure 5 This is a schematic diagram of a block partitioning method according to an embodiment of this application;

[0052] Figure 6 This is a schematic diagram of a model training method according to an embodiment of this application;

[0053] Figure 7 A schematic diagram of a network structure for a pre-trained risk identification model;

[0054] Figure 8 A schematic diagram of a network structure for an embedding layer;

[0055] Figure 9 This is a schematic diagram of a network structure for an attention module;

[0056] Figure 10 This is a schematic diagram showing the connections between Q attention modules;

[0057] Figure 11 This is a schematic diagram of the output layer;

[0058] Figure 12 A schematic diagram of the training method for a risk identification model provided in an embodiment of this application;

[0059] Figure 13 A flowchart illustrating a risk identification method provided in an embodiment of this application;

[0060] Figure 14 This is a schematic block diagram of a risk identification device provided in an embodiment of this application;

[0061] Figure 15 This is a schematic block diagram of a model training apparatus provided in an embodiment of this application;

[0062] Figure 16 This is a schematic block diagram of the electronic device provided in the embodiments of this application. Detailed Implementation

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

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

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

[0066] The relevant concepts involved in the embodiments of this application are introduced below.

[0067] Mobile payments: Allows users to make payments and transfers through applications (such as instant messaging applications).

[0068] Social payment scenarios refer to payment activities conducted on social media or communication applications, such as payments between friends or sending red envelopes.

[0069] Anti-fraud algorithm: A machine learning algorithm that identifies potential fraudulent activities by analyzing an object's payment transaction data.

[0070] Deep neural networks: a type of machine learning model used to handle complex nonlinear data modeling tasks.

[0071] LSTM: Long Short-Term Memory.

[0072] RNN: Recurrent Neural Network.

[0073] Transformer: A deep learning model based on self-attention mechanism.

[0074] In social payment scenarios, it is necessary to conduct risk assessments on the payment behavior of objects (such as users). A typical strategy is to use a series of logical judgments to determine the risk of an object. For example, if an object has a high risk payment score, it is considered too risky and is blocked. Therefore, this application embodiment needs to identify object risk based on the object's payment transaction data to identify potential fraudulent activities.

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

[0076] To address this technical problem, this application proposes a novel risk identification method. First, M payment transaction data points of a target object are acquired. Then, each of these M payment transaction data points is feature-encoded to obtain a first payment feature sequence of the target 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 first payment feature sequence of the target object into K sequence blocks. Payment risk identification processing is then performed on the K sequence blocks of the target object to obtain the risk prediction result for each payment transaction data point among the M payment transaction data points of the target object. Therefore, in this application embodiment, by performing feature encoding processing on multiple payment transaction data points of the target object, a first payment feature sequence of the target object is obtained. This first payment feature sequence can reflect the payment behavior of the target object. 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 local and global payment features of the target object, thereby achieving accurate identification of payment transaction data risks.

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

[0078] Figure 1 This 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.

[0079] In this embodiment, the target object (e.g., a user) can interact with the terminal device 101. For example, the target 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 target object. The server 102 has data processing capabilities.

[0080] In some embodiments, if the risk identification method of this application is performed by 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 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.

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

[0082] 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 risk identification model, for example, the server 102 stores the risk identification model locally, or the server 102 loads the 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 first payment feature sequence for the i-th object, where i is a positive integer less than or equal to N. A sliding window is created with a preset block length as the size of the sliding window and a preset block step size as the sliding step size. The sliding window is then divided into K sequence blocks, where K is a positive integer greater than 1. A pre-trained risk identification model is used to perform payment risk identification processing on the K sequence blocks for each of the N objects, resulting in a 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 the parameters in the risk identification model are adjusted based on the model loss to obtain the trained risk identification model.

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

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

[0085] In this embodiment of the application, the risk identification method can be executed by server 102 or terminal device 101.

[0086] 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 the target object. For example, in response to a payment transaction request from the target object, terminal device 101 acquires M payment transaction data of the target object. Next, terminal device 101 performs feature encoding on each of the M payment transaction data of the target object to obtain a first payment feature sequence of the target object. Then, terminal device 101 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 of the target object 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 of the target object to obtain a risk prediction result for each of the M payment transaction data of the target object. Based on the risk prediction results of the M payment transaction data of the target object, the risk prediction result of the target object is determined, for example, whether the target object is a normal object or a high-risk object (e.g., a fraud object).

[0087] In some embodiments, when the risk identification method of this application is executed by server 102, server 102 obtains M payment transaction data of the target object. For example, the target object initiates a transaction request on terminal device 101, and terminal device 101 sends the target object's transaction request to server 102. The transaction request includes the target object's identification information. Thus, server 102 can obtain the target object's M payment transaction data based on the target object's identification information. Next, server 102 performs feature encoding on each of the target object's M payment transaction data to obtain the target object's first payment feature sequence. Then, server 102 slides on the first payment feature sequence with a preset block length as the sliding window size and a preset block step size as the sliding window step size, dividing the target 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 target object's K sequence blocks to obtain the risk prediction result for each of the target 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 target object, obtaining the risk prediction result for each of the M payment transaction data of the target object. Optionally, server 102 can display the risk prediction result to terminal device 101.

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

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

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

[0091] It should be noted that the implementation environment of this application embodiment includes, but is not limited to, Figure 1 As shown.

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

[0093] First, the training process of the risk identification model will be introduced.

[0094] Figure 2 This is a flowchart illustrating a risk identification method provided in an embodiment of this application. The executing entity in this embodiment is a device with risk identification functionality, such as a risk identification device. In some embodiments, the risk identification device in this embodiment may be... Figure 1 The server in, or for Figure 1 Terminal devices in, or for Figure 1 The system consists of a server and terminal devices. For ease of description, this application uses an electronic device as an example for illustration.

[0095] like Figure 2 As shown, the risk identification method in this application includes the following steps:

[0096] S101. Obtain M payment transaction data for the target object.

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

[0098] The risk identification method of this application can be applied to anti-fraud scenarios or illegal transaction scenarios. It identifies potential fraudulent activities by analyzing the payment transaction data of a target object (e.g., a user). For example, if the risk identification result of the target object is determined to be high based on the payment transaction data, the relevant payment transaction behavior of the target object can be intercepted. Conversely, if the risk identification result of the target object is determined to be low based on the payment transaction data, the relevant payment transaction behavior of the target object can be processed normally. This improves the security of mobile payments.

[0099] This application embodiment does not restrict the specific triggering conditions for the electronic device to obtain M payment transaction data of the target object.

[0100] For example, an electronic device receives a payment transaction request from a target object, and then, based on the target object's payment transaction request, obtains M payment transaction data of the target object within a recent period.

[0101] For example, electronic devices periodically acquire M payment transaction data of a target object within a recent period to assess the risk of that target object.

[0102] In some embodiments, if the number of payment transaction data of the target object in a recent period is less than M, for example, if the number of payment transaction data of the target object in the recent period is B, which is less than M, then the B payment transaction data of the target object are obtained, and the remaining MB payment transaction data are filled in.

[0103] In some embodiments, the M payment transaction data of the target object are payment transaction data on a payment transaction platform, such as payment transaction data on an instant messaging application.

[0104] In some embodiments, the M payment transaction data of the target 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 target object's payment transaction data from different mobile payment platforms within a recent period based on the target object's identifier.

[0105] The payment transaction data in this application embodiment includes information such as transaction records, payment methods, and payment times.

[0106] In this embodiment of the application, after the electronic device obtains M payment transaction data of the target object based on the above steps, it executes the following step S102.

[0107] S102. Encode the features of each of the M payment transaction data of the target object to obtain the first payment feature sequence of the target object.

[0108] In this embodiment, after acquiring M payment transaction data points of a target 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 target object. In this embodiment, these payment transaction data points are first encoded to obtain a payment feature sequence of the target object, denoted as the first payment feature sequence. This first payment feature sequence includes the payment-related features of the target object.

[0109] This application embodiment does not limit the specific method for determining the first payment feature sequence of the target object based on M payment transaction data of the target object.

[0110] 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 target 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 target object. For example, the feature information of the M payment transaction data points for the target object is added together to obtain the first payment feature sequence of the target object. Another example is that the feature information of the M payment transaction data points for the target object is concatenated to obtain the first payment feature sequence of the target object.

[0111] In some embodiments, the electronic device may obtain the first payment feature sequence of the target object through the following steps S102-A to S102-D:

[0112] S102-A: For the j-th payment transaction data in the M payment transaction data of the target object, based on the preset payment information type, select P payment information belonging to the payment information type 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;

[0113] S102-B, Perform feature encoding on each of the P payment information pieces to obtain the encoding information of each feature in the P payment information pieces;

[0114] S102-C: Perform feature fusion on the encoded information of P payment information to obtain the feature representation information of the j-th payment transaction data;

[0115] S102-D: Based on the feature representation information of each payment data in the M payment transaction data of the target object, perform data transformation processing to determine the first payment feature sequence of the target object.

[0116] In this implementation, for each of the M payment transaction data of the target 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.

[0117] 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 features such as payment method, payment amount, geographical location, and time interval since the last transaction 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}.

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

[0119] 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 target 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 target 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 denoted as the encoded information of that payment information. That is, in this embodiment, the encoded information of each of the 5 payment information pieces is a 4-dimensional vector.

[0120] 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 target 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.

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

[0122] In one possible implementation, the electronic device adds the features of the encoded information of P payment information in the j-th payment transaction data to obtain the feature representation information of the j-th payment transaction data.

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

[0124] For example, such as Figure 3 As shown, the electronic device selects P payment information related to the payment from the j-th payment transaction data, for example, selecting 5 payment information, denoted as payment information A1, payment information A2, payment information A3, payment information A4, and payment information A5 respectively. Next, each of these 5 payment information pieces is feature-encoded; for example, each of the 5 features is encoded into a 4-dimensional vector, resulting in the encoded representation of the 5 payment information pieces. Then, the electronic device concatenates the encoded information of these 5 payment information pieces to obtain a 20-dimensional vector, denoted as the feature representation information of the j-th payment transaction data.

[0125] The above describes the specific process by which an electronic device determines the feature representation information of the j-th payment transaction data of a target object. Referring to the above method, the electronic device can determine the feature representation information of each of the M payment transaction data of the target object.

[0126] In this way, the electronic device can perform the steps of S102-D above, that is, determine the first payment feature sequence of the target object based on the feature representation information of each payment data in the M payment transaction data of the target object.

[0127] This application embodiment does not limit the specific method by which the electronic device determines the first payment feature sequence of the target object based on the feature representation information of each payment data in the M payment transaction data of the target object.

[0128] 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 the target object. In one example, the encoded information of the same payment information in P payment information of the M payment transaction data is added together to obtain the first payment feature sequence of the target object. For example, refer to Figure 5 As shown, the element-wise summation of the encoded information (a 4-dimensional vector) of payment information A1 from each of the five payment transaction data sets yields a new encoded information (also a 4-dimensional vector) for payment information A1. Similarly, the element-wise summation of the encoded information (a 4-dimensional vector) of payment information A2 from the five payment transaction data sets yields a new encoded information (also a 4-dimensional vector) for payment information A2. This process is repeated until a 20-dimensional first payment feature sequence is obtained. In another example, the feature representations of M payment transaction data sets are concatenated to obtain the first payment feature sequence of the target object. For example, refer to... Figure 5 As shown, the feature representation information of each of the five payment transaction data is a 20-dimensional vector. The features of 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 target object.

[0129] In some embodiments, the electronic device may determine the first payment feature sequence of the target object through the following steps S102-D1 and S102-D2:

[0130] S102-D1. Embed the feature representation information of the M payment transaction data of the target object respectively to obtain the embedded representation of the feature representation information of each payment data in the M payment transaction data.

[0131] In this implementation, the electronic device obtains the feature representation information of each of the M payment transaction data of the target 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 high-dimensional feature space, thereby obtaining the embedded representation of the feature representation information of each payment transaction data.

[0132] In one example, if the j-th payment transaction data of the target 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 low-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.

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

[0134] In one possible implementation, for each of the M payment transaction data of the target 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.

[0135] In one possible implementation, for each of the M payment transaction data of the target 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.

[0136] 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 target object. Then, it executes the steps S102-D2 above.

[0137] S102-D2: Perform data format conversion processing on the embedded representation of the feature representation information of the M payment transaction data of the target object to obtain the first payment feature sequence of the target object.

[0138] 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 target object by the electronic device to obtain the first payment feature sequence of the target object. The specific method is not limited.

[0139] In one possible implementation, the electronic device combines the embedded representations of the feature representations of M payment transaction data points of the target object to obtain a second payment feature sequence of the target object. For example, the electronic device can arrange the embedded representations of the feature representations of the M payment transaction data points of the target object according to the time order, either from far to near or from near to far, to obtain the second payment feature sequence of the target object. Then, the feature dimension F and the payment transaction data entry dimension M in the second payment feature sequence of the target object are interchanged to obtain the first payment feature sequence of the target object.

[0140] For example, suppose an electronic device combines the embedded representations of the feature representations of M payment transaction data points of a target object to obtain the second payment feature sequence of the target 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 for the target object), 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 target 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 target object form a 1 x 8 x 10 matrix. That is, the data dimension of the second payment feature sequence of the target object is 1 x 8 x 10, where `length = M = 8` and `features = 10`.

[0141] Next, the electronic device converts the data format of the second payment feature sequence of the target object 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 second payment feature sequence of the target object to obtain the first payment feature sequence of the target object. For instance, swapping the length and features (i.e., converting the data format of the second payment feature sequence from 1x8x10 to 1x10x8) yields the first payment feature sequence of the target object.

[0142] Based on the above steps, the electronic device can determine the first payment feature sequence of the target object and then execute the following step S103.

[0143] S103. 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 on the first payment feature sequence of the target object into K sequence blocks.

[0144] Where K is a positive integer greater than 1.

[0145] In this embodiment, the electronic device acquires a preset block length and block step size; using the block length as the size of the sliding window and the block step size as the sliding step size of the sliding window, it slides across the first payment feature sequence of the target object, dividing the target object's payment feature sequence into K sequence blocks. This division of the target object's first payment feature sequence into multiple fixed-size blocks maintains temporal continuity while capturing local temporal dependencies, thereby better understanding the information in the target object's first payment feature sequence and improving the accuracy of risk identification for the target object.

[0146] Specifically, the electronic device obtains the preset patch length `patch_size` and patch stride. Then, using the patch length `patch_size` as the size of the sliding window and the patch stride as the sliding step size, it slides across the first payment feature sequence of the target object, dividing the target object's payment feature sequence into K sequence blocks. At this point, the data format becomes [batch, newlength, newfeatures]. For example, the electronic device can calculate the new feature dimension `newfeatures` and sequence length dimension `newlength` using this formula, where... newfeatures=features*patch_size.

[0147] For example, such as Figure 5 As shown, the electronic device divides the first payment feature sequence of the target object into 6 sequence blocks according to the preset block length and block step size.

[0148] The above describes the specific process of dividing the first payment feature sequence of the target object into K sequence blocks, using the target object as an example. Next, the electronic device executes the following step S104.

[0149] S104. Perform payment risk identification processing on the K sequence blocks of the target object to obtain the risk prediction result of each payment transaction data in the M payment transaction data of the target object.

[0150] The embodiments of this application do not limit the specific method by which an electronic device performs payment risk identification processing on K sequence blocks of a target object to obtain the risk prediction result of each payment transaction data in M ​​payment transaction data of the target object.

[0151] In some embodiments, the electronic device uses a risk identification model to perform payment risk identification processing on K sequence blocks of the target object, and obtains the risk prediction result of each payment transaction data in M ​​payment transaction data of the target object.

[0152] The embodiments of this application do not limit the specific network structure of the risk identification model.

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

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

[0155] In the embodiments of this application, such as Figure 6 As shown, the electronic device inputs the K sequence blocks of the target object as 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 the M payment transaction data of the target object.

[0156] In some embodiments, such as Figure 7 As shown, the risk identification model in this 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:

[0157] S104-A: The K sequence blocks of the target object are embedded through the embedding layer to obtain the input embedding representation of the target object;

[0158] S104-B: The input embedding representation of the target object is processed by attention analysis through Q attention modules to obtain the attention feature information of the target object;

[0159] S104-C: By performing risk calculation on the attention feature information of the target object through the output layer, the risk prediction result of each payment transaction data in the M payment transaction data of the target object is obtained.

[0160] In this embodiment, the electronic device converts the numerical data of the first payment feature sequence of the target object into a high-dimensional feature vector that the model can understand through an embedding layer. Specifically, each of the K sequence blocks of the target object is mapped to a continuous vector space. These vectors can capture the local features and contextual information of the target object's payment transaction data. These vectors constitute the input embedding representation of the target object.

[0161] 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 the target object into the feature embedding layer for feature embedding processing to obtain the input embedding representation of the target object.

[0162] In some embodiments, such as Figure 8 As shown, the embedding layer in this embodiment includes a feature embedding layer and a position embedding layer. The electronic device can perform feature embedding processing on each of the K sequence blocks of the target 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 target 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 target 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 target 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 target 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, mapping each sequence block to a continuous vector space, which facilitates the capture of local features and contextual information of the target object's payment transaction data. This improves the accuracy of subsequent analysis and prediction based on the embedding representation information of the K sequence blocks of the target object.

[0163] Based on the above steps, after determining the input embedding representation of the target object, the electronic device performs attention analysis processing on the input embedding representation of the target object through Q attention modules to obtain the attention feature information of the target object.

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

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

[0166] In some embodiments, the network structure of the Q attention modules included in the risk identification model of this application is consistent. For example... Figure 9 As shown, 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. In this case, the above S104-B may include the following steps S104-B1 to S104-B3:

[0167] S104-B1: 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, attention analysis processing is performed on the input embedding representation corresponding to the target object to obtain the first attention feature information of the target object.

[0168] S104-B2: 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, attention analysis processing is performed on the first attention feature information of the target object to obtain the second attention feature information of the target object. This process is repeated sequentially to obtain the Qth attention feature information of the target object.

[0169] S104-B3. Based on the Qth attention feature information of the target object, obtain the attention feature information of the target object.

[0170] In this implementation, such as Figure 10 As shown, these Q attention modules are connected in series, with the input of the first attention module connected to the output of the model's embedding layer, and the output of the Qth attention module 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.

[0171] In this way, the electronic device can perform attention analysis processing on the input embedding representation corresponding to the target 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 target object. Specifically, the electronic device inputs the input embedding representation B corresponding to the target 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 and the attention feature information C are added together 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 and the feature information D element by element and then normalizes them to obtain normalized feature information G. The normalized feature information G is recorded as the first attention feature information of the target object. Next, the electronic device inputs the feature information G into the multi-head attention layer of the second attention module for processing, obtaining an 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 a feature information K. Feature information K is added element-wise to feature information I and then normalized to obtain feature information L, which is recorded as the second attention feature information of the target object. Feature information L is input into the third attention module, and so on, until the Qth attention feature information of the target object is finally obtained from the output of the Qth attention module.

[0172] Next, the electronic device obtains the target object's attention feature information based on the Qth attention feature information of the target object. For example, the Qth attention feature information of the target object is determined as the target object's attention feature information. Another example is to perform feature re-extraction or other processing on the Qth attention feature information of the target object to obtain the target object's attention feature information.

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

[0174] After the electronic device performs attention analysis processing on the input embedding representation of the target object through the aforementioned Q attention modules to obtain the attention feature information of the target object, it executes the steps of S104-C above, such as... Figure 11As shown, the risk prediction result of each payment transaction in the M payment transaction data of the target object is obtained by calculating the risk of the attention feature information of the target object through the output layer.

[0175] The embodiments of this application do not impose restrictions on the specific network structure of the output layer.

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

[0177] 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 target object to obtain the first feature information of the target object. This application does not limit the type of the activation function; optionally, the activation function is a GELU activation function. In one example, the electronic device can use this formula. Obtain the first feature information B of the target object. Where A represents the attention feature information of the target object, and B represents the first feature information of the target object. 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 attention feature information A of the target object, thus producing a non-monotonic feature information, denoted as the first feature information of the target object. Next, the first feature information of the target object is normalized to obtain the second feature information C of the target object. Finally, the second feature information C of the target object is subjected to risk classification processing to obtain the risk prediction result for each of the M payment transaction data of the target object. For example, the second feature information of the target object can be input into the Sigmoid function to implement a binary classification task, outputting the classification result of each of the M payment transaction data of the target object, thereby obtaining the risk prediction result for each of the M payment transaction data of the target object, such as obtaining the fraud risk probability of each of the M payment transaction data of the target object. For example, the second feature information of the target object can be input into this formula. We can obtain the risk prediction result for each of the M payment transaction data of the target object. Here, C represents the second characteristic information of the target object.

[0178] Through the above steps, electronic devices can determine the risk prediction result for each of the M payment transaction data of the target object.

[0179] In some embodiments, the electronic device can also determine the risk prediction result of the target 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 target 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 target object is determined to be a normal object, i.e., a non-fraud object.

[0180] In some embodiments, if the target object is determined to be a high-risk object, the relevant payment behavior of the target object can be intercepted in a timely manner to improve the security of mobile payment.

[0181] The risk identification method provided in this application embodiment encodes the features of each payment transaction in M ​​payment transaction data of a target object to obtain a first payment feature sequence of the target object. Then, a sliding window is slid across the first payment feature sequence with a preset block length and a preset block step size, dividing the first payment feature sequence of the target object into K sequence blocks. Payment risk identification processing is then performed on the K sequence blocks of the target object to obtain the risk prediction result for each payment transaction in the M payment transaction data of the target object. Therefore, in this application embodiment, by encoding the features of multiple payment transaction data of the target object, a first payment feature sequence of the target object is obtained. This first payment feature sequence can reflect the payment behavior of the target object. Then, dividing this first payment feature sequence into multiple sequence blocks allows for the capture of both local and global payment features of the target object, thereby achieving accurate identification of payment transaction data risks.

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

[0183] Figure 12 This is a flowchart illustrating a training method for a risk identification model provided in one embodiment of this application. The execution entity 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 may be... Figure 1 The server in, or for Figure 1 Terminal devices in, or for Figure 1 The system consists of a server and terminal devices. For ease of description, this application uses an electronic device as an example for illustration.

[0184] like Figure 12As shown, the training process of the risk identification model in this application embodiment includes:

[0185] S201. Obtain M payment transaction data for each of the N objects.

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

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

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

[0189] In some embodiments, for each of the N objects, if the number of payment transaction data for that object in the 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 MB payment transaction data are filled with data.

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

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

[0192] The payment transaction data in this application embodiment includes information such as transaction records, payment methods, and payment times.

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

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

[0195] S202. For the i-th object among N objects, perform feature encoding on each of the M payment transaction data of the i-th object to obtain the first payment feature sequence of the i-th object.

[0196] Where i is a positive integer less than or equal to N.

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

[0198] The following describes the specific process of determining the first payment feature sequence for each of the N objects.

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

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

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

[0202] 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:

[0203] S202-A: For the j-th payment transaction data in the M payment transaction data of the i-th object, based on the preset payment information type, select P payment information belonging to the payment information type 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;

[0204] S202-B, Perform feature encoding on each of the P payment information pieces to obtain the encoding information of each feature in the P payment information pieces;

[0205] S202-C, Perform feature fusion on the encoded information of P payment information to obtain the feature representation information of the j-th payment transaction data;

[0206] S202-D: Based on the feature representation information of each payment data in the M payment transaction data of the i-th object, perform data transformation processing to determine the first payment feature sequence of the i-th object.

[0207] In this implementation, for each of the M payment transaction data of the i-th 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.

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

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

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

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

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

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

[0214] 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:

[0215] S202-D1. Embed the feature representation information of the M payment transaction data of the i-th object respectively to obtain the embedded representation of the feature representation information of each payment data in the M payment transaction data;

[0216] S202-D2: 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.

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

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

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

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

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

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

[0223] The specific implementation process of S202 can be referred to the relevant description of S102 above, and will not be repeated here.

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

[0225] S203. 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.

[0226] The specific implementation process of S203 can be referred to the relevant description of S103 above, and will not be repeated here.

[0227] The electronic device can refer to the above embodiments to determine K sequence blocks for each of the N objects.

[0228] S204. Using a risk identification model, perform payment risk identification processing 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.

[0229] This application does not limit the specific type and network structure of the initial model of the risk identification model.

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

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

[0232] In the embodiments of this application, such as Figure 6 As shown, 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.

[0233] In some embodiments, such as Figure 7 As shown, the risk identification model in this 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:

[0234] S204-A: By embedding each of the K sequence blocks of the i-th object through the embedding layer, the input embedding representation of the i-th object is obtained;

[0235] S204-B: Perform attention analysis on the input embedding representation of the i-th object using Q attention modules to obtain the attention feature information of the i-th object;

[0236] S204-C: By performing risk calculation on the attention feature information of the i-th object through the output layer, the risk prediction result of each payment transaction data in the M payment transaction data of the i-th object is obtained.

[0237] In some embodiments, such as Figure 8 As shown, the embedding layer in this embodiment includes a feature embedding layer and a position embedding layer. 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, mapping each sequence block to a continuous vector space, which facilitates capturing the 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.

[0238] In some embodiments, the network structure of the Q attention modules included in the pre-trained risk identification model of this application is consistent. For example... Figure 9 As shown, 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. In this case, the above S204-B may include the following steps S204-B1 to S204-B3:

[0239] S204-B1. 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, 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.

[0240] S204-B2: 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, attention analysis processing is performed on the first attention feature information of the i-th object to obtain the second attention feature information of the i-th object. This process is repeated sequentially to obtain the Q-th attention feature information of the i-th object.

[0241] S204-B3. Based on the Qth attention feature information of the i-th object, obtain the attention feature information of the i-th object.

[0242] In this implementation, such as Figure 10 As shown, these Q attention modules are connected in series, with the input of the first attention module connected to the output of the model's embedding layer, and the output of the Qth attention module 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 it 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. Feed Forward performs a further non-linear transformation on the output of the self-attention layer.

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

[0244] The embodiments of this application do not impose restrictions on the specific network structure of the output layer.

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

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

[0247] The specific implementation process of S204 can be referred to the relevant description of S104 above, and will not be repeated here.

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

[0249] S205. Based on the risk prediction results of each payment transaction data in the M payment transaction data included in each of the N objects, determine the model loss of the risk identification model, and adjust the parameters in the risk identification model based on the model loss to obtain the trained risk identification model.

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

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

[0252] 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 for each of the N objects. For example, for each payment transaction data, the loss corresponding to that payment transaction data is determined based on its tag information and risk prediction results. Then, the losses corresponding to the M payment transaction data for each of the N objects are summed to obtain the model loss.

[0253] Next, it is determined whether the model loss reaches the preset loss. If it does, model fine-tuning is stopped, and the parameters of the current model are fixed to obtain the target risk prediction model. If the model loss does not reach the preset loss, the parameters of the risk prediction model are adjusted based on the model loss.

[0254] In some embodiments, if the initial model of the risk identification model is a pre-trained risk identification model, then some parameters in the pre-trained risk identification model are adjusted based on the model loss calculated above. This application embodiment does not limit the specific parameters to be adjusted.

[0255] In some embodiments, during parameter tuning, only the parameters included in the normalization layer and the location encoding layer of the pre-trained risk prediction model are adjusted. For example, as shown... Figure 9 As shown, the grayscale boxes in the image are adjusted, while the self-attention mechanism layer and the feedforward neural network layer are frozen. The purpose of this is to retain most of the knowledge learned by the model during the pre-training phase during parameter tuning, 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.

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

[0257] 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, feature encoding is performed on each of the M payment transaction data for the i-th object to obtain the first payment feature sequence of the i-th object; a sliding window is opened with a preset block length and a preset block step size, dividing the first payment feature sequence of the i-th object into K sequence blocks. Then, the risk identification model performs payment risk identification processing 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 the parameters in the risk identification model are adjusted based on the model loss to obtain the trained risk identification model. As described above, during model training, feature encoding 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 reflects 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 multiple sequence blocks of 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 risk identification 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.

[0258] The above section introduced risk identification methods and the training methods for risk identification models. The following section will combine... Figure 13 The risk identification method of this application embodiment is described in general when using a risk identification model for risk identification.

[0259] Figure 13 This is a schematic flowchart of a risk identification method provided in an embodiment of this application.

[0260] like Figure 13 As shown, the risk identification method in this application includes the following steps:

[0261] S301. Obtain M payment transaction data for each of the N objects.

[0262] The specific implementation process of S301 can be referred to the relevant description of S201 above, and will not be repeated here.

[0263] S302. For the i-th object among N objects, perform feature encoding on each of the M payment transaction data of the i-th object to obtain the first payment feature sequence of the i-th object.

[0264] The specific implementation process of S302 can be referred to the relevant description of S202 above, and will not be repeated here.

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

[0266] The specific implementation process of S303 can be referred to the relevant description of S203 above, and will not be repeated here.

[0267] S304. Using a risk identification model, perform payment risk identification processing 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.

[0268] The specific implementation process of S304 can be referred to the relevant description of S204 above, and will not be repeated here.

[0269] S305. Based on the risk prediction results of each payment transaction data in the M payment transaction data included in each of the N objects, determine the model loss of the risk identification model, and adjust the parameters in the risk identification model based on the model loss to obtain the trained risk identification model.

[0270] The specific implementation process of S305 can be referred to the relevant description of S205 above, and will not be repeated here.

[0271] The above S310 to S305 describe the training process of the risk identification model.

[0272] S306. Obtain M payment transaction data for the target object.

[0273] The specific implementation process of S306 can be referred to the relevant description of S101 above, and will not be repeated here.

[0274] S307. Encode the features of each of the M payment transaction data of the target object to obtain the first payment feature sequence of the target object.

[0275] The specific implementation process of S307 can be referred to the relevant description of S102 above, and will not be repeated here.

[0276] S308. 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 target object into K sequence blocks.

[0277] The specific implementation process of S308 can be referred to the relevant description of S103 above, and will not be repeated here.

[0278] S309. Using the trained risk identification model, perform payment risk identification processing on K sequence blocks of the target object to obtain the risk prediction result of each payment transaction data in M ​​payment transaction data of the target object.

[0279] The specific implementation process of S309 can be referred to the relevant description of S104 above, and will not be repeated here.

[0280] The above S306 to S309 describe the process of risk identification using the trained risk identification model.

[0281] 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 a target object, obtaining a risk prediction result for each of the M payment transaction data of the target object. Based on the risk prediction results of each of the M payment transaction data of the target object, the payment risk of the target object can be accurately predicted, thereby improving the security of social payments.

[0282] The above text combined Figures 2 to 12 The present application describes in detail embodiments of risk identification model training and risk identification methods. The following section combines... Figure 14 The following describes in detail the device embodiments of this application.

[0283] Figure 14 This is a schematic block diagram of a risk identification device provided in an embodiment of this application.

[0284] like Figure 14 As shown, the risk identification device 10 includes:

[0285] Acquisition unit 11 is used to acquire M payment transaction data of the target object, where M is a positive integer;

[0286] Feature encoding unit 12 is used to perform feature encoding on each of the M payment transaction data of the target object to obtain the first payment feature sequence of the target object;

[0287] The block division unit 13 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, and divide the first payment feature sequence of the target object into K sequence blocks, where K is a positive integer greater than 1.

[0288] The risk identification unit 14 is used to perform payment risk identification processing on K sequence blocks of the target object to obtain the risk prediction result of each payment transaction data in the M payment transaction data.

[0289] 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 of the target object, 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 of the target object to determine the first payment feature sequence of the target object.

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

[0291] In some embodiments, the feature encoding unit 12 is specifically used to embed the feature representation information of the M payment transaction data of the target object respectively 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 of the target object to obtain the first payment feature sequence of the target object.

[0292] In some embodiments, the feature encoding unit 12 is specifically used to combine the embedded representation of the feature representation information of the M payment transaction data of the target object to obtain the second payment feature sequence of the target object; and to interchange the feature dimension and the payment transaction data entry dimension M in the second payment feature sequence of the target object to obtain the first payment feature sequence of the target object.

[0293] In some embodiments, the risk identification unit 14 is specifically used to perform payment risk identification processing on K sequence blocks of the target object through a risk identification model, so as to obtain the risk prediction result of each payment transaction data in the M payment transaction data.

[0294] 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 of the target object through the embedding layer to obtain the input embedding representation of the target object; to perform attention analysis processing on the input embedding representation of the target object through the Q attention modules to obtain the attention feature information of the target object; and to perform risk calculation on the attention feature information of the target object through the output layer to obtain the risk prediction result of each of the M payment transaction data of the target object.

[0295] 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 of the target 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 target 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 target object.

[0296] 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 corresponding to the target 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 of the Q attention modules, to obtain the first attention feature information of the target object; to perform attention analysis processing on the first attention feature information of the target 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 of the Q attention modules, to obtain the second attention feature information of the target object, and so on, sequentially to obtain the Qth attention feature information of the target object; and to obtain the attention feature information of the target object based on the Qth attention feature information of the target object.

[0297] 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 of the target object through the activation function to obtain the first feature information of the target object; to perform normalization processing on the first feature information of the target object to obtain the second feature information of the target object; and to perform risk classification processing on the second feature information of the target object to obtain the risk prediction result of each payment transaction data in the M payment transaction data of the target object.

[0298] 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, further details will not be provided here. Specifically, Figure 14 The apparatus shown can perform the above-described risk identification method embodiments, and the foregoing and other operations and / or functions of each module in the apparatus are respectively for implementing the method embodiments corresponding to the electronic device. For the sake of brevity, they will not be described in detail here.

[0299] Figure 15 This is a schematic block diagram of a model training device provided in an embodiment of this application.

[0300] like Figure 15 As shown, the model training device 20 is applied to a terminal device and includes:

[0301] Acquisition unit 21 is used to acquire M payment transaction data for each of N objects, where N and M are both positive integers;

[0302] The feature encoding unit 22 is used to perform feature encoding on each of the M payment transaction data of the i-th object among the N objects to obtain the first payment feature sequence of the i-th object, where i is a positive integer less than or equal to N;

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

[0304] 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;

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

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

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

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

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

[0310] 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, further details will not be provided here. Specifically, Figure 15 The apparatus shown can execute the embodiments of the above-described model training method, and the foregoing and other operations and / or functions of each module in the apparatus are respectively for implementing the method embodiments corresponding to the electronic device, which will not be described in detail here for the sake of brevity.

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

[0312] Figure 16 This is a schematic block diagram of the electronic device provided in the embodiments of this application. Figure 15 The electronic device can be a terminal device or a server, and can be used to execute the above method embodiments.

[0313] like Figure 16 As shown, the electronic device 30 may include:

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

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

[0316] In some embodiments of this application, the processor 32 may include, but is not limited to:

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

[0318] In some embodiments of this application, the memory 31 includes, but is not limited to:

[0319] 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 Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).

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

[0321] like Figure 16 As shown, the electronic device 30 may further include:

[0322] Transceiver 34, which can be connected to processor 32 or memory 31.

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

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

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

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

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

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

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

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

[0331] 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

1. A risk identification method, characterized in that, include: Obtain M payment transaction data entries for the target object, where M is a positive integer; Each payment transaction in the M payment transaction data of the target object is feature-encoded to obtain the first payment feature sequence of the target object; 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, where K is a positive integer greater than 1. The payment risk identification process is performed on K sequence blocks of the target object to obtain the risk prediction result of each payment transaction data in the M payment transaction data.

2. The method according to claim 1, characterized in that, The step of feature encoding each payment transaction in the M payment transaction data of the target object to obtain the first payment feature sequence of the target object includes: For the j-th payment transaction data in the M payment transaction data of the target object, 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; The encoded information of the P payment information is fused to obtain the feature representation information of the j-th payment transaction data; Based on the feature representation information of each payment data in the M payment transaction data of the target object, data format conversion processing is performed to determine the first payment feature sequence of the target object.

3. 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.

4. The method according to claim 2 or 3, characterized in that, The process of converting the data format of each payment data point in the M payment transaction data of the target object to determine the first payment feature sequence of the target object includes: The feature representation information of the M payment transaction data of the target object is embedded to obtain the embedded representation of the feature representation information of each payment data in the M payment transaction data; The embedding representation of the feature representation information of the M payment transaction data of the target object is processed by data format conversion to obtain the first payment feature sequence of the target object.

5. The method according to claim 4, characterized in that, The embedding representation of the feature representation information of the M payment transaction data of the target object is subjected to data format conversion processing to obtain the first payment feature sequence of the target object, including: By combining the embedded representations of the feature representation information of the M payment transaction data of the target object, a second payment feature sequence of the target object is obtained; The feature dimension and the payment transaction data entry dimension M in the second payment feature sequence of the target object are interchanged to obtain the first payment feature sequence of the target object.

6. The method according to any one of claims 1-5, characterized in that, The process of performing payment risk identification on K sequence blocks of the target object 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 K sequence blocks of the target object to obtain the risk prediction result for each of the M payment transaction data.

7. The method according to claim 6, 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 K sequence blocks of the target object to obtain the risk prediction result for each of the M payment transaction data points of the target object, including: The embedding layer is used to embed each of the K sequence blocks to obtain the input embedding representation of the target object. The input embedding representation of the target object is subjected to attention analysis processing through the Q attention modules to obtain the attention feature information of the target object; The output layer performs risk calculations on the attention feature information of the target object to obtain the risk prediction result for each of the M payment transaction data of the target object.

8. The method according to claim 7, 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 target object to obtain the input embedding representation of the target object, including: The feature embedding layer performs feature embedding processing on each of the K sequence blocks of the target 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 target 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 target object.

9. The method according to claim 8, 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 target object through the Q attention modules to obtain the attention feature information of the target object includes: The first attention module among 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 target object to obtain the first attention feature information of the target object. The second 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 first attention feature information of the target object to obtain the second attention feature information of the target object. This process is repeated sequentially to obtain the Qth attention feature information of the target object. Based on the Qth attention feature information of the target object, the attention feature information of the target object is obtained.

10. The method according to any one of claims 7-9, characterized in that, The output layer includes an activation function. The risk prediction result for each of the M payment transaction data points of the target object is obtained by performing risk calculation on the attention feature information of the target object through the output layer, including: The first feature information of the target object is obtained by non-linearly mapping the attention feature information of the target object through the activation function; The first feature information of the target object is normalized to obtain the second feature information of the target object; The second feature information of the target object is processed for risk classification to obtain the risk prediction result of each of the M payment transaction data of the target object.

11. A training method for 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 first payment feature sequence of the i-th object, where i is a positive integer less than or equal to N; 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, 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.

12. The method according to claim 11, 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 processed 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.

13. The method according to claim 12, 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.

14. The method according to claim 13, 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.

15. The method according to claim 14, 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.

16. A risk identification device, characterized in that, include: The acquisition unit is used to acquire M payment transaction data of the target object, where M is a positive integer; The feature encoding unit is used to encode the features of each of the M payment transaction data of the target object to obtain the first payment feature sequence of the target object; 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, dividing 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 the target object to obtain the risk prediction result of each payment transaction data in the M payment transaction data.

17. 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, so as to obtain the first payment feature sequence of the i-th object, where i is a positive integer less than or equal to N; 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, dividing 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.

18. 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 10 or 11 to 15.

19. 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 10 or 11 to 15.