Model training method, anomaly judgment method, equipment, medium and program product

By constructing a context information sequence that includes user, merchant and transaction association relationships, and training a credit card abnormal transaction judgment model, the judgment deviation problem caused by the single feature information type in the prior art is solved, and the accuracy and efficiency of the judgment are improved.

CN119807741APending Publication Date: 2025-04-11INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411862412.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

In the prior art, when only user's characteristic information is considered, the model input feature information type of credit card abnormal transaction judgment is relatively single, resulting in deviations in the output results, and abnormal transactions cannot be accurately discovered, which reduces efficiency and accuracy.

Method used

By obtaining user information, merchant information and transaction information in training transactions, and building a context information sequence, including the relationship between users and merchants, users and transactions, and merchants and transactions, it is used to train an exception determination model.

Benefits of technology

By adding data feature information of the input model, the training data type of the model is more comprehensive, avoiding output result deviations, and improving the accuracy and efficiency of abnormal transaction judgments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119807741A_ABST
    Figure CN119807741A_ABST
Patent Text Reader

Abstract

The invention discloses a model training method, an anomaly judgment method, equipment, a medium and a program product, relates to the technical field of big data, and can be applied to the field of financial science and technology. The model training method comprises the steps of obtaining user information of a transaction user, merchant information of a transaction merchant and transaction information between the transaction user and the transaction merchant in a training transaction; for each training transaction, constructing a context information sequence according to the user information, the merchant information, the transaction information, the corresponding relationship between the user information and the transaction information and the corresponding relationship between the merchant information and the transaction information; and inputting each context information sequence into a to-be-trained model, and training the to-be-trained model to obtain an anomaly judgment model. According to the model training method, the association relationship can be established among the user information, the merchant information and the transaction information, the feature information of the data input into the model is increased, the accuracy of a model output result is improved, and the security of the transaction is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of big data technology and can be applied to the field of financial technology, and in particular to a model training method, anomaly determination method, equipment, medium and program product. Background Art

[0002] With the gradual improvement of people's consumption level and the continuous change of consumption concepts in today's society, credit card payment, as a payment method, has been used more and more frequently in everyone's life. However, the function of credit card payment allows users to consume in advance, which poses certain financial risks to financial institutions as card issuers. For example, abnormal transactions such as cash withdrawal and fraudulent use occur when using credit cards. Therefore, it is necessary to identify abnormal transactions during the use of credit cards.

[0003] At present, the determination of abnormal transactions mainly involves first obtaining the user feature information of some users who use credit cards to make transactions, and then taking whether there is an abnormality in the transaction process as a sample label, and inputting it together with the user feature information into the machine learning algorithm model to train the model, and obtain a model that can determine abnormal transactions. Finally, using the trained model, the determination of abnormal credit card transactions is completed based on the user's feature information.

[0004] However, in the above abnormal transaction determination method, only the characteristic information of the user can be used to determine the abnormal credit card transaction. In abnormal transactions, the user is only one of the reasons leading to abnormal credit card transactions. Therefore, when only the characteristic information of the user is considered, the type of input characteristic information of the model that can determine abnormal transactions will be relatively single, resulting in deviations in the output results of the model, making it impossible to accurately detect abnormal transactions, and reducing the efficiency and accuracy of abnormal transaction determination. Summary of the invention

[0005] The present application provides a model training method, anomaly determination method, device, medium and program product to solve the problem in the prior art that when only the characteristic information of the user is considered, the type of input characteristic information of the model capable of determining abnormal transactions is relatively single, resulting in deviation in the output result of the model, making it impossible to accurately detect abnormal transactions, and reducing the efficiency and accuracy of abnormal transaction determination.

[0006] In a first aspect, the present application provides a model training method, the method comprising:

[0007] Obtaining user information of a transaction user in a training transaction, merchant information of a transaction merchant, and transaction information between the transaction user and the transaction merchant; wherein there are multiple training transactions, and there is a corresponding relationship between the transaction user, the transaction merchant, and the transaction information in each training transaction;

[0008] For each of the training transactions, a context information sequence is constructed according to the user information, the merchant information, the transaction information, the corresponding relationship between the user information and the transaction information, and the corresponding relationship between the merchant information and the transaction information; wherein the context information sequence is a vector sequence capable of indicating the transaction user, the transaction merchant, the transaction information, the association relationship between the transaction user and the transaction information, and the association relationship between the transaction merchant and the transaction information;

[0009] The context information sequence corresponding to each of the multiple training transactions is input into the model to be trained, and the model to be trained is trained to obtain an abnormality determination model; wherein the abnormality determination model is used to output an abnormality determination result corresponding to the target transaction according to the target context information corresponding to the target transaction, and the abnormality determination result is used to indicate whether the target transaction is an abnormal transaction.

[0010] In a second aspect, the present application also provides an abnormality determination method, the method comprising:

[0011] Acquire target transaction user information of a target transaction user in a target transaction, target transaction merchant information of a target transaction merchant, and target transaction information between the target transaction user and the target transaction merchant;

[0012] Constructing a target context information sequence according to the target transaction user information, the target transaction merchant information, the target transaction information, the correspondence between the target transaction user information and the target transaction information, and the correspondence between the target transaction merchant information and the target transaction information; wherein the target context information sequence has the same sequence attribute as the context information sequence described in the model training method described in the first aspect of the present application;

[0013] The target context information sequence corresponding to the target transaction is input into the abnormality judgment model to obtain the abnormality judgment result corresponding to the target transaction output by the abnormality judgment model; wherein the abnormality judgment model is a model trained according to the model training method described in the first aspect of the present application, and the abnormality judgment result is used to indicate whether the target transaction is an abnormal transaction.

[0014] In a third aspect, the present application provides a model training device, comprising:

[0015] A training acquisition module, used to acquire user information of a transaction user in a training transaction, merchant information of a transaction merchant, and transaction information between the transaction user and the transaction merchant; wherein the number of the training transactions is multiple, and there is a corresponding relationship between the transaction user, the transaction merchant, and the transaction information in each of the training transactions;

[0016] A training construction module, configured to construct, for each of the training transactions, a context information sequence according to the user information, the merchant information, the transaction information, the corresponding relationship between the user information and the transaction information, and the corresponding relationship between the merchant information and the transaction information; wherein the context information sequence is a vector sequence capable of indicating the transaction user, the transaction merchant, the transaction information, the association relationship between the transaction user and the transaction information, and the association relationship between the transaction merchant and the transaction information;

[0017] A model training module is used to input the context information sequence corresponding to each of the multiple training transactions into the model to be trained, train the model to be trained, and obtain an abnormality determination model; wherein the abnormality determination model is used to output an abnormality determination result corresponding to the target transaction based on the target context information corresponding to the target transaction, and the abnormality determination result is used to indicate whether the target transaction is an abnormal transaction.

[0018] In a fourth aspect, the present application provides an abnormality determination device, comprising:

[0019] A target acquisition module, used to acquire target transaction user information of a target transaction user in a target transaction, target transaction merchant information of a target transaction merchant, and target transaction information between the target transaction user and the target transaction merchant;

