Transaction relationship-based information encoding method and device, equipment and medium

By obtaining transaction vectors and neighbor transaction vectors, and utilizing the multi-head attention mechanism and gated residual connection mechanism, we learn and aggregate transaction relationship information, solving the problem of transaction relationships not being reflected in existing technologies and improving the accuracy of information encoding and the precision of transaction operations.

CN115293897BActive Publication Date: 2025-10-21CHINA UNIONPAY
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210885030.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-26
Publication Date
2025-10-21
Estimated Expiration
2042-07-26

AI Technical Summary

Technical Problem

Existing technologies are unable to effectively reflect the relationship between transactions, resulting in insufficient accuracy of information coding in operations such as transaction classification and risk detection.

Method used

By obtaining transaction vectors and neighbor transaction vectors, the multi-head attention mechanism and gated residual connection mechanism are used to learn the relationship information between transactions and aggregate it into the information encoding of the transaction, including the relationship information between transactions.

Benefits of technology

It improves the accuracy of information coding and enhances the precision of operations such as transaction classification and risk detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115293897B_ABST
    Figure CN115293897B_ABST
Patent Text Reader

Abstract

The application discloses a transaction relationship-based information encoding method and device, equipment and medium, and belongs to the field of data processing. The method comprises the following steps: acquiring a plurality of transaction vectors, each transaction vector representing attribute information of a transaction; obtaining a plurality of attention head output matrices according to the transaction vector, a neighbor transaction vector of the transaction vector, a random weight vector and a preset attention head output conversion matrix, the neighbor transaction vector being associated with the transaction vector, the plurality of attention head output matrices comprising a plurality of attention head output vectors, and the attention head output vector being used for representing the influence of the transaction of the neighbor transaction vector on the transaction of the transaction vector; acquiring a numerical information vector corresponding to the transaction vector; and obtaining information encoding of the transaction indicated by the transaction vector based on the transaction vector, the numerical information vector and the attention head output vector corresponding to the transaction vector. According to the embodiment of the application, the accuracy of business operation based on information encoding and other information of the transaction can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular to a method, apparatus, device and medium for encoding information based on transaction relationships. Background Art

[0002] With the continuous development of payment technology, online transactions have become a major trend. Each online transaction generates a large amount of information. In order to facilitate the use of transaction-related information for certain operations such as transaction classification and risk detection, this information needs to be encoded.

[0003] Multiple transactions can form a transaction network. Within a complex transaction network, the relationships between transactions have a significant impact on operations such as transaction classification and risk detection. Current information encoding methods fail to reflect these relationships, reducing the accuracy of operations such as transaction classification and risk detection based on information encoding. Summary of the Invention

[0004] The embodiments of the present application provide a transaction relationship-based information encoding method, apparatus, device, and medium, which can improve the accuracy of business operations based on information such as transaction information encoding.

[0005] In a first aspect, an embodiment of the present application provides an information encoding method based on transaction relationships, including: obtaining multiple transaction vectors, each transaction vector representing attribute information of a transaction; obtaining a multi-attention head output matrix based on the transaction vector, the neighbor transaction vector of the transaction vector, a random trade-off vector and a preset attention head output conversion matrix, the neighbor transaction vector is associated with the transaction vector, and the multi-attention head output matrix includes multiple multi-attention head output vectors, each multi-attention head output vector is used to represent the impact of the transaction of the neighbor transaction vector on the transaction of a transaction vector; obtaining a numerical information vector corresponding to the transaction vector, and obtaining information encoding of the transaction indicated by the transaction vector based on the transaction vector, the numerical information vector and the multi-attention head output vector corresponding to the transaction vector.

[0006] In a second aspect, an embodiment of the present application provides an information encoding device based on transaction relations, including: an acquisition module for acquiring multiple transaction vectors, each transaction vector representing attribute information of a transaction; a generation module for obtaining a multi-attention head output matrix based on the transaction vector, the neighbor transaction vector of the transaction vector, a random trade-off vector and a preset attention head output conversion matrix, the neighbor transaction vector is associated with the transaction vector, and the multi-attention head output matrix includes multiple multi-attention head output vectors, each multi-attention head output vector is used to represent the impact of the transaction of the neighbor transaction vector on the transaction of a transaction vector; an encoding module for obtaining a numerical information vector corresponding to the transaction vector, and obtaining information encoding of the transaction indicated by the transaction vector based on the transaction vector, the numerical information vector and the multi-attention head output vector corresponding to the transaction vector.

[0007] In a third aspect, an embodiment of the present application provides an information encoding device based on transaction relationships, comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the information encoding method based on transaction relationships of the first aspect is implemented.

[0008] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having computer program instructions stored thereon. When the computer program instructions are executed by a processor, the information encoding method based on transaction relationships of the first aspect is implemented.

[0009] The embodiments of the present application provide a method, apparatus, device and medium for information encoding based on transaction relationships, which can obtain a multi-attention head output vector based on a transaction vector representing attribute information of a transaction, a neighbor transaction vector of the transaction vector, a random trade-off vector and an attention head output conversion matrix. Based on the transaction vector, the numerical information vector and the multi-attention head output vector, the information encoding of the transaction indicated by the transaction vector is obtained. The multi-attention head output vector corresponding to the transaction vector represents the impact of the transaction of the neighbor transaction vector on the transaction of the transaction vector, that is, it represents the relationship information between the neighbor transaction and the transaction. Therefore, the information encoding obtained based on the multi-attention head output vector includes the relationship information between transactions, which can improve the accuracy of the information encoding, and thereby improve the accuracy of operations such as transaction classification and risk detection based on information such as the information encoding of the transaction. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0011] Figure 1 A schematic diagram illustrating an example relationship between resource cards, merchants, and transactions provided in an embodiment of the present application;

[0012] Figure 2 A schematic diagram of an example of a transaction provided in an embodiment of the present application;

[0013] Figure 3 A flowchart of a transaction relationship-based information encoding method provided in one embodiment of the present application;

[0014] Figure 4 A flowchart of a transaction relationship-based information encoding method provided in another embodiment of the present application;

[0015] Figure 5 A flowchart of a transaction relationship-based information encoding method provided in yet another embodiment of the present application;

[0016] Figure 6 A flowchart of a transaction relationship-based information encoding method provided in yet another embodiment of the present application;

[0017] Figure 7 A logical diagram of an example of a transaction relationship-based information encoding method provided in an embodiment of the present application;

