CN-121998642-A - Risk identification method, apparatus, device and storage medium
Abstract
The application provides a risk identification method, a device, equipment and a storage medium, which can be applied to the technical fields of mobile payment, risk identification and the like and comprise the steps of obtaining M payment transaction data of a target object; the method comprises the steps of carrying out feature coding on each piece of payment transaction data in M pieces of payment transaction data to obtain a first payment feature sequence of a target object, dividing the first payment feature sequence of the target object into K sequence blocks, and carrying out 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. The first payment characteristic sequence of the target object is divided into a plurality of sequence blocks, so that the model can accurately capture the local payment characteristic data of the target object, and further, the payment risk can be accurately identified.
Inventors
- ZHANG HAO
Assignees
- 腾讯科技(深圳)有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20241104
Claims (19)
- 1.A risk identification method, comprising: Obtaining M payment transaction data of a target object, wherein M is a positive integer; Performing feature coding on each piece of payment transaction data in M pieces of payment transaction data of the target object to obtain a first payment feature sequence of the target object; Sliding on the first payment feature sequence by taking a preset block length as the size of a sliding window and taking a preset block step length as the sliding step length of the sliding window, dividing the first payment feature sequence into K sequence blocks, wherein K is a positive integer greater than 1; And carrying out 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.
- 2. The method of claim 1, wherein the feature encoding each of the M pieces of payment transaction data for the target object to obtain a first payment feature sequence for the target object comprises: for the j-th payment transaction data in the M payment transaction data of the target object, selecting P pieces of payment information belonging to the payment information type from the j-th payment transaction data based on a preset payment information type, wherein P is a positive integer, and j is a positive integer smaller than or equal to M; respectively carrying out feature coding on the P payment information to obtain coding information of each payment information in the P payment information; feature fusion is carried out on the coding information of the P payment information, and feature representation information of the j payment transaction data is obtained; And carrying out data format conversion processing based on the characteristic representation information of each piece of payment data in the M pieces of payment transaction data of the target object, and determining a first payment characteristic sequence of the target object.
- 3. The method according to claim 2, wherein the feature fusion of the encoded information of the P payment messages to obtain feature representation information of the j-th payment transaction data includes: And performing characteristic splicing on the coding information of the P payment information to obtain characteristic representation information of the j payment transaction data.
- 4. A method according to claim 2 or 3, wherein the determining the first payment feature sequence of the target object based on the data format conversion processing of the feature representation information of each of the M pieces of payment transaction data of the target object comprises: Respectively carrying out embedding processing on the characteristic representation information of the M pieces of payment transaction data of the target object to obtain embedded representation of the characteristic representation information of each piece of payment data in the M pieces of payment transaction data; And carrying out data format conversion processing on the embedded representation of the characteristic representation information of the M pieces of payment transaction data of the target object to obtain a first payment characteristic sequence of the target object.
- 5. The method according to claim 4, wherein the performing data format conversion processing on the embedded representation of the feature representation information of the M pieces of payment transaction data of the target object to obtain the first payment feature sequence of the target object includes: Combining the embedded representation of the characteristic representation information of the M pieces of payment transaction data of the target object to obtain a second payment characteristic sequence of the target object; And exchanging the feature dimension in the second payment feature sequence of the target object with the payment transaction data entry dimension M to obtain a first payment feature sequence of the target object.
- 6. The method according to any one of claims 1-5, wherein performing a payment risk identification process 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 includes: and carrying out payment risk identification processing on the K sequence blocks of the target object through a risk identification model to obtain a risk prediction result of each piece of payment transaction data in the M pieces of payment transaction data.
- 7. The method according to claim 6, wherein the risk recognition model includes an embedding layer, Q attention modules and an output layer, Q is a positive integer, and the performing, by the risk recognition model, a payment risk recognition process on K sequence blocks of the target object to obtain a risk prediction result of each of M payment transaction data of the target object includes: Embedding each sequence block in the K sequence blocks through the embedding layer to obtain an input embedded representation of the target object; performing attention analysis processing on the input embedded representation of the target object through the Q attention modules to obtain attention characteristic information of the target object; and performing risk calculation on the attention characteristic information of the target object through the output layer 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.
- 8. The method of claim 7, wherein the embedding layers include a feature embedding layer and a position embedding layer, the embedding processing, by the embedding layer, each of the K sequence blocks of the target object to obtain the input embedded representation of the target object, comprising: performing feature embedding processing on each of K sequence blocks of the target object through the feature embedding layer to obtain feature embedded representations of the K sequence blocks; Performing position embedding processing on each of K sequence blocks of the target object through the position embedding layer to obtain position embedding representations of the K sequence blocks; and carrying out information fusion on the characteristic embedded representation and the position embedded representation of the K sequence blocks to obtain the input embedded representation of the target object.
- 9. The method of claim 8, wherein each of the Q attention modules includes a multi-headed attention layer, a first residual connection and normalization layer, a feed forward network layer, and a second residual connection and normalization layer, wherein the performing, by the Q attention modules, an attention analysis process on the input embedded representation of the target object to obtain attention characteristic information of the target object includes: Performing attention analysis processing on the input embedded representation corresponding to the target object through a multi-head attention layer, a first residual error connection and normalization layer, a feedforward network layer and a second residual error connection and normalization layer which are included in a first attention module in the Q attention modules, so as to obtain first attention characteristic information of the target object; Performing attention analysis processing on the first attention characteristic information of the target object through a multi-head attention layer, a first residual error connection and normalization layer, a feedforward network layer and a second residual error connection and normalization layer which are included in a second attention module in the Q attention modules to obtain second attention characteristic information of the target object, and sequentially executing in sequence to obtain Q attention characteristic information of the target object; And obtaining the attention characteristic information of the target object based on the Q-th attention characteristic information of the target object.
- 10. The method according to any one of claims 7-9, wherein the output layer includes an activation function, and the risk calculation is performed on the attention characteristic information of the target object by the output layer 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, including: Nonlinear mapping is carried out on the attention characteristic information of the target object through the activation function, so that first characteristic information of the target object is obtained; normalizing the first characteristic information of the target object to obtain second characteristic information of the target object; and performing risk classification processing on the second characteristic information 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.
- 11. A method for training a risk identification model, comprising: Acquiring M payment transaction data of each object in N objects, wherein N and M are positive integers; for an ith object in the N objects, performing feature coding on each piece of payment transaction data in M pieces of payment transaction data of the ith object to obtain a first payment feature sequence of the ith object, wherein i is a positive integer less than or equal to N; Sliding on the first payment feature sequence by taking a preset block length as the size of a sliding window and taking a preset block step length as the sliding step length of the sliding window, dividing the first payment feature sequence into K sequence blocks, wherein K is a positive integer greater than 1; Carrying out payment risk identification processing on K sequence blocks of each of the N objects through a risk identification model to obtain a risk prediction result of each piece of payment transaction data of the N objects; And determining model loss of the risk identification model based on a risk prediction result of each piece of payment transaction data of the N objects, and adjusting parameters in the risk identification model based on the model loss to obtain a trained risk identification model.
- 12. The method according to claim 11, wherein the risk recognition model includes an embedding layer, Q attention modules, and an output layer, Q is a positive integer, and the performing, by the pre-trained risk recognition model, a payment risk recognition process on K sequence blocks of each of the N objects to obtain a risk prediction result of each piece of payment transaction data of the N objects includes: For an ith object in the N objects, embedding each sequence block in K sequence blocks of the ith object through the embedding layer to obtain an input embedded representation of the ith object; performing attention analysis processing on the input embedded representation of the ith object through the Q attention modules to obtain attention characteristic information of the ith object; And performing risk calculation on the attention characteristic information of the ith object through the output layer to obtain a risk prediction result of each piece of payment transaction data in the M pieces of payment transaction data of the ith object.
- 13. The method according to claim 12, wherein the embedding layers include a feature embedding layer and a position embedding layer, the embedding processing, by the embedding layer, each of the K sequence blocks of the i-th object to obtain an input embedded representation of the i-th object, including: Performing feature embedding processing on each of the K sequence blocks of the ith object through the feature embedding layer to obtain feature embedded representations of the K sequence blocks; Performing position embedding processing on each sequence block in the K sequence blocks of the ith object through the position embedding layer to obtain position embedding representation of the K sequence blocks; and carrying out information fusion on the characteristic embedded representation and the position embedded representation of the K sequence blocks to obtain the input embedded representation of the ith object.
- 14. The method of claim 13, wherein each of the Q attention modules includes a multi-headed attention layer, a first residual connection and normalization layer, a feed forward network layer, and a second residual connection and normalization layer, wherein the performing, by the Q attention modules, an attention analysis process on the input embedded representation of the i-th object to obtain attention characteristic information of the i-th object includes: Performing attention analysis processing on the input embedded representation corresponding to the ith object through a multi-head attention layer, a first residual error connection and normalization layer, a feedforward network layer and a second residual error connection and normalization layer which are included in a first attention module in the Q attention modules, so as to obtain first attention characteristic information of the ith object; Performing attention analysis processing on the first attention characteristic information of the ith object through a multi-head attention layer, a first residual error connection and normalization layer, a feedforward network layer and a second residual error connection and normalization layer which are included in a second attention module in the Q attention modules to obtain second attention characteristic information of the ith object, and sequentially executing in turn to obtain Q attention characteristic information of the ith object; And obtaining the attention characteristic information of the ith object based on the Q attention characteristic information of the ith object.
- 15. The method of claim 14, wherein adjusting a portion of the parameters in the risk identification model based on the model loss results in a trained risk identification model, comprising: And adjusting parameters included by a position embedding layer and a normalization layer in the risk identification model based on the model loss to obtain the risk identification model.
- 16. A risk identification device, comprising: the acquisition unit is used for acquiring M payment transaction data of a target object, wherein M is a positive integer; The feature encoding unit is used for performing feature encoding on each piece of payment transaction data in the M pieces of payment transaction data of the target object to obtain a first payment feature sequence of the target object; The block dividing unit is used for dividing the first payment characteristic sequence into K sequence blocks by taking a preset block length as the size of a sliding window and taking a preset block step length as the sliding step length of the sliding window, wherein K is a positive integer greater than 1; And the risk identification unit is used for carrying out 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.
- 17. A training device for a risk identification model, comprising: the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring M pieces of payment transaction data of each object in N objects, and N and M are positive integers; The characteristic coding unit is used for carrying out characteristic coding on each piece of payment transaction data in M pieces of payment transaction data of the ith object for the ith object in the N objects to obtain a first payment characteristic sequence of the ith object, wherein i is a positive integer less than or equal to N; The block dividing unit is used for dividing the first payment characteristic sequence into K sequence blocks by taking a preset block length as the size of a sliding window and taking a preset block step length as the sliding step length of the sliding window, wherein K is a positive integer greater than 1; the risk identification unit is used for carrying out payment risk identification processing on the K sequence blocks of each of the N objects through a risk identification model to obtain a risk prediction result of each piece of payment transaction data of the N objects; the training unit is used for determining the model loss of the risk identification model based on the risk prediction result of each piece of payment transaction data of the N objects, and adjusting parameters in the risk identification model based on the model loss to obtain a trained risk identification model.
- 18. An electronic device includes a processor and a memory; The memory is used for storing a computer program; the processor for executing the computer program to implement the method of any of the preceding claims 1 to 10 or 11 to 15.
- 19. A computer-readable storage medium storing a computer program; the computer program causes a computer to perform the method of any of the preceding claims 1 to 10 or 11 to 15.
Description
Risk identification method, apparatus, device and storage medium Technical Field The embodiment of the application relates to the technical field of computers, in particular to a risk identification method, a risk identification device, risk identification equipment and a storage medium. Background The mobile payment service allows the object to pay and transfer accounts through the application program, is convenient to use and is widely popularized and applied. But with the development and popularity of mobile payment technology, some illegal actions (e.g., fraud) are implemented through mobile payment. Therefore, in a mobile payment scenario, how to judge an abnormal payment (e.g., a fraudulent payment) is important. In the mobile payment scene at present, a risk identification rule is usually formulated based on historical fraud cases and business logic, and then the risk identification rule is used for risk identification. However, the risk identification method based on the risk identification rule is easily bypassed by the black product, and cannot effectively distinguish normal transaction from fraudulent conduct, so that the risk identification is inaccurate. Disclosure of Invention The application provides a risk identification method, a risk identification device and a risk identification storage medium, which can improve the accuracy of payment risk identification, further can intercept illegal payment behaviors in time and improve the safety of mobile payment. In a first aspect, the present application provides a risk identification method, including: Obtaining M payment transaction data of a target object, wherein M is a positive integer; Performing feature coding on each piece of payment transaction data in M pieces of payment transaction data of the target object to obtain a first payment feature sequence of the target object; Sliding on the first payment feature sequence by taking a preset block length as the size of a sliding window and taking a preset block step length as the sliding step length of the sliding window, and dividing the first payment feature sequence of the target object into K sequence blocks, wherein K is a positive integer greater than 1; And carrying out 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. In a second aspect, the present application provides a training method of a risk identification model, including: Acquiring M payment transaction data of each object in N objects, wherein N and M are positive integers; for an ith object in the N objects, performing feature coding on each piece of payment transaction data in M pieces of payment transaction data of the ith object to obtain a first payment feature sequence of the ith object, wherein i is a positive integer less than or equal to N; Sliding on the first payment feature sequence by taking a preset block length as the size of a sliding window and taking a preset block step length as the sliding step length of the sliding window, dividing the first payment feature sequence of the ith object into K sequence blocks, wherein K is a positive integer greater than 1; Carrying out payment risk identification processing on K sequence blocks of each of the N objects through a risk identification model to obtain a risk prediction result of each piece of payment transaction data of the N objects; And determining model loss of the risk identification model based on a risk prediction result of each piece of payment transaction data of the N objects, and adjusting parameters in the risk identification model based on the model loss to obtain the risk identification model. In a third aspect, the present application provides a risk identification device, comprising: the acquisition unit is used for acquiring M payment transaction data of a target object, wherein M is a positive integer; The feature encoding unit is used for performing feature encoding on each piece of payment transaction data in the M pieces of payment transaction data of the target object to obtain a first payment feature sequence of the target object; The block dividing unit is used for dividing the first payment characteristic sequence of the target object into K sequence blocks by taking the preset block length as the size of a sliding window and taking the preset block step length as the sliding step length of the sliding window, wherein K is a positive integer greater than 1; And the risk identification unit is used for carrying out 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. In some embodiments, the feature encoding unit is specifically configured to select P pieces of payment information belonging to the payment information type from the j t