[0020] a target construction module, configured to construct a target context information sequence according to the target transaction user information, the target transaction merchant information, the target transaction information, the correspondence between the target transaction user information and the target transaction information, and the correspondence between the target transaction merchant information and the target transaction information; wherein the target context information sequence has the same sequence attribute as the context information sequence described in the model training method described in the first aspect of the present application;

[0021] An abnormality determination module is used to input the target context information sequence corresponding to the target transaction into an abnormality determination model to obtain an abnormality determination result corresponding to the target transaction output by the abnormality determination model; wherein the abnormality determination model is a model trained according to the model training method described in the first aspect of the present application, and the abnormality determination result is used to indicate whether the target transaction is an abnormal transaction.

[0022] In a fifth aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the model training method as described in the first aspect of the present application, or implements the abnormality determination method as described in the second aspect of the present application.

[0023] In a sixth aspect, the present application also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, it implements the model training method as described in the first aspect of the present application, or implements the abnormality determination method as described in the second aspect of the present application.

[0024] In a seventh aspect, the present application provides a computer program product, comprising a computer program, which, when executed by a processor, implements the model training method as described in the first aspect of the present application, or implements the abnormality determination method as described in the second aspect of the present application.

[0025] The model training method of the present application obtains user information of a transaction user in a training transaction, merchant information of a transaction merchant, and transaction information between the transaction user and the transaction merchant; wherein, there are multiple training transactions, and there is a corresponding relationship between the transaction user, the transaction merchant, and the transaction information in each training transaction; for each training transaction, a context information sequence is constructed according to user information, merchant information, transaction information, the corresponding relationship between user information and transaction information, and the corresponding relationship between merchant information and transaction information; wherein the context information sequence is a vector sequence that can indicate the transaction user, the transaction merchant, the transaction information, the association relationship between the transaction user and the transaction information, and the association relationship between the transaction merchant and the transaction information; the context information sequence corresponding to each training transaction in multiple training transactions is input into the model to be trained, and the model to be trained is trained to obtain an abnormality determination model; wherein the abnormality determination model is used to output an abnormality determination result corresponding to a target transaction according to the target context information corresponding to the target transaction, and the abnormality determination result is used to indicate whether the target transaction is an abnormal transaction. That is, the model training method of the present application, on the one hand, generates a context information sequence for user information, merchant information and transaction information that can indicate the transaction user, transaction merchant, transaction information, the relationship between the transaction user and transaction information, and the relationship between the transaction merchant and transaction information, so that the user information, merchant information and transaction information can establish a relationship, thereby increasing the feature information of the data input into the model, and then making the training data type of the model more comprehensive, avoiding the deviation of the output result of the model, and improving the accuracy of the output result of the model. On the other hand, by determining the abnormal determination result corresponding to the target transaction through the abnormal determination model, it is possible to determine whether the target transaction is an abnormal transaction, thereby improving the security of the transaction. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0027] Figure 1 It is a flowchart of the model training method provided in this application;

[0028] Figure 2 is another flow chart of the model training method provided by this application;

[0029] Figure 3 It is a flowchart of the abnormality determination method provided by the present application;

[0030] Figure 4 It is a structural schematic diagram of the model training device provided by this application;

[0031] Figure 5 It is a structural schematic diagram of the abnormality determination device provided by the present application;

[0032] Figure 6 It is a structural schematic diagram of the electronic device provided by this application. DETAILED DESCRIPTION

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

[0034] The acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.

[0035] Figure 1 This is a flow chart of the model training method provided by the present application. The method can be executed by the model training device provided by the present application, and the device can be implemented in software and / or hardware. In a specific embodiment, the device can be integrated in an electronic device. For example, the device can be integrated in a computer. The following embodiments will be described by taking the device integrated in an electronic device as an example. Figure 1 , the method may specifically include the following steps:

[0036] Step 101, obtaining user information of a transaction user in a training transaction, merchant information of a transaction merchant, and transaction information between the transaction user and the transaction merchant.

[0037] There are multiple training transactions, and there is a corresponding relationship between the transaction user, transaction merchant and transaction information in each training transaction.

[0038] Specifically, the user information of the transaction user refers to the user characteristic information that has a certain relevance to the transaction and has conducted transactions with the merchant in the training transaction. For example, the user information may include the age, job type, and income of the transaction user. The merchant information of the transaction merchant refers to the merchant characteristic information that has a certain relevance to the transaction and has conducted transactions with the user in the training transaction. For example, the merchant information may include the merchant category and operating conditions of the merchant. The transaction information between the transaction user and the transaction merchant refers to the transaction characteristic information of the transaction reached between the user and the merchant in the training transaction. For example, the transaction information may include the transaction amount, transaction time, and the type of goods purchased by the user. In the training transaction composed of users, merchants, and transaction information, there is a corresponding relationship between the transaction user, transaction merchant, and transaction information in each training transaction.

[0039] The user information of the transaction user in the training transaction, the merchant information of the transaction merchant, and the transaction information between the transaction user and the transaction merchant can be obtained by the electronic device executing this embodiment from a pre-constructed user-merchant bipartite attribute graph, wherein the topological structure of the graph is composed of nodes and edges, and the nodes can be divided into two types: users and merchants. Edges only exist between nodes of different types, and an edge exists only if and only if the user has had a credit card transaction at the merchant. The attributes of the user node in the graph are represented by expanding the user information into a vector form. The attributes of the merchant node in the graph are represented by expanding the merchant information into a vector form. The attributes of the edges between the nodes in the graph are represented by expanding the transaction information into a vector form.

[0040] Step 102 , for each training transaction, construct a context information sequence according to the user information, the merchant information, the transaction information, the correspondence between the user information and the transaction information, and the correspondence between the merchant information and the transaction information.

[0041] The context information sequence is a vector sequence that can indicate a transaction user, a transaction merchant, transaction information, an association relationship between a transaction user and transaction information, and an association relationship between a transaction merchant and transaction information.

[0042] Specifically, for each training transaction, the user information, merchant information, transaction information, the corresponding relationship between the user information and the transaction information, and the corresponding relationship between the merchant information and the transaction information are combined to obtain a context information sequence. The context information sequence is made to be able to indicate the transaction user, the transaction merchant, the transaction information, the association relationship between the transaction user and the transaction information, and the association relationship between the transaction merchant and the transaction information, so as to reflect the association information between the user and the merchant, the user and the transaction, and the merchant and the transaction in the context sequence, and provide a data basis for subsequent model training.

[0043] Exemplarily, user information, merchant information, transaction information, the correspondence between user information and transaction information, and the correspondence between merchant information and transaction information are all represented in vector form. Therefore, the above multiple vectors are concatenated, and the resulting vector matrix is ​​the context information sequence.

[0044] Step 103: input the context information sequence corresponding to each training transaction in the plurality of training transactions into the model to be trained, train the model to be trained, and obtain an abnormality determination model.