[0018] Figure 8 A schematic diagram showing a comparison of the area under the receiver operating characteristic curve values ​​of multiple models provided in an embodiment of the present application;

[0019] Figure 9 A schematic diagram of the structure of an information encoding device based on transaction relationships provided in one embodiment of the present application;

[0020] Figure 10 A schematic diagram of the structure of an information encoding device based on transaction relationships provided in another embodiment of the present application;

[0021] Figure 11 A schematic diagram of the structure of an information encoding device based on transaction relationships provided in one embodiment of the present application. DETAILED DESCRIPTION

[0022] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is merely to provide a better understanding of the present application by illustrating the examples of the present application.

[0023] With the continuous development of payment technology, online transactions have become a major trend. Each online transaction generates a large amount of information. To facilitate the use of transaction-related information for operations such as transaction classification and risk detection, this information needs to be encoded. Multiple transactions can form a transaction network. In a complex transaction network, the relationships between transactions have a significant impact on operations such as transaction classification and risk detection related to the transaction information. The current encoding of information does not reflect the relationship between transactions, which reduces the accuracy of operations such as transaction classification and risk detection based on information encoding and other information.

[0024] The present application provides a transaction relationship-based information encoding method, apparatus, device, and medium. Based on the transaction vector of a transaction and the neighbor transaction vectors associated with the transaction vector, a multi-head attention mechanism can be used to learn the importance of temporally associated neighbor transaction vectors to the transaction vector. A gated residual connection mechanism can also be used to learn the importance of neighbor transaction vectors of each order to the transaction vector. The importance of neighbor transaction vectors to the transaction vector can represent the relationship information between neighbor transactions. The importance of neighbor transaction vectors to the transaction vector is aggregated into the information encoding of the transaction indicated by the transaction vector. The content of the transaction represented by this information encoding can include relationship information between transactions, which can reflect the relationship between transactions, thereby improving the accuracy of the information encoding corresponding to the transaction, and further improving the accuracy of operations such as transaction classification and risk detection based on information such as the transaction information encoding.

[0025] Each transaction is associated with resource cards, merchants, and other transactions. Based on this association information, a relationship diagram of resource cards, merchants, and transactions can be constructed. Within this relationship diagram, the relationships between transactions can be used to identify neighboring transactions. Neighboring transactions are other transactions associated with a transaction. Based on the closeness of the relationship between transactions, neighboring transactions can be categorized as first-order neighboring transactions, second-order neighboring transactions, third-order neighboring transactions, and so on. The order of neighboring transactions is not limited here. A second-order neighboring transaction of a transaction can be considered a first-order neighboring transaction of a first-order neighboring transaction, and a third-order neighboring transaction can be considered a first-order neighboring transaction of a second-order neighboring transaction. The lower the order, the closer the relationship between the neighboring transaction and the transaction; the higher the order, the more distant the relationship. The relationship between transactions and neighboring transactions can include temporal relationships and relationships involving the same merchant and / or resource card, which are not limited here.

[0026] For example, Figure 1 This is a schematic diagram of an example relationship between resource cards, merchants, and transactions provided in an embodiment of the present application, as shown in FIG. Figure 1As shown, nodes A1, A2, and A3 represent resource cards, nodes B1, B2, B3, B4, B5, B6, B7, B8, and B9 represent transactions, and nodes C1 and C2 represent merchants. Transactions can be associated based on the corresponding resource cards and / or merchants. Specifically, the resource cards corresponding to nodes B1, B2, B3, and B4 are the same as the merchants, and nodes B1, B2, B3, and B4 are first-order neighbor transactions; the resource cards corresponding to nodes B6 and B7 are the same as the merchants, and nodes B6 and B7 are first-order neighbor transactions; the resource cards corresponding to nodes B8 and B9 are the same as the merchants, and nodes B8 and B9 are first-order neighbor transactions. Nodes B4 and B5 correspond to the same merchant but different resource cards, so they can trade with each other as second-order neighbors. Nodes B7 and B8 correspond to the same resource card but different merchants, so they can trade with each other as second-order neighbors. Nodes B1 and B9 correspond to different merchants and resource cards, so they can trade with each other as third-order neighbors. Other nodes representing transactions also have other neighbor transaction relationships, which are not detailed here.

[0027] For example, Figure 2 A diagram showing an example of a transaction provided in an embodiment of the present application, such as Figure 2 As shown, nodes R1, R2, R3, R4, R5, R6, R7, and R8 represent transactions, and transactions can be associated in the order of occurrence time. Figure 2 The connection lines between nodes in the network have a direction, from the node with the earlier transaction to the node with the later transaction. Directly connected nodes can be first-order neighbors, while indirectly connected nodes can be second-order neighbors. The more intermediate nodes an indirect connection requires, the higher the order of neighbor transactions and the more distant the relationship between the transactions.

[0028] The following describes the transaction relationship-based information encoding method, device, equipment, and medium provided in this application.

[0029] In the first aspect of the present application, a transaction relationship-based information encoding method is provided, which can be applied to transaction relationship-based information encoding devices, equipment, etc., that is, the transaction relationship-based information encoding method can be executed by transaction relationship-based information encoding devices and equipment, and the type of transaction relationship-based information encoding devices and equipment is not limited here. Figure 3 This is a flow chart of a transaction relationship-based information encoding method provided in one embodiment of the present application. Figure 3 As shown, the information encoding method based on transaction relationship may include steps S101 to S103.

[0030] In step S101 , multiple transaction vectors are obtained.

[0031] Each transaction vector represents the attribute information of a transaction. The transaction vector can be obtained based on the attribute information of the transaction, and the method and algorithm for obtaining the transaction vector are not limited here.

[0032] Each transaction generates both attribute information and numerical information. Attribute information is information generated by a transaction that cannot be directly represented by numerical values. For example, attribute information may include the transaction location, transaction currency, and transaction type. However, attribute information can be represented by numerical codes. For example, if the transaction currencies include RMB and Euro, RMB can be represented by 001 and Euro by 002. Numerical information is information generated by a transaction that can be directly represented by numerical values. For example, numerical information may include transaction volume and transaction time. For example, if the transaction volume is 200 RMB, the numerical information would be 200.

[0033] In some examples, transaction vectors may be associated based on the chronological order of transactions. The details of this association can be found in the description of the above embodiments and are not further elaborated here. Transaction vectors may also be associated based on the same resource card and / or merchant, i.e., transactions with the same resource card and / or merchant can be associated. The details of this association can be found in the description of the above embodiments and are not further elaborated here.

