Repeated transaction detection method and device, equipment and storage medium
By obtaining and comparing transaction feature vectors in the financial trading system, the problem of difficulty in identifying repeated transactions in the financial trading system is solved, and the accuracy and security of transaction detection are improved.
Patent Information
- Application Number
- CN202411179628.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2024-11-29
AI Technical Summary
It is difficult to accurately identify and prevent duplicate transactions in the financial trading system, resulting in economic losses for customers and damage to institutional credibility.
By obtaining the transaction data of the current transaction, determining its first transaction feature vector, and comparing it with the second transaction feature vector of the target historical transaction of the same transaction type and payer information, the similarity threshold is used to determine whether there is a risk of repeated transactions.
Improve the accuracy of repeated transaction detection, effectively identify and reduce the risks brought by repeated transactions.
Smart Images

Figure CN119048238A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a duplicate transaction detection method, device, equipment and storage medium. Background Art
[0002] At present, once a duplicate transaction occurs in a financial transaction system, it may not only cause economic losses to customers, but also seriously damage the reputation of financial institutions. Therefore, how to enable the financial transaction system to accurately determine whether the corresponding transaction has a duplicate transaction risk is a technical problem that urgently needs to be solved. Summary of the invention
[0003] The present application provides a duplicate transaction detection method, device, equipment and storage medium to solve the problem in the related art of how to enable a financial transaction system to accurately determine whether a corresponding transaction has a duplicate transaction risk.
[0004] In a first aspect, the present application provides a method for detecting duplicate transactions, the method comprising: obtaining transaction data of a current transaction, and determining a first transaction feature vector of the current transaction based on the transaction data; obtaining a target historical transaction having the same transaction type and payer information as the current transaction, wherein the transaction time of the target historical transaction is within a preset time period before the current transaction; obtaining a second transaction feature vector of the target historical transaction from a pre-established transaction feature vector library; determining the similarity between the current transaction and the target historical transaction based on the first transaction feature vector and the second transaction feature vector; comparing the similarity with a similarity threshold corresponding to the transaction type of the current transaction to determine whether the current transaction has a risk of duplicate transactions.
[0005] In a second aspect, the present application provides a duplicate transaction detection device, the device comprising: a first determination module, which acquires transaction data of a current transaction, and determines a first transaction feature vector of the current transaction based on the transaction data; a first acquisition module, which is used to acquire a target historical transaction having the same transaction type and payer information as the current transaction, wherein the transaction time of the target historical transaction is within a preset time period before the current transaction; a second acquisition module, which is used to acquire a second transaction feature vector of the target historical transaction from a pre-established transaction feature vector library; a second determination module, which is used to determine the similarity between the current transaction and the target historical transaction based on the first transaction feature vector and the second transaction feature vector; and a third determination module, which is used to compare the similarity with a similarity threshold corresponding to the transaction type of the current transaction, so as to determine whether the current transaction has a risk of duplicate transactions.
[0006] In a third aspect, the present application provides an electronic device comprising: a processor, and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the duplicate transaction detection method disclosed in an embodiment of the present application.
[0007] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the duplicate transaction detection method disclosed in the embodiment of the present application.
[0008] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the duplicate transaction detection method disclosed in the embodiment of the present application.
[0009] The technical solution of this application has the following advantages or beneficial effects:
[0010] When monitoring the risk of repeated transactions for the current transaction, the first transaction feature vector of the current transaction is determined in combination with the transaction data of the current transaction, and the target historical transaction with the same transaction type and payer information as the current transaction is obtained, and the second transaction feature vector of the target historical transaction is quickly obtained from the transaction feature vector library, and based on the second transaction feature vector of the target historical transaction and the first transaction feature vector of the current transaction, the similarity between the current transaction and the target historical transaction is accurately determined, and based on the comparison result of the similarity and the similarity threshold corresponding to the transaction type of the current transaction, it is determined whether the current transaction has the risk of repeated transactions. Thus, the similarity between the current transaction and the target historical transaction is accurately determined through the transaction feature vectors of the current transaction and the target historical transaction, and based on the similarity and the similarity threshold corresponding to the transaction type of the current transaction, the risk of repeated transactions is accurately detected for the current transaction, which can effectively identify repeated transactions, improve the accuracy of repeated transaction detection, and reduce the risks brought by repeated transactions. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0012] Figure 1 The process of the repeated transaction detection method provided in the embodiment of the present application Figure 1 ;
[0013] Figure 2 The process of the repeated transaction detection method provided in the embodiment of the present application Figure 2 ;
[0014] Figure 3The process of the repeated transaction detection method provided in the embodiment of the present application Figure 3 ;
[0015] Figure 4 A schematic diagram of the structure of a repeated transaction detection device provided in an embodiment of the present application;
[0016] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0017] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0018] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0019] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties. The acquisition, transmission, storage, use, and processing of data in the technical solution of this application are in compliance with the relevant laws and regulations of the relevant regions.
[0020] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0021] In the related art, the method for determining whether the current transaction has a risk of duplicate transaction in a financial transaction system is to search the transaction database based on the transaction identification (ID) of the current transaction to determine whether the transaction record of the transaction identification is retrieved, and determine whether the current transaction has a risk of duplicate transaction based on the search result. However, this method cannot effectively identify duplicate transactions that are sent by multiple clicks due to human error, and duplicate transaction detection is not accurate enough.
[0022] In order to enable the financial transaction system to accurately determine whether the corresponding transaction has a risk of repeated transactions, the present application proposes a method for detecting repeated transactions, which proposes the following technical ideas: when monitoring the risk of repeated transactions for the current transaction, the first transaction feature vector of the current transaction is determined in combination with the transaction data of the current transaction, and the target historical transaction with the same transaction type and payer information as the current transaction is obtained, and the second transaction feature vector of the target historical transaction is quickly obtained from the transaction feature vector library, and based on the second transaction feature vector of the target historical transaction and the first transaction feature vector of the current transaction, the similarity between the current transaction and the target historical transaction is accurately determined, and based on the comparison result of the similarity and the similarity threshold corresponding to the transaction type of the current transaction, it is determined whether the current transaction has a risk of repeated transactions. Thus, through the transaction feature vectors of the current transaction and the target transaction, the similarity between the current transaction and the target historical transaction is accurately determined, and based on the similarity and the similarity threshold corresponding to the transaction type of the current transaction, the current transaction is accurately detected for the risk of repeated transactions, which can effectively identify repeated transactions, improve the accuracy of repeated transaction detection, and reduce the risks brought by repeated transactions.
[0023] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0024] First combine Figure 1 , the repeated transaction detection method provided in the embodiment of the present application is exemplified.
[0025] Figure 1 The process of the repeated transaction detection method provided in the embodiment of the present application Figure 1 .
[0026] It should be noted that the repeated transaction detection method provided in the embodiment of the present application can be performed by a repeated transaction detection device, wherein the repeated transaction detection device can be a financial transaction system, or can be configured in a financial transaction system. The financial transaction system in this embodiment can be configured in an electronic device.
[0027] Among them, the electronic device can be any device with computing capabilities, such as a personal computer, a mobile terminal, a server, etc. The mobile terminal can be, for example, a mobile phone, a tablet computer, a personal digital assistant, and other hardware devices with various operating systems, touch screens and / or display screens.
[0028] like Figure 1 As shown, the repeated transaction detection method includes the following steps:
[0029] S101, acquiring transaction data of a current transaction, and determining a first transaction feature vector of the current transaction according to the transaction data.
[0030] In this embodiment, the current transaction may be determined based on the received current transaction request. For example, a transaction identifier carried in the current transaction request may be obtained, and the transaction corresponding to the transaction identifier may be used as the current transaction.
[0031] Among them, the transaction data of the current transaction refers to data related to the current transaction. For example, the transaction data of the current transaction may include but is not limited to: the transaction identifier, transaction time, transaction amount, payment method, transaction type and other information of the current transaction.
[0032] The first transaction feature vector is obtained by vectorizing the transaction feature of the current transaction.
[0033] In one embodiment of the present application, in order to accurately determine the first transaction feature vector of the current transaction, a possible implementation method for determining the first transaction feature vector of the current transaction based on the transaction data is: extracting features from the transaction data to obtain multiple transaction features; vectorizing the multiple transaction features to obtain feature vectors corresponding to the multiple transaction features; and concatenating the feature vectors corresponding to the multiple transaction feature vectors to obtain the first transaction feature vector. Thus, the first transaction feature vector of the current transaction is accurately determined by combining the multiple transaction features of the current transaction.
[0034] Among them, the transaction characteristics in this embodiment may include at least two of the following: transaction amount, transaction time, payer information, etc.
[0035] As an example, in order to further accurately obtain the first transaction feature vector of the current transaction, correspondingly, the above transaction features may include all of the following: transaction amount, transaction time, and payer information.
[0036] In some embodiments, in order to convert data of different dimensions to the same scale so that different transaction features can be directly compared and calculated, thereby eliminating the impact of dimensional and range differences, the following operations can be performed before vectorizing multiple transaction features to obtain feature vectors corresponding to each of the multiple transaction features: when it is determined that there is a first target transaction feature of a numerical type among the multiple transaction features, the first target transaction feature can be standardized.
[0037] In some embodiments, in order to enable the duplicate transaction detection device to more easily process transaction features of the tag type and improve computing efficiency, the following operation can be performed before vectorizing multiple transaction features respectively to obtain feature vectors corresponding to the multiple transaction features: when it is determined that there is a second target transaction feature of the tag type among the multiple transaction features, the second target transaction feature can be encoded to obtain the tag code of the second target transaction feature.
[0038] In one embodiment of the present application, in order to further improve the efficiency of obtaining the first transaction feature vector, another possible implementation method of determining the first transaction feature vector of the current transaction based on the transaction data is: inputting the transaction data into a pre-trained transaction feature vector representation model to quickly obtain the first transaction feature vector of the current transaction through the transaction feature vector representation model.
[0039] It should be noted that the transaction feature vector representation model in this embodiment is pre-trained based on training data.
[0040] S102, obtaining a target historical transaction having the same transaction type and payer information as the current transaction, wherein the transaction time of the target historical transaction is within a preset time period before the current transaction.
[0041] In some embodiments, in different application scenarios, the methods for obtaining a target historical transaction having the same transaction type and payer information as the current transaction are different, and an exemplary description is given below:
[0042] As an example, the transaction database may be queried based on the transaction type and payer information of the current transaction to obtain the target historical transaction.
[0043] In some embodiments, the transaction type and payer information of the current transaction can be extracted from the transaction data of the current transaction, or the transaction type and payer information of the current transaction can be obtained by other means. This embodiment does not specifically limit the method of obtaining the transaction type and payer information of the current transaction.
[0044] As another example, based on the payee information of the current transaction, multiple first candidate historical transactions within a preset time period before the current transaction are obtained from the transaction database, wherein the first candidate historical transactions have the same payee information as the current transaction; from the multiple first candidate historical transactions, a first candidate historical transaction with the same transaction type as the current transaction is selected as the target historical transaction. Thus, the target historical transaction is accurately obtained from the transaction database.
[0045] As another example, according to the transaction type of the current transaction, multiple second candidate historical transactions within a preset time period before the current transaction are obtained from the transaction database, wherein the second candidate historical transactions have the same transaction type as the current transaction; from the multiple second candidate historical transactions, the second candidate historical transaction with the same payee information as the current transaction is selected as the target historical transaction. Thus, the target historical transaction is accurately obtained from the transaction database.
[0046] The preset time period is a time period pre-set according to actual needs. For example, the preset time period may be 5 minutes, 2 minutes, 3 minutes, etc. This embodiment does not specifically limit the value of the preset time period.
[0047] S103, obtaining a second transaction feature vector of the target historical transaction from a pre-established transaction feature vector library.
[0048] In some embodiments, the second transaction feature vector of the target historical transaction in the transaction feature vector library may be obtained by performing transaction feature extraction on the transaction data of the target historical transaction to obtain multiple transaction features, and vectorizing the multiple transaction features to obtain feature vectors corresponding to each of the multiple transaction features, and concatenating the feature vectors corresponding to each of the multiple transaction features to obtain the second transaction feature vector of the target historical transaction, and saving the target historical transaction and the corresponding second transaction feature vector in the transaction feature vector library.
[0049] In this embodiment, the second transaction feature vector of the target historical transaction is obtained through a pre-established transaction feature vector library, so that when performing transaction duplication detection on the current transaction, there is no need to determine the second transaction feature vector of the target historical transaction based on the transaction data of the target historical transaction, thereby improving the efficiency of obtaining the second transaction feature vector of the target historical transaction, and then improving the efficiency of determining whether the current transaction has a risk of duplicate transactions.
[0050] S104: Determine the similarity between the current transaction and the target historical transaction according to the first transaction feature vector and the second transaction feature vector.
[0051] In this embodiment, the similarity between the first transaction feature vector and the second transaction feature vector may be calculated by a preset similarity algorithm, and the similarity between the current transaction and the target historical transaction may be determined based on the similarity between the first transaction feature vector and the second transaction feature vector.
[0052] As an example, the similarity between the first transaction feature vector and the second transaction feature vector may be used as the similarity between the current transaction and the target historical transaction.
[0053] S105, comparing the similarity with the similarity threshold corresponding to the transaction type of the current transaction to determine whether the current transaction has a risk of repeated transactions.
[0054] In some embodiments, in order to accurately determine whether the current transaction has a risk of repeated transactions, a similarity threshold corresponding to the transaction type of the current transaction may be obtained; the similarity may be compared with the similarity threshold to obtain a comparison result; if the comparison result is that the similarity is greater than or equal to the similarity threshold, it is determined that the current transaction has a risk of repeated transactions; if the comparison result is that the similarity is less than the similarity threshold, it is determined that the current transaction does not have a risk of repeated transactions. Thus, based on comparing the similarity with the similarity threshold corresponding to the transaction type of the current transaction, and based on the comparison result, it is accurately determined whether the current transaction has a risk of repeated transactions.
[0055] It should be noted that the number of target historical transactions in this embodiment can be one or more.
[0056] In one embodiment of the present application, when there are multiple target historical transactions, that is, when there are multiple target historical transactions, the similarity between the current transaction and each target historical transaction can be compared with a similarity threshold, and based on the target comparison result, it is determined whether the current transaction has a risk of duplicate transactions.
[0057] In some embodiments, when the target comparison result indicates that multiple similarities are greater than or equal to the similarity threshold, it is determined that there is no risk of duplicate transaction in the current transaction; in addition, when the target comparison result indicates that at least one of the multiple similarities is less than the similarity threshold, it is determined that there is a risk of duplicate transaction in the current transaction.
[0058] In other embodiments, when the target comparison result indicates that the proportion of similarities greater than or equal to the similarity threshold among multiple similarities exceeds a preset proportion threshold, it is determined that there is no risk of duplicate transaction for the current transaction; in addition, when the target comparison result indicates that the proportion of similarities greater than or equal to the similarity threshold among multiple similarities does not exceed the preset proportion threshold, it is determined that there is a risk of duplicate transaction for the current transaction.
[0059] The preset ratio threshold is set according to actual needs, and this embodiment does not specifically limit the value of the preset ratio threshold.
[0060] In one embodiment of the present application, in order to further improve the accuracy of determining whether the current transaction has a risk of repeated transactions, correspondingly, a plurality of historical transactions of the same transaction type as the current transaction may be combined to determine the similarity threshold corresponding to the transaction type of the current transaction. Specifically, a plurality of historical transactions of the same transaction type as the current transaction may be obtained; the similarity between the plurality of historical transactions is determined based on the transaction feature vectors corresponding to each of the plurality of historical transactions; and the similarity threshold corresponding to the transaction type is determined based on the similarity. Thus, based on the similarity between the plurality of historical transactions, the similarity threshold corresponding to the transaction type of the current transaction is accurately determined.
[0061] In some embodiments, based on the similarities between multiple historical transactions, the similarity distribution of historical transactions of the transaction type is determined, and the similarity distribution is statistically analyzed to obtain the similarity threshold corresponding to the transaction type, thereby accurately determining the similarity threshold of the transaction type.
[0062] In one embodiment of the present application, in the process of performing repeated transaction risk detection on the corresponding transaction based on the similarity threshold, the corresponding false alarm rate and / or missed alarm rate when performing repeated transaction risk detection on the transaction type can also be obtained, and the similarity threshold is adaptively adjusted according to the false alarm rate and / or missed alarm rate to reduce the false alarm rate and / or missed alarm rate when performing repeated transaction risk detection on the corresponding transaction. In this way, adaptive modification of the similarity threshold is achieved, and the accuracy of repeated transaction risk detection on the corresponding transaction can be improved.
[0063] The duplicate transaction detection method provided in the embodiment of the present application, when monitoring the risk of duplicate transactions for the current transaction, determines the first transaction feature vector of the current transaction in combination with the transaction data of the current transaction, obtains the target historical transaction with the same transaction type and payer information as the current transaction, and quickly obtains the second transaction feature vector of the target historical transaction from the transaction feature vector library, and accurately determines the similarity between the current transaction and the target historical transaction based on the second transaction feature vector of the target historical transaction and the first transaction feature vector of the current transaction, and determines whether the current transaction has the risk of duplicate transactions based on the comparison result of the similarity and the similarity threshold value corresponding to the transaction type of the current transaction. Thus, the similarity between the current transaction and the target historical transaction is accurately determined through the transaction feature vectors of the current transaction and the target historical transaction, and based on the similarity and the similarity threshold value corresponding to the transaction type of the current transaction, the current transaction is accurately detected for the risk of duplicate transactions, which can effectively identify duplicate transactions, improve the accuracy of duplicate transaction detection, and reduce the risks brought by duplicate transactions.
[0064] Figure 2 The process of the repeated transaction detection method provided in the embodiment of the present application Figure 2 .
[0065] like Figure 2 As shown, the repeated transaction detection method includes the following steps:
[0066] S201, acquiring transaction data of a current transaction, and determining a first transaction feature vector of the current transaction according to the transaction data.
[0067] S202, obtaining a target historical transaction having the same transaction type and payer information as the current transaction, wherein the transaction time of the target historical transaction is within a preset time period before the current transaction.
[0068] S203, obtaining a second transaction feature vector of the target historical transaction from a pre-established transaction feature vector library.
[0069] S204: Determine the similarity between the current transaction and the target historical transaction according to the first transaction feature vector and the second transaction feature vector.
[0070] S205: Compare the similarity with the similarity threshold corresponding to the transaction type of the current transaction to determine whether the current transaction has a risk of repeated transactions.
[0071] It should be noted that, for the specific description of S201 to S205, reference may be made to the relevant description in other embodiments, which will not be repeated here.
[0072] S206, when it is determined that there is a risk of duplicate transaction in the current transaction, a duplicate transaction prompt message is sent to the terminal device corresponding to the payee information, wherein the duplicate transaction prompt message is used to prompt that there is a risk of duplicate transaction between the current transaction and the target historical transaction, and prompt whether to cancel the current transaction or the target historical transaction.
[0073] S207, canceling the target transaction according to the response result returned by the terminal device to the repeated transaction prompt information, wherein the target transaction is one of the current transaction and the target historical transaction.
[0074] In some embodiments, when the response result indicates that the current transaction is to be cancelled, the target transaction may be determined to be the current transaction, and accordingly, the current transaction may be cancelled. In other embodiments, when there is one target historical transaction and the response result indicates that the target historical transaction is to be cancelled, the target transaction may be determined to be the target historical transaction, and accordingly, the target historical transaction may be cancelled. In still other embodiments, when there are multiple target historical transactions and the response result indicates that a specified historical transaction among the multiple historical transactions is to be cancelled, the target transaction may be determined to be the specified historical transaction, and accordingly, the specified historical transaction may be cancelled.
[0075] In this embodiment, when it is determined that the current transaction has a risk of duplicate transactions, duplicate transaction prompt information is sent to the terminal device corresponding to the payee information, wherein the duplicate transaction prompt information is used to prompt that there is a risk of duplicate transactions between the current transaction and the target historical transaction, and prompt whether to cancel the current transaction or the target historical transaction; according to the response result returned by the terminal device to the duplicate transaction prompt information, the target transaction is canceled, wherein the target transaction is one of the current transaction and the target historical transaction. As a result, the transaction initiator of the current transaction can independently select the target transaction to be canceled, thereby improving the experience of the transaction initiator.
[0076] Based on the above embodiments, in some embodiments, when it is determined that the current transaction has a risk of repeated transactions, in order to allow the corresponding personnel to conveniently manually review the current transaction with the risk of repeated transactions, correspondingly, when it is determined that the current transaction has a risk of repeated transactions, a preset mark can be added to the current transaction, wherein the preset mark is used to indicate that the current transaction has a risk of repeated transactions. Thus, the corresponding personnel can learn about the current transaction with the risk of repeated transactions through the preset mark, and manually review the current transaction with the risk of repeated transactions.
[0077] It should be noted that the preset mark can be preset according to actual needs. For example, the preset mark can be one of colors, numbers, characters, etc., or a combination of multiple ones. This embodiment does not specifically limit the preset mark.
[0078] Figure 3 The process of the repeated transaction detection method provided in the embodiment of the present application Figure 3 .
[0079] like Figure 3 As shown, the repeated transaction detection method includes the following steps:
[0080] S301, acquiring transaction data of a current transaction, and determining a first transaction feature vector of the current transaction according to the transaction data.
[0081] S302, obtaining a target historical transaction having the same transaction type and payer information as the current transaction, wherein the transaction time of the target historical transaction is within a preset time period before the current transaction.
[0082] S303: Obtain a second transaction feature vector of the target historical transaction from a pre-established transaction feature vector library.
[0083] It should be noted that, for the specific description of S301 to S303, reference may be made to the relevant description in other embodiments, which will not be repeated here.
[0084] S304: Calculate the similarity between the first transaction feature vector and the second transaction feature vector using a plurality of similarity algorithms.
[0085] S305, determining the similarity between the current transaction and the target historical transaction according to the similarities calculated by the multiple similarity algorithms.
[0086] It should be noted that in different application scenarios, the similarity between the current transaction and the target historical transaction is determined in different ways according to the similarity calculated by various similarity algorithms. The example methods are as follows:
[0087] As an example, from the similarities calculated by multiple similarity algorithms, the similarity with the largest value is selected as the similarity between the current transaction and the target historical transaction.
[0088] As another example, the similarities calculated by multiple similarity algorithms are averaged, and the similarity obtained by the average processing is used as the similarity between the current transaction and the target historical transaction. Thus, by averaging multiple similarities, the similarity between the current transaction and the target historical transaction is accurately obtained.
[0089] As another example, weighted summation is performed on the similarities calculated by multiple similarity algorithms to obtain the similarity between the current transaction and the target historical transaction, thereby accurately obtaining the similarity between the current transaction and the target historical transaction.
[0090] Among them, the weights corresponding to various similarity algorithms are pre-set.
[0091] Among them, the similarity algorithm in this embodiment is pre-set according to actual needs. For example, the multiple similarity algorithms can be at least two of the following: cosine similarity algorithm, Euclidean distance similarity algorithm, Manhattan distance, Pearson correlation coefficient algorithm, etc.
[0092] S306: Compare the similarity with the similarity threshold corresponding to the transaction type of the current transaction to determine whether the current transaction has a risk of repeated transactions.
[0093] It should be noted that, for the specific description of S306, reference may be made to the relevant descriptions in other embodiments, which will not be repeated here.
[0094] In this embodiment, the similarity between the first transaction feature vector and the second transaction feature vector is calculated by using a plurality of similarity algorithms, and the similarity between the current transaction and the target historical transaction is determined based on the similarity calculated by the plurality of similarity algorithms. Thus, the similarity between the current transaction and the target historical transaction is accurately determined, thereby improving the accuracy of repeated transaction risk detection based on the similarity.
[0095] It should be noted that, based on any of the above embodiments, in order to further determine whether the current transaction has a risk of repeated transactions, before performing repeated transaction risk detection on the current transaction based on the target historical transaction, the current transaction can also be processed by an existing repeated transaction risk detection method, and when it is determined that the current transaction does not have a risk of repeated transactions, the current transaction can be processed based on the method disclosed in the embodiment. For example, before processing the current transaction based on the method disclosed in the embodiment, the transaction database can also be queried based on the transaction identifier of the current transaction to determine whether there is transaction data of the transaction identifier in the transaction database. If so, it is determined that the current transaction has a risk of repeated transactions. If not, it is determined that the current transaction does not have a risk of repeated transactions, and the current transaction is processed based on the method disclosed in the embodiment.
[0096] Figure 4 This is a schematic diagram of the structure of a repeated transaction detection device provided in an embodiment of the present application. It should be noted that the device is configured in a financial transaction system, and the financial transaction system can be configured in an electronic device.
[0097] like Figure 4 As shown, the repeated transaction detection device 400 may include:
[0098] The first determination module 401 acquires transaction data of a current transaction, and determines a first transaction feature vector of the current transaction according to the transaction data.
[0099] The first acquisition module 402 is used to acquire a target historical transaction having the same transaction type and payer information as the current transaction, wherein the transaction time of the target historical transaction is within a preset time period before the current transaction.
[0100] The second acquisition module 403 is used to acquire a second transaction feature vector of a target historical transaction from a pre-established transaction feature vector library.
[0101] The second determination module 404 is configured to determine the similarity between the current transaction and the target historical transaction according to the first transaction feature vector and the second transaction feature vector.
[0102] The third determination module 405 is used to compare the similarity with the similarity threshold corresponding to the transaction type of the current transaction to determine whether the current transaction has a risk of repeated transactions.
[0103] In one embodiment of the present application, the first acquisition module 402 is specifically used to: acquire, from a transaction database, a plurality of first candidate historical transactions within a preset time period before the current transaction based on the payer information of the current transaction, wherein the first candidate historical transactions have the same payer information as the current transaction; and select, from the plurality of first candidate historical transactions, a first candidate historical transaction having the same transaction type as the current transaction as the target historical transaction.
[0104] In one embodiment of the present application, the first acquisition module 402 is specifically used to: acquire, from a transaction database, a plurality of second candidate historical transactions within a preset time period before the current transaction according to the transaction type of the current transaction, wherein the second candidate historical transactions have the same transaction type as the current transaction; and select, from the plurality of second candidate historical transactions, a second candidate historical transaction having the same payer information as the current transaction as the target historical transaction.
[0105] In one embodiment of the present application, the second determination module 404 is specifically used to: calculate the similarity between the first transaction feature vector and the second transaction feature vector using multiple similarity algorithms; and determine the similarity between the current transaction and the target historical transaction based on the similarities calculated using the multiple similarity algorithms.
[0106] In one embodiment of the present application, the similarity between the current transaction and the target historical transaction is determined based on the similarities calculated by multiple similarity algorithms, including: selecting the similarity with the largest value from the similarities calculated by multiple similarity algorithms as the similarity between the current transaction and the target historical transaction; or, averaging the similarities calculated by multiple similarity algorithms, and using the similarity obtained by the averaging as the similarity between the current transaction and the target historical transaction; or, weighted summing the similarities calculated by multiple similarity algorithms to obtain the similarity between the current transaction and the target historical transaction.
[0107] In one embodiment of the present application, the first determination module 401 determines the first transaction feature vector of the current transaction based on the transaction data in the following specific manner: extracting features from the transaction data to obtain multiple transaction features; vectorizing the multiple transaction features respectively to obtain feature vectors corresponding to the multiple transaction features; and concatenating the feature vectors corresponding to the multiple transaction feature vectors to obtain the first transaction feature vector.
[0108] In one embodiment of the present application, the third determination module 405 is specifically used to: obtain a similarity threshold corresponding to the transaction type of the current transaction; compare the similarity with the similarity threshold to obtain a comparison result; when the comparison result is that the similarity is greater than or equal to the similarity threshold, determine that the current transaction has a risk of repeated transactions; when the comparison result is that the similarity is less than the similarity threshold, determine that the current transaction does not have a risk of repeated transactions.
[0109] In one embodiment of the present application, the device may further include:
[0110] The marking module is used to add a preset mark to the current transaction when it is determined that the current transaction has a risk of repeated transactions, wherein the preset mark is used to indicate that the current transaction has a risk of repeated transactions.
[0111] In one embodiment of the present application, the device may further include:
[0112] A sending module, configured to send duplicate transaction prompt information to the terminal device corresponding to the payee information when it is determined that the current transaction has a duplicate transaction risk, wherein the duplicate transaction prompt information is used to prompt that there is a duplicate transaction risk between the current transaction and the target historical transaction, and prompt whether to cancel the current transaction or the target historical transaction;
[0113] The cancellation module is used to cancel the target transaction according to the response result returned by the terminal device to the repeated transaction prompt information, wherein the target transaction is one of the current transaction and the target historical transaction.
[0114] In one embodiment of the present application, the similarity threshold is obtained in the following manner: obtaining multiple historical transactions of the same transaction type as the current transaction; determining the similarity between the multiple historical transactions based on the transaction feature vectors corresponding to each of the multiple historical transactions; and determining the similarity threshold corresponding to the transaction type based on the similarity.
[0115] The repeated transaction detection device provided in the embodiment of the present application can be used to execute the technical solution of the repeated transaction detection method in the above embodiment. Its implementation principle and technical effect are similar and will not be repeated here.
[0116] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the second determination module 404 can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The function of the second determination module 404. The implementation of other modules is similar. In addition, all or part of these modules can be integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.
[0117] Figure 5 The electronic device in this embodiment may be a terminal device or a server.
[0118] like Figure 5 As shown, the electronic device may include: a transceiver 121 , a processor 122 , and a memory 123 .
[0119] The processor 122 executes the computer execution instructions stored in the memory, so that the processor 122 executes the scheme in the above embodiment. The processor 122 can be a general-purpose processor, including a central processing unit CPU, a network processor (network processor, NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0120] The memory 123 is connected to the processor 122 via a system bus and completes communication between them. The memory 123 is used to store computer program instructions.
[0121] The transceiver 121 may be used to obtain transaction data of a current transaction.
[0122] The system bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The transceiver is used to realize the communication between the database access device and other computers (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM) and may also include non-volatile memory.
[0123] An embodiment of the present application also provides a chip for running instructions, which is used to execute the technical solution of the repeated transaction detection method in the above embodiment.
[0124] An embodiment of the present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the technical solution of the duplicate transaction detection method in the above embodiment.
[0125] An embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When at least one processor executes the computer program, it can implement the technical solution of the duplicate transaction detection method in the above embodiment.
[0126] The electronic device, chip, computer-readable storage medium, and computer program product provided in the embodiments of the present application can be used to execute the technical solutions of the task processing methods in the above embodiments. Their implementation principles and technical effects are similar and will not be repeated here.
[0127] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0128] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A repeated transaction detection method, characterized in that: The method comprises: Acquire transaction data of a current transaction, and determine a first transaction feature vector of the current transaction based on the transaction data; Acquire a target historical transaction having the same transaction type and payer information as the current transaction, wherein the transaction time of the target historical transaction is within a preset time period before the current transaction; Acquire a second transaction feature vector of the target historical transaction from a pre-established transaction feature vector library; determining, according to the first transaction feature vector and the second transaction feature vector, a similarity between the current transaction and a target historical transaction; The similarity is compared with a similarity threshold corresponding to the transaction type of the current transaction to determine whether the current transaction has a risk of repeated transactions.
2. The method according to claim 1, characterized in that The acquiring of a target historical transaction having the same transaction type and payer information as the current transaction includes: According to the payee information of the current transaction, obtaining from a transaction database a plurality of first candidate historical transactions within a preset time period before the current transaction, wherein the first candidate historical transactions have the same payee information as the current transaction; A first candidate historical transaction having the same transaction type as the current transaction is selected from the multiple first candidate historical transactions as the target historical transaction.
3. The method according to claim 2, characterized in that The acquiring of a target historical transaction having the same transaction type and payer information as the current transaction includes: According to the transaction type of the current transaction, acquiring from a transaction database a plurality of second candidate historical transactions within a preset time period before the current transaction, wherein the second candidate historical transactions have the same transaction type as the current transaction; From the multiple second candidate historical transactions, a second candidate historical transaction having the same payer information as the current transaction is selected as the target historical transaction.
4. The method according to claim 1, characterized in that The determining, according to the first transaction feature vector and the second transaction feature vector, the similarity between the current transaction and the target historical transaction includes: Calculating the similarity between the first transaction feature vector and the second transaction feature vector using a plurality of similarity algorithms; The similarity between the current transaction and the target historical transaction is determined according to the similarities calculated by the multiple similarity algorithms.
5. The method according to claim 4, characterized in that Determining the similarity between the current transaction and the target historical transaction according to the similarities calculated by the multiple similarity algorithms includes: Selecting the largest similarity from the similarities calculated by the multiple similarity algorithms as the similarity between the current transaction and the target historical transaction; or averaging the similarities obtained by the plurality of similarity algorithms, and using the similarity obtained by the averaging as the similarity between the current transaction and the target historical transaction; or, A weighted sum is performed on the similarities obtained by calculating the multiple similarity algorithms to obtain the similarity between the current transaction and the target historical transaction.
6. The method according to claim 1, characterized in that The determining, according to the transaction data, a first transaction feature vector of the current transaction includes: Extracting features from the transaction data to obtain multiple transaction features; Vectorizing the plurality of transaction features respectively to obtain feature vectors corresponding to the plurality of transaction features; The feature vectors corresponding to the multiple transaction feature vectors are concatenated to obtain the first transaction feature vector.
7. The method according to claim 1, characterized in that The comparing the similarity with a similarity threshold corresponding to the transaction type of the current transaction to determine whether the current transaction has a risk of repeated transactions includes: Obtaining a similarity threshold corresponding to the transaction type of the current transaction; Comparing the similarity with the similarity threshold to obtain a comparison result; When the comparison result shows that the similarity is greater than or equal to the similarity threshold, determining that the current transaction has a risk of repeated transactions; When the comparison result is that the similarity is less than the similarity threshold, it is determined that there is no risk of repeated transaction in the current transaction.
8. The method according to claim 1 or 7, characterized in that The method further comprises: In the case where it is determined that the current transaction has a risk of repeated transactions, a preset mark is added to the current transaction, wherein the preset mark is used to indicate that the current transaction has a risk of repeated transactions.
9. The method according to claim 1 or 7, characterized in that: The method further comprises: In the case where it is determined that the current transaction has a risk of duplicate transactions, sending duplicate transaction prompt information to the terminal device corresponding to the payer information, wherein the duplicate transaction prompt information is used to prompt that there is a risk of duplicate transactions between the current transaction and the target historical transaction, and prompt whether to cancel the current transaction or the target historical transaction; According to the response result returned by the terminal device to the repeated transaction prompt information, the target transaction is canceled, wherein the target transaction is one of the current transaction and the target historical transaction.
10. The method according to claim 1, characterized in that The similarity threshold is obtained by: Acquire multiple historical transactions of the same transaction type as the current transaction; Determining similarities between two of the plurality of historical transactions according to the transaction feature vectors corresponding to the plurality of historical transactions; A similarity threshold corresponding to the transaction type is determined according to the similarity.
11. A repeated transaction detection device, characterized in that: The method comprises: A first determination module, which obtains transaction data of a current transaction and determines a first transaction feature vector of the current transaction according to the transaction data; A first acquisition module is used to acquire a target historical transaction having the same transaction type and payer information as the current transaction, wherein the transaction time of the target historical transaction is within a preset time period before the current transaction; A second acquisition module, configured to acquire a second transaction feature vector of the target historical transaction from a pre-established transaction feature vector library; a second determining module, configured to determine a similarity between the current transaction and a target historical transaction according to the first transaction feature vector and the second transaction feature vector; The third determination module is used to compare the similarity with a similarity threshold corresponding to the transaction type of the current transaction to determine whether the current transaction has a risk of repeated transactions.
12. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 10 when executed by a processor.
14. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 10 when being executed by a processor.