[0045] The abnormality determination model is used to output an abnormality determination result corresponding to the target transaction according to the target context information corresponding to the target transaction, and the abnormality determination result is used to indicate whether the target transaction is an abnormal transaction.

[0046] Specifically, the context information sequence corresponding to each training transaction in the multiple training transactions is input into the model to be trained, the model to be trained is trained, and the model parameters are adjusted based on the training loss to obtain the abnormality determination model. For example, when the training reaches a certain end condition, the training can be stopped, and the model updated in the last round can be used as the abnormality determination model. The end condition can be that the number of training rounds reaches a preset number of rounds, or the training loss is lower than a certain value. The model to be trained can be a model built based on the reinforcement learning framework. The abnormality determination model is used to output the abnormality determination result corresponding to the target transaction according to the target context information corresponding to the target transaction, and the abnormality determination result is used to indicate whether the target transaction is an abnormal transaction.

[0047] Optionally, the model to be trained includes an encoder, a decoder, and an abnormality determination unit, and step 103 can be implemented through steps 31 to 35.

[0048] Step 31, inputting the context information sequence corresponding to the first training transaction into the encoder of the model to be trained, and obtaining the encoder output result output by the encoder with the attention degree of the association relationship increased.

[0049] Specifically, the first training transaction is a training transaction that has not been input into the encoder of the model to be trained among the multiple training transactions. There is an attention mechanism layer in the encoder, so after the context information sequence that can indicate the transaction user, the transaction merchant, the transaction information, the association between the transaction user and the transaction information, and the association between the transaction merchant and the transaction information is input into the encoder of the model to be trained, the encoder output result that increases the attention of the association between the transaction user and the transaction information and the association between the transaction merchant and the transaction information can be obtained. Since the encoder output result increases the attention of the association between the transaction user and the transaction information and the association between the transaction merchant and the transaction information, the comprehensiveness of the features acquired by the model is improved, thereby improving the accuracy of the model output.

[0050] Optionally, both the encoder and the decoder include cascaded attention mechanism layers and forward propagation layers, and step 31 can be implemented through steps 311 to 312.

[0051] Step 311, input the context information sequence corresponding to the training transaction into the attention mechanism layer of the encoder of the model to be trained, and obtain the first attention information output by the attention mechanism layer of the encoder with increased attention to the association relationship.

[0052] Specifically, the context information sequence corresponding to the training transaction is input into the attention mechanism layer of the encoder of the model to be trained, and attention calculation is performed in the attention mechanism layer to obtain the first attention information output by the attention mechanism layer of the encoder that increases the attention degree of the association relationship.

[0053] Exemplary context information sequence in, After converting the user information, merchant information and transaction information into vectors, they are marked according to the information type, and then the vectors are marked again according to the association between user information and transaction information, and the association between merchant information and transaction information. In the formula, 1 and n, k, and m are the number of rows in the context information sequence matrix. After entering the attention mechanism layer, the following attention calculation is performed in the attention mechanism layer:

[0054]

[0055] Among them, Attention encode (X″,X″,X″) indicates the attention calculation for X″,X″,X″, and max(·,·,·) indicates taking the maximum value among the three elements. c ,d b ,d t denote the vector length of user information, the vector length of merchant information, and the vector length of transaction information in the context information sequence, respectively. e Represents the length of the vector labeled by information type in the context information sequence, d q Indicates the length of the vector for the second labeling based on the association between user information and transaction information, and the association between merchant information and transaction information. X″=[X″ c ;X″ t ;X″ b], [·; ·] represents the vertical concatenation of two matrices, that is, the matrices of user information, merchant information, and transaction information are concatenated after being marked twice. Since the vector lengths of user information, merchant information, and transaction information are different, the longest vector length is used as the standard, and the vectors shorter than this length are filled with 0 elements. Softmax(·) is a normalization function that normalizes the elements in each row vector of the matrix input to the interval between 0 and 1, and makes the sum of all elements of the row vector 1.

[0056] Step 312, input the first attention information into the forward propagation layer of the encoder, perform nonlinear change calculation, and obtain the encoder output result output by the forward propagation layer of the encoder.

[0057] Specifically, after obtaining the first attention information with increased attention to the association relationship output by the attention mechanism layer of the encoder, the first attention information is input into the forward propagation layer of the encoder for nonlinear change calculation, and the calculation result is the encoder output result output by the forward propagation layer of the encoder.

[0058] Exemplarily, the first attention information is input into the forward propagation layer of the encoder, and the following nonlinear change calculation is performed: FFN encode (X″)=max(0,Attention encode (X″,X″,X″)W1+b1)W2+b2, where W1, b1 and W2, b2 are all trainable model parameters. The model parameters here can be understood as a matrix and vector composed of variables. During the model training process, these variables are continuously adjusted and updated until the model training is completed. FFN encode (X″) is the encoder output result.

[0059] Step 32, input the encoder output result into the decoder, and obtain the decoder output result with the attention degree of the association relationship increased by the decoder.

[0060] Specifically, after obtaining the encoder output result, the encoder output result is input into the decoder, and the attention mechanism layer inside the decoder performs attention calculation on the encoder output result, and the decoder output result with increased attention of the associated relationship can be obtained. Since the decoder output result increases the attention of the associated relationship between the transaction user and the transaction information and the associated relationship between the transaction merchant and the transaction information, the comprehensiveness of the features obtained by the model is improved, thereby improving the accuracy of the model output.

[0061] Optionally, after executing step 312 , step 32 may be implemented through steps 321 to 322 .

[0062] Step 321, input the encoder output result into the attention mechanism layer of the decoder, and obtain the second attention information output by the attention mechanism layer of the decoder with increased attention to the association relationship.

[0063] Specifically, the encoder output result is input into the attention mechanism layer of the decoder of the model to be trained, and attention calculation is performed in the attention mechanism layer to obtain the second attention information output by the attention mechanism layer of the decoder with increased attention to the association relationship.

[0064] For example, after obtaining the encoder output result FFN encode (X″), it can be input into the attention mechanism of the decoder together with the user information, merchant information and transaction information to perform the following calculation:

[0065]

[0066] At this point, the obtained Attention encode (FFN encode (X″),X″ (i,·) ,X″ (i,·) ) is the second attention information.

[0067] Step 322, input the second attention information into the forward propagation layer of the decoder, perform nonlinear change calculation, and obtain the decoder output result output by the forward propagation layer of the decoder.

[0068] Specifically, after obtaining the second attention information with increased attention to the association relationship output by the attention mechanism layer of the decoder, the second attention information is input into the forward propagation layer of the decoder for nonlinear change calculation, and the calculation result is the decoder output result output by the forward propagation layer of the decoder.

[0069] Exemplarily, similar to the calculation method of the encoder, the second attention information Attentione ncode (FFN encode (X″),X″ (i,·) ,X″ (i,·) ) is input into the forward propagation layer, and the nonlinear change calculation process is the same as the nonlinear change calculation process in the forward propagation layer of the encoder, and FFN is obtained. decode (X″ (i,·) ), as the decoder output result.