[0034] In some examples, the multiple transaction vectors obtained may be transaction vectors corresponding to the same transaction object, which may include a resource card and / or a merchant. In some examples, the multiple transaction vectors obtained may be transaction vectors corresponding to different transaction objects.

[0035] In step S102, a multi-attention head output matrix is ​​obtained according to the transaction vector, the neighbor transaction vectors of the transaction vector, the random weight vector and the preset attention head output conversion matrix.

[0036] If a transaction is associated with another transaction, then the other transaction is a neighbor transaction of the transaction. Correspondingly, the transaction can be represented by a transaction vector, and the neighbor transaction can be represented by a neighbor transaction vector. The neighbor transaction vector is associated with the transaction vector.

[0037] The random trade-off vector is used to weigh the impact of different neighboring transaction vectors on the transaction vector. This weighting can be increased for neighboring transaction vectors with close relationships to the transaction vector, while decreasing the weighting for neighboring transaction vectors with close relationships to the transaction vector. The random trade-off vector can be set based on the scenario, requirements, and experience, and is not limited here.

[0038] The multi-attention head output matrix includes multiple multi-attention head output vectors. The attention head output conversion matrix is ​​used to convert the multi-attention head output matrix to ensure that the format of the multiple multi-attention head output vectors in the multi-attention head output matrix is ​​consistent, which facilitates calculation.

[0039] For each transaction vector, the importance parameter of each neighboring transaction vector to the transaction vector under each attention head condition can be calculated based on the transaction vector, its neighboring transaction vectors, and the random weight vector. The number of attention heads in the multi-head attention mechanism can be predefined, and each attention head condition corresponds to a single attention head output vector. Based on the importance parameter of each neighboring transaction vector to the transaction vector and the transaction vector, multiple single attention head output vectors corresponding to the transaction vector can be obtained. Based on these multiple single attention head output vectors, a multi-attention head output matrix for the transaction vector is obtained. Each multi-attention head output vector in the multi-attention head output matrix represents the impact of the transactions of the neighboring transaction vector on the transactions of the transaction vector.

[0040] In step S103, a numerical information vector corresponding to the transaction vector is obtained, and based on the transaction vector, the numerical information vector, and the multi-attention head output vector corresponding to the transaction vector, the information encoding of the transaction indicated by the transaction vector is obtained.

[0041] Each numerical information vector represents the numerical information of a transaction. The specific content of the numerical information can be found in the relevant description in the above embodiment and will not be repeated here.

[0042] Based on the transaction vector, the numerical information vector, and the multi-attention head output vector corresponding to the transaction vector, an information encoding of the transaction can be obtained. Since the transaction vector can represent the attribute information of the transaction, the numerical information vector can represent the attribute information of the transaction, and the multi-attention head output vector corresponding to the transaction vector represents the impact of the transactions of the neighboring transaction vector on the transactions of the transaction vector, that is, the relationship information between the neighboring transactions and the transaction. Therefore, the content represented by the information encoding can include the attribute information of the transaction, the attribute information of the transaction, and the relationship information between the neighboring transactions and the transaction. In other words, the information encoding obtained in the embodiments of the present application includes the relationship information between transactions, which improves the accuracy of the information encoding, and thus can improve the accuracy of operations such as transaction classification and risk detection based on information such as the transaction information encoding.

[0043] In some examples, a gated residual connection mechanism can be used to process the transaction vector, the numerical information vector, and the multi-attention head output vector corresponding to the transaction vector to obtain the corresponding information encoding.

[0044] In an embodiment of the present application, a multi-attention head output vector can be obtained based on a transaction vector representing attribute information of a transaction, a neighboring transaction vector of the transaction vector, a random trade-off vector, and an attention head output transition matrix. Based on the transaction vector, the numerical information vector, and the multi-attention head output vector, an information encoding of the transaction indicated by the transaction vector is obtained. The multi-attention head output vector corresponding to the transaction vector represents the impact of the transactions of the neighboring transaction vector on the transactions of the transaction vector, that is, it represents the relationship information between the neighboring transactions and the transaction. Therefore, the information encoding obtained based on the multi-attention head output vector includes the relationship information between transactions, which can improve the accuracy of the information encoding, and thus improve the accuracy of operations such as transaction classification and risk detection based on information such as the transaction information encoding.

[0045] Moreover, the number of transactions will continue to increase over time. As the number of transactions increases, the relationship information between transactions will also continue to increase. For example, the proportion of attribute information and relationship information of an institution from February to October of a year is shown in Table 1 below:

[0046] Table 1

[0047] month Attribute information ratio Relationship information ratio 2 82.3% 17.7% 3 81.6% 18.4% 4 76.9% 23.1% 5 77.0% 23.0% 6 78.7% 21.3% 7 73.5% 26.5% 8 73.8% 26.2% 9 72.3% 27.7% 10 71.9% 28.1%

[0048] As shown in Table 1, from February to October, the proportion of relational information relative to attribute information gradually increased. Therefore, the impact of relational information on transaction representation cannot be ignored. If relational information is ignored when encoding transaction information, the accuracy of the information encoding will be greatly reduced.

[0049] In some embodiments, a multi-head attention mechanism can be used to aggregate messages, and an attribute-driven gated residual connection mechanism can be used to obtain a gated value that can measure the importance of the aggregation of neighboring transactions to participate in the calculation of information encoding, further enriching the relationship information of transactions that can be represented in the information encoding, thereby further improving the accuracy of the information encoding of transactions. Figure 4 A flowchart of a transaction relationship-based information encoding method provided in another embodiment of the present application. Figure 4 and Figure 3 The difference is that Figure 3 Step S102 in the above example can be specifically broken down into Figure 4 Steps S1021 to S1024 in Figure 3 Step S103 in the above example can be specifically broken down into Figure 4 Steps S1031 to S1033 in .

[0050] In step S1021, the importance parameter under the condition of each attention head is calculated using the first activation function and the exponential function according to the transaction vector, the transaction vectors of each neighbor of the transaction vector, and the random weight vector corresponding to each attention head.

[0051] Different attention heads correspond to different random trade-off vectors. A neighbor transaction vector is a transaction vector whose occurrence time precedes the transaction corresponding to the transaction vector. That is, the transaction corresponding to the neighbor transaction vector occurs earlier than the transaction corresponding to the transaction vector. The influence parameter of a neighbor transaction vector on the transaction vector can be obtained by applying the first activation function and the exponential function to the transaction vector, the neighbor transaction vector, and the random trade-off vector. The ratio of this influence parameter to the sum of the influence parameters of all neighbor transaction vectors on the transaction vector can be used as the importance parameter. The importance parameter is used to characterize the importance of a neighbor transaction vector to the transaction vector.

[0052] In some examples, the importance parameter of an attention condition can be obtained according to the following formula (1):

[0053]

[0054] Among them, x t is any one of the multiple transaction vectors obtained; x i is x t The transaction vector of the i-th neighbor; To include x t The set of neighbor transaction vectors; x j is x t The j-th neighbor transaction vector of a; T is a random weight vector; [x t ||x i ] is x t with x i The concatenated vector; [x t ||x j ] is x t with x j The concatenated vector; LeakyReLU is the first activation function; exp is the exponential function; for; for x i x t The first activation function here can be the LeakyReLU activation function.

[0055] In step S1022, based on the importance parameters corresponding to the transaction vector and each neighbor transaction vector, a summation algorithm and a second activation function are used to obtain the single attention head output vector under each attention head condition.

[0056] The importance parameters corresponding to the transaction vector and each neighbor transaction vector can be used as the weight of the influence of the neighbor transaction vector on the transaction vector. The summation algorithm and the second activation function are used to obtain the single attention output vector.

[0057] In some examples, the single attention output vector can be obtained according to the following formula (2):

[0058]

[0059] in, is a set of multiple transaction vectors obtained; σ is the second activation function, specifically the sigmoid activation function; Head p is the p-th single attention output vector; the meanings of other parameters can be found in the parameter descriptions in formula (1) above and will not be repeated here.

[0060] In step S1023, the single attention head output vectors under the conditions of each attention head are merged to obtain a merged vector.

[0061] In step S1024, the product of the merged vector and the attention head output conversion matrix is ​​determined as the multi-attention head output matrix.

[0062] The merging can be performed using the Concat merging function, which is not limited here. In some examples, the multi-attention head output matrix can be obtained according to the following formula (3):

[0063] H=Concat(Head1,…,Headh att )W o (3)

[0064] Among them, Concat is the merging function; W o is the attention head output conversion matrix; H is the multi-attention head output matrix; h att is the number of attention heads; the meanings of other parameters can be found in the parameter descriptions in formula (2) above and will not be repeated here.

[0065] The multi-attention head output matrix may include multiple multi-attention head output vectors. The relationship between the multi-attention head output matrix and the multi-attention head output vector is shown in the following formula (4):

[0066]

[0067] Among them, h1 is the output vector of the first multi-attention head; h q is the output vector of the qth multi-attention head; the meaning of other parameters can be found in the parameter description in formula (3) above and will not be repeated here.

[0068] Through the above steps S1021 to S1024, the importance of each neighbor transaction vector temporally associated with the transaction vector of each transaction can be automatically learned.

[0069] In step S1031, the transaction vector, the numerical information vector, and the multi-attention head output vector corresponding to the transaction vector are concatenated to obtain a concatenated vector.

[0070] The concatenated vector can represent the following contents: the attribute information of the transaction, the numerical information of the transaction, and the importance of neighbor transactions to the transaction.

[0071] In step S1032, a random constant conversion vector is obtained, and based on the concatenation vector and the random constant conversion vector, a gating value corresponding to the transaction vector is obtained using a third activation function.

[0072] The random constant conversion vector is used to convert the concatenated vector into a constant. This setting can be based on the scenario, requirements, experience, and other factors, and is not limited here. The third activation function can be a sigmoid activation function, but is not limited thereto. The gating value measures the importance of neighbor transactions to the transaction, specifically, the importance of the neighbor transaction vector to the transaction vector. The gating value is greater than or equal to 0 and less than or equal to 1. When the gating value is 0, the importance of neighbor transactions to the transaction is considered zero. As the gating value increases, the proportion of neighbor transactions to the transaction increases.

[0073] In some examples, the gating value corresponding to the transaction vector can be obtained according to the following formula (5):

[0074] gate t =σ([x t ||x num,t ||h t ]β t ) (5)

[0075] Among them, σ is the third activation function, which can be specifically the sigmoid activation function; x t is the transaction vector; x num,t is the numerical information vector; h t is the transaction vector x t The corresponding multi-attention head output vector; β t Convert vector to random constant; gate t is x t The gate value of .

[0076] In step S1033, the information encoding of the transaction indicated by the transaction vector is calculated based on the gate value, the multi-attention head output vector corresponding to the transaction vector, and the transaction vector.

[0077] The output vector of multiple attention heads can reflect the influence of neighbor transaction vectors on the transaction vector. The gate value and the difference between 1 and the gate value can be used as the weight of the multi-attention head output vector and the weight of the transaction vector, respectively, to aggregate the multi-attention head output vector and the transaction vector. This realizes the use of the gated residual connection mechanism to aggregate the importance of the neighbor transaction vector into the information encoding of the transaction, so that the information encoding can represent the importance of the neighbor transaction to the transaction, that is, to reflect the relationship information between transactions.

[0078] In some examples, the information encoding of the transaction indicated by the transaction vector can be obtained according to the following formula (6):

[0079] z t =gate t ·h t +(1-gate t )·x t (6)

[0080] Among them, x t is the transaction vector; gate t is x t The gate value of h t is the transaction vector x t The corresponding multi-attention head output vector; z t Encodes information about the transaction indicated by the transaction vector.

[0081] In an embodiment of the present application, the relationship between a high-order neighbor transaction and a transaction can be transmitted to the first-order neighbor transaction of the transaction through the influence of the high-order neighbor transaction as the influence of the low-order neighbor transaction of the low-order neighbor transaction. For example, the relationship between a second-order neighbor transaction and a transaction can be transmitted to the first-order neighbor transaction of the transaction through the influence of the first-order neighbor transaction of the first-order neighbor transaction as the influence of the first-order neighbor transaction of the first-order neighbor transaction, and then aggregated with the information of the first-order neighbor transaction, and then the influence of the first-order neighbor transaction on the transaction is transmitted to the transaction, and aggregated with the information of the transaction. The content of the information coding guarantee of the obtained transaction may include the relationship information between the first-order neighbor transaction and the second-order neighbor transaction and the transaction. For example, the relationship between transactions is as follows: Figure 2 As shown, node R2 is the first-order neighbor transaction of node R5, and node R1 is the second-order neighbor transaction of node R5. The influence of node R1 as a second-order neighbor transaction on the transaction of node R5 can be first transmitted to the transaction of node R2 through the influence of node R1 as a first-order neighbor transaction on node R2, and aggregated with the information of node R2's transaction, and then transmitted to node R5 through the influence of node R2 as a first-order neighbor transaction on node R5, and aggregated with the information of node R5's transaction. The information encoding of the transaction of node R5 obtained will include the relationship information between node R2 and node R5, as well as the relationship information between node R1 and node R5.