[0070] Step 33, input the decoder output result into the abnormality determination unit to obtain the abnormality determination result corresponding to the training transaction output by the abnormality determination unit.

[0071] Specifically, the abnormality determination unit can determine whether the training transaction is abnormal according to the decoder output result. For example, the label value calculated by the decoder output result is determined by the excitation function, and according to the label value and the transaction abnormality threshold, the transaction abnormality threshold is the label value threshold for determining the transaction abnormality, and when the label value is greater than the transaction abnormality threshold, the abnormality determination result corresponding to the training transaction is determined to be that the transaction is abnormal.

[0072] Optionally, after executing step 322 , step 33 may be implemented through steps 331 to 332 .

[0073] Step 331, determining the training label value corresponding to the training transaction according to the decoder output result and the preset excitation function.

[0074] Specifically, the decoder output result is input into a preset excitation function to obtain a training label value corresponding to the training transaction.

[0075] Exemplarily, the preset activation function is:

[0076] Among them, w and b are trainable model parameters. i Represents the training label value corresponding to the i-th training transaction. This formula represents an additional nonlinear change based on the output of the decoder.

[0077] Step 332: determine the abnormality determination result corresponding to the training transaction according to the training label value corresponding to the training transaction and the preset feedback function.

[0078] Specifically, the transaction anomaly threshold is determined according to a preset feedback function, and the transaction anomaly threshold is a label value threshold for determining transaction anomalies. For example, the transaction anomaly threshold is 0.5. According to the label value and the transaction anomaly threshold, when the label value is greater than the transaction anomaly threshold, it is determined that the anomaly determination result corresponding to the training transaction is that the transaction is abnormal.

[0079] Exemplarily, the abnormal detection judgment of training user n can be determined by inputting the training label value corresponding to training user n into the feedback function, where the feedback function is R n =(y ′ n -y n ) 2 Among them, y ′ n Indicates whether it is an abnormal transaction training user’s label value, y ′ n The value of 0 corresponds to normal transaction training users, y ′ n The value of 1 corresponds to abnormal transaction training users. nIndicates the training label value corresponding to the training transaction, and its value range is between 0 and 1. The abnormal detection judgment of transaction information t can be determined by inputting the training label value corresponding to transaction information t into the feedback function. The feedback function is R t =(y t ′ -y t ) 2 .y t ′ Indicates whether it is an abnormal transaction. t ′ The value of 0 corresponds to normal transaction information, t ′ The value 1 corresponds to abnormal transaction information. t Indicates the training label value corresponding to the training transaction, ranging from 0 to 1.

[0080] Step 34, based on the abnormality determination result and whether there is an abnormality in the training transaction, the model parameters of the encoder and the decoder are corrected to obtain the model to be trained after the parameters are corrected.

[0081] Specifically, according to the abnormality determination result and whether the training transaction indicated in the training transaction information of the training transaction has an abnormality, the model parameters of the encoder and the decoder are corrected to obtain the to-be-trained model with the corrected parameters.

[0082] Step 35, taking the second training transaction as the new first training transaction, taking the model to be trained after the parameters are corrected as the new model to be trained, returning to execute step 31, until the preset iteration end condition is reached, taking the model to be trained after the parameters are corrected as the abnormality determination model.

[0083] The second training transaction is a training transaction among the multiple training transactions in which the corresponding context information sequence is not input into the encoder of the model to be trained.

[0084] Specifically, after the model parameters are corrected, the model to be trained after the corrected parameters is used as a new model to be trained, and the second training transaction is input into the model to adjust the model parameters until the preset iteration end condition is reached, and the model to be trained after the corrected parameters is used as the abnormality determination model. For example, the preset iteration end condition may be that the number of training rounds reaches a preset number of rounds, or the training loss is lower than a certain value, etc.

[0085] Optionally, the preset iteration termination condition includes that the objective function value corresponding to the model parameter is the minimum value of the objective function.

[0086] Specifically, limiting the iteration end condition to obtaining the minimum value of the objective function can improve the convergence speed of the model and thus improve the training efficiency of the model.

[0087] Exemplarily, the model is a model established by a reinforcement learning training framework. After setting the initial model parameters, the Adam optimization algorithm can be used to minimize the following objective function to train the model.

[0088]

[0089] Among them, θ is the model parameter, when θ=θ * =argmin θ When R(θ) is reached, the model training is completed. Since the model established by the reinforcement learning training framework can be trained based on real-time effect feedback, it can also ensure that the model learns the latest abnormal trading patterns in real time when the model is used.

[0090] The model training method of the present application obtains user information of a transaction user in a training transaction, merchant information of a transaction merchant, and transaction information between the transaction user and the transaction merchant; wherein, there are multiple training transactions, and there is a corresponding relationship between the transaction user, the transaction merchant, and the transaction information in each training transaction; for each training transaction, a context information sequence is constructed according to user information, merchant information, transaction information, the corresponding relationship between user information and transaction information, and the corresponding relationship between merchant information and transaction information; wherein the context information sequence is a vector sequence that can indicate the transaction user, the transaction merchant, the transaction information, the association relationship between the transaction user and the transaction information, and the association relationship between the transaction merchant and the transaction information; the context information sequence corresponding to each training transaction in multiple training transactions is input into the model to be trained, and the model to be trained is trained to obtain an abnormality determination model; wherein the abnormality determination model is used to output an abnormality determination result corresponding to a target transaction according to the target context information corresponding to the target transaction, and the abnormality determination result is used to indicate whether the target transaction is an abnormal transaction. That is, the model training method of the present application, on the one hand, generates a context information sequence for user information, merchant information and transaction information that can indicate the transaction user, transaction merchant, transaction information, the relationship between the transaction user and transaction information, and the relationship between the transaction merchant and transaction information, so that the user information, merchant information and transaction information can establish a relationship, thereby increasing the feature information of the data input into the model, and then making the training data type of the model more comprehensive, avoiding the deviation of the output result of the model, and improving the accuracy of the output result of the model. On the other hand, by determining the abnormal determination result corresponding to the target transaction through the abnormal determination model, it is possible to determine whether the target transaction is an abnormal transaction, thereby improving the security of the transaction.

[0091] Figure 2 is another flow chart of the model training method provided by the present application. Figure 1Based on the illustrated embodiment and various optional implementation schemes, the process of constructing the context information sequence is described in detail. Figure 2 As shown, the method may include the following steps:

[0092] Step 201, obtaining user information of a transaction user in a training transaction, merchant information of a transaction merchant, and transaction information between the transaction user and the transaction merchant.

[0093] Step 202: for each training transaction, the characteristic information of the user information, the merchant information and the transaction information between the transaction user and the transaction merchant is represented by a characteristic vector matrix to obtain an initial vector sequence consisting of a first information matrix, a second information matrix and a third information matrix.

[0094] Specifically, for each training transaction, the user information is represented by a feature vector matrix to obtain a first information matrix. The merchant information is represented by a feature vector matrix to obtain a second information matrix. The transaction information between the transaction user and the transaction merchant is represented by a feature vector matrix to obtain a third information matrix. The first information matrix, the second information matrix and the third information matrix constitute an initial vector sequence.