[0082] Among the m-th order neighbor vectors of a transaction vector, the m-th order neighbor transaction vector can be used as the first-order vector of the m-1th order neighbor transaction vector. Using the transaction relationship-based information encoding method described in the above embodiment, the multi-attention head output vector corresponding to the m-1th order neighbor transaction vector can be obtained. When the m-1th order neighbor transaction vector is used as the first-order vector of the m-2th order neighbor transaction vector, the multi-attention head output vector corresponding to the m-1th order neighbor transaction vector is used as the m-1th order neighbor transaction vector to participate in the information encoding process for the transaction indicated by the m-2th order neighbor transaction vector. Similarly, the influence between different-order neighbor transaction vectors is transferred step by step, so that in the process of obtaining the information encoding of the transaction vector, not only the importance of the first-order neighbor transaction vector to the transaction vector is learned, but also the importance of the higher-order neighbor transaction vectors to the transaction vector.

[0083] In some embodiments, a newly emerged transaction may be associated with other transactions preceding the newly emerged transaction, and the information encoding of the newly emerged transaction may also be obtained according to the aforementioned transaction relationship-based information encoding method. That is, the relationship information between the newly emerged transaction and other transactions preceding the newly emerged transaction may be reflected in the information encoding of the newly emerged transaction. The transaction relationship-based information encoding method in the embodiments of the present application can be applied to the information encoding of transactions in a dynamically changing transaction network graph, and can adapt to dynamically changing heterogeneous graphs related to transactions. Figure 5 A flowchart of a transaction relationship-based information encoding method provided in yet another embodiment of the present application. Figure 5 and Figure 3 The difference is that Figure 5 The transaction relationship-based information encoding method shown may further include steps S104 to S106.

[0084] In step S104, when a newly added transaction vector is obtained, the multi-attention head output vector corresponding to the previous transaction vector is determined as a neighbor transaction vector of the newly added transaction vector.

[0085] The preceding transaction vector is the transaction vector of a transaction occurring before the transaction in the newly added transaction vector. To convey the importance of neighboring transaction vectors occurring before the preceding transaction vector to the newly added transaction vector, the multi-attention head output vector corresponding to the preceding transaction vector is determined as the newly added transaction vector. That is, the multi-attention head output vector corresponding to the preceding transaction vector is used as the newly added transaction vector to participate in the process of generating the information encoding of the transaction indicated by the newly added transaction vector.

[0086] In step S105, the multi-attention head output matrix corresponding to the newly added transaction vector is obtained according to the newly added transaction vector, the multi-attention head output vector corresponding to the previous transaction vector, the random weight vector and the attention head output conversion matrix.

[0087] In step S106, a numerical information vector corresponding to the newly added transaction vector is obtained, and based on the newly added transaction vector, the numerical information vector corresponding to the newly added transaction vector, and the multi-attention head output vector corresponding to the newly added transaction vector, the information encoding of the transaction indicated by the newly added transaction vector is obtained.

[0088] The specific contents of step S105 and step S106 can be found in the relevant descriptions of step S102, step S103, step S1021 to step S1024, and step S1031 to step S1033 in the above embodiment, which will not be repeated here.

[0089] In some embodiments, the information encoding of the transaction is used to train the business model. The information encoding of the transaction can be input into the business model, and the output results of the business model can be used for back propagation to optimize and update the model-related parameters of the business model to achieve optimization of the model. Figure 6 A flowchart of a transaction relationship-based information encoding method provided in yet another embodiment of the present application. Figure 6 and Figure 3 The difference is that Figure 6 The transaction relationship-based information encoding method shown may further include steps S107 to S109.

[0090] In step S107, the information code is input into the business model to obtain a first output result output by the business model.

[0091] The first output result is an output result of a business model corresponding to the information encoding.

[0092] Business models may include, but are not limited to, transaction classification models and risk detection models. For example, a risk detection model may include a fraud detection model for detecting fraudulent transactions, which uses aggregated attribute information to classify or detect risks. The output of the business model may represent the classification or detection results of transactions corresponding to the aggregated attribute information.

[0093] The business model may include models such as a two-layer perceptron, logistic regression, support vector machine, neural network, etc., but is not limited here. Different business models have different expressions. For example, if the business model is a two-layer perceptron, the output result of the business model can be obtained according to the following formula (7):

[0094]

[0095] Where σ is the sigmoid activation function; PReLU is a parameterized linear rectifier unit; Z is the aggregation matrix of the information encoding of transactions of multiple transaction vectors, that is, the information encoding of transactions including multiple transaction vectors; b0, c0, b1, and c1 are constant coefficients; is the output result.

[0096] In step S108, the actual result label corresponding to the transaction indicated by the information code is obtained, and a first binary cross entropy is obtained according to the number of transaction vectors, the first output result and the actual result label.

[0097] The actual result label corresponding to the transaction indicated by the information code can represent the actual result of the transaction. For example, if the business model is a fraud detection model, the first output result includes a first identifier indicating a fraudulent transaction or a second identifier indicating a non-fraudulent transaction. The actual result label includes the first identifier or the second identifier. If the transaction is actually fraudulent, the actual result label is the first identifier; if the transaction is actually non-fraudulent, the actual result label is the second identifier.

[0098] The first binary cross entropy is calculated based on the number of transaction vectors, the first output result, and the actual result label. This binary cross entropy is used to evaluate the quality of the business model's predictions, i.e., the output results.

[0099] In some examples, the binary cross entropy can be obtained according to the following formula (8):

[0100]

[0101] Where N is the number of transaction vectors; y i The output of the business model for the i-th transaction vector; is the actual result label of the i-th transaction vector; is the binary cross entropy.