[0095] For example, for the user-merchant bipartite attribute graph, we start from the initial node and perform a deep traversal to avoid missing data. If user information, merchant information, and transaction information are represented by matrices and Indicates. Where n, m, and k represent the number of rows in the matrix, and d c d b and t Both represent the number of columns of the matrix, The value range of each element in the matrix is ​​real. Each row of the matrix corresponds to a feature vector of user information, merchant information, and transaction information. Therefore, the initial vector sequence middle, The nth, kth, and mth row vectors of the eigenvector matrix represent user information, transaction information, and merchant information, respectively.

[0096] Step 203, marking the initial vector sequence according to the information types of the first information matrix, the second information matrix and the third information matrix in the initial vector sequence, and obtaining an augmented vector sequence consisting of a user information matrix, a merchant information matrix and a transaction information matrix.

[0097] Specifically, since it is impossible to determine whether a certain vector in the initial vector sequence belongs to user information, merchant information or transaction information, it is necessary to type-mark the initial vector sequence to obtain an augmented vector sequence consisting of a user information matrix, a merchant information matrix and a transaction information matrix.

[0098] For example, for the initial vector sequence Φ, the type labeling matrix Mark the initial vector sequence. Among them, E c ; E t ; E b They represent mutually orthogonal vectors used to type-mark user information, transaction information, and merchant information, respectively. The semicolon indicates that the three vectors are vertically concatenated to form the type-marking matrix E. For example, the type-marking rule is: for a certain attribute vector of user information n The type tag is denoted by For a certain business information m, the attribute vector The type tag is denoted by For a transaction information t, the attribute vector The type tag is denoted by

[0099] Step 204, based on the correspondence between the transaction users, the transaction merchants and the transaction information, establish an association relationship between the user information matrix and the transaction information matrix, and an association relationship between the merchant information matrix and the transaction information matrix.

[0100] Specifically, since the above-mentioned attribute vector sequence cannot provide information on the association relationship between the user information matrix and the transaction information matrix, as well as the association relationship between the merchant information matrix and the transaction information matrix, two orthogonal identification matrices are required to further mark the augmented vector sequence after completing the above-mentioned type marking. Therefore, it is necessary to establish the association relationship between the user information matrix and the transaction information matrix, as well as the association relationship between the merchant information matrix and the transaction information matrix.

[0101] For example, for a certain user information n, the augmented vector matrix After establishing the relationship between the user information matrix and the transaction information matrix, the matrix is For a certain business information m, the augmented vector matrix After establishing the relationship between the merchant information matrix and the transaction information matrix, the matrix is For the augmented vector matrix of transaction information k Because the nodes at both ends are user node n and merchant node m, the relationship between the user information matrix and the transaction information matrix, and the relationship between the merchant information matrix and the transaction information matrix are established, and the matrix is

[0102] Step 205 , establishing a context information sequence according to the user information matrix, the merchant information matrix, the transaction information matrix, the association relationship between the user information matrix and the transaction information matrix, and the association relationship between the merchant information matrix and the transaction information matrix.

[0103] Specifically, after obtaining the user information matrix, the merchant information matrix, the transaction information matrix, the correlation between the user information matrix and the transaction information matrix, and the correlation between the merchant information matrix and the transaction information matrix, a context sequence is established. After the context sequence is generated, it is affected by the attention mechanism layer in the model, which can make the model pay more attention to the correlation between the user information matrix and the transaction information matrix, and the correlation between the merchant information matrix and the transaction information matrix. Therefore, in the face of the rapid increase in transaction information every day, this method of localized sampling of context information sequences can continuously provide incremental training data for the model, which is conducive to further improving the accuracy of the model.

[0104] Exemplarily, the context information sequence is established based on the user information matrix, the merchant information matrix, the transaction information matrix, the association relationship between the user information matrix and the transaction information matrix, and the association relationship between the merchant information matrix and the transaction information matrix.

[0105] Step 206: input the context information sequence corresponding to each training transaction in the plurality of training transactions into the model to be trained, train the model to be trained, and obtain an abnormality determination model.

[0106] The model training method of the present application effectively integrates the features of user information, merchant information, transaction information, the correlation between the user information matrix and the transaction information matrix, and the correlation between the merchant information matrix and the transaction information matrix, and fully utilizes multi-source information to generate context information sequences, avoiding the situation where the type of input feature information of the model that can determine abnormal transactions is relatively single, thereby improving the accuracy of the model output results.

[0107] Figure 3 is a flow chart of the abnormality determination method provided by the present application. The method can be executed by the abnormality determination device provided by the present application, and the device can be implemented in software and / or hardware. In a specific embodiment, the device can be integrated in an electronic device. For example, the device can be integrated in a computer. The following embodiments will be described by taking the device integrated in an electronic device as an example. Figure 3 , the method may specifically include the following steps:

[0108] Step 301 , obtaining target transaction user information of a target transaction user in a target transaction, target transaction merchant information of a target transaction merchant, and target transaction information between the target transaction user and the target transaction merchant.

[0109] Specifically, the target transaction is a transaction to be determined whether it is abnormal. The target transaction user, target transaction merchant, and target transaction information in the target transaction can also be stored in a pre-constructed user-merchant two-part attribute graph, and then obtained from the user-merchant two-part attribute graph by the electronic device executing this embodiment.

[0110] Step 302 , construct a target context information sequence according to the target transaction user information, the target transaction merchant information, the target transaction information, the correspondence between the target transaction user information and the target transaction information, and the correspondence between the target transaction merchant information and the target transaction information.

[0111] Among them, the target context information sequence has the same sequence attributes as the context information sequence of the model training method in any embodiment of the present application.

[0112] Specifically, since the target transaction user, target transaction merchant, and target transaction information are obtained in the user-merchant bipartite attribute graph, it is possible to traverse the nodes in the user-merchant bipartite attribute graph to enhance the comprehensiveness of the target transaction user information, the target transaction merchant information, the target transaction information, the correspondence between the target transaction user information and the target transaction information, and the correspondence between the target transaction merchant information and the target transaction information. The target context information sequence has the same sequence attributes as the context information sequence of the model training method of any embodiment of the present application, so the process of constructing the target context information sequence is the same as the method for constructing the context information sequence in any of the above embodiments, which will not be repeated here.

[0113] Step 303: input the target context information sequence corresponding to the target transaction into the abnormality determination model to obtain the abnormality determination result corresponding to the target transaction output by the abnormality determination model.

[0114] Among them, the anomaly determination model is a model trained according to the model training method of any embodiment of the present application, and the anomaly determination result is used to indicate whether the target transaction is an abnormal transaction.

[0115] Specifically, after obtaining the target context information sequence corresponding to the target transaction, the target context information sequence corresponding to the target transaction is input into the anomaly determination model to obtain the anomaly determination result corresponding to the target transaction output by the anomaly determination model. After detecting multiple target transactions, an abnormal transaction list is generated according to the abnormal transactions in the multiple target transactions for easy viewing by the staff.

[0116] For example, for the target transaction user n, the corresponding context information sequence The data is input into the abnormality determination model to obtain the abnormality determination result corresponding to the target transaction output by the abnormality determination model, which can determine whether the user has abnormal transaction behavior.

[0117] The abnormality determination method of the present application obtains the target transaction user information of the target transaction user in the target transaction, the target transaction merchant information of the target transaction merchant, and the target transaction information between the target transaction user and the target transaction merchant; constructs a target context information sequence according to the target transaction user information, the target transaction merchant information, the target transaction information, the correspondence between the target transaction user information and the target transaction information, and the correspondence between the target transaction merchant information and the target transaction information; wherein the target context information sequence has the same sequence attribute as the context information sequence of the model training method of any embodiment of the present application; inputs the target context information sequence corresponding to the target transaction into the abnormality determination model, and obtains the abnormality determination result corresponding to the target transaction output by the abnormality determination model; wherein the abnormality determination model is a model trained by the model training method according to any embodiment of the present application, and the abnormality determination result is used to indicate whether the target transaction is an abnormal transaction. That is, the abnormality determination method of the present application, on the one hand, the sequence attribute of the target context information sequence is the same as the sequence attribute type of the context information sequence of the model training method, so it can indicate the target transaction user, the target transaction merchant, the target transaction information, the association between the target transaction user and the target transaction information, and the association between the target transaction merchant and the target transaction information, thereby avoiding the deviation of the output result of the model and improving the accuracy of the abnormality determination result. On the other hand, determining whether the target transaction is an abnormal transaction based on the target context information sequence improves the security of the transaction.

[0118] Figure 4 is a schematic diagram of the structure of the model training device provided in this application, which is suitable for executing the model training method provided in this application. Figure 4 As shown, the device may specifically include:

[0119] The training acquisition module 401 is used to obtain the user information of the transaction user, the merchant information of the transaction merchant, and the transaction information between the transaction user and the transaction merchant in the training transaction; wherein the number of the training transactions is multiple, and there is a corresponding relationship between the transaction user, the transaction merchant, and the transaction information in each of the training transactions.

[0120] The training construction module 402 is used to construct a context information sequence for each training transaction according to the user information, the merchant information, the transaction information, the correspondence between the user information and the transaction information, and the correspondence between the merchant information and the transaction information; wherein the context information sequence is a vector sequence that can indicate the transaction user, the transaction merchant, the transaction information, the association relationship between the transaction user and the transaction information, and the association relationship between the transaction merchant and the transaction information.

[0121] The model training module 403 is used to input the context information sequence corresponding to each of the multiple training transactions into the model to be trained, train the model to be trained, and obtain an abnormality determination model; wherein the abnormality determination model is used to output an abnormality determination result corresponding to the target transaction according to the target context information corresponding to the target transaction, and the abnormality determination result is used to indicate whether the target transaction is an abnormal transaction.

[0122] In one embodiment, the training construction module 402, in the aspect of constructing the context information sequence according to the user information, the merchant information, the transaction information, the correspondence between the user information and the transaction information, and the correspondence between the merchant information and the transaction information, is specifically used to: represent the feature information of the user information, the merchant information, and the transaction information between the transaction user and the transaction merchant with a feature vector matrix to obtain an initial vector sequence consisting of a first information matrix, a second information matrix, and a third information matrix; and based on the information type of the first information matrix, the second information matrix, and the third information matrix in the initial vector sequence, , type-marking the initial vector sequence to obtain an augmented vector sequence consisting of a user information matrix, a merchant information matrix and a transaction information matrix; establishing an association relationship between the user information matrix and the transaction information matrix, and an association relationship between the merchant information matrix and the transaction information matrix according to the corresponding relationship between the transaction user, the transaction merchant and the transaction information; establishing a context information sequence according to the user information matrix, the merchant information matrix, the transaction information matrix, the association relationship between the user information matrix and the transaction information matrix, and the association relationship between the merchant information matrix and the transaction information matrix.

[0123] In one embodiment, the model to be trained includes an encoder, a decoder, and an anomaly determination unit, and the model training module 403 is specifically used to: input the context information sequence corresponding to the first training transaction into the encoder of the model to be trained, and obtain the encoder output result output by the encoder with the attention degree of the association relationship increased; input the encoder output result into the decoder, and obtain the decoder output result output by the decoder with the attention degree of the association relationship increased; input the decoder output result into the anomaly determination unit, and obtain the anomaly determination result corresponding to the training transaction output by the anomaly determination unit; and according to the anomaly determination result and whether the training transaction is abnormal, the encoder is The model parameters of the detector and the decoder are corrected to obtain the model to be trained after the corrected parameters; the second training transaction is used as the new first training transaction, the model to be trained after the corrected parameters is used as the new model to be trained, and the step of "inputting the context information sequence corresponding to the first training transaction into the encoder of the model to be trained to obtain the encoder output result of the encoder with the attention degree of the association relationship increased" is returned to execute until the preset iteration end condition is reached, and the model to be trained after the corrected parameters is used as the abnormality judgment model; wherein the second training transaction is a training transaction in which the corresponding context information sequence is not input into the encoder of the model to be trained among the multiple training transactions.

[0124] In one embodiment, the encoder and the decoder both include a cascaded attention mechanism layer and a forward propagation layer. The model training module 403, in terms of inputting the context information sequence corresponding to the training transaction into the encoder of the model to be trained to obtain the encoder output result output by the encoder with the degree of attention to the association relationship increased, is specifically used for: inputting the context information sequence corresponding to the training transaction into the attention mechanism layer of the encoder of the model to be trained to obtain the first attention information output by the attention mechanism layer of the encoder with the degree of attention to the association relationship increased; inputting the first attention information into the forward propagation layer of the encoder, performing nonlinear change calculation, and obtaining the encoder output result output by the forward propagation layer of the encoder.

[0125] In one embodiment, the model training module 403, in the aspect of inputting the encoder output result into the decoder to obtain the decoder output result output by the decoder with the attention degree of the association relationship increased, is specifically used to: input the encoder output result into the attention mechanism layer of the decoder to obtain the second attention information output by the attention mechanism layer of the decoder with the attention degree of the association relationship increased; input the second attention information into the forward propagation layer of the decoder to perform nonlinear change calculation to obtain the decoder output result output by the forward propagation layer of the decoder. The model training module 403, in the aspect of inputting the decoder output result into the abnormality determination unit to obtain the abnormality determination result corresponding to the training transaction output by the abnormality determination unit, is specifically used to: determine the training label value corresponding to the training transaction according to the decoder output result and the preset excitation function; determine the abnormality determination result corresponding to the training transaction according to the training label value corresponding to the training transaction and the preset feedback function.

[0126] In one embodiment, the preset iteration termination condition of the model training module 403 includes that the objective function value corresponding to the model parameter is the minimum value of the objective function.

[0127] The model training device of the present application, its optional implementation methods and the beneficial effects that can be achieved are the same as those of the above-mentioned model training method embodiment, and will not be repeated here.