[0102] In step S109 , the model-associated parameters are optimized and updated based on the information coding, the model-associated parameters of the business model, and the first binary cross entropy.

[0103] Model-related parameters include parameters related to the business model. Changes in model-related parameters will affect the business model. By adjusting the model-related parameters, the business model can be optimized and updated.

[0104] In some examples, model-associated parameters can be updated using a mini-batch gradient descent method. A second output of the business model can be obtained using the business model based on the information encoding, the model-associated parameters, and a preset first increment. A second binary cross entropy can be obtained based on the number of transaction vectors, the second output, and the actual result label. An optimization gradient of the business model can be calculated based on the first binary cross entropy, the second binary cross entropy, and the first increment, and the model parameters of the business model can be updated using the optimization gradient until the optimization effect, as represented by the optimization effect parameters of the business model, reaches a peak.

[0105] The first increment can be a positive value or a negative value, which is not limited here. The first increment can be added to the model-associated parameter to update the business model, and the information encoding is input into the business model after the model-associated parameter is updated to obtain a second output result. The process of calculating the second binary cross entropy can refer to the relevant description of calculating the first binary cross entropy in the above embodiment, which will not be repeated here. The optimization gradient can be the ratio of the first difference to the first increment, and the first difference is the difference between the second binary cross entropy and the first binary cross entropy.

[0106] The optimization effect parameter can represent the optimization effect of the business model and can be used to evaluate and calculate the business model to obtain the optimization effect parameter. In some examples, the information encoding of a portion of transactions is used to train the business model, while the information encoding of another portion of transactions is used to test the trained business model. The information encoding of the transactions used to test the trained business model can be used to evaluate and calculate the business model to obtain the optimization effect parameter.

[0107] According to the optimization gradient, the model-associated parameters can be updated to update the business model. The optimization effect represented by the optimization effect parameters of the updated business model can be improved. The above steps S107 to S109 can be executed cyclically until the optimization effect represented by the optimization effect parameters of the business model no longer improves but decreases. It can be determined that the optimization effect has reached a peak, and the updated model-associated parameters with the best optimization effect can be used as the model-associated parameters finally adopted by the business model.

[0108] Figure 7 This is a logical diagram of an example of the information encoding method based on transaction relationships provided in an embodiment of the present application. According to the order of transaction occurrence time, the neighboring transactions of any transaction can be obtained. Multiple transaction vectors are x t1 、x t2 ,……,x tn , the previous transaction vector is the neighbor transaction vector of the next transaction vector. Each transaction vector will undergo the Temporal Graph Attention (TGAT) mechanism and the Gated Residual mechanism. The results of the previous transaction vector undergoing the TGAT and Gated Residual mechanisms will be passed to the calculation process of the next transaction vector, thereby transmitting the importance of the neighbor transaction vector to the transaction vector step by step. This ensures that the information encoded and represented by the input business model includes transaction relationship information, and the output results of the business model are more accurate.

[0109] In order to more intuitively reflect the improvement in the business model effect obtained by the information coding training generated by the information coding method based on transaction relationships in the embodiment of the present application, the performance improvement of the information coding method based on transaction relationships in the embodiment of the present application is illustrated by a bar chart below. Figure 8 This is a comparative diagram of the area under the receiver operating characteristic curve (AUC) values ​​of multiple models provided in the embodiments of the present application. Figure 8 As shown, the vertical direction is the AUC value and the horizontal direction is the model type. Under the same transaction information, among the AUC values ​​of the business models trained by various methods to obtain information coding, the AUC value of the business model obtained by information coding training based on the information coding method of transaction relationship (abbreviated as GTAN) in the embodiment of the present application is higher than that of other baseline models. The baseline model may include common machine learning and deep learning models. The AUC value of the business model obtained by GTAN training in the embodiment of the present application can reach about 0.9. Figure 8 As shown, the bar graphs 1 to 8 respectively represent the AUC values ​​of models such as logistic regression (LR), gradient boosting decision tree (GBDT), multilayer perceptron (MLP), Deep&Wide model, maximum convolutional neural network (CNN-max), AdaBM model, long short-term neural network sequence (LSTM-seq), and STAGN model. The bar graph 9 corresponds to the AUC value of the GTAN model in the embodiment of the present application. The classification prediction performance is better than the baseline model.

[0110] The business model trained using GTAN in the embodiment of the present application achieved an average accuracy greater than 0.55 on the test dataset, outperforming baseline models. Baseline models can include common machine learning and deep learning models. In addition to the common models mentioned above, baseline models can also include STAN models, GTAN-noatt models, and other models. For example, using the same test dataset, the average accuracy of GTAN in the embodiment of the present application was greater than 0.55, while the highest average accuracy among the baseline models was less than 0.52, failing to achieve the same accuracy as the embodiment of the present application.

[0111] The second aspect of the present application provides an information encoding device based on transaction relationships. Figure 9 This is a schematic diagram of the structure of the information encoding device based on transaction relationship provided by an embodiment of the present application. Figure 9 As shown, the information encoding device 200 may include an acquisition module 201 , a generation module 202 and an encoding module 203 .

[0112] The acquisition module 201 may be configured to acquire multiple transaction vectors, each transaction vector representing attribute information of a transaction.

[0113] In some examples, the transaction vectors are associated according to the chronological order of the transactions; and / or the transaction vectors are associated according to the corresponding resource cards and / or merchants.

[0114] The generation module 202 may be configured to obtain a multi-attention head output matrix based on the transaction vector, the neighboring transaction vectors of the transaction vector, the random weight vector, and a preset attention head output conversion matrix.

[0115] The neighbor transaction vector is associated with the transaction vector. The multi-attention head output matrix includes multiple multi-attention head output vectors. Each multi-attention head output vector is used to represent the impact of the transactions of the neighbor transaction vector on the transactions of a transaction vector.

[0116] The encoding module 203 can be used to obtain a numerical information vector corresponding to the transaction vector, and obtain the information encoding of the transaction indicated by the transaction vector based on the transaction vector, the numerical information vector, and the multi-attention head output vector corresponding to the transaction vector.