[0128] Figure 5 is a schematic diagram of the structure of the abnormality determination device provided by the present application, and the device is suitable for executing the abnormality determination method provided by the present application. Figure 5 As shown, the device may specifically include:

[0129] The target acquisition module 501 is used to acquire the target transaction user information of the target transaction user in the target transaction, the target transaction merchant information of the target transaction merchant, and the target transaction information between the target transaction user and the target transaction merchant.

[0130] The target construction module 502 is used to construct a target context information sequence according to the target transaction user information, the target transaction merchant information, the target transaction information, the correspondence between the target transaction user information and the target transaction information, and the correspondence between the target transaction merchant information and the target transaction information; wherein the target context information sequence is the same as the sequence attribute of the context information sequence described in the model training method described in the first aspect of the present application.

[0131] The abnormality determination module 503 is used to input the target context information sequence corresponding to the target transaction into the abnormality determination model, and obtain the abnormality determination result corresponding to the target transaction output by the abnormality determination model; wherein the abnormality determination model is a model trained according to the model training method described in the first aspect of the present application, and the abnormality determination result is used to indicate whether the target transaction is an abnormal transaction.

[0132] The abnormality determination device of the present application, its optional implementation methods and the beneficial effects that can be achieved are the same as those of the above-mentioned abnormality determination method embodiment, and will not be repeated here.

[0133] The present application also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the model training method provided in any one of the above embodiments is implemented, or the abnormality determination method provided in any one of the above embodiments is implemented.

[0134] The present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the model training method provided in any of the above embodiments, or implements the abnormality determination method provided in any of the above embodiments.

[0135] Reference below Figure 6 , which shows a structural schematic diagram of an electronic device 600 suitable for implementing the present application. Figure 6 The electronic device shown is only an example and should not bring any limitation to the function and scope of use of the present application.

[0136] like Figure 6 As shown, the electronic device 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0137] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.

[0138] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the system of the present application are executed.

[0139] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0140] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0141] The modules and / or units described in this application may be implemented in software or hardware. The modules and / or units described may also be provided in a processor, for example, may be described as: a processor including a training acquisition module, a training construction module, and a model training module. Alternatively, it may be described as: a processor including a target acquisition module, a target construction module, and an anomaly determination module. The names of these modules do not, in some cases, constitute limitations on the modules themselves.

[0142] As another aspect, the present application further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes:

[0143] Obtain user information of a transaction user in a training transaction, merchant information of a transaction merchant, and transaction information between the transaction user and the transaction merchant; wherein there are multiple training transactions, and there is a corresponding relationship between the transaction user, the transaction merchant, and the transaction information in each training transaction; for each training transaction, construct a context information sequence according to user information, merchant information, transaction information, the corresponding relationship between user information and transaction information, and the corresponding relationship between merchant information and transaction information; wherein the context information sequence is a vector sequence that can indicate the transaction user, the transaction merchant, the transaction information, the association relationship between the transaction user and the transaction information, and the association relationship between the transaction merchant and the transaction information; input the context information sequence corresponding to each training transaction in multiple training transactions into a to-be-trained model, train the to-be-trained model, and obtain an anomaly determination model; wherein the anomaly determination model is used to output an anomaly determination result corresponding to a target transaction according to the target context information corresponding to the target transaction, and the anomaly determination result is used to indicate whether the target transaction is an abnormal transaction.

[0144] According to the model training method of the present application, user information of transaction users in training transactions, merchant information of transaction merchants, and transaction information between transaction users and transaction merchants are obtained; wherein, there are multiple training transactions, and there is a corresponding relationship between transaction users, transaction merchants, and transaction information in each training transaction; for each training transaction, a context information sequence is constructed according to user information, merchant information, transaction information, the corresponding relationship between user information and transaction information, and the corresponding relationship between merchant information and transaction information; wherein the context information sequence is a vector sequence that can indicate transaction users, transaction merchants, transaction information, the association relationship between transaction users and transaction information, and the association relationship between transaction merchants and transaction information; the context information sequence corresponding to each training transaction in multiple training transactions is input into a model to be trained, and the model to be trained is trained to obtain an abnormality determination model; wherein the abnormality determination model is used to output an abnormality determination result corresponding to a target transaction according to the target context information corresponding to the target transaction, and the abnormality determination result is used to indicate whether the target transaction is an abnormal transaction. That is, the model training method of the present application, on the one hand, generates a context information sequence for user information, merchant information and transaction information that can indicate the transaction user, transaction merchant, transaction information, the relationship between the transaction user and transaction information, and the relationship between the transaction merchant and transaction information, so that the user information, merchant information and transaction information can establish a relationship, thereby increasing the feature information of the data input into the model, and then making the training data type of the model more comprehensive, avoiding the deviation of the output result of the model, and improving the accuracy of the output result of the model. On the other hand, by determining the abnormal determination result corresponding to the target transaction through the abnormal determination model, it is possible to determine whether the target transaction is an abnormal transaction, thereby improving the security of the transaction.

[0145] Alternatively, when the above one or more programs are executed by a device, the device includes:

[0146] Obtain target transaction user information of a target transaction user in a target transaction, target transaction merchant information of a target transaction merchant, and target transaction information between the target transaction user and the target transaction merchant; construct a target context information sequence according to the target transaction user information, the target transaction merchant information, the target transaction information, the correspondence between the target transaction user information and the target transaction information, and the correspondence between the target transaction merchant information and the target transaction information; wherein the target context information sequence has the same sequence attribute as the context information sequence of the model training method of any embodiment of the present application; input the target context information sequence corresponding to the target transaction into an abnormality determination model to obtain an abnormality determination result corresponding to the target transaction output by the abnormality determination model; wherein the abnormality determination model is a model trained according to the model training method of any embodiment of the present application, and the abnormality determination result is used to indicate whether the target transaction is an abnormal transaction.

[0147] According to the abnormality determination method of the present application, the target transaction user information of the target transaction user in the target transaction, the target transaction merchant information of the target transaction merchant, and the target transaction information between the target transaction user and the target transaction merchant are obtained; according to the target transaction user information, the target transaction merchant information, the target transaction information, the correspondence between the target transaction user information and the target transaction information, and the correspondence between the target transaction merchant information and the target transaction information, a target context information sequence is constructed; wherein the target context information sequence has the same sequence attribute as the context information sequence of the model training method of any embodiment of the present application; the target context information sequence corresponding to the target transaction is input into the abnormality determination model to obtain the abnormality determination result corresponding to the target transaction output by the abnormality determination model; wherein the abnormality determination model is a model trained by the model training method according to any embodiment of the present application, and the abnormality determination result is used to indicate whether the target transaction is an abnormal transaction. That is, the abnormality determination method of the present application, on the one hand, the sequence attribute of the target context information sequence is the same as the sequence attribute type of the context information sequence of the model training method, so it can indicate the target transaction user, the target transaction merchant, the target transaction information, the association between the target transaction user and the target transaction information, and the association between the target transaction merchant and the target transaction information, thereby avoiding the deviation of the output result of the model and improving the accuracy of the abnormality determination result. On the other hand, determining whether the target transaction is an abnormal transaction based on the target context information sequence improves the security of the transaction.

[0148] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements a model training method as provided in any embodiment of the present application, or implements an abnormality determination method as provided in any embodiment of the present application.

[0149] In the process of implementation, the computer program product can be written in one or more programming languages ​​or a combination thereof to perform the computer program code of the present application, and the programming language includes an object-oriented programming language, such as Java, Smalltalk, C++, and also includes a conventional procedural programming language, such as "C" language or similar programming language. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on the remote computer, or completely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0150] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution of this application can be achieved, and this document is not limited here.

[0151] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.

Claims

1. A model training method, characterized in that: include: Obtaining user information of a transaction user in a training transaction, merchant information of a transaction merchant, and transaction information between the transaction user and the transaction merchant; wherein there are multiple training transactions, and there is a corresponding relationship between the transaction user, the transaction merchant, and the transaction information in each training transaction; For each of the training transactions, a context information sequence is constructed according to the user information, the merchant information, the transaction information, the corresponding relationship between the user information and the transaction information, and the corresponding relationship between the merchant information and the transaction information; wherein the context information sequence is a vector sequence capable of indicating the transaction user, the transaction merchant, the transaction information, the association relationship between the transaction user and the transaction information, and the association relationship between the transaction merchant and the transaction information; The context information sequence corresponding to each of the multiple training transactions is input into the model to be trained, and the model to be trained is trained to obtain an abnormality determination model; wherein the abnormality determination model is used to output an abnormality determination result corresponding to the target transaction according to the target context information corresponding to the target transaction, and the abnormality determination result is used to indicate whether the target transaction is an abnormal transaction.

2. The method according to claim 1, characterized in that The constructing a context information sequence according to the user information, the merchant information, the transaction information, the correspondence between the user information and the transaction information, and the correspondence between the merchant information and the transaction information includes: The characteristic information of the user information, the merchant information, and the transaction information between the transaction user and the transaction merchant is represented by a characteristic vector matrix to obtain an initial vector sequence consisting of a first information matrix, a second information matrix, and a third information matrix; According to the information types of the first information matrix, the second information matrix, and the third information matrix in the initial vector sequence, the initial vector sequence is type-marked to obtain an augmented vector sequence consisting of a user information matrix, a merchant information matrix, and a transaction information matrix; According to the correspondence between the transaction user, the transaction merchant and the transaction information, an association relationship between the user information matrix and the transaction information matrix, and an association relationship between the merchant information matrix and the transaction information matrix are established; A context information sequence is established according to the user information matrix, the merchant information matrix, the transaction information matrix, the association relationship between the user information matrix and the transaction information matrix, and the association relationship between the merchant information matrix and the transaction information matrix.

3. The method according to claim 1, characterized in that The model to be trained includes an encoder, a decoder and an abnormality determination unit. The context information sequence corresponding to each of the training transactions in the plurality of training transactions is input into the model to be trained, and the model to be trained is trained to obtain an abnormality determination model, including: Inputting the context information sequence corresponding to the first training transaction into the encoder of the to-be-trained model, and obtaining an encoder output result output by the encoder that increases the attention degree of the association relationship; Inputting the encoder output result into the decoder to obtain a decoder output result output by the decoder with the attention degree of the association relationship increased; Inputting the decoder output result into the abnormality determination unit to obtain the abnormality determination result corresponding to the training transaction output by the abnormality determination unit; According to the abnormality determination result and whether the training transaction is abnormal, the model parameters of the encoder and the decoder are corrected to obtain the model to be trained after the parameters are corrected; The second training transaction is used as the new first training transaction, and the model to be trained after the correction of the parameters is used as the new model to be trained, and the step of "inputting the context information sequence corresponding to the first training transaction into the encoder of the model to be trained, and obtaining the encoder output result of the encoder with the attention degree of the association relationship increased by the encoder" is returned to execute until the preset iteration end condition is reached, and the model to be trained after the correction of the parameters is used as the abnormality judgment model; wherein, the second training transaction is a training transaction among the multiple training transactions, in which the corresponding context information sequence is not input into the encoder of the model to be trained.

4. The method according to claim 3, characterized in that: The encoder and the decoder both include a cascaded attention mechanism layer and a forward propagation layer, and the context information sequence corresponding to the training transaction is input into the encoder of the to-be-trained model to obtain an encoder output result output by the encoder with the attention degree of the association relationship increased, including: Inputting the context information sequence corresponding to the training transaction into the attention mechanism layer of the encoder of the model to be trained, and obtaining the first attention information output by the attention mechanism layer of the encoder that increases the attention degree of the association relationship; The first attention information is input into the forward propagation layer of the encoder, and a nonlinear change calculation is performed to obtain an encoder output result output by the forward propagation layer of the encoder.

5. The method according to claim 4, characterized in that The step of inputting the encoder output result into the decoder to obtain a decoder output result output by the decoder with the attention degree of the association relationship increased includes: Inputting the encoder output result into the attention mechanism layer of the decoder to obtain second attention information output by the attention mechanism layer of the decoder with increased attention to the association relationship; Inputting the second attention information into the forward propagation layer of the decoder, performing nonlinear change calculation, and obtaining a decoder output result output by the forward propagation layer of the decoder; Inputting the decoder output result into the abnormality determination unit to obtain the abnormality determination result corresponding to the training transaction output by the abnormality determination unit, including: Determine the training label value corresponding to the training transaction according to the decoder output result and the preset excitation function; The abnormality determination result corresponding to the training transaction is determined according to the training label value corresponding to the training transaction and a preset feedback function.

6. The method according to claim 3, characterized in that: The preset iteration termination condition includes that the objective function value corresponding to the model parameter is the minimum value of the objective function.

7. An abnormality determination method, characterized in that: include: Acquire target transaction user information of a target transaction user in a target transaction, target transaction merchant information of a target transaction merchant, and target transaction information between the target transaction user and the target transaction merchant; A target context information sequence is constructed according to the target transaction user information, the target transaction merchant information, the target transaction information, the correspondence between the target transaction user information and the target transaction information, and the correspondence between the target transaction merchant information and the target transaction information; wherein the target context information sequence has the same sequence attribute as the context information sequence in the model training method according to any one of claims 1 to 6; The target context information sequence corresponding to the target transaction is input into the abnormality judgment model to obtain the abnormality judgment result corresponding to the target transaction output by the abnormality judgment model; wherein the abnormality judgment model is a model trained according to the model training method described in any one of claims 1-6, and the abnormality judgment result is used to indicate whether the target transaction is an abnormal transaction.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, it implements the model training method as described in any one of claims 1 to 6, or, when executing the program, it implements the abnormality determination method as described in claim 7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, it implements the model training method as described in any one of claims 1 to 6, or, when the program is executed, it implements the abnormality determination method as described in claim 7.

10. A computer program product, comprising a computer program, characterized in that When executed by a processor, the computer program implements the model training method as described in any one of claims 1 to 6, or implements the abnormality determination method as described in claim 7.