[0117] In an embodiment of the present application, a multi-attention head output vector can be obtained based on a transaction vector representing attribute information of a transaction, a neighboring transaction vector of the transaction vector, a random trade-off vector, and an attention head output transition matrix. Based on the transaction vector, the numerical information vector, and the multi-attention head output vector, an information encoding of the transaction indicated by the transaction vector is obtained. The multi-attention head output vector corresponding to the transaction vector represents the impact of the transactions of the neighboring transaction vector on the transactions of the transaction vector, that is, it represents the relationship information between the neighboring transactions and the transaction. Therefore, the information encoding obtained based on the multi-attention head output vector includes the relationship information between transactions, which can improve the accuracy of the information encoding, and thus improve the accuracy of operations such as transaction classification and risk detection based on information such as the transaction information encoding.

[0118] In some embodiments, the generation module 202 can be used to: calculate the importance parameter under the condition of each attention head based on the transaction vector, the neighbor transaction vectors of the transaction vector and the random weight vector corresponding to each attention head, using the first activation function and the exponential function, and the importance parameter is used to characterize the importance of the neighbor transaction vector to the transaction vector; obtain the single attention head output vector under the condition of each attention head based on the importance parameters corresponding to the transaction vector and each neighbor transaction vector, using the summation algorithm and the second activation function; merge the single attention head output vectors under the conditions of each attention head to obtain a merged vector; and determine the product of the merged vector and the attention head output conversion matrix as the multi-attention head output matrix.

[0119] In some embodiments, the encoding module 203 can be used to: splice the transaction vector, the numerical information vector and the multi-attention head output vector corresponding to the transaction vector to obtain a spliced ​​vector; obtain a random constant conversion vector, and based on the spliced ​​vector and the random constant conversion vector, use a third activation function to obtain a gating value corresponding to the transaction vector; and calculate the information encoding of the transaction indicated by the transaction vector based on the gating value, the multi-attention head output vector corresponding to the transaction vector and the transaction vector.

[0120] In some embodiments, the acquisition module 201 can also be used to: when a newly added transaction vector is acquired, determine the multi-attention head output vector corresponding to the previous transaction vector as a neighbor transaction vector of the newly added transaction vector, and the previous transaction vector is a transaction vector of a transaction whose occurrence time is between the occurrence time of the transaction of the newly added transaction vector.

[0121] The generation module 202 can also be used to obtain the multi-attention head output matrix corresponding to the newly added transaction vector based on the newly added transaction vector, the multi-attention head output vector corresponding to the previous transaction vector, the random weight vector and the attention head output conversion matrix.

[0122] The encoding module 203 can also be used to: obtain a numerical information vector corresponding to the newly added transaction vector, and based on the newly added transaction vector, the numerical information vector corresponding to the newly added transaction vector, and the multi-attention head output vector corresponding to the newly added transaction vector, obtain the information encoding of the transaction indicated by the newly added transaction vector.

[0123] Figure 10 A schematic structural diagram of a transaction relationship-based information encoding device provided in another embodiment of the present application. Figure 10 and Figure 9 The difference is that Figure 10 The transaction relationship-based information encoding device 200 shown may further include a training module 204 and an optimization module 205 .

[0124] The training module 204 may be used to input information encoding into the business model to obtain a first output result output by the business model.

[0125] The optimization module 205 can be used to obtain the actual result label corresponding to the transaction indicated by the information encoding, and obtain the first binary cross entropy based on the number of transaction vectors, the first output result and the actual result label; and to optimize and update the model-associated parameters based on the information encoding, the model-associated parameters of the business model and the first binary cross entropy.

[0126] In some embodiments, the business model is used to obtain a second output result of the business model based on the information encoding, model association parameters and a preset first increment; the second binary cross entropy is obtained based on the number of transaction vectors, the second output result and the actual result label; the optimization gradient of the business model is calculated based on the first binary cross entropy, the second binary cross entropy and the first increment, and the model parameters of the business model are updated using the optimization gradient until the optimization effect represented by the optimization effect parameters of the business model reaches a peak.

[0127] The third aspect of the present application also provides an information encoding device based on transaction relationships. Figure 11 This is a schematic diagram of the structure of an information encoding device based on transaction relationships provided in one embodiment of the present application. Figure 11 As shown, the transaction relationship-based information encoding device 300 includes a memory 301 , a processor 302 , and a computer program stored in the memory 301 and executable on the processor 302 .

[0128] In an example, the processor 302 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0129] The memory 301 may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Therefore, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the information encoding method based on the transaction relationship in the embodiment of the present application.

[0130] The processor 302 reads the executable program code stored in the memory 301 to run a computer program corresponding to the executable program code, so as to implement the information encoding method based on transaction relationship in the above embodiment.

[0131] In one example, the transaction relationship-based information encoding device 300 may further include a communication interface 303 and a bus 304. Figure 11 As shown, the memory 301 , the processor 302 , and the communication interface 303 are connected via a bus 304 and communicate with each other.

[0132] The communication interface 303 is mainly used to implement communication between the modules, devices, units and / or equipment in the embodiment of the present application. Input devices and / or output devices can also be connected through the communication interface 303.

[0133] The bus 304 includes hardware, software, or both, and couples the components of the information encoding device 300 based on transaction relationships. By way of example and not limitation, the bus 304 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-E) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses, or a combination of two or more of these. Where appropriate, the bus 304 may include one or more buses. Although embodiments herein describe and illustrate a particular bus, this application contemplates any suitable bus or interconnect.

[0134] In a fourth aspect, the present application further provides a computer-readable storage medium having computer program instructions stored thereon. When the computer program instructions are executed by a processor, the information encoding method based on transaction relationships in the above-mentioned embodiment can be implemented, and the same technical effects can be achieved. To avoid repetition, the above-mentioned computer-readable storage medium may include a non-transitory computer-readable storage medium, such as a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc., which is not limited here.

[0135] The present application provides a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the information encoding method based on transaction relationships described in the above embodiments, achieving the same technical effects. To avoid repetition, the details are not described here.

[0136] It should be understood that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. For device embodiments, equipment embodiments, computer-readable storage medium embodiments, and computer program product embodiments, the relevant parts can be referred to the description section of the method embodiment. This application is not limited to the specific steps and structures described above and shown in the figures. Those skilled in the art can make various changes, modifications and additions, or change the order of the steps after understanding the spirit of this application. In addition, for the sake of brevity, a detailed description of known method technologies is omitted here.

[0137] Aspects of the present application have been described above with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed via the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. This processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit. It is also understood that each box in the block diagram and / or the flowchart and the combination of the boxes in the block diagram and / or the flowchart can also be implemented by the dedicated hardware that performs the specified function or action, or can be implemented by the combination of dedicated hardware and computer instructions.

[0138] Those skilled in the art should understand that the above embodiments are illustrative rather than restrictive. Different technical features appearing in different embodiments can be combined to achieve beneficial effects. Based on a study of the drawings, the specification and the claims, those skilled in the art should be able to understand and implement other variations of the disclosed embodiments. In the claims, the term "comprising" does not exclude other devices or steps; the quantifier "one" does not exclude a plurality; the terms "first" and "second" are used to identify names rather than to indicate any specific order. Any figure marks in the claims should not be understood as limiting the scope of protection. The functions of multiple parts appearing in the claims can be implemented by a separate hardware or software module. The fact that certain technical features appear in different dependent claims does not mean that these technical features cannot be combined to achieve beneficial effects.

Claims

1. A method for encoding information based on transaction relationships, characterized in that: include: Acquire multiple transaction vectors, each of which represents attribute information of a transaction, wherein the attribute information is information generated by the transaction that cannot be directly represented by a numerical value; A multi-attention head output matrix is ​​obtained based on the transaction vector, the neighboring transaction vectors of the transaction vector, the random trade-off vector, and a preset attention head output conversion matrix. The neighboring transaction vectors are associated with the transaction vector. The multi-attention head output matrix includes multiple multi-attention head output vectors, each of which is used to represent the impact of transactions of a neighboring transaction vector on transactions of a transaction vector. Obtaining a numerical information vector corresponding to the transaction vector, and concatenating the transaction vector, the numerical information vector, and the multi-attention head output vector corresponding to the transaction vector to obtain a concatenated vector; Obtaining a random constant conversion vector, and obtaining a gating value corresponding to the transaction vector using a third activation function based on the concatenated vector and the random constant conversion vector; Calculating an information encoding of the transaction indicated by the transaction vector based on the gate value, the multi-attention head output vector corresponding to the transaction vector, and the transaction vector; The transaction vectors are associated in the order of transaction occurrence time; and / or, The transaction vectors are associated with corresponding resource cards and / or merchants.

2. The method according to claim 1, characterized in that The multi-attention head output matrix is ​​obtained according to the transaction vector, the neighbor transaction vector of the transaction vector, the random weight vector and the preset attention head output conversion matrix, including: Based on the transaction vector, each of its neighboring transaction vectors, and the random weight vector corresponding to each attention head, the first activation function and the exponential function are used to calculate the importance parameter under the condition of each attention head. The importance parameter is used to represent the importance of the neighboring transaction vector to the transaction vector. According to the importance parameters corresponding to the transaction vector and each neighbor transaction vector, a summation algorithm and a second activation function are used to obtain a single attention head output vector under each attention head condition; Merge the single attention head output vectors under the conditions of each attention head to obtain the merged vector; The product of the merged vector and the attention head output transformation matrix is ​​determined as the multi-attention head output matrix.

3. The method according to claim 1, characterized in that Also includes: When a new transaction vector is obtained, the multi-attention head output vector corresponding to the previous transaction vector is determined as a neighbor transaction vector of the new transaction vector, where the previous transaction vector is a transaction vector of transactions whose occurrence time is between the occurrence time of the transaction of the new transaction vector; Obtaining the multi-attention head output matrix corresponding to the newly added transaction vector according to the newly added transaction vector, the multi-attention head output vector corresponding to the previous transaction vector, the random weight vector, and the attention head output conversion matrix; Obtain a numerical information vector corresponding to the newly added transaction vector, and based on the newly added transaction vector, the numerical information vector corresponding to the newly added transaction vector, and the multi-attention head output vector corresponding to the newly added transaction vector, obtain the information encoding of the transaction indicated by the newly added transaction vector.

4. The method according to claim 1, wherein Also includes: Inputting the information code into the business model to obtain a first output result output by the business model; Obtaining an actual result label corresponding to the transaction indicated by the information code, and obtaining a first binary cross entropy based on the number of transaction vectors, the first output result, and the actual result label; Based on the information coding, the model-associated parameters of the business model and the first binary cross entropy, the model-associated parameters are optimized and updated.

5. The method according to claim 4, characterized in that The optimizing and updating the model-associated parameters based on the information encoding, the model-associated parameters of the business model, and the first binary cross entropy includes: Obtaining a second output result of the business model using the business model according to the information code, the model-related parameters, and the preset first increment; Obtaining a second binary cross entropy based on the number of transaction vectors, the second output result, and the actual result label; An optimization gradient of the business model is calculated based on the first binary cross entropy, the second binary cross entropy, and the first increment, and the model parameters of the business model are updated using the optimization gradient until the optimization effect represented by the optimization effect parameter of the business model reaches a peak.

6. An information encoding device based on transaction relationship, characterized in that: include: an acquisition module, configured to acquire a plurality of transaction vectors, each of which represents attribute information of a transaction, wherein the attribute information is information generated by the transaction that cannot be directly represented by a numerical value; a generation module configured to obtain a multi-attention head output matrix based on a transaction vector, a neighboring transaction vector of the transaction vector, a random trade-off vector, and a preset attention head output transformation matrix, wherein the neighboring transaction vector is associated with the transaction vector, the multi-attention head output matrix including a plurality of multi-attention head output vectors, each of which is used to represent the impact of transactions of a neighboring transaction vector on transactions of a transaction vector; an encoding module configured to obtain a numerical information vector corresponding to a transaction vector, concatenate the transaction vector, the numerical information vector, and the multi-attention head output vector corresponding to the transaction vector to obtain a concatenated vector; obtain a random constant conversion vector, and based on the concatenated vector and the random constant conversion vector, utilize a third activation function to obtain a gating value corresponding to the transaction vector; and calculate an information encoding of the transaction indicated by the transaction vector based on the gating value, the multi-attention head output vector corresponding to the transaction vector, and the transaction vector; The transaction vectors are associated in the order of transaction occurrence time; and / or, The transaction vectors are associated with corresponding resource cards and / or merchants.

7. An information encoding device based on transaction relationship, characterized in that: include: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the information encoding method based on transaction relationship as described in any one of claims 1 to 5 is implemented.

8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the information encoding method based on transaction relationships as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Abnormal key account discovery method and system based on graph neural network, equipment and storage medium

    CN113469804A

  • Session recommendation method and system based on enhanced graph neural network, and medium

    CN114116995A

  • Block chain abnormal node identification method based on dynamic graph convolutional neural network

    CN114240